var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _KlevuDropdown_instances, _KlevuDropdown_onChange;
import { h, Host } from "@stencil/core";
/**
 * Simple native dropdown component for dropdown
 *
 * @cssprop --klevu-dropdown-icon-clip-path polygon shape of the cut of icon
 * @cssprop --klevu-dropdown-icon-color --klevu-color-primary icon color
 */
export class KlevuDropdown {
  constructor() {
    _KlevuDropdown_instances.add(this);
    this.name = undefined;
    this.options = undefined;
    this.disabled = undefined;
    this.selected = undefined;
    this.variant = "default";
  }
  render() {
    var _a;
    return (h(Host, null, h("div", { class: {
        selectcontainer: true,
        disabled: Boolean(this.disabled),
        inline: this.variant === "inline",
        default: this.variant === "default",
      } }, h("select", { name: this.name, disabled: this.disabled, onChange: __classPrivateFieldGet(this, _KlevuDropdown_instances, "m", _KlevuDropdown_onChange).bind(this) }, (_a = this.options) === null || _a === void 0 ? void 0 : _a.map((o) => (h("option", { selected: this.selected === o.value, value: o.value }, o.text)))), h("span", { part: "material-icon", class: "triangle" }, "expand_more"))));
  }
  static get is() { return "klevu-dropdown"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() {
    return {
      "$": ["klevu-dropdown.css"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["klevu-dropdown.css"]
    };
  }
  static get properties() {
    return {
      "name": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": true,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Form name"
        },
        "attribute": "name",
        "reflect": false
      },
      "options": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "Array<{ value: string; text: String }>",
          "resolved": "{ value: string; text: String; }[]",
          "references": {
            "Array": {
              "location": "global"
            },
            "String": {
              "location": "global"
            }
          }
        },
        "required": true,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Options to display in dropdown"
        }
      },
      "disabled": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Is element disabled"
        },
        "attribute": "disabled",
        "reflect": false
      },
      "selected": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": true,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Which element value is selected"
        },
        "attribute": "selected",
        "reflect": false
      },
      "variant": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "KlevuDropdownVariant",
          "resolved": "\"default\" | \"inline\"",
          "references": {
            "KlevuDropdownVariant": {
              "location": "local",
              "path": "/home/runner/work/frontend-sdk/frontend-sdk/packages/klevu-ui/src/components/klevu-dropdown/klevu-dropdown.tsx"
            }
          }
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Variant of dropdown"
        },
        "attribute": "variant",
        "reflect": false,
        "defaultValue": "\"default\""
      }
    };
  }
  static get events() {
    return [{
        "method": "klevuDropdownChanged",
        "name": "klevuDropdownChanged",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "When dropdown item has been changed"
        },
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        }
      }];
  }
}
_KlevuDropdown_instances = new WeakSet(), _KlevuDropdown_onChange = function _KlevuDropdown_onChange(event) {
  this.klevuDropdownChanged.emit(event.target.value);
};
//# sourceMappingURL=klevu-dropdown.js.map
