import { h } from '@stencil/core';
export class EclFileTranslations {
  constructor() {
    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 (h("div", { class: this.getClass(), "data-ecl-file-translation-container": true }, 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, h("ecl-icon", { styleClass: "ecl-button__icon ecl-button__icon--after", icon: "corener-arrow", transform: "rotate-180", size: "fluid" })), h("ul", { class: `ecl-file__translation-list sc-ecl-file-${this.theme}` }, h("slot", null), 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": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "theme",
        "reflect": false,
        "defaultValue": "'ec'"
      },
      "styleClass": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "style-class",
        "reflect": false
      },
      "toggleLabel": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "toggle-label",
        "reflect": false
      },
      "others": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "others",
        "reflect": false,
        "defaultValue": "false"
      }
    };
  }
  static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-file-translations.js.map
