/**  
 * @since Last modified: 2024-09-17 00:31:28
 * @class AlertElem
 * @description The custom element : ax-alert .
 * @augments CustomElement
 * @see {@link https://codepen.io/axui/pen/qBwEzLp|demo @ codepen}
 * @example
 * <ax-alert>Long article</ax-alert>;
 */
import createEl from '../utils/createEl';
import CustomElement from './CustomElem';
import Alert from '../modules/Alert';
import optAlert from '../options/optAlert';
import alias from '../global/alias';
class AlertElem extends CustomElement {
    constructor() {
        super();
        this.createShadow();
        super.createObs();
    }
    createShadow() {
        this.shadowEl = this.attachShadow({ mode: "open" });
        this.slotEl = createEl('slot');
        this.shadowEl.appendChild(this.slotEl);
    }
    render() {
        this.wrapEl = createEl('div',{[alias]:'slot-host'}, this.innerHTML);
        this.innerHTML = '';
        this.appendChild(this.wrapEl);
        this.ins = new Alert(this.wrapEl);
    }
    static get observedAttributes() {
        return [...optAlert.map((k: any) => k.attr), 'options'];
    }
    connectedCallback() {
        this.render();
    }
    attributeChangedCallback(name: string, oldVal: string, newVal: string) {
        super.updateProxy(name, newVal,optAlert);
    }
    disconnectedCallback() {
    }
    adoptedCallback() {
    }
}
window.customElements.define("ax-alert", AlertElem);
export default AlertElem;
