import { h } from '@stencil/core';
export class EclFormGroup {
  constructor() {
    this.styleClass = '';
    this.theme = 'ec';
    this.label = undefined;
    this.invalid = false;
    this.required = false;
    this.requiredText = '*';
    this.optionalText = undefined;
    this.invalidText = undefined;
    this.helperText = undefined;
    this.helperId = undefined;
    this.name = undefined;
    this.invalidIcon = 'error';
    this.labelClass = undefined;
  }
  getClass() {
    return [
      `ecl-form-group`,
      this.styleClass
    ].join(' ');
  }
  render() {
    return (h("fieldset", { class: this.getClass(), "aria-describedby": this.helperId }, this.label ?
      h("legend", { class: `ecl-form-label ${this.invalid ? 'ecl-form-label--invalid' : ''} ${this.labelClass || ''}` }, this.label, this.required && this.requiredText ?
        h("span", { class: "ecl-form-label__required" }, this.requiredText) : '', !this.required && this.optionalText ?
        h("span", { class: "ecl-form-label__optional" }, this.optionalText) : '') : '', this.helperText ?
      h("div", { class: "ecl-help-block" }, this.helperText) : '', this.invalid && this.invalidText ?
      h("div", { class: "ecl-feedback-message" }, this.invalidIcon ?
        h("ecl-icon", { styleClass: `ecl-feedback-message__icon sc-ecl-form-group-${this.theme}`, icon: this.invalidIcon, size: "m" }) : '', this.invalidText) : '', h("slot", null)));
  }
  static get is() { return "ecl-form-group"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() {
    return {
      "ec": ["./build/styles/ecl-form-group-ec.css"],
      "eu": ["./build/styles/ecl-form-group-eu.css"]
    };
  }
  static get styleUrls() {
    return {
      "ec": ["./build/styles/ecl-form-group-ec.css"],
      "eu": ["./build/styles/ecl-form-group-eu.css"]
    };
  }
  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
      },
      "invalid": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "invalid",
        "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"
      },
      "requiredText": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "required-text",
        "reflect": false,
        "defaultValue": "'*'"
      },
      "optionalText": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "optional-text",
        "reflect": false
      },
      "invalidText": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "invalid-text",
        "reflect": false
      },
      "helperText": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "helper-text",
        "reflect": false
      },
      "helperId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "helper-id",
        "reflect": false
      },
      "name": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "name",
        "reflect": false
      },
      "invalidIcon": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "invalid-icon",
        "reflect": false,
        "defaultValue": "'error'"
      },
      "labelClass": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "label-class",
        "reflect": false
      }
    };
  }
}
//# sourceMappingURL=ecl-form-group.js.map
