import { defineComponent, useAttrs, resolveComponent, createBlock, openBlock, mergeProps, unref, withCtx, renderSlot, createVNode } from 'vue';
import '../../../utils/index.mjs';
import { dropdownEmits, dropdownProps } from './dropdown.mjs';
import './recursive-menu.vue.mjs';
import { createNamespace } from '../../../utils/create-namespace.mjs';
import _sfc_main$1 from './recursive-menu.vue2.mjs';

"use strict";
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{ name: "LlDropdown" },
  __name: "dropdown",
  props: dropdownProps,
  emits: dropdownEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const bem = createNamespace("dropdown");
    const attrs = useAttrs();
    const handleMenuItemClick = (item) => {
      if (!item.disabled) {
        emits("claimSelected", item);
      }
    };
    return (_ctx, _cache) => {
      const _component_a_menu = resolveComponent("a-menu");
      const _component_a_dropdown = resolveComponent("a-dropdown");
      return openBlock(), createBlock(_component_a_dropdown, mergeProps(unref(attrs), {
        "overlay-class-name": `${_ctx.overlayClassName} ${unref(bem).b("menu-wrapper")}`,
        class: unref(bem).b()
      }), {
        overlay: withCtx(() => [
          _ctx.$slots.overlay ? renderSlot(_ctx.$slots, "overlay", { key: 0 }) : (openBlock(), createBlock(_component_a_menu, { key: 1 }, {
            default: withCtx(() => [
              createVNode(_sfc_main$1, {
                items: props.dropdownItems,
                onClaimSelected: handleMenuItemClick
              }, null, 8, ["items"])
            ]),
            _: 1
            /* STABLE */
          }))
        ]),
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
        /* FORWARDED */
      }, 16, ["overlay-class-name", "class"]);
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=dropdown.vue2.mjs.map
