UNPKG

ziko

Version:

a versatile javaScript framework offering a rich set of UI components, advanced mathematical utilities, reactivity, animations, client side routing and graphics capabilities

39 lines (37 loc) 1.37 kB
// if(globalThis?.document){ // class ZikoUIComponent extends HTMLElement{ // constructor(){ // super(); // this.shadowDOM = this.attachShadow({ mode: 'open' }); // this.wrapper=document?.createElement("div"); // } // connectedCallback() { // this.setAttribute('role', 'region'); // this.setAttribute('data-engine',"zikojs"); // this.shadowDOM.append(this.wrapper); // this.observeContentChanges(); // } // observeContentChanges() { // const observer = new MutationObserver((mutations) => { // mutations.forEach((mutation) => { // if (mutation.type === 'childList' || mutation.type === 'characterData') { // this.wrapper.innerHTML=""; // __Ziko__.__Config__.setDefault({ target: this.wrapper }); // globalThis.eval(this.innerHTML); // } // }); // }); // observer.observe(this, { childList: true, subtree: true, characterData: true }); // } // disconnectedCallback() { // console.log('ZikoUIComponent removed from page.'); // } // } // globalThis.customElements.define('ziko-ui', ZikoUIComponent); // } // else { // var ZikoUIComponent = null; // } // export{ // ZikoUIComponent // }