"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@ant-design/icons-vue"),l=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const f=require("./style/index.js"),k=require("../../config-provider/hooks/use-namespace.js"),v=e.defineComponent({__name:"MenuItemGroup",props:{selectedRows:{},buttonProps:{},menuList:{},setOpen:{type:Function}},setup(u){const o=u,i=f.default("ap-batch-action-group"),{b:a}=k.useNamespace("ap-batch-action-group-menu-item"),r=e.ref({});async function d(c,s){const n=c?.id||s;r.value[n]=!0;try{await c?.onClick?.({selectedRows:o?.selectedRows})}finally{o.setOpen(!1),r.value[n]=void 0}}return(c,s)=>(e.openBlock(),e.createBlock(e.unref(l.Menu),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menuList,(n,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n==="divider"?`divider-${t}`:n?.id||t},[n==="divider"?(e.openBlock(),e.createBlock(e.unref(l.Menu).Divider,{key:0})):(e.openBlock(),e.createBlock(e.unref(l.MenuItem),e.mergeProps({key:n?.id||t},{ref_for:!0},{...n,onClick:()=>d(n,t),disabled:r.value[n?.id||t]??(typeof n?.disabled=="function"?n?.disabled({selectedRows:o?.selectedRows}):n?.disabled)??!1}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(i),e.unref(a)()])},[e.createVNode(e.Transition,{name:e.unref(a)("loading-icon-wrapper-ease")},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(p.LoadingOutlined),{class:e.normalizeClass(e.unref(a)("loading-icon"))},null,8,["class"]),[[e.vShow,r.value[n?.id||t]]])]),_:2},1032,["name"]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h(e.Fragment,[n?.content]))))],2)]),_:2},1040))],64))),128))]),_:1}))}});exports.default=v;
