material-react-table 2.0.0-alpha.1 → 2.0.0-alpha.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.
Files changed (143) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/index.js +2408 -2334
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/MaterialReactTable.d.ts +1 -1
  5. package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
  6. package/dist/cjs/types/buttons/MRT_RowPinButton.d.ts +2 -2
  7. package/dist/cjs/types/column.utils.d.ts +6 -6
  8. package/dist/cjs/types/filterFns.d.ts +14 -14
  9. package/dist/cjs/types/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  10. package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  11. package/dist/cjs/types/hooks/useMRT_DisplayColumns.d.ts +3 -3
  12. package/dist/cjs/types/icons.d.ts +1 -1
  13. package/dist/cjs/types/inputs/MRT_FilterRangeSlider.d.ts +1 -1
  14. package/dist/cjs/types/locales/np.d.ts +2 -0
  15. package/dist/cjs/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
  16. package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  17. package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -2
  18. package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +1 -1
  19. package/dist/cjs/types/types.d.ts +217 -197
  20. package/dist/esm/material-react-table.esm.js +2311 -2239
  21. package/dist/esm/material-react-table.esm.js.map +1 -1
  22. package/dist/esm/types/MaterialReactTable.d.ts +1 -1
  23. package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
  24. package/dist/esm/types/buttons/MRT_RowPinButton.d.ts +2 -2
  25. package/dist/esm/types/column.utils.d.ts +6 -6
  26. package/dist/esm/types/filterFns.d.ts +14 -14
  27. package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  28. package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  29. package/dist/esm/types/hooks/useMRT_DisplayColumns.d.ts +3 -3
  30. package/dist/esm/types/icons.d.ts +1 -1
  31. package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +1 -1
  32. package/dist/esm/types/locales/np.d.ts +2 -0
  33. package/dist/esm/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
  34. package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  35. package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -2
  36. package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +1 -1
  37. package/dist/esm/types/types.d.ts +217 -197
  38. package/dist/index.d.ts +258 -238
  39. package/locales/fr.esm.js +1 -1
  40. package/locales/fr.esm.js.map +1 -1
  41. package/locales/fr.js +1 -1
  42. package/locales/fr.js.map +1 -1
  43. package/locales/np.d.ts +2 -0
  44. package/locales/np.esm.d.ts +2 -0
  45. package/locales/np.esm.js +94 -0
  46. package/locales/np.esm.js.map +1 -0
  47. package/locales/np.js +98 -0
  48. package/locales/np.js.map +1 -0
  49. package/locales/tr.d.ts +2 -0
  50. package/locales/tr.esm.d.ts +2 -0
  51. package/locales/tr.esm.js +93 -0
  52. package/locales/tr.esm.js.map +1 -0
  53. package/locales/tr.js +97 -0
  54. package/locales/tr.js.map +1 -0
  55. package/locales/uk.d.ts +2 -0
  56. package/locales/uk.esm.d.ts +2 -0
  57. package/locales/uk.esm.js +93 -0
  58. package/locales/uk.esm.js.map +1 -0
  59. package/locales/uk.js +97 -0
  60. package/locales/uk.js.map +1 -0
  61. package/locales/vi.d.ts +2 -0
  62. package/locales/vi.esm.d.ts +2 -0
  63. package/locales/vi.esm.js +93 -0
  64. package/locales/vi.esm.js.map +1 -0
  65. package/locales/vi.js +97 -0
  66. package/locales/vi.js.map +1 -0
  67. package/locales/zh-Hans.d.ts +2 -0
  68. package/locales/zh-Hans.esm.d.ts +2 -0
  69. package/locales/zh-Hans.esm.js +93 -0
  70. package/locales/zh-Hans.esm.js.map +1 -0
  71. package/locales/zh-Hans.js +97 -0
  72. package/locales/zh-Hans.js.map +1 -0
  73. package/locales/zh-Hant.d.ts +2 -0
  74. package/locales/zh-Hant.esm.d.ts +2 -0
  75. package/locales/zh-Hant.esm.js +93 -0
  76. package/locales/zh-Hant.esm.js.map +1 -0
  77. package/locales/zh-Hant.js +97 -0
  78. package/locales/zh-Hant.js.map +1 -0
  79. package/package.json +27 -26
  80. package/src/MaterialReactTable.tsx +2 -2
  81. package/src/body/MRT_TableBody.tsx +9 -9
  82. package/src/body/MRT_TableBodyCell.tsx +22 -22
  83. package/src/body/MRT_TableBodyCellValue.tsx +5 -5
  84. package/src/body/MRT_TableBodyRow.tsx +32 -32
  85. package/src/body/MRT_TableBodyRowGrabHandle.tsx +2 -2
  86. package/src/body/MRT_TableBodyRowPinButton.tsx +3 -3
  87. package/src/body/MRT_TableDetailPanel.tsx +3 -3
  88. package/src/buttons/MRT_CopyButton.tsx +1 -1
  89. package/src/buttons/MRT_EditActionButtons.tsx +4 -4
  90. package/src/buttons/MRT_ExpandAllButton.tsx +3 -3
  91. package/src/buttons/MRT_ExpandButton.tsx +1 -1
  92. package/src/buttons/MRT_GrabHandleButton.tsx +10 -10
  93. package/src/buttons/MRT_RowPinButton.tsx +5 -5
  94. package/src/buttons/MRT_ShowHideColumnsButton.tsx +1 -1
  95. package/src/buttons/MRT_ToggleFullScreenButton.tsx +2 -2
  96. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +8 -8
  97. package/src/column.utils.ts +24 -22
  98. package/src/filterFns.ts +29 -29
  99. package/src/footer/MRT_TableFooter.tsx +9 -9
  100. package/src/footer/MRT_TableFooterCell.tsx +1 -1
  101. package/src/footer/MRT_TableFooterRow.tsx +2 -2
  102. package/src/head/MRT_TableHead.tsx +9 -9
  103. package/src/head/MRT_TableHeadCell.tsx +10 -6
  104. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +9 -6
  105. package/src/head/MRT_TableHeadCellFilterContainer.tsx +12 -5
  106. package/src/head/MRT_TableHeadCellFilterLabel.tsx +106 -61
  107. package/src/head/MRT_TableHeadCellGrabHandle.tsx +2 -2
  108. package/src/head/MRT_TableHeadCellResizeHandle.tsx +11 -11
  109. package/src/head/MRT_TableHeadCellSortLabel.tsx +8 -8
  110. package/src/head/MRT_TableHeadRow.tsx +2 -2
  111. package/src/hooks/useMRT_DisplayColumns.tsx +5 -5
  112. package/src/hooks/useMRT_Effects.ts +3 -3
  113. package/src/hooks/useMRT_TableInstance.ts +15 -14
  114. package/src/hooks/useMRT_TableOptions.ts +3 -3
  115. package/src/icons.ts +2 -2
  116. package/src/inputs/MRT_EditCellTextField.tsx +9 -9
  117. package/src/inputs/MRT_FilterCheckbox.tsx +7 -7
  118. package/src/inputs/MRT_FilterRangeFields.tsx +1 -1
  119. package/src/inputs/MRT_FilterRangeSlider.tsx +6 -6
  120. package/src/inputs/MRT_FilterTextField.tsx +309 -230
  121. package/src/inputs/MRT_GlobalFilterTextField.tsx +26 -26
  122. package/src/inputs/MRT_SelectCheckbox.tsx +7 -7
  123. package/src/locales/fr.ts +1 -1
  124. package/src/locales/np.ts +94 -0
  125. package/src/menus/MRT_ColumnActionMenu.tsx +48 -45
  126. package/src/menus/MRT_FilterOptionMenu.tsx +36 -36
  127. package/src/menus/MRT_RowActionMenu.tsx +7 -7
  128. package/src/menus/MRT_ShowHideColumnsMenu.tsx +6 -6
  129. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +5 -5
  130. package/src/modals/MRT_EditRowModal.tsx +8 -8
  131. package/src/sortingFns.ts +1 -1
  132. package/src/table/MRT_Table.tsx +7 -7
  133. package/src/table/MRT_TableContainer.tsx +10 -10
  134. package/src/table/MRT_TablePaper.tsx +9 -9
  135. package/src/toolbar/MRT_BottomToolbar.tsx +5 -5
  136. package/src/toolbar/MRT_LinearProgressBar.tsx +4 -4
  137. package/src/toolbar/MRT_TablePagination.tsx +19 -19
  138. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +4 -4
  139. package/src/toolbar/MRT_ToolbarDropZone.tsx +6 -6
  140. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +8 -5
  141. package/src/toolbar/MRT_TopToolbar.tsx +7 -7
  142. package/src/types.ts +288 -257
  143. package/src/useMaterialReactTable.ts +1 -1
@@ -1,4 +1,7 @@
1
1
  import { type Dispatch, type MutableRefObject, type ReactNode, type RefObject, type SetStateAction } from 'react';
2
+ import { type AggregationFn, type Cell, type Column, type ColumnDef, type ColumnFiltersState, type ColumnOrderState, type ColumnPinningState, type ColumnSizingInfoState, type ColumnSizingState, type DeepKeys, type ExpandedState, type FilterFn, type GroupingState, type Header, type HeaderGroup, type OnChangeFn, type PaginationState, type Row, type RowSelectionState, type SortingFn, type SortingState, type Table, type TableOptions, type TableState, type Updater, type VisibilityState } from '@tanstack/react-table';
3
+ import { type VirtualItem, type Virtualizer, type VirtualizerOptions } from '@tanstack/react-virtual';
4
+ import { type AutocompleteProps } from '@mui/material';
2
5
  import { type AlertProps } from '@mui/material/Alert';
3
6
  import { type ButtonProps } from '@mui/material/Button';
4
7
  import { type CheckboxProps } from '@mui/material/Checkbox';
@@ -10,22 +13,21 @@ import { type PaperProps } from '@mui/material/Paper';
10
13
  import { type RadioProps } from '@mui/material/Radio';
11
14
  import { type SkeletonProps } from '@mui/material/Skeleton';
12
15
  import { type SliderProps } from '@mui/material/Slider';
16
+ import { type TableProps } from '@mui/material/Table';
13
17
  import { type TableBodyProps } from '@mui/material/TableBody';
14
18
  import { type TableCellProps } from '@mui/material/TableCell';
15
19
  import { type TableContainerProps } from '@mui/material/TableContainer';
16
20
  import { type TableFooterProps } from '@mui/material/TableFooter';
17
21
  import { type TableHeadProps } from '@mui/material/TableHead';
18
22
  import { type TablePaginationProps } from '@mui/material/TablePagination';
19
- import { type TableProps } from '@mui/material/Table';
20
23
  import { type TableRowProps } from '@mui/material/TableRow';
21
24
  import { type TextFieldProps } from '@mui/material/TextField';
22
25
  import { type ToolbarProps } from '@mui/material/Toolbar';
23
- import { type AggregationFn, type Cell, type Column, type ColumnDef, type ColumnFiltersState, type ColumnOrderState, type ColumnPinningState, type ColumnSizingInfoState, type ColumnSizingState, type DeepKeys, type ExpandedState, type FilterFn, type GroupingState, type Header, type HeaderGroup, type OnChangeFn, type PaginationState, type Row, type RowSelectionState, type SortingFn, type SortingState, type Table, type TableOptions, type TableState, type Updater, type VisibilityState } from '@tanstack/react-table';
24
- import { type VirtualizerOptions, type Virtualizer, type VirtualItem } from '@tanstack/react-virtual';
26
+ import { type DatePickerProps } from '@mui/x-date-pickers';
25
27
  import { type MRT_AggregationFns } from './aggregationFns';
26
28
  import { type MRT_FilterFns } from './filterFns';
27
- import { type MRT_SortingFns } from './sortingFns';
28
29
  import { type MRT_Icons } from './icons';
30
+ import { type MRT_SortingFns } from './sortingFns';
29
31
  export type { MRT_Icons };
30
32
  export type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
31
33
  export type Prettify<T> = {
@@ -71,10 +73,9 @@ export interface MRT_Localization {
71
73
  filterFuzzy: string;
72
74
  filterGreaterThan: string;
73
75
  filterGreaterThanOrEqualTo: string;
76
+ filterInNumberRange: string;
74
77
  filterIncludesString: string;
75
78
  filterIncludesStringSensitive: string;
76
- filteringByColumn: string;
77
- filterInNumberRange: string;
78
79
  filterLessThan: string;
79
80
  filterLessThanOrEqualTo: string;
80
81
  filterMode: string;
@@ -82,6 +83,7 @@ export interface MRT_Localization {
82
83
  filterNotEquals: string;
83
84
  filterStartsWith: string;
84
85
  filterWeakEquals: string;
86
+ filteringByColumn: string;
85
87
  goToFirstPage: string;
86
88
  goToLastPage: string;
87
89
  goToNextPage: string;
@@ -164,26 +166,26 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<Table<TD
164
166
  filterInputRefs: MutableRefObject<Record<string, HTMLInputElement>>;
165
167
  searchInputRef: MutableRefObject<HTMLInputElement>;
166
168
  tableContainerRef: MutableRefObject<HTMLDivElement>;
169
+ tableFooterRef: MutableRefObject<HTMLTableSectionElement>;
167
170
  tableHeadCellRefs: MutableRefObject<Record<string, HTMLTableCellElement>>;
171
+ tableHeadRef: MutableRefObject<HTMLTableSectionElement>;
168
172
  tablePaperRef: MutableRefObject<HTMLDivElement>;
169
173
  topToolbarRef: MutableRefObject<HTMLDivElement>;
170
- tableHeadRef: MutableRefObject<HTMLTableSectionElement>;
171
- tableFooterRef: MutableRefObject<HTMLTableSectionElement>;
172
174
  };
173
- setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
174
175
  setColumnFilterFns: Dispatch<SetStateAction<MRT_ColumnFilterFnsState>>;
176
+ setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
175
177
  setDensity: Dispatch<SetStateAction<MRT_DensityState>>;
176
178
  setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
177
179
  setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
178
180
  setEditingCell: Dispatch<SetStateAction<MRT_Cell<TData> | null>>;
179
181
  setEditingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
180
182
  setGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
181
- setHoveredColumn: Dispatch<SetStateAction<MRT_Column<TData> | {
183
+ setHoveredColumn: Dispatch<SetStateAction<{
182
184
  id: string;
183
- } | null>>;
184
- setHoveredRow: Dispatch<SetStateAction<MRT_Row<TData> | {
185
+ } | MRT_Column<TData> | null>>;
186
+ setHoveredRow: Dispatch<SetStateAction<{
185
187
  id: string;
186
- } | null>>;
188
+ } | MRT_Row<TData> | null>>;
187
189
  setIsFullScreen: Dispatch<SetStateAction<boolean>>;
188
190
  setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
189
191
  setShowColumnFilters: Dispatch<SetStateAction<boolean>>;
@@ -191,8 +193,8 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<Table<TD
191
193
  setShowToolbarDropZone: Dispatch<SetStateAction<boolean>>;
192
194
  };
193
195
  export type MRT_DefinedTableOptions<TData extends Record<string, any>> = MRT_TableOptions<TData> & {
194
- localization: MRT_Localization;
195
196
  icons: MRT_Icons;
197
+ localization: MRT_Localization;
196
198
  };
197
199
  export type MRT_TableState<TData extends Record<string, any>> = TableState & {
198
200
  columnFilterFns: MRT_ColumnFilterFnsState;
@@ -203,12 +205,12 @@ export type MRT_TableState<TData extends Record<string, any>> = TableState & {
203
205
  editingCell: MRT_Cell<TData> | null;
204
206
  editingRow: MRT_Row<TData> | null;
205
207
  globalFilterFn: MRT_FilterOption;
206
- hoveredColumn: MRT_Column<TData> | {
208
+ hoveredColumn: {
207
209
  id: string;
208
- } | null;
209
- hoveredRow: MRT_Row<TData> | {
210
+ } | MRT_Column<TData> | null;
211
+ hoveredRow: {
210
212
  id: string;
211
- } | null;
213
+ } | MRT_Row<TData> | null;
212
214
  isFullScreen: boolean;
213
215
  isLoading: boolean;
214
216
  isSaving: boolean;
@@ -228,8 +230,8 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TD
228
230
  }) => ReactNode;
229
231
  Cell?: (props: {
230
232
  cell: MRT_Cell<TData>;
231
- renderedCellValue: number | string | ReactNode;
232
233
  column: MRT_Column<TData>;
234
+ renderedCellValue: ReactNode | number | string;
233
235
  row: MRT_Row<TData>;
234
236
  rowRef?: RefObject<HTMLTableRowElement>;
235
237
  table: MRT_TableInstance<TData>;
@@ -246,22 +248,22 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TD
246
248
  rangeFilterIndex?: number;
247
249
  table: MRT_TableInstance<TData>;
248
250
  }) => ReactNode;
249
- Footer?: ReactNode | ((props: {
251
+ Footer?: ((props: {
250
252
  column: MRT_Column<TData>;
251
253
  footer: MRT_Header<TData>;
252
254
  table: MRT_TableInstance<TData>;
253
- }) => ReactNode);
255
+ }) => ReactNode) | ReactNode;
254
256
  GroupedCell?: (props: {
255
257
  cell: MRT_Cell<TData>;
256
258
  column: MRT_Column<TData>;
257
259
  row: MRT_Row<TData>;
258
260
  table: MRT_TableInstance<TData>;
259
261
  }) => ReactNode;
260
- Header?: ReactNode | ((props: {
262
+ Header?: ((props: {
261
263
  column: MRT_Column<TData>;
262
264
  header: MRT_Header<TData>;
263
265
  table: MRT_TableInstance<TData>;
264
- }) => ReactNode);
266
+ }) => ReactNode) | ReactNode;
265
267
  PlaceholderCell?: (props: {
266
268
  cell: MRT_Cell<TData>;
267
269
  column: MRT_Column<TData>;
@@ -283,8 +285,8 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TD
283
285
  * @example accessorKey: 'username' //simple
284
286
  * @example accessorKey: 'name.firstName' //deep key dot notation
285
287
  */
286
- accessorKey?: (string & {}) | DeepKeys<TData>;
287
- aggregationFn?: MRT_AggregationFn<TData> | Array<MRT_AggregationFn<TData>>;
288
+ accessorKey?: DeepKeys<TData> | (string & {});
289
+ aggregationFn?: Array<MRT_AggregationFn<TData>> | MRT_AggregationFn<TData>;
288
290
  /**
289
291
  * Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
290
292
  * Leave this blank if you are just creating a normal data column.
@@ -296,24 +298,24 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TD
296
298
  columnDefType?: 'data' | 'display' | 'group';
297
299
  columnFilterModeOptions?: Array<LiteralUnion<string & MRT_FilterOption>> | null;
298
300
  columns?: MRT_ColumnDef<TData>[];
299
- editSelectOptions?: (string | {
301
+ editSelectOptions?: ({
300
302
  text: string;
301
303
  value: any;
302
- })[];
303
- editVariant?: 'text' | 'select';
304
+ } | string)[];
305
+ editVariant?: 'select' | 'text';
304
306
  enableClickToCopy?: boolean;
305
307
  enableColumnActions?: boolean;
306
308
  enableColumnDragging?: boolean;
307
309
  enableColumnFilterModes?: boolean;
308
310
  enableColumnOrdering?: boolean;
309
- enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
311
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
310
312
  enableFilterMatchHighlighting?: boolean;
311
313
  filterFn?: MRT_FilterFn<TData>;
312
- filterSelectOptions?: (string | {
314
+ filterSelectOptions?: ({
313
315
  text: string;
314
316
  value: any;
315
- })[];
316
- filterVariant?: 'checkbox' | 'multi-select' | 'range' | 'range-slider' | 'select' | 'text';
317
+ } | string)[];
318
+ filterVariant?: 'autocomplete' | 'checkbox' | 'date' | 'date-range' | 'multi-select' | 'range' | 'range-slider' | 'select' | 'text';
317
319
  /**
318
320
  * footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
319
321
  */
@@ -332,53 +334,62 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TD
332
334
  * @default gets set to the same value as `accessorKey` by default
333
335
  */
334
336
  id?: LiteralUnion<string & keyof TData>;
335
- muiCopyButtonProps?: ButtonProps | ((props: {
336
- cell: MRT_Cell<TData>;
337
+ muiColumnActionsButtonProps?: ((props: {
338
+ column: MRT_Column<TData>;
339
+ table: MRT_TableInstance<TData>;
340
+ }) => IconButtonProps) | IconButtonProps;
341
+ muiColumnDragHandleProps?: ((props: {
337
342
  column: MRT_Column<TData>;
338
- row: MRT_Row<TData>;
339
343
  table: MRT_TableInstance<TData>;
340
- }) => ButtonProps);
341
- muiEditTextFieldProps?: TextFieldProps | ((props: {
344
+ }) => IconButtonProps) | IconButtonProps;
345
+ muiCopyButtonProps?: ((props: {
342
346
  cell: MRT_Cell<TData>;
343
347
  column: MRT_Column<TData>;
344
348
  row: MRT_Row<TData>;
345
349
  table: MRT_TableInstance<TData>;
346
- }) => TextFieldProps);
347
- muiTableBodyCellProps?: TableCellProps | ((props: {
350
+ }) => ButtonProps) | ButtonProps;
351
+ muiEditTextFieldProps?: ((props: {
348
352
  cell: MRT_Cell<TData>;
349
353
  column: MRT_Column<TData>;
350
354
  row: MRT_Row<TData>;
351
355
  table: MRT_TableInstance<TData>;
352
- }) => TableCellProps);
353
- muiTableFooterCellProps?: TableCellProps | ((props: {
354
- table: MRT_TableInstance<TData>;
356
+ }) => TextFieldProps) | TextFieldProps;
357
+ muiFilterAutocompleteProps?: ((props: {
355
358
  column: MRT_Column<TData>;
356
- }) => TableCellProps);
357
- muiColumnActionsButtonProps?: IconButtonProps | ((props: {
358
359
  table: MRT_TableInstance<TData>;
360
+ }) => AutocompleteProps<any, any, any, any>) | AutocompleteProps<any, any, any, any>;
361
+ muiFilterCheckboxProps?: ((props: {
359
362
  column: MRT_Column<TData>;
360
- }) => IconButtonProps);
361
- muiColumnDragHandleProps?: IconButtonProps | ((props: {
362
363
  table: MRT_TableInstance<TData>;
364
+ }) => CheckboxProps) | CheckboxProps;
365
+ muiFilterDatePickerProps?: ((props: {
363
366
  column: MRT_Column<TData>;
364
- }) => IconButtonProps);
365
- muiFilterCheckboxProps?: CheckboxProps | ((props: {
366
- column: MRT_Column<TData>;
367
+ rangeFilterIndex?: number;
367
368
  table: MRT_TableInstance<TData>;
368
- }) => CheckboxProps);
369
- muiFilterTextFieldProps?: TextFieldProps | ((props: {
369
+ }) => DatePickerProps<any>) | DatePickerProps<any>;
370
+ muiFilterSliderProps?: ((props: {
371
+ column: MRT_Column<TData>;
370
372
  table: MRT_TableInstance<TData>;
373
+ }) => SliderProps) | SliderProps;
374
+ muiFilterTextFieldProps?: ((props: {
371
375
  column: MRT_Column<TData>;
372
376
  rangeFilterIndex?: number;
373
- }) => TextFieldProps);
374
- muiFilterSliderProps?: SliderProps | ((props: {
375
377
  table: MRT_TableInstance<TData>;
378
+ }) => TextFieldProps) | TextFieldProps;
379
+ muiTableBodyCellProps?: ((props: {
380
+ cell: MRT_Cell<TData>;
381
+ column: MRT_Column<TData>;
382
+ row: MRT_Row<TData>;
383
+ table: MRT_TableInstance<TData>;
384
+ }) => TableCellProps) | TableCellProps;
385
+ muiTableFooterCellProps?: ((props: {
376
386
  column: MRT_Column<TData>;
377
- }) => SliderProps);
378
- muiTableHeadCellProps?: TableCellProps | ((props: {
379
387
  table: MRT_TableInstance<TData>;
388
+ }) => TableCellProps) | TableCellProps;
389
+ muiTableHeadCellProps?: ((props: {
380
390
  column: MRT_Column<TData>;
381
- }) => TableCellProps);
391
+ table: MRT_TableInstance<TData>;
392
+ }) => TableCellProps) | TableCellProps;
382
393
  renderColumnActionsMenuItems?: (props: {
383
394
  closeMenu: () => void;
384
395
  column: MRT_Column<TData>;
@@ -393,12 +404,12 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TD
393
404
  }) => ReactNode[];
394
405
  sortingFn?: MRT_SortingFn<TData>;
395
406
  };
396
- export type MRT_DefinedColumnDef<TData extends Record<string, any>> = Omit<MRT_ColumnDef<TData>, 'id' | 'defaultDisplayColumn'> & {
407
+ export type MRT_DefinedColumnDef<TData extends Record<string, any>> = Omit<MRT_ColumnDef<TData>, 'defaultDisplayColumn' | 'id'> & {
408
+ _filterFn: MRT_FilterOption;
397
409
  defaultDisplayColumn: Partial<MRT_ColumnDef<TData>>;
398
410
  id: string;
399
- _filterFn: MRT_FilterOption;
400
411
  };
401
- export type MRT_Column<TData extends Record<string, any>> = Omit<Column<TData, unknown>, 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'> & {
412
+ export type MRT_Column<TData extends Record<string, any>> = Omit<Column<TData, unknown>, 'columnDef' | 'columns' | 'filterFn' | 'footer' | 'header'> & {
402
413
  columnDef: MRT_DefinedColumnDef<TData>;
403
414
  columns?: MRT_Column<TData>[];
404
415
  filterFn?: MRT_FilterFn<TData>;
@@ -411,11 +422,11 @@ export type MRT_Header<TData extends Record<string, any>> = Omit<Header<TData, u
411
422
  export type MRT_HeaderGroup<TData extends Record<string, any>> = Omit<HeaderGroup<TData>, 'headers'> & {
412
423
  headers: MRT_Header<TData>[];
413
424
  };
414
- export type MRT_Row<TData extends Record<string, any>> = Omit<Row<TData>, 'getVisibleCells' | 'getAllCells' | 'subRows' | '_valuesCache'> & {
425
+ export type MRT_Row<TData extends Record<string, any>> = Omit<Row<TData>, '_valuesCache' | 'getAllCells' | 'getVisibleCells' | 'subRows'> & {
426
+ _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
415
427
  getAllCells: () => MRT_Cell<TData>[];
416
428
  getVisibleCells: () => MRT_Cell<TData>[];
417
429
  subRows?: MRT_Row<TData>[];
418
- _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
419
430
  };
420
431
  export type MRT_Cell<TData extends Record<string, any>> = Omit<Cell<TData, unknown>, 'column' | 'row'> & {
421
432
  column: MRT_Column<TData>;
@@ -424,7 +435,7 @@ export type MRT_Cell<TData extends Record<string, any>> = Omit<Cell<TData, unkno
424
435
  export type MRT_AggregationOption = string & keyof typeof MRT_AggregationFns;
425
436
  export type MRT_AggregationFn<TData extends Record<string, any>> = AggregationFn<TData> | MRT_AggregationOption;
426
437
  export type MRT_SortingOption = LiteralUnion<string & keyof typeof MRT_SortingFns>;
427
- export type MRT_SortingFn<TData extends Record<string, any>> = SortingFn<TData> | MRT_SortingOption;
438
+ export type MRT_SortingFn<TData extends Record<string, any>> = MRT_SortingOption | SortingFn<TData>;
428
439
  export type MRT_FilterOption = LiteralUnion<string & keyof typeof MRT_FilterFns>;
429
440
  export type MRT_FilterFn<TData extends Record<string, any>> = FilterFn<TData> | MRT_FilterOption;
430
441
  export type MRT_InternalFilterOption = {
@@ -433,7 +444,7 @@ export type MRT_InternalFilterOption = {
433
444
  option: string;
434
445
  symbol: string;
435
446
  };
436
- export type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' | 'mrt-row-expand' | 'mrt-row-numbers' | 'mrt-row-select' | 'mrt-row-pin';
447
+ export type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' | 'mrt-row-expand' | 'mrt-row-numbers' | 'mrt-row-pin' | 'mrt-row-select';
437
448
  /**
438
449
  * `columns` and `data` props are the only required props, but there are over 170 other optional props.
439
450
  *
@@ -444,7 +455,12 @@ export type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' | 'mrt-row
444
455
  * @link https://www.material-react-table.com/docs/api/props
445
456
  */
446
457
  export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'defaultColumn' | 'enableRowSelection' | 'expandRowsFn' | 'getRowId' | 'globalFilterFn' | 'initialState' | 'onStateChange' | 'state'> & {
458
+ columnFilterDisplayMode?: 'custom' | 'popover' | 'subheader';
447
459
  columnFilterModeOptions?: Array<LiteralUnion<string & MRT_FilterOption>> | null;
460
+ columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableCellElement> | null>;
461
+ columnVirtualizerOptions?: ((props: {
462
+ table: MRT_TableInstance<TData>;
463
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>) | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>;
448
464
  /**
449
465
  * The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
450
466
  *
@@ -456,10 +472,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
456
472
  * @link https://www.material-react-table.com/docs/api/column-options
457
473
  */
458
474
  columns: MRT_ColumnDef<TData>[];
459
- columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableCellElement> | null>;
460
- columnVirtualizerOptions?: Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>> | ((props: {
461
- table: MRT_TableInstance<TData>;
462
- }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>);
475
+ createDisplayMode?: 'custom' | 'modal' | 'row';
463
476
  /**
464
477
  * Pass your data as an array of objects. Objects can theoretically be any shape, but it's best to keep them consistent.
465
478
  *
@@ -478,12 +491,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
478
491
  displayColumnDefOptions?: Partial<{
479
492
  [key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef<TData>>;
480
493
  }>;
481
- createDisplayMode?: 'modal' | 'row' | 'custom';
482
- editDisplayMode?: 'modal' | 'row' | 'cell' | 'table' | 'custom';
483
- columnFilterDisplayMode?: 'subheader' | 'popover' | 'custom';
484
- paginationDisplayMode?: 'default' | 'pages' | 'custom';
485
- selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
486
- rowPinningDisplayMode?: 'sticky' | 'top' | 'bottom' | 'top-and-bottom' | 'select-sticky' | 'select-top' | 'select-bottom';
494
+ editDisplayMode?: 'cell' | 'custom' | 'modal' | 'row' | 'table';
487
495
  enableBottomToolbar?: boolean;
488
496
  enableClickToCopy?: boolean;
489
497
  enableColumnActions?: boolean;
@@ -492,7 +500,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
492
500
  enableColumnOrdering?: boolean;
493
501
  enableColumnVirtualization?: boolean;
494
502
  enableDensityToggle?: boolean;
495
- enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
503
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
496
504
  enableExpandAll?: boolean;
497
505
  enableFacetedValues?: boolean;
498
506
  enableFilterMatchHighlighting?: boolean;
@@ -504,7 +512,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
504
512
  enableRowDragging?: boolean;
505
513
  enableRowNumbers?: boolean;
506
514
  enableRowOrdering?: boolean;
507
- enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean);
515
+ enableRowSelection?: ((row: MRT_Row<TData>) => boolean) | boolean;
508
516
  enableRowVirtualization?: boolean;
509
517
  enableSelectAll?: boolean;
510
518
  enableStickyFooter?: boolean;
@@ -522,7 +530,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
522
530
  /**
523
531
  * Changes which kind of CSS layout is used to render the table. `semantic` uses default semantic HTML elements, while `grid` adds CSS grid and flexbox styles
524
532
  */
525
- layoutMode?: 'semantic' | 'grid';
533
+ layoutMode?: 'grid' | 'semantic';
526
534
  /**
527
535
  * Pass in either a locale imported from `material-react-table/locales/*` or a custom locale object.
528
536
  *
@@ -537,143 +545,155 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
537
545
  * @link https://www.material-react-table.com/docs/guides/memoize-components
538
546
  */
539
547
  memoMode?: 'cells' | 'rows' | 'table-body';
540
- muiBottomToolbarProps?: ToolbarProps | ((props: {
548
+ muiBottomToolbarProps?: ((props: {
541
549
  table: MRT_TableInstance<TData>;
542
- }) => ToolbarProps);
543
- muiExpandAllButtonProps?: IconButtonProps | ((props: {
550
+ }) => ToolbarProps) | ToolbarProps;
551
+ muiColumnActionsButtonProps?: ((props: {
552
+ column: MRT_Column<TData>;
544
553
  table: MRT_TableInstance<TData>;
545
- }) => IconButtonProps);
546
- muiExpandButtonProps?: IconButtonProps | ((props: {
554
+ }) => IconButtonProps) | IconButtonProps;
555
+ muiColumnDragHandleProps?: ((props: {
556
+ column: MRT_Column<TData>;
547
557
  table: MRT_TableInstance<TData>;
558
+ }) => IconButtonProps) | IconButtonProps;
559
+ muiCopyButtonProps?: ((props: {
560
+ cell: MRT_Cell<TData>;
561
+ column: MRT_Column<TData>;
548
562
  row: MRT_Row<TData>;
549
- }) => IconButtonProps);
550
- muiLinearProgressProps?: LinearProgressProps | ((props: {
551
- isTopToolbar: boolean;
552
563
  table: MRT_TableInstance<TData>;
553
- }) => LinearProgressProps);
554
- muiSearchTextFieldProps?: TextFieldProps | ((props: {
555
- table: MRT_TableInstance<TData>;
556
- }) => TextFieldProps);
557
- muiSelectAllCheckboxProps?: CheckboxProps | ((props: {
558
- table: MRT_TableInstance<TData>;
559
- }) => CheckboxProps);
560
- muiSelectCheckboxProps?: (CheckboxProps | RadioProps) | ((props: {
564
+ }) => ButtonProps) | ButtonProps;
565
+ muiCreateRowModalProps?: ((props: {
566
+ row: MRT_Row<TData>;
561
567
  table: MRT_TableInstance<TData>;
568
+ }) => DialogProps) | DialogProps;
569
+ muiDetailPanelProps?: ((props: {
562
570
  row: MRT_Row<TData>;
563
- }) => CheckboxProps | RadioProps);
564
- muiCopyButtonProps?: ButtonProps | ((props: {
565
- cell: MRT_Cell<TData>;
566
- column: MRT_Column<TData>;
571
+ table: MRT_TableInstance<TData>;
572
+ }) => TableCellProps) | TableCellProps;
573
+ muiEditRowModalProps?: ((props: {
567
574
  row: MRT_Row<TData>;
568
575
  table: MRT_TableInstance<TData>;
569
- }) => ButtonProps);
570
- muiEditTextFieldProps?: TextFieldProps | ((props: {
576
+ }) => DialogProps) | DialogProps;
577
+ muiEditTextFieldProps?: ((props: {
571
578
  cell: MRT_Cell<TData>;
572
579
  column: MRT_Column<TData>;
573
580
  row: MRT_Row<TData>;
574
581
  table: MRT_TableInstance<TData>;
575
- }) => TextFieldProps);
576
- muiTableBodyCellProps?: TableCellProps | ((props: {
577
- cell: MRT_Cell<TData>;
578
- column: MRT_Column<TData>;
582
+ }) => TextFieldProps) | TextFieldProps;
583
+ muiExpandAllButtonProps?: ((props: {
584
+ table: MRT_TableInstance<TData>;
585
+ }) => IconButtonProps) | IconButtonProps;
586
+ muiExpandButtonProps?: ((props: {
579
587
  row: MRT_Row<TData>;
580
588
  table: MRT_TableInstance<TData>;
581
- }) => TableCellProps);
582
- muiSkeletonProps?: SkeletonProps | ((props: {
583
- cell: MRT_Cell<TData>;
589
+ }) => IconButtonProps) | IconButtonProps;
590
+ muiFilterAutocompleteProps?: ((props: {
584
591
  column: MRT_Column<TData>;
585
- row: MRT_Row<TData>;
586
592
  table: MRT_TableInstance<TData>;
587
- }) => SkeletonProps);
588
- muiTableBodyProps?: TableBodyProps | ((props: {
593
+ }) => AutocompleteProps<any, any, any, any>) | AutocompleteProps<any, any, any, any>;
594
+ muiFilterCheckboxProps?: ((props: {
595
+ column: MRT_Column<TData>;
589
596
  table: MRT_TableInstance<TData>;
590
- }) => TableBodyProps);
591
- muiRowDragHandleProps?: IconButtonProps | ((props: {
597
+ }) => CheckboxProps) | CheckboxProps;
598
+ muiFilterDatePickerProps?: ((props: {
599
+ column: MRT_Column<TData>;
600
+ rangeFilterIndex?: number;
592
601
  table: MRT_TableInstance<TData>;
593
- row: MRT_Row<TData>;
594
- }) => IconButtonProps);
595
- muiTableBodyRowProps?: TableRowProps | ((props: {
596
- isDetailPanel?: boolean;
597
- row: MRT_Row<TData>;
598
- staticRowIndex: number;
602
+ }) => DatePickerProps<any>) | DatePickerProps<any>;
603
+ muiFilterSliderProps?: ((props: {
604
+ column: MRT_Column<TData>;
599
605
  table: MRT_TableInstance<TData>;
600
- }) => TableRowProps);
601
- muiTableContainerProps?: TableContainerProps | ((props: {
606
+ }) => SliderProps) | SliderProps;
607
+ muiFilterTextFieldProps?: ((props: {
608
+ column: MRT_Column<TData>;
609
+ rangeFilterIndex?: number;
602
610
  table: MRT_TableInstance<TData>;
603
- }) => TableContainerProps);
604
- muiDetailPanelProps?: TableCellProps | ((props: {
611
+ }) => TextFieldProps) | TextFieldProps;
612
+ muiLinearProgressProps?: ((props: {
613
+ isTopToolbar: boolean;
605
614
  table: MRT_TableInstance<TData>;
615
+ }) => LinearProgressProps) | LinearProgressProps;
616
+ muiRowDragHandleProps?: ((props: {
606
617
  row: MRT_Row<TData>;
607
- }) => TableCellProps);
608
- muiTableFooterCellProps?: TableCellProps | ((props: {
609
618
  table: MRT_TableInstance<TData>;
610
- column: MRT_Column<TData>;
611
- }) => TableCellProps);
612
- muiTableFooterProps?: TableFooterProps | ((props: {
619
+ }) => IconButtonProps) | IconButtonProps;
620
+ muiSearchTextFieldProps?: ((props: {
613
621
  table: MRT_TableInstance<TData>;
614
- }) => TableFooterProps);
615
- muiTableFooterRowProps?: TableRowProps | ((props: {
622
+ }) => TextFieldProps) | TextFieldProps;
623
+ muiSelectAllCheckboxProps?: ((props: {
616
624
  table: MRT_TableInstance<TData>;
617
- footerGroup: MRT_HeaderGroup<TData>;
618
- }) => TableRowProps);
619
- muiColumnActionsButtonProps?: IconButtonProps | ((props: {
625
+ }) => CheckboxProps) | CheckboxProps;
626
+ muiSelectCheckboxProps?: ((props: {
627
+ row: MRT_Row<TData>;
620
628
  table: MRT_TableInstance<TData>;
629
+ }) => CheckboxProps | RadioProps) | (CheckboxProps | RadioProps);
630
+ muiSkeletonProps?: ((props: {
631
+ cell: MRT_Cell<TData>;
621
632
  column: MRT_Column<TData>;
622
- }) => IconButtonProps);
623
- muiColumnDragHandleProps?: IconButtonProps | ((props: {
633
+ row: MRT_Row<TData>;
624
634
  table: MRT_TableInstance<TData>;
635
+ }) => SkeletonProps) | SkeletonProps;
636
+ muiTableBodyCellProps?: ((props: {
637
+ cell: MRT_Cell<TData>;
625
638
  column: MRT_Column<TData>;
626
- }) => IconButtonProps);
627
- muiFilterCheckboxProps?: CheckboxProps | ((props: {
628
- column: MRT_Column<TData>;
639
+ row: MRT_Row<TData>;
629
640
  table: MRT_TableInstance<TData>;
630
- }) => CheckboxProps);
631
- muiFilterTextFieldProps?: TextFieldProps | ((props: {
641
+ }) => TableCellProps) | TableCellProps;
642
+ muiTableBodyProps?: ((props: {
632
643
  table: MRT_TableInstance<TData>;
633
- column: MRT_Column<TData>;
634
- rangeFilterIndex?: number;
635
- }) => TextFieldProps);
636
- muiFilterSliderProps?: SliderProps | ((props: {
644
+ }) => TableBodyProps) | TableBodyProps;
645
+ muiTableBodyRowProps?: ((props: {
646
+ isDetailPanel?: boolean;
647
+ row: MRT_Row<TData>;
648
+ staticRowIndex: number;
649
+ table: MRT_TableInstance<TData>;
650
+ }) => TableRowProps) | TableRowProps;
651
+ muiTableContainerProps?: ((props: {
637
652
  table: MRT_TableInstance<TData>;
653
+ }) => TableContainerProps) | TableContainerProps;
654
+ muiTableFooterCellProps?: ((props: {
638
655
  column: MRT_Column<TData>;
639
- }) => SliderProps);
640
- muiCreateRowModalProps?: DialogProps | ((props: {
641
- row: MRT_Row<TData>;
642
656
  table: MRT_TableInstance<TData>;
643
- }) => DialogProps);
644
- muiEditRowModalProps?: DialogProps | ((props: {
645
- row: MRT_Row<TData>;
657
+ }) => TableCellProps) | TableCellProps;
658
+ muiTableFooterProps?: ((props: {
646
659
  table: MRT_TableInstance<TData>;
647
- }) => DialogProps);
648
- muiTableHeadCellProps?: TableCellProps | ((props: {
660
+ }) => TableFooterProps) | TableFooterProps;
661
+ muiTableFooterRowProps?: ((props: {
662
+ footerGroup: MRT_HeaderGroup<TData>;
649
663
  table: MRT_TableInstance<TData>;
664
+ }) => TableRowProps) | TableRowProps;
665
+ muiTableHeadCellProps?: ((props: {
650
666
  column: MRT_Column<TData>;
651
- }) => TableCellProps);
652
- muiTableHeadProps?: TableHeadProps | ((props: {
653
667
  table: MRT_TableInstance<TData>;
654
- }) => TableHeadProps);
655
- muiTableHeadRowProps?: TableRowProps | ((props: {
668
+ }) => TableCellProps) | TableCellProps;
669
+ muiTableHeadProps?: ((props: {
656
670
  table: MRT_TableInstance<TData>;
671
+ }) => TableHeadProps) | TableHeadProps;
672
+ muiTableHeadRowProps?: ((props: {
657
673
  headerGroup: MRT_HeaderGroup<TData>;
658
- }) => TableRowProps);
659
- muiTablePaginationProps?: Partial<Omit<TablePaginationProps, 'rowsPerPage'>> | ((props: {
660
674
  table: MRT_TableInstance<TData>;
661
- }) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
662
- muiTablePaperProps?: PaperProps | ((props: {
675
+ }) => TableRowProps) | TableRowProps;
676
+ muiTablePaginationProps?: ((props: {
677
+ table: MRT_TableInstance<TData>;
678
+ }) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>) | Partial<Omit<TablePaginationProps, 'rowsPerPage'>>;
679
+ muiTablePaperProps?: ((props: {
663
680
  table: MRT_TableInstance<TData>;
664
- }) => PaperProps);
665
- muiTableProps?: TableProps | ((props: {
681
+ }) => PaperProps) | PaperProps;
682
+ muiTableProps?: ((props: {
666
683
  table: MRT_TableInstance<TData>;
667
- }) => TableProps);
668
- muiToolbarAlertBannerChipProps?: ChipProps | ((props: {
684
+ }) => TableProps) | TableProps;
685
+ muiToolbarAlertBannerChipProps?: ((props: {
669
686
  table: MRT_TableInstance<TData>;
670
- }) => ChipProps);
671
- muiToolbarAlertBannerProps?: AlertProps | ((props: {
687
+ }) => ChipProps) | ChipProps;
688
+ muiToolbarAlertBannerProps?: ((props: {
672
689
  table: MRT_TableInstance<TData>;
673
- }) => AlertProps);
674
- muiTopToolbarProps?: ToolbarProps | ((props: {
690
+ }) => AlertProps) | AlertProps;
691
+ muiTopToolbarProps?: ((props: {
675
692
  table: MRT_TableInstance<TData>;
676
- }) => ToolbarProps);
693
+ }) => ToolbarProps) | ToolbarProps;
694
+ onColumnFilterFnsChange?: OnChangeFn<{
695
+ [key: string]: MRT_FilterOption;
696
+ }>;
677
697
  onCreatingRowCancel?: (props: {
678
698
  row: MRT_Row<TData>;
679
699
  table: MRT_TableInstance<TData>;
@@ -685,9 +705,6 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
685
705
  table: MRT_TableInstance<TData>;
686
706
  values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
687
707
  }) => void;
688
- onColumnFilterFnsChange?: OnChangeFn<{
689
- [key: string]: MRT_FilterOption;
690
- }>;
691
708
  onDensityChange?: OnChangeFn<MRT_DensityState>;
692
709
  onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
693
710
  onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
@@ -704,42 +721,33 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
704
721
  values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
705
722
  }) => Promise<void> | void;
706
723
  onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
707
- onHoveredColumnChange?: OnChangeFn<MRT_Column<TData> | {
724
+ onHoveredColumnChange?: OnChangeFn<{
708
725
  id: string;
709
- } | null>;
710
- onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | {
726
+ } | MRT_Column<TData> | null>;
727
+ onHoveredRowChange?: OnChangeFn<{
711
728
  id: string;
712
- } | null>;
729
+ } | MRT_Row<TData> | null>;
713
730
  onIsFullScreenChange?: OnChangeFn<boolean>;
714
731
  onShowAlertBannerChange?: OnChangeFn<boolean>;
715
732
  onShowColumnFiltersChange?: OnChangeFn<boolean>;
716
733
  onShowGlobalFilterChange?: OnChangeFn<boolean>;
717
734
  onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
735
+ paginationDisplayMode?: 'custom' | 'default' | 'pages';
718
736
  positionActionsColumn?: 'first' | 'last';
719
737
  positionExpandColumn?: 'first' | 'last';
720
- positionGlobalFilter?: 'left' | 'right' | 'none';
721
- positionPagination?: 'bottom' | 'top' | 'both' | 'none';
722
- positionToolbarAlertBanner?: 'bottom' | 'top' | 'none';
723
- positionToolbarDropZone?: 'bottom' | 'top' | 'none' | 'both';
724
- renderBottomToolbar?: ReactNode | ((props: {
738
+ positionGlobalFilter?: 'left' | 'none' | 'right';
739
+ positionPagination?: 'both' | 'bottom' | 'none' | 'top';
740
+ positionToolbarAlertBanner?: 'bottom' | 'none' | 'top';
741
+ positionToolbarDropZone?: 'both' | 'bottom' | 'none' | 'top';
742
+ renderBottomToolbar?: ((props: {
725
743
  table: MRT_TableInstance<TData>;
726
- }) => ReactNode);
744
+ }) => ReactNode) | ReactNode;
727
745
  renderBottomToolbarCustomActions?: (props: {
728
746
  table: MRT_TableInstance<TData>;
729
747
  }) => ReactNode;
730
- renderCreateRowModalContent?: (props: {
731
- internalEditComponents: ReactNode[];
732
- row: MRT_Row<TData>;
733
- table: MRT_TableInstance<TData>;
734
- }) => ReactNode;
735
- renderEditRowModalContent?: (props: {
736
- internalEditComponents: ReactNode[];
737
- row: MRT_Row<TData>;
738
- table: MRT_TableInstance<TData>;
739
- }) => ReactNode;
740
748
  renderColumnActionsMenuItems?: (props: {
741
- column: MRT_Column<TData>;
742
749
  closeMenu: () => void;
750
+ column: MRT_Column<TData>;
743
751
  internalColumnMenuItems: ReactNode[];
744
752
  table: MRT_TableInstance<TData>;
745
753
  }) => ReactNode[];
@@ -749,18 +757,28 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
749
757
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
750
758
  table: MRT_TableInstance<TData>;
751
759
  }) => ReactNode[];
760
+ renderCreateRowModalContent?: (props: {
761
+ internalEditComponents: ReactNode[];
762
+ row: MRT_Row<TData>;
763
+ table: MRT_TableInstance<TData>;
764
+ }) => ReactNode;
752
765
  renderDetailPanel?: (props: {
753
766
  row: MRT_Row<TData>;
754
767
  table: MRT_TableInstance<TData>;
755
768
  }) => ReactNode;
769
+ renderEditRowModalContent?: (props: {
770
+ internalEditComponents: ReactNode[];
771
+ row: MRT_Row<TData>;
772
+ table: MRT_TableInstance<TData>;
773
+ }) => ReactNode;
774
+ renderEmptyRowsFallback?: (props: {
775
+ table: MRT_TableInstance<TData>;
776
+ }) => ReactNode;
756
777
  renderGlobalFilterModeMenuItems?: (props: {
757
778
  internalFilterOptions: MRT_InternalFilterOption[];
758
779
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
759
780
  table: MRT_TableInstance<TData>;
760
781
  }) => ReactNode[];
761
- renderEmptyRowsFallback?: (props: {
762
- table: MRT_TableInstance<TData>;
763
- }) => ReactNode;
764
782
  renderRowActionMenuItems?: (props: {
765
783
  closeMenu: () => void;
766
784
  row: MRT_Row<TData>;
@@ -774,19 +792,21 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
774
792
  renderToolbarInternalActions?: (props: {
775
793
  table: MRT_TableInstance<TData>;
776
794
  }) => ReactNode;
777
- renderTopToolbar?: ReactNode | ((props: {
795
+ renderTopToolbar?: ((props: {
778
796
  table: MRT_TableInstance<TData>;
779
- }) => ReactNode);
797
+ }) => ReactNode) | ReactNode;
780
798
  renderTopToolbarCustomActions?: (props: {
781
799
  table: MRT_TableInstance<TData>;
782
800
  }) => ReactNode;
783
801
  rowCount?: number;
784
802
  rowNumberMode?: 'original' | 'static';
803
+ rowPinningDisplayMode?: 'bottom' | 'select-bottom' | 'select-sticky' | 'select-top' | 'sticky' | 'top' | 'top-and-bottom';
785
804
  rowVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableRowElement> | null>;
786
- rowVirtualizerOptions?: Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>> | ((props: {
805
+ rowVirtualizerOptions?: ((props: {
787
806
  table: MRT_TableInstance<TData>;
788
- }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>);
807
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>) | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
789
808
  selectAllMode?: 'all' | 'page';
809
+ selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
790
810
  /**
791
811
  * Manage state externally any way you want, then pass it back into MRT.
792
812
  */