material-react-table-narender 2.13.29 → 2.13.32
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +10 -42
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/head/MRT_TableHeadCell.tsx +2 -2
- package/src/components/head/MRT_TableHeadCellToolBar.tsx +61 -61
- package/src/components/menus/MRT_ColumnActionMenu.tsx +3 -2
- package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +2 -2
- package/src/components/table/MRT_TablePaper.tsx +5 -2
- package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +2 -2
- package/src/icons.ts +3 -1
package/package.json
CHANGED
@@ -18,7 +18,7 @@ import {
|
|
18
18
|
import { getCommonMRTCellStyles } from '../../utils/style.utils';
|
19
19
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
20
20
|
import { cellKeyboardShortcuts } from '../../utils/cell.utils';
|
21
|
-
import { MRT_TableHeadCellToolBar } from './MRT_TableHeadCellToolBar';
|
21
|
+
// import { MRT_TableHeadCellToolBar } from './MRT_TableHeadCellToolBar';
|
22
22
|
|
23
23
|
export interface MRT_TableHeadCellProps<TData extends MRT_RowData>
|
24
24
|
extends TableCellProps {
|
@@ -309,7 +309,7 @@ export const MRT_TableHeadCell = <TData extends MRT_RowData>({
|
|
309
309
|
{column.getCanSort() && (
|
310
310
|
<MRT_TableHeadCellSortLabel header={header} table={table} />
|
311
311
|
)}
|
312
|
-
<MRT_TableHeadCellToolBar header={header} table={table} />
|
312
|
+
{/* <MRT_TableHeadCellToolBar header={header} table={table} /> */}
|
313
313
|
</Box>
|
314
314
|
{columnDefType !== 'group' && (
|
315
315
|
<Box
|
@@ -1,68 +1,68 @@
|
|
1
|
-
import Badge from '@mui/material/Badge';
|
2
|
-
import TableSortLabel, {
|
3
|
-
|
4
|
-
} from '@mui/material/TableSortLabel';
|
5
|
-
import Tooltip from '@mui/material/Tooltip';
|
6
|
-
import {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
} from '../../types';
|
11
|
-
import { parseFromValuesOrFunc } from '../../utils/utils';
|
12
|
-
import { IconButton } from '@mui/material';
|
1
|
+
// import Badge from '@mui/material/Badge';
|
2
|
+
// import TableSortLabel, {
|
3
|
+
// type TableSortLabelProps,
|
4
|
+
// } from '@mui/material/TableSortLabel';
|
5
|
+
// import Tooltip from '@mui/material/Tooltip';
|
6
|
+
// import {
|
7
|
+
// type MRT_Header,
|
8
|
+
// type MRT_RowData,
|
9
|
+
// type MRT_TableInstance,
|
10
|
+
// } from '../../types';
|
11
|
+
// import { parseFromValuesOrFunc } from '../../utils/utils';
|
12
|
+
// import { IconButton } from '@mui/material';
|
13
13
|
|
14
|
-
export interface MRT_TableHeadCellToolBarLabelProps<TData extends MRT_RowData>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
14
|
+
// export interface MRT_TableHeadCellToolBarLabelProps<TData extends MRT_RowData>
|
15
|
+
// extends TableSortLabelProps {
|
16
|
+
// header: MRT_Header<TData>;
|
17
|
+
// table: MRT_TableInstance<TData>;
|
18
|
+
// }
|
19
19
|
|
20
|
-
export const MRT_TableHeadCellToolBar = <TData extends MRT_RowData>({
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
}: MRT_TableHeadCellToolBarLabelProps<TData>) => {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
20
|
+
// export const MRT_TableHeadCellToolBar = <TData extends MRT_RowData>({
|
21
|
+
// header,
|
22
|
+
// table,
|
23
|
+
// ...rest
|
24
|
+
// }: MRT_TableHeadCellToolBarLabelProps<TData>) => {
|
25
|
+
// const {
|
26
|
+
// getState,
|
27
|
+
// options: {
|
28
|
+
// icons: { ArrowDownwardIcon, SyncAltIcon },
|
29
|
+
// localization,
|
30
|
+
// },
|
31
|
+
// } = table;
|
32
|
+
// const { isLoading, showSkeletons, showToolBar } = getState();
|
33
33
|
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
// const showToolBarTooltip = isLoading || showSkeletons
|
36
|
+
// ? ''
|
37
|
+
// : showToolBar
|
38
|
+
// ? "Hide ToolBar"
|
39
|
+
// : "Show ToolBar";
|
40
40
|
|
41
41
|
|
42
|
-
|
43
|
-
|
42
|
+
// return (
|
43
|
+
// <Tooltip placement="top" title={showToolBarTooltip}>
|
44
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
|
-
};
|
45
|
+
// <IconButton
|
46
|
+
// aria-label={showToolBarTooltip}
|
47
|
+
// size="small"
|
48
|
+
// sx={(theme) => ({
|
49
|
+
// '&:hover': {
|
50
|
+
// backgroundColor: 'transparent',
|
51
|
+
// opacity: 1,
|
52
|
+
// },
|
53
|
+
// cursor: 'pointer',
|
54
|
+
// opacity: 1,
|
55
|
+
// p: '2px',
|
56
|
+
// transition: 'all 150ms ease-in-out',
|
57
|
+
// ...(parseFromValuesOrFunc(rest?.sx, theme) as any),
|
58
|
+
// })}
|
59
|
+
// onClick={(e) => {
|
60
|
+
// e.stopPropagation();
|
61
|
+
// table.setShowToolBar(!showToolBar);
|
62
|
+
// }}
|
63
|
+
// >
|
64
|
+
// <SyncAltIcon />
|
65
|
+
// </IconButton>
|
66
|
+
// </Tooltip>
|
67
|
+
// );
|
68
|
+
// };
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
type MRT_RowData,
|
8
8
|
type MRT_TableInstance,
|
9
9
|
} from '../../types';
|
10
|
-
import { MRT_TableHeadCellToolBar } from '../head/MRT_TableHeadCellToolBar';
|
10
|
+
// import { MRT_TableHeadCellToolBar } from '../head/MRT_TableHeadCellToolBar';
|
11
11
|
|
12
12
|
export interface MRT_ColumnActionMenuProps<TData extends MRT_RowData>
|
13
13
|
extends Partial<MenuProps> {
|
@@ -48,6 +48,7 @@ export const MRT_ColumnActionMenu = <TData extends MRT_RowData>({
|
|
48
48
|
SortIcon,
|
49
49
|
ViewColumnIcon,
|
50
50
|
VisibilityOffIcon,
|
51
|
+
SettingsOutlinedIcon
|
51
52
|
},
|
52
53
|
localization,
|
53
54
|
mrtTheme: { menuBackgroundColor },
|
@@ -319,7 +320,7 @@ export const MRT_ColumnActionMenu = <TData extends MRT_RowData>({
|
|
319
320
|
|
320
321
|
// **Newly Added Menu Item for Toolbar Visibility**
|
321
322
|
<MRT_ActionMenuItem
|
322
|
-
icon={<
|
323
|
+
icon={<SettingsOutlinedIcon />}
|
323
324
|
key={13}
|
324
325
|
label={showToolBar ? "Hide ToolBar" : "Show ToolBar"}
|
325
326
|
onClick={(e) => {
|
@@ -180,7 +180,7 @@ export const MRT_ShowHideColumnsMenuItems = <TData extends MRT_RowData>({
|
|
180
180
|
{columnDef.header}
|
181
181
|
</Typography>
|
182
182
|
)}
|
183
|
-
{
|
183
|
+
{/* {
|
184
184
|
enableColumnResizing && columnDefType !== 'group' &&
|
185
185
|
(
|
186
186
|
columnDef.enableResizing !== false ? (
|
@@ -202,7 +202,7 @@ export const MRT_ShowHideColumnsMenuItems = <TData extends MRT_RowData>({
|
|
202
202
|
<Box sx={{ width: '28px' }} />
|
203
203
|
)
|
204
204
|
)
|
205
|
-
}
|
205
|
+
} */}
|
206
206
|
|
207
207
|
</Box>
|
208
208
|
</MenuItem>
|
@@ -27,7 +27,7 @@ export const MRT_TablePaper = <TData extends MRT_RowData>({
|
|
27
27
|
},
|
28
28
|
refs: { tablePaperRef },
|
29
29
|
} = table;
|
30
|
-
const { isFullScreen } = getState();
|
30
|
+
const { isFullScreen,showToolBar } = getState();
|
31
31
|
|
32
32
|
const paperProps = {
|
33
33
|
...parseFromValuesOrFunc(muiTablePaperProps, { table }),
|
@@ -74,10 +74,13 @@ export const MRT_TablePaper = <TData extends MRT_RowData>({
|
|
74
74
|
...(parseFromValuesOrFunc(paperProps?.sx, theme) as any),
|
75
75
|
})}
|
76
76
|
>
|
77
|
-
{enableTopToolbar &&
|
77
|
+
{enableTopToolbar &&
|
78
78
|
(parseFromValuesOrFunc(renderTopToolbar, { table }) ?? (
|
79
79
|
<MRT_TopToolbar table={table} />
|
80
80
|
))}
|
81
|
+
|
82
|
+
|
83
|
+
|
81
84
|
<MRT_TableContainer table={table} />
|
82
85
|
{enableBottomToolbar &&
|
83
86
|
(parseFromValuesOrFunc(renderBottomToolbar, { table }) ?? (
|
@@ -67,9 +67,9 @@ export const MRT_ToolbarInternalButtons = <TData extends MRT_RowData>({
|
|
67
67
|
{enableFullScreenToggle && (
|
68
68
|
<MRT_ToggleFullScreenButton table={table} />
|
69
69
|
)}
|
70
|
-
{enableKeyboardShortcuts && (
|
70
|
+
{/* {enableKeyboardShortcuts && (
|
71
71
|
<MRT_ToggleNavigationButton table={table} />
|
72
|
-
)}
|
72
|
+
)} */}
|
73
73
|
</>
|
74
74
|
)}
|
75
75
|
</Box>
|
package/src/icons.ts
CHANGED
@@ -33,6 +33,7 @@ import SyncAltIcon from '@mui/icons-material/SyncAlt';
|
|
33
33
|
import ViewColumnIcon from '@mui/icons-material/ViewColumn';
|
34
34
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
35
35
|
import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore';
|
36
|
+
import SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined';
|
36
37
|
|
37
38
|
export const MRT_Default_Icons = {
|
38
39
|
ArrowDownwardIcon,
|
@@ -69,7 +70,8 @@ export const MRT_Default_Icons = {
|
|
69
70
|
SyncAltIcon,
|
70
71
|
ViewColumnIcon,
|
71
72
|
VisibilityOffIcon,
|
72
|
-
SettingsBackupRestoreIcon
|
73
|
+
SettingsBackupRestoreIcon,
|
74
|
+
SettingsOutlinedIcon
|
73
75
|
} as const;
|
74
76
|
|
75
77
|
export type MRT_Icons = Record<keyof typeof MRT_Default_Icons, any>;
|