"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("@aplus-frontend/antdv"),s=require("../../ap-title/index.js");require("../../../config-provider/index.js");const y=require("../../../config-provider/hooks/use-locale.js"),g=require("../../../config-provider/hooks/use-namespace.js"),p=e.defineComponent({__name:"index",props:{leftTitle:{type:[String,Object,Number,Boolean,null,Array],default:""},rightTitle:{},rightContentStyle:{type:[Boolean,null,String,Object,Array]},renderSelectedItem:{},selectedList:{default:()=>[]}},emits:["clear","deleteItem"],setup(t,{emit:d}){const{t:r}=y.useLocale(),o=t,c=d,{m:n}=g.useNamespace("ap-table-modal"),u=()=>{c("clear")},m=l=>{c("deleteItem",l)},f=l=>typeof o.rightTitle=="function"?o.rightTitle(l):`${r("ap.apTableModal.selected")} (${l})`;return(l,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.renderSelectedItem?e.unref(n)("table-layout"):"",{"complex-layout":!!t.renderSelectedItem}])},[t.renderSelectedItem?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.leftTitle?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n)("table-layout-left"))},[e.createVNode(e.unref(s.ApTitle),{style:{"margin-bottom":"16px"}},{prefix:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h(e.Fragment,[t.leftTitle]))))]),_:1}),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n)("table-layout-left-content"))},[e.renderSlot(l.$slots,"default")],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n)("table-layout-right")),style:e.normalizeStyle(t.rightContentStyle)},[e.createVNode(e.unref(s.ApTitle),{title:`${e.unref(r)("ap.apTableModal.selected")} (${t.selectedList.length})`},{prefix:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h(e.Fragment,[f(t.selectedList.length)]))))]),suffix:e.withCtx(()=>[e.createVNode(e.unref(a.Button),{type:"link",style:{padding:"0px",height:"22px","border-width":"0px"},onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("ap.apTableModal.clear")),1)]),_:1})]),_:1},8,["title"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n)("table-layout-right-content"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.selectedList,i=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderSelectedItem?.(i,{deleteItem:m})),{key:i}))),128)),t.selectedList.length===0?(e.openBlock(),e.createBlock(e.unref(a.Empty),{key:0,image:e.unref(a.Empty).PRESENTED_IMAGE_SIMPLE,style:{"margin-top":"100px"}},null,8,["image"])):e.createCommentVNode("",!0)],2)],6)],64)):e.renderSlot(l.$slots,"default",{key:1})],2))}});exports.default=p;
