import { defineComponent as y, ref as _, openBlock as o, createBlock as r, unref as l, withCtx as c, createElementBlock as u, Fragment as a, renderList as k, mergeProps as m, createElementVNode as w, withDirectives as h, createVNode as b, vShow as g, resolveDynamicComponent as C, h as R } from "vue";
import { LoadingOutlined as L } from "@ant-design/icons-vue";
import { Menu as f, MenuItem as M } from "@aplus-frontend/antdv";
const B = { style: { display: "flex", "align-items": "center" } }, N = /* @__PURE__ */ y({
  __name: "MenuItemGroup",
  props: {
    selectedRows: {},
    buttonProps: {},
    menuList: {}
  },
  setup(p) {
    const s = p, n = _({});
    async function v(d, i) {
      const e = d?.id || i;
      n.value[e] = !0;
      try {
        await d?.onClick?.({ selectedRows: s?.selectedRows });
      } finally {
        n.value[e] = void 0;
      }
    }
    return (d, i) => (o(), r(l(f), null, {
      default: c(() => [
        (o(!0), u(a, null, k(s.menuList, (e, t) => (o(), u(a, {
          key: e === "divider" ? `divider-${t}` : e?.id || t
        }, [
          e === "divider" ? (o(), r(l(f).Divider, { key: 0 })) : (o(), r(l(M), m({
            key: e?.id || t
          }, { ref_for: !0 }, {
            ...e,
            onClick: () => v(e, t),
            disabled: n.value[e?.id || t] ?? (typeof e?.disabled == "function" ? e?.disabled({ selectedRows: s?.selectedRows }) : e?.disabled) ?? !1
          }), {
            default: c(() => [
              w("div", B, [
                h(b(l(L), { style: { "margin-right": "10px" } }, null, 512), [
                  [g, n.value[e?.id || t]]
                ]),
                (o(), r(C(R(a, [e?.content]))))
              ])
            ]),
            _: 2
          }, 1040))
        ], 64))), 128))
      ]),
      _: 1
    }));
  }
});
export {
  N as default
};
