UNPKG

@codeperate/app-asset

Version:

Codeperate App Asset

1 lines 1.02 kB
import{r as s,h as t,H as r,a as e}from"./p-511e9258.js";import{s as o}from"./p-af818f9b.js";import"./p-58253349.js";const l=class{constructor(t){s(this,t),this.markedClear=[]}disconnectedCallback(){this.unsubscribe&&this.unsubscribe()}markedClearHandler(){if(this.markedClear.length>0){for(const s of this.markedClear)o.modals.splice(s,1);this.markedClear.splice(0,this.markedClear.length)}}render(){return t(r,{class:"absolute block top-0 left-0 w-full"+(o.modals.length>0?" h-full":"")},t("div",{class:"sticky w-full top-0 left-0"+(o.modals.length>0?" h-screen":"")},o.modals.map(((s,r)=>{var e,o;return t("cdp-modal",{key:r,props:{display:!s.close},config:null!==(e=s.config)&&void 0!==e?e:null===(o=this.config)||void 0===o?void 0:o.defaultModalConfig,onClosed:t=>{this.markedClear=[...this.markedClear,r],s.onClosed&&s.onClosed(t)},onOpened:t=>{s.onOpened&&s.onOpened(t)}},s.content)}))))}get rootEl(){return e(this)}static get watchers(){return{markedClear:["markedClearHandler"]}}};export{l as cdp_modal_store}