All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.module-min.compile.js Maven / Gradle / Ivy

The newest version!
import{Template,TemplateDOM}from"./type.js";import{idl_attributes}from"./factory.js";const event_types={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},event_bubble={blur:"focusout",focus:"focusin",mouseleave:"mouseout",mouseenter:"mouseover"};function replaceComments(a){return a.replace(//g,"")}function strip(a){return a.replace(/({{|}})/g,"").trim()}let message=0,counter=0;export default function compile(a,b,c,d,e,f){if(!1,b)return new Promise(function(c){const d=compile(a);"function"==typeof b&&b(d),c(d)});e||(d=[],c=[d],d.index=e={current:-1,count:0,last:-1,inc:0,included:!1});const g=f?{}:{tpl:{}},h=f?g:g.tpl;if(!f){if("string"==typeof a)if(/<.*>/.test(a)){const b=document.createElement("div");b.innerHTML=a,a=b.firstElementChild}else g.name=a,a=document.getElementById(a);a=a,a.content&&(!g.name&&(g.name=a.id||a.getAttribute("name")),a=a.content.firstElementChild)}const i=a.tagName;if(!i||"SCRIPT"===i){let b;if((b=(i?a.firstChild:a).nodeValue)&&b&&b.trim()){if(b.includes("{{@")){let a=b.replace(/{{@([\s\S]+)}}/g,"$1").trim();if(b=/{{[\s\S]+}}/.test(a)?a.replace(/{{([\s\S]+)}}/g,"{{$1}}"):"",a&&(a=a.replace(/{{([\s\S]+)}}/g,"")),a&&d.push(a),"SCRIPT"===i)return b.trim()&&(h.text=b,h.tag=i),h}b&&b.trim()&&(b.includes("{{#")?handle_value(h,"html",b,!1,null,e,c,d):(e.count++,handle_value(h,"text",b,!1,null,e,c,d)))}if(!i)return b&&b.trim()?h:null}i&&(h.tag=i);let j=a.attributes;if(j&&j.length){const b={};for(let c=0;c




© 2015 - 2025 Weber Informatics LLC | Privacy Policy