material-react-table 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1951,11 +1951,13 @@ const MRT_TableHeadRow = ({ headerGroup, table }) => {
|
|
|
1951
1951
|
};
|
|
1952
1952
|
|
|
1953
1953
|
const MRT_TableHead = ({ table }) => {
|
|
1954
|
-
const { getHeaderGroups, options: { enableStickyHeader, muiTableHeadProps }, } = table;
|
|
1954
|
+
const { getHeaderGroups, getState, options: { enableStickyHeader, muiTableHeadProps, enableRowVirtualization }, } = table;
|
|
1955
|
+
const { isFullScreen } = getState();
|
|
1955
1956
|
const tableHeadProps = muiTableHeadProps instanceof Function
|
|
1956
1957
|
? muiTableHeadProps({ table })
|
|
1957
1958
|
: muiTableHeadProps;
|
|
1958
|
-
|
|
1959
|
+
const stickyHeader = enableStickyHeader || enableRowVirtualization || isFullScreen;
|
|
1960
|
+
return (React.createElement(TableHead, Object.assign({}, tableHeadProps, { sx: (theme) => (Object.assign({ opacity: 0.97, position: stickyHeader ? 'sticky' : undefined, zIndex: stickyHeader ? 2 : undefined }, ((tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx) instanceof Function
|
|
1959
1961
|
? tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx(theme)
|
|
1960
1962
|
: tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx))) }), getHeaderGroups().map((headerGroup) => (React.createElement(MRT_TableHeadRow, { headerGroup: headerGroup, key: headerGroup.id, table: table })))));
|
|
1961
1963
|
};
|