'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-420e0ca1.js');

const EclFileTranslations = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.theme = 'ec';
        this.styleClass = undefined;
        this.toggleLabel = undefined;
        this.others = false;
    }
    getClass() {
        const styleClasses = [
            `ecl-file__translation-container`,
            `sc-ecl-file-${this.theme}`,
            this.styleClass
        ];
        return styleClasses.join(' ');
    }
    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__label').appendChild(text);
        }
    }
    render() {
        return (index.h("div", { class: this.getClass(), "data-ecl-file-translation-container": true }, index.h("ecl-button", { styleClass: `ecl-file__translation-toggle sc-ecl-file-${this.theme}`, variant: "ghost", "data-ecl-file-translation-toggle": true, theme: this.theme }, this.toggleLabel, index.h("ecl-icon", { styleClass: "ecl-button__icon ecl-button__icon--after", icon: "corener-arrow", transform: "rotate-180", size: "fluid" })), index.h("ul", { class: `ecl-file__translation-list sc-ecl-file-${this.theme}` }, index.h("slot", null), this.others ?
            index.h("li", { class: `ecl-file__translation-item ecl-file__translation-description sc-ecl-file-${this.theme}` }, index.h("slot", { name: "others" })) : '')));
    }
    get el() { return index.getElement(this); }
};

exports.ecl_file_translations = EclFileTranslations;

//# sourceMappingURL=ecl-file-translations.cjs.entry.js.map