package.dist.mikado.bundle.module.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mikado Show documentation
Show all versions of mikado Show documentation
Web's fastest template library to build user interfaces.
The newest version!
/**!
* Mikado.js v0.8.329 (Bundle/Module)
* Copyright 2019-2024 Nextapps GmbH
* Author: Thomas Wilkerling
* Licence: Apache-2.0
* https://github.com/nextapps-de/mikado
*/
var n;const p={},w={},y=Object.create(null),A=Object.create(null),B=document.documentElement||document.body.parentNode,C="ontouchstart"in window,D=!C&&window.PointerEvent&&navigator.maxTouchPoints;F.eventCache=!1;F.eventBubble=!1;let aa;
function G(a,b){const c=a.target;if(c!==window&&c!==B){var d=F.eventCache,e=F.eventBubble;b||(b=a.type);var f;d&&(f=c["_mke"+b]);if("undefined"===typeof f){for(var g=c;g&&g!==B;){var h=void 0;"click"===b&&aa&&(h=g.getAttribute("tap"));h||(h=g.getAttribute(b));if(h){var k=h.indexOf(":"),l=g;if(-1Math.abs(J-e)&&15>Math.abs(K-f)&&G(d,"tap")}const c={passive:!1,capture:!0};da=function(d){I(d,D?"pointerdown":"touchstart",a,c);I(d,D?"pointerup":"touchend",b,c)}}function I(a,b,c,d){if("tap"===b){if(C||D){da(a);return}aa=!0;b="click"}window[(a?"add":"remove")+"EventListener"](b,c,d||!1===d?d:!0)};function L(a,b,c){let d;c&&(d=a._mkc)&&(a._mkc=null);const e=b.length,f=[],g={};for(let l=0,m,q,t,r,v=null;l"===x)h=h.firstChild;else{if("|"===x){t=[h.firstChild,h];break a}if("@"===x){t=[h.style,h];break a}h=h.nextSibling}g[z]=h}}t=[h]}r=t[0];t=t[1]||r}}else r=t=a;c&&(v=d?d[l]:{},t._mkc=v);f[l]=new M(v,r,"")}return a._mkp=f}
function N(a,b,c,d,e,f){f||(a.i=1);const g=e||(b.tag?b.svg?document.createElementNS("http://www.w3.org/2000/svg",b.tag):document.createElement(b.tag):document.createTextNode(b.text));let h,k;if(k=b.class)"object"===typeof k?(c.push(new M(h={_c:""},g,d)),(k=k[0])?O(a,k,{fn:"_c",index:c.length-1}):a.i=0):e||(g.className=k);if(k=b.attr)for(const m in k){let q=k[m];"object"===typeof q?(h||c.push(new M(h={},g,d)),h["_a"+m]=!1,(q=q[0])?O(a,q,{fn:"_a",index:c.length-1,key:m}):a.i=0):e||g.setAttribute(m,
q)}if(k=b.event)for(let m in k){let q;if(!e){if("load"===m||"error"===m)window.dispatch=ba,k["on"+m]="dispatch('"+k[m]+"', this)",m="on"+m,q=1;g.setAttribute(m,k[m])}q||ca(m)}if(k=b.style)"object"===typeof k?(c.push(new M(h||(h={}),g.style,d+"@")),h._s="",(k=k[0])?O(a,k,{fn:"_s",index:c.length-1}):a.i=0):e||(g.style.cssText=k);if(k=b.text)if("object"===typeof k){var l=g;k=k[0];b.tag?(d+="|",l=!e&&g.firstChild,l||(l=document.createTextNode(k),g.appendChild(l))):h={};(h||(h={}))._t=k;c.push(new M(h,
l,d));k?O(a,k,{fn:"_t",index:c.length-1}):a.i=0}else e||(b.tag?g.textContent=k:g.nodeValue=k);else if(k=b.child){if(e&&(e=e.firstChild,!e))return null;k.constructor!==Array&&(k=[k]);for(let m=0,q,t=k.length;m",b=N(a,q,c,d,e,1),e){if(ma?this.length+a:a,a=this.g[d]):d=this.index(a));var e;if(this.key){var f=b[this.key];if(e=this.o[f]){if(e!==a){f=this.index(e);const g=fa?this.length+a-1:a,a=this.g[d]):d=this.index(a));this.apply(b,c||this.state,d,a._mkp||L(a,this.m._mkp,this.cache));(b=this.on&&this.on.update)&&b(a,this);return this};
n.cancel=function(){cancelAnimationFrame(this.s);this.s=0;return this};
n.create=function(a,b,c,d){const e=this.key,f=e&&a[e];let g;var h;let k,l;this.pool&&(e?(h=this.j)&&(g=h.get(f))&&(h.delete(f),l=1):(h=this.A)&&h.length&&(g=h.pop()));g||(g=k=this.m,k||(this.m=g=k=N(this,this.tpl.tpl,[],""),S(this)));let m;this.apply&&(h=g._mkp||L(g,this.m._mkp,!!k||this.cache),m=k&&this.cache&&Array(h.length),this.apply(a,b||this.state,c,h,!!k,m));k&&(g=k.cloneNode(!0),m&&!0!==m&&(g._mkc=m),g._mkr=1);e&&(l||(g._mkk=f),d&&(this.o[f]=g));(a=this.on&&this.on[k?"create":"recycle"])&&
a(g,this);return g};n.add=function(a,b,c){let d;"number"===typeof b?(c=0>b?this.length+b:b,b=null,d=cc&&(c+=this.length),d=ch?k:h,m=0;for(d||(d=0);d=k;let v,u,H,z;a.proxy&&(t._mkx?z=a.i:b[d]=T(a,e[d],t));if(!r&&(v=e[d],u=t[g],H=v._mkk,H===u)){z||a.update(v,t,c,d);continue}if(r||!f[u]){r||!a.pool?(k++,l=k>h?k:h,a.add(t,c,d)):a.replace(v,t,c,d);continue}let x,E;for(r=d+1;r=E+m?(q=e[x-1],a.root.insertBefore(q,v),z||a.update(q,
t,c,d),x===E?(1k?k:t)-1),m--,d--);q=1;break}}q||(a.remove(d),k--,l=k>h?k:h,d--)}return a}function la(a,b,c,d){const e=d||a[b];d&&b++;if(bc;b--)a[b]=a[b-1];a[c]=e}
n.append=function(a,b,c){let d;"number"===typeof b?(c=0>b?this.length+b:b,b=null,d=1):"number"===typeof c&&(0>c&&(c+=this.length),d=1);const e=a.length;for(let f=0;fa&&(a=c+a));if(!c||a>=c)return this;b?0>b&&(a-=b+1,0>a&&(a=0),b*=-1):b=1;let d;!a&&b>=c?(d=this.g,b=d.length,this.root.textContent="",this.root._mkd=this.g=[],c=0):(d=this.g.splice(a,b),c-=b);const e=this.pool&&!this.key,f=this.key||this.pool,g=this.on&&this.on.remove;(a=this.key&&this.pool)&&b>=a&&(this.j=new Map,a=0);for(let h=0,k;ha.pool&&a.j.delete(a.j.keys().next().value)):a.A[a.A.length]=b)}n.flush=function(){this.A=[];this.j=new Map;return this};
n.destroy=function(){for(let a=0,b;a=g?(e.add(c),a.length++):ba.length&&this.splice(a.length)):(this.splice(),this.concat(a));return this};n.splice=function(a,b,c){W=!0;a||(a=0);"undefined"===typeof b&&(b=this.length-a,0>b&&(b=0));b&&this.h.remove(a,b);b=c?this.l.splice(a,b,c):this.l.splice(a,b);c&&this.h.add(c,a);W=!1;return b};n.push=function(a){W=!0;this.h.add(a);this[this.length]=a;ma&&this.length++;W=!1};n.unshift=function(a){W=!0;this.h.add(a,0);this.l.unshift(a);W=!1};
n.pop=function(){W=!0;this.h.remove(this.length-1);const a=this.l.pop();W=!1;return a};n.shift=function(){W=!0;this.h.remove(0);const a=this.l.shift();W=!1;return a};n.concat=function(a){const b=a.length;for(let c=0;cb&&(b=this.length+b-1);c!==b&&this.shift(a,b-c);return this};
n.shift=function(a,b){if(!b)return this;if("number"===typeof a){var c=a;a=this.g[a]}else c=this.index(a);const d=0>b;if(d&&c||!d&&cb;c--)this.g[c]=this.g[c-1];else for(;cb&&(b=this.length+b,0>a&&b--),0>a&&(a=this.length+a-1),this.shift(a,b-a-1));return this};
n.after=function(a,b){"number"!==typeof a&&(a=this.index(a));"number"!==typeof b&&(b=this.index(b));b!==a-1&&(0>b&&(b=this.length+b-2,0>a&&b++),0>a&&(a=this.length+a-1),this.shift(a,b-a+1));return this};
n.swap=function(a,b){if(a!==b){let c,d;"number"===typeof a?(c=0>a?this.length+a:a,a=this.g[c]):c=this.index(a);"number"===typeof b?(d=0>b?this.length+b:b,b=this.g[d]):d=this.index(b);const e=c+1!==d;this.root.insertBefore(e?a:b,e?b:a);e&&d+1!==c&&this.root.insertBefore(b,this.g[c+1]||null);this.g[c]=b;this.g[d]=a}return this};const qa={tap:1,change:1,click:1,dblclick:1,input:1,keydown:1,keypress:1,keyup:1,mousedown:1,mouseover:1,mouseout:1,mousemove:1,mouseup:1,mousewheel:1,touchstart:1,touchmove:1,touchend:1,touchcancel:1,reset:1,select:1,submit:1,toggle:1,focusin:1,focusout:1,resize:1,scroll:1,error:1,load:1},ra={blur:"focusout",focus:"focusin",mouseleave:"mouseout",mouseenter:"mouseover"};let sa=0;
function ta(a,b,c,d,e,f){if(b)return new Promise(function(v){const u=ta(a);"function"===typeof b&&b(u);v(u)});e||(d=[],c=[d],d.index=e={current:-1,count:0,last:-1,inc:0,u:!1});const g=f?{}:{tpl:{}},h=f?g:g.tpl;if(!f){if("string"===typeof a)if(/<.*>/.test(a)){var k=document.createElement("div");k.innerHTML=a;a=k.firstElementChild}else g.name=a,a=document.getElementById(a);a.content&&(g.name||(g.name=a.id||a.getAttribute("name")),a=a.content.firstElementChild)}k=a.tagName;if(!k||"SCRIPT"===k){var l;
if((l=(k?a.firstChild:a).nodeValue)&&l&&l.trim()){if(l.includes("{{@")){var m=l.replace(/{{@([\s\S]+)}}/g,"$1").trim();l=/{{[\s\S]+}}/.test(m)?m.replace(/{{([\s\S]+)}}/g,"{{$1}}"):"";m&&(m=m.replace(/{{([\s\S]+)}}/g,""));m&&d.push(m);if("SCRIPT"===k)return l.trim()&&(h.text=l,h.tag=k),h}l&&l.trim()&&(l.includes("{{#")?ua(h,"html",l,!1,null,e,d):(e.count++,ua(h,"text",l,!1,null,e,d)))}if(!k)return l&&l.trim()?h:null}k&&(h.tag=k);if((l=a.attributes)&&l.length){k={};for(m=0;m
© 2015 - 2025 Weber Informatics LLC | Privacy Policy