@rtdui/datatable
Version:
React DataTable component based on Rtdui components
36 lines (32 loc) • 1.31 kB
JavaScript
'use client';
;
var jsxRuntime = require('react/jsx-runtime');
var clsx = require('clsx');
var reactTable = require('@tanstack/react-table');
var shouldElevation = require('./utils/shouldElevation.cjs');
var shouldIgnoreSticky = require('./utils/shouldIgnoreSticky.cjs');
function FooterCell(props) {
const { header, table, scrollingTrigger } = props;
const { column } = header;
const isSticky = column.getIsPinned() && !shouldIgnoreSticky.shouldIgnoreSticky(header);
return /* @__PURE__ */ jsxRuntime.jsx(
"th",
{
className: clsx({
elevation: shouldElevation.shouldElevation(table, column, scrollingTrigger) && !shouldIgnoreSticky.shouldIgnoreSticky(header),
sticky: column.getIsPinned() && !shouldIgnoreSticky.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 : reactTable.flexRender(column.columnDef.footer, header.getContext())
}
);
}
exports.FooterCell = FooterCell;
//# sourceMappingURL=FooterCell.cjs.map