diff --git a/dist/doz.js b/dist/doz.js index 38a10af7..45ff780f 100644 --- a/dist/doz.js +++ b/dist/doz.js @@ -1,4 +1,4 @@ -// [DOZ] Build version: 3.20.3 +// [DOZ] Build version: 3.20.4 (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -1619,7 +1619,11 @@ function createInstance() { } } - if (!newElement || newElement.__beforeCreateReturnsFalse) { + if (newElement && newElement.__beforeCreateReturnsFalse) { + newElement = undefined; + } + + if (!newElement) { $child = $child.nextElementSibling; return "continue"; } @@ -4240,7 +4244,7 @@ Object.defineProperties(Doz, { enumerable: true }, version: { - value: '3.20.3', + value: '3.20.4', enumerable: true }, tag: { diff --git a/dist/doz.min.js b/dist/doz.min.js index cdb6a4e4..5c15aff2 100644 --- a/dist/doz.min.js +++ b/dist/doz.min.js @@ -1,2 +1,2 @@ -// [DOZ] Build version: 3.20.3 - !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(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=27)}([function(e,t,n){function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(e,t)}var r=n(2),a=r.registerDirective;e.exports=Object.assign({directive:o},n(30),n(31))},function(e,t){e.exports={COMPONENT_DYNAMIC_INSTANCE:"componentDynamicInstance",COMPONENT_INSTANCE:"componentInstance",COMPONENT_ROOT_INSTANCE:"componentRootInstance",PROPS_ATTRIBUTES:"props",ALREADY_WALKED:"walked",DEFAULT_SLOT_KEY:"__default__",NS:{SVG:"http://www.w3.org/2000/svg"},TAG:{ROOT:"dz-root",EACH:"dz-each-root",APP:"dz-app",EMPTY:"dz-empty",MOUNT:"dz-mount",SLOT:"dz-slot",SLOT_UPPERCASE:"DZ-SLOT",SUFFIX_ROOT:"-root",TEXT_NODE_PLACE:"dz-text-node",ITERATE_NODE_PLACE:"dz-iterate-node"},REGEX:{IS_DIRECTIVE:/^d[-:][\w-]+$/,IS_CUSTOM_TAG:/^\w+-[\w-]+$/,IS_CUSTOM_TAG_STRING:/<\w+-[\w-]+/,IS_LISTENER:/^on/,IS_ID_SELECTOR:/^#[\w-_:.]+$/,IS_PARENT_METHOD:/^parent.(.*)/,IS_STRING_QUOTED:/^"\w+"/,IS_SVG:/^svg$/,GET_LISTENER:/^this.(.*)\((.*)\)/,GET_LISTENER_SCOPE:/^scope.(.*)\((.*)\)/,IS_LISTENER_SCOPE:/(^|\()scope[.)]/g,TRIM_QUOTES:/^["'](.*)["']$/,THIS_TARGET:/\B\$this(?!\w)/g,HTML_MARKUP:/)-->|<(\/?)([a-z][-.0-9_a-z]*)\s*([^>]*?)(\/?)>|<\/>/gi,HTML_ATTRIBUTE:/(^|\s)([\w-:]+)(\s*=\s*("([^"]+)"|'([^']+)'|(\S+)))?/gi,MATCH_NLS:/\n\s+/gm,REPLACE_QUOT:/"/g,REPLACE_D_DIRECTIVE:/^d[-:]/,EXTRACT_STYLE_DISPLAY_PROPERTY:/display(?:\s+)?:(?:\s+)?([\w-]+)/},ATTR:{FORCE_UPDATE:"forceupdate"}}},function(e,t,n){function o(e){"@babel/helpers - typeof";return(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)}function r(e){var t=e.tag.toUpperCase();Object.prototype.hasOwnProperty.call(l.components,t)&&console.warn("Doz","component ".concat(t," overwritten")),l.components[t]=e}function a(){l.components={}}function i(e){return e=e.toUpperCase(),l.components[e]}function p(e){l.plugins.push(e)}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new TypeError("Doz directive name must be a string");if("object"!==o(t)||!t)throw new TypeError("Doz directive config must be an object");":"===e[0]&&(t._onlyDozComponent=!0,e=e.substr(1)),e=e.toLowerCase();var n=[];-1!==e.indexOf("-")&&(n=e.split("-"),e=n[0],n.shift()),t.name=e,t._keyArguments=n.map(function(e){return e.substr(1)}),Object.prototype.hasOwnProperty.call(l.directives,e)&&console.warn("Doz","directive ".concat(e," overwritten")),l.directives[e]=t,l.directivesKeys.includes(e)||l.directivesKeys.push(e)}var l=n(11);e.exports={registerComponent:r,registerPlugin:p,getComponent:i,registerDirective:c,removeAll:a,data:l}},function(e,t){var n=window.setTimeout.bind(window);window.requestAnimationFrame&&(n=window.requestAnimationFrame.bind(window)),e.exports=n},function(e,t){e.exports=function(e){e&&!e._dozAttach&&(e._dozAttach={})}},function(e,t,n){function o(e){var t;t=Object.keys(e.props).length?e.props:e._rawProps;for(var n=Object.keys(t),o=0;o<=n.length-1;o++)!function(n){if(r(n)){var o=n.replace(c.REPLACE_D_DIRECTIVE,"");e._directiveProps[o]=t[n]}}(n[o]);return e._directiveProps}function r(e){return"d"===e[0]&&("-"===e[1]||":"===e[1])}function a(e){if(!e._dozAttach[l]||!e._dozAttach[l].style)return null;var t=e._dozAttach[l].style.match(c.EXTRACT_STYLE_DISPLAY_PROPERTY);return t?t[1]:null}function i(e){e=e.replace(c.REPLACE_D_DIRECTIVE,"");var t=e,n=[];return-1!==t.indexOf("-")&&(n=t.split("-"),t=n[0],n.shift()),[t,n]}var p=n(1),c=p.REGEX,l=p.PROPS_ATTRIBUTES;e.exports={isDirective:r,extractDirectivesFromProps:o,extractStyleDisplayFromDozProps:a,extractDirectiveNameAndKeyValues:i}},function(e,t,n){function o(e){if(g.callAppComponentBeforeCreate(e),g.callComponentBeforeCreate(e),"function"==typeof e.onBeforeCreate)return e.onBeforeCreate.call(e)}function r(e){g.callAppComponentCreate(e),g.callComponentCreate(e),"function"==typeof e.onCreate&&e.onCreate.call(e),e.app.emit("componentCreate",e)}function a(e){g.callAppComponentConfigCreate(e),"function"==typeof e.onConfigCreate&&e.onConfigCreate.call(e),e.parent&&"function"==typeof e.parent[e.__onConfigCreate]&&e.parent[e.__onConfigCreate].call(e.parent,e),e.app.emit("componentConfigCreate",e)}function i(e){if(g.callAppComponentBeforeMount(e),g.callComponentBeforeMount(e),"function"==typeof e.onBeforeMount)return e.onBeforeMount.call(e)}function p(e){g.callAppComponentMount(e),g.callComponentMount(e),"function"==typeof e.onMount&&e.onMount.call(e),e.app.emit("componentMount",e)}function c(e){b(function(){g.callAppComponentMountAsync(e),g.callComponentMountAsync(e)}),"function"==typeof e.onMountAsync&&b(function(){return e.onMountAsync.call(e)}),e.app.emit("componentMountAsync",e)}function l(e,t){if(g.callAppComponentBeforeUpdate(e,t),g.callComponentBeforeUpdate(e,t),"function"==typeof e.onBeforeUpdate)return e.onBeforeUpdate.call(e,t)}function u(e,t){g.callAppComponentUpdate(e,t),g.callComponentUpdate(e,t),"function"==typeof e.onUpdate&&e.onUpdate.call(e,t),e.app.emit("componentUpdate",e,t)}function s(e,t,n){if(e)return g.callAppComponentDrawByParent(e,t,n),"function"==typeof e.onDrawByParent?e.onDrawByParent.call(e,t,n):e.parent&&"function"==typeof e.parent[e.__onDrawByParent]?e.parent[e.__onDrawByParent].call(e.parent,e,t,n):void 0}function f(e,t){if(g.callAppComponentAfterRender(e,t),g.callComponentAfterRender(e,t),"function"==typeof e.onAfterRender)return e.onAfterRender.call(e,t)}function d(e){if(g.callAppComponentBeforeUnmount(e),g.callComponentBeforeUnmount(e),"function"==typeof e.onBeforeUnmount)return e.onBeforeUnmount.call(e)}function y(e){g.callAppComponentUnmount(e),g.callComponentUnmount(e),"function"==typeof e.onUnmount&&e.onUnmount.call(e),e.app.emit("componentUnmount",e)}function m(e){if(g.callAppComponentBeforeDestroy(e),g.callComponentBeforeDestroy(e),"function"==typeof e.onBeforeDestroy)return e.onBeforeDestroy.call(e)}function h(e){g.callAppComponentDestroy(e),g.callComponentDestroy(e),e.app.emit("componentDestroy",e);var t=document.getElementById(e.uId+"--style"),n=document.getElementById(e.uId+"--style-reset");t&&t.parentNode.removeChild(t),n&&n.parentNode.removeChild(n),e._unmountedPlaceholder&&e._unmountedPlaceholder.parentNode&&e._unmountedPlaceholder.parentNode.removeChild(e._unmountedPlaceholder),"function"==typeof e.onDestroy&&(e.onDestroy.call(e),e=null)}function _(e){g.callAppComponentLoadProps(e),g.callComponentLoadProps(e),"function"==typeof e.onLoadProps&&e.onLoadProps.call(e),e.app.emit("componentLoadProps",e)}function v(e){g.callAppComponentWaitMount(e),g.callComponentWaitMount(e),"function"==typeof e.onWaitMount&&e.onWaitMount.call(e),e.app.emit("componentWaitMount",e)}var b=n(3),g=n(0);e.exports={callBeforeCreate:o,callCreate:r,callConfigCreate:a,callBeforeMount:i,callMount:p,callMountAsync:c,callBeforeUpdate:l,callUpdate:u,callDrawByParent:s,callAfterRender:f,callBeforeUnmount:d,callUnmount:y,callBeforeDestroy:m,callDestroy:h,callLoadProps:_,callWaitMount:v}},function(e,t,n){function o(e){"@babel/helpers - typeof";return(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)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n-1&&l+t[0].length"===t[0]){var f=p(a).type;f&&(t[0]=""),t[1]="/",t[2]=f)}if(!v.test(t[0])){if("slot"===t[2]&&(t[2]=h.SLOT),!t[1]&&t[0]){n={};for(var d;d=y.HTML_ATTRIBUTE.exec(t[3]);)n[d[2]]=d[5]||d[6]||"",s(t[0].substring(1,t[0].length-1),d[2],n[d[2]],n,null);if(!t[4]&&S[i.type]&&S[i.type][t[2]]&&(a.pop(),i=p(a)),"style"===t[2]&&void 0===n["data-is-webcomponent"]){i.style=!0,""===n["data-scoped"]&&(i.styleScoped=!0);continue}i=i.appendChild(new T(t[2],n,i.isSVG)),a.push(i)}if(t[1]||t[4]||E[t[2]])for(;;){if(i.type===t[2]){a.pop(),i=p(a);break}{if(!P[i.type]||!P[i.type][t[2]])break;a.pop(),i=p(a)}}}}}if(r.style&&"object"===o(r.children[0])&&(r.children[0].style=r.style,r.children[0].styleScoped=r.styleScoped),r.children.length>1)r.type=h.ROOT;else if(r.children.length)return w[e]=r.children[0],r.children[0];return w[e]=r,r}function u(e){var t={};if(e._dozAttach[_])for(var n=Object.keys(e._dozAttach[_]),o=0;o=0;--a){var i=r[a];s(e.nodeName,i.name,i.nodeValue,t,e)}return t}function s(e,t,n,o,r){"string"==typeof n&&y.IS_STRING_QUOTED.test(n)&&(n=n.replace(y.REPLACE_QUOT,"""));var a=A(t),i=y.IS_CUSTOM_TAG.test(e)&&!a?f(t):t;r&&b.callAppComponentPropsAssignName(r,t,n,a,o,function(e){i=e}),o[i]=t===m.FORCE_UPDATE||n}var f=n(8),d=n(1),y=d.REGEX,m=d.ATTR,h=d.TAG,_=d.PROPS_ATTRIBUTES,v=new RegExp("$")),b=n(0),g=n(5),A=g.isDirective,C=n(14),w=C.tplCache,E={meta:!0,img:!0,link:!0,input:!0,area:!0,br:!0,hr:!0},S={li:{li:!0},p:{p:!0,div:!0},td:{td:!0,th:!0},th:{td:!0,th:!0}},P={li:{ul:!0,ol:!0},a:{div:!0},b:{div:!0},i:{div:!0},p:{div:!0},td:{tr:!0,table:!0},th:{tr:!0,table:!0}},T=function(){function e(t,n,o,a,i){r(this,e),this.type=t,this.props=n,this.children=[],a&&(this.style=a),i&&(this.styleScoped=i),(o||"svg"===t)&&(this.isSVG=!0),void 0!==n.key&&(this.key=n.key)}return i(e,[{key:"appendChild",value:function(e){return e.props&&void 0!==e.props.key&&(this.hasKeys=!0),this.children.push(e),e}}]),e}();e.exports={compile:l,serializeProps:u,propsFixer:s,Element:T,removeNLS:c,last:p}},function(e,t){function n(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}e.exports=n},function(module,exports,__webpack_require__){function _typeof(e){"@babel/helpers - typeof";return(_typeof="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)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(_classCallCheck(this,Doz),this.baseTemplate="<".concat(TAG.APP,">"),REGEX.IS_ID_SELECTOR.test(cfg.root)&&(cfg.root=document.getElementById(cfg.root.substring(1))),REGEX.IS_ID_SELECTOR.test(cfg.template)&&(cfg.template=document.getElementById(cfg.template.substring(1)),cfg.template=cfg.template.innerHTML),!(cfg.root instanceof HTMLElement||cfg.root instanceof ShadowRoot))throw new TypeError("root must be an HTMLElement or an valid ID selector like #example-root");if(!cfg.mainComponent&&!(cfg.template instanceof HTMLElement||"string"==typeof cfg.template||"function"==typeof cfg.template))throw new TypeError("template must be a string or an HTMLElement or a function or an valid ID selector like #example-template");if(cfg.root.hasChildNodes){var appNode=cfg.root.firstElementChild;makeSureAttach(appNode),appNode&&!appNode._dozAttach[ALREADY_WALKED]&&appNode.parentNode.removeChild(appNode)}if(this.cfg=Object.assign({},{components:[],shared:{},useShadowRoot:!1,propsListener:null,propsListenerAsync:null,listeners:null,actions:{},autoDraw:!0,enableExternalTemplate:!1},cfg),Object.defineProperties(this,{_lastUId:{value:0,writable:!0},_components:{value:{},writable:!0},_usedComponents:{value:{},writable:!0},_cache:{value:new Map},_onAppReadyCB:{value:[],writable:!0},_onAppComponentsMounted:{value:new Map,writable:!0},_callAppReady:{value:function(){for(var e=this._onAppReadyCB,t=0;t<=e.length-1;t++)!function(e){"function"==typeof e&&e._instance&&e.call(e._instance)}(e[t]);this._onAppReadyCB=[]}},_onAppDrawCB:{value:[],writable:!0},_onAppCB:{value:{},writable:!0},isWebComponent:{value:this.cfg.isWebComponent},byAppCreate:{value:this.cfg.byAppCreate},useShadowRoot:{value:this.cfg.useShadowRoot,writable:!0,enumerable:!0},_root:{value:this.cfg.root},appId:{value:window.DOZ_APP_ID||Math.random().toString(36).substring(2,15),enumerable:!0},appIntId:{value:appCounter++,enumerable:!0},action:{value:bind(this.cfg.actions,this),enumerable:!0},onAppEmit:{value:this.cfg.onAppEmit,writable:!0,enumerable:!0},shared:{value:this.cfg.shared,writable:!0,enumerable:!0},setAllAttributes:{value:this.cfg.setAllAttributes,writable:!0,enumerable:!0},onVdomUpdateElement:{value:this.cfg.onVdomUpdateElement,writable:!0,enumerable:!0},cacheStores:{value:{kCache:new Map,hCache:new Map},enumerable:!0},mount:{value:function value(template,root){var parent=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._tree;if("string"==typeof root&&(root=document.querySelector(root)),!((root=root||parent._rootElement)instanceof HTMLElement))throw new TypeError("root must be an HTMLElement or an valid selector like #example-root");var contentStr=this.cfg.enableExternalTemplate?eval("`"+toLiteralString(template)+"`"):template,autoCmp={tag:TAG.MOUNT,cfg:{props:{},template:function(e){return contentStr}}};return createInstance({root:root,template:"<".concat(TAG.MOUNT,">"),app:this,parentCmp:parent,autoCmp:autoCmp,mount:!0})},enumerable:!0}}),Array.isArray(this.cfg.components))for(var _defined3=function(e){"object"===_typeof(e)&&"string"==typeof e.tag&&"object"===_typeof(e.cfg)&&(_this._components[e.tag]=e)},_defined4=this.cfg.components,_i4=0;_i4<=_defined4.length-1;_i4++)_defined3(_defined4[_i4],_i4,_defined4);else if("object"===_typeof(this.cfg.components))for(var _defined5=function(e){_this._components[e]={tag:e,cfg:_this.cfg.components[e]}},_defined6=Object.keys(this.cfg.components),_i6=0;_i6<=_defined6.length-1;_i6++)_defined5(_defined6[_i6],_i6,_defined6);if(plugin.load(this),directive.callAppInit(this),this.cfg.mainComponent)this._tree=createInstance({mountMainComponent:!0,root:this.cfg.root,component:this.cfg.mainComponent,app:this,innerHTML:this.cfg.innerHTML});else{this._components[TAG.APP]={tag:TAG.APP,cfg:{template:"function"==typeof cfg.template?cfg.template:function(){var contentStr=toLiteralString(cfg.template);return/\${.*?}/g.test(contentStr)?eval("`"+contentStr+"`"):contentStr}}};for(var _defined7=function(e){["template","root"].includes(e)||(_this._components[TAG.APP].cfg[e]=cfg[e])},_defined8=Object.keys(cfg),_i8=0;_i8<=_defined8.length-1;_i8++)_defined7(_defined8[_i8],_i8,_defined8)}if(this.cfg.listeners)for(var _defined9=function(e){_this.on(e,_this.cfg.listeners[e])},_defined10=Object.keys(this.cfg.listeners),_i10=0;_i10<=_defined10.length-1;_i10++)_defined9(_defined10[_i10],_i10,_defined10);!this.cfg.mainComponent&&this.cfg.autoDraw&&this.draw(),this.canAppReady()}return _createClass(Doz,[{key:"canAppReady",value:function(){var e=this;this._onAppComponentsMounted.size?setTimeout(function(){e.canAppReady()}):(this._callAppReady(),this.emit("ready",this))}},{key:"draw",value:function(){return this.cfg.autoDraw||(this.cfg.root.innerHTML=""),this._tree=createInstance({root:this.cfg.root,template:this.baseTemplate,app:this}),this}},{key:"mainComponent",get:function(){return this._tree}},{key:"on",value:function(e,t){if("string"!=typeof e)throw new TypeError("Event must be a string");if("function"!=typeof t)throw new TypeError("Callback must be a function");return this._onAppCB[e]||(this._onAppCB[e]=[]),this._onAppCB[e].push(t),this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,o=new Array(n>1?n-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};s;){(function(){if(x(s),s._dozAttach[b])return s=s.nextElementSibling,"continue";s._dozAttach[b]=!0,O.callAppWalkDOM(f,s),r=k(s),O.callAppComponentAssignName(f,s,function(e){r=e});var d={};f.cmp&&f.cmp._components&&(d=f.cmp._components);var y=n.autoCmp||d[r]||n.app._components[r]||g.getComponent(r),m=void 0;if(y){var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(R=e||R,!R._isRendered){if(R._isRendered=!0,R.render(!0),c||(c=R),R._rootElement._dozAttach[_]=R,R.getHTMLElement()._dozAttach[v]=R,R._defaultSlot&&R.getHTMLElement().firstElementChild){var t=document.createComment("slot");R.getHTMLElement().replaceChild(t,R.getHTMLElement().firstElementChild)}T(function(){R.render(!1,[],!0)}),A.callMount(R),A.callMountAsync(R),R.waitMount&&(R.appReadyExcluded||n.app._onAppComponentsMounted.delete(R))}};if(f.cmp){var C=s.outerHTML;f.cmp.rawChildren.push(C)}if(f.cmp&&f.cmp.mounted)return s=s.nextElementSibling,"continue";if(f.cmp&&!1===f.cmp.autoCreateChildren)return u.push(s),s=s.nextElementSibling,"continue";var R,I=w(s),M={};if("function"==typeof y.cfg){if(!(y.cfg.prototype instanceof S)){var D=y.cfg;y.cfg=function(e){function t(){return i(this,t),n.apply(this,arguments)}p(t,e);var n=l(t);return a(t)}(S),y.cfg.prototype.template=D}R=new y.cfg({tag:y.tag||r,root:s,app:n.app,props:I,componentDirectives:M,parentCmp:f.cmp||n.parent})}else if(y.cfg.then){var z=null,j=null;s.parentElement&&s.parentElement._dozAttach&&s.parentElement._dozAttach.props&&(s.parentElement._dozAttach.props["d-async-loading"]&&(z=s.parentElement._dozAttach.props["d-async-loading"]),s.parentElement._dozAttach.props["d-async-error"]&&(j=s.parentElement._dozAttach.props["d-async-error"])),function(a,i,p){var c=null,l=null;if(i){var u={},s={};"object"===o(i)&&i.component&&(u=i.props||u,s=i.directives||s,i=i.component),R=new i({tag:i.tag||"loading-component",root:a,app:n.app,props:u,componentDirectives:s,parentCmp:f.cmp||n.parent}),c=R}y.cfg.then(function(i){if("object"===o(i)){var p=Object.keys(i);i=i[p[p.length-1]]}if(i.tag){var l=document.createElement(i.tag);a.replaceWith(l),a=l}R=new i({tag:y.tag||r,root:a,app:n.app,props:I,componentDirectives:M,parentCmp:f.cmp||n.parent}),P(R),R.app.emit("componentPropsInit",R),c&&c.destroy(),h(R),t(R.getHTMLElement(),{cmp:R}),e(f,R)}).catch(function(e){if(p){var t={},r={};"object"===o(p)&&p.component&&(t=p.props||t,r=p.directives||r,p=p.component),R=new p({tag:p.tag||"error-component",root:a,app:n.app,props:t,componentDirectives:r,parentCmp:f.cmp||n.parent}),l=R}console.error(e)})}(s,z,j)}else R=new S({tag:y.tag||r,cmp:y,root:s,app:n.app,props:I,componentDirectives:M,parentCmp:f.cmp||n.parent});if(!R||R.__beforeCreateReturnsFalse)return s=s.nextElementSibling,"continue";R.rawChildrenObject=s._dozAttach.elementChildren,R.$domEl=s,"object"===o(R.module)&&E(R,R.module),P(R),R.app.emit("componentPropsInit",R),R.waitMount?(R.appReadyExcluded||n.app._onAppComponentsMounted.set(R,!1),R.runMount=h,A.callWaitMount(R)):!1!==A.callBeforeMount(R)?h():R.runMount=h,m=R,e(f,R),n.autoCmp=null}s.hasChildNodes()&&(m?t(s.firstElementChild,{cmp:m}):t(s.firstElementChild,{cmp:f.cmp})),s=s.nextElementSibling})()}}var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.root){n.mountMainComponent||(n.template instanceof HTMLElement?n.template.parentNode||n.root.appendChild(n.template):"string"==typeof n.template&&(n.template=m.create(n.template),n.root.appendChild(n.template)));var r,c=null,u=[];if(n.mountMainComponent){var s=new n.component({cmp:n.component,root:n.root,app:n.app,props:n.props||{},componentDirectives:{},parentCmp:null});if(P(s),s.app.emit("componentPropsInit",s),s._isRendered=!0,s._mainComponentByAppCreate=!0,s.render(!0),n.innerHTML)for(var f=m.create(n.innerHTML,"div"),d=f.childNodes,y=0;y<=d.length-1;y++)!function(e){s.getHTMLElement().appendChild(e)}(d[y]);t(s.getHTMLElement(),{cmp:s});for(var h=0;h<=u.length-1;h++)!function(e){e.remove()}(u[h]);return A.callMount(s),A.callMountAsync(s),s}t(n.template);for(var C=0;C<=u.length-1;C++)!function(e){e.remove()}(u[C]);return c}}var m=n(13),h=n(1),_=h.COMPONENT_ROOT_INSTANCE,v=h.COMPONENT_INSTANCE,b=h.ALREADY_WALKED,g=(h.REGEX,n(2)),A=n(6),C=n(7),w=C.serializeProps,E=n(32),S=n(12),P=n(23),T=n(3),O=n(0),k=n(57),x=n(4);e.exports=y},function(e,t){e.exports={components:{},webComponents:{tags:{},ids:{}},plugins:[],directives:{},directivesKeys:[]}},function(module,exports,__webpack_require__){function _typeof(e){"@babel/helpers - typeof";return(_typeof="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)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(e)){o&&this.beginSafeRender(),n=new Array(e.length);for(var r=0;r<=e.length-1;r++)n[r]=t(e[r],r,e);o&&this.endSafeRender()}return n}},{key:"toStyle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return toInlineStyle(e,t)}},{key:"render",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2]);if(!this._renderPause){this.beginSafeRender();for(var n=Object.keys(this.props),o=[this.h],r=0;r0&&void 0!==arguments[0])||arguments[0];this._renderPause=!1,e&&this.render()}},{key:"prepareCommit",value:function(){proxy.pause(this.props),this.renderPause()}},{key:"commit",value:function(){this.renderResume(),proxy.resume(this.props)}},{key:"isRenderPause",get:function(){return this._renderPause}},{key:"mount",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._unmounted){if(!1===hooks.callBeforeMount(this))return this;this._unmountedPlaceholder.parentNode.replaceChild(this._unmountedParentNode,this._unmountedPlaceholder),this._unmounted=!1,this._unmountedParentNode=null,this._unmountedPlaceholder=null,hooks.callMount(this);for(var o=Object.keys(this.children),r=0;r<=o.length-1;r++)!function(e){t.children[e].mount()}(o[r]);return this}if(e){var a=this._rootElement;return"string"==typeof n.selector?a=a.querySelector(n.selector):n.selector instanceof HTMLElement?a=n.selector:1!==this._rootElement.nodeType&&(a=this.getHTMLElement()),this._unmounted=!1,this._unmountedParentNode=null,this._unmountedPlaceholder=null,this.app.mount(e,a,this)}}},{key:"unmount",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;if(this.lockRemoveInstanceByCallback&&"function"==typeof this.lockRemoveInstanceByCallback)return void this.lockRemoveInstanceByCallback(this.unmount,t,n,o);if(t||!Boolean(this._unmountedParentNode)&&this._rootElement&&this._rootElement.parentNode&&this._rootElement.parentNode.parentNode){if(!1===hooks.callBeforeUnmount(this))return!1;this._unmountedParentNode=this._rootElement.parentNode,this._unmountedPlaceholder=document.createComment(Date.now().toString()),t?this._rootElement.parentNode&&this._rootElement.parentNode.parentNode.removeChild(this._rootElement.parentNode):this._rootElement.parentNode.parentNode.replaceChild(this._unmountedPlaceholder,this._unmountedParentNode),this._unmounted=!n,o||hooks.callUnmount(this);for(var r=Object.keys(this.children),a=0;a<=r.length-1;a++)!function(r){e.children[r].unmount(t,n,o)}(r[a]);return this}}},{key:"destroy",value:function(e){var t=this;if(this.lockRemoveInstanceByCallback&&"function"==typeof this.lockRemoveInstanceByCallback)return void this.lockRemoveInstanceByCallback(this.destroy,e);if(!1!==this.unmount(e,!0)&&(e||this._rootElement&&!1!==hooks.callBeforeDestroy(this))){for(var n=Object.keys(this.children),o=0;o<=n.length-1;o++)!function(e){t.children[e].destroy()}(n[o]);if(hooks.callDestroy(this),this.parent&&this.parent.children){for(var r in this.parent.children)this.parent.children.hasOwnProperty(r)&&this===this.parent.children[r]&&delete this.parent.children[r];if(this.parent.childrenByTag[this.tag]){var a=this.parent.childrenByTag[this.tag].indexOf(this);-1!==a&&this.parent.childrenByTag[this.tag].splice(a,1)}}return!0}}},{key:"template",value:function(){return""}},{key:"_initTemplate",value:function _initTemplate(opt){if("string"==typeof opt.cmp.cfg.template&&opt.app.cfg.enableExternalTemplate){var contentTpl=opt.cmp.cfg.template;REGEX.IS_ID_SELECTOR.test(contentTpl)?opt.cmp.cfg.template=function(){var contentStr=toLiteralString(document.querySelector(contentTpl).innerHTML);return eval("`"+contentStr+"`")}:opt.cmp.cfg.template=function(){return contentTpl=toLiteralString(contentTpl),eval("`"+contentTpl+"`")}}}},{key:"_initRawProps",value:function(e){this._isSubclass?this._rawProps=Object.assign({},e.props):(this._rawProps=Object.assign({},"function"==typeof e.cmp.cfg.props?e.cmp.cfg.props():e.cmp.cfg.props,e.props),this._initTemplate(e)),Object.defineProperty(this,"_initialProps",{value:cloneObject(this._rawProps)})}},{key:"getDozWebComponentById",value:function(e){return this.getWebComponentById(e)}},{key:"getDozWebComponentByTag",value:function(e){return this.getWebComponentByTag(e)}},{key:"getWebComponentById",value:function(e){return data.webComponents.ids[e]||null}},{key:"getWebComponentByTag",value:function(e){return data.webComponents.tags[e]||null}},{key:"_setProps",value:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.props[t]=e[t])}},{key:"setProps",value:function(e){this.prepareCommit(),this._setProps(e),this.commit()}},{key:"setPropsAsync",value:function(e){var t=this;delay(function(){return t._setProps(e)})}}]),Component}(DOMManipulation);module.exports=Component,module.exports._Component=Component},function(e,t){var n,o=/\n/g,r=/\s+/g,a={create:function(e,t){var n;e=e.replace(o," "),e=e.replace(r," ");var a=document.createElement("div");return a.innerHTML=e,t&&a.childNodes.length>1?(n=document.createElement(t),n.innerHTML=a.innerHTML):n=a.firstChild||document.createTextNode(""),n},decode:function(e){return n=n||document.createElement("div"),n.innerHTML=e,n.textContent}};e.exports=a},function(e,t){e.exports={kCache:new Map,tplCache:Object.create(null),hCache:new Map}},function(e,t,n){function o(e){"@babel/helpers - typeof";return(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)}var r=n(3),a=n(34),i=function(){var e=[],t=[],n=[],i=null,p=function(e,t){return t.split(".").reduce(function(e,t){return e?e[t]:void 0},e||self)},c=function c(l,u,s,f){var d=null==u,y=s||null,m=f||"",h=[],_=function(e,t){return e instanceof Array?""!==m?m:t:""!==m?m+"."+t:t},v=0,b=function(e){if(!0!==y.paused)if(d&&(u=++v>1,r(function(){v=0})),!0===u)r(function(){if(e===h.length){for(var t=0;t-1)return y.proxies[o];return c(n,u,y,""!==m?m+"."+t:t)}var s=y.renderMode?a.encode(n):n,f=y.manipulate;return"function"==typeof f&&(s=f(s,t,!0)),s},deleteProperty:function(e,o){var r=!0;i===A&&(r=!1,i=null);var a=Object.assign({},e),p=_(e,o);if(!y.paused){if(h.push({type:"delete",target:e,property:o,newValue:null,previousValue:a[o],currentPath:p,proxy:A}),"function"==typeof y.beforeChange&&y.checkBeforeChange!==p){y.checkBeforeChange=p;if(!1===y.beforeChange(h))return y.checkBeforeChange="",!1}y.checkBeforeChange=""}if(!0===r){var c,l;for(c=0,l=t.length;c-1?n[w].push(C):(t.push(l),n.push([C])),A};return{create:function(e,t,n,o){!0===e.__isProxy&&(e=e.__getTarget);var r=c(e,t);return"function"==typeof n&&this.observe(r,n),function e(t){for(var n=t.__getTarget,r=Object.keys(n),a=0,i=r.length;a3&&void 0!==arguments[3]?arguments[3]:0,u=arguments.length>4?arguments[4]:void 0,f=arguments.length>5?arguments[5]:void 0,y=arguments.length>6?arguments[6]:void 0;if(e&&(t!==n||u.tag===d.MOUNT)){if(u&&u.app&&u.app.onVdomUpdateElement){var v=u.app.onVdomUpdateElement(e,t,n,u,f,y);v&&(e=v.$parent||e,t=v.newNode||t,n=v.oldNode||n,u=v.cmp||u)}if(t&&t.cmp&&(u=t.cmp),t&&n&&t.style!==n.style&&i(t,u),y&&e._dozAttach[m]){var A=b.callDrawByParent(e._dozAttach[m],t,n);void 0!==A&&null!==A&&"object"===o(A)&&(t=A.newNode||t,n=A.oldNode||n);var C=!(!t||!t.props)&&t.props.slot;if(e._dozAttach[m]._defaultSlot&&!C&&(C=_),"object"===o(t)&&C&&e._dozAttach[m]._slots[C]){for(var w=e._dozAttach[m]._slots[C],S=0;S<=w.length-1;S++)!function(o){if(o.parentNode){t.isNewSlotEl=!0;var r=a(t,u,f,e._dozAttach[m]||y);r.removeAttribute("slot"),o.parentNode.replaceChild(r,o),o.__newSlotEl=r}else{var i=Array.from(o.__newSlotEl.parentNode.children).indexOf(o.__newSlotEl);p(o.__newSlotEl.parentNode,t,n,i,u,f,e._dozAttach[m]||y)}}(w[S]);return}}if(!n){var P;if(e.childNodes.length){var T=e.childNodes[e.childNodes.length-1];if(g(T),T._dozAttach[h])return P=a(t,u,f,e._dozAttach[m]||y),e.insertBefore(P,T),P}return g(e),P=a(t,u,f,e._dozAttach[m]||y),e.appendChild(P),P}if(t){if(r(t,n)){var O=e.childNodes[l];if(!O)return;var k=u.$$beforeNodeChange(e,O,t,n);if(k)return k;var x=a(t,u,f,e._dozAttach[m]||y);return e.replaceChild(x,O),u.$$afterNodeChange(x,O),O._dozAttach&&O._dozAttach[m]&&(O._dozAttach[m].unmount(),O._dozAttach[m].destroy()),x}if(void 0!==t.hasKeys||void 0!==n.hasKeys){for(var R=e.childNodes[l],I=t.children,M=new Array(I.length),D=0;D<=I.length-1;D++)M[D]=function(e){return e.key}(I[D]);for(var z=n.children,j=new Array(z.length),N=0;N<=z.length-1;N++)j[N]=function(e){return e.key}(z[N]);void 0===R._dozAttach.keyList&&(R._dozAttach.keyList=new Map);for(var L=[],B=0;B<=j.length-1;B++)(function(e){return!M.includes(e)})(j[B])&&L.push(j[B]);for(var U=0;U=2?t[n[1].substr(1)]+"":t[n[1]]:e}return e.replace(m,function(e,n){return n?t[n]:e})}function a(e){for(var t="",n=0;n1?c-1:0),s=1;s"===g[w]&&(m=!0);g.indexOf("-1&&(h=!0,_=!0),g.indexOf("-1&&(h=!1),_&&r&&(p=p.replace(/