material-react-table 0.39.0 → 0.40.2
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/MaterialReactTable.d.ts +11 -2
- package/dist/cjs/index.js +40 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/MaterialReactTable.d.ts +11 -2
- package/dist/esm/material-react-table.esm.js +40 -23
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/index.d.ts +12 -3
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +11 -5
- package/src/body/MRT_TableBody.tsx +15 -10
- package/src/body/MRT_TableBodyCell.tsx +6 -4
- package/src/head/MRT_TableHeadCell.tsx +21 -13
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +1 -1
- package/src/table/MRT_TableRoot.tsx +15 -9
- package/src/toolbar/MRT_ToolbarDropZone.tsx +10 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { MutableRefObject, Dispatch, SetStateAction, ReactNode, DragEvent } from 'react';
|
|
3
3
|
import { ButtonProps, TextFieldProps, TableCellProps, IconButtonProps, ToolbarProps, LinearProgressProps, CheckboxProps, SkeletonProps, TableBodyProps, TableRowProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, PaperProps, TableProps, ChipProps, AlertProps } from '@mui/material';
|
|
4
4
|
import { Row, Table, TableState, ColumnDef, DeepKeys, Column, Header, HeaderGroup, Cell, SortingFn, FilterFn, TableOptions, OnChangeFn } from '@tanstack/react-table';
|
|
5
|
-
import { Options } from 'react-virtual';
|
|
5
|
+
import { Options, VirtualItem } from 'react-virtual';
|
|
6
6
|
import * as _tanstack_table_core from '@tanstack/table-core';
|
|
7
7
|
import { RankingInfo } from '@tanstack/match-sorter-utils';
|
|
8
8
|
|
|
@@ -697,11 +697,20 @@ declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = O
|
|
|
697
697
|
rowNumberMode?: 'original' | 'static';
|
|
698
698
|
selectAllMode?: 'all' | 'page';
|
|
699
699
|
state?: Partial<MRT_TableState<TData>>;
|
|
700
|
+
tableInstanceRef?: MutableRefObject<MRT_TableInstance<TData> | null>;
|
|
700
701
|
virtualizerProps?: Partial<Options<HTMLDivElement>> | (({ table, }: {
|
|
701
702
|
table: MRT_TableInstance<TData>;
|
|
702
703
|
}) => Partial<Options<HTMLDivElement>>);
|
|
704
|
+
virtualizerInstanceRef?: MutableRefObject<Virtualizer | null>;
|
|
703
705
|
};
|
|
704
|
-
declare
|
|
706
|
+
declare type Virtualizer = {
|
|
707
|
+
virtualItems: VirtualItem[];
|
|
708
|
+
totalSize: number;
|
|
709
|
+
scrollToOffset: (index: number, options?: any | undefined) => void;
|
|
710
|
+
scrollToIndex: (index: number, options?: any | undefined) => void;
|
|
711
|
+
measure: () => void;
|
|
712
|
+
};
|
|
713
|
+
declare const _default: <TData extends Record<string, any> = {}>({ aggregationFns, autoResetExpanded, columnResizeMode, defaultColumn, editingMode, enableBottomToolbar, enableColumnActions, enableColumnFilters, enableColumnOrdering, enableColumnResizing, enableDensityToggle, enableExpandAll, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableGlobalFilterRankedResults, enableGrouping, enableHiding, enableMultiRowSelection, enableMultiSort, enablePagination, enablePinning, enableRowSelection, enableSelectAll, enableSorting, enableStickyHeader, enableTableFooter, enableTableHead, enableToolbarInternalActions, enableTopToolbar, filterFns, icons, localization, positionActionsColumn, positionExpandColumn, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, rowNumberMode, selectAllMode, sortingFns, ...rest }: MaterialReactTableProps<TData>) => JSX.Element;
|
|
705
714
|
|
|
706
715
|
interface Props$6<TData extends Record<string, any> = {}> {
|
|
707
716
|
cell: MRT_Cell<TData>;
|
|
@@ -740,4 +749,4 @@ interface Props<TData extends Record<string, any> = {}> extends IconButtonProps
|
|
|
740
749
|
}
|
|
741
750
|
declare const MRT_ToggleGlobalFilterButton: <TData extends Record<string, any> = {}>({ table, ...rest }: Props<TData>) => JSX.Element;
|
|
742
751
|
|
|
743
|
-
export { MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_CopyButton, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterFn, MRT_FilterOption, MRT_FullScreenToggleButton, MRT_GlobalFilterTextField, MRT_Header, MRT_HeaderGroup, MRT_Icons, MRT_InternalFilterOption, MRT_Localization, MRT_Row, MRT_RowModel, MRT_ShowHideColumnsButton, MRT_SortingFn, MRT_SortingOption, MRT_TableInstance, MRT_TableState, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleGlobalFilterButton, MaterialReactTableProps, _default as default };
|
|
752
|
+
export { MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_CopyButton, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterFn, MRT_FilterOption, MRT_FullScreenToggleButton, MRT_GlobalFilterTextField, MRT_Header, MRT_HeaderGroup, MRT_Icons, MRT_InternalFilterOption, MRT_Localization, MRT_Row, MRT_RowModel, MRT_ShowHideColumnsButton, MRT_SortingFn, MRT_SortingOption, MRT_TableInstance, MRT_TableState, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleGlobalFilterButton, MaterialReactTableProps, Virtualizer, _default as default };
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.40.2",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "material-react-table",
|
|
5
5
|
"description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"storybook": "start-storybook -p 6006"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@babel/core": "^7.18.
|
|
52
|
+
"@babel/core": "^7.18.13",
|
|
53
53
|
"@babel/preset-react": "^7.18.6",
|
|
54
54
|
"@emotion/react": "^11.10.0",
|
|
55
55
|
"@emotion/styled": "^11.10.0",
|
|
56
56
|
"@faker-js/faker": "^7.4.0",
|
|
57
|
-
"@mui/icons-material": "^5.
|
|
58
|
-
"@mui/material": "^5.10.
|
|
57
|
+
"@mui/icons-material": "^5.10.2",
|
|
58
|
+
"@mui/material": "^5.10.2",
|
|
59
59
|
"@rollup/plugin-babel": "^5.3.1",
|
|
60
60
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
61
61
|
"@rollup/plugin-typescript": "^8.3.4",
|
|
@@ -40,7 +40,7 @@ import type {
|
|
|
40
40
|
TableOptions,
|
|
41
41
|
TableState,
|
|
42
42
|
} from '@tanstack/react-table';
|
|
43
|
-
import type { Options as VirtualizerOptions } from 'react-virtual';
|
|
43
|
+
import type { Options as VirtualizerOptions, VirtualItem } from 'react-virtual';
|
|
44
44
|
// import type { VirtualizerOptions } from '@tanstack/react-virtual';
|
|
45
45
|
import { MRT_AggregationFns } from './aggregationFns';
|
|
46
46
|
import { MRT_Default_Icons, MRT_Icons } from './icons';
|
|
@@ -841,6 +841,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
|
841
841
|
rowNumberMode?: 'original' | 'static';
|
|
842
842
|
selectAllMode?: 'all' | 'page';
|
|
843
843
|
state?: Partial<MRT_TableState<TData>>;
|
|
844
|
+
tableInstanceRef?: MutableRefObject<MRT_TableInstance<TData> | null>;
|
|
844
845
|
virtualizerProps?:
|
|
845
846
|
| Partial<VirtualizerOptions<HTMLDivElement>>
|
|
846
847
|
| (({
|
|
@@ -855,8 +856,17 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
|
855
856
|
// }: {
|
|
856
857
|
// table: MRT_TableInstance<TData>;
|
|
857
858
|
// }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>);
|
|
859
|
+
virtualizerInstanceRef?: MutableRefObject<Virtualizer | null>;
|
|
858
860
|
};
|
|
859
861
|
|
|
862
|
+
export type Virtualizer = {
|
|
863
|
+
virtualItems: VirtualItem[];
|
|
864
|
+
totalSize: number;
|
|
865
|
+
scrollToOffset: (index: number, options?: any | undefined) => void;
|
|
866
|
+
scrollToIndex: (index: number, options?: any | undefined) => void;
|
|
867
|
+
measure: () => void;
|
|
868
|
+
};
|
|
869
|
+
|
|
860
870
|
export default <TData extends Record<string, any> = {}>({
|
|
861
871
|
aggregationFns,
|
|
862
872
|
autoResetExpanded = false,
|
|
@@ -865,7 +875,6 @@ export default <TData extends Record<string, any> = {}>({
|
|
|
865
875
|
editingMode = 'modal',
|
|
866
876
|
enableBottomToolbar = true,
|
|
867
877
|
enableColumnActions = true,
|
|
868
|
-
enableColumnFilterModes = false,
|
|
869
878
|
enableColumnFilters = true,
|
|
870
879
|
enableColumnOrdering = false,
|
|
871
880
|
enableColumnResizing = false,
|
|
@@ -874,7 +883,6 @@ export default <TData extends Record<string, any> = {}>({
|
|
|
874
883
|
enableFilters = true,
|
|
875
884
|
enableFullScreenToggle = true,
|
|
876
885
|
enableGlobalFilter = true,
|
|
877
|
-
enableGlobalFilterModes = false,
|
|
878
886
|
enableGlobalFilterRankedResults = true,
|
|
879
887
|
enableGrouping = false,
|
|
880
888
|
enableHiding = true,
|
|
@@ -912,7 +920,6 @@ export default <TData extends Record<string, any> = {}>({
|
|
|
912
920
|
editingMode={editingMode}
|
|
913
921
|
enableBottomToolbar={enableBottomToolbar}
|
|
914
922
|
enableColumnActions={enableColumnActions}
|
|
915
|
-
enableColumnFilterModes={enableColumnFilterModes}
|
|
916
923
|
enableColumnFilters={enableColumnFilters}
|
|
917
924
|
enableColumnOrdering={enableColumnOrdering}
|
|
918
925
|
enableColumnResizing={enableColumnResizing}
|
|
@@ -921,7 +928,6 @@ export default <TData extends Record<string, any> = {}>({
|
|
|
921
928
|
enableFilters={enableFilters}
|
|
922
929
|
enableFullScreenToggle={enableFullScreenToggle}
|
|
923
930
|
enableGlobalFilter={enableGlobalFilter}
|
|
924
|
-
enableGlobalFilterModes={enableGlobalFilterModes}
|
|
925
931
|
enableGlobalFilterRankedResults={enableGlobalFilterRankedResults}
|
|
926
932
|
enableGrouping={enableGrouping}
|
|
927
933
|
enableHiding={enableHiding}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { FC, RefObject, useMemo } from 'react';
|
|
2
|
-
import { useVirtual } from 'react-virtual';
|
|
1
|
+
import React, { FC, RefObject, useEffect, useMemo } from 'react';
|
|
2
|
+
import { useVirtual } from 'react-virtual'; //stuck on v2 for now
|
|
3
3
|
// import { useVirtualizer, Virtualizer } from '@tanstack/react-virtual';
|
|
4
4
|
import { TableBody } from '@mui/material';
|
|
5
5
|
import { MRT_TableBodyRow } from './MRT_TableBodyRow';
|
|
@@ -22,6 +22,7 @@ export const MRT_TableBody: FC<Props> = ({ table, tableContainerRef }) => {
|
|
|
22
22
|
enableRowVirtualization,
|
|
23
23
|
muiTableBodyProps,
|
|
24
24
|
virtualizerProps,
|
|
25
|
+
virtualizerInstanceRef,
|
|
25
26
|
},
|
|
26
27
|
} = table;
|
|
27
28
|
const { globalFilter, pagination, sorting } = getState();
|
|
@@ -62,7 +63,7 @@ export const MRT_TableBody: FC<Props> = ({ table, tableContainerRef }) => {
|
|
|
62
63
|
globalFilter,
|
|
63
64
|
]);
|
|
64
65
|
|
|
65
|
-
const
|
|
66
|
+
const virtualizer = enableRowVirtualization
|
|
66
67
|
? useVirtual({
|
|
67
68
|
size: rows.length,
|
|
68
69
|
parentRef: tableContainerRef,
|
|
@@ -71,7 +72,13 @@ export const MRT_TableBody: FC<Props> = ({ table, tableContainerRef }) => {
|
|
|
71
72
|
})
|
|
72
73
|
: ({} as any);
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (virtualizerInstanceRef) {
|
|
77
|
+
virtualizerInstanceRef.current = virtualizer;
|
|
78
|
+
}
|
|
79
|
+
}, [virtualizer]);
|
|
80
|
+
|
|
81
|
+
// const virtualizer: Virtualizer = enableRowVirtualization
|
|
75
82
|
// ? useVirtualizer({
|
|
76
83
|
// count: rows.length,
|
|
77
84
|
// estimateSize: () => (density === 'compact' ? 25 : 50),
|
|
@@ -81,12 +88,10 @@ export const MRT_TableBody: FC<Props> = ({ table, tableContainerRef }) => {
|
|
|
81
88
|
// })
|
|
82
89
|
// : ({} as any);
|
|
83
90
|
|
|
84
|
-
const virtualRows = enableRowVirtualization
|
|
85
|
-
? rowVirtualizer.virtualItems
|
|
86
|
-
: [];
|
|
91
|
+
const virtualRows = enableRowVirtualization ? virtualizer.virtualItems : [];
|
|
87
92
|
|
|
88
93
|
// const virtualRows = enableRowVirtualization
|
|
89
|
-
// ?
|
|
94
|
+
// ? virtualizer.getVirtualItems()
|
|
90
95
|
// : [];
|
|
91
96
|
|
|
92
97
|
let paddingTop = 0;
|
|
@@ -94,13 +99,13 @@ export const MRT_TableBody: FC<Props> = ({ table, tableContainerRef }) => {
|
|
|
94
99
|
if (enableRowVirtualization) {
|
|
95
100
|
paddingTop = !!virtualRows.length ? virtualRows[0].start : 0;
|
|
96
101
|
paddingBottom = !!virtualRows.length
|
|
97
|
-
?
|
|
102
|
+
? virtualizer.totalSize - virtualRows[virtualRows.length - 1].end
|
|
98
103
|
: 0;
|
|
99
104
|
}
|
|
100
105
|
// if (enableRowVirtualization) {
|
|
101
106
|
// paddingTop = !!virtualRows.length ? virtualRows[0].start : 0;
|
|
102
107
|
// paddingBottom = !!virtualRows.length
|
|
103
|
-
// ?
|
|
108
|
+
// ? virtualizer.getTotalSize() - virtualRows[virtualRows.length - 1].end
|
|
104
109
|
// : 0;
|
|
105
110
|
// }
|
|
106
111
|
|
|
@@ -109,7 +109,8 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
109
109
|
[isLoading, showSkeletons],
|
|
110
110
|
);
|
|
111
111
|
|
|
112
|
-
const handleDoubleClick = (
|
|
112
|
+
const handleDoubleClick = (event: MouseEvent<HTMLTableCellElement>) => {
|
|
113
|
+
tableCellProps?.onDoubleClick?.(event);
|
|
113
114
|
if (
|
|
114
115
|
(enableEditing || columnDef.enableEditing) &&
|
|
115
116
|
columnDef.enableEditing !== false &&
|
|
@@ -143,7 +144,8 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
143
144
|
);
|
|
144
145
|
};
|
|
145
146
|
|
|
146
|
-
const handleDragEnter = (
|
|
147
|
+
const handleDragEnter = (e: DragEvent<HTMLTableCellElement>) => {
|
|
148
|
+
tableCellProps?.onDragEnter?.(e);
|
|
147
149
|
if (enableGrouping && hoveredColumn?.id === 'drop-zone') {
|
|
148
150
|
setHoveredColumn(null);
|
|
149
151
|
}
|
|
@@ -179,9 +181,9 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
179
181
|
|
|
180
182
|
return (
|
|
181
183
|
<TableCell
|
|
182
|
-
onDoubleClick={handleDoubleClick}
|
|
183
|
-
onDragEnter={handleDragEnter}
|
|
184
184
|
{...tableCellProps}
|
|
185
|
+
onDragEnter={handleDragEnter}
|
|
186
|
+
onDoubleClick={handleDoubleClick}
|
|
185
187
|
sx={(theme) => ({
|
|
186
188
|
backgroundColor: column.getIsPinned()
|
|
187
189
|
? alpha(lighten(theme.palette.background.default, 0.04), 0.95)
|
|
@@ -28,8 +28,13 @@ export const MRT_TableHeadCell: FC<Props> = ({ header, table }) => {
|
|
|
28
28
|
},
|
|
29
29
|
setHoveredColumn,
|
|
30
30
|
} = table;
|
|
31
|
-
const {
|
|
32
|
-
|
|
31
|
+
const {
|
|
32
|
+
density,
|
|
33
|
+
draggingColumn,
|
|
34
|
+
grouping,
|
|
35
|
+
hoveredColumn,
|
|
36
|
+
showColumnFilters,
|
|
37
|
+
} = getState();
|
|
33
38
|
const { column } = header;
|
|
34
39
|
const { columnDef } = column;
|
|
35
40
|
const { columnDefType } = columnDef;
|
|
@@ -221,17 +226,20 @@ export const MRT_TableHeadCell: FC<Props> = ({ header, table }) => {
|
|
|
221
226
|
</Box>
|
|
222
227
|
{columnDefType !== 'group' && (
|
|
223
228
|
<Box sx={{ whiteSpace: 'nowrap' }}>
|
|
224
|
-
{
|
|
225
|
-
columnDef.enableColumnDragging !== false
|
|
226
|
-
(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
229
|
+
{enableColumnDragging !== false &&
|
|
230
|
+
columnDef.enableColumnDragging !== false &&
|
|
231
|
+
(enableColumnDragging ||
|
|
232
|
+
(enableColumnOrdering &&
|
|
233
|
+
columnDef.enableColumnOrdering !== false) ||
|
|
234
|
+
(enableGrouping &&
|
|
235
|
+
columnDef.enableGrouping !== false &&
|
|
236
|
+
!grouping.includes(column.id))) && (
|
|
237
|
+
<MRT_TableHeadCellGrabHandle
|
|
238
|
+
column={column}
|
|
239
|
+
table={table}
|
|
240
|
+
tableHeadCellRef={tableHeadCellRef}
|
|
241
|
+
/>
|
|
242
|
+
)}
|
|
235
243
|
{(enableColumnActions || columnDef.enableColumnActions) &&
|
|
236
244
|
columnDef.enableColumnActions !== false && (
|
|
237
245
|
<MRT_TableHeadCellColumnActionsButton
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, useRef, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
TableState,
|
|
4
4
|
getCoreRowModel,
|
|
@@ -134,7 +134,7 @@ export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
|
|
|
134
134
|
<MRT_ToggleRowActionMenuButton
|
|
135
135
|
cell={cell as any}
|
|
136
136
|
row={row as any}
|
|
137
|
-
table={table}
|
|
137
|
+
table={table as any}
|
|
138
138
|
/>
|
|
139
139
|
),
|
|
140
140
|
header: props.localization?.actions,
|
|
@@ -146,11 +146,11 @@ export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
|
|
|
146
146
|
columnOrder.includes('mrt-row-expand') &&
|
|
147
147
|
showExpandColumn(props, grouping) && {
|
|
148
148
|
Cell: ({ row }) => (
|
|
149
|
-
<MRT_ExpandButton row={row as any} table={table} />
|
|
149
|
+
<MRT_ExpandButton row={row as any} table={table as any} />
|
|
150
150
|
),
|
|
151
151
|
Header: () =>
|
|
152
152
|
props.enableExpandAll ? (
|
|
153
|
-
<MRT_ExpandAllButton table={table} />
|
|
153
|
+
<MRT_ExpandAllButton table={table as any} />
|
|
154
154
|
) : null,
|
|
155
155
|
header: props.localization?.expand,
|
|
156
156
|
size: 60,
|
|
@@ -160,11 +160,11 @@ export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
|
|
|
160
160
|
},
|
|
161
161
|
columnOrder.includes('mrt-row-select') && {
|
|
162
162
|
Cell: ({ row }) => (
|
|
163
|
-
<MRT_SelectCheckbox row={row as any} table={table} />
|
|
163
|
+
<MRT_SelectCheckbox row={row as any} table={table as any} />
|
|
164
164
|
),
|
|
165
165
|
Header: () =>
|
|
166
166
|
props.enableSelectAll ? (
|
|
167
|
-
<MRT_SelectCheckbox selectAll table={table} />
|
|
167
|
+
<MRT_SelectCheckbox selectAll table={table as any} />
|
|
168
168
|
) : null,
|
|
169
169
|
header: props.localization?.select,
|
|
170
170
|
size: 60,
|
|
@@ -301,7 +301,13 @@ export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
|
|
|
301
301
|
setShowAlertBanner: props.onShowAlertBannerChange ?? setShowAlertBanner,
|
|
302
302
|
setShowFilters: props.onShowFiltersChange ?? setShowFilters,
|
|
303
303
|
setShowGlobalFilter: props.onShowGlobalFilterChange ?? setShowGlobalFilter,
|
|
304
|
-
} as MRT_TableInstance
|
|
304
|
+
} as MRT_TableInstance<TData>;
|
|
305
|
+
|
|
306
|
+
useEffect(() => {
|
|
307
|
+
if (props.tableInstanceRef) {
|
|
308
|
+
props.tableInstanceRef.current = table;
|
|
309
|
+
}
|
|
310
|
+
}, [table]);
|
|
305
311
|
|
|
306
312
|
return (
|
|
307
313
|
<>
|
|
@@ -315,9 +321,9 @@ export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
|
|
|
315
321
|
open={isFullScreen}
|
|
316
322
|
transitionDuration={400}
|
|
317
323
|
>
|
|
318
|
-
<MRT_TablePaper table={table} />
|
|
324
|
+
<MRT_TablePaper table={table as any} />
|
|
319
325
|
</Dialog>
|
|
320
|
-
{!isFullScreen && <MRT_TablePaper table={table} />}
|
|
326
|
+
{!isFullScreen && <MRT_TablePaper table={table as any} />}
|
|
321
327
|
{editingRow && props.editingMode === 'modal' && (
|
|
322
328
|
<MRT_EditRowModal row={editingRow as any} table={table} open />
|
|
323
329
|
)}
|
|
@@ -13,14 +13,22 @@ export const MRT_ToolbarDropZone: FC<Props> = ({ table }) => {
|
|
|
13
13
|
setHoveredColumn,
|
|
14
14
|
} = table;
|
|
15
15
|
|
|
16
|
-
const { draggingColumn, hoveredColumn } = getState();
|
|
16
|
+
const { draggingColumn, hoveredColumn, grouping } = getState();
|
|
17
17
|
|
|
18
18
|
const handleDragEnter = (_event: DragEvent<HTMLDivElement>) => {
|
|
19
19
|
setHoveredColumn({ id: 'drop-zone' });
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<Fade
|
|
23
|
+
<Fade
|
|
24
|
+
unmountOnExit
|
|
25
|
+
mountOnEnter
|
|
26
|
+
in={
|
|
27
|
+
!!enableGrouping &&
|
|
28
|
+
!!draggingColumn &&
|
|
29
|
+
!grouping.includes(draggingColumn.id)
|
|
30
|
+
}
|
|
31
|
+
>
|
|
24
32
|
<Box
|
|
25
33
|
sx={(theme) => ({
|
|
26
34
|
alignItems: 'center',
|