/**
 * @since Last modified: 2024/05/08 15:40:02
 * @class AlertElem
 * @description The custom element : ax-more .
 * @augments CustomElement
 * @see {@link https://codepen.io/axui/pen/YzBrzxr|demo @ codepen}
 * @example
 * <ax-more>Long article</ax-more>;
 */
import createEl from '../utils/createEl';
import More from '../modules/More';
import { moreOptsMap } from '../utils/optionsMap';
import CustomElement from './CustomElem';
import ax from '../ax';
class AlertElem extends CustomElement {
    constructor() {
        super();
        this.createShadow();
        super.createObserver();
    }
    createShadow() {
        this.shadowDOM = this.attachShadow({ mode: "open" });
        this.slotDom = createEl('slot');
        this.shadowDOM.appendChild(this.slotDom);
    }
    render() {
        this.wrapperDom = createEl(`${ax.pfx}more-wrap`, '', this.innerHTML);
        this.innerHTML = '';
        this.appendChild(this.wrapperDom);
        this.ins = new More(this.wrapperDom);
    }
    static get observedAttributes() {
        return [...moreOptsMap.map((k) => k.attr), 'options'];
    }
    connectedCallback() {
        this.render();
    }
    attributeChangedCallback(name, oldVal, newVal) {
        super.updateProxy(name, newVal, moreOptsMap);
    }
    disconnectedCallback() {
    }
    adoptedCallback() {
    }
}
window.customElements.define("ax-more", AlertElem);
export default AlertElem;
