@rtdui/datatable
Version:
React DataTable component based on Rtdui components
34 lines (31 loc) • 1.19 kB
JavaScript
'use client';
import { jsx } from 'react/jsx-runtime';
import clsx from 'clsx';
import { flexRender } from '@tanstack/react-table';
import { shouldElevation } from './utils/shouldElevation.mjs';
import { shouldIgnoreSticky } from './utils/shouldIgnoreSticky.mjs';
function FooterCell(props) {
const { header, table, scrollingTrigger } = props;
const { column } = header;
const isSticky = column.getIsPinned() && !shouldIgnoreSticky(header);
return /* @__PURE__ */ jsx(
"th",
{
className: clsx({
elevation: shouldElevation(table, column, scrollingTrigger) && !shouldIgnoreSticky(header),
sticky: column.getIsPinned() && !shouldIgnoreSticky(header),
placeholder: header.isPlaceholder
}),
colSpan: header.colSpan > 1 ? header.colSpan : void 0,
style: {
// width: header.getSize(),
position: isSticky ? "sticky" : "relative",
left: isSticky ? header.getStart("left") : void 0,
zIndex: isSticky ? 1 : void 0
},
children: header.isPlaceholder ? null : flexRender(column.columnDef.footer, header.getContext())
}
);
}
export { FooterCell };
//# sourceMappingURL=FooterCell.mjs.map