"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("@aplus-frontend/antdv"),d=require("lodash-unified");require("../../config-provider/index.js");require("../item/index.vue.js");require("../item-dropdown/index.vue2.js");require("../item-modal/index.vue2.js");require("../item-popconfirm/index.vue2.js");const f=require("../../config-provider/hooks/use-locale.js"),i=require("../item-dropdown/index.vue.js"),m=require("../item-modal/index.vue.js"),g=require("../item-popconfirm/index.vue.js"),k=require("../item/index.vue2.js"),v=e.defineComponent({name:"ApActionGroup",__name:"index",props:{count:{default:3},trigger:{default:()=>["hover"]},placement:{default:"bottomRight"},actions:{default:()=>[]},iconFirst:{type:Boolean,default:void 0}},setup(u){const o=u,{t:s}=f.useLocale(),c=e.computed(()=>o.actions.filter(r=>r.visible||d.isUndefined(r.visible))),a=e.computed(()=>e.unref(c).length>o.count),l=e.computed(()=>{const r=e.unref(c);if(r.length<=o.count)return{showActions:r.map(t=>({...t,iconFirst:t.iconFirst??o.iconFirst??!0})),menuActions:[]};let n=r.slice(0,o.count-1);return o.iconFirst&&(n=n.map(t=>({...t,iconFirst:!0}))),{showActions:n,menuActions:r.slice(o.count-1)}});return(r,n)=>(e.openBlock(),e.createBlock(e.unref(_.Space),{size:16,align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.showActions,(t,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[t.actions?(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:0,ref_for:!0},t),null,16)):t.modalProps?(e.openBlock(),e.createBlock(m.default,e.mergeProps({key:1,ref_for:!0},t),null,16)):t.popconfirmProps?(e.openBlock(),e.createBlock(g.default,e.mergeProps({key:2,ref_for:!0},t),null,16)):(e.openBlock(),e.createBlock(k.default,e.mergeProps({key:3,ref_for:!0},t),null,16))],64))),128)),a.value?(e.openBlock(),e.createBlock(i.default,{key:0,actions:l.value.menuActions,placement:u.placement,trigger:u.trigger,text:e.unref(s)("ap.common.more")},null,8,["actions","placement","trigger","text"])):e.createCommentVNode("",!0)]),_:1}))}});exports.default=v;
