var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, Host, h, Prop, Element, Event, State } from '@stencil/core';
import { sanitizeVegaComponent } from '../../../utils/component';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, slotPlaceholder, } from 'vega-slimmer/core';
import { VegaDropdownItemRenderer } from './slimmers/renderers/vega-dropdown-item-renderer';
import { VegaDropdownItemStateController } from './slimmers/controllers/vega-dropdown-item-state-controller';
import { VegaDropdownItemClickController } from './slimmers/controllers/vega-dropdown-item-click-controller';
import { ChildNodesEventPreventSlimmer } from '../../../helpers/event-manager/slimmers/child-nodes-event-prevent-slimmer';
import { createEventEmitSlimmer, } from '../../../helpers/event-manager/slimmers/event-emit-slimmer';
import { VegaChange, VegaClick } from '../../../helpers/event-manager/event-id/vega-event-id';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../../helpers/slimmers/component-usage-runtime-metrics';
/**
 * @vegaVersion 1.47.0
 */
export class VegaDropdownItem {
  constructor() {
    this.globalSlimmers = {};
    this.renderer = new VegaDropdownItemRenderer();
    this.vegaDropdownItemStateController = new VegaDropdownItemStateController();
    this.vegaDropdownItemClickController = new VegaDropdownItemClickController();
    this.dropdownItemEventPrevent = new ChildNodesEventPreventSlimmer([VegaChange], () => this.host);
    this.clickEventEmitter = createEventEmitSlimmer(VegaDropdownItem, VegaClick);
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    /**
     * The placeholder of prefix icon, while other item have prefix icon but no in this item,
     * if you want to keep those items align, you can set this placeholder as true.
     */
    this.prefixIconSlot = false;
    /**
     * Specifies the dropdown item's selected status.
     */
    this.selected = false;
    /**
     * Specifies the dropdown item's rule of display.
     */
    this.itemDisplayRule = 'newline';
    /**
     * Specifies the disabled status of the dropdown item.
     *
     * @vegaVersion 1.47.0
     */
    this.disabled = false;
    /**
     * Specifies whether the dropdown item represents a danger action.
     * 	  It highlights actions that may have critical consequences
     * 	     when the select type is set to none.
     *
     * @vegaVersion 2.25.0
     */
    this.danger = false;
  }
  render() {
    slotPlaceholder(h("slot", null));
    return sanitizeVegaComponent(h(Host, null, this.renderer.render()), this.host);
  }
  static get is() { return "vega-dropdown-item"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-dropdown-item.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-dropdown-item.css"]
  }; }
  static get properties() { return {
    "label": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.47.0"
          }],
        "text": "Specifies the label for the dropdown item."
      },
      "attribute": "label",
      "reflect": false
    },
    "itemKey": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.47.0"
          }],
        "text": "Specifies the key for the dropdown item."
      },
      "attribute": "item-key",
      "reflect": true
    },
    "count": {
      "type": "number",
      "mutable": false,
      "complexType": {
        "original": "number",
        "resolved": "number",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.47.0"
          }],
        "text": "Specifies the dropdown item's count."
      },
      "attribute": "count",
      "reflect": false
    },
    "prefixIcon": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.47.0"
          }],
        "text": "Specifies the prefix icon for the dropdown item."
      },
      "attribute": "prefix-icon",
      "reflect": false
    },
    "disabled": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.47.0"
          }],
        "text": "Specifies the disabled status of the dropdown item."
      },
      "attribute": "disabled",
      "reflect": false,
      "defaultValue": "false"
    },
    "height": {
      "type": "number",
      "mutable": false,
      "complexType": {
        "original": "number",
        "resolved": "number",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.47.0"
          }],
        "text": "Specifies the height of the dropdown item."
      },
      "attribute": "height",
      "reflect": false
    },
    "danger": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.25.0"
          }],
        "text": "Specifies whether the dropdown item represents a danger action.\n\t  It highlights actions that may have critical consequences\n\t     when the select type is set to none."
      },
      "attribute": "danger",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
  static get states() { return {
    "selectType": {},
    "prefixIconSlot": {},
    "selected": {},
    "itemDisplayRule": {},
    "itemTooltipProps": {}
  }; }
  static get events() { return [{
      "method": "vegaClick",
      "name": "vegaClick",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.47.0"
          }],
        "text": "An event emitter notifying the dropdown item has been clicked."
      },
      "complexType": {
        "original": "VegaDropdownItemClickEvent",
        "resolved": "{ itemKey: string; }",
        "references": {
          "VegaDropdownItemClickEvent": {
            "location": "import",
            "path": "./types"
          }
        }
      }
    }, {
      "method": "click",
      "name": "click",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.0.0"
          }],
        "text": "An event emitter notifying the dropdown item has been clicked."
      },
      "complexType": {
        "original": "VegaDropdownItemClickEvent",
        "resolved": "{ itemKey: string; }",
        "references": {
          "VegaDropdownItemClickEvent": {
            "location": "import",
            "path": "./types"
          }
        }
      }
    }]; }
  static get elementRef() { return "host"; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaDropdownItem.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaDropdownItem.prototype, "renderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaDropdownItem.prototype, "vegaDropdownItemStateController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaDropdownItem.prototype, "vegaDropdownItemClickController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaDropdownItem.prototype, "dropdownItemEventPrevent", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaDropdownItem.prototype, "clickEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaDropdownItem.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
