import { defineComponent, ref, computed, unref, resolveComponent, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps, renderSlot } from 'vue';
import '../../roving-focus-group/index.mjs';
import PsDropdownItemImpl from './dropdown-item-impl.mjs';
import { PsCollectionItem, dropdownItemProps } from './dropdown.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import PsRovingFocusItem from '../../roving-focus-group/src/roving-focus-item.mjs';

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

export { DropdownItem as default };
//# sourceMappingURL=dropdown-item.mjs.map
