material-react-table 0.3.5 → 0.4.0

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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.5",
2
+ "version": "0.4.0",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material-UI implementation of react-table, inspired by material-table and the mui DataGrid, written from the ground up in TypeScript.",
@@ -56,13 +56,13 @@
56
56
  }
57
57
  ],
58
58
  "devDependencies": {
59
- "@babel/core": "^7.17.2",
59
+ "@babel/core": "^7.17.4",
60
60
  "@emotion/react": "^11.7.1",
61
61
  "@emotion/styled": "^11.6.0",
62
62
  "@etchteam/storybook-addon-status": "^4.2.0",
63
63
  "@faker-js/faker": "^6.0.0-alpha.6",
64
- "@mui/icons-material": "^5.4.1",
65
- "@mui/material": "^5.4.1",
64
+ "@mui/icons-material": "^5.4.2",
65
+ "@mui/material": "^5.4.2",
66
66
  "@size-limit/preset-small-lib": "^7.0.8",
67
67
  "@storybook/addon-a11y": "^6.4.19",
68
68
  "@storybook/addon-actions": "^6.4.19",
@@ -81,7 +81,9 @@ export type MaterialReactTableProps<D extends {} = {}> = TableOptions<D> &
81
81
  | ((cell?: Cell<D>) => TableCellProps);
82
82
  muiTableBodyProps?: TableBodyProps;
83
83
  muiTableBodyRowProps?: TableRowProps | ((row: Row<D>) => TableRowProps);
84
- muiTableContainerProps?: TableContainerProps;
84
+ muiTableContainerProps?:
85
+ | TableContainerProps
86
+ | ((table: TableInstance<D>) => TableContainerProps);
85
87
  muiTableDetailPanelProps?:
86
88
  | TableCellProps
87
89
  | ((row: Row<D>) => TableCellProps);
@@ -24,6 +24,7 @@ const TableContainer = styled(MuiTableContainer, {
24
24
  top: fullScreen ? '0' : undefined,
25
25
  transition: 'all 0.2s ease-in-out',
26
26
  width: fullScreen ? '100vw' : undefined,
27
+ zIndex: 1200,
27
28
  }));
28
29
 
29
30
  const CircularProgressWrapper = styled('div')(({ theme }) => ({
@@ -41,19 +42,25 @@ interface Props {}
41
42
 
42
43
  export const MRT_TableContainer: FC<Props> = () => {
43
44
  const {
44
- muiTableContainerProps,
45
- hideToolbarTop,
46
- hideToolbarBottom,
47
45
  fullScreen,
48
- isLoading,
46
+ hideToolbarBottom,
47
+ hideToolbarTop,
49
48
  isFetching,
49
+ isLoading,
50
+ muiTableContainerProps,
51
+ tableInstance,
50
52
  } = useMRT();
51
53
 
54
+ const tableContainerProps =
55
+ muiTableContainerProps instanceof Function
56
+ ? muiTableContainerProps(tableInstance)
57
+ : muiTableContainerProps;
58
+
52
59
  return (
53
60
  <TableContainer
54
61
  component={Paper}
55
62
  fullScreen={fullScreen}
56
- {...muiTableContainerProps}
63
+ {...tableContainerProps}
57
64
  >
58
65
  {!hideToolbarTop && <MRT_ToolbarTop />}
59
66
  {isFetching && <LinearProgress />}