Skip to content

Commit

Permalink
Release 6.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Masquerade-Circus committed Mar 18, 2022
1 parent 3a8e780 commit d7fbca1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
### [6.0.6](https://github.com/Masquerade-Circus/valyrian.js/compare/6.0.5...6.0.6) (2022-03-17)
### [6.0.7](https://github.com/Masquerade-Circus/valyrian.js/compare/6.0.6...6.0.7) (2022-03-18)


### Bug Fixes

* **v-model:** fix v-model directive not working ([3a8e780](https://github.com/Masquerade-Circus/valyrian.js/commit/3a8e7800e9291b177889b1da37f8286234d5094b))

### [6.0.6](https://github.com/Masquerade-Circus/valyrian.js/compare/6.0.5...6.0.6) (2022-03-17)

### Bug Fixes

* **router:** fix pushState error ([9cee5a9](https://github.com/Masquerade-Circus/valyrian.js/commit/9cee5a994020665a6c8091aed6d2ef2e20c0bf9c))
* **router:** fix pushState error ([9cee5a9](https://github.com/Masquerade-Circus/valyrian.js/commit/9cee5a994020665a6c8091aed6d2ef2e20c0bf9c))

### [6.0.5](https://github.com/Masquerade-Circus/valyrian.js/compare/6.0.4...6.0.5) (2022-03-17)

Expand Down
20 changes: 10 additions & 10 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __export = (target, all) => {
for (var name in all) __defProp(target, name, { get: all[name], enumerable: true });
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __reExport = (target, module2, copyDefault, desc) => {
if ((module2 && typeof module2 === "object") || typeof module2 === "function") {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
Expand All @@ -16,7 +17,7 @@ var __reExport = (target, module2, copyDefault, desc) => {
};
var __toCommonJS = /* @__PURE__ */ ((cache) => {
return (module2, temp) => {
return (cache && cache.get(module2)) || ((temp = __reExport(__markAsModule({}), module2, 1)), cache && cache.set(module2, temp), temp);
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
};
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);

Expand All @@ -38,7 +39,7 @@ function isVnode(object) {
return object instanceof Vnode;
}
function isComponent(component) {
return typeof component === "function" || (typeof component === "object" && component !== null && "view" in component);
return typeof component === "function" || typeof component === "object" && component !== null && "view" in component;
}
function isVnodeComponent(vnode) {
return vnode instanceof Vnode && vnode.tag === ComponentString;
Expand All @@ -62,7 +63,7 @@ function domToVnode(dom) {
}
}
let props = {};
[].forEach.call(dom.attributes, (prop) => (props[prop.nodeName] = prop.nodeValue));
[].forEach.call(dom.attributes, (prop) => props[prop.nodeName] = prop.nodeValue);
let vnode = v(dom.tagName.toLowerCase(), props, ...children);
vnode.dom = dom;
return vnode;
Expand Down Expand Up @@ -306,7 +307,7 @@ function patch(newVnode, oldVnode = emptyVnode) {
let shouldPatch = true;
if (oldChildVnode) {
childVnode.dom = oldChildVnode.dom;
if ("v-once" in childVnode.props || (childVnode.props.shouldupdate && childVnode.props.shouldupdate(childVnode, oldChildVnode) === false)) {
if ("v-once" in childVnode.props || childVnode.props.shouldupdate && childVnode.props.shouldupdate(childVnode, oldChildVnode) === false) {
childVnode.children = oldChildVnode.children;
shouldPatch = false;
} else {
Expand Down Expand Up @@ -358,7 +359,7 @@ function patch(newVnode, oldVnode = emptyVnode) {
}
if (oldChildVnode.tag === newChildVnode.tag) {
newChildVnode.dom = oldChildVnode.dom;
if (newChildVnode.props["v-once"] || (newChildVnode.props.shouldupdate && newChildVnode.props.shouldupdate(newChildVnode, oldChildVnode) === false)) {
if (newChildVnode.props["v-once"] || newChildVnode.props.shouldupdate && newChildVnode.props.shouldupdate(newChildVnode, oldChildVnode) === false) {
newChildVnode.children = oldChildVnode.children;
continue;
}
Expand Down Expand Up @@ -438,7 +439,6 @@ var directives = {
"v-model": ([model, property, event], vnode, oldVnode) => {
let value;
let handler;
console.log(vnode);
if (vnode.tag === "input") {
event = event || "oninput";
switch (vnode.props.type) {
Expand All @@ -464,7 +464,7 @@ var directives = {
};
value = model[property] === vnode.props.value;
} else {
handler = () => (model[property] = !model[property]);
handler = () => model[property] = !model[property];
value = model[property];
}
setAttribute("checked", value, vnode, oldVnode);
Expand Down Expand Up @@ -515,7 +515,7 @@ var directives = {
}
if (!vnode.props[event]) {
if (!handler) {
handler = (e) => (model[property] = e.target.value);
handler = (e) => model[property] = e.target.value;
}
setAttribute(event, handler, vnode, oldVnode);
}
Expand Down
9 changes: 5 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ var reservedProps = {
"v-for": true,
"v-show": true,
"v-class": true,
"v-html": true
"v-html": true,
"v-model": true
};
var eventListenerNames = {};
var onCleanupList = [];
Expand Down Expand Up @@ -411,7 +412,7 @@ var directives = {
"v-model": ([model, property, event], vnode, oldVnode) => {
let value;
let handler;
if (vnode.name === "input") {
if (vnode.tag === "input") {
event = event || "oninput";
switch (vnode.props.type) {
case "checkbox": {
Expand Down Expand Up @@ -450,7 +451,7 @@ var directives = {
setAttribute("value", model[property], vnode, oldVnode);
}
}
} else if (vnode.name === "select") {
} else if (vnode.tag === "select") {
event = event || "onclick";
if (vnode.props.multiple) {
handler = (e) => {
Expand Down Expand Up @@ -481,7 +482,7 @@ var directives = {
}
});
}
} else if (vnode.name === "textarea") {
} else if (vnode.tag === "textarea") {
event = event || "oninput";
vnode.children = [model[property]];
}
Expand Down
Loading

0 comments on commit d7fbca1

Please sign in to comment.