import { h } from "@stencil/core";
export class EclFileTranslations {
    constructor() {
        this.others = false;
    }
    getClass() {
        const styleClasses = [
            `ecl-file__translation-container`,
            `sc-ecl-file-${this.theme}`,
            this.styleClass
        ];
        return styleClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    componentDidRender() {
        const translationsTotal = this.el.querySelectorAll('.ecl-file__translation-item').length;
        const text = document.createTextNode(` (${translationsTotal}) `);
        if (this.el.querySelector('.ecl-file__translation-toggle')) {
            this.el.querySelector('.ecl-file__translation-toggle .ecl-button__icon').before(text);
        }
    }
    render() {
        return (h("div", { key: '217c411335fdf9aaf79b9f90a168bc262a1030c5', class: this.getClass(), "data-ecl-file-translation-container": true }, h("ecl-button", { key: 'e3f4f9ac27c432c97e4e2fd209311d2fdce70857', styleClass: `ecl-file__translation-toggle sc-ecl-file-${this.theme}`, variant: "tertiary", "data-ecl-file-translation-toggle": true, theme: this.theme }, this.toggleLabel, h("ecl-icon", { key: 'c17979edc0afcb4afa62f103602ac146a8132f59', styleClass: "ecl-button__icon ecl-button__icon--after", icon: "corner-arrow", rotate: "180", size: "fluid" })), h("ul", { key: 'cf9704b444d2063298f28532d7438a0346f49059', class: `ecl-file__translation-list sc-ecl-file-${this.theme}` }, h("slot", { key: '7edaa3370f47be8502f0debf8c780fb14cbe5dcc' }), this.others ?
            h("li", { class: `ecl-file__translation-item ecl-file__translation-description sc-ecl-file-${this.theme}` }, h("slot", { name: "others" })) : '')));
    }
    static get is() { return "ecl-file-translations"; }
    static get properties() {
        return {
            "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"
            },
            "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"
            },
            "toggleLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "toggle-label"
            },
            "others": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "others",
                "defaultValue": "false"
            }
        };
    }
    static get elementRef() { return "el"; }
}
