UNPKG

tanstack-table-header-rowspan

Version:
3 lines (2 loc) 1.02 kB
function e(e){let t=e;for(;;){const n=t.isPlaceholder&&1===t.colSpan&&1===t.subHeaders.length?t.subHeaders[0]:null;if(!n)return t===e?null:t;t=n}}function t(t){const n=e(t);return t.depth-t.column.depth>1?null:1+(n?n.depth-t.depth:0)}function n(t){const n=e(t);return 1+(n?n.depth-t.depth:0)>1?null:t.depth-t.column.depth}function o(e){const t=e.depth-e.column.depth;return{rowSpan:t,topBorderMightBeNeeded:0===e.column.depth,styles:n=>({"--rowspan":t,height:`calc(var(--rowspan, 1) * ${n})`,marginTop:`calc(-1 * (var(--rowspan, 1) - 1) * ${n})`,visibility:e.isPlaceholder?"hidden":void 0})}}function r(e){const t=e.depth-e.column.depth;return{rowSpan:t,bottomBorderMightBeNeeded:0===e.column.depth,styles:n=>({"--rowspan":t,height:`calc(var(--rowspan, 1) * ${n})`,marginBottom:`calc(-1*(var(--rowspan, 1) - 1) * ${n})`,visibility:e.isPlaceholder?"hidden":void 0})}}export{r as flexTableFooterRowSpan,o as flexTableHeaderRowSpan,n as tableFooterRowSpan,t as tableHeaderRowSpan}; //# sourceMappingURL=rowspan.modern.mjs.map