material-react-table 1.5.2 → 1.5.4
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/cjs/index.js +19 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/buttons/MRT_ExpandAllButton.d.ts +1 -1
- package/dist/cjs/types/buttons/MRT_FullScreenToggleButton.d.ts +1 -1
- package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
- package/dist/cjs/types/buttons/MRT_ShowHideColumnsButton.d.ts +1 -1
- package/dist/cjs/types/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -1
- package/dist/cjs/types/buttons/MRT_ToggleFiltersButton.d.ts +1 -1
- package/dist/cjs/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -1
- package/dist/cjs/types/icons.d.ts +0 -2
- package/dist/cjs/types/inputs/MRT_GlobalFilterTextField.d.ts +1 -1
- package/dist/cjs/types/table/MRT_Table.d.ts +1 -1
- package/dist/cjs/types/toolbar/MRT_BottomToolbar.d.ts +1 -1
- package/dist/cjs/types/toolbar/MRT_LinearProgressBar.d.ts +1 -1
- package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +1 -1
- package/dist/cjs/types/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
- package/dist/cjs/types/toolbar/MRT_ToolbarDropZone.d.ts +1 -1
- package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +1 -1
- package/dist/esm/material-react-table.esm.js +19 -11
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/buttons/MRT_ExpandAllButton.d.ts +1 -1
- package/dist/esm/types/buttons/MRT_FullScreenToggleButton.d.ts +1 -1
- package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
- package/dist/esm/types/buttons/MRT_ShowHideColumnsButton.d.ts +1 -1
- package/dist/esm/types/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -1
- package/dist/esm/types/buttons/MRT_ToggleFiltersButton.d.ts +1 -1
- package/dist/esm/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -1
- package/dist/esm/types/icons.d.ts +0 -2
- package/dist/esm/types/inputs/MRT_GlobalFilterTextField.d.ts +1 -1
- package/dist/esm/types/table/MRT_Table.d.ts +1 -1
- package/dist/esm/types/toolbar/MRT_BottomToolbar.d.ts +1 -1
- package/dist/esm/types/toolbar/MRT_LinearProgressBar.d.ts +1 -1
- package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +1 -1
- package/dist/esm/types/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
- package/dist/esm/types/toolbar/MRT_ToolbarDropZone.d.ts +1 -1
- package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +1 -1
- package/dist/index.d.ts +0 -2
- package/package.json +1 -1
- package/src/buttons/MRT_ExpandAllButton.tsx +1 -1
- package/src/buttons/MRT_FullScreenToggleButton.tsx +1 -1
- package/src/buttons/MRT_GrabHandleButton.tsx +1 -1
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +1 -1
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +1 -1
- package/src/buttons/MRT_ToggleFiltersButton.tsx +1 -1
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +1 -1
- package/src/icons.ts +0 -6
- package/src/inputs/MRT_FilterTextField.tsx +16 -5
- package/src/inputs/MRT_GlobalFilterTextField.tsx +1 -1
- package/src/table/MRT_Table.tsx +1 -1
- package/src/toolbar/MRT_BottomToolbar.tsx +2 -2
- package/src/toolbar/MRT_LinearProgressBar.tsx +1 -1
- package/src/toolbar/MRT_TablePagination.tsx +1 -1
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +1 -1
- package/src/toolbar/MRT_ToolbarDropZone.tsx +1 -1
- package/src/toolbar/MRT_TopToolbar.tsx +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
3
|
-
import { MRT_TableInstance } from '..';
|
3
|
+
import type { MRT_TableInstance } from '..';
|
4
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
5
5
|
table: MRT_TableInstance<TData>;
|
6
6
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { DragEventHandler } from 'react';
|
2
2
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
3
|
-
import { MRT_TableInstance } from '..';
|
3
|
+
import type { MRT_TableInstance } from '..';
|
4
4
|
interface Props<TData extends Record<string, any> = {}> {
|
5
5
|
iconButtonProps?: IconButtonProps;
|
6
6
|
onDragStart: DragEventHandler<HTMLButtonElement>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
3
|
-
import { MRT_TableInstance } from '..';
|
3
|
+
import type { MRT_TableInstance } from '..';
|
4
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
5
5
|
table: MRT_TableInstance<TData>;
|
6
6
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
3
|
-
import { MRT_TableInstance } from '..';
|
3
|
+
import type { MRT_TableInstance } from '..';
|
4
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
5
5
|
table: MRT_TableInstance<TData>;
|
6
6
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
3
|
-
import { MRT_TableInstance } from '..';
|
3
|
+
import type { MRT_TableInstance } from '..';
|
4
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
5
5
|
table: MRT_TableInstance<TData>;
|
6
6
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
3
|
-
import { MRT_TableInstance } from '..';
|
3
|
+
import type { MRT_TableInstance } from '..';
|
4
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
5
5
|
table: MRT_TableInstance<TData>;
|
6
6
|
}
|
@@ -2,7 +2,6 @@ export interface MRT_Icons {
|
|
2
2
|
ArrowDownwardIcon: any;
|
3
3
|
ArrowRightIcon: any;
|
4
4
|
CancelIcon: any;
|
5
|
-
CheckBoxIcon: any;
|
6
5
|
ClearAllIcon: any;
|
7
6
|
CloseIcon: any;
|
8
7
|
DensityLargeIcon: any;
|
@@ -15,7 +14,6 @@ export interface MRT_Icons {
|
|
15
14
|
ExpandLessIcon: any;
|
16
15
|
ExpandMoreIcon: any;
|
17
16
|
FilterAltIcon: any;
|
18
|
-
FilterAltOffIcon: any;
|
19
17
|
FilterListIcon: any;
|
20
18
|
FilterListOffIcon: any;
|
21
19
|
FullscreenExitIcon: any;
|
package/dist/index.d.ts
CHANGED
@@ -107,7 +107,6 @@ interface MRT_Icons {
|
|
107
107
|
ArrowDownwardIcon: any;
|
108
108
|
ArrowRightIcon: any;
|
109
109
|
CancelIcon: any;
|
110
|
-
CheckBoxIcon: any;
|
111
110
|
ClearAllIcon: any;
|
112
111
|
CloseIcon: any;
|
113
112
|
DensityLargeIcon: any;
|
@@ -120,7 +119,6 @@ interface MRT_Icons {
|
|
120
119
|
ExpandLessIcon: any;
|
121
120
|
ExpandMoreIcon: any;
|
122
121
|
FilterAltIcon: any;
|
123
|
-
FilterAltOffIcon: any;
|
124
122
|
FilterListIcon: any;
|
125
123
|
FilterListOffIcon: any;
|
126
124
|
FullscreenExitIcon: any;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { FC } from 'react';
|
2
2
|
import IconButton from '@mui/material/IconButton';
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
4
|
-
import { MRT_TableInstance } from '..';
|
4
|
+
import type { MRT_TableInstance } from '..';
|
5
5
|
|
6
6
|
interface Props {
|
7
7
|
table: MRT_TableInstance;
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import IconButton from '@mui/material/IconButton';
|
3
3
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
5
|
-
import { MRT_TableInstance } from '..';
|
5
|
+
import type { MRT_TableInstance } from '..';
|
6
6
|
|
7
7
|
interface Props<TData extends Record<string, any> = {}>
|
8
8
|
extends IconButtonProps {
|
@@ -2,7 +2,7 @@ import React, { DragEventHandler } from 'react';
|
|
2
2
|
import IconButton from '@mui/material/IconButton';
|
3
3
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
5
|
-
import { MRT_TableInstance } from '..';
|
5
|
+
import type { MRT_TableInstance } from '..';
|
6
6
|
|
7
7
|
interface Props<TData extends Record<string, any> = {}> {
|
8
8
|
iconButtonProps?: IconButtonProps;
|
@@ -3,7 +3,7 @@ import IconButton from '@mui/material/IconButton';
|
|
3
3
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
5
5
|
import { MRT_ShowHideColumnsMenu } from '../menus/MRT_ShowHideColumnsMenu';
|
6
|
-
import { MRT_TableInstance } from '..';
|
6
|
+
import type { MRT_TableInstance } from '..';
|
7
7
|
|
8
8
|
interface Props<TData extends Record<string, any> = {}>
|
9
9
|
extends IconButtonProps {
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import IconButton from '@mui/material/IconButton';
|
3
3
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
5
|
-
import { MRT_TableInstance } from '..';
|
5
|
+
import type { MRT_TableInstance } from '..';
|
6
6
|
|
7
7
|
interface Props<TData extends Record<string, any> = {}>
|
8
8
|
extends IconButtonProps {
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import IconButton from '@mui/material/IconButton';
|
3
3
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
5
|
-
import { MRT_TableInstance } from '..';
|
5
|
+
import type { MRT_TableInstance } from '..';
|
6
6
|
|
7
7
|
interface Props<TData extends Record<string, any> = {}>
|
8
8
|
extends IconButtonProps {
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import IconButton from '@mui/material/IconButton';
|
3
3
|
import type { IconButtonProps } from '@mui/material/IconButton';
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
5
|
-
import { MRT_TableInstance } from '..';
|
5
|
+
import type { MRT_TableInstance } from '..';
|
6
6
|
|
7
7
|
interface Props<TData extends Record<string, any> = {}>
|
8
8
|
extends IconButtonProps {
|
package/src/icons.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
|
2
2
|
import ArrowRightIcon from '@mui/icons-material/ArrowRight';
|
3
3
|
import CancelIcon from '@mui/icons-material/Cancel';
|
4
|
-
import CheckBoxIcon from '@mui/icons-material/CheckBox';
|
5
4
|
import ClearAllIcon from '@mui/icons-material/ClearAll';
|
6
5
|
import CloseIcon from '@mui/icons-material/Close';
|
7
6
|
import DensityLargeIcon from '@mui/icons-material/DensityLarge';
|
@@ -13,7 +12,6 @@ import EditIcon from '@mui/icons-material/Edit';
|
|
13
12
|
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
|
14
13
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
15
14
|
import FilterAltIcon from '@mui/icons-material/FilterAlt';
|
16
|
-
import FilterAltOffIcon from '@mui/icons-material/FilterAltOff';
|
17
15
|
import FilterListIcon from '@mui/icons-material/FilterList';
|
18
16
|
import FilterListOffIcon from '@mui/icons-material/FilterListOff';
|
19
17
|
import FullscreenExitIcon from '@mui/icons-material/FullscreenExit';
|
@@ -34,7 +32,6 @@ export interface MRT_Icons {
|
|
34
32
|
ArrowDownwardIcon: any;
|
35
33
|
ArrowRightIcon: any;
|
36
34
|
CancelIcon: any;
|
37
|
-
CheckBoxIcon: any;
|
38
35
|
ClearAllIcon: any;
|
39
36
|
CloseIcon: any;
|
40
37
|
DensityLargeIcon: any;
|
@@ -47,7 +44,6 @@ export interface MRT_Icons {
|
|
47
44
|
ExpandLessIcon: any;
|
48
45
|
ExpandMoreIcon: any;
|
49
46
|
FilterAltIcon: any;
|
50
|
-
FilterAltOffIcon: any;
|
51
47
|
FilterListIcon: any;
|
52
48
|
FilterListOffIcon: any;
|
53
49
|
FullscreenExitIcon: any;
|
@@ -68,7 +64,6 @@ export const MRT_Default_Icons: MRT_Icons = {
|
|
68
64
|
ArrowDownwardIcon,
|
69
65
|
ArrowRightIcon,
|
70
66
|
CancelIcon,
|
71
|
-
CheckBoxIcon,
|
72
67
|
ClearAllIcon,
|
73
68
|
CloseIcon,
|
74
69
|
DensityLargeIcon,
|
@@ -80,7 +75,6 @@ export const MRT_Default_Icons: MRT_Icons = {
|
|
80
75
|
ExpandLessIcon,
|
81
76
|
ExpandMoreIcon,
|
82
77
|
FilterAltIcon,
|
83
|
-
FilterAltOffIcon,
|
84
78
|
FilterListIcon,
|
85
79
|
FilterListOffIcon,
|
86
80
|
FullscreenExitIcon,
|
@@ -16,9 +16,9 @@ import MenuItem from '@mui/material/MenuItem';
|
|
16
16
|
import TextField from '@mui/material/TextField';
|
17
17
|
import Tooltip from '@mui/material/Tooltip';
|
18
18
|
import { debounce } from '@mui/material/utils';
|
19
|
+
import { MRT_FilterOptionMenu } from '../menus/MRT_FilterOptionMenu';
|
19
20
|
import type { TextFieldProps } from '@mui/material/TextField';
|
20
21
|
import type { MRT_Header, MRT_TableInstance } from '..';
|
21
|
-
import { MRT_FilterOptionMenu } from '../menus/MRT_FilterOptionMenu';
|
22
22
|
|
23
23
|
interface Props {
|
24
24
|
header: MRT_Header;
|
@@ -165,7 +165,10 @@ export const MRT_FilterTextField: FC<Props> = ({
|
|
165
165
|
column.setFilterValue(undefined);
|
166
166
|
setColumnFilterFns((prev) => ({
|
167
167
|
...prev,
|
168
|
-
[header.id]:
|
168
|
+
[header.id]:
|
169
|
+
columnDef.columnFilterModeOptions?.[0] ??
|
170
|
+
columnFilterModeOptions?.[0] ??
|
171
|
+
'fuzzy',
|
169
172
|
}));
|
170
173
|
};
|
171
174
|
|
@@ -176,9 +179,17 @@ export const MRT_FilterTextField: FC<Props> = ({
|
|
176
179
|
const isMounted = useRef(false);
|
177
180
|
|
178
181
|
useEffect(() => {
|
179
|
-
if (isMounted.current
|
180
|
-
|
182
|
+
if (isMounted.current) {
|
183
|
+
const filterValue = column.getFilterValue();
|
184
|
+
if (filterValue === undefined) {
|
185
|
+
handleClear();
|
186
|
+
} else if (isRangeFilter && rangeFilterIndex !== undefined) {
|
187
|
+
setFilterValue((filterValue as [string, string])[rangeFilterIndex]);
|
188
|
+
} else {
|
189
|
+
setFilterValue(filterValue as string);
|
190
|
+
}
|
181
191
|
}
|
192
|
+
|
182
193
|
isMounted.current = true;
|
183
194
|
}, [column.getFilterValue()]);
|
184
195
|
|
@@ -267,7 +278,7 @@ export const MRT_FilterTextField: FC<Props> = ({
|
|
267
278
|
<span>
|
268
279
|
<IconButton
|
269
280
|
aria-label={localization.clearFilter}
|
270
|
-
disabled={!filterValue?.length}
|
281
|
+
disabled={!filterValue?.toString()?.length}
|
271
282
|
onClick={handleClear}
|
272
283
|
size="small"
|
273
284
|
sx={{
|
@@ -12,7 +12,7 @@ import TextField from '@mui/material/TextField';
|
|
12
12
|
import Tooltip from '@mui/material/Tooltip';
|
13
13
|
import { debounce } from '@mui/material/utils';
|
14
14
|
import { MRT_FilterOptionMenu } from '../menus/MRT_FilterOptionMenu';
|
15
|
-
import { MRT_TableInstance } from '..';
|
15
|
+
import type { MRT_TableInstance } from '..';
|
16
16
|
|
17
17
|
interface Props<TData extends Record<string, any> = {}> {
|
18
18
|
table: MRT_TableInstance<TData>;
|
package/src/table/MRT_Table.tsx
CHANGED
@@ -9,7 +9,7 @@ import Table from '@mui/material/Table';
|
|
9
9
|
import { MRT_TableHead } from '../head/MRT_TableHead';
|
10
10
|
import { Memo_MRT_TableBody, MRT_TableBody } from '../body/MRT_TableBody';
|
11
11
|
import { MRT_TableFooter } from '../footer/MRT_TableFooter';
|
12
|
-
import { MRT_TableInstance } from '..';
|
12
|
+
import type { MRT_TableInstance } from '..';
|
13
13
|
|
14
14
|
interface Props {
|
15
15
|
table: MRT_TableInstance;
|
@@ -5,10 +5,10 @@ import useMediaQuery from '@mui/material/useMediaQuery';
|
|
5
5
|
import { alpha } from '@mui/material/styles';
|
6
6
|
import { MRT_TablePagination } from './MRT_TablePagination';
|
7
7
|
import { MRT_ToolbarAlertBanner } from './MRT_ToolbarAlertBanner';
|
8
|
+
import { MRT_ToolbarDropZone } from './MRT_ToolbarDropZone';
|
8
9
|
import { MRT_LinearProgressBar } from './MRT_LinearProgressBar';
|
9
10
|
import { commonToolbarStyles } from './MRT_TopToolbar';
|
10
|
-
import { MRT_TableInstance } from '..';
|
11
|
-
import { MRT_ToolbarDropZone } from './MRT_ToolbarDropZone';
|
11
|
+
import type { MRT_TableInstance } from '..';
|
12
12
|
|
13
13
|
interface Props {
|
14
14
|
table: MRT_TableInstance;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { FC } from 'react';
|
2
2
|
import Collapse from '@mui/material/Collapse';
|
3
3
|
import LinearProgress from '@mui/material/LinearProgress';
|
4
|
-
import { MRT_TableInstance } from '..';
|
4
|
+
import type { MRT_TableInstance } from '..';
|
5
5
|
|
6
6
|
interface Props {
|
7
7
|
isTopToolbar: boolean;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { ChangeEvent } from 'react';
|
2
2
|
import TablePagination from '@mui/material/TablePagination';
|
3
|
-
import { MRT_TableInstance } from '..';
|
3
|
+
import type { MRT_TableInstance } from '..';
|
4
4
|
|
5
5
|
interface Props<TData extends Record<string, any> = {}> {
|
6
6
|
position?: 'top' | 'bottom';
|
@@ -4,7 +4,7 @@ import AlertTitle from '@mui/material/AlertTitle';
|
|
4
4
|
import Box from '@mui/material/Box';
|
5
5
|
import Chip from '@mui/material/Chip';
|
6
6
|
import Collapse from '@mui/material/Collapse';
|
7
|
-
import { MRT_TableInstance } from '..';
|
7
|
+
import type { MRT_TableInstance } from '..';
|
8
8
|
|
9
9
|
interface Props<TData extends Record<string, any> = {}> {
|
10
10
|
stackAlertBanner: boolean;
|
@@ -3,7 +3,7 @@ import { alpha } from '@mui/material/styles';
|
|
3
3
|
import Box from '@mui/material/Box';
|
4
4
|
import Fade from '@mui/material/Fade';
|
5
5
|
import Typography from '@mui/material/Typography';
|
6
|
-
import { MRT_TableInstance } from '..';
|
6
|
+
import type { MRT_TableInstance } from '..';
|
7
7
|
|
8
8
|
interface Props<TData extends Record<string, any> = {}> {
|
9
9
|
table: MRT_TableInstance<TData>;
|
@@ -5,7 +5,7 @@ import useMediaQuery from '@mui/material/useMediaQuery';
|
|
5
5
|
import { lighten } from '@mui/material/styles';
|
6
6
|
import { MRT_GlobalFilterTextField } from '../inputs/MRT_GlobalFilterTextField';
|
7
7
|
import { MRT_LinearProgressBar } from './MRT_LinearProgressBar';
|
8
|
-
import { MRT_TableInstance } from '..';
|
8
|
+
import type { MRT_TableInstance } from '..';
|
9
9
|
import { MRT_TablePagination } from './MRT_TablePagination';
|
10
10
|
import { MRT_ToolbarAlertBanner } from './MRT_ToolbarAlertBanner';
|
11
11
|
import { MRT_ToolbarInternalButtons } from './MRT_ToolbarInternalButtons';
|