import{defineComponent as y,createVNode as l}from"vue";import g from"../Cell/index.mjs";import{useInjectTable as R}from"../context/TableContext.mjs";import{getCellFixedInfo as W}from"../utils/fixUtil.mjs";import{getColumnsKey as b}from"../utils/valueUtil.mjs";import k from"./DragHandle.mjs";const j=y({name:"HeaderRow",props:["cells","stickyOffsets","flattenColumns","rowComponent","cellComponent","index","customHeaderRow"],setup(a){const d=R();return()=>{const{prefixCls:r,direction:p}=d,{cells:n,stickyOffsets:c,flattenColumns:u,rowComponent:f,cellComponent:C,customHeaderRow:m,index:w}=a;let i;m&&(i=m(n.map(e=>e.column),w));const x=b(n.map(e=>e.column));return l(f,i,{default:()=>[n.map((e,h)=>{const{column:o}=e,H=W(e.colStart,e.colEnd,u,c,p);let s;o&&o.customHeaderCell&&(s=e.column.customHeaderCell(o));const t=o;return l(g,{...e,cellType:"header",ellipsis:o.ellipsis,align:o.align,component:C,prefixCls:r,key:x[h],...H,additionalProps:s,rowType:"header",column:o},{default:()=>o.title,dragHandle:()=>t.resizable?l(k,{prefixCls:r,width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth,column:t},null):null})})]})}}});export{j as default};
