import { h } from "@stencil/core";
export class EclTagSet {
    getClass() {
        const styleClasses = [
            'ecl-tag-set',
            `sc-ecl-tag-${this.theme}`,
            this.styleClass
        ];
        if (this.colorMode) {
            styleClasses.push(`ecl-color-mode--${this.colorMode}`);
        }
        return styleClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme =
            (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    componentDidLoad() {
        const tagElements = Array.from(this.el.querySelectorAll('ecl-tag'));
        tagElements.forEach((tag) => {
            const li = document.createElement('li');
            li.className = `ecl-tag-set__item sc-ecl-tag-${this.theme}`;
            li.appendChild(tag);
            this.listEl.appendChild(li);
        });
    }
    render() {
        return (h("ul", { key: '4e760bec5e90ca30234ba16496ac2317ac943c32', class: this.getClass(), ref: (el) => (this.listEl = el) }));
    }
    static get is() { return "ecl-tag-set"; }
    static get encapsulation() { return "scoped"; }
    static get properties() {
        return {
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "style-class"
            },
            "theme": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "theme"
            },
            "colorMode": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "color-mode"
            }
        };
    }
    static get elementRef() { return "el"; }
}
