import { defineComponent, computed, createVNode, mergeProps } from 'vue';
import { getPropsSlot } from '../../_util/props-util/index.mjs';
import PropTypes from '../../_util/vue-types/index.mjs';
import { objectType } from '../../_util/type.mjs';
import { useInjectMenu } from './hooks/useMenuContext.mjs';
import { useMeasure } from './hooks/useKeyPath.mjs';

const menuItemGroupProps = () => ({
  title: PropTypes.any,
  // Internal user prop
  originItemValue: objectType()
});
var ItemGroup = /* @__PURE__ */ defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "AMenuItemGroup",
  inheritAttrs: false,
  props: menuItemGroupProps(),
  slots: Object,
  setup(props, {
    slots,
    attrs
  }) {
    const {
      prefixCls
    } = useInjectMenu();
    const groupPrefixCls = computed(() => `${prefixCls.value}-item-group`);
    const isMeasure = useMeasure();
    return () => {
      var _a, _b;
      if (isMeasure)
        return (_a = slots.default) == null ? void 0 : _a.call(slots);
      return createVNode("li", mergeProps(attrs, {
        "onClick": (e) => e.stopPropagation(),
        "class": groupPrefixCls.value
      }), [createVNode("div", {
        "title": typeof props.title === "string" ? props.title : void 0,
        "class": `${groupPrefixCls.value}-title`
      }, [getPropsSlot(slots, props, "title")]), createVNode("ul", {
        "class": `${groupPrefixCls.value}-list`
      }, [(_b = slots.default) == null ? void 0 : _b.call(slots)])]);
    };
  }
});

export { ItemGroup as default, menuItemGroupProps };
//# sourceMappingURL=ItemGroup.mjs.map
