const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../_util/vue-types/index.js"),r=require("../pagination/index.js"),i=require("./ListItem.js");let a=require("vue");var o={prefixCls:String,filteredRenderItems:n.default.array.def([]),selectedKeys:n.default.array,disabled:e.booleanType(),showRemove:e.booleanType(),pagination:n.default.any,onItemSelect:Function,onScroll:Function,onItemRemove:Function};function s(e){if(!e)return null;let t={pageSize:10,simple:!0,showSizeChanger:!1,showLessItems:!1};return typeof e==`object`?{...t,...e}:t}var c=(0,a.defineComponent)({compatConfig:{MODE:3},name:`ListBody`,inheritAttrs:!1,props:o,emits:[`itemSelect`,`itemRemove`,`scroll`],setup(e,{emit:n,expose:o}){let c=(0,a.ref)(1),l=t=>{let{selectedKeys:r}=e,i=r.includes(t.key);n(`itemSelect`,t.key,!i)},u=e=>{n(`itemRemove`,[e.key])},d=e=>{n(`scroll`,e)},f=(0,a.computed)(()=>s(e.pagination));(0,a.watch)([f,()=>e.filteredRenderItems],()=>{if(f.value){let t=Math.ceil(e.filteredRenderItems.length/f.value.pageSize);c.value=Math.min(c.value,t)}},{immediate:!0});let p=(0,a.computed)(()=>{let{filteredRenderItems:t}=e,n=t;return f.value&&(n=t.slice((c.value-1)*f.value.pageSize,c.value*f.value.pageSize)),n}),m=e=>{c.value=e};return o({items:p}),()=>{let{prefixCls:n,filteredRenderItems:o,selectedKeys:s,disabled:h,showRemove:g}=e,_=null;f.value&&(_=(0,a.createVNode)(r.default,{simple:f.value.simple,showSizeChanger:f.value.showSizeChanger,showLessItems:f.value.showLessItems,size:`small`,disabled:h,class:`${n}-pagination`,total:o.length,pageSize:f.value.pageSize,current:c.value,onChange:m},null));let v=p.value.map(({renderedEl:e,renderedText:t,item:r})=>{let{disabled:o}=r,c=s.includes(r.key);return(0,a.createVNode)(i.default,{disabled:h||o,key:r.key,item:r,renderedText:t,renderedEl:e,checked:c,prefixCls:n,onClick:l,onRemove:u,showRemove:g},null)});return(0,a.createVNode)(a.Fragment,null,[(0,a.createVNode)(`ul`,{class:t.default(`${n}-content`,{[`${n}-content-show-remove`]:g}),onScroll:d},[v]),_])}}});exports.default=c,exports.transferListBodyProps=o;