material-react-table 0.4.8 → 0.5.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/MaterialReactTable.d.ts +6 -5
- package/dist/body/MRT_TableBodyCell.d.ts +10 -3
- package/dist/body/MRT_TableBodyRow.d.ts +1 -16
- package/dist/head/MRT_TableHeadCell.d.ts +8 -4
- package/dist/material-react-table.cjs.development.js +400 -471
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +404 -475
- package/dist/material-react-table.esm.js.map +1 -1
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +8 -7
- package/src/body/MRT_TableBody.tsx +6 -7
- package/src/body/MRT_TableBodyCell.tsx +20 -11
- package/src/body/MRT_TableBodyRow.tsx +17 -14
- package/src/body/MRT_TableDetailPanel.tsx +9 -26
- package/src/buttons/MRT_EditActionButtons.tsx +3 -8
- package/src/buttons/MRT_ExpandAllButton.tsx +5 -5
- package/src/buttons/MRT_ExpandButton.tsx +10 -10
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +9 -9
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +11 -12
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +9 -8
- package/src/footer/MRT_TableFooterCell.tsx +10 -17
- package/src/footer/MRT_TableFooterRow.tsx +1 -1
- package/src/head/MRT_TableHeadCell.tsx +47 -54
- package/src/head/MRT_TableHeadCellActions.tsx +5 -4
- package/src/head/MRT_TableHeadRow.tsx +5 -4
- package/src/inputs/MRT_SearchTextField.tsx +2 -11
- package/src/inputs/MRT_SelectCheckbox.tsx +4 -4
- package/src/menus/MRT_ColumnActionMenu.tsx +17 -6
- package/src/menus/MRT_RowActionMenu.tsx +2 -7
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +1 -1
- package/src/table/MRT_Table.tsx +1 -1
- package/src/table/MRT_TableContainer.tsx +17 -41
- package/src/table/MRT_TableSpacerCell.tsx +4 -3
- package/src/toolbar/MRT_TablePagination.tsx +6 -1
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +19 -29
- package/src/toolbar/MRT_ToolbarBottom.tsx +23 -20
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +13 -12
- package/src/toolbar/MRT_ToolbarTop.tsx +38 -35
- package/dist/table/MRT_TableButtonCell.d.ts +0 -3
- package/src/table/MRT_TableButtonCell.tsx +0 -9
|
@@ -1,40 +1,11 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
-
import { alpha,
|
|
2
|
+
import { alpha, Box, Toolbar } from '@mui/material';
|
|
3
3
|
import { MRT_SearchTextField } from '../inputs/MRT_SearchTextField';
|
|
4
4
|
import { useMRT } from '../useMRT';
|
|
5
5
|
import { MRT_ToolbarInternalButtons } from './MRT_ToolbarInternalButtons';
|
|
6
6
|
import { MRT_TablePagination } from './MRT_TablePagination';
|
|
7
7
|
import { MRT_ToolbarAlertBanner } from './MRT_ToolbarAlertBanner';
|
|
8
8
|
|
|
9
|
-
const Toolbar = styled(MuiToolbar, {
|
|
10
|
-
shouldForwardProp: (prop) => prop !== 'fullScreen',
|
|
11
|
-
})<{ fullScreen?: boolean }>(({ fullScreen, theme }) => ({
|
|
12
|
-
backgroundColor: theme.palette.background.default,
|
|
13
|
-
backgroundImage: `linear-gradient(${alpha(
|
|
14
|
-
theme.palette.common.white,
|
|
15
|
-
0.05,
|
|
16
|
-
)},${alpha(theme.palette.common.white, 0.05)})`,
|
|
17
|
-
display: 'grid',
|
|
18
|
-
padding: '0 0.5rem !important',
|
|
19
|
-
position: fullScreen ? 'sticky' : undefined,
|
|
20
|
-
top: fullScreen ? '0' : undefined,
|
|
21
|
-
width: 'calc(100% - 1rem)',
|
|
22
|
-
zIndex: 1,
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
const ToolbarTopRow = styled('div')({
|
|
26
|
-
padding: '0.5rem',
|
|
27
|
-
display: 'flex',
|
|
28
|
-
justifyContent: 'space-between',
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const ToolbarActionsContainer = styled('div')({
|
|
32
|
-
display: 'flex',
|
|
33
|
-
gap: '0.5rem',
|
|
34
|
-
position: 'relative',
|
|
35
|
-
zIndex: 3,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
9
|
interface Props {}
|
|
39
10
|
|
|
40
11
|
export const MRT_ToolbarTop: FC<Props> = () => {
|
|
@@ -57,17 +28,49 @@ export const MRT_ToolbarTop: FC<Props> = () => {
|
|
|
57
28
|
: muiTableToolbarTopProps;
|
|
58
29
|
|
|
59
30
|
return (
|
|
60
|
-
<Toolbar
|
|
31
|
+
<Toolbar
|
|
32
|
+
variant="dense"
|
|
33
|
+
{...toolbarProps}
|
|
34
|
+
sx={(theme) =>
|
|
35
|
+
({
|
|
36
|
+
backgroundColor: theme.palette.background.default,
|
|
37
|
+
backgroundImage: `linear-gradient(${alpha(
|
|
38
|
+
theme.palette.common.white,
|
|
39
|
+
0.05,
|
|
40
|
+
)},${alpha(theme.palette.common.white, 0.05)})`,
|
|
41
|
+
display: 'grid',
|
|
42
|
+
p: '0 !important',
|
|
43
|
+
position: fullScreen ? 'sticky' : undefined,
|
|
44
|
+
top: fullScreen ? '0' : undefined,
|
|
45
|
+
width: '100%',
|
|
46
|
+
zIndex: 1,
|
|
47
|
+
...toolbarProps?.sx,
|
|
48
|
+
} as any)
|
|
49
|
+
}
|
|
50
|
+
>
|
|
61
51
|
{positionToolbarAlertBanner === 'top' && <MRT_ToolbarAlertBanner />}
|
|
62
|
-
<
|
|
52
|
+
<Box
|
|
53
|
+
sx={{
|
|
54
|
+
p: '0.5rem',
|
|
55
|
+
display: 'flex',
|
|
56
|
+
justifyContent: 'space-between',
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
63
59
|
{renderToolbarCustomActions?.(tableInstance) ?? <span />}
|
|
64
|
-
<
|
|
60
|
+
<Box
|
|
61
|
+
sx={{
|
|
62
|
+
display: 'flex',
|
|
63
|
+
gap: '0.5rem',
|
|
64
|
+
position: 'relative',
|
|
65
|
+
zIndex: 3,
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
65
68
|
{!disableGlobalFilter && <MRT_SearchTextField />}
|
|
66
69
|
{!hideToolbarInternalActions && positionToolbarActions === 'top' && (
|
|
67
70
|
<MRT_ToolbarInternalButtons />
|
|
68
71
|
)}
|
|
69
|
-
</
|
|
70
|
-
</
|
|
72
|
+
</Box>
|
|
73
|
+
</Box>
|
|
71
74
|
<div>
|
|
72
75
|
{!manualPagination &&
|
|
73
76
|
['top', 'both'].includes(positionPagination ?? '') && (
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { styled, TableCell as MuiTableCell } from '@mui/material';
|
|
2
|
-
|
|
3
|
-
export const MRT_TableButtonCell = styled(MuiTableCell, {
|
|
4
|
-
shouldForwardProp: (prop) => prop !== 'densePadding',
|
|
5
|
-
})<{ densePadding?: boolean }>(({ densePadding }) => ({
|
|
6
|
-
padding: densePadding ? '1px' : '0.6rem',
|
|
7
|
-
textAlign: 'center',
|
|
8
|
-
transition: 'all 0.2s ease-in-out',
|
|
9
|
-
}));
|