"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const h=require("./style/index.js"),f=require("../../config-provider/hooks/use-namespace.js"),m=require("../../config-provider/hooks/use-locale.js"),v={key:0,class:"selected-desc"},y={class:"selected-desc-conut"},S={class:"selected-desc-clean"},N=e.defineComponent({__name:"ApBatchAction",props:{selectedRowKeys:{},clearAll:{},showSelected:{type:Boolean,default:!0}},setup(i){const{b:a}=f.useNamespace("ap-batch-action"),{t:o}=m.useLocale(),d=h.default("ap-batch-action"),l=i,n=e.useSlots(),u=e.computed(()=>l.selectedRowKeys?.length||0),r=e.ref(!1),c=e.ref();return e.watch(()=>n.header,()=>{setTimeout(()=>{const t=n.header?.();t?.length===1&&t?.[0]?.type?.name==="ASpace"?r.value=!!Array.prototype.slice.call(c.value?.children?.[0]?.children)?.filter?.(s=>s?.children?.length)?.length:r.value=!!c.value?.children?.length})},{immediate:!0}),(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(a)(),e.unref(d)])},[e.withDirectives(e.createElementVNode("div",{ref_key:"headerRef",ref:c,class:e.normalizeClass(e.unref(a)("header"))},[e.renderSlot(t.$slots,"header")],2),[[e.vShow,r.value]]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a)("body"))},[e.renderSlot(t.$slots,"prefix"),l.showSelected?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",y,[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apBatchAction.selected"))+" ",1),e.createElementVNode("span",null,e.toDisplayString(u.value),1),e.createTextVNode(" "+e.toDisplayString(e.unref(o)("ap.apBatchAction.piecesOfData")),1)]),e.createElementVNode("div",S,[e.createVNode(e.unref(p.Button),{type:"link",onClick:s[0]||(s[0]=g=>l.clearAll&&l.clearAll())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apBatchAction.empty")),1)]),_:1})])])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"suffix")],2)],2))}});exports.default=N;
