'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../roving-focus-group/index.js');
var dropdownItemImpl = require('./dropdown-item-impl.js');
var dropdown = require('./dropdown.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
var rovingFocusItem = require('../../roving-focus-group/src/roving-focus-item.js');

const _sfc_main = vue.defineComponent({
  name: "PsDropdownItem",
  components: {
    PsDropdownCollectionItem: dropdown.PsCollectionItem,
    PsRovingFocusItem: rovingFocusItem["default"],
    PsDropdownItemImpl: dropdownItemImpl["default"]
  },
  inheritAttrs: false,
  props: dropdown.dropdownItemProps,
  setup(props, { attrs }) {
    const itemRef = vue.ref(null);
    const textContent = vue.computed(() => {
      var _a, _b;
      return (_b = (_a = vue.unref(itemRef)) == null ? void 0 : _a.textContent) != null ? _b : "";
    });
    const propsAndAttrs = vue.computed(() => {
      return { ...props, ...attrs };
    });
    return {
      textContent,
      propsAndAttrs
    };
  }
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  var _a;
  const _component_ps_dropdown_item_impl = vue.resolveComponent("ps-dropdown-item-impl");
  const _component_ps_roving_focus_item = vue.resolveComponent("ps-roving-focus-item");
  const _component_ps_dropdown_collection_item = vue.resolveComponent("ps-dropdown-collection-item");
  return vue.openBlock(), vue.createBlock(_component_ps_dropdown_collection_item, {
    disabled: _ctx.disabled,
    "text-value": (_a = _ctx.textValue) != null ? _a : _ctx.textContent
  }, {
    default: vue.withCtx(() => [
      vue.createVNode(_component_ps_roving_focus_item, {
        focusable: !_ctx.disabled
      }, {
        default: vue.withCtx(() => [
          vue.createVNode(_component_ps_dropdown_item_impl, vue.normalizeProps(vue.guardReactiveProps(_ctx.propsAndAttrs)), {
            default: vue.withCtx(() => [
              vue.renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 16)
        ]),
        _: 3
      }, 8, ["focusable"])
    ]),
    _: 3
  }, 8, ["disabled", "text-value"]);
}
var DropdownItem = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/dropdown/src/dropdown-item.vue"]]);

exports["default"] = DropdownItem;
//# sourceMappingURL=dropdown-item.js.map
