import { h } from '@stencil/core';
export class EclCategoryFilterItem {
  constructor() {
    this.styleClass = '';
    this.theme = 'ec';
    this.label = undefined;
    this.path = undefined;
    this.level = undefined;
    this.subItems = false;
  }
  getClass() {
    return [
      `ecl-category-filter__list-item`,
      `sc-ecl-category-filter-${this.theme}`,
      this.styleClass
    ].join(' ');
  }
  getLinkClass() {
    const linkClasses = [
      `ecl-category-filter__item`,
      `sc-ecl-category-filter-${this.theme}`,
      `ecl-category-filter__item--level-${this.level}`,
      this.styleClass
    ];
    if (this.subItems) {
      linkClasses.push(`ecl-category-filter__item--has-children`);
    }
    return linkClasses.join(' ');
  }
  render() {
    const elAttrs = this.subItems ? { 'aria-expanded': "false" } : {};
    return (h("li", Object.assign({ class: this.getClass() }, elAttrs), this.path ?
      h("ecl-link", { "style-class": this.getLinkClass(), path: this.path }, this.label, this.subItems ?
        h("ecl-icon", { "style-class": `ecl-category-filter__item-icon sc-ecl-category-filter-${this.theme}`, icon: this.level === 1 ? 'corner-arrow' : 'solid-arrow', size: this.level === 1 ? 'xs' : 'm', transform: this.level === 1 ? 'rotate-180' : 'rotate-90', slot: this.level === 1 ? 'icon-after' : 'icon-before' }) : '') : '', !this.path ? this.label : '', this.subItems ?
      h("ul", { class: `ecl-category-filter__list sc-ecl-category-filter-${this.theme}` }, h("slot", null)) : ''));
  }
  static get is() { return "ecl-category-filter-item"; }
  static get properties() {
    return {
      "styleClass": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "style-class",
        "reflect": false,
        "defaultValue": "''"
      },
      "theme": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "theme",
        "reflect": false,
        "defaultValue": "'ec'"
      },
      "label": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "label",
        "reflect": false
      },
      "path": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "path",
        "reflect": false
      },
      "level": {
        "type": "number",
        "mutable": false,
        "complexType": {
          "original": "number",
          "resolved": "number",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "level",
        "reflect": false
      },
      "subItems": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "sub-items",
        "reflect": false,
        "defaultValue": "false"
      }
    };
  }
  static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-category-filter-item.js.map
