- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
import{a as e,L as o}from"./core-CJ4hMzNX.js";class t{constructor({content:o="",className:t="",onClose:l=null}={}){this.onClose=l,this.dialog=document.createElement("dialog"),this.dialog.className=t,this.dialog.innerHTML=`\n <form method="dialog" class="${t}-content">\n ${o}\n <button class="${t}-close" value="close">×</button>\n </form>\n `,e(this.dialog,"click",e=>{!e.target.closest(t+"-content")&&this.close()}),e(this.dialog,"cancel",e=>{e.preventDefault(),this.close()})}open(){var e,o;document.body.appendChild(this.dialog),(null==(o=(e=this.dialog).showModal)?void 0:o.call(e))||this.dialog.setAttribute("open",""),document.documentElement.dataset[`${this.dialog.className}Open`]="true"}close(){var e,o,t;(null==(o=(e=this.dialog).close)?void 0:o.call(e))||this.dialog.removeAttribute("open"),this.dialog.remove(),delete document.documentElement.dataset[`${this.dialog.className}Open`],null==(t=this.onClose)||t.call(this)}}const l={modal:class extends t{constructor(e){super({...e,className:"modal"})}}},s={open(e,t={}){const s=l[e];if(!s)return o.warn(`[UIManager] Unknown type: ${e}`),null;const n=new s(t);return n.open(),n},close(e){(null==e?void 0:e.close)&&e.close()}};const n=Object.freeze(Object.defineProperty({__proto__:null,init:function(){}},Symbol.toStringTag,{value:"Module"}));export{s as U,n as _};
|