@cutting/material-react-table 5.0.0 → 5.1.0
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 -4
- package/dist/index.d.ts +186 -524
- package/dist/index.js +323 -342
- package/dist/index.js.map +1 -1
- package/locales/ar/index.mjs +1 -2
- package/locales/az/index.mjs +1 -2
- package/locales/bg/index.mjs +1 -2
- package/locales/cs/index.mjs +1 -2
- package/locales/da/index.mjs +1 -2
- package/locales/de/index.mjs +1 -2
- package/locales/el/index.mjs +1 -2
- package/locales/en/index.mjs +1 -2
- package/locales/es/index.mjs +1 -2
- package/locales/et/index.mjs +1 -2
- package/locales/fa/index.mjs +1 -2
- package/locales/fi/index.mjs +1 -2
- package/locales/fr/index.mjs +1 -2
- package/locales/he/index.mjs +1 -2
- package/locales/hr/index.mjs +1 -2
- package/locales/hu/index.mjs +1 -2
- package/locales/hy/index.mjs +1 -2
- package/locales/id/index.mjs +1 -2
- package/locales/it/index.mjs +1 -2
- package/locales/ja/index.mjs +1 -2
- package/locales/ko/index.mjs +1 -2
- package/locales/nl/index.mjs +1 -2
- package/locales/no/index.mjs +1 -2
- package/locales/np/index.mjs +1 -2
- package/locales/pl/index.mjs +1 -2
- package/locales/pt/index.mjs +1 -2
- package/locales/pt-BR/index.mjs +1 -2
- package/locales/ro/index.mjs +1 -2
- package/locales/ru/index.mjs +1 -2
- package/locales/sk/index.mjs +1 -2
- package/locales/sr-Cyrl-RS/index.mjs +1 -2
- package/locales/sr-Latn-RS/index.mjs +1 -2
- package/locales/sv/index.mjs +1 -2
- package/locales/tr/index.mjs +1 -2
- package/locales/uk/index.mjs +1 -2
- package/locales/vi/index.mjs +1 -2
- package/locales/zh-Hans/index.mjs +1 -2
- package/locales/zh-Hant/index.mjs +1 -2
- package/package.json +19 -27
- package/src/MaterialReactTable.smoke.test.tsx +3 -9
- package/src/components/MaterialReactTable.tsx +13 -21
- package/src/components/body/MRT_TableBody.tsx +67 -82
- package/src/components/body/MRT_TableBodyCell.tsx +38 -80
- package/src/components/body/MRT_TableBodyCellValue.tsx +5 -14
- package/src/components/body/MRT_TableBodyRow.tsx +55 -102
- package/src/components/body/MRT_TableBodyRowGrabHandle.test.tsx +2 -6
- package/src/components/body/MRT_TableBodyRowGrabHandle.tsx +4 -9
- package/src/components/body/MRT_TableBodyRowPinButton.tsx +8 -14
- package/src/components/body/MRT_TableDetailPanel.test.tsx +3 -9
- package/src/components/body/MRT_TableDetailPanel.tsx +8 -14
- package/src/components/buttons/MRT_ColumnPinningButtons.test.tsx +6 -16
- package/src/components/buttons/MRT_ColumnPinningButtons.tsx +6 -12
- package/src/components/buttons/MRT_CopyButton.tsx +7 -15
- package/src/components/buttons/MRT_EditActionButtons.test.tsx +2 -6
- package/src/components/buttons/MRT_EditActionButtons.tsx +15 -37
- package/src/components/buttons/MRT_ExpandAllButton.tsx +8 -16
- package/src/components/buttons/MRT_ExpandButton.tsx +9 -21
- package/src/components/buttons/MRT_GrabHandleButton.tsx +6 -10
- package/src/components/buttons/MRT_RowPinButton.tsx +8 -23
- package/src/components/buttons/MRT_ShowHideColumnsButton.tsx +5 -18
- package/src/components/buttons/MRT_ToggleDensePaddingButton.test.tsx +4 -12
- package/src/components/buttons/MRT_ToggleDensePaddingButton.tsx +4 -11
- package/src/components/buttons/MRT_ToggleFiltersButton.test.tsx +4 -13
- package/src/components/buttons/MRT_ToggleFiltersButton.tsx +3 -5
- package/src/components/buttons/MRT_ToggleFullScreenButton.test.tsx +3 -11
- package/src/components/buttons/MRT_ToggleFullScreenButton.tsx +4 -9
- package/src/components/buttons/MRT_ToggleGlobalFilterButton.tsx +3 -5
- package/src/components/buttons/MRT_ToggleRowActionMenuButton.tsx +7 -15
- package/src/components/footer/MRT_TableFooter.tsx +9 -16
- package/src/components/footer/MRT_TableFooterCell.tsx +9 -32
- package/src/components/footer/MRT_TableFooterRow.tsx +18 -32
- package/src/components/head/MRT_TableHead.tsx +8 -18
- package/src/components/head/MRT_TableHeadCell.tsx +46 -100
- package/src/components/head/MRT_TableHeadCellColumnActionsButton.tsx +10 -30
- package/src/components/head/MRT_TableHeadCellFilterContainer.tsx +4 -15
- package/src/components/head/MRT_TableHeadCellFilterLabel.tsx +20 -54
- package/src/components/head/MRT_TableHeadCellGrabHandle.test.tsx +5 -19
- package/src/components/head/MRT_TableHeadCellGrabHandle.tsx +9 -38
- package/src/components/head/MRT_TableHeadCellResizeHandle.test.tsx +3 -13
- package/src/components/head/MRT_TableHeadCellResizeHandle.tsx +10 -24
- package/src/components/head/MRT_TableHeadCellSortLabel.tsx +10 -26
- package/src/components/head/MRT_TableHeadRow.tsx +24 -36
- package/src/components/inputs/MRT_EditCellTextField.test.tsx +2 -9
- package/src/components/inputs/MRT_EditCellTextField.tsx +9 -28
- package/src/components/inputs/MRT_FilterCheckbox.tsx +9 -23
- package/src/components/inputs/MRT_FilterRangeFields.tsx +6 -15
- package/src/components/inputs/MRT_FilterRangeSlider.tsx +24 -32
- package/src/components/inputs/MRT_FilterTextField.test.tsx +72 -14
- package/src/components/inputs/MRT_FilterTextField.tsx +77 -138
- package/src/components/inputs/MRT_GlobalFilterTextField.tsx +10 -32
- package/src/components/inputs/MRT_SelectCheckbox.test.tsx +4 -11
- package/src/components/inputs/MRT_SelectCheckbox.tsx +17 -36
- package/src/components/menus/MRT_ActionMenuItem.tsx +6 -15
- package/src/components/menus/MRT_CellActionMenu.tsx +6 -9
- package/src/components/menus/MRT_ColumnActionMenu.tsx +22 -57
- package/src/components/menus/MRT_FilterOptionMenu.tsx +38 -65
- package/src/components/menus/MRT_RowActionMenu.tsx +33 -22
- package/src/components/menus/MRT_ShowHideColumnsMenu.tsx +29 -65
- package/src/components/menus/MRT_ShowHideColumnsMenuItems.test.tsx +43 -0
- package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +14 -50
- package/src/components/modals/MRT_EditRowModal.test.tsx +5 -21
- package/src/components/modals/MRT_EditRowModal.tsx +8 -26
- package/src/components/table/MRT_Table.tsx +12 -20
- package/src/components/table/MRT_TableContainer.test.tsx +147 -0
- package/src/components/table/MRT_TableContainer.tsx +33 -37
- package/src/components/table/MRT_TableLoadingOverlay.tsx +3 -5
- package/src/components/table/MRT_TablePaper.tsx +7 -14
- package/src/components/toolbar/MRT_BottomToolbar.tsx +11 -23
- package/src/components/toolbar/MRT_LinearProgressBar.tsx +4 -11
- package/src/components/toolbar/MRT_TablePagination.tsx +33 -40
- package/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +21 -50
- package/src/components/toolbar/MRT_ToolbarDropZone.test.tsx +26 -10
- package/src/components/toolbar/MRT_ToolbarDropZone.tsx +23 -21
- package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +11 -21
- package/src/components/toolbar/MRT_TopToolbar.tsx +12 -28
- package/src/fns/aggregationFns.test.tsx +1 -3
- package/src/fns/filterFns.test.tsx +8 -37
- package/src/fns/filterFns.ts +71 -96
- package/src/fns/sortingFns.test.tsx +5 -21
- package/src/fns/sortingFns.ts +10 -14
- package/src/fns/tableFeatures.test.tsx +6 -29
- package/src/fns/tableFeatures.ts +5 -4
- package/src/hooks/display-columns/getMRT_RowActionsColumnDef.tsx +2 -11
- package/src/hooks/display-columns/getMRT_RowDragColumnDef.tsx +2 -10
- package/src/hooks/display-columns/getMRT_RowExpandColumnDef.tsx +8 -17
- package/src/hooks/display-columns/getMRT_RowNumbersColumnDef.tsx +3 -8
- package/src/hooks/display-columns/getMRT_RowPinningColumnDef.tsx +2 -8
- package/src/hooks/display-columns/getMRT_RowSelectColumnDef.tsx +3 -13
- package/src/hooks/display-columns/getMRT_RowSpacerColumnDef.tsx +1 -5
- package/src/hooks/useMRT_ColumnVirtualizer.ts +28 -49
- package/src/hooks/useMRT_Effects.test.tsx +114 -0
- package/src/hooks/useMRT_Effects.ts +26 -27
- package/src/hooks/useMRT_RowVirtualizer.ts +18 -33
- package/src/hooks/useMRT_Rows.ts +3 -42
- package/src/hooks/useMRT_TableInstance.ts +63 -129
- package/src/hooks/useMRT_TableOptions.ts +15 -29
- package/src/hooks/useMaterialReactTable.ts +2 -7
- package/src/icons.ts +38 -1
- package/src/index.ts +0 -4
- package/src/locales/ar.ts +1 -2
- package/src/locales/az.ts +1 -2
- package/src/locales/bg.ts +1 -2
- package/src/locales/cs.ts +2 -4
- package/src/locales/da.ts +1 -2
- package/src/locales/de.ts +1 -2
- package/src/locales/el.ts +1 -2
- package/src/locales/en.ts +1 -2
- package/src/locales/es.ts +1 -2
- package/src/locales/et.ts +2 -4
- package/src/locales/fa.ts +1 -2
- package/src/locales/fi.ts +2 -4
- package/src/locales/fr.ts +1 -2
- package/src/locales/he.ts +1 -2
- package/src/locales/hr.ts +1 -2
- package/src/locales/hu.ts +1 -2
- package/src/locales/hy.ts +1 -2
- package/src/locales/id.ts +2 -4
- package/src/locales/it.ts +1 -2
- package/src/locales/ja.ts +1 -2
- package/src/locales/ko.ts +1 -2
- package/src/locales/nl.ts +1 -2
- package/src/locales/no.ts +2 -4
- package/src/locales/np.ts +2 -4
- package/src/locales/pl.ts +1 -2
- package/src/locales/pt-BR.ts +1 -2
- package/src/locales/pt.ts +1 -2
- package/src/locales/ro.ts +1 -2
- package/src/locales/ru.ts +1 -2
- package/src/locales/sk.ts +2 -4
- package/src/locales/sr-Cyrl-RS.ts +1 -2
- package/src/locales/sr-Latn-RS.ts +1 -2
- package/src/locales/sv.ts +1 -2
- package/src/locales/tr.ts +1 -2
- package/src/locales/uk.ts +1 -2
- package/src/locales/vi.ts +1 -2
- package/src/types.ts +156 -349
- package/src/utils/cell.utils.ts +30 -68
- package/src/utils/column.utils.ts +61 -49
- package/src/utils/displayColumn.utils.ts +16 -38
- package/src/utils/highlight.utils.ts +7 -11
- package/src/utils/row.utils.ts +40 -65
- package/src/utils/slotProps.utils.ts +1 -4
- package/src/utils/style.utils.ts +18 -46
- package/src/utils/tanstack.helpers.ts +10 -17
- package/src/utils/utils.ts +6 -10
- package/src/utils/virtualization.utils.ts +5 -9
package/src/types.ts
CHANGED
|
@@ -23,14 +23,9 @@ import { type TableFooterProps } from '@mui/material/TableFooter';
|
|
|
23
23
|
import { type TableHeadProps } from '@mui/material/TableHead';
|
|
24
24
|
import { type TableRowProps } from '@mui/material/TableRow';
|
|
25
25
|
import { type TextFieldProps } from '@mui/material/TextField';
|
|
26
|
-
import {
|
|
27
|
-
type DatePickerProps,
|
|
28
|
-
type DateTimePickerProps,
|
|
29
|
-
type TimePickerProps,
|
|
30
|
-
} from '@mui/x-date-pickers';
|
|
26
|
+
import { type DatePickerProps, type DateTimePickerProps, type TimePickerProps } from '@mui/x-date-pickers';
|
|
31
27
|
import {
|
|
32
28
|
type AccessorFn,
|
|
33
|
-
type AggregationFnDef,
|
|
34
29
|
type Cell,
|
|
35
30
|
type CellData,
|
|
36
31
|
type Column,
|
|
@@ -40,6 +35,7 @@ import {
|
|
|
40
35
|
type ColumnPinningState,
|
|
41
36
|
type ColumnSizingState,
|
|
42
37
|
type ColumnVisibilityState,
|
|
38
|
+
type CustomAggregationFns,
|
|
43
39
|
type DeepKeys,
|
|
44
40
|
type DeepValue,
|
|
45
41
|
type ExpandedState,
|
|
@@ -62,17 +58,8 @@ import {
|
|
|
62
58
|
type TableState_ColumnResizing,
|
|
63
59
|
type Updater,
|
|
64
60
|
} from '@tanstack/react-table';
|
|
65
|
-
import {
|
|
66
|
-
|
|
67
|
-
type Virtualizer,
|
|
68
|
-
type VirtualizerOptions,
|
|
69
|
-
} from '@tanstack/react-virtual';
|
|
70
|
-
import {
|
|
71
|
-
type Dispatch,
|
|
72
|
-
type ReactNode,
|
|
73
|
-
type RefObject,
|
|
74
|
-
type SetStateAction,
|
|
75
|
-
} from 'react';
|
|
61
|
+
import { type VirtualItem, type Virtualizer, type VirtualizerOptions } from '@tanstack/react-virtual';
|
|
62
|
+
import { type Dispatch, type ReactNode, type RefObject, type SetStateAction } from 'react';
|
|
76
63
|
|
|
77
64
|
import { type MRT_AggregationFns } from './fns/aggregationFns';
|
|
78
65
|
import { type MRT_FilterFns } from './fns/filterFns';
|
|
@@ -86,50 +73,36 @@ export type DropdownOption =
|
|
|
86
73
|
| string
|
|
87
74
|
| {
|
|
88
75
|
label?: string;
|
|
76
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
89
77
|
value: any;
|
|
90
78
|
};
|
|
91
79
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
81
|
+
export type MRT_FilterAutocompleteProps = Partial<AutocompleteProps<any, any, any, any>>;
|
|
82
|
+
|
|
83
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
84
|
+
export type MRT_EditValues<TData extends MRT_RowData> = Record<LiteralUnion<DeepKeys<TData> & string>, any>;
|
|
85
|
+
|
|
86
|
+
export type LiteralUnion<T extends U, U = string> = (Record<never, never> & U) | T;
|
|
95
87
|
|
|
96
|
-
/**
|
|
97
|
-
* v9 replaced the callable `AggregationFn` with `AggregationFnDef`, an object
|
|
98
|
-
* with an `aggregate` method that takes a single context argument.
|
|
99
|
-
*/
|
|
100
88
|
export type MRT_AggregationFn<TData extends MRT_RowData> =
|
|
101
|
-
|
|
|
89
|
+
| CustomAggregationFns<MRT_TableFeatures, TData>[string]
|
|
102
90
|
| MRT_AggregationOption;
|
|
103
91
|
|
|
104
|
-
export type MRT_AggregationOption =
|
|
105
|
-
| (keyof typeof MRT_AggregationFns & string)
|
|
106
|
-
| (string & {});
|
|
92
|
+
export type MRT_AggregationOption = (keyof typeof MRT_AggregationFns & string) | (string & {});
|
|
107
93
|
|
|
108
|
-
export type MRT_Cell<
|
|
109
|
-
TData extends MRT_RowData,
|
|
110
|
-
TValue = unknown,
|
|
111
|
-
> = Cell<MRT_TableFeatures, TData, TValue>;
|
|
94
|
+
export type MRT_Cell<TData extends MRT_RowData, TValue = unknown> = Cell<MRT_TableFeatures, TData, TValue>;
|
|
112
95
|
|
|
113
|
-
export type MRT_Column<
|
|
114
|
-
TData extends MRT_RowData,
|
|
115
|
-
TValue = unknown,
|
|
116
|
-
> = Column<MRT_TableFeatures, TData, TValue>;
|
|
96
|
+
export type MRT_Column<TData extends MRT_RowData, TValue = unknown> = Column<MRT_TableFeatures, TData, TValue>;
|
|
117
97
|
|
|
118
98
|
declare module '@tanstack/table-core' {
|
|
119
|
-
interface ColumnDef_FeatureMap<
|
|
120
|
-
TFeatures extends TableFeatures,
|
|
121
|
-
TData extends RowData,
|
|
122
|
-
TValue extends CellData,
|
|
123
|
-
> {
|
|
99
|
+
interface ColumnDef_FeatureMap<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData> {
|
|
124
100
|
mrtFeature: MRT_ColumnDefExtras<TData, TValue>;
|
|
125
101
|
}
|
|
126
102
|
interface Plugins {
|
|
127
103
|
mrtFeature: TableFeature;
|
|
128
104
|
}
|
|
129
|
-
interface TableOptions_FeatureMap<
|
|
130
|
-
TFeatures extends TableFeatures,
|
|
131
|
-
TData extends RowData,
|
|
132
|
-
> {
|
|
105
|
+
interface TableOptions_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
|
|
133
106
|
mrtFeature: MRT_TableOptionExtras<TData>;
|
|
134
107
|
}
|
|
135
108
|
interface TableState_FeatureMap {
|
|
@@ -137,15 +110,9 @@ declare module '@tanstack/table-core' {
|
|
|
137
110
|
}
|
|
138
111
|
}
|
|
139
112
|
|
|
140
|
-
export type MRT_ColumnDef<
|
|
141
|
-
TData extends MRT_RowData,
|
|
142
|
-
TValue = unknown,
|
|
143
|
-
> = ColumnDef<MRT_TableFeatures, TData, TValue>;
|
|
113
|
+
export type MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown> = ColumnDef<MRT_TableFeatures, TData, TValue>;
|
|
144
114
|
|
|
145
|
-
export interface MRT_ColumnDefExtras<
|
|
146
|
-
TData extends MRT_RowData,
|
|
147
|
-
TValue = unknown,
|
|
148
|
-
> {
|
|
115
|
+
export interface MRT_ColumnDefExtras<TData extends MRT_RowData, TValue = unknown> {
|
|
149
116
|
_filterFn?: MRT_FilterOption;
|
|
150
117
|
AggregatedCell?: (props: {
|
|
151
118
|
cell: MRT_Cell<TData, TValue>;
|
|
@@ -174,9 +141,7 @@ export interface MRT_ColumnDefExtras<
|
|
|
174
141
|
* @example columnDefType: 'display'
|
|
175
142
|
*/
|
|
176
143
|
columnDefType?: 'data' | 'display' | 'group';
|
|
177
|
-
columnFilterModeOptions?: Array<
|
|
178
|
-
LiteralUnion<MRT_FilterOption & string>
|
|
179
|
-
> | null;
|
|
144
|
+
columnFilterModeOptions?: Array<LiteralUnion<MRT_FilterOption & string>> | null;
|
|
180
145
|
Edit?: (props: {
|
|
181
146
|
cell: MRT_Cell<TData, TValue>;
|
|
182
147
|
column: MRT_Column<TData, TValue>;
|
|
@@ -192,10 +157,7 @@ export interface MRT_ColumnDefExtras<
|
|
|
192
157
|
}) => DropdownOption[])
|
|
193
158
|
| DropdownOption[];
|
|
194
159
|
editVariant?: 'select' | 'text';
|
|
195
|
-
enableClickToCopy?:
|
|
196
|
-
| 'context-menu'
|
|
197
|
-
| ((cell: MRT_Cell<TData>) => 'context-menu' | boolean)
|
|
198
|
-
| boolean;
|
|
160
|
+
enableClickToCopy?: 'context-menu' | ((cell: MRT_Cell<TData>) => 'context-menu' | boolean) | boolean;
|
|
199
161
|
enableColumnActions?: boolean;
|
|
200
162
|
enableColumnDragging?: boolean;
|
|
201
163
|
enableColumnFilterModes?: boolean;
|
|
@@ -252,16 +214,10 @@ export interface MRT_ColumnDefExtras<
|
|
|
252
214
|
}) => ReactNode)
|
|
253
215
|
| ReactNode;
|
|
254
216
|
muiColumnActionsButtonProps?:
|
|
255
|
-
| ((props: {
|
|
256
|
-
column: MRT_Column<TData>;
|
|
257
|
-
table: MRT_TableInstance<TData>;
|
|
258
|
-
}) => IconButtonProps)
|
|
217
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => IconButtonProps)
|
|
259
218
|
| IconButtonProps;
|
|
260
219
|
muiColumnDragHandleProps?:
|
|
261
|
-
| ((props: {
|
|
262
|
-
column: MRT_Column<TData>;
|
|
263
|
-
table: MRT_TableInstance<TData>;
|
|
264
|
-
}) => IconButtonProps)
|
|
220
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => IconButtonProps)
|
|
265
221
|
| IconButtonProps;
|
|
266
222
|
muiCopyButtonProps?:
|
|
267
223
|
| ((props: {
|
|
@@ -280,16 +236,10 @@ export interface MRT_ColumnDefExtras<
|
|
|
280
236
|
}) => TextFieldProps)
|
|
281
237
|
| TextFieldProps;
|
|
282
238
|
muiFilterAutocompleteProps?:
|
|
283
|
-
| ((props: {
|
|
284
|
-
|
|
285
|
-
table: MRT_TableInstance<TData>;
|
|
286
|
-
}) => AutocompleteProps<any, any, any, any>)
|
|
287
|
-
| AutocompleteProps<any, any, any, any>;
|
|
239
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => MRT_FilterAutocompleteProps)
|
|
240
|
+
| MRT_FilterAutocompleteProps;
|
|
288
241
|
muiFilterCheckboxProps?:
|
|
289
|
-
| ((props: {
|
|
290
|
-
column: MRT_Column<TData>;
|
|
291
|
-
table: MRT_TableInstance<TData>;
|
|
292
|
-
}) => CheckboxProps)
|
|
242
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => CheckboxProps)
|
|
293
243
|
| CheckboxProps;
|
|
294
244
|
muiFilterDatePickerProps?:
|
|
295
245
|
| ((props: {
|
|
@@ -306,10 +256,7 @@ export interface MRT_ColumnDefExtras<
|
|
|
306
256
|
}) => DateTimePickerProps)
|
|
307
257
|
| DateTimePickerProps;
|
|
308
258
|
muiFilterSliderProps?:
|
|
309
|
-
| ((props: {
|
|
310
|
-
column: MRT_Column<TData>;
|
|
311
|
-
table: MRT_TableInstance<TData>;
|
|
312
|
-
}) => SliderProps)
|
|
259
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => SliderProps)
|
|
313
260
|
| SliderProps;
|
|
314
261
|
muiFilterTextFieldProps?:
|
|
315
262
|
| ((props: {
|
|
@@ -334,16 +281,10 @@ export interface MRT_ColumnDefExtras<
|
|
|
334
281
|
}) => TableCellProps)
|
|
335
282
|
| TableCellProps;
|
|
336
283
|
muiTableFooterCellProps?:
|
|
337
|
-
| ((props: {
|
|
338
|
-
column: MRT_Column<TData>;
|
|
339
|
-
table: MRT_TableInstance<TData>;
|
|
340
|
-
}) => TableCellProps)
|
|
284
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => TableCellProps)
|
|
341
285
|
| TableCellProps;
|
|
342
286
|
muiTableHeadCellProps?:
|
|
343
|
-
| ((props: {
|
|
344
|
-
column: MRT_Column<TData>;
|
|
345
|
-
table: MRT_TableInstance<TData>;
|
|
346
|
-
}) => TableCellProps)
|
|
287
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => TableCellProps)
|
|
347
288
|
| TableCellProps;
|
|
348
289
|
PlaceholderCell?: (props: {
|
|
349
290
|
cell: MRT_Cell<TData, TValue>;
|
|
@@ -383,11 +324,11 @@ export type MRT_ColumnFiltersState = ColumnFiltersState;
|
|
|
383
324
|
export type MRT_ColumnHelper<TData extends MRT_RowData> = {
|
|
384
325
|
accessor: <
|
|
385
326
|
TAccessor extends AccessorFn<TData> | DeepKeys<TData>,
|
|
386
|
-
TValue extends TAccessor extends AccessorFn<TData, infer TReturn>
|
|
327
|
+
TValue extends (TAccessor extends AccessorFn<TData, infer TReturn>
|
|
387
328
|
? TReturn
|
|
388
329
|
: TAccessor extends DeepKeys<TData>
|
|
389
330
|
? DeepValue<TData, TAccessor>
|
|
390
|
-
: never,
|
|
331
|
+
: never),
|
|
391
332
|
>(
|
|
392
333
|
accessor: TAccessor,
|
|
393
334
|
column: MRT_DisplayColumnDef<TData, TValue>,
|
|
@@ -398,8 +339,7 @@ export type MRT_ColumnHelper<TData extends MRT_RowData> = {
|
|
|
398
339
|
|
|
399
340
|
export type MRT_ColumnOrderState = ColumnOrderState;
|
|
400
341
|
export type MRT_ColumnPinningState = ColumnPinningState;
|
|
401
|
-
export type MRT_ColumnSizingInfoState =
|
|
402
|
-
TableState_ColumnResizing['columnResizing'];
|
|
342
|
+
export type MRT_ColumnSizingInfoState = TableState_ColumnResizing['columnResizing'];
|
|
403
343
|
export type MRT_ColumnSizingState = ColumnSizingState;
|
|
404
344
|
export type MRT_ColumnVirtualizer<
|
|
405
345
|
TScrollElement extends Element | Window = HTMLDivElement,
|
|
@@ -409,10 +349,10 @@ export type MRT_ColumnVirtualizer<
|
|
|
409
349
|
virtualPaddingLeft?: number;
|
|
410
350
|
virtualPaddingRight?: number;
|
|
411
351
|
};
|
|
412
|
-
export type MRT_DefinedColumnDef<
|
|
413
|
-
TData
|
|
414
|
-
|
|
415
|
-
>
|
|
352
|
+
export type MRT_DefinedColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<
|
|
353
|
+
MRT_ColumnDef<TData, TValue>,
|
|
354
|
+
'defaultDisplayColumn' | 'id'
|
|
355
|
+
> & {
|
|
416
356
|
_filterFn: MRT_FilterOption;
|
|
417
357
|
defaultDisplayColumn: Partial<MRT_ColumnDef<TData, TValue>>;
|
|
418
358
|
id: string;
|
|
@@ -426,10 +366,10 @@ export type MRT_DefinedTableOptions<TData extends MRT_RowData> = Omit<
|
|
|
426
366
|
mrtTheme: Required<MRT_Theme>;
|
|
427
367
|
};
|
|
428
368
|
export type MRT_DensityState = 'comfortable' | 'compact' | 'spacious';
|
|
429
|
-
export type MRT_DisplayColumnDef<
|
|
430
|
-
TData
|
|
431
|
-
|
|
432
|
-
|
|
369
|
+
export type MRT_DisplayColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<
|
|
370
|
+
MRT_ColumnDef<TData, TValue>,
|
|
371
|
+
'accessorFn' | 'accessorKey'
|
|
372
|
+
>;
|
|
433
373
|
export type MRT_DisplayColumnIds =
|
|
434
374
|
| 'mrt-row-actions'
|
|
435
375
|
| 'mrt-row-drag'
|
|
@@ -439,31 +379,20 @@ export type MRT_DisplayColumnIds =
|
|
|
439
379
|
| 'mrt-row-select'
|
|
440
380
|
| 'mrt-row-spacer';
|
|
441
381
|
export type MRT_ExpandedState = ExpandedState;
|
|
442
|
-
export type MRT_FilterFn<TData extends MRT_RowData> =
|
|
443
|
-
|
|
444
|
-
| MRT_FilterOption;
|
|
445
|
-
export type MRT_FilterOption = LiteralUnion<
|
|
446
|
-
keyof typeof MRT_FilterFns & string
|
|
447
|
-
>;
|
|
382
|
+
export type MRT_FilterFn<TData extends MRT_RowData> = FilterFn<MRT_TableFeatures, TData> | MRT_FilterOption;
|
|
383
|
+
export type MRT_FilterOption = LiteralUnion<keyof typeof MRT_FilterFns & string>;
|
|
448
384
|
|
|
449
|
-
export type MRT_GroupColumnDef<TData extends MRT_RowData> =
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
};
|
|
385
|
+
export type MRT_GroupColumnDef<TData extends MRT_RowData> = MRT_DisplayColumnDef<TData, unknown> & {
|
|
386
|
+
columns: MRT_ColumnDef<TData>[];
|
|
387
|
+
};
|
|
453
388
|
|
|
454
389
|
export type MRT_GroupingState = GroupingState;
|
|
455
390
|
|
|
456
|
-
export type MRT_Header<TData extends MRT_RowData> = Omit<
|
|
457
|
-
Header<MRT_TableFeatures, TData, unknown>,
|
|
458
|
-
'column'
|
|
459
|
-
> & {
|
|
391
|
+
export type MRT_Header<TData extends MRT_RowData> = Omit<Header<MRT_TableFeatures, TData, unknown>, 'column'> & {
|
|
460
392
|
column: MRT_Column<TData>;
|
|
461
393
|
};
|
|
462
394
|
|
|
463
|
-
export type MRT_HeaderGroup<TData extends MRT_RowData> = Omit<
|
|
464
|
-
HeaderGroup<MRT_TableFeatures, TData>,
|
|
465
|
-
'headers'
|
|
466
|
-
> & {
|
|
395
|
+
export type MRT_HeaderGroup<TData extends MRT_RowData> = Omit<HeaderGroup<MRT_TableFeatures, TData>, 'headers'> & {
|
|
467
396
|
headers: MRT_Header<TData>[];
|
|
468
397
|
};
|
|
469
398
|
|
|
@@ -574,6 +503,7 @@ export type MRT_PaginationState = PaginationState;
|
|
|
574
503
|
|
|
575
504
|
export type MRT_Row<TData extends MRT_RowData> = Row<MRT_TableFeatures, TData>;
|
|
576
505
|
|
|
506
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
577
507
|
export type MRT_RowData = Record<string, any>;
|
|
578
508
|
|
|
579
509
|
export interface MRT_RowModel<TData extends MRT_RowData> {
|
|
@@ -591,44 +521,41 @@ export type MRT_RowVirtualizer<
|
|
|
591
521
|
virtualRows: MRT_VirtualItem[];
|
|
592
522
|
};
|
|
593
523
|
|
|
594
|
-
export type MRT_SortingFn<TData extends MRT_RowData> =
|
|
595
|
-
| MRT_SortingOption
|
|
596
|
-
| SortFn<MRT_TableFeatures, TData>;
|
|
524
|
+
export type MRT_SortingFn<TData extends MRT_RowData> = MRT_SortingOption | SortFn<MRT_TableFeatures, TData>;
|
|
597
525
|
|
|
598
|
-
export type MRT_SortingOption = LiteralUnion<
|
|
599
|
-
keyof typeof MRT_SortingFns & string
|
|
600
|
-
>;
|
|
526
|
+
export type MRT_SortingOption = LiteralUnion<keyof typeof MRT_SortingFns & string>;
|
|
601
527
|
|
|
602
528
|
export type MRT_SortingState = SortingState;
|
|
603
529
|
|
|
604
|
-
export type MRT_StatefulState<TData extends MRT_RowData> = Partial<
|
|
530
|
+
export type MRT_StatefulState<TData extends MRT_RowData> = Partial<
|
|
531
|
+
Pick<MRT_TableState<TData>, 'isLoading' | 'showSkeletons'>
|
|
532
|
+
> &
|
|
605
533
|
Pick<
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
>;
|
|
534
|
+
MRT_TableState<TData>,
|
|
535
|
+
| 'columnFilterFns'
|
|
536
|
+
| 'columnOrder'
|
|
537
|
+
| 'columnResizing'
|
|
538
|
+
| 'creatingRow'
|
|
539
|
+
| 'density'
|
|
540
|
+
| 'draggingColumn'
|
|
541
|
+
| 'draggingRow'
|
|
542
|
+
| 'editingCell'
|
|
543
|
+
| 'editingRow'
|
|
544
|
+
| 'globalFilterFn'
|
|
545
|
+
| 'grouping'
|
|
546
|
+
| 'hoveredColumn'
|
|
547
|
+
| 'hoveredRow'
|
|
548
|
+
| 'isFullScreen'
|
|
549
|
+
| 'pagination'
|
|
550
|
+
| 'showAlertBanner'
|
|
551
|
+
| 'showColumnFilters'
|
|
552
|
+
| 'showGlobalFilter'
|
|
553
|
+
| 'showToolbarDropZone'
|
|
554
|
+
>;
|
|
627
555
|
|
|
628
|
-
export type MRT_StatefulTableOptions<TData extends MRT_RowData> =
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
};
|
|
556
|
+
export type MRT_StatefulTableOptions<TData extends MRT_RowData> = MRT_DefinedTableOptions<TData> & {
|
|
557
|
+
state: MRT_StatefulState<TData>;
|
|
558
|
+
};
|
|
632
559
|
|
|
633
560
|
export type MRT_TableInstance<TData extends MRT_RowData> = Omit<
|
|
634
561
|
ReactTable<MRT_TableFeatures, TData>,
|
|
@@ -652,7 +579,9 @@ export type MRT_TableInstance<TData extends MRT_RowData> = Omit<
|
|
|
652
579
|
| 'getSelectedRowModel'
|
|
653
580
|
| 'getTopRows'
|
|
654
581
|
| 'options'
|
|
582
|
+
| 'state'
|
|
655
583
|
> & {
|
|
584
|
+
readonly state: Readonly<MRT_TableState<TData>>;
|
|
656
585
|
getAllColumns: () => MRT_Column<TData>[];
|
|
657
586
|
getAllFlatColumns: () => MRT_Column<TData>[];
|
|
658
587
|
getAllLeafColumns: () => MRT_Column<TData>[];
|
|
@@ -714,32 +643,25 @@ export type MRT_TableInstance<TData extends MRT_RowData> = Omit<
|
|
|
714
643
|
* See the full props list on the official docs site:
|
|
715
644
|
* @link https://www.material-react-table.com/docs/api/props
|
|
716
645
|
*/
|
|
717
|
-
export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
/**
|
|
735
|
-
* Custom aggregation functions, registered by name so column defs can select
|
|
736
|
-
* them with `aggregationFn: 'myFn'`.
|
|
737
|
-
*/
|
|
738
|
-
aggregationFns?: Record<string, AggregationFnDef<any, TData, any, any>>;
|
|
646
|
+
export interface MRT_TableOptions<TData extends MRT_RowData> extends Omit<
|
|
647
|
+
Partial<Omit<TableOptions<MRT_TableFeatures, TData>, 'features'>>,
|
|
648
|
+
| 'columns'
|
|
649
|
+
| 'data'
|
|
650
|
+
| 'defaultColumn'
|
|
651
|
+
| 'enableRowSelection'
|
|
652
|
+
| 'expandRowsFn'
|
|
653
|
+
| 'getRowId'
|
|
654
|
+
| 'globalFilterFn'
|
|
655
|
+
| 'icons'
|
|
656
|
+
| 'initialState'
|
|
657
|
+
| 'localization'
|
|
658
|
+
| 'mrtTheme'
|
|
659
|
+
| 'onStateChange'
|
|
660
|
+
| 'state'
|
|
661
|
+
> {
|
|
662
|
+
aggregationFns?: CustomAggregationFns<MRT_TableFeatures, TData>;
|
|
739
663
|
columnFilterDisplayMode?: 'custom' | 'popover' | 'subheader';
|
|
740
|
-
columnFilterModeOptions?: Array<
|
|
741
|
-
LiteralUnion<MRT_FilterOption & string>
|
|
742
|
-
> | null;
|
|
664
|
+
columnFilterModeOptions?: Array<LiteralUnion<MRT_FilterOption & string>> | null;
|
|
743
665
|
/**
|
|
744
666
|
* The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` table option.
|
|
745
667
|
*
|
|
@@ -750,6 +672,7 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
750
672
|
* See all Columns Options on the official docs site:
|
|
751
673
|
* @link https://www.material-react-table.com/docs/api/column-options
|
|
752
674
|
*/
|
|
675
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
753
676
|
columns: ReadonlyArray<MRT_ColumnDef<TData, any>>;
|
|
754
677
|
columnVirtualizerInstanceRef?: RefObject<MRT_ColumnVirtualizer | null>;
|
|
755
678
|
columnVirtualizerOptions?:
|
|
@@ -780,10 +703,7 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
780
703
|
enableBatchRowSelection?: boolean;
|
|
781
704
|
enableBottomToolbar?: boolean;
|
|
782
705
|
enableCellActions?: ((cell: MRT_Cell<TData>) => boolean) | boolean;
|
|
783
|
-
enableClickToCopy?:
|
|
784
|
-
| 'context-menu'
|
|
785
|
-
| ((cell: MRT_Cell<TData>) => 'context-menu' | boolean)
|
|
786
|
-
| boolean;
|
|
706
|
+
enableClickToCopy?: 'context-menu' | ((cell: MRT_Cell<TData>) => 'context-menu' | boolean) | boolean;
|
|
787
707
|
enableColumnActions?: boolean;
|
|
788
708
|
enableColumnDragging?: boolean;
|
|
789
709
|
enableColumnFilterModes?: boolean;
|
|
@@ -813,16 +733,8 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
813
733
|
enableToolbarInternalActions?: boolean;
|
|
814
734
|
enableTopToolbar?: boolean;
|
|
815
735
|
expandRowsFn?: (dataRow: TData) => TData[];
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
* with `filterFn: 'myFn'` and `globalFilterFn` can name one.
|
|
819
|
-
*/
|
|
820
|
-
filterFns?: Record<string, FilterFn<any, TData>>;
|
|
821
|
-
getRowId?: (
|
|
822
|
-
originalRow: TData,
|
|
823
|
-
index: number,
|
|
824
|
-
parentRow?: MRT_Row<TData>,
|
|
825
|
-
) => string;
|
|
736
|
+
filterFns?: Record<string, FilterFn<MRT_TableFeatures, TData>>;
|
|
737
|
+
getRowId?: (originalRow: TData, index: number, parentRow?: MRT_Row<TData>) => string;
|
|
826
738
|
globalFilterFn?: MRT_FilterOption;
|
|
827
739
|
globalFilterModeOptions?: MRT_FilterOption[] | null;
|
|
828
740
|
icons?: Partial<MRT_Icons>;
|
|
@@ -847,25 +759,15 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
847
759
|
*/
|
|
848
760
|
memoMode?: 'cells' | 'rows' | 'table-body';
|
|
849
761
|
mrtTheme?: ((theme: Theme) => Partial<MRT_Theme>) | Partial<MRT_Theme>;
|
|
850
|
-
muiBottomToolbarProps?:
|
|
851
|
-
| ((props: { table: MRT_TableInstance<TData> }) => BoxProps)
|
|
852
|
-
| BoxProps;
|
|
762
|
+
muiBottomToolbarProps?: ((props: { table: MRT_TableInstance<TData> }) => BoxProps) | BoxProps;
|
|
853
763
|
muiCircularProgressProps?:
|
|
854
|
-
| ((props: {
|
|
855
|
-
table: MRT_TableInstance<TData>;
|
|
856
|
-
}) => CircularProgressProps & { Component?: ReactNode })
|
|
764
|
+
| ((props: { table: MRT_TableInstance<TData> }) => CircularProgressProps & { Component?: ReactNode })
|
|
857
765
|
| (CircularProgressProps & { Component?: ReactNode });
|
|
858
766
|
muiColumnActionsButtonProps?:
|
|
859
|
-
| ((props: {
|
|
860
|
-
column: MRT_Column<TData>;
|
|
861
|
-
table: MRT_TableInstance<TData>;
|
|
862
|
-
}) => IconButtonProps)
|
|
767
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => IconButtonProps)
|
|
863
768
|
| IconButtonProps;
|
|
864
769
|
muiColumnDragHandleProps?:
|
|
865
|
-
| ((props: {
|
|
866
|
-
column: MRT_Column<TData>;
|
|
867
|
-
table: MRT_TableInstance<TData>;
|
|
868
|
-
}) => IconButtonProps)
|
|
770
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => IconButtonProps)
|
|
869
771
|
| IconButtonProps;
|
|
870
772
|
muiCopyButtonProps?:
|
|
871
773
|
| ((props: {
|
|
@@ -876,22 +778,13 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
876
778
|
}) => ButtonProps)
|
|
877
779
|
| ButtonProps;
|
|
878
780
|
muiCreateRowModalProps?:
|
|
879
|
-
| ((props: {
|
|
880
|
-
row: MRT_Row<TData>;
|
|
881
|
-
table: MRT_TableInstance<TData>;
|
|
882
|
-
}) => DialogProps)
|
|
781
|
+
| ((props: { row: MRT_Row<TData>; table: MRT_TableInstance<TData> }) => DialogProps)
|
|
883
782
|
| DialogProps;
|
|
884
783
|
muiDetailPanelProps?:
|
|
885
|
-
| ((props: {
|
|
886
|
-
row: MRT_Row<TData>;
|
|
887
|
-
table: MRT_TableInstance<TData>;
|
|
888
|
-
}) => TableCellProps)
|
|
784
|
+
| ((props: { row: MRT_Row<TData>; table: MRT_TableInstance<TData> }) => TableCellProps)
|
|
889
785
|
| TableCellProps;
|
|
890
786
|
muiEditRowDialogProps?:
|
|
891
|
-
| ((props: {
|
|
892
|
-
row: MRT_Row<TData>;
|
|
893
|
-
table: MRT_TableInstance<TData>;
|
|
894
|
-
}) => DialogProps)
|
|
787
|
+
| ((props: { row: MRT_Row<TData>; table: MRT_TableInstance<TData> }) => DialogProps)
|
|
895
788
|
| DialogProps;
|
|
896
789
|
muiEditTextFieldProps?:
|
|
897
790
|
| ((props: {
|
|
@@ -901,27 +794,15 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
901
794
|
table: MRT_TableInstance<TData>;
|
|
902
795
|
}) => TextFieldProps)
|
|
903
796
|
| TextFieldProps;
|
|
904
|
-
muiExpandAllButtonProps?:
|
|
905
|
-
| ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps)
|
|
906
|
-
| IconButtonProps;
|
|
797
|
+
muiExpandAllButtonProps?: ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps) | IconButtonProps;
|
|
907
798
|
muiExpandButtonProps?:
|
|
908
|
-
| ((props: {
|
|
909
|
-
row: MRT_Row<TData>;
|
|
910
|
-
staticRowIndex?: number;
|
|
911
|
-
table: MRT_TableInstance<TData>;
|
|
912
|
-
}) => IconButtonProps)
|
|
799
|
+
| ((props: { row: MRT_Row<TData>; staticRowIndex?: number; table: MRT_TableInstance<TData> }) => IconButtonProps)
|
|
913
800
|
| IconButtonProps;
|
|
914
801
|
muiFilterAutocompleteProps?:
|
|
915
|
-
| ((props: {
|
|
916
|
-
|
|
917
|
-
table: MRT_TableInstance<TData>;
|
|
918
|
-
}) => AutocompleteProps<any, any, any, any>)
|
|
919
|
-
| AutocompleteProps<any, any, any, any>;
|
|
802
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => MRT_FilterAutocompleteProps)
|
|
803
|
+
| MRT_FilterAutocompleteProps;
|
|
920
804
|
muiFilterCheckboxProps?:
|
|
921
|
-
| ((props: {
|
|
922
|
-
column: MRT_Column<TData>;
|
|
923
|
-
table: MRT_TableInstance<TData>;
|
|
924
|
-
}) => CheckboxProps)
|
|
805
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => CheckboxProps)
|
|
925
806
|
| CheckboxProps;
|
|
926
807
|
muiFilterDatePickerProps?:
|
|
927
808
|
| ((props: {
|
|
@@ -938,10 +819,7 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
938
819
|
}) => DateTimePickerProps)
|
|
939
820
|
| DateTimePickerProps;
|
|
940
821
|
muiFilterSliderProps?:
|
|
941
|
-
| ((props: {
|
|
942
|
-
column: MRT_Column<TData>;
|
|
943
|
-
table: MRT_TableInstance<TData>;
|
|
944
|
-
}) => SliderProps)
|
|
822
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => SliderProps)
|
|
945
823
|
| SliderProps;
|
|
946
824
|
muiFilterTextFieldProps?:
|
|
947
825
|
| ((props: {
|
|
@@ -958,10 +836,7 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
958
836
|
}) => TimePickerProps)
|
|
959
837
|
| TimePickerProps;
|
|
960
838
|
muiLinearProgressProps?:
|
|
961
|
-
| ((props: {
|
|
962
|
-
isTopToolbar: boolean;
|
|
963
|
-
table: MRT_TableInstance<TData>;
|
|
964
|
-
}) => LinearProgressProps)
|
|
839
|
+
| ((props: { isTopToolbar: boolean; table: MRT_TableInstance<TData> }) => LinearProgressProps)
|
|
965
840
|
| LinearProgressProps;
|
|
966
841
|
muiPaginationProps?:
|
|
967
842
|
| ((props: { table: MRT_TableInstance<TData> }) => Partial<
|
|
@@ -981,17 +856,10 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
981
856
|
}
|
|
982
857
|
>;
|
|
983
858
|
muiRowDragHandleProps?:
|
|
984
|
-
| ((props: {
|
|
985
|
-
row: MRT_Row<TData>;
|
|
986
|
-
table: MRT_TableInstance<TData>;
|
|
987
|
-
}) => IconButtonProps)
|
|
859
|
+
| ((props: { row: MRT_Row<TData>; table: MRT_TableInstance<TData> }) => IconButtonProps)
|
|
988
860
|
| IconButtonProps;
|
|
989
|
-
muiSearchTextFieldProps?:
|
|
990
|
-
|
|
991
|
-
| TextFieldProps;
|
|
992
|
-
muiSelectAllCheckboxProps?:
|
|
993
|
-
| ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps)
|
|
994
|
-
| CheckboxProps;
|
|
861
|
+
muiSearchTextFieldProps?: ((props: { table: MRT_TableInstance<TData> }) => TextFieldProps) | TextFieldProps;
|
|
862
|
+
muiSelectAllCheckboxProps?: ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps) | CheckboxProps;
|
|
995
863
|
muiSelectCheckboxProps?:
|
|
996
864
|
| ((props: {
|
|
997
865
|
row: MRT_Row<TData>;
|
|
@@ -1015,9 +883,7 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
1015
883
|
table: MRT_TableInstance<TData>;
|
|
1016
884
|
}) => TableCellProps)
|
|
1017
885
|
| TableCellProps;
|
|
1018
|
-
muiTableBodyProps?:
|
|
1019
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps)
|
|
1020
|
-
| TableBodyProps;
|
|
886
|
+
muiTableBodyProps?: ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps) | TableBodyProps;
|
|
1021
887
|
muiTableBodyRowProps?:
|
|
1022
888
|
| ((props: {
|
|
1023
889
|
isDetailPanel?: boolean;
|
|
@@ -1026,81 +892,47 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
1026
892
|
table: MRT_TableInstance<TData>;
|
|
1027
893
|
}) => TableRowProps)
|
|
1028
894
|
| TableRowProps;
|
|
1029
|
-
muiTableContainerProps?:
|
|
1030
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps)
|
|
1031
|
-
| TableContainerProps;
|
|
895
|
+
muiTableContainerProps?: ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps) | TableContainerProps;
|
|
1032
896
|
muiTableFooterCellProps?:
|
|
1033
|
-
| ((props: {
|
|
1034
|
-
column: MRT_Column<TData>;
|
|
1035
|
-
table: MRT_TableInstance<TData>;
|
|
1036
|
-
}) => TableCellProps)
|
|
897
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => TableCellProps)
|
|
1037
898
|
| TableCellProps;
|
|
1038
|
-
muiTableFooterProps?:
|
|
1039
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps)
|
|
1040
|
-
| TableFooterProps;
|
|
899
|
+
muiTableFooterProps?: ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps) | TableFooterProps;
|
|
1041
900
|
muiTableFooterRowProps?:
|
|
1042
|
-
| ((props: {
|
|
1043
|
-
footerGroup: MRT_HeaderGroup<TData>;
|
|
1044
|
-
table: MRT_TableInstance<TData>;
|
|
1045
|
-
}) => TableRowProps)
|
|
901
|
+
| ((props: { footerGroup: MRT_HeaderGroup<TData>; table: MRT_TableInstance<TData> }) => TableRowProps)
|
|
1046
902
|
| TableRowProps;
|
|
1047
903
|
muiTableHeadCellProps?:
|
|
1048
|
-
| ((props: {
|
|
1049
|
-
column: MRT_Column<TData>;
|
|
1050
|
-
table: MRT_TableInstance<TData>;
|
|
1051
|
-
}) => TableCellProps)
|
|
904
|
+
| ((props: { column: MRT_Column<TData>; table: MRT_TableInstance<TData> }) => TableCellProps)
|
|
1052
905
|
| TableCellProps;
|
|
1053
|
-
muiTableHeadProps?:
|
|
1054
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps)
|
|
1055
|
-
| TableHeadProps;
|
|
906
|
+
muiTableHeadProps?: ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps) | TableHeadProps;
|
|
1056
907
|
muiTableHeadRowProps?:
|
|
1057
|
-
| ((props: {
|
|
1058
|
-
headerGroup: MRT_HeaderGroup<TData>;
|
|
1059
|
-
table: MRT_TableInstance<TData>;
|
|
1060
|
-
}) => TableRowProps)
|
|
908
|
+
| ((props: { headerGroup: MRT_HeaderGroup<TData>; table: MRT_TableInstance<TData> }) => TableRowProps)
|
|
1061
909
|
| TableRowProps;
|
|
1062
|
-
muiTablePaperProps?:
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
| TableProps;
|
|
1068
|
-
muiToolbarAlertBannerChipProps?:
|
|
1069
|
-
| ((props: { table: MRT_TableInstance<TData> }) => ChipProps)
|
|
1070
|
-
| ChipProps;
|
|
1071
|
-
muiToolbarAlertBannerProps?:
|
|
1072
|
-
| ((props: { table: MRT_TableInstance<TData> }) => AlertProps)
|
|
1073
|
-
| AlertProps;
|
|
1074
|
-
muiTopToolbarProps?:
|
|
1075
|
-
| ((props: { table: MRT_TableInstance<TData> }) => BoxProps)
|
|
1076
|
-
| BoxProps;
|
|
910
|
+
muiTablePaperProps?: ((props: { table: MRT_TableInstance<TData> }) => PaperProps) | PaperProps;
|
|
911
|
+
muiTableProps?: ((props: { table: MRT_TableInstance<TData> }) => TableProps) | TableProps;
|
|
912
|
+
muiToolbarAlertBannerChipProps?: ((props: { table: MRT_TableInstance<TData> }) => ChipProps) | ChipProps;
|
|
913
|
+
muiToolbarAlertBannerProps?: ((props: { table: MRT_TableInstance<TData> }) => AlertProps) | AlertProps;
|
|
914
|
+
muiTopToolbarProps?: ((props: { table: MRT_TableInstance<TData> }) => BoxProps) | BoxProps;
|
|
1077
915
|
onActionCellChange?: OnChangeFn<MRT_Cell<TData> | null>;
|
|
1078
916
|
onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
|
|
1079
|
-
onCreatingRowCancel?: (props: {
|
|
1080
|
-
row: MRT_Row<TData>;
|
|
1081
|
-
table: MRT_TableInstance<TData>;
|
|
1082
|
-
}) => void;
|
|
917
|
+
onCreatingRowCancel?: (props: { row: MRT_Row<TData>; table: MRT_TableInstance<TData> }) => void;
|
|
1083
918
|
onCreatingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
1084
919
|
onCreatingRowSave?: (props: {
|
|
1085
920
|
exitCreatingMode: () => void;
|
|
1086
921
|
row: MRT_Row<TData>;
|
|
1087
922
|
table: MRT_TableInstance<TData>;
|
|
1088
|
-
values:
|
|
923
|
+
values: MRT_EditValues<TData>;
|
|
1089
924
|
}) => Promise<void> | void;
|
|
1090
925
|
onDensityChange?: OnChangeFn<MRT_DensityState>;
|
|
1091
926
|
onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
|
|
1092
927
|
onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
1093
928
|
onEditingCellChange?: OnChangeFn<MRT_Cell<TData> | null>;
|
|
1094
|
-
onEditingRowCancel?: (props: {
|
|
1095
|
-
row: MRT_Row<TData>;
|
|
1096
|
-
table: MRT_TableInstance<TData>;
|
|
1097
|
-
}) => void;
|
|
929
|
+
onEditingRowCancel?: (props: { row: MRT_Row<TData>; table: MRT_TableInstance<TData> }) => void;
|
|
1098
930
|
onEditingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
1099
931
|
onEditingRowSave?: (props: {
|
|
1100
932
|
exitEditingMode: () => void;
|
|
1101
933
|
row: MRT_Row<TData>;
|
|
1102
934
|
table: MRT_TableInstance<TData>;
|
|
1103
|
-
values:
|
|
935
|
+
values: MRT_EditValues<TData>;
|
|
1104
936
|
}) => Promise<void> | void;
|
|
1105
937
|
onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
|
|
1106
938
|
onHoveredColumnChange?: OnChangeFn<null | Partial<MRT_Column<TData>>>;
|
|
@@ -1118,15 +950,9 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
1118
950
|
positionPagination?: 'both' | 'bottom' | 'none' | 'top';
|
|
1119
951
|
positionToolbarAlertBanner?: 'bottom' | 'head-overlay' | 'none' | 'top';
|
|
1120
952
|
positionToolbarDropZone?: 'both' | 'bottom' | 'none' | 'top';
|
|
1121
|
-
renderBottomToolbar?:
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
renderBottomToolbarCustomActions?: (props: {
|
|
1125
|
-
table: MRT_TableInstance<TData>;
|
|
1126
|
-
}) => ReactNode;
|
|
1127
|
-
renderCaption?:
|
|
1128
|
-
| ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
|
|
1129
|
-
| ReactNode;
|
|
953
|
+
renderBottomToolbar?: ((props: { table: MRT_TableInstance<TData> }) => ReactNode) | ReactNode;
|
|
954
|
+
renderBottomToolbarCustomActions?: (props: { table: MRT_TableInstance<TData> }) => ReactNode;
|
|
955
|
+
renderCaption?: ((props: { table: MRT_TableInstance<TData> }) => ReactNode) | ReactNode;
|
|
1130
956
|
renderCellActionMenuItems?: (props: {
|
|
1131
957
|
cell: MRT_Cell<TData>;
|
|
1132
958
|
closeMenu: () => void;
|
|
@@ -1154,18 +980,13 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
1154
980
|
row: MRT_Row<TData>;
|
|
1155
981
|
table: MRT_TableInstance<TData>;
|
|
1156
982
|
}) => ReactNode;
|
|
1157
|
-
renderDetailPanel?: (props: {
|
|
1158
|
-
row: MRT_Row<TData>;
|
|
1159
|
-
table: MRT_TableInstance<TData>;
|
|
1160
|
-
}) => ReactNode;
|
|
983
|
+
renderDetailPanel?: (props: { row: MRT_Row<TData>; table: MRT_TableInstance<TData> }) => ReactNode;
|
|
1161
984
|
renderEditRowDialogContent?: (props: {
|
|
1162
985
|
internalEditComponents: ReactNode[];
|
|
1163
986
|
row: MRT_Row<TData>;
|
|
1164
987
|
table: MRT_TableInstance<TData>;
|
|
1165
988
|
}) => ReactNode;
|
|
1166
|
-
renderEmptyRowsFallback?: (props: {
|
|
1167
|
-
table: MRT_TableInstance<TData>;
|
|
1168
|
-
}) => ReactNode;
|
|
989
|
+
renderEmptyRowsFallback?: (props: { table: MRT_TableInstance<TData> }) => ReactNode;
|
|
1169
990
|
renderGlobalFilterModeMenuItems?: (props: {
|
|
1170
991
|
internalFilterOptions: MRT_InternalFilterOption[];
|
|
1171
992
|
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
@@ -1188,15 +1009,9 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
1188
1009
|
selectedAlert: null | ReactNode;
|
|
1189
1010
|
table: MRT_TableInstance<TData>;
|
|
1190
1011
|
}) => ReactNode;
|
|
1191
|
-
renderToolbarInternalActions?: (props: {
|
|
1192
|
-
|
|
1193
|
-
}) => ReactNode;
|
|
1194
|
-
renderTopToolbar?:
|
|
1195
|
-
| ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
|
|
1196
|
-
| ReactNode;
|
|
1197
|
-
renderTopToolbarCustomActions?: (props: {
|
|
1198
|
-
table: MRT_TableInstance<TData>;
|
|
1199
|
-
}) => ReactNode;
|
|
1012
|
+
renderToolbarInternalActions?: (props: { table: MRT_TableInstance<TData> }) => ReactNode;
|
|
1013
|
+
renderTopToolbar?: ((props: { table: MRT_TableInstance<TData> }) => ReactNode) | ReactNode;
|
|
1014
|
+
renderTopToolbarCustomActions?: (props: { table: MRT_TableInstance<TData> }) => ReactNode;
|
|
1200
1015
|
rowNumberDisplayMode?: 'original' | 'static';
|
|
1201
1016
|
rowPinningDisplayMode?:
|
|
1202
1017
|
| 'bottom'
|
|
@@ -1208,16 +1023,10 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
|
|
|
1208
1023
|
| 'top-and-bottom';
|
|
1209
1024
|
rowVirtualizerInstanceRef?: RefObject<MRT_RowVirtualizer | null>;
|
|
1210
1025
|
rowVirtualizerOptions?:
|
|
1211
|
-
| ((props: {
|
|
1212
|
-
table: MRT_TableInstance<TData>;
|
|
1213
|
-
}) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>)
|
|
1026
|
+
| ((props: { table: MRT_TableInstance<TData> }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>)
|
|
1214
1027
|
| Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
|
|
1215
1028
|
selectAllMode?: 'all' | 'page';
|
|
1216
|
-
|
|
1217
|
-
* Custom sort functions, registered by name so column defs can select them
|
|
1218
|
-
* with `sortFn: 'myFn'`.
|
|
1219
|
-
*/
|
|
1220
|
-
sortFns?: Record<string, SortFn<any, TData>>;
|
|
1029
|
+
sortFns?: Record<string, SortFn<MRT_TableFeatures, TData>>;
|
|
1221
1030
|
/**
|
|
1222
1031
|
* Manage state externally any way you want, then pass it back into MRT.
|
|
1223
1032
|
*/
|
|
@@ -1256,7 +1065,7 @@ export type MRT_TableState<TData extends MRT_RowData> = Omit<
|
|
|
1256
1065
|
showProgressBars: boolean;
|
|
1257
1066
|
showSkeletons: boolean;
|
|
1258
1067
|
showToolbarDropZone: boolean;
|
|
1259
|
-
}
|
|
1068
|
+
};
|
|
1260
1069
|
|
|
1261
1070
|
export interface MRT_Theme {
|
|
1262
1071
|
baseBackgroundColor: string;
|
|
@@ -1281,22 +1090,20 @@ export type MRT_VisibilityState = ColumnVisibilityState;
|
|
|
1281
1090
|
|
|
1282
1091
|
export type Prettify<T> = unknown & { [K in keyof T]: T[K] };
|
|
1283
1092
|
|
|
1284
|
-
export type Xor<A, B> =
|
|
1285
|
-
| Prettify<A & { [k in keyof B]?: never }>
|
|
1286
|
-
| Prettify<B & { [k in keyof A]?: never }>;
|
|
1093
|
+
export type Xor<A, B> = Prettify<A & { [k in keyof B]?: never }> | Prettify<B & { [k in keyof A]?: never }>;
|
|
1287
1094
|
|
|
1288
1095
|
interface MRT_StateExtras {
|
|
1289
|
-
actionCell?:
|
|
1096
|
+
actionCell?: unknown;
|
|
1290
1097
|
columnFilterFns: MRT_ColumnFilterFnsState;
|
|
1291
|
-
creatingRow:
|
|
1098
|
+
creatingRow: unknown;
|
|
1292
1099
|
density: MRT_DensityState;
|
|
1293
|
-
draggingColumn:
|
|
1294
|
-
draggingRow:
|
|
1295
|
-
editingCell:
|
|
1296
|
-
editingRow:
|
|
1100
|
+
draggingColumn: unknown;
|
|
1101
|
+
draggingRow: unknown;
|
|
1102
|
+
editingCell: unknown;
|
|
1103
|
+
editingRow: unknown;
|
|
1297
1104
|
globalFilterFn: MRT_FilterOption;
|
|
1298
|
-
hoveredColumn:
|
|
1299
|
-
hoveredRow:
|
|
1105
|
+
hoveredColumn: unknown;
|
|
1106
|
+
hoveredRow: unknown;
|
|
1300
1107
|
isFullScreen: boolean;
|
|
1301
1108
|
isLoading: boolean;
|
|
1302
1109
|
isSaving: boolean;
|