import { h } from "@stencil/core";
export class EclAccordionItem {
    constructor() {
        this.handleClick = () => {
            this.toggleItem.emit(this.itemId);
        };
    }
    getClass() {
        return [
            `ecl-accordion__item`,
            `sc-ecl-accordion-${this.theme}`,
            this.styleClass
        ].join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    render() {
        const titleId = `${this.itemId}-title`;
        const contentId = `${this.itemId}-content`;
        return (h("div", { key: '0870354b49a3224af6070ff8e0f4bc6a6adf606b', class: this.getClass() }, h("div", { key: '39dd262aef893ece8eda8fbd98a990fc31d04b35', class: `ecl-accordion__title sc-ecl-accordion-${this.theme}`, id: titleId }, h("button", { key: '59696a18242a15b9e06e2ef0b0ca9147399b78e9', type: "button", "data-ecl-accordion-toggle": true, onClick: this.handleClick, "aria-controls": contentId, "aria-expanded": this.expanded ? 'true' : 'false', class: `ecl-accordion__toggle sc-ecl-accordion-${this.theme}` }, h("span", { key: '63f6804e41104d64c4e671c94a3ed62dcf54d831', class: `ecl-accordion__toggle-flex sc-ecl-accordion-${this.theme}` }, h("span", { key: 'f2f79d78ecfabe1f83acd997cb4f9c62e2ad1412', class: `ecl-accordion__toggle-title sc-ecl-accordion-${this.theme}` }, this.label), h("span", { key: 'd79c0a92564d2a4ca00cf75b15bfbcd75b706eeb', class: `ecl-accordion__toggle-indicator sc-ecl-accordion-${this.theme}` }, h("ecl-icon", { key: 'd94897417447af84f4ff5645d347a1d691c1e913', icon: "minus", size: "s", "style-class": `ecl-accordion__toggle-icon ecl-accordion__toggle-icon--minus sc-ecl-accordion-${this.theme}` }), h("ecl-icon", { key: '32c3d11dd0b228cd5bab5ee90fc9fb9662b8af9f', icon: "plus", size: "s", "style-class": `ecl-accordion__toggle-icon ecl-accordion__toggle-icon--plus sc-ecl-accordion-${this.theme}` }))))), h("div", { key: '9cc89a7d65aeaae44c88fbe7c974998da6f74f77', class: `ecl-accordion__content sc-ecl-accordion-${this.theme}`, role: "region", id: contentId, "aria-labelledby": titleId, hidden: this.expanded !== true }, h("slot", { key: '4a07a2c41c24cf2b498f805facfaf96e01221c74' }))));
    }
    static get is() { return "ecl-accordion-item"; }
    static get originalStyleUrls() {
        return {
            "$": ["build/styles/ecl-accordion-item.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["build/styles/ecl-accordion-item.css"]
        };
    }
    static get assetsDirs() { return ["build"]; }
    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"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label"
            },
            "itemId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "item-id"
            },
            "expanded": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "attribute": "expanded"
            },
            "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"
            }
        };
    }
    static get events() {
        return [{
                "method": "toggleItem",
                "name": "toggleItem",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                }
            }];
    }
    static get elementRef() { return "el"; }
}
