Comparing version 0.0.24 to 0.0.25
@@ -7,2 +7,6 @@ # Change Log | ||
## [0.0.25] - 2018-05-17 | ||
- **Fixed** deep state updating issue | ||
- **Fixed** svg animation start issue | ||
## [0.0.24] - 2018-05-16 | ||
@@ -9,0 +13,0 @@ - **Improvement** deep state updating |
@@ -1,2 +0,2 @@ | ||
// [DOZ] Build version: 0.0.24 | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Doz",[],t):"object"==typeof exports?exports.Doz=t():e.Doz=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=10)}([function(e,t,r){"use strict";e.exports={ROOT:"__DOZ_GLOBAL_COMPONENTS__",INSTANCE:"__DOZ_INSTANCE__",NS:{SVG:"http://www.w3.org/2000/svg"},TAG:{ROOT:"doz-root",EACH:"doz-each-root",VIEW:"doz-view",EMPTY:"doz-empty",SUFFIX_ROOT:"-root"},REGEX:{IS_CUSTOM_TAG:/^\w+-[\w-]+$/,IS_CUSTOM_TAG_STRING:/<\w+-[\w-]+/,IS_BIND:/^d-bind$/,IS_REF:/^d-ref$/,IS_ALIAS:/^d:alias$/,IS_STORE:/^d:store$/,IS_COMPONENT_LISTENER:/^d:on-(\w+)$/,IS_LISTENER:/^on/,IS_ID_SELECTOR:/^#[\w-_:.]+$/,IS_PARENT_METHOD:/^parent.(.*)/,IS_STRING_QUOTED:/^"\w+"/,GET_LISTENER:/^this.(.*)\((.*)\)/,TRIM_QUOTES:/^["'](.*)["']$/},ATTR:{BIND:"d-bind",REF:"d-ref",ALIAS:"d:alias",STORE:"d:store",LISTENER:"d:on",ID:"d:id",FORCE_UPDATE:"forceupdate"}}},function(e,t,r){"use strict";function n(){return window[u]=window[u]||{components:{}},window[u].components}function o(e){var t=n(),r=e.tag.toUpperCase();if(t.hasOwnProperty(r))throw new Error("Component "+r+" already defined");t[r]=e}function i(){window[u]&&(window[u].components={})}function a(e){if("string"!=typeof e)throw new TypeError("tag must be a string");return e=e.toUpperCase(),n()[e]}var c=r(0),u=c.ROOT;e.exports={register:o,get:a,removeAll:i}},function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(var o in t)t.hasOwnProperty(o)&&-1===r.indexOf(o)&&(e.hasOwnProperty(o)&&void 0!==e[o]?"object"===i(e[o])&&n(e[o],t[o]):e[o]=t[o]);return e}function o(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t[0]=Object.assign({},t[0]),n.apply(this,t)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=n,e.exports.copy=o},function(e,t,r){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new TypeError("Tag must be a string");if(!h.IS_CUSTOM_TAG.test(e))throw new TypeError("Tag must contain a dash (-) like my-component");var r={};r.tag=e,r.cfg=l.copy(t,{updateChildrenProps:!0,props:{},template:function(){return"<div></div>"}}),f(r)}function o(){function e(o){for(var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o;){var c=t.autoCmp||m.get(o.nodeName)||t.view._components[o.nodeName.toLowerCase()];if(c){var u=w(o),l=C(u),s=i(c,{root:o,view:t.view,props:u,dProps:l,parentCmp:a.cmp});if(!s)continue;if(s.render(!0),r||(r=s),o.insertBefore(s._rootElement,o.firstChild),g.callRender(s),n=s,a.cmp){var f=Object.keys(a.cmp.children).length;a.cmp.children[s.alias?s.alias:f++]=s}t.autoCmp=null}o.hasChildNodes()&&e(o.firstChild,{cmp:n}),o=o.nextSibling}}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.template="string"==typeof t.template?p.create(t.template):t.template,t.root.appendChild(t.template);var r=null,n=void 0;return e(t.template),r}function i(e,t){var r=l.copy(t.props,"function"==typeof e.cfg.props?e.cfg.props():e.cfg.props),n=Object.defineProperties({},{_isCreated:{value:!1,writable:!0},_prevTpl:{value:null,writable:!0},_prev:{value:null,writable:!0},_prevProps:{value:null,writable:!0},_rootElement:{value:null,writable:!0},_boundElements:{value:{},writable:!0},_callback:{value:t.dProps.callback,writable:!0},_cache:{value:new Map},_loops:{value:{},writable:!0},_publicProps:{value:Object.assign({},t.props)},_processing:{value:[],writable:!0},_dynamicChildren:{value:[],writable:!0},beginSafeRender:{value:function(){N.beginRender(this.props)},enumerable:!0},endSafeRender:{value:function(){N.endRender(this.props)},enumerable:!0},view:{value:t.view,enumerable:!0},parent:{value:t.parentCmp,enumerable:!0},ref:{value:{},writable:!0,enumerable:!0},children:{value:{},writable:!0,enumerable:!0},tag:{value:e.tag,enumerable:!0},emit:{value:function(e){if(this._callback&&void 0!==this._callback[e]&&void 0!==this.parent[this._callback[e]]&&"function"==typeof this.parent[this._callback[e]]){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.parent[this._callback[e]].apply(this.parent,r)}},enumerable:!0},each:{value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=void 0;return Array.isArray(e)&&(r&&this.beginSafeRender(),n=e.map(t).map(function(e){if("string"==typeof e)return e.trim()}).join(""),r&&this.endSafeRender()),n},enumerable:!0},getStore:{value:function(e){return this.view.getStore(e)},enumerable:!0},getComponentById:{value:function(e){return this.view.getComponentById(e)},enumerable:!0},action:{value:t.view.action,enumerable:!0},render:{value:function(e){this.beginSafeRender();var r=this.template().trim();this.endSafeRender();var n=p.create(r,v.ROOT),o=_(n),i=S(t.root,o,this._prev,0,this,e);u(this),!this._rootElement&&i&&(this._rootElement=i),this._prev=o},enumerable:!0},mount:{value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this._rootElement;return"string"==typeof t.selector?r=r.querySelector(t.selector):t.selector instanceof HTMLElement&&(r=t.selector),this.view.mount(e,r,this)},enumerable:!0},destroy:{value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(t||this._rootElement&&!1!==g.callBeforeDestroy(this)&&this._rootElement.parentNode)&&(Object.keys(this.children).forEach(function(t){e.children[t].destroy()}),t?this._rootElement.parentNode.innerHTML="":this._rootElement.parentNode.parentNode.removeChild(this._rootElement.parentNode),g.callDestroy(this))},enumerable:!0}});if(a(n,e.cfg,t.dProps),!1!==g.callBeforeCreate(n))return b.create(n,r),T.create(n),O.create(n),g.callCreate(n),n._isCreated=!0,n}function a(e,t,r){Object.assign(e,t,r)}function c(e){for(var t=e._dynamicChildren.length-1;t>=0;){var r=e._dynamicChildren[t];!document.body.contains(r)&&r[y]&&(r[y].destroy(!0),e._dynamicChildren.splice(t,1)),t-=1}}function u(e){c(e);for(var t=e._processing.length-1;t>=0;){var r=e._processing[t],n=r.node.parentNode;r.node[y]&&r.node[y].destroy(!0);var i=o({root:n,template:r.node.outerHTML,view:e.view});e._dynamicChildren.push(i._rootElement.parentNode),n.replaceChild(i._rootElement.parentNode,r.node),i._rootElement.parentNode[y]=i,e._processing.splice(t,1),t-=1}}var l=r(2),s=r(1),f=s.register,p=r(4),d=r(0),h=d.REGEX,v=d.TAG,y=d.INSTANCE,m=r(1),b=r(14),g=r(6),E=r(7),_=E.transform,w=E.serializeProps,S=r(9).updateElement,T=r(18),O=r(19),x=r(20),C=x.extract,N=r(5);e.exports={component:n,getInstances:o}},function(e,t,r){"use strict";var n=/\n/g,o=/\s+/g,i={create:function(e,t){var r=void 0;e=e.replace(n," "),e=e.replace(o," ");var i=document.createElement("div");if(i.innerHTML=e,i.childNodes.length>1?(r=document.createElement(t),r.innerHTML=i.innerHTML):r=i.firstChild||document.createTextNode(""),!this.isValidNode(r))throw new Error("Element not valid");return r},isValidNode:function(e){return e&&"nodeType"in e},getAllNodes:function(e){function t(e){for(;e;)r.push(e),e.hasChildNodes()&&t(e.firstChild),e=e.nextSibling}var r=[];return t(e),r}};e.exports=i},function(e,t,r){"use strict";function n(e){return"string"==typeof e?e.replace(/&(?!\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):e}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){var e=[],t=[],r=[],i=null,a=function(e,t){return t.split(".").reduce(function(e,t){return e?e[t]:void 0},e||self)},c=function c(u,l,s,f){var p=s||null,d=f||"",h=[],v=function(e,t){return e instanceof Array?""!==d?d:t:""!==d?d+"."+t:t},y=function(e){if(!0!==p.paused)if(!0===l)setTimeout(function(){if(e===h.length){for(var t=0;t<p.observers.length;t++)p.observers[t](h);h=[]}},10);else{for(var t=0;t<p.observers.length;t++)p.observers[t](h);h=[]}},m={get:function(e,t){if("__getTarget"===t)return e;if("__isProxy"===t)return!0;if("__getParent"===t)return function(t){void 0===t&&(t=1);var r=v(e,"__getParent").split(".");return r.splice(-(t+1),t+1),a(p.parentProxy,r.join("."))};var r=e[t];if(r instanceof Object&&null!==r&&e.hasOwnProperty(t)){!0===r.__isProxy&&(r=r.__getTarget);for(var o=-1,i=p.targets,u=0,s=i.length;u<s;u++)if(r===i[u]){o=u;break}if(o>-1)return p.proxies[o];return c(r,l,p,""!==d?d+"."+t:t)}return p.renderMode?n(r):r},deleteProperty:function(e,n){var o=!0;i===b&&(o=!1,i=null);var a=Object.assign({},e),c=v(e,n);if(h.push({type:"delete",target:e,property:n,newValue:null,previousValue:a[n],currentPath:c,proxy:b}),"function"==typeof p.beforeChange&&p.checkBeforeChange!==c){p.checkBeforeChange=c;if(!1===p.beforeChange(h))return p.checkBeforeChange="",!1}if(p.checkBeforeChange="",!0===o){var u=void 0,l=void 0;for(u=0,l=t.length;u<l&&e!==t[u];u++);for(var s=r[u],f=s.length;f--;)s[f].proxy!==b&&(i=s[f].proxy,delete s[f].proxy[n]);delete e[n]}return y(h.length),!0},set:function(e,n,a,c){var u=!0;i===b&&(u=!1,i=null);var l=e[n];if(l!==a||!1===u){var s=void 0===l?"undefined":o(l),f=v(e,n),d="update";if("undefined"===s&&(d="add"),h.push({type:d,target:e,property:n,newValue:a,previousValue:c[n],currentPath:f,proxy:b}),"function"==typeof p.beforeChange&&p.checkBeforeChange!==f){p.checkBeforeChange=f;if(!1===p.beforeChange(h))return p.checkBeforeChange="",!1}if(p.checkBeforeChange="",!0===u){var m=void 0,g=void 0;for(m=0,g=t.length;m<g&&e!==t[m];m++);var E=r[m];if(E)for(var _=0,w=E.length;_<w;_++)E[_].proxy!==b&&(i=E[_].proxy,E[_].proxy[n]=a);setTimeout(function(){if("object"===s&&null!==l){for(var n=Object.keys(e),o=0,i=n.length;o<i;o++)if(e[n[o]]===l)return;!function e(n){for(var o=Object.keys(n),i=0,a=o.length;i<a;i++){var c=n[o[i]];c instanceof Object&&null!==c&&e(c)}for(var u=-1,l=0,s=t.length;l<s;l++)if(n===t[l]){u=l;break}if(u>-1){for(var f=r[u],d=f.length;d--;)if(p===f[d].observable){f.splice(d,1);break}0===f.length&&(r.splice(u,1),t.splice(u,1))}}(l)}},1e4),e[n]=a,a instanceof Object&&null!==a&&function e(t){for(var r=t.__getTarget,n=Object.keys(r),o=0,i=n.length;o<i;o++){var a=n[o];r[a]instanceof Object&&null!==r[a]&&e(t[a])}}(b[n])}y(h.length)}return!0}},b=new Proxy(u,m);null===p?(p={parentTarget:u,domDelay:l,parentProxy:b,observers:[],targets:[u],proxies:[b],paused:!1,path:d},e.push(p)):(p.targets.push(u),p.proxies.push(b));for(var g={target:u,proxy:b,observable:p},E=-1,_=0,w=t.length;_<w;_++)if(u===t[_]){E=_;break}return E>-1?r[E].push(g):(t.push(u),r.push([g]),E=t.length-1),b};return{create:function(e,t,r){!0===e.__isProxy&&(e=e.__getTarget);var n=c(e,t);return"function"==typeof r&&this.observe(n,r),function e(t){for(var r=t.__getTarget,n=Object.keys(r),o=0,i=n.length;o<i;o++){var a=n[o];r[a]instanceof Object&&null!==r[a]&&e(t[a])}}(n),n},observe:function(t,r){for(var n=e.length;n--;)if(e[n].parentProxy===t){e[n].observers.push(r);break}},pause:function(t){for(var r=e.length,n=!1;r--;)if(e[r].parentProxy===t){e[r].paused=!0,n=!0;break}if(!1===n)throw new Error("ObseravableSlim could not pause observable -- matching proxy not found.")},resume:function(t){for(var r=e.length,n=!1;r--;)if(e[r].parentProxy===t){e[r].paused=!1,n=!0;break}if(!1===n)throw new Error("ObseravableSlim could not resume observable -- matching proxy not found.")},remove:function(n){for(var o=null,i=!1,a=e.length;a--;)if(e[a].parentProxy===n){o=e[a],i=!0;break}for(var c=r.length;c--;)for(var u=r[c].length;u--;)r[c][u].observable===o&&(r[c].splice(u,1),0===r[c].length&&(r.splice(c,1),t.splice(c,1)));!0===i&&e.splice(a,1)},beforeChange:function(t,r){if("function"!=typeof r)throw new Error("Callback function is required");for(var n=e.length,o=!1;n--;)if(e[n].parentProxy===t){e[n].beforeChange=r,o=!0;break}if(!1===o)throw new Error("ObseravableSlim -- matching proxy not found.")},beginRender:function(t){for(var r=e.length,n=!1;r--;)if(e[r].parentProxy===t){e[r].renderMode=!0,n=!0;break}if(!1===n)throw new Error("ObseravableSlim -- matching proxy not found.")},endRender:function(t){for(var r=e.length,n=!1;r--;)if(e[r].parentProxy===t){e[r].renderMode=!1,n=!0;break}if(!1===n)throw new Error("ObseravableSlim -- matching proxy not found.")}}}();e.exports=i},function(e,t,r){"use strict";function n(e){if("function"==typeof e.onBeforeCreate)return e.onBeforeCreate.call(e)}function o(e){"function"==typeof e.onCreate&&e.onCreate.call(e)}function i(e){"function"==typeof e.onRender&&e.onRender.call(e)}function a(e){if("function"==typeof e.onBeforeUpdate)return e.onBeforeUpdate.call(e,Object.assign({},e.props))}function c(e){"function"==typeof e.onUpdate&&e.onUpdate.call(e)}function u(e){if("function"==typeof e.onBeforeDestroy)return e.onBeforeDestroy.call(e)}function l(e){"function"==typeof e.onDestroy&&(e.onDestroy.call(e),e=null)}e.exports={callBeforeCreate:n,callCreate:o,callRender:i,callBeforeUpdate:a,callUpdate:c,callBeforeDestroy:u,callDestroy:l}},function(e,t,r){"use strict";function n(e){var t={};if(e.attributes)for(var r=Array.from(e.attributes),n=r.length-1;n>=0;--n){var o=r[n],a=o.name.match(c.IS_COMPONENT_LISTENER);if(a)void 0===t[u.LISTENER]&&(t[u.LISTENER]={}),t[u.LISTENER][a[1]]=o.nodeValue,delete t[o.name];else{var l=o.nodeValue;c.IS_STRING_QUOTED.test(l)&&(l=o.nodeValue.replace(/"/g,""")),t[o.name]=o.name===u.FORCE_UPDATE||i(l)}}return t}function o(e){function t(e,o){for(;e;){var i=void 0;3===e.nodeType?i=e.nodeValue:(i={},i.type=e.nodeName.toLowerCase(),i.children=[],i.props=n(e),i.isSVG=void 0!==e.ownerSVGElement),Object.keys(r).length||(r=i),o&&o.children&&o.children.push(i),e.hasChildNodes()&&t(e.firstChild,i),e=e.nextSibling}}var r={};return t(e,r),r}var i=r(8),a=r(0),c=a.REGEX,u=a.ATTR;e.exports={transform:o,serializeProps:n}},function(e,t,r){"use strict";function n(e){if("string"!=typeof e)return e;switch(e){case"undefined":return;case"null":return null;case"NaN":return NaN;case"Infinity":return 1/0;case"true":return!0;case"false":return!1;case"0":return e;default:try{return JSON.parse(e)}catch(e){}}var t=parseFloat(e);return!isNaN(t)&&isFinite(e)?0===e.toLowerCase().indexOf("0x")?parseInt(e,16):t:e}e.exports=n},function(e,t,r){"use strict";var n=r(15);e.exports={updateElement:n.update}},function(e,t,r){"use strict";e.exports=r(11)},function(e,t,r){"use strict";e.exports=r(12),e.exports.component=r(3).component,e.exports.collection=r(1),e.exports.update=r(9).updateElement,e.exports.transform=r(7).transform,e.exports.html=r(4)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(2),c=r(13),u=r(3),l=r(0),s=l.TAG,f=l.REGEX,p=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e);var i="<"+s.VIEW+"></"+s.VIEW+">";if(f.IS_ID_SELECTOR.test(r.root)&&(r.root=document.getElementById(r.root.substring(1))),f.IS_ID_SELECTOR.test(r.template)&&(r.template=document.getElementById(r.template.substring(1)),r.template=r.template.innerHTML),!(r.root instanceof HTMLElement))throw new TypeError("root must be an HTMLElement or an valid ID selector like #example-root");if(!(r.template instanceof HTMLElement||"string"==typeof r.template||"function"==typeof r.template))throw new TypeError("template must be a string or an HTMLElement or a function or an valid ID selector like #example-template");this.cfg=a(r,{components:[],actions:{}}),Object.defineProperties(this,{_components:{value:{},writable:!0},_usedComponents:{value:{},writable:!0},_stores:{value:{},writable:!0},_cache:{value:new Map},_ids:{value:{},writable:!0},action:{value:c(this.cfg.actions,this),enumerable:!0},mount:{value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._tree;if("string"==typeof t&&(t=document.querySelector(t)),!((t=t||r._rootElement)instanceof HTMLElement))throw new TypeError("root must be an HTMLElement or an valid selector like #example-root");var n={tag:s.ROOT,cfg:{props:{},template:function(){return e}}};return u.getInstances({root:t,template:"<"+s.ROOT+"></"+s.ROOT+">",view:this,parentCmp:r,autoCmp:n,mount:!0})},enumerable:!0}}),this.cfg.components.forEach(function(e){"object"===(void 0===e?"undefined":o(e))&&"string"==typeof e.tag&&"object"===o(e.cfg)&&(t._components[e.tag]=e)}),this._components[s.VIEW]={tag:s.VIEW,cfg:{props:r.props||{},template:function(){return"function"==typeof r.template?r.template():r.template}}},this._tree=u.getInstances({root:this.cfg.root,template:i,view:this})||[]}return i(e,[{key:"getComponent",value:function(e){return this._tree?this._tree.children[e]:void 0}},{key:"getComponentById",value:function(e){return this._ids[e]}},{key:"getStore",value:function(e){return this._stores[e]}}]),e}();e.exports=p},function(e,t,r){"use strict";function n(e,t){if("object"!==(void 0===e?"undefined":o(e)))throw new TypeError("expected an object");for(var r=Object.assign({},e),i=Object.keys(e),a=i.length-1;a>=0;--a){var c=r[i[a]];"function"==typeof c?r[i[a]]=c.bind(t):"object"===(void 0===c?"undefined":o(c))&&(r[i[a]]=n(c,t))}return r}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=n},function(e,t,r){"use strict";function n(e){return void 0!==window.requestAnimationFrame?window.requestAnimationFrame(e):window.setTimeout(e)}function o(e,t){t.forEach(function(t){e._boundElements.hasOwnProperty(t.property)&&e._boundElements[t.property].forEach(function(e){"radio"===e.type||"checkbox"===e.type?e.checked=e.value===t.newValue:e.value=t.newValue})})}function i(e,t){e.props=a.create(t,!0,function(t){e.render(),o(e,t),e._isCreated&&n(function(){c.callUpdate(e)})}),a.beforeChange(e.props,function(){if(!1===c.callBeforeUpdate(e))return!1})}var a=r(5),c=r(6);e.exports={create:i}},function(e,t,r){"use strict";function n(e,t){return(void 0===e?"undefined":c(e))!==(void 0===t?"undefined":c(t))||"string"==typeof e&&e!==t||e.type!==t.type||e.props&&e.props.forceupdate}function o(e,t,r){if(void 0!==e){if("string"==typeof e)return document.createTextNode(e);"#"===e.type[0]&&(e.type=h.EMPTY);var n=e.isSVG?document.createElementNS(v.SVG,e.type):document.createElement(e.type);return l(n,e.props,t),e.children.map(function(e){return o(e,t,r)}).forEach(n.appendChild.bind(n)),-1===e.type.indexOf("-")||r||t._processing.push({node:n,action:"create"}),n}}function i(e,t,r){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments[4],l=arguments[5];if(!r){var p=o(t,u,l);return e.appendChild(p),p}if(t){if(n(t,r)){var h=o(t,u,l);return e.replaceChild(h,e.childNodes[c]),h}if(t.type){var v=s(e.childNodes[c],t.props,r.props,u);if(e.childNodes[c]){var y=e.childNodes[c][d];if(y&&v.length)return void v.forEach(function(e){Object.keys(e).forEach(function(t){y.props[t]=e[t]})})}for(var m=t.children.length,b=r.children.length,g=0;g<m||g<b;g++)i(e.childNodes[c],t.children[g],r.children[g],g,u,l);a()}}else e.childNodes[c]&&f.push(e.childNodes[c])}function a(){for(var e=f.length;e--;)f[e].parentNode.removeChild(f[e]),f.splice(e,1)}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=r(16),l=u.attach,s=u.updateAttributes,f=[],p=r(0),d=p.INSTANCE,h=p.TAG,v=p.NS;e.exports={create:o,update:i}},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e){return w.IS_LISTENER.test(e)}function i(e){return e===S.BIND}function a(e){return e===S.REF}function c(e){return-1!==["INPUT","TEXTAREA","SELECT"].indexOf(e.nodeName)}function u(e,t,r,n){if(p(t));else if("boolean"==typeof r)d(e,t,r);else if("object"===(void 0===r?"undefined":E(r)))try{e.setAttribute(t,JSON.stringify(r))}catch(e){}else e.setAttribute(t,r)}function l(e,t,r){p(t)||e.removeAttribute(t)}function s(e,t,r,n,o){if(r?n&&r===n||u(e,t,r,o):l(e,t,n,o),o&&o.updateChildrenProps){Object.keys(o.children).forEach(function(e){o.children[e]._publicProps.hasOwnProperty(t)&&o.children[e].props.hasOwnProperty(t)&&(o.children[e].props[t]=r)})}}function f(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],o=Object.assign({},t,r),i=[];return Object.keys(o).forEach(function(o){if(s(e,o,t[o],r[o],n),t[o]!==r[o]){var a={};a[o]=t[o],i.push(a)}}),i}function p(e){return o(e)||i(e)||a(e)||e===S.FORCE_UPDATE}function d(e,t,r){e.setAttribute(t,r),e[t]=r}function h(e){return e.slice(2).toLowerCase()}function v(e){return e.replace(w.TRIM_QUOTES,"$1")}function y(e,t,r,i){if(o(t)){var a=r.match(w.GET_LISTENER);if(a){var c=null,u=a[1],l=a[2];l&&(c=l.split(",").map(function(e){return e=e.trim(),"this"===e?i:T(v(e))}));var s=u.match(w.IS_PARENT_METHOD);s&&(u=s[1],i=i.parent);var f=O(u,i);void 0!==f&&(r=c?f.bind.apply(f,[i].concat(n(c))):f.bind(i))}"function"==typeof r&&e.addEventListener(h(t),r)}}function m(e,t,r,n){i(t)&&c(e)&&void 0!==n.props[r]&&(["compositionstart","compositionend","input","change"].forEach(function(t){e.addEventListener(t,function(){this.defaultValue||"checkbox"!==this.type?n.props[r]=this.value:n.props[r]=this.checked})}),n._boundElements.hasOwnProperty(r)?n._boundElements[r].push(e):n._boundElements[r]=[e])}function b(e,t,r,n){a(t)&&(n.ref[r]=e)}function g(e,t,r){Object.keys(t).forEach(function(n){u(e,n,t[n],r),y(e,n,t[n],r),m(e,n,t[n],r),b(e,n,t[n],r)});for(var n in e.dataset)e.dataset.hasOwnProperty(n)&&w.IS_LISTENER.test(n)&&y(e,n,e.dataset[n],r)}var E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_=r(0),w=_.REGEX,S=_.ATTR,T=r(8),O=r(17);e.exports={attach:g,updateAttributes:f}},function(e,t,r){"use strict";function n(e,t){return e.split(".").reduce(function(e,t){return e?e[t]:void 0},t)}function o(e,t){return-1!==e.indexOf(".")&&(e=e.split("."),e.pop(),e=e.join(".")),n(e,t)}e.exports=n,e.exports.getLast=o},function(e,t,r){"use strict";function n(e){if("string"==typeof e.store){if(void 0!==e.view._stores[e.store])throw new Error("Store already defined: "+e.store);e.view._stores[e.store]=e.props}}e.exports={create:n}},function(e,t,r){"use strict";function n(e){if("string"==typeof e.id){if(void 0!==e.view._ids[e.id])throw new Error("ID already defined: "+e.id);e.view._ids[e.id]=e}}e.exports={create:n}},function(e,t,r){"use strict";function n(e){var t={};return void 0!==e[i.ALIAS]&&(t.alias=e[i.ALIAS],delete e[i.ALIAS]),void 0!==e[i.STORE]&&(t.store=e[i.STORE],delete e[i.STORE]),void 0!==e[i.LISTENER]&&(t.callback=e[i.LISTENER],delete e[i.LISTENER]),void 0!==e[i.ID]&&(t.id=e[i.ID],delete e[i.ID]),t}var o=r(0),i=o.ATTR;e.exports={extract:n}}])}); | ||
// [DOZ] Build version: 0.0.25 | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Doz",[],t):"object"==typeof exports?exports.Doz=t():e.Doz=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=10)}([function(e,t,r){"use strict";e.exports={ROOT:"__DOZ_GLOBAL_COMPONENTS__",INSTANCE:"__DOZ_INSTANCE__",NS:{SVG:"http://www.w3.org/2000/svg"},TAG:{ROOT:"doz-root",EACH:"doz-each-root",VIEW:"doz-view",EMPTY:"doz-empty",SUFFIX_ROOT:"-root"},REGEX:{IS_CUSTOM_TAG:/^\w+-[\w-]+$/,IS_CUSTOM_TAG_STRING:/<\w+-[\w-]+/,IS_BIND:/^d-bind$/,IS_REF:/^d-ref$/,IS_ALIAS:/^d:alias$/,IS_STORE:/^d:store$/,IS_COMPONENT_LISTENER:/^d:on-(\w+)$/,IS_LISTENER:/^on/,IS_ID_SELECTOR:/^#[\w-_:.]+$/,IS_PARENT_METHOD:/^parent.(.*)/,IS_STRING_QUOTED:/^"\w+"/,GET_LISTENER:/^this.(.*)\((.*)\)/,TRIM_QUOTES:/^["'](.*)["']$/},ATTR:{BIND:"d-bind",REF:"d-ref",ALIAS:"d:alias",STORE:"d:store",LISTENER:"d:on",ID:"d:id",FORCE_UPDATE:"forceupdate"}}},function(e,t,r){"use strict";function n(){return window[u]=window[u]||{components:{}},window[u].components}function o(e){var t=n(),r=e.tag.toUpperCase();if(t.hasOwnProperty(r))throw new Error("Component "+r+" already defined");t[r]=e}function i(){window[u]&&(window[u].components={})}function a(e){if("string"!=typeof e)throw new TypeError("tag must be a string");return e=e.toUpperCase(),n()[e]}var c=r(0),u=c.ROOT;e.exports={register:o,get:a,removeAll:i}},function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(var o in t)t.hasOwnProperty(o)&&-1===r.indexOf(o)&&(e.hasOwnProperty(o)&&void 0!==e[o]?"object"===i(e[o])&&n(e[o],t[o]):e[o]=t[o]);return e}function o(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t[0]=Object.assign({},t[0]),n.apply(this,t)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=n,e.exports.copy=o},function(e,t,r){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new TypeError("Tag must be a string");if(!h.IS_CUSTOM_TAG.test(e))throw new TypeError("Tag must contain a dash (-) like my-component");var r={};r.tag=e,r.cfg=l.copy(t,{updateChildrenProps:!0,props:{},template:function(){return"<div></div>"}}),f(r)}function o(){function e(o){for(var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o;){var c=t.autoCmp||m.get(o.nodeName)||t.view._components[o.nodeName.toLowerCase()];if(c){var u=w(o),l=C(u),s=i(c,{root:o,view:t.view,props:u,dProps:l,parentCmp:a.cmp});if(!s)continue;if(s.render(!0),r||(r=s),o.insertBefore(s._rootElement,o.firstChild),g.callRender(s),n=s,a.cmp){var f=Object.keys(a.cmp.children).length;a.cmp.children[s.alias?s.alias:f++]=s}t.autoCmp=null}o.hasChildNodes()&&e(o.firstChild,{cmp:n}),o=o.nextSibling}}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.template="string"==typeof t.template?p.create(t.template):t.template,t.root.appendChild(t.template);var r=null,n=void 0;return e(t.template),r}function i(e,t){var r=l.copy(t.props,"function"==typeof e.cfg.props?e.cfg.props():e.cfg.props),n=Object.defineProperties({},{_isCreated:{value:!1,writable:!0},_prevTpl:{value:null,writable:!0},_prev:{value:null,writable:!0},_prevProps:{value:null,writable:!0},_rootElement:{value:null,writable:!0},_boundElements:{value:{},writable:!0},_callback:{value:t.dProps.callback,writable:!0},_cache:{value:new Map},_loops:{value:{},writable:!0},_publicProps:{value:Object.assign({},t.props)},_processing:{value:[],writable:!0},_dynamicChildren:{value:[],writable:!0},beginSafeRender:{value:function(){N.beginRender(this.props)},enumerable:!0},endSafeRender:{value:function(){N.endRender(this.props)},enumerable:!0},view:{value:t.view,enumerable:!0},parent:{value:t.parentCmp,enumerable:!0},ref:{value:{},writable:!0,enumerable:!0},children:{value:{},writable:!0,enumerable:!0},tag:{value:e.tag,enumerable:!0},emit:{value:function(e){if(this._callback&&void 0!==this._callback[e]&&void 0!==this.parent[this._callback[e]]&&"function"==typeof this.parent[this._callback[e]]){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.parent[this._callback[e]].apply(this.parent,r)}},enumerable:!0},each:{value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=void 0;return Array.isArray(e)&&(r&&this.beginSafeRender(),n=e.map(t).map(function(e){if("string"==typeof e)return e.trim()}).join(""),r&&this.endSafeRender()),n},enumerable:!0},getStore:{value:function(e){return this.view.getStore(e)},enumerable:!0},getComponentById:{value:function(e){return this.view.getComponentById(e)},enumerable:!0},action:{value:t.view.action,enumerable:!0},render:{value:function(e){this.beginSafeRender();var r=this.template().trim();this.endSafeRender();var n=p.create(r,v.ROOT),o=_(n),i=S(t.root,o,this._prev,0,this,e);u(this),!this._rootElement&&i&&(this._rootElement=i),this._prev=o},enumerable:!0},mount:{value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this._rootElement;return"string"==typeof t.selector?r=r.querySelector(t.selector):t.selector instanceof HTMLElement&&(r=t.selector),this.view.mount(e,r,this)},enumerable:!0},destroy:{value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(t||this._rootElement&&!1!==g.callBeforeDestroy(this)&&this._rootElement.parentNode)&&(Object.keys(this.children).forEach(function(t){e.children[t].destroy()}),t?this._rootElement.parentNode.innerHTML="":this._rootElement.parentNode.parentNode.removeChild(this._rootElement.parentNode),g.callDestroy(this))},enumerable:!0}});if(a(n,e.cfg,t.dProps),!1!==g.callBeforeCreate(n))return b.create(n,r),T.create(n),O.create(n),g.callCreate(n),n._isCreated=!0,n}function a(e,t,r){Object.assign(e,t,r)}function c(e){for(var t=e._dynamicChildren.length-1;t>=0;){var r=e._dynamicChildren[t];!document.body.contains(r)&&r[y]&&(r[y].destroy(!0),e._dynamicChildren.splice(t,1)),t-=1}}function u(e){c(e);for(var t=e._processing.length-1;t>=0;){var r=e._processing[t],n=r.node.parentNode;r.node[y]&&r.node[y].destroy(!0);var i=o({root:n,template:r.node.outerHTML,view:e.view});i&&(e._dynamicChildren.push(i._rootElement.parentNode),n.replaceChild(i._rootElement.parentNode,r.node),i._rootElement.parentNode[y]=i,e._processing.splice(t,1)),t-=1}}var l=r(2),s=r(1),f=s.register,p=r(4),d=r(0),h=d.REGEX,v=d.TAG,y=d.INSTANCE,m=r(1),b=r(14),g=r(6),E=r(7),_=E.transform,w=E.serializeProps,S=r(9).updateElement,T=r(18),O=r(19),x=r(20),C=x.extract,N=r(5);e.exports={component:n,getInstances:o}},function(e,t,r){"use strict";var n=/\n/g,o=/\s+/g,i={create:function(e,t){var r=void 0;e=e.replace(n," "),e=e.replace(o," ");var i=document.createElement("div");if(i.innerHTML=e,i.childNodes.length>1?(r=document.createElement(t),r.innerHTML=i.innerHTML):r=i.firstChild||document.createTextNode(""),!this.isValidNode(r))throw new Error("Element not valid");return r},isValidNode:function(e){return e&&"nodeType"in e},getAllNodes:function(e){function t(e){for(;e;)r.push(e),e.hasChildNodes()&&t(e.firstChild),e=e.nextSibling}var r=[];return t(e),r}};e.exports=i},function(e,t,r){"use strict";function n(e){return"string"==typeof e?e.replace(/&(?!\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):e}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){var e=[],t=[],r=[],i=null,a=function(e,t){return t.split(".").reduce(function(e,t){return e?e[t]:void 0},e||self)},c=function c(u,l,s,f){var p=s||null,d=f||"",h=[],v=function(e,t){return e instanceof Array?""!==d?d:t:""!==d?d+"."+t:t},y=function(e){if(!0!==p.paused)if(!0===l)setTimeout(function(){if(e===h.length){for(var t=0;t<p.observers.length;t++)p.observers[t](h);h=[]}},10);else{for(var t=0;t<p.observers.length;t++)p.observers[t](h);h=[]}},m={get:function(e,t){if("__getTarget"===t)return e;if("__isProxy"===t)return!0;if("__getParent"===t)return function(t){void 0===t&&(t=1);var r=v(e,"__getParent").split(".");return r.splice(-(t+1),t+1),a(p.parentProxy,r.join("."))};var r=e[t];if(r instanceof Object&&null!==r&&e.hasOwnProperty(t)){!0===r.__isProxy&&(r=r.__getTarget);for(var o=-1,i=p.targets,u=0,s=i.length;u<s;u++)if(r===i[u]){o=u;break}if(o>-1)return p.proxies[o];return c(r,l,p,""!==d?d+"."+t:t)}return p.renderMode?n(r):r},deleteProperty:function(e,n){var o=!0;i===b&&(o=!1,i=null);var a=Object.assign({},e),c=v(e,n);if(h.push({type:"delete",target:e,property:n,newValue:null,previousValue:a[n],currentPath:c,proxy:b}),"function"==typeof p.beforeChange&&p.checkBeforeChange!==c){p.checkBeforeChange=c;if(!1===p.beforeChange(h))return p.checkBeforeChange="",!1}if(p.checkBeforeChange="",!0===o){var u=void 0,l=void 0;for(u=0,l=t.length;u<l&&e!==t[u];u++);for(var s=r[u],f=s.length;f--;)s[f].proxy!==b&&(i=s[f].proxy,delete s[f].proxy[n]);delete e[n]}return y(h.length),!0},set:function(e,n,a,c){var u=!0;i===b&&(u=!1,i=null);var l=e[n];if(l!==a||!1===u){var s=void 0===l?"undefined":o(l),f=v(e,n),d="update";if("undefined"===s&&(d="add"),h.push({type:d,target:e,property:n,newValue:a,previousValue:c[n],currentPath:f,proxy:b}),"function"==typeof p.beforeChange&&p.checkBeforeChange!==f){p.checkBeforeChange=f;if(!1===p.beforeChange(h))return p.checkBeforeChange="",!1}if(p.checkBeforeChange="",!0===u){var m=void 0,g=void 0;for(m=0,g=t.length;m<g&&e!==t[m];m++);var E=r[m];if(E)for(var _=0,w=E.length;_<w;_++)E[_].proxy!==b&&(i=E[_].proxy,E[_].proxy[n]=a);setTimeout(function(){if("object"===s&&null!==l){for(var n=Object.keys(e),o=0,i=n.length;o<i;o++)if(e[n[o]]===l)return;!function e(n){for(var o=Object.keys(n),i=0,a=o.length;i<a;i++){var c=n[o[i]];c instanceof Object&&null!==c&&e(c)}for(var u=-1,l=0,s=t.length;l<s;l++)if(n===t[l]){u=l;break}if(u>-1){for(var f=r[u],d=f.length;d--;)if(p===f[d].observable){f.splice(d,1);break}0===f.length&&(r.splice(u,1),t.splice(u,1))}}(l)}},1e4),e[n]=a,a instanceof Object&&null!==a&&function e(t){for(var r=t.__getTarget,n=Object.keys(r),o=0,i=n.length;o<i;o++){var a=n[o];r[a]instanceof Object&&null!==r[a]&&e(t[a])}}(b[n])}y(h.length)}return!0}},b=new Proxy(u,m);null===p?(p={parentTarget:u,domDelay:l,parentProxy:b,observers:[],targets:[u],proxies:[b],paused:!1,path:d},e.push(p)):(p.targets.push(u),p.proxies.push(b));for(var g={target:u,proxy:b,observable:p},E=-1,_=0,w=t.length;_<w;_++)if(u===t[_]){E=_;break}return E>-1?r[E].push(g):(t.push(u),r.push([g]),E=t.length-1),b};return{create:function(e,t,r){!0===e.__isProxy&&(e=e.__getTarget);var n=c(e,t);return"function"==typeof r&&this.observe(n,r),function e(t){for(var r=t.__getTarget,n=Object.keys(r),o=0,i=n.length;o<i;o++){var a=n[o];r[a]instanceof Object&&null!==r[a]&&e(t[a])}}(n),n},observe:function(t,r){for(var n=e.length;n--;)if(e[n].parentProxy===t){e[n].observers.push(r);break}},pause:function(t){for(var r=e.length,n=!1;r--;)if(e[r].parentProxy===t){e[r].paused=!0,n=!0;break}if(!1===n)throw new Error("ObseravableSlim could not pause observable -- matching proxy not found.")},resume:function(t){for(var r=e.length,n=!1;r--;)if(e[r].parentProxy===t){e[r].paused=!1,n=!0;break}if(!1===n)throw new Error("ObseravableSlim could not resume observable -- matching proxy not found.")},remove:function(n){for(var o=null,i=!1,a=e.length;a--;)if(e[a].parentProxy===n){o=e[a],i=!0;break}for(var c=r.length;c--;)for(var u=r[c].length;u--;)r[c][u].observable===o&&(r[c].splice(u,1),0===r[c].length&&(r.splice(c,1),t.splice(c,1)));!0===i&&e.splice(a,1)},beforeChange:function(t,r){if("function"!=typeof r)throw new Error("Callback function is required");for(var n=e.length,o=!1;n--;)if(e[n].parentProxy===t){e[n].beforeChange=r,o=!0;break}if(!1===o)throw new Error("ObseravableSlim -- matching proxy not found.")},beginRender:function(t){for(var r=e.length,n=!1;r--;)if(e[r].parentProxy===t){e[r].renderMode=!0,n=!0;break}if(!1===n)throw new Error("ObseravableSlim -- matching proxy not found.")},endRender:function(t){for(var r=e.length,n=!1;r--;)if(e[r].parentProxy===t){e[r].renderMode=!1,n=!0;break}if(!1===n)throw new Error("ObseravableSlim -- matching proxy not found.")}}}();e.exports=i},function(e,t,r){"use strict";function n(e){if("function"==typeof e.onBeforeCreate)return e.onBeforeCreate.call(e)}function o(e){"function"==typeof e.onCreate&&e.onCreate.call(e)}function i(e){"function"==typeof e.onRender&&e.onRender.call(e)}function a(e){if("function"==typeof e.onBeforeUpdate)return e.onBeforeUpdate.call(e,Object.assign({},e.props))}function c(e){"function"==typeof e.onUpdate&&e.onUpdate.call(e)}function u(e){if("function"==typeof e.onBeforeDestroy)return e.onBeforeDestroy.call(e)}function l(e){"function"==typeof e.onDestroy&&(e.onDestroy.call(e),e=null)}e.exports={callBeforeCreate:n,callCreate:o,callRender:i,callBeforeUpdate:a,callUpdate:c,callBeforeDestroy:u,callDestroy:l}},function(e,t,r){"use strict";function n(e){var t={};if(e.attributes)for(var r=Array.from(e.attributes),n=r.length-1;n>=0;--n){var o=r[n],a=o.name.match(c.IS_COMPONENT_LISTENER);if(a)void 0===t[u.LISTENER]&&(t[u.LISTENER]={}),t[u.LISTENER][a[1]]=o.nodeValue,delete t[o.name];else{var l=o.nodeValue;c.IS_STRING_QUOTED.test(l)&&(l=o.nodeValue.replace(/"/g,""")),t[o.name]=o.name===u.FORCE_UPDATE||i(l)}}return t}function o(e){function t(e,o){for(;e;){var i=void 0;3===e.nodeType?i=e.nodeValue:(i={},i.type=e.nodeName,i.children=[],i.props=n(e),i.isSVG=void 0!==e.ownerSVGElement),Object.keys(r).length||(r=i),o&&o.children&&o.children.push(i),e.hasChildNodes()&&t(e.firstChild,i),e=e.nextSibling}}var r={};return t(e,r),r}var i=r(8),a=r(0),c=a.REGEX,u=a.ATTR;e.exports={transform:o,serializeProps:n}},function(e,t,r){"use strict";function n(e){if("string"!=typeof e)return e;switch(e){case"undefined":return;case"null":return null;case"NaN":return NaN;case"Infinity":return 1/0;case"true":return!0;case"false":return!1;case"0":return e;default:try{return JSON.parse(e)}catch(e){}}var t=parseFloat(e);return!isNaN(t)&&isFinite(e)?0===e.toLowerCase().indexOf("0x")?parseInt(e,16):t:e}e.exports=n},function(e,t,r){"use strict";var n=r(15);e.exports={updateElement:n.update}},function(e,t,r){"use strict";e.exports=r(11)},function(e,t,r){"use strict";e.exports=r(12),e.exports.component=r(3).component,e.exports.collection=r(1),e.exports.update=r(9).updateElement,e.exports.transform=r(7).transform,e.exports.html=r(4)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(2),c=r(13),u=r(3),l=r(0),s=l.TAG,f=l.REGEX,p=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e);var i="<"+s.VIEW+"></"+s.VIEW+">";if(f.IS_ID_SELECTOR.test(r.root)&&(r.root=document.getElementById(r.root.substring(1))),f.IS_ID_SELECTOR.test(r.template)&&(r.template=document.getElementById(r.template.substring(1)),r.template=r.template.innerHTML),!(r.root instanceof HTMLElement))throw new TypeError("root must be an HTMLElement or an valid ID selector like #example-root");if(!(r.template instanceof HTMLElement||"string"==typeof r.template||"function"==typeof r.template))throw new TypeError("template must be a string or an HTMLElement or a function or an valid ID selector like #example-template");this.cfg=a(r,{components:[],actions:{}}),Object.defineProperties(this,{_components:{value:{},writable:!0},_usedComponents:{value:{},writable:!0},_stores:{value:{},writable:!0},_cache:{value:new Map},_ids:{value:{},writable:!0},action:{value:c(this.cfg.actions,this),enumerable:!0},mount:{value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._tree;if("string"==typeof t&&(t=document.querySelector(t)),!((t=t||r._rootElement)instanceof HTMLElement))throw new TypeError("root must be an HTMLElement or an valid selector like #example-root");var n={tag:s.ROOT,cfg:{props:{},template:function(){return e}}};return u.getInstances({root:t,template:"<"+s.ROOT+"></"+s.ROOT+">",view:this,parentCmp:r,autoCmp:n,mount:!0})},enumerable:!0}}),this.cfg.components.forEach(function(e){"object"===(void 0===e?"undefined":o(e))&&"string"==typeof e.tag&&"object"===o(e.cfg)&&(t._components[e.tag]=e)}),this._components[s.VIEW]={tag:s.VIEW,cfg:{props:r.props||{},template:function(){return"function"==typeof r.template?r.template():r.template}}},this._tree=u.getInstances({root:this.cfg.root,template:i,view:this})||[]}return i(e,[{key:"getComponent",value:function(e){return this._tree?this._tree.children[e]:void 0}},{key:"getComponentById",value:function(e){return this._ids[e]}},{key:"getStore",value:function(e){return this._stores[e]}}]),e}();e.exports=p},function(e,t,r){"use strict";function n(e,t){if("object"!==(void 0===e?"undefined":o(e)))throw new TypeError("expected an object");for(var r=Object.assign({},e),i=Object.keys(e),a=i.length-1;a>=0;--a){var c=r[i[a]];"function"==typeof c?r[i[a]]=c.bind(t):"object"===(void 0===c?"undefined":o(c))&&(r[i[a]]=n(c,t))}return r}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=n},function(e,t,r){"use strict";function n(e){return void 0!==window.requestAnimationFrame?window.requestAnimationFrame(e):window.setTimeout(e)}function o(e,t){t.forEach(function(t){e._boundElements.hasOwnProperty(t.property)&&e._boundElements[t.property].forEach(function(e){"radio"===e.type||"checkbox"===e.type?e.checked=e.value===t.newValue:e.value=t.newValue})})}function i(e,t){e.props=a.create(t,!0,function(t){e.render(),o(e,t),e._isCreated&&n(function(){c.callUpdate(e)})}),a.beforeChange(e.props,function(){if(!1===c.callBeforeUpdate(e))return!1})}var a=r(5),c=r(6);e.exports={create:i}},function(e,t,r){"use strict";function n(e,t){return(void 0===e?"undefined":c(e))!==(void 0===t?"undefined":c(t))||"string"==typeof e&&e!==t||e.type!==t.type||e.props&&e.props.forceupdate}function o(e,t,r){if(void 0!==e){if("string"==typeof e)return document.createTextNode(e);"#"===e.type[0]&&(e.type=h.EMPTY);var n=e.isSVG?document.createElementNS(v.SVG,e.type):document.createElement(e.type);return l(n,e.props,t),e.children.map(function(e){return o(e,t,r)}).forEach(n.appendChild.bind(n)),-1===e.type.indexOf("-")||r||t._processing.push({node:n,action:"create"}),n}}function i(e,t,r){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments[4],l=arguments[5];if(!r){var p=o(t,u,l);return e.appendChild(p),p}if(t){if(n(t,r)){var h=o(t,u,l);return e.replaceChild(h,e.childNodes[c]),h}if(t.type){var v=s(e.childNodes[c],t.props,r.props,u);if(e.childNodes[c]){var y=e.childNodes[c][d];if(y&&v.length)return void v.forEach(function(e){Object.keys(e).forEach(function(t){y.props[t]=e[t]})})}for(var m=t.children.length,b=r.children.length,g=0;g<m||g<b;g++)i(e.childNodes[c],t.children[g],r.children[g],g,u,l);a()}}else e.childNodes[c]&&f.push(e.childNodes[c])}function a(){for(var e=f.length;e--;)f[e].parentNode.removeChild(f[e]),f.splice(e,1)}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=r(16),l=u.attach,s=u.updateAttributes,f=[],p=r(0),d=p.INSTANCE,h=p.TAG,v=p.NS;e.exports={create:o,update:i}},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e){return S.IS_LISTENER.test(e)}function i(e){return e===T.BIND}function a(e){return e===T.REF}function c(e){return-1!==["INPUT","TEXTAREA","SELECT"].indexOf(e.nodeName)}function u(e,t,r,n){if(d(t));else if("boolean"==typeof r)h(e,t,r);else if("object"===(void 0===r?"undefined":_(r)))try{e.setAttribute(t,JSON.stringify(r))}catch(e){}else e.setAttribute(t,r)}function l(e,t,r){d(t)||e.removeAttribute(t)}function s(e,t,r,n,o){r?n&&r===n||(u(e,t,r,o),f(o,t,r)):(l(e,t,n,o),f(o,t,r))}function f(e,t,r){if(e&&e.updateChildrenProps){Object.keys(e.children).forEach(function(n){e.children[n]._publicProps.hasOwnProperty(t)&&e.children[n].props.hasOwnProperty(t)&&(e.children[n].props[t]=r)})}}function p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],o=Object.assign({},t,r),i=[];return Object.keys(o).forEach(function(o){if(s(e,o,t[o],r[o],n),t[o]!==r[o]){var a={};a[o]=t[o],i.push(a)}}),i}function d(e){return o(e)||i(e)||a(e)||e===T.FORCE_UPDATE}function h(e,t,r){e.setAttribute(t,r),e[t]=r}function v(e){return e.slice(2).toLowerCase()}function y(e){return e.replace(S.TRIM_QUOTES,"$1")}function m(e,t,r,i){if(o(t)){var a=r.match(S.GET_LISTENER);if(a){var c=null,u=a[1],l=a[2];l&&(c=l.split(",").map(function(e){return e=e.trim(),"this"===e?i:O(y(e))}));var s=u.match(S.IS_PARENT_METHOD);s&&(u=s[1],i=i.parent);var f=x(u,i);void 0!==f&&(r=c?f.bind.apply(f,[i].concat(n(c))):f.bind(i))}"function"==typeof r&&e.addEventListener(v(t),r)}}function b(e,t,r,n){i(t)&&c(e)&&void 0!==n.props[r]&&(["compositionstart","compositionend","input","change"].forEach(function(t){e.addEventListener(t,function(){this.defaultValue||"checkbox"!==this.type?n.props[r]=this.value:n.props[r]=this.checked})}),n._boundElements.hasOwnProperty(r)?n._boundElements[r].push(e):n._boundElements[r]=[e])}function g(e,t,r,n){a(t)&&(n.ref[r]=e)}function E(e,t,r){Object.keys(t).forEach(function(n){u(e,n,t[n],r),m(e,n,t[n],r),b(e,n,t[n],r),g(e,n,t[n],r)});for(var n in e.dataset)e.dataset.hasOwnProperty(n)&&S.IS_LISTENER.test(n)&&m(e,n,e.dataset[n],r)}var _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w=r(0),S=w.REGEX,T=w.ATTR,O=r(8),x=r(17);e.exports={attach:E,updateAttributes:p}},function(e,t,r){"use strict";function n(e,t){return e.split(".").reduce(function(e,t){return e?e[t]:void 0},t)}function o(e,t){return-1!==e.indexOf(".")&&(e=e.split("."),e.pop(),e=e.join(".")),n(e,t)}e.exports=n,e.exports.getLast=o},function(e,t,r){"use strict";function n(e){if("string"==typeof e.store){if(void 0!==e.view._stores[e.store])throw new Error("Store already defined: "+e.store);e.view._stores[e.store]=e.props}}e.exports={create:n}},function(e,t,r){"use strict";function n(e){if("string"==typeof e.id){if(void 0!==e.view._ids[e.id])throw new Error("ID already defined: "+e.id);e.view._ids[e.id]=e}}e.exports={create:n}},function(e,t,r){"use strict";function n(e){var t={};return void 0!==e[i.ALIAS]&&(t.alias=e[i.ALIAS],delete e[i.ALIAS]),void 0!==e[i.STORE]&&(t.store=e[i.STORE],delete e[i.STORE]),void 0!==e[i.LISTENER]&&(t.callback=e[i.LISTENER],delete e[i.LISTENER]),void 0!==e[i.ID]&&(t.id=e[i.ID],delete e[i.ID]),t}var o=r(0),i=o.ATTR;e.exports={extract:n}}])}); |
{ | ||
"name": "doz", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "A JavaScript framework for building UI, almost like writing in VanillaJS.", | ||
@@ -5,0 +5,0 @@ "main": "dist/doz.js", |
@@ -345,7 +345,9 @@ const extend = require('../utils/extend'); | ||
instance._dynamicChildren.push(dynamicInstance._rootElement.parentNode); | ||
if (dynamicInstance) { | ||
instance._dynamicChildren.push(dynamicInstance._rootElement.parentNode); | ||
root.replaceChild(dynamicInstance._rootElement.parentNode, item.node); | ||
dynamicInstance._rootElement.parentNode[INSTANCE] = dynamicInstance; | ||
instance._processing.splice(index, 1); | ||
root.replaceChild(dynamicInstance._rootElement.parentNode, item.node); | ||
dynamicInstance._rootElement.parentNode[INSTANCE] = dynamicInstance; | ||
instance._processing.splice(index, 1); | ||
} | ||
index -= 1; | ||
@@ -352,0 +354,0 @@ |
@@ -46,16 +46,16 @@ const {REGEX, ATTR} = require('../constants'); | ||
removeAttribute($target, name, oldVal, cmp); | ||
updateChildren(cmp, name, newVal); | ||
} else if (!oldVal || newVal !== oldVal) { | ||
setAttribute($target, name, newVal, cmp); | ||
updateChildren(cmp, name, newVal); | ||
} | ||
} | ||
// Set children state | ||
function updateChildren(cmp, name, value) { | ||
if (cmp && cmp.updateChildrenProps) { | ||
const children = Object.keys(cmp.children); | ||
children.forEach(i => { | ||
//console.log(cmp.children[i].tag); | ||
if (cmp.children[i]._publicProps.hasOwnProperty(name) | ||
&& cmp.children[i].props.hasOwnProperty(name)) | ||
cmp.children[i].props[name] = newVal; | ||
/*if (cmp.children[i].props.hasOwnProperty(name)) | ||
cmp.children[i].props[name] = newVal;*/ | ||
cmp.children[i].props[name] = value; | ||
}); | ||
@@ -62,0 +62,0 @@ } |
@@ -23,2 +23,5 @@ const {attach, updateAttributes} = require('./attributes'); | ||
//console.log(node.isSVG, node.type) | ||
//console.dir(node); | ||
const $el = node.isSVG | ||
@@ -25,0 +28,0 @@ ? document.createElementNS(NS.SVG, node.type) |
@@ -41,6 +41,7 @@ const castStringTo = require('../utils/cast-string-to'); | ||
obj = {}; | ||
obj.type = node.nodeName.toLowerCase(); | ||
obj.type = node.nodeName;//.toLowerCase(); | ||
obj.children = []; | ||
obj.props = serializeProps(node); | ||
obj.isSVG = typeof node.ownerSVGElement !== 'undefined' | ||
obj.isSVG = typeof node.ownerSVGElement !== 'undefined'; | ||
//console.dir(node); | ||
} | ||
@@ -47,0 +48,0 @@ |
Sorry, the diff of this file is too big to display
213706
3789