material-react-table 3.0.0 → 3.0.1
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/index.esm.js +24 -25
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +24 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/table/MRT_TablePaper.tsx +48 -51
package/package.json
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import Paper, { type PaperProps } from '@mui/material/Paper';
|
2
|
-
import FocusTrap from '@mui/material/Unstable_TrapFocus/FocusTrap';
|
3
2
|
import { useTheme } from '@mui/material/styles';
|
4
3
|
import { MRT_TableContainer } from './MRT_TableContainer';
|
5
4
|
import { type MRT_RowData, type MRT_TableInstance } from '../../types';
|
@@ -38,55 +37,53 @@ export const MRT_TablePaper = <TData extends MRT_RowData>({
|
|
38
37
|
const theme = useTheme();
|
39
38
|
|
40
39
|
return (
|
41
|
-
<
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
{
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
{
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
</Paper>
|
90
|
-
</FocusTrap>
|
40
|
+
<Paper
|
41
|
+
elevation={2}
|
42
|
+
onKeyDown={(e) => e.key === 'Escape' && table.setIsFullScreen(false)}
|
43
|
+
{...paperProps}
|
44
|
+
ref={(ref: HTMLDivElement) => {
|
45
|
+
tablePaperRef.current = ref;
|
46
|
+
if (paperProps?.ref) {
|
47
|
+
//@ts-ignore
|
48
|
+
paperProps.ref.current = ref;
|
49
|
+
}
|
50
|
+
}}
|
51
|
+
style={{
|
52
|
+
...(isFullScreen
|
53
|
+
? {
|
54
|
+
bottom: 0,
|
55
|
+
height: '100dvh',
|
56
|
+
left: 0,
|
57
|
+
margin: 0,
|
58
|
+
maxHeight: '100dvh',
|
59
|
+
maxWidth: '100dvw',
|
60
|
+
padding: 0,
|
61
|
+
position: 'fixed',
|
62
|
+
right: 0,
|
63
|
+
top: 0,
|
64
|
+
width: '100dvw',
|
65
|
+
zIndex: theme.zIndex.modal,
|
66
|
+
}
|
67
|
+
: {}),
|
68
|
+
...paperProps?.style,
|
69
|
+
}}
|
70
|
+
sx={(theme) => ({
|
71
|
+
backgroundColor: baseBackgroundColor,
|
72
|
+
backgroundImage: 'unset',
|
73
|
+
overflow: 'hidden',
|
74
|
+
transition: 'all 100ms ease-in-out',
|
75
|
+
...(parseFromValuesOrFunc(paperProps?.sx, theme) as any),
|
76
|
+
})}
|
77
|
+
>
|
78
|
+
{enableTopToolbar &&
|
79
|
+
(parseFromValuesOrFunc(renderTopToolbar, { table }) ?? (
|
80
|
+
<MRT_TopToolbar table={table} />
|
81
|
+
))}
|
82
|
+
<MRT_TableContainer table={table} />
|
83
|
+
{enableBottomToolbar &&
|
84
|
+
(parseFromValuesOrFunc(renderBottomToolbar, { table }) ?? (
|
85
|
+
<MRT_BottomToolbar table={table} />
|
86
|
+
))}
|
87
|
+
</Paper>
|
91
88
|
);
|
92
89
|
};
|