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/package.json
CHANGED
|
@@ -10,21 +10,26 @@ interface Props {
|
|
|
10
10
|
export const MRT_TableHead: FC<Props> = ({ table }) => {
|
|
11
11
|
const {
|
|
12
12
|
getHeaderGroups,
|
|
13
|
-
|
|
13
|
+
getState,
|
|
14
|
+
options: { enableStickyHeader, muiTableHeadProps, enableRowVirtualization },
|
|
14
15
|
} = table;
|
|
16
|
+
const { isFullScreen } = getState();
|
|
15
17
|
|
|
16
18
|
const tableHeadProps =
|
|
17
19
|
muiTableHeadProps instanceof Function
|
|
18
20
|
? muiTableHeadProps({ table })
|
|
19
21
|
: muiTableHeadProps;
|
|
20
22
|
|
|
23
|
+
const stickyHeader =
|
|
24
|
+
enableStickyHeader || enableRowVirtualization || isFullScreen;
|
|
25
|
+
|
|
21
26
|
return (
|
|
22
27
|
<TableHead
|
|
23
28
|
{...tableHeadProps}
|
|
24
29
|
sx={(theme) => ({
|
|
25
30
|
opacity: 0.97,
|
|
26
|
-
position:
|
|
27
|
-
zIndex:
|
|
31
|
+
position: stickyHeader ? 'sticky' : undefined,
|
|
32
|
+
zIndex: stickyHeader ? 2 : undefined,
|
|
28
33
|
...(tableHeadProps?.sx instanceof Function
|
|
29
34
|
? tableHeadProps?.sx(theme)
|
|
30
35
|
: (tableHeadProps?.sx as any)),
|