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.
package/dist/cjs/index.js CHANGED
@@ -1959,11 +1959,13 @@ const MRT_TableHeadRow = ({ headerGroup, table }) => {
1959
1959
  };
1960
1960
 
1961
1961
  const MRT_TableHead = ({ table }) => {
1962
- const { getHeaderGroups, options: { enableStickyHeader, muiTableHeadProps }, } = table;
1962
+ const { getHeaderGroups, getState, options: { enableStickyHeader, muiTableHeadProps, enableRowVirtualization }, } = table;
1963
+ const { isFullScreen } = getState();
1963
1964
  const tableHeadProps = muiTableHeadProps instanceof Function
1964
1965
  ? muiTableHeadProps({ table })
1965
1966
  : muiTableHeadProps;
1966
- return (React__default["default"].createElement(material.TableHead, Object.assign({}, tableHeadProps, { sx: (theme) => (Object.assign({ opacity: 0.97, position: enableStickyHeader ? 'sticky' : undefined, zIndex: enableStickyHeader ? 2 : undefined }, ((tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx) instanceof Function
1967
+ const stickyHeader = enableStickyHeader || enableRowVirtualization || isFullScreen;
1968
+ return (React__default["default"].createElement(material.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
1967
1969
  ? tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx(theme)
1968
1970
  : tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx))) }), getHeaderGroups().map((headerGroup) => (React__default["default"].createElement(MRT_TableHeadRow, { headerGroup: headerGroup, key: headerGroup.id, table: table })))));
1969
1971
  };