Comparing version 1.2.4 to 1.2.5
/* | ||
https://github.com/leeoniya/domvm (1.2.4) | ||
https://github.com/leeoniya/domvm (1.2.5) | ||
*/ | ||
@@ -11,6 +11,6 @@ ("undefined"!==typeof global?global:this).domvm={};(function(x){var r=("undefined"==typeof window?{}:window).requestAnimationFrame,w={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,counterIncrement:!0,fillOpacity:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,"float":!0,fontWeight:!0,gridColumn:!0,lineHeight:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0,tabSize:!0,transform:!0,transformOrigin:!0,widows:!0,zIndex:!0,zoom:!0},f={TYPE_ELEM:1, | ||
(t.type!==a.type||t.tag!==a.tag))var E=null,v=!0,u=a.el.parentNode;z(t,E);A&&(A.body[e]=t);c&&(a&&n(a),!a&&B||p(t,null,t.el),v&&(u||t.parent.el).insertBefore(t.el,u.childNodes[a.idx]));a&&d(q,"didRedraw",q);!1!==c&&l.tick(r,2);return q}var B=!A;l.isArr(b)&&(g=b[1],k=b[2],a=b[3],b=b[0]);k=w(g,k);var q={api:{},node:null,view:[b,k],model:g,opts:a||{},render:null,update:function(b,e){null==b||k===g&&!l.isVal(k)||(g=q.model=b);return!1!==e?f(0):q},on:function(b,g){t(q.events,b,g)},hook:function(b,g){q.hooks= | ||
q.hooks||{};t(q.hooks,b,g)},events:{},hooks:null,redraw:J.useRaf?l.raft(f):f,patch:function(b,g){var e=null!=b.el;if(l.isObj(g)){var k="class"in g?(u(b["class"])+" "+u(g["class"])).trim():b.props["class"],c="style"in g?g.style:b.props.style;e&&(e=Object.create(b.props),e["class"]=k,e.style=c,e={tag:b.tag,el:b.el,ns:b.ns,props:e},h(e,b));b.props["class"]=k;b.props.style=c}else k=b.parent,e=z(m(g,k,b.idx,q),b),k.body[b.idx]=e},emit:function(b){for(var g=Array.prototype.slice.call(arguments),e=q,k;e;){if(k= | ||
e.events[b]){g[0]=k;l.execAll.apply(null,g);break}e=e.parent}},refs:{},parent:null,body:[],mount:function(b,g){var e=null;g&&(b.textContent="",e=b,b=null);p(q.node,e,null,b);return q},attach:function(b){c(q.node,b);return q},unmount:function(){n(q.node)},moveTo:v,updIdx:function(b){e=b}};a&&a.hooks&&q.hook(a.hooks);l.execAll(G,q);q.render=b.call(q.api,q,g,k);return A?v(A,e):f(0)}function c(b,g){b.el=g;g._node=b;for(var k in b.props){var a=b.props[k],A=l.isEvProp(k)?k:"."===k[0]?k.substr(1):null;null!== | ||
A&&(g[A]=a)}if(l.isArr(b.body))for(k=0;k<b.body.length;k++)c(b.body[k],g.childNodes[k])}function d(b,g,k,c,a,e){if(b&&b.hooks&&(b=b.hooks[g]))if(J.useRaf&&"did"==g.substr(0,3))I.push([l.execAll,b,k,c,a,e]);else return l.execAll(b,k,c,a,e)}function n(b,g){var k=b.el&&!b.moved;if(k){var c=d(b.vm,"willUnmount",b.vm),A=d(b,"willRemove",b),e=c||A;b.removed=!0}b.wasSame?b.wasSame=!1:(l.isArr(b.body)&&b.body.forEach(function(b,k){n(b,g||e)}),g||(e?e.then(function(){a(b,k)}):a(b,k)));b.moved=!1}function a(b, | ||
g){null!=b.el&&b.el.parentNode&&(g&&(b.el.parentNode.removeChild(b.el),b.el=null,d(b.vm,"didUnmount",b.vm),d(b,"didRemove",b)),l.isArr(b.body)&&b.body.forEach(function(b,g){a(b,!b.moved)}));K.push(b)}function m(b,g,k,c,a){var e=b;b=0<K.length?K.pop():{type:null,key:null,ref:null,idx:null,parent:null,moved:!1,wasSame:!1,removed:!1,hooks:null,tag:null,"class":null,ns:null,guard:!1,raw:!1,props:null,el:null,hasKeys:!1,body:null};b.el=b.key=b.vm=b.body=b.props=null;b.moved=b.wasSame=b.removed=!1;l.isFunc(e)&& | ||
q.hooks||{};t(q.hooks,b,g)},events:{},hooks:null,redraw:J.useRaf?l.raft(f):f,patch:function(b,g){var e=null!=b.el;if(l.isObj(g)){b.props=b.props||{};var k="class"in g?(u(b["class"])+" "+u(g["class"])).trim():b.props["class"],c="style"in g?g.style:b.props.style;e&&(e=Object.create(b.props),e["class"]=k,e.style=c,e={tag:b.tag,el:b.el,ns:b.ns,props:e},h(e,b));b.props["class"]=k;b.props.style=c}else k=b.parent,e=z(m(g,k,b.idx,q),b),k.body[b.idx]=e},emit:function(b){for(var g=Array.prototype.slice.call(arguments), | ||
e=q,k;e;){if(k=e.events[b]){g[0]=k;l.execAll.apply(null,g);break}e=e.parent}},refs:{},parent:null,body:[],mount:function(b,g){var e=null;g&&(b.textContent="",e=b,b=null);p(q.node,e,null,b);return q},attach:function(b){c(q.node,b);return q},unmount:function(){n(q.node)},moveTo:v,updIdx:function(b){e=b}};a&&a.hooks&&q.hook(a.hooks);l.execAll(G,q);q.render=b.call(q.api,q,g,k);return A?v(A,e):f(0)}function c(b,g){b.el=g;g._node=b;for(var k in b.props){var a=b.props[k],A=l.isEvProp(k)?k:"."===k[0]?k.substr(1): | ||
null;null!==A&&(g[A]=a)}if(l.isArr(b.body))for(k=0;k<b.body.length;k++)c(b.body[k],g.childNodes[k])}function d(b,g,k,c,a,e){if(b&&b.hooks&&(b=b.hooks[g]))if(J.useRaf&&"did"==g.substr(0,3))I.push([l.execAll,b,k,c,a,e]);else return l.execAll(b,k,c,a,e)}function n(b,g){var k=b.el&&!b.moved;if(k){var c=d(b.vm,"willUnmount",b.vm),A=d(b,"willRemove",b),e=c||A;b.removed=!0}b.wasSame?b.wasSame=!1:(l.isArr(b.body)&&b.body.forEach(function(b,k){n(b,g||e)}),g||(e?e.then(function(){a(b,k)}):a(b,k)));b.moved= | ||
!1}function a(b,g){K.push(b);null!=b.el&&b.el.parentNode&&g&&(b.el.parentNode.removeChild(b.el),b.el=null,d(b.vm,"didUnmount",b.vm),d(b,"didRemove",b))}function m(b,g,k,c,a){var e=b;b=0<K.length?K.pop():{type:null,key:null,ref:null,idx:null,parent:null,moved:!1,wasSame:!1,removed:!1,hooks:null,tag:null,"class":null,ns:null,guard:!1,raw:!1,props:null,el:null,hasKeys:!1,body:null,data:null,diff:null};b.el=b.key=b.ref=b.data=b.diff=b.vm=b.body=b.props=null;b.raw=b.moved=b.wasSame=b.removed=!1;l.isFunc(e)&& | ||
(e=e());var t=e.length;if(l.isArr(e)&&t){b.type=l.TYPE_ELEM;if(1<t){var h=1;!l.isObj(e[1])||e[1].redraw||l.isElem(e[1])||(b.props=e[1],h=2);b.body=t==h+1?l.isVal(e[h])?e[h]:l.isFunc(e[h])?e[h]():e.slice(h):e.slice(h)}e=e[0];t=N[e];t||(t=["",""],t={tag:(e.match(/^[-\w]+/)||["div"])[0],id:(e.match(/#([-\w]+)/)||t)[1],"class":(e.match(/\.([-\w.]+)/)||t)[1].replace(/\./g," ")},N[e]=t);b.tag=t.tag;if(t.id||t["class"])e=b.props||{},t.id&&null==e.id&&(e.id=t.id),t["class"]&&(b["class"]=t["class"],e["class"]= | ||
@@ -17,0 +17,0 @@ t["class"]+(null!=e["class"]?" "+e["class"]:"")),b.props=e;if(b.props){var e=b.props,d;for(d in e)!l.isEvProp(d)&&l.isFunc(e[d])&&("href"==d?(e.onclick=e[d],e.href=e[d].href):e[d]=e[d]()),l.isDynProp(b.tag,d)&&(e["."+d]=e[d]);if(l.isObj(e.style))for(var m in e.style)d=e.style[m],l.isFunc(d)&&(e.style[m]=d());l.isObj(e._hooks)&&(b.hooks=e._hooks,e._hooks=null);b.key=l.isVal(e._key)?e._key:l.isVal(e._ref)?e._ref:l.isVal(e.id)?e.id:l.isVal(e.name)?e.name:null;null!=e._ref&&(b.ref=e._ref);e._raw&&(b.raw= |
@@ -7,3 +7,3 @@ { | ||
"author": "Leon Sorokin <leeoniya@gmail.com>", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"main": "index.js", | ||
@@ -10,0 +10,0 @@ "repository": { |
@@ -196,2 +196,4 @@ (function(domvm) { | ||
if (u.isObj(newTpl)) { | ||
targNode.props = targNode.props || {}; | ||
// (won't work to removeAttr class/style attrs via setting to false) | ||
@@ -419,6 +421,6 @@ var cls = "class" in newTpl ? ((coerceEmpty(targNode.class) + " ") + coerceEmpty(newTpl.class)).trim() : targNode.props.class; | ||
function removeNode(node, removeSelf) { | ||
if (node.el == null || !node.el.parentNode) { | ||
free(node); | ||
free(node); | ||
if (node.el == null || !node.el.parentNode) | ||
return; | ||
} | ||
@@ -435,12 +437,3 @@ if (removeSelf) { | ||
var resRem = fireHook(node, "didRemove", node); | ||
} | ||
if (u.isArr(node.body)) { | ||
node.body.forEach(function(n, i) { | ||
removeNode(n, !n.moved); | ||
}); | ||
} | ||
free(node); | ||
} | ||
@@ -861,2 +854,4 @@ | ||
body: null, | ||
data: null, | ||
diff: null, | ||
}; | ||
@@ -866,2 +861,5 @@ | ||
node.key = | ||
node.ref = | ||
node.data = | ||
node.diff = | ||
node.vm = | ||
@@ -871,2 +869,3 @@ node.body = | ||
node.raw = | ||
node.moved = | ||
@@ -873,0 +872,0 @@ node.wasSame = |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
750354
0