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;
|
@@ -834,7 +834,7 @@ const commonListItemStyles = {
|
|
834
834
|
};
|
835
835
|
const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
836
836
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
837
|
-
const { getState, toggleAllColumnsVisible, setColumnOrder, options: { columnFilterModeOptions, enableColumnFilterModes, enableColumnFilters, enableColumnResizing, enableGrouping, enableHiding, enablePinning, enableSorting, icons: { ArrowRightIcon, ClearAllIcon, ViewColumnIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, SortIcon, RestartAltIcon, VisibilityOffIcon, }, localization, renderColumnActionsMenuItems, }, refs: { filterInputRefs }, setColumnSizingInfo,
|
837
|
+
const { getState, toggleAllColumnsVisible, setColumnOrder, options: { columnFilterModeOptions, enableColumnFilterModes, enableColumnFilters, enableColumnResizing, enableGrouping, enableHiding, enablePinning, enableSorting, icons: { ArrowRightIcon, ClearAllIcon, ViewColumnIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, SortIcon, RestartAltIcon, VisibilityOffIcon, }, localization, renderColumnActionsMenuItems, }, refs: { filterInputRefs }, setColumnSizingInfo, setShowColumnFilters, } = table;
|
838
838
|
const { column } = header;
|
839
839
|
const { columnDef } = column;
|
840
840
|
const { columnSizing, columnVisibility, density } = getState();
|
@@ -875,7 +875,7 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
875
875
|
setAnchorEl(null);
|
876
876
|
};
|
877
877
|
const handleFilterByColumn = () => {
|
878
|
-
|
878
|
+
setShowColumnFilters(true);
|
879
879
|
queueMicrotask(() => { var _a; return (_a = filterInputRefs.current[`${column.id}-0`]) === null || _a === void 0 ? void 0 : _a.focus(); });
|
880
880
|
setAnchorEl(null);
|
881
881
|
};
|
@@ -1131,6 +1131,7 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
1131
1131
|
const textFieldProps = muiSearchTextFieldProps instanceof Function
|
1132
1132
|
? muiSearchTextFieldProps({ table })
|
1133
1133
|
: muiSearchTextFieldProps;
|
1134
|
+
const isMounted = useRef(false);
|
1134
1135
|
const [anchorEl, setAnchorEl] = useState(null);
|
1135
1136
|
const [searchValue, setSearchValue] = useState(globalFilter !== null && globalFilter !== void 0 ? globalFilter : '');
|
1136
1137
|
const handleChangeDebounced = useCallback(debounce((event) => {
|
@@ -1149,9 +1150,15 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
1149
1150
|
setGlobalFilter(undefined);
|
1150
1151
|
};
|
1151
1152
|
useEffect(() => {
|
1152
|
-
if (
|
1153
|
-
|
1153
|
+
if (isMounted.current) {
|
1154
|
+
if (globalFilter === undefined) {
|
1155
|
+
handleClear();
|
1156
|
+
}
|
1157
|
+
else {
|
1158
|
+
setSearchValue(globalFilter);
|
1159
|
+
}
|
1154
1160
|
}
|
1161
|
+
isMounted.current = true;
|
1155
1162
|
}, [globalFilter]);
|
1156
1163
|
return (React.createElement(Collapse, { in: showGlobalFilter, orientation: "horizontal", unmountOnExit: true, mountOnEnter: true },
|
1157
1164
|
React.createElement(TextField, Object.assign({ placeholder: localization.search, onChange: handleChange, value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "standard", InputProps: {
|
@@ -1205,7 +1212,7 @@ const MRT_TablePagination = ({ table, position = 'bottom', }) => {
|
|
1205
1212
|
? localization.goToLastPage
|
1206
1213
|
: type === 'next'
|
1207
1214
|
? localization.goToNextPage
|
1208
|
-
: localization.goToPreviousPage, labelDisplayedRows: ({ from, to, count }) => `${from}-${to} ${localization.of} ${count}`, labelRowsPerPage: localization.rowsPerPage, onPageChange: (_, newPage) => setPageIndex(newPage), onRowsPerPageChange: handleChangeRowsPerPage, page: pageIndex, rowsPerPage: pageSize, rowsPerPageOptions: [5, 10, 15, 20, 25, 30, 50, 100], showFirstButton: showFirstLastPageButtons, showLastButton: showFirstLastPageButtons }, tablePaginationProps, { SelectProps: Object.assign({ sx: { m: '0 1rem 0 1ch' }, MenuProps: { MenuListProps: { disablePadding: true }, sx: { m: 0 } } }, tablePaginationProps === null || tablePaginationProps === void 0 ? void 0 : tablePaginationProps.SelectProps), sx: (theme) => (Object.assign({ '& .MuiTablePagination-toolbar': {
|
1215
|
+
: localization.goToPreviousPage, labelDisplayedRows: ({ from, to, count }) => `${from}-${to} ${localization.of} ${count}`, labelRowsPerPage: localization.rowsPerPage, onPageChange: (_, newPage) => setPageIndex(newPage), onRowsPerPageChange: handleChangeRowsPerPage, page: Math.max(Math.min(pageIndex, Math.ceil(totalRowCount / pageSize) - 1), 0), rowsPerPage: pageSize, rowsPerPageOptions: [5, 10, 15, 20, 25, 30, 50, 100], showFirstButton: showFirstLastPageButtons, showLastButton: showFirstLastPageButtons }, tablePaginationProps, { SelectProps: Object.assign({ sx: { m: '0 1rem 0 1ch' }, MenuProps: { MenuListProps: { disablePadding: true }, sx: { m: 0 } } }, tablePaginationProps === null || tablePaginationProps === void 0 ? void 0 : tablePaginationProps.SelectProps), sx: (theme) => (Object.assign({ '& .MuiTablePagination-toolbar': {
|
1209
1216
|
display: 'flex',
|
1210
1217
|
alignItems: 'center',
|
1211
1218
|
}, '& .MuiTablePagination-selectLabel': {
|
@@ -1310,10 +1317,10 @@ const MRT_ToggleDensePaddingButton = (_a) => {
|
|
1310
1317
|
const MRT_ToggleFiltersButton = (_a) => {
|
1311
1318
|
var _b;
|
1312
1319
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
1313
|
-
const { getState, options: { icons: { FilterListIcon, FilterListOffIcon }, localization, },
|
1320
|
+
const { getState, options: { icons: { FilterListIcon, FilterListOffIcon }, localization, }, setShowColumnFilters, } = table;
|
1314
1321
|
const { showColumnFilters } = getState();
|
1315
1322
|
const handleToggleShowFilters = () => {
|
1316
|
-
|
1323
|
+
setShowColumnFilters(!showColumnFilters);
|
1317
1324
|
};
|
1318
1325
|
return (React.createElement(Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters },
|
1319
1326
|
React.createElement(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined }), showColumnFilters ? React.createElement(FilterListOffIcon, null) : React.createElement(FilterListIcon, null))));
|
@@ -1777,7 +1784,7 @@ const MRT_TableHeadCellFilterContainer = ({ header, table }) => {
|
|
1777
1784
|
|
1778
1785
|
const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
1779
1786
|
var _a, _b, _c;
|
1780
|
-
const { options: { icons: { FilterAltIcon }, localization, }, refs: { filterInputRefs },
|
1787
|
+
const { options: { icons: { FilterAltIcon }, localization, }, refs: { filterInputRefs }, setShowColumnFilters, } = table;
|
1781
1788
|
const { column } = header;
|
1782
1789
|
const { columnDef } = column;
|
1783
1790
|
const isRangeFilter = columnDef.filterVariant === 'range' ||
|
@@ -1799,7 +1806,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
1799
1806
|
React.createElement(Box, { component: "span", sx: { flex: '0 0' } },
|
1800
1807
|
React.createElement(Tooltip, { arrow: true, placement: "top", title: filterTooltip },
|
1801
1808
|
React.createElement(IconButton, { disableRipple: true, onClick: (event) => {
|
1802
|
-
|
1809
|
+
setShowColumnFilters(true);
|
1803
1810
|
queueMicrotask(() => {
|
1804
1811
|
var _a, _b;
|
1805
1812
|
(_a = filterInputRefs.current[`${column.id}-0`]) === null || _a === void 0 ? void 0 : _a.focus();
|
@@ -2215,11 +2222,11 @@ const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table }) => {
|
|
2215
2222
|
|
2216
2223
|
const allowedTypes = ['string', 'number'];
|
2217
2224
|
const MRT_TableBodyCellValue = ({ cell, table }) => {
|
2218
|
-
var _a, _b, _c
|
2225
|
+
var _a, _b, _c;
|
2219
2226
|
const { getState, options: { enableFilterMatchHighlighting }, } = table;
|
2220
2227
|
const { column, row } = cell;
|
2221
2228
|
const { columnDef } = column;
|
2222
|
-
const { globalFilter } = getState();
|
2229
|
+
const { globalFilter, globalFilterFn } = getState();
|
2223
2230
|
const filterValue = column.getFilterValue();
|
2224
2231
|
let renderedCellValue = cell.getIsAggregated() && columnDef.AggregatedCell
|
2225
2232
|
? columnDef.AggregatedCell({
|
@@ -2249,13 +2256,16 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
|
|
2249
2256
|
((filterValue &&
|
2250
2257
|
allowedTypes.includes(typeof filterValue) &&
|
2251
2258
|
columnDef.filterVariant === 'text') ||
|
2252
|
-
(globalFilter &&
|
2259
|
+
(globalFilter &&
|
2260
|
+
allowedTypes.includes(typeof globalFilter) &&
|
2261
|
+
column.getCanGlobalFilter()))) {
|
2253
2262
|
const chunks = highlightWords === null || highlightWords === void 0 ? void 0 : highlightWords({
|
2254
2263
|
text: renderedCellValue === null || renderedCellValue === void 0 ? void 0 : renderedCellValue.toString(),
|
2255
|
-
query: ((
|
2264
|
+
query: ((_a = filterValue !== null && filterValue !== void 0 ? filterValue : globalFilter) !== null && _a !== void 0 ? _a : '').toString(),
|
2265
|
+
matchExactly: (filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
|
2256
2266
|
});
|
2257
|
-
if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((
|
2258
|
-
renderedCellValue = (React.createElement("span", { "aria-label": renderedCellValue, role: "note" }, (
|
2267
|
+
if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((_b = chunks === null || chunks === void 0 ? void 0 : chunks[0]) === null || _b === void 0 ? void 0 : _b.match)) {
|
2268
|
+
renderedCellValue = (React.createElement("span", { "aria-label": renderedCellValue, role: "note" }, (_c = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (React.createElement(Box, { "aria-hidden": "true", component: "span", key: key, sx: match
|
2259
2269
|
? {
|
2260
2270
|
backgroundColor: (theme) => theme.palette.mode === 'dark'
|
2261
2271
|
? darken(theme.palette.warning.dark, 0.25)
|
@@ -2264,7 +2274,7 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
|
|
2264
2274
|
color: (theme) => theme.palette.mode === 'dark' ? 'white' : 'black',
|
2265
2275
|
padding: '2px 1px',
|
2266
2276
|
}
|
2267
|
-
: undefined }, text)))) !== null &&
|
2277
|
+
: undefined }, text)))) !== null && _c !== void 0 ? _c : renderedCellValue));
|
2268
2278
|
}
|
2269
2279
|
}
|
2270
2280
|
if (columnDef.Cell && !isGroupedValue) {
|
@@ -2890,7 +2900,7 @@ const MRT_TableRoot = (props) => {
|
|
2890
2900
|
const [hoveredRow, setHoveredRow] = useState((_k = initialState.hoveredRow) !== null && _k !== void 0 ? _k : null);
|
2891
2901
|
const [isFullScreen, setIsFullScreen] = useState((_l = initialState === null || initialState === void 0 ? void 0 : initialState.isFullScreen) !== null && _l !== void 0 ? _l : false);
|
2892
2902
|
const [showAlertBanner, setShowAlertBanner] = useState((_o = (_m = props.initialState) === null || _m === void 0 ? void 0 : _m.showAlertBanner) !== null && _o !== void 0 ? _o : false);
|
2893
|
-
const [showColumnFilters,
|
2903
|
+
const [showColumnFilters, setShowColumnFilters] = useState((_p = initialState === null || initialState === void 0 ? void 0 : initialState.showColumnFilters) !== null && _p !== void 0 ? _p : false);
|
2894
2904
|
const [showGlobalFilter, setShowGlobalFilter] = useState((_q = initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) !== null && _q !== void 0 ? _q : false);
|
2895
2905
|
const [showToolbarDropZone, setShowToolbarDropZone] = useState((_r = initialState === null || initialState === void 0 ? void 0 : initialState.showToolbarDropZone) !== null && _r !== void 0 ? _r : false);
|
2896
2906
|
const displayColumns = useMemo(() => {
|
@@ -2987,7 +2997,7 @@ const MRT_TableRoot = (props) => {
|
|
2987
2997
|
tableHeadCellRefs,
|
2988
2998
|
tablePaperRef,
|
2989
2999
|
topToolbarRef,
|
2990
|
-
}, setColumnFilterFns: (_0 = props.onColumnFilterFnsChange) !== null && _0 !== void 0 ? _0 : setColumnFilterFns, setDensity: (_1 = props.onDensityChange) !== null && _1 !== void 0 ? _1 : setDensity, setDraggingColumn: (_2 = props.onDraggingColumnChange) !== null && _2 !== void 0 ? _2 : setDraggingColumn, setDraggingRow: (_3 = props.onDraggingRowChange) !== null && _3 !== void 0 ? _3 : setDraggingRow, setEditingCell: (_4 = props.onEditingCellChange) !== null && _4 !== void 0 ? _4 : setEditingCell, setEditingRow: (_5 = props.onEditingRowChange) !== null && _5 !== void 0 ? _5 : setEditingRow, setGlobalFilterFn: (_6 = props.onGlobalFilterFnChange) !== null && _6 !== void 0 ? _6 : setGlobalFilterFn, setHoveredColumn: (_7 = props.onHoveredColumnChange) !== null && _7 !== void 0 ? _7 : setHoveredColumn, setHoveredRow: (_8 = props.onHoveredRowChange) !== null && _8 !== void 0 ? _8 : setHoveredRow, setIsFullScreen: (_9 = props.onIsFullScreenChange) !== null && _9 !== void 0 ? _9 : setIsFullScreen, setShowAlertBanner: (_10 = props.onShowAlertBannerChange) !== null && _10 !== void 0 ? _10 : setShowAlertBanner,
|
3000
|
+
}, setColumnFilterFns: (_0 = props.onColumnFilterFnsChange) !== null && _0 !== void 0 ? _0 : setColumnFilterFns, setDensity: (_1 = props.onDensityChange) !== null && _1 !== void 0 ? _1 : setDensity, setDraggingColumn: (_2 = props.onDraggingColumnChange) !== null && _2 !== void 0 ? _2 : setDraggingColumn, setDraggingRow: (_3 = props.onDraggingRowChange) !== null && _3 !== void 0 ? _3 : setDraggingRow, setEditingCell: (_4 = props.onEditingCellChange) !== null && _4 !== void 0 ? _4 : setEditingCell, setEditingRow: (_5 = props.onEditingRowChange) !== null && _5 !== void 0 ? _5 : setEditingRow, setGlobalFilterFn: (_6 = props.onGlobalFilterFnChange) !== null && _6 !== void 0 ? _6 : setGlobalFilterFn, setHoveredColumn: (_7 = props.onHoveredColumnChange) !== null && _7 !== void 0 ? _7 : setHoveredColumn, setHoveredRow: (_8 = props.onHoveredRowChange) !== null && _8 !== void 0 ? _8 : setHoveredRow, setIsFullScreen: (_9 = props.onIsFullScreenChange) !== null && _9 !== void 0 ? _9 : setIsFullScreen, setShowAlertBanner: (_10 = props.onShowAlertBannerChange) !== null && _10 !== void 0 ? _10 : setShowAlertBanner, setShowColumnFilters: (_11 = props.onShowColumnFiltersChange) !== null && _11 !== void 0 ? _11 : setShowColumnFilters, setShowGlobalFilter: (_12 = props.onShowGlobalFilterChange) !== null && _12 !== void 0 ? _12 : setShowGlobalFilter, setShowToolbarDropZone: (_13 = props.onShowToolbarDropZoneChange) !== null && _13 !== void 0 ? _13 : setShowToolbarDropZone });
|
2991
3001
|
if (props.tableFeatures) {
|
2992
3002
|
props.tableFeatures.forEach((feature) => {
|
2993
3003
|
Object.assign(table, feature(table));
|
@@ -3012,6 +3022,16 @@ const MRT_TableRoot = (props) => {
|
|
3012
3022
|
}
|
3013
3023
|
}
|
3014
3024
|
}, [table.getState().isFullScreen]);
|
3025
|
+
//if page index is out of bounds, set it to the last page
|
3026
|
+
useEffect(() => {
|
3027
|
+
var _a;
|
3028
|
+
const { pageIndex, pageSize } = table.getState().pagination;
|
3029
|
+
const totalRowCount = (_a = props.rowCount) !== null && _a !== void 0 ? _a : table.getPrePaginationRowModel().rows.length;
|
3030
|
+
const firstVisibleRowIndex = pageIndex * pageSize;
|
3031
|
+
if (firstVisibleRowIndex > totalRowCount) {
|
3032
|
+
table.setPageIndex(Math.floor(totalRowCount / pageSize));
|
3033
|
+
}
|
3034
|
+
}, [props.rowCount, table.getPrePaginationRowModel().rows.length]);
|
3015
3035
|
return (React.createElement(React.Fragment, null,
|
3016
3036
|
React.createElement(Dialog, { PaperComponent: Box, TransitionComponent: !props.enableRowVirtualization ? Grow : undefined, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => table.setIsFullScreen(false), open: table.getState().isFullScreen, transitionDuration: 400 },
|
3017
3037
|
React.createElement(MRT_TablePaper, { table: table })),
|