material-react-table 1.9.1 → 1.9.3
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/README.md +1 -1
- package/dist/cjs/index.js +38 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/MaterialReactTable.d.ts +3 -3
- package/dist/cjs/types/sortingFns.d.ts +298 -6
- package/dist/esm/material-react-table.esm.js +38 -18
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/MaterialReactTable.d.ts +3 -3
- package/dist/esm/types/sortingFns.d.ts +298 -6
- package/dist/index.d.ts +3 -3
- package/package.json +15 -15
- package/src/MaterialReactTable.tsx +3 -3
- package/src/body/MRT_TableBodyCellValue.tsx +7 -3
- package/src/buttons/MRT_ToggleFiltersButton.tsx +2 -2
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +2 -2
- package/src/inputs/MRT_GlobalFilterTextField.tsx +9 -2
- package/src/menus/MRT_ColumnActionMenu.tsx +2 -2
- package/src/table/MRT_TableRoot.tsx +14 -2
- package/src/toolbar/MRT_TablePagination.tsx +4 -1
@@ -179,7 +179,7 @@ export type MRT_TableInstance<TData extends Record<string, any> = {}> = Prettify
|
|
179
179
|
} | null>>;
|
180
180
|
setIsFullScreen: Dispatch<SetStateAction<boolean>>;
|
181
181
|
setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
|
182
|
-
|
182
|
+
setShowColumnFilters: Dispatch<SetStateAction<boolean>>;
|
183
183
|
setShowGlobalFilter: Dispatch<SetStateAction<boolean>>;
|
184
184
|
setShowToolbarDropZone: Dispatch<SetStateAction<boolean>>;
|
185
185
|
}>;
|
@@ -617,7 +617,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
617
617
|
}) => TableRowProps);
|
618
618
|
muiTablePaginationProps?: Partial<Omit<TablePaginationProps, 'rowsPerPage'>> | ((props: {
|
619
619
|
table: MRT_TableInstance<TData>;
|
620
|
-
}) => Partial<TablePaginationProps
|
620
|
+
}) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
|
621
621
|
muiTablePaperProps?: PaperProps | ((props: {
|
622
622
|
table: MRT_TableInstance<TData>;
|
623
623
|
}) => PaperProps);
|
@@ -656,7 +656,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
656
656
|
onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
657
657
|
onIsFullScreenChange?: OnChangeFn<boolean>;
|
658
658
|
onShowAlertBannerChange?: OnChangeFn<boolean>;
|
659
|
-
|
659
|
+
onShowColumnFiltersChange?: OnChangeFn<boolean>;
|
660
660
|
onShowGlobalFilterChange?: OnChangeFn<boolean>;
|
661
661
|
onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
|
662
662
|
positionActionsColumn?: 'first' | 'last';
|
@@ -17,11 +17,14 @@ export declare const rankGlobalFuzzy: <TData extends Record<string, any> = {}>(r
|
|
17
17
|
index: number;
|
18
18
|
original: TData;
|
19
19
|
depth: number;
|
20
|
+
parentId?: string | undefined;
|
20
21
|
_uniqueValuesCache: Record<string, unknown>;
|
21
22
|
getUniqueValues: <TValue_2>(columnId: string) => TValue_2[];
|
22
23
|
getLeafRows: () => Row<TData>[];
|
23
24
|
originalSubRows?: TData[] | undefined;
|
24
25
|
_getAllCellsByColumnId: () => Record<string, import("@tanstack/react-table").Cell<TData, unknown>>;
|
26
|
+
getParentRow: () => Row<TData> | undefined;
|
27
|
+
getParentRows: () => Row<TData>[];
|
25
28
|
_getAllVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
26
29
|
getLeftVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
27
30
|
getCenterVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
@@ -52,7 +55,48 @@ export declare const rankGlobalFuzzy: <TData extends Record<string, any> = {}>(r
|
|
52
55
|
getIsPlaceholder: () => boolean;
|
53
56
|
getIsAggregated: () => boolean;
|
54
57
|
column: import("./MaterialReactTable").MRT_Column<TData>;
|
55
|
-
row:
|
58
|
+
row: {
|
59
|
+
getValue: <TValue>(columnId: string) => TValue;
|
60
|
+
renderValue: <TValue_1>(columnId: string) => TValue_1;
|
61
|
+
id: string;
|
62
|
+
columnFilters: Record<string, boolean>;
|
63
|
+
index: number;
|
64
|
+
original: TData;
|
65
|
+
depth: number;
|
66
|
+
parentId?: string | undefined;
|
67
|
+
_uniqueValuesCache: Record<string, unknown>;
|
68
|
+
getUniqueValues: <TValue_2>(columnId: string) => TValue_2[];
|
69
|
+
getLeafRows: () => Row<TData>[];
|
70
|
+
originalSubRows?: TData[] | undefined;
|
71
|
+
_getAllCellsByColumnId: () => Record<string, import("@tanstack/react-table").Cell<TData, unknown>>;
|
72
|
+
getParentRow: () => Row<TData> | undefined;
|
73
|
+
getParentRows: () => Row<TData>[];
|
74
|
+
_getAllVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
75
|
+
getLeftVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
76
|
+
getCenterVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
77
|
+
getRightVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
78
|
+
columnFiltersMeta: Record<string, import("@tanstack/react-table").FilterMeta>;
|
79
|
+
groupingColumnId?: string | undefined;
|
80
|
+
groupingValue?: unknown;
|
81
|
+
getIsGrouped: () => boolean;
|
82
|
+
_groupingValuesCache: Record<string, any>;
|
83
|
+
getIsSelected: () => boolean;
|
84
|
+
getIsSomeSelected: () => boolean;
|
85
|
+
getIsAllSubRowsSelected: () => boolean;
|
86
|
+
getCanSelect: () => boolean;
|
87
|
+
getCanMultiSelect: () => boolean;
|
88
|
+
getCanSelectSubRows: () => boolean;
|
89
|
+
toggleSelected: (value?: boolean | undefined) => void;
|
90
|
+
getToggleSelectedHandler: () => (event: unknown) => void;
|
91
|
+
toggleExpanded: (expanded?: boolean | undefined) => void;
|
92
|
+
getIsExpanded: () => boolean;
|
93
|
+
getCanExpand: () => boolean;
|
94
|
+
getToggleExpandedHandler: () => () => void;
|
95
|
+
getAllCells: any;
|
96
|
+
getVisibleCells: () => any[];
|
97
|
+
subRows?: any[] | undefined;
|
98
|
+
_valuesCache: Record<(string & Record<never, never>) | (string & import("@tanstack/react-table").DeepKeys<TData>), any>;
|
99
|
+
};
|
56
100
|
}[];
|
57
101
|
getVisibleCells: () => {
|
58
102
|
getValue: import("@tanstack/react-table").Getter<unknown>;
|
@@ -63,9 +107,111 @@ export declare const rankGlobalFuzzy: <TData extends Record<string, any> = {}>(r
|
|
63
107
|
getIsPlaceholder: () => boolean;
|
64
108
|
getIsAggregated: () => boolean;
|
65
109
|
column: import("./MaterialReactTable").MRT_Column<TData>;
|
66
|
-
row:
|
110
|
+
row: {
|
111
|
+
getValue: <TValue>(columnId: string) => TValue;
|
112
|
+
renderValue: <TValue_1>(columnId: string) => TValue_1;
|
113
|
+
id: string;
|
114
|
+
columnFilters: Record<string, boolean>;
|
115
|
+
index: number;
|
116
|
+
original: TData;
|
117
|
+
depth: number;
|
118
|
+
parentId?: string | undefined;
|
119
|
+
_uniqueValuesCache: Record<string, unknown>;
|
120
|
+
getUniqueValues: <TValue_2>(columnId: string) => TValue_2[];
|
121
|
+
getLeafRows: () => Row<TData>[];
|
122
|
+
originalSubRows?: TData[] | undefined;
|
123
|
+
_getAllCellsByColumnId: () => Record<string, import("@tanstack/react-table").Cell<TData, unknown>>;
|
124
|
+
getParentRow: () => Row<TData> | undefined;
|
125
|
+
getParentRows: () => Row<TData>[];
|
126
|
+
_getAllVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
127
|
+
getLeftVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
128
|
+
getCenterVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
129
|
+
getRightVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
130
|
+
columnFiltersMeta: Record<string, import("@tanstack/react-table").FilterMeta>;
|
131
|
+
groupingColumnId?: string | undefined;
|
132
|
+
groupingValue?: unknown;
|
133
|
+
getIsGrouped: () => boolean;
|
134
|
+
_groupingValuesCache: Record<string, any>;
|
135
|
+
getIsSelected: () => boolean;
|
136
|
+
getIsSomeSelected: () => boolean;
|
137
|
+
getIsAllSubRowsSelected: () => boolean;
|
138
|
+
getCanSelect: () => boolean;
|
139
|
+
getCanMultiSelect: () => boolean;
|
140
|
+
getCanSelectSubRows: () => boolean;
|
141
|
+
toggleSelected: (value?: boolean | undefined) => void;
|
142
|
+
getToggleSelectedHandler: () => (event: unknown) => void;
|
143
|
+
toggleExpanded: (expanded?: boolean | undefined) => void;
|
144
|
+
getIsExpanded: () => boolean;
|
145
|
+
getCanExpand: () => boolean;
|
146
|
+
getToggleExpandedHandler: () => () => void;
|
147
|
+
getAllCells: () => any[];
|
148
|
+
getVisibleCells: any;
|
149
|
+
subRows?: any[] | undefined;
|
150
|
+
_valuesCache: Record<(string & Record<never, never>) | (string & import("@tanstack/react-table").DeepKeys<TData>), any>;
|
151
|
+
};
|
67
152
|
}[];
|
68
|
-
subRows?:
|
153
|
+
subRows?: {
|
154
|
+
getValue: <TValue>(columnId: string) => TValue;
|
155
|
+
renderValue: <TValue_1>(columnId: string) => TValue_1;
|
156
|
+
id: string;
|
157
|
+
columnFilters: Record<string, boolean>;
|
158
|
+
index: number;
|
159
|
+
original: TData;
|
160
|
+
depth: number;
|
161
|
+
parentId?: string | undefined;
|
162
|
+
_uniqueValuesCache: Record<string, unknown>;
|
163
|
+
getUniqueValues: <TValue_2>(columnId: string) => TValue_2[];
|
164
|
+
getLeafRows: () => Row<TData>[];
|
165
|
+
originalSubRows?: TData[] | undefined;
|
166
|
+
_getAllCellsByColumnId: () => Record<string, import("@tanstack/react-table").Cell<TData, unknown>>;
|
167
|
+
getParentRow: () => Row<TData> | undefined;
|
168
|
+
getParentRows: () => Row<TData>[];
|
169
|
+
_getAllVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
170
|
+
getLeftVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
171
|
+
getCenterVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
172
|
+
getRightVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
173
|
+
columnFiltersMeta: Record<string, import("@tanstack/react-table").FilterMeta>;
|
174
|
+
groupingColumnId?: string | undefined;
|
175
|
+
groupingValue?: unknown;
|
176
|
+
getIsGrouped: () => boolean;
|
177
|
+
_groupingValuesCache: Record<string, any>;
|
178
|
+
getIsSelected: () => boolean;
|
179
|
+
getIsSomeSelected: () => boolean;
|
180
|
+
getIsAllSubRowsSelected: () => boolean;
|
181
|
+
getCanSelect: () => boolean;
|
182
|
+
getCanMultiSelect: () => boolean;
|
183
|
+
getCanSelectSubRows: () => boolean;
|
184
|
+
toggleSelected: (value?: boolean | undefined) => void;
|
185
|
+
getToggleSelectedHandler: () => (event: unknown) => void;
|
186
|
+
toggleExpanded: (expanded?: boolean | undefined) => void;
|
187
|
+
getIsExpanded: () => boolean;
|
188
|
+
getCanExpand: () => boolean;
|
189
|
+
getToggleExpandedHandler: () => () => void;
|
190
|
+
getAllCells: () => {
|
191
|
+
getValue: import("@tanstack/react-table").Getter<unknown>;
|
192
|
+
renderValue: import("@tanstack/react-table").Getter<unknown>;
|
193
|
+
id: string;
|
194
|
+
getContext: () => import("@tanstack/react-table").CellContext<TData, unknown>;
|
195
|
+
getIsGrouped: () => boolean;
|
196
|
+
getIsPlaceholder: () => boolean;
|
197
|
+
getIsAggregated: () => boolean;
|
198
|
+
column: import("./MaterialReactTable").MRT_Column<TData>;
|
199
|
+
row: any;
|
200
|
+
}[];
|
201
|
+
getVisibleCells: () => {
|
202
|
+
getValue: import("@tanstack/react-table").Getter<unknown>;
|
203
|
+
renderValue: import("@tanstack/react-table").Getter<unknown>;
|
204
|
+
id: string;
|
205
|
+
getContext: () => import("@tanstack/react-table").CellContext<TData, unknown>;
|
206
|
+
getIsGrouped: () => boolean;
|
207
|
+
getIsPlaceholder: () => boolean;
|
208
|
+
getIsAggregated: () => boolean;
|
209
|
+
column: import("./MaterialReactTable").MRT_Column<TData>;
|
210
|
+
row: any;
|
211
|
+
}[];
|
212
|
+
subRows?: any[] | undefined;
|
213
|
+
_valuesCache: Record<(string & Record<never, never>) | (string & import("@tanstack/react-table").DeepKeys<TData>), any>;
|
214
|
+
}[] | undefined;
|
69
215
|
_valuesCache: Record<(string & Record<never, never>) | (string & import("@tanstack/react-table").DeepKeys<TData>), any>;
|
70
216
|
}, rowB: {
|
71
217
|
getValue: <TValue>(columnId: string) => TValue;
|
@@ -75,11 +221,14 @@ export declare const rankGlobalFuzzy: <TData extends Record<string, any> = {}>(r
|
|
75
221
|
index: number;
|
76
222
|
original: TData;
|
77
223
|
depth: number;
|
224
|
+
parentId?: string | undefined;
|
78
225
|
_uniqueValuesCache: Record<string, unknown>;
|
79
226
|
getUniqueValues: <TValue_2>(columnId: string) => TValue_2[];
|
80
227
|
getLeafRows: () => Row<TData>[];
|
81
228
|
originalSubRows?: TData[] | undefined;
|
82
229
|
_getAllCellsByColumnId: () => Record<string, import("@tanstack/react-table").Cell<TData, unknown>>;
|
230
|
+
getParentRow: () => Row<TData> | undefined;
|
231
|
+
getParentRows: () => Row<TData>[];
|
83
232
|
_getAllVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
84
233
|
getLeftVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
85
234
|
getCenterVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
@@ -110,7 +259,48 @@ export declare const rankGlobalFuzzy: <TData extends Record<string, any> = {}>(r
|
|
110
259
|
getIsPlaceholder: () => boolean;
|
111
260
|
getIsAggregated: () => boolean;
|
112
261
|
column: import("./MaterialReactTable").MRT_Column<TData>;
|
113
|
-
row:
|
262
|
+
row: {
|
263
|
+
getValue: <TValue>(columnId: string) => TValue;
|
264
|
+
renderValue: <TValue_1>(columnId: string) => TValue_1;
|
265
|
+
id: string;
|
266
|
+
columnFilters: Record<string, boolean>;
|
267
|
+
index: number;
|
268
|
+
original: TData;
|
269
|
+
depth: number;
|
270
|
+
parentId?: string | undefined;
|
271
|
+
_uniqueValuesCache: Record<string, unknown>;
|
272
|
+
getUniqueValues: <TValue_2>(columnId: string) => TValue_2[];
|
273
|
+
getLeafRows: () => Row<TData>[];
|
274
|
+
originalSubRows?: TData[] | undefined;
|
275
|
+
_getAllCellsByColumnId: () => Record<string, import("@tanstack/react-table").Cell<TData, unknown>>;
|
276
|
+
getParentRow: () => Row<TData> | undefined;
|
277
|
+
getParentRows: () => Row<TData>[];
|
278
|
+
_getAllVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
279
|
+
getLeftVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
280
|
+
getCenterVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
281
|
+
getRightVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
282
|
+
columnFiltersMeta: Record<string, import("@tanstack/react-table").FilterMeta>;
|
283
|
+
groupingColumnId?: string | undefined;
|
284
|
+
groupingValue?: unknown;
|
285
|
+
getIsGrouped: () => boolean;
|
286
|
+
_groupingValuesCache: Record<string, any>;
|
287
|
+
getIsSelected: () => boolean;
|
288
|
+
getIsSomeSelected: () => boolean;
|
289
|
+
getIsAllSubRowsSelected: () => boolean;
|
290
|
+
getCanSelect: () => boolean;
|
291
|
+
getCanMultiSelect: () => boolean;
|
292
|
+
getCanSelectSubRows: () => boolean;
|
293
|
+
toggleSelected: (value?: boolean | undefined) => void;
|
294
|
+
getToggleSelectedHandler: () => (event: unknown) => void;
|
295
|
+
toggleExpanded: (expanded?: boolean | undefined) => void;
|
296
|
+
getIsExpanded: () => boolean;
|
297
|
+
getCanExpand: () => boolean;
|
298
|
+
getToggleExpandedHandler: () => () => void;
|
299
|
+
getAllCells: any;
|
300
|
+
getVisibleCells: () => any[];
|
301
|
+
subRows?: any[] | undefined;
|
302
|
+
_valuesCache: Record<(string & Record<never, never>) | (string & import("@tanstack/react-table").DeepKeys<TData>), any>;
|
303
|
+
};
|
114
304
|
}[];
|
115
305
|
getVisibleCells: () => {
|
116
306
|
getValue: import("@tanstack/react-table").Getter<unknown>;
|
@@ -121,8 +311,110 @@ export declare const rankGlobalFuzzy: <TData extends Record<string, any> = {}>(r
|
|
121
311
|
getIsPlaceholder: () => boolean;
|
122
312
|
getIsAggregated: () => boolean;
|
123
313
|
column: import("./MaterialReactTable").MRT_Column<TData>;
|
124
|
-
row:
|
314
|
+
row: {
|
315
|
+
getValue: <TValue>(columnId: string) => TValue;
|
316
|
+
renderValue: <TValue_1>(columnId: string) => TValue_1;
|
317
|
+
id: string;
|
318
|
+
columnFilters: Record<string, boolean>;
|
319
|
+
index: number;
|
320
|
+
original: TData;
|
321
|
+
depth: number;
|
322
|
+
parentId?: string | undefined;
|
323
|
+
_uniqueValuesCache: Record<string, unknown>;
|
324
|
+
getUniqueValues: <TValue_2>(columnId: string) => TValue_2[];
|
325
|
+
getLeafRows: () => Row<TData>[];
|
326
|
+
originalSubRows?: TData[] | undefined;
|
327
|
+
_getAllCellsByColumnId: () => Record<string, import("@tanstack/react-table").Cell<TData, unknown>>;
|
328
|
+
getParentRow: () => Row<TData> | undefined;
|
329
|
+
getParentRows: () => Row<TData>[];
|
330
|
+
_getAllVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
331
|
+
getLeftVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
332
|
+
getCenterVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
333
|
+
getRightVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
334
|
+
columnFiltersMeta: Record<string, import("@tanstack/react-table").FilterMeta>;
|
335
|
+
groupingColumnId?: string | undefined;
|
336
|
+
groupingValue?: unknown;
|
337
|
+
getIsGrouped: () => boolean;
|
338
|
+
_groupingValuesCache: Record<string, any>;
|
339
|
+
getIsSelected: () => boolean;
|
340
|
+
getIsSomeSelected: () => boolean;
|
341
|
+
getIsAllSubRowsSelected: () => boolean;
|
342
|
+
getCanSelect: () => boolean;
|
343
|
+
getCanMultiSelect: () => boolean;
|
344
|
+
getCanSelectSubRows: () => boolean;
|
345
|
+
toggleSelected: (value?: boolean | undefined) => void;
|
346
|
+
getToggleSelectedHandler: () => (event: unknown) => void;
|
347
|
+
toggleExpanded: (expanded?: boolean | undefined) => void;
|
348
|
+
getIsExpanded: () => boolean;
|
349
|
+
getCanExpand: () => boolean;
|
350
|
+
getToggleExpandedHandler: () => () => void;
|
351
|
+
getAllCells: () => any[];
|
352
|
+
getVisibleCells: any;
|
353
|
+
subRows?: any[] | undefined;
|
354
|
+
_valuesCache: Record<(string & Record<never, never>) | (string & import("@tanstack/react-table").DeepKeys<TData>), any>;
|
355
|
+
};
|
125
356
|
}[];
|
126
|
-
subRows?:
|
357
|
+
subRows?: {
|
358
|
+
getValue: <TValue>(columnId: string) => TValue;
|
359
|
+
renderValue: <TValue_1>(columnId: string) => TValue_1;
|
360
|
+
id: string;
|
361
|
+
columnFilters: Record<string, boolean>;
|
362
|
+
index: number;
|
363
|
+
original: TData;
|
364
|
+
depth: number;
|
365
|
+
parentId?: string | undefined;
|
366
|
+
_uniqueValuesCache: Record<string, unknown>;
|
367
|
+
getUniqueValues: <TValue_2>(columnId: string) => TValue_2[];
|
368
|
+
getLeafRows: () => Row<TData>[];
|
369
|
+
originalSubRows?: TData[] | undefined;
|
370
|
+
_getAllCellsByColumnId: () => Record<string, import("@tanstack/react-table").Cell<TData, unknown>>;
|
371
|
+
getParentRow: () => Row<TData> | undefined;
|
372
|
+
getParentRows: () => Row<TData>[];
|
373
|
+
_getAllVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
374
|
+
getLeftVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
375
|
+
getCenterVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
376
|
+
getRightVisibleCells: () => import("@tanstack/react-table").Cell<TData, unknown>[];
|
377
|
+
columnFiltersMeta: Record<string, import("@tanstack/react-table").FilterMeta>;
|
378
|
+
groupingColumnId?: string | undefined;
|
379
|
+
groupingValue?: unknown;
|
380
|
+
getIsGrouped: () => boolean;
|
381
|
+
_groupingValuesCache: Record<string, any>;
|
382
|
+
getIsSelected: () => boolean;
|
383
|
+
getIsSomeSelected: () => boolean;
|
384
|
+
getIsAllSubRowsSelected: () => boolean;
|
385
|
+
getCanSelect: () => boolean;
|
386
|
+
getCanMultiSelect: () => boolean;
|
387
|
+
getCanSelectSubRows: () => boolean;
|
388
|
+
toggleSelected: (value?: boolean | undefined) => void;
|
389
|
+
getToggleSelectedHandler: () => (event: unknown) => void;
|
390
|
+
toggleExpanded: (expanded?: boolean | undefined) => void;
|
391
|
+
getIsExpanded: () => boolean;
|
392
|
+
getCanExpand: () => boolean;
|
393
|
+
getToggleExpandedHandler: () => () => void;
|
394
|
+
getAllCells: () => {
|
395
|
+
getValue: import("@tanstack/react-table").Getter<unknown>;
|
396
|
+
renderValue: import("@tanstack/react-table").Getter<unknown>;
|
397
|
+
id: string;
|
398
|
+
getContext: () => import("@tanstack/react-table").CellContext<TData, unknown>;
|
399
|
+
getIsGrouped: () => boolean;
|
400
|
+
getIsPlaceholder: () => boolean;
|
401
|
+
getIsAggregated: () => boolean;
|
402
|
+
column: import("./MaterialReactTable").MRT_Column<TData>;
|
403
|
+
row: any;
|
404
|
+
}[];
|
405
|
+
getVisibleCells: () => {
|
406
|
+
getValue: import("@tanstack/react-table").Getter<unknown>;
|
407
|
+
renderValue: import("@tanstack/react-table").Getter<unknown>;
|
408
|
+
id: string;
|
409
|
+
getContext: () => import("@tanstack/react-table").CellContext<TData, unknown>;
|
410
|
+
getIsGrouped: () => boolean;
|
411
|
+
getIsPlaceholder: () => boolean;
|
412
|
+
getIsAggregated: () => boolean;
|
413
|
+
column: import("./MaterialReactTable").MRT_Column<TData>;
|
414
|
+
row: any;
|
415
|
+
}[];
|
416
|
+
subRows?: any[] | undefined;
|
417
|
+
_valuesCache: Record<(string & Record<never, never>) | (string & import("@tanstack/react-table").DeepKeys<TData>), any>;
|
418
|
+
}[] | undefined;
|
127
419
|
_valuesCache: Record<(string & Record<never, never>) | (string & import("@tanstack/react-table").DeepKeys<TData>), any>;
|
128
420
|
}) => number;
|
package/dist/index.d.ts
CHANGED
@@ -300,7 +300,7 @@ type MRT_TableInstance<TData extends Record<string, any> = {}> = Prettify<Omit<T
|
|
300
300
|
} | null>>;
|
301
301
|
setIsFullScreen: Dispatch<SetStateAction<boolean>>;
|
302
302
|
setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
|
303
|
-
|
303
|
+
setShowColumnFilters: Dispatch<SetStateAction<boolean>>;
|
304
304
|
setShowGlobalFilter: Dispatch<SetStateAction<boolean>>;
|
305
305
|
setShowToolbarDropZone: Dispatch<SetStateAction<boolean>>;
|
306
306
|
}>;
|
@@ -738,7 +738,7 @@ type MaterialReactTableProps<TData extends Record<string, any> = {}> = Prettify<
|
|
738
738
|
}) => TableRowProps);
|
739
739
|
muiTablePaginationProps?: Partial<Omit<TablePaginationProps, 'rowsPerPage'>> | ((props: {
|
740
740
|
table: MRT_TableInstance<TData>;
|
741
|
-
}) => Partial<TablePaginationProps
|
741
|
+
}) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
|
742
742
|
muiTablePaperProps?: PaperProps | ((props: {
|
743
743
|
table: MRT_TableInstance<TData>;
|
744
744
|
}) => PaperProps);
|
@@ -777,7 +777,7 @@ type MaterialReactTableProps<TData extends Record<string, any> = {}> = Prettify<
|
|
777
777
|
onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
778
778
|
onIsFullScreenChange?: OnChangeFn<boolean>;
|
779
779
|
onShowAlertBannerChange?: OnChangeFn<boolean>;
|
780
|
-
|
780
|
+
onShowColumnFiltersChange?: OnChangeFn<boolean>;
|
781
781
|
onShowGlobalFilterChange?: OnChangeFn<boolean>;
|
782
782
|
onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
|
783
783
|
positionActionsColumn?: 'first' | 'last';
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "1.9.
|
2
|
+
"version": "1.9.3",
|
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.",
|
@@ -52,33 +52,33 @@
|
|
52
52
|
"size": "size-limit"
|
53
53
|
},
|
54
54
|
"devDependencies": {
|
55
|
-
"@babel/core": "^7.21.
|
55
|
+
"@babel/core": "^7.21.3",
|
56
56
|
"@babel/preset-react": "^7.18.6",
|
57
57
|
"@emotion/react": "^11.10.6",
|
58
58
|
"@emotion/styled": "^11.10.6",
|
59
|
-
"@mui/icons-material": "^5.11.
|
60
|
-
"@mui/material": "^5.11.
|
59
|
+
"@mui/icons-material": "^5.11.11",
|
60
|
+
"@mui/material": "^5.11.14",
|
61
61
|
"@rollup/plugin-babel": "^6.0.3",
|
62
62
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
63
63
|
"@rollup/plugin-typescript": "^11.0.0",
|
64
64
|
"@size-limit/preset-small-lib": "^8.2.4",
|
65
|
-
"@types/node": "^18.
|
66
|
-
"@types/react": "^18.0.
|
65
|
+
"@types/node": "^18.15.10",
|
66
|
+
"@types/react": "^18.0.29",
|
67
67
|
"@types/react-dom": "^18.0.11",
|
68
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
69
|
-
"@typescript-eslint/parser": "^5.
|
70
|
-
"eslint": "^8.
|
71
|
-
"eslint-plugin-mui-path-imports": "^0.0.
|
68
|
+
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
69
|
+
"@typescript-eslint/parser": "^5.56.0",
|
70
|
+
"eslint": "^8.36.0",
|
71
|
+
"eslint-plugin-mui-path-imports": "^0.0.15",
|
72
72
|
"react": "^18.2.0",
|
73
73
|
"react-dom": "^18.2.0",
|
74
74
|
"react-is": "^18.2.0",
|
75
75
|
"rollup": "^2.79.1",
|
76
76
|
"rollup-plugin-copy": "^3.4.0",
|
77
|
-
"rollup-plugin-dts": "^5.
|
77
|
+
"rollup-plugin-dts": "^5.3.0",
|
78
78
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
79
79
|
"size-limit": "^8.2.4",
|
80
80
|
"tslib": "^2.5.0",
|
81
|
-
"typescript": "^
|
81
|
+
"typescript": "^5.0.2"
|
82
82
|
},
|
83
83
|
"peerDependencies": {
|
84
84
|
"@emotion/react": ">=11",
|
@@ -89,9 +89,9 @@
|
|
89
89
|
"react-dom": ">=17.0"
|
90
90
|
},
|
91
91
|
"dependencies": {
|
92
|
-
"@tanstack/match-sorter-utils": "8.
|
93
|
-
"@tanstack/react-table": "8.
|
94
|
-
"@tanstack/react-virtual": "3.0.0-beta.
|
92
|
+
"@tanstack/match-sorter-utils": "8.8.4",
|
93
|
+
"@tanstack/react-table": "8.8.5",
|
94
|
+
"@tanstack/react-virtual": "3.0.0-beta.54",
|
95
95
|
"highlight-words": "1.2.1"
|
96
96
|
}
|
97
97
|
}
|
@@ -262,7 +262,7 @@ export type MRT_TableInstance<TData extends Record<string, any> = {}> =
|
|
262
262
|
>;
|
263
263
|
setIsFullScreen: Dispatch<SetStateAction<boolean>>;
|
264
264
|
setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
|
265
|
-
|
265
|
+
setShowColumnFilters: Dispatch<SetStateAction<boolean>>;
|
266
266
|
setShowGlobalFilter: Dispatch<SetStateAction<boolean>>;
|
267
267
|
setShowToolbarDropZone: Dispatch<SetStateAction<boolean>>;
|
268
268
|
}
|
@@ -846,7 +846,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
846
846
|
| Partial<Omit<TablePaginationProps, 'rowsPerPage'>>
|
847
847
|
| ((props: {
|
848
848
|
table: MRT_TableInstance<TData>;
|
849
|
-
}) => Partial<TablePaginationProps
|
849
|
+
}) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
|
850
850
|
muiTablePaperProps?:
|
851
851
|
| PaperProps
|
852
852
|
| ((props: { table: MRT_TableInstance<TData> }) => PaperProps);
|
@@ -883,7 +883,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
883
883
|
onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
884
884
|
onIsFullScreenChange?: OnChangeFn<boolean>;
|
885
885
|
onShowAlertBannerChange?: OnChangeFn<boolean>;
|
886
|
-
|
886
|
+
onShowColumnFiltersChange?: OnChangeFn<boolean>;
|
887
887
|
onShowGlobalFilterChange?: OnChangeFn<boolean>;
|
888
888
|
onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
|
889
889
|
positionActionsColumn?: 'first' | 'last';
|
@@ -18,7 +18,7 @@ export const MRT_TableBodyCellValue = ({ cell, table }: Props) => {
|
|
18
18
|
} = table;
|
19
19
|
const { column, row } = cell;
|
20
20
|
const { columnDef } = column;
|
21
|
-
const { globalFilter } = getState();
|
21
|
+
const { globalFilter, globalFilterFn } = getState();
|
22
22
|
const filterValue = column.getFilterValue();
|
23
23
|
|
24
24
|
let renderedCellValue =
|
@@ -54,11 +54,15 @@ export const MRT_TableBodyCellValue = ({ cell, table }: Props) => {
|
|
54
54
|
((filterValue &&
|
55
55
|
allowedTypes.includes(typeof filterValue) &&
|
56
56
|
columnDef.filterVariant === 'text') ||
|
57
|
-
(globalFilter &&
|
57
|
+
(globalFilter &&
|
58
|
+
allowedTypes.includes(typeof globalFilter) &&
|
59
|
+
column.getCanGlobalFilter()))
|
58
60
|
) {
|
59
61
|
const chunks = highlightWords?.({
|
60
62
|
text: renderedCellValue?.toString() as string,
|
61
|
-
query: (
|
63
|
+
query: (filterValue ?? globalFilter ?? '').toString(),
|
64
|
+
matchExactly:
|
65
|
+
(filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
|
62
66
|
});
|
63
67
|
if (chunks?.length > 1 || chunks?.[0]?.match) {
|
64
68
|
renderedCellValue = (
|
@@ -21,12 +21,12 @@ export const MRT_ToggleFiltersButton = <
|
|
21
21
|
icons: { FilterListIcon, FilterListOffIcon },
|
22
22
|
localization,
|
23
23
|
},
|
24
|
-
|
24
|
+
setShowColumnFilters,
|
25
25
|
} = table;
|
26
26
|
const { showColumnFilters } = getState();
|
27
27
|
|
28
28
|
const handleToggleShowFilters = () => {
|
29
|
-
|
29
|
+
setShowColumnFilters(!showColumnFilters);
|
30
30
|
};
|
31
31
|
|
32
32
|
return (
|
@@ -17,7 +17,7 @@ export const MRT_TableHeadCellFilterLabel = ({ header, table }: Props) => {
|
|
17
17
|
localization,
|
18
18
|
},
|
19
19
|
refs: { filterInputRefs },
|
20
|
-
|
20
|
+
setShowColumnFilters,
|
21
21
|
} = table;
|
22
22
|
const { column } = header;
|
23
23
|
const { columnDef } = column;
|
@@ -66,7 +66,7 @@ export const MRT_TableHeadCellFilterLabel = ({ header, table }: Props) => {
|
|
66
66
|
<IconButton
|
67
67
|
disableRipple
|
68
68
|
onClick={(event: MouseEvent<HTMLButtonElement>) => {
|
69
|
-
|
69
|
+
setShowColumnFilters(true);
|
70
70
|
queueMicrotask(() => {
|
71
71
|
filterInputRefs.current[`${column.id}-0`]?.focus();
|
72
72
|
filterInputRefs.current[`${column.id}-0`]?.select();
|
@@ -3,6 +3,7 @@ import React, {
|
|
3
3
|
MouseEvent,
|
4
4
|
useCallback,
|
5
5
|
useEffect,
|
6
|
+
useRef,
|
6
7
|
useState,
|
7
8
|
} from 'react';
|
8
9
|
import Collapse from '@mui/material/Collapse';
|
@@ -42,6 +43,7 @@ export const MRT_GlobalFilterTextField = <
|
|
42
43
|
? muiSearchTextFieldProps({ table })
|
43
44
|
: muiSearchTextFieldProps;
|
44
45
|
|
46
|
+
const isMounted = useRef(false);
|
45
47
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
46
48
|
const [searchValue, setSearchValue] = useState(globalFilter ?? '');
|
47
49
|
|
@@ -70,9 +72,14 @@ export const MRT_GlobalFilterTextField = <
|
|
70
72
|
};
|
71
73
|
|
72
74
|
useEffect(() => {
|
73
|
-
if (
|
74
|
-
|
75
|
+
if (isMounted.current) {
|
76
|
+
if (globalFilter === undefined) {
|
77
|
+
handleClear();
|
78
|
+
} else {
|
79
|
+
setSearchValue(globalFilter);
|
80
|
+
}
|
75
81
|
}
|
82
|
+
isMounted.current = true;
|
76
83
|
}, [globalFilter]);
|
77
84
|
|
78
85
|
return (
|
@@ -63,7 +63,7 @@ export const MRT_ColumnActionMenu = ({
|
|
63
63
|
},
|
64
64
|
refs: { filterInputRefs },
|
65
65
|
setColumnSizingInfo,
|
66
|
-
|
66
|
+
setShowColumnFilters,
|
67
67
|
} = table;
|
68
68
|
const { column } = header;
|
69
69
|
const { columnDef } = column;
|
@@ -117,7 +117,7 @@ export const MRT_ColumnActionMenu = ({
|
|
117
117
|
};
|
118
118
|
|
119
119
|
const handleFilterByColumn = () => {
|
120
|
-
|
120
|
+
setShowColumnFilters(true);
|
121
121
|
queueMicrotask(() => filterInputRefs.current[`${column.id}-0`]?.focus());
|
122
122
|
setAnchorEl(null);
|
123
123
|
};
|
@@ -113,7 +113,7 @@ export const MRT_TableRoot: any = <TData extends Record<string, any> = {}>(
|
|
113
113
|
const [showAlertBanner, setShowAlertBanner] = useState<boolean>(
|
114
114
|
props.initialState?.showAlertBanner ?? false,
|
115
115
|
);
|
116
|
-
const [showColumnFilters,
|
116
|
+
const [showColumnFilters, setShowColumnFilters] = useState<boolean>(
|
117
117
|
initialState?.showColumnFilters ?? false,
|
118
118
|
);
|
119
119
|
const [showGlobalFilter, setShowGlobalFilter] = useState<boolean>(
|
@@ -326,7 +326,8 @@ export const MRT_TableRoot: any = <TData extends Record<string, any> = {}>(
|
|
326
326
|
setHoveredRow: props.onHoveredRowChange ?? setHoveredRow,
|
327
327
|
setIsFullScreen: props.onIsFullScreenChange ?? setIsFullScreen,
|
328
328
|
setShowAlertBanner: props.onShowAlertBannerChange ?? setShowAlertBanner,
|
329
|
-
|
329
|
+
setShowColumnFilters:
|
330
|
+
props.onShowColumnFiltersChange ?? setShowColumnFilters,
|
330
331
|
setShowGlobalFilter: props.onShowGlobalFilterChange ?? setShowGlobalFilter,
|
331
332
|
setShowToolbarDropZone:
|
332
333
|
props.onShowToolbarDropZoneChange ?? setShowToolbarDropZone,
|
@@ -360,6 +361,17 @@ export const MRT_TableRoot: any = <TData extends Record<string, any> = {}>(
|
|
360
361
|
}
|
361
362
|
}, [table.getState().isFullScreen]);
|
362
363
|
|
364
|
+
//if page index is out of bounds, set it to the last page
|
365
|
+
useEffect(() => {
|
366
|
+
const { pageIndex, pageSize } = table.getState().pagination;
|
367
|
+
const totalRowCount =
|
368
|
+
props.rowCount ?? table.getPrePaginationRowModel().rows.length;
|
369
|
+
const firstVisibleRowIndex = pageIndex * pageSize;
|
370
|
+
if (firstVisibleRowIndex > totalRowCount) {
|
371
|
+
table.setPageIndex(Math.floor(totalRowCount / pageSize));
|
372
|
+
}
|
373
|
+
}, [props.rowCount, table.getPrePaginationRowModel().rows.length]);
|
374
|
+
|
363
375
|
return (
|
364
376
|
<>
|
365
377
|
<Dialog
|