/**  
 * @since Last modified: 2024-09-17 00:29:17
 * @class MoreElem
 * @description The custom element : ax-more .
 * @augments CustomElem
 * @see {@link https://codepen.io/axui/pen/YzBeJNO|demo @ codepen}
 * @example
 * <ax-more>Long article</ax-more>;
 */
import createEl from '../utils/createEl';
import More from '../modules/More';
import optMore from '../options/optMore';
import CustomElem from './CustomElem';
import alias from '../global/alias';
class MoreElem extends CustomElem {
    constructor() {
        super();
        this.createShadow();
        super.createObs();
    }
    static get observedAttributes() {
        return [...optMore.map((k: any) => k.attr), 'options'];
    }
    attributeChangedCallback(name: string, oldVal: string, newVal: string) {
        super.updateProxy(name, newVal, optMore);
    }
    connectedCallback() {
        this.render();
    }
    disconnectedCallback() {
    }
    adoptedCallback() {
    }
    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 More(this.wrapEl);
    }
}
window.customElements.define("ax-more", MoreElem);
export default MoreElem;
