import { h } from '@stencil/core';
export class EclRatingField {
  constructor() {
    this.theme = 'ec';
    this.styleClass = undefined;
    this.disabled = false;
    this.required = false;
  }
  componentDidRender() {
    const stars = this.el.querySelectorAll('.ecl-rating-field__star');
    this.el.querySelector('.ecl-rating-field').innerHTML = '';
    this.el.querySelector('.ecl-rating-field').append(...stars);
  }
  getClass() {
    const styleClasses = [
      `ecl-rating-field`,
      this.styleClass
    ];
    if (this.disabled) {
      styleClasses.push('ecl-rating-field--disabled');
    }
    return styleClasses.join(' ');
  }
  render() {
    return (h("div", { class: this.getClass() }, h("slot", null)));
  }
  static get is() { return "ecl-rating-field"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() {
    return {
      "ec": ["./build/styles/ecl-rating-field-ec.css"],
      "eu": ["./build/styles/ecl-rating-field-eu.css"]
    };
  }
  static get styleUrls() {
    return {
      "ec": ["./build/styles/ecl-rating-field-ec.css"],
      "eu": ["./build/styles/ecl-rating-field-eu.css"]
    };
  }
  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
      },
      "disabled": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "disabled",
        "reflect": false,
        "defaultValue": "false"
      },
      "required": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "required",
        "reflect": false,
        "defaultValue": "false"
      }
    };
  }
  static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-rating-field.js.map
