const e=require("../context/TableContext.js"),t=require("../context/HoverContext.js"),n=require("../utils/valueUtil.js"),r=require("../context/BodyContext.js"),i=require("../context/ResizeContext.js"),a=require("../hooks/useFlattenRecords.js"),o=require("./ExpandedRow.js"),s=require("./BodyRow.js"),c=require("./MeasureCell.js");let l=require("vue");var u=(0,l.defineComponent)({name:`TableBody`,props:[`data`,`getRowKey`,`measureColumnWidth`,`expandedKeys`,`customRow`,`rowExpandable`,`childrenColumnName`],setup(u,{slots:d}){let f=i.useInjectResize(),p=e.useInjectTable(),m=r.useInjectBody(),h=a.default((0,l.toRef)(u,`data`),(0,l.toRef)(u,`childrenColumnName`),(0,l.toRef)(u,`expandedKeys`),(0,l.toRef)(u,`getRowKey`)),g=(0,l.shallowRef)(-1),_=(0,l.shallowRef)(-1),v;return t.useProvideHover({startRow:g,endRow:_,onHover:(e,t)=>{clearTimeout(v),v=setTimeout(()=>{g.value=e,_.value=t},100)}}),()=>{let{data:e,getRowKey:t,measureColumnWidth:r,expandedKeys:i,customRow:a,rowExpandable:g,childrenColumnName:_}=u,{onColumnResize:v}=f,{prefixCls:y,getComponent:b}=p,{flattenColumns:x}=m,S=b([`body`,`wrapper`],`tbody`),C=b([`body`,`row`],`tr`),w=b([`body`,`cell`],`td`),T;T=e.length?h.value.map((e,n)=>{let{record:r,indent:o,index:c}=e,u=t(r,n);return(0,l.createVNode)(s.default,{key:u,rowKey:u,record:r,recordKey:u,index:n,renderIndex:c,rowComponent:C,cellComponent:w,expandedKeys:i,customRow:a,getRowKey:t,rowExpandable:g,childrenColumnName:_,indent:o},null)}):(0,l.createVNode)(o.default,{expanded:!0,class:`${y}-placeholder`,prefixCls:y,component:C,cellComponent:w,colSpan:x.length,isEmpty:!0},{default:()=>[d.emptyNode?.()]});let E=n.getColumnsKey(x);return(0,l.createVNode)(S,{class:`${y}-tbody`},{default:()=>[r&&(0,l.createVNode)(`tr`,{"aria-hidden":`true`,class:`${y}-measure-row`,style:{height:0,fontSize:0}},[E.map(e=>(0,l.createVNode)(c.default,{key:e,columnKey:e,onColumnResize:v},null))]),T]})}}});exports.default=u;