import { h, getAssetPath } from '@stencil/core';
export class EclIcon {
  constructor() {
    this.styleClass = '';
    this.icon = '';
    this.size = 'xs';
    this.color = '';
    this.path = undefined;
    this.transform = '';
    this.theme = 'ec';
    this.sprite = '';
  }
  componentWillLoad() {
    if (!this.sprite) {
      this.path = getAssetPath(`./build/images/${this.theme}/icons.svg`);
    }
    else {
      this.path = getAssetPath(`./build/images/${this.theme}/${this.sprite}.svg`);
    }
  }
  getClass() {
    const styleClasses = [
      `ecl-icon`,
      `ecl-icon--${this.size}`,
      this.styleClass,
    ];
    if (this.color) {
      styleClasses.push(`ecl-icon--${this.color}`);
    }
    if (this.transform) {
      styleClasses.push(`ecl-icon--${this.transform}`);
    }
    return styleClasses.join(' ');
  }
  render() {
    return (h("svg", { class: this.getClass() }, h("use", { xlinkHref: `${this.path}#${this.icon}` })));
  }
  static get is() { return "ecl-icon"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() {
    return {
      "ec": ["./build/styles/ecl-icon-ec.css"],
      "eu": ["./build/styles/ecl-icon-eu.css"]
    };
  }
  static get styleUrls() {
    return {
      "ec": ["./build/styles/ecl-icon-ec.css"],
      "eu": ["./build/styles/ecl-icon-eu.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": ""
        },
        "attribute": "style-class",
        "reflect": false,
        "defaultValue": "''"
      },
      "icon": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "icon",
        "reflect": false,
        "defaultValue": "''"
      },
      "size": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "size",
        "reflect": false,
        "defaultValue": "'xs'"
      },
      "color": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "color",
        "reflect": false,
        "defaultValue": "''"
      },
      "path": {
        "type": "string",
        "mutable": true,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "path",
        "reflect": false
      },
      "transform": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "transform",
        "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'"
      },
      "sprite": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "sprite",
        "reflect": false,
        "defaultValue": "''"
      }
    };
  }
}
//# sourceMappingURL=ecl-icon.js.map
