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
package/src/types.ts CHANGED
@@ -5,27 +5,6 @@ import {
5
5
  type RefObject,
6
6
  type SetStateAction,
7
7
  } from 'react';
8
- import { type AlertProps } from '@mui/material/Alert';
9
- import { type ButtonProps } from '@mui/material/Button';
10
- import { type CheckboxProps } from '@mui/material/Checkbox';
11
- import { type ChipProps } from '@mui/material/Chip';
12
- import { type DialogProps } from '@mui/material/Dialog';
13
- import { type IconButtonProps } from '@mui/material/IconButton';
14
- import { type LinearProgressProps } from '@mui/material/LinearProgress';
15
- import { type PaperProps } from '@mui/material/Paper';
16
- import { type RadioProps } from '@mui/material/Radio';
17
- import { type SkeletonProps } from '@mui/material/Skeleton';
18
- import { type SliderProps } from '@mui/material/Slider';
19
- import { type TableBodyProps } from '@mui/material/TableBody';
20
- import { type TableCellProps } from '@mui/material/TableCell';
21
- import { type TableContainerProps } from '@mui/material/TableContainer';
22
- import { type TableFooterProps } from '@mui/material/TableFooter';
23
- import { type TableHeadProps } from '@mui/material/TableHead';
24
- import { type TablePaginationProps } from '@mui/material/TablePagination';
25
- import { type TableProps } from '@mui/material/Table';
26
- import { type TableRowProps } from '@mui/material/TableRow';
27
- import { type TextFieldProps } from '@mui/material/TextField';
28
- import { type ToolbarProps } from '@mui/material/Toolbar';
29
8
  import {
30
9
  type AggregationFn,
31
10
  type Cell,
@@ -55,14 +34,37 @@ import {
55
34
  type VisibilityState,
56
35
  } from '@tanstack/react-table';
57
36
  import {
58
- type VirtualizerOptions,
59
- type Virtualizer,
60
37
  type VirtualItem,
38
+ type Virtualizer,
39
+ type VirtualizerOptions,
61
40
  } from '@tanstack/react-virtual';
41
+ import { type AutocompleteProps } from '@mui/material';
42
+ import { type AlertProps } from '@mui/material/Alert';
43
+ import { type ButtonProps } from '@mui/material/Button';
44
+ import { type CheckboxProps } from '@mui/material/Checkbox';
45
+ import { type ChipProps } from '@mui/material/Chip';
46
+ import { type DialogProps } from '@mui/material/Dialog';
47
+ import { type IconButtonProps } from '@mui/material/IconButton';
48
+ import { type LinearProgressProps } from '@mui/material/LinearProgress';
49
+ import { type PaperProps } from '@mui/material/Paper';
50
+ import { type RadioProps } from '@mui/material/Radio';
51
+ import { type SkeletonProps } from '@mui/material/Skeleton';
52
+ import { type SliderProps } from '@mui/material/Slider';
53
+ import { type TableProps } from '@mui/material/Table';
54
+ import { type TableBodyProps } from '@mui/material/TableBody';
55
+ import { type TableCellProps } from '@mui/material/TableCell';
56
+ import { type TableContainerProps } from '@mui/material/TableContainer';
57
+ import { type TableFooterProps } from '@mui/material/TableFooter';
58
+ import { type TableHeadProps } from '@mui/material/TableHead';
59
+ import { type TablePaginationProps } from '@mui/material/TablePagination';
60
+ import { type TableRowProps } from '@mui/material/TableRow';
61
+ import { type TextFieldProps } from '@mui/material/TextField';
62
+ import { type ToolbarProps } from '@mui/material/Toolbar';
63
+ import { type DatePickerProps } from '@mui/x-date-pickers';
62
64
  import { type MRT_AggregationFns } from './aggregationFns';
63
65
  import { type MRT_FilterFns } from './filterFns';
64
- import { type MRT_SortingFns } from './sortingFns';
65
66
  import { type MRT_Icons } from './icons';
67
+ import { type MRT_SortingFns } from './sortingFns';
66
68
 
67
69
  export type { MRT_Icons };
68
70
  export type LiteralUnion<T extends U, U = string> =
@@ -129,10 +131,9 @@ export interface MRT_Localization {
129
131
  filterFuzzy: string;
130
132
  filterGreaterThan: string;
131
133
  filterGreaterThanOrEqualTo: string;
134
+ filterInNumberRange: string;
132
135
  filterIncludesString: string;
133
136
  filterIncludesStringSensitive: string;
134
- filteringByColumn: string;
135
- filterInNumberRange: string;
136
137
  filterLessThan: string;
137
138
  filterLessThanOrEqualTo: string;
138
139
  filterMode: string;
@@ -140,6 +141,7 @@ export interface MRT_Localization {
140
141
  filterNotEquals: string;
141
142
  filterStartsWith: string;
142
143
  filterWeakEquals: string;
144
+ filteringByColumn: string;
143
145
  goToFirstPage: string;
144
146
  goToLastPage: string;
145
147
  goToNextPage: string;
@@ -244,14 +246,14 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
244
246
  filterInputRefs: MutableRefObject<Record<string, HTMLInputElement>>;
245
247
  searchInputRef: MutableRefObject<HTMLInputElement>;
246
248
  tableContainerRef: MutableRefObject<HTMLDivElement>;
249
+ tableFooterRef: MutableRefObject<HTMLTableSectionElement>;
247
250
  tableHeadCellRefs: MutableRefObject<Record<string, HTMLTableCellElement>>;
251
+ tableHeadRef: MutableRefObject<HTMLTableSectionElement>;
248
252
  tablePaperRef: MutableRefObject<HTMLDivElement>;
249
253
  topToolbarRef: MutableRefObject<HTMLDivElement>;
250
- tableHeadRef: MutableRefObject<HTMLTableSectionElement>;
251
- tableFooterRef: MutableRefObject<HTMLTableSectionElement>;
252
254
  };
253
- setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
254
255
  setColumnFilterFns: Dispatch<SetStateAction<MRT_ColumnFilterFnsState>>;
256
+ setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
255
257
  setDensity: Dispatch<SetStateAction<MRT_DensityState>>;
256
258
  setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
257
259
  setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
@@ -259,10 +261,10 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
259
261
  setEditingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
260
262
  setGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
261
263
  setHoveredColumn: Dispatch<
262
- SetStateAction<MRT_Column<TData> | { id: string } | null>
264
+ SetStateAction<{ id: string } | MRT_Column<TData> | null>
263
265
  >;
264
266
  setHoveredRow: Dispatch<
265
- SetStateAction<MRT_Row<TData> | { id: string } | null>
267
+ SetStateAction<{ id: string } | MRT_Row<TData> | null>
266
268
  >;
267
269
  setIsFullScreen: Dispatch<SetStateAction<boolean>>;
268
270
  setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
@@ -273,8 +275,8 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
273
275
 
274
276
  export type MRT_DefinedTableOptions<TData extends Record<string, any>> =
275
277
  MRT_TableOptions<TData> & {
276
- localization: MRT_Localization;
277
278
  icons: MRT_Icons;
279
+ localization: MRT_Localization;
278
280
  };
279
281
 
280
282
  export type MRT_TableState<TData extends Record<string, any>> = TableState & {
@@ -286,8 +288,8 @@ export type MRT_TableState<TData extends Record<string, any>> = TableState & {
286
288
  editingCell: MRT_Cell<TData> | null;
287
289
  editingRow: MRT_Row<TData> | null;
288
290
  globalFilterFn: MRT_FilterOption;
289
- hoveredColumn: MRT_Column<TData> | { id: string } | null;
290
- hoveredRow: MRT_Row<TData> | { id: string } | null;
291
+ hoveredColumn: { id: string } | MRT_Column<TData> | null;
292
+ hoveredRow: { id: string } | MRT_Row<TData> | null;
291
293
  isFullScreen: boolean;
292
294
  isLoading: boolean;
293
295
  isSaving: boolean;
@@ -320,8 +322,8 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
320
322
  }) => ReactNode;
321
323
  Cell?: (props: {
322
324
  cell: MRT_Cell<TData>;
323
- renderedCellValue: number | string | ReactNode;
324
325
  column: MRT_Column<TData>;
326
+ renderedCellValue: ReactNode | number | string;
325
327
  row: MRT_Row<TData>;
326
328
  rowRef?: RefObject<HTMLTableRowElement>;
327
329
  table: MRT_TableInstance<TData>;
@@ -339,12 +341,12 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
339
341
  table: MRT_TableInstance<TData>;
340
342
  }) => ReactNode;
341
343
  Footer?:
342
- | ReactNode
343
344
  | ((props: {
344
345
  column: MRT_Column<TData>;
345
346
  footer: MRT_Header<TData>;
346
347
  table: MRT_TableInstance<TData>;
347
- }) => ReactNode);
348
+ }) => ReactNode)
349
+ | ReactNode;
348
350
  GroupedCell?: (props: {
349
351
  cell: MRT_Cell<TData>;
350
352
  column: MRT_Column<TData>;
@@ -352,12 +354,12 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
352
354
  table: MRT_TableInstance<TData>;
353
355
  }) => ReactNode;
354
356
  Header?:
355
- | ReactNode
356
357
  | ((props: {
357
358
  column: MRT_Column<TData>;
358
359
  header: MRT_Header<TData>;
359
360
  table: MRT_TableInstance<TData>;
360
- }) => ReactNode);
361
+ }) => ReactNode)
362
+ | ReactNode;
361
363
  PlaceholderCell?: (props: {
362
364
  cell: MRT_Cell<TData>;
363
365
  column: MRT_Column<TData>;
@@ -379,8 +381,8 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
379
381
  * @example accessorKey: 'username' //simple
380
382
  * @example accessorKey: 'name.firstName' //deep key dot notation
381
383
  */
382
- accessorKey?: (string & {}) | DeepKeys<TData>;
383
- aggregationFn?: MRT_AggregationFn<TData> | Array<MRT_AggregationFn<TData>>;
384
+ accessorKey?: DeepKeys<TData> | (string & {});
385
+ aggregationFn?: Array<MRT_AggregationFn<TData>> | MRT_AggregationFn<TData>;
384
386
  /**
385
387
  * Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
386
388
  * Leave this blank if you are just creating a normal data column.
@@ -394,19 +396,22 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
394
396
  LiteralUnion<string & MRT_FilterOption>
395
397
  > | null;
396
398
  columns?: MRT_ColumnDef<TData>[];
397
- editSelectOptions?: (string | { text: string; value: any })[];
398
- editVariant?: 'text' | 'select';
399
+ editSelectOptions?: ({ text: string; value: any } | string)[];
400
+ editVariant?: 'select' | 'text';
399
401
  enableClickToCopy?: boolean;
400
402
  enableColumnActions?: boolean;
401
403
  enableColumnDragging?: boolean;
402
404
  enableColumnFilterModes?: boolean;
403
405
  enableColumnOrdering?: boolean;
404
- enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
406
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
405
407
  enableFilterMatchHighlighting?: boolean;
406
408
  filterFn?: MRT_FilterFn<TData>;
407
- filterSelectOptions?: (string | { text: string; value: any })[];
409
+ filterSelectOptions?: ({ text: string; value: any } | string)[];
408
410
  filterVariant?:
411
+ | 'autocomplete'
409
412
  | 'checkbox'
413
+ | 'date'
414
+ | 'date-range'
410
415
  | 'multi-select'
411
416
  | 'range'
412
417
  | 'range-slider'
@@ -430,73 +435,86 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
430
435
  * @default gets set to the same value as `accessorKey` by default
431
436
  */
432
437
  id?: LiteralUnion<string & keyof TData>;
438
+ muiColumnActionsButtonProps?:
439
+ | ((props: {
440
+ column: MRT_Column<TData>;
441
+ table: MRT_TableInstance<TData>;
442
+ }) => IconButtonProps)
443
+ | IconButtonProps;
444
+ muiColumnDragHandleProps?:
445
+ | ((props: {
446
+ column: MRT_Column<TData>;
447
+ table: MRT_TableInstance<TData>;
448
+ }) => IconButtonProps)
449
+ | IconButtonProps;
433
450
  muiCopyButtonProps?:
434
- | ButtonProps
435
451
  | ((props: {
436
452
  cell: MRT_Cell<TData>;
437
453
  column: MRT_Column<TData>;
438
454
  row: MRT_Row<TData>;
439
455
  table: MRT_TableInstance<TData>;
440
- }) => ButtonProps);
456
+ }) => ButtonProps)
457
+ | ButtonProps;
441
458
  muiEditTextFieldProps?:
442
- | TextFieldProps
443
459
  | ((props: {
444
460
  cell: MRT_Cell<TData>;
445
461
  column: MRT_Column<TData>;
446
462
  row: MRT_Row<TData>;
447
463
  table: MRT_TableInstance<TData>;
448
- }) => TextFieldProps);
449
- muiTableBodyCellProps?:
450
- | TableCellProps
464
+ }) => TextFieldProps)
465
+ | TextFieldProps;
466
+ muiFilterAutocompleteProps?:
451
467
  | ((props: {
452
- cell: MRT_Cell<TData>;
453
468
  column: MRT_Column<TData>;
454
- row: MRT_Row<TData>;
455
469
  table: MRT_TableInstance<TData>;
456
- }) => TableCellProps);
457
- muiTableFooterCellProps?:
458
- | TableCellProps
470
+ }) => AutocompleteProps<any, any, any, any>)
471
+ | AutocompleteProps<any, any, any, any>;
472
+ muiFilterCheckboxProps?:
459
473
  | ((props: {
460
- table: MRT_TableInstance<TData>;
461
474
  column: MRT_Column<TData>;
462
- }) => TableCellProps);
463
- muiColumnActionsButtonProps?:
464
- | IconButtonProps
465
- | ((props: {
466
475
  table: MRT_TableInstance<TData>;
467
- column: MRT_Column<TData>;
468
- }) => IconButtonProps);
469
- muiColumnDragHandleProps?:
470
- | IconButtonProps
476
+ }) => CheckboxProps)
477
+ | CheckboxProps;
478
+ muiFilterDatePickerProps?:
471
479
  | ((props: {
472
- table: MRT_TableInstance<TData>;
473
480
  column: MRT_Column<TData>;
474
- }) => IconButtonProps);
475
- muiFilterCheckboxProps?:
476
- | CheckboxProps
481
+ rangeFilterIndex?: number;
482
+ table: MRT_TableInstance<TData>;
483
+ }) => DatePickerProps<any>)
484
+ | DatePickerProps<any>;
485
+ muiFilterSliderProps?:
477
486
  | ((props: {
478
487
  column: MRT_Column<TData>;
479
488
  table: MRT_TableInstance<TData>;
480
- }) => CheckboxProps);
489
+ }) => SliderProps)
490
+ | SliderProps;
481
491
  muiFilterTextFieldProps?:
482
- | TextFieldProps
483
492
  | ((props: {
484
- table: MRT_TableInstance<TData>;
485
493
  column: MRT_Column<TData>;
486
494
  rangeFilterIndex?: number;
487
- }) => TextFieldProps);
488
- muiFilterSliderProps?:
489
- | SliderProps
495
+ table: MRT_TableInstance<TData>;
496
+ }) => TextFieldProps)
497
+ | TextFieldProps;
498
+ muiTableBodyCellProps?:
490
499
  | ((props: {
500
+ cell: MRT_Cell<TData>;
501
+ column: MRT_Column<TData>;
502
+ row: MRT_Row<TData>;
491
503
  table: MRT_TableInstance<TData>;
504
+ }) => TableCellProps)
505
+ | TableCellProps;
506
+ muiTableFooterCellProps?:
507
+ | ((props: {
492
508
  column: MRT_Column<TData>;
493
- }) => SliderProps);
509
+ table: MRT_TableInstance<TData>;
510
+ }) => TableCellProps)
511
+ | TableCellProps;
494
512
  muiTableHeadCellProps?:
495
- | TableCellProps
496
513
  | ((props: {
497
- table: MRT_TableInstance<TData>;
498
514
  column: MRT_Column<TData>;
499
- }) => TableCellProps);
515
+ table: MRT_TableInstance<TData>;
516
+ }) => TableCellProps)
517
+ | TableCellProps;
500
518
  renderColumnActionsMenuItems?: (props: {
501
519
  closeMenu: () => void;
502
520
  column: MRT_Column<TData>;
@@ -514,16 +532,16 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
514
532
 
515
533
  export type MRT_DefinedColumnDef<TData extends Record<string, any>> = Omit<
516
534
  MRT_ColumnDef<TData>,
517
- 'id' | 'defaultDisplayColumn'
535
+ 'defaultDisplayColumn' | 'id'
518
536
  > & {
537
+ _filterFn: MRT_FilterOption;
519
538
  defaultDisplayColumn: Partial<MRT_ColumnDef<TData>>;
520
539
  id: string;
521
- _filterFn: MRT_FilterOption;
522
540
  };
523
541
 
524
542
  export type MRT_Column<TData extends Record<string, any>> = Omit<
525
543
  Column<TData, unknown>,
526
- 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'
544
+ 'columnDef' | 'columns' | 'filterFn' | 'footer' | 'header'
527
545
  > & {
528
546
  columnDef: MRT_DefinedColumnDef<TData>;
529
547
  columns?: MRT_Column<TData>[];
@@ -548,12 +566,12 @@ export type MRT_HeaderGroup<TData extends Record<string, any>> = Omit<
548
566
 
549
567
  export type MRT_Row<TData extends Record<string, any>> = Omit<
550
568
  Row<TData>,
551
- 'getVisibleCells' | 'getAllCells' | 'subRows' | '_valuesCache'
569
+ '_valuesCache' | 'getAllCells' | 'getVisibleCells' | 'subRows'
552
570
  > & {
571
+ _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
553
572
  getAllCells: () => MRT_Cell<TData>[];
554
573
  getVisibleCells: () => MRT_Cell<TData>[];
555
574
  subRows?: MRT_Row<TData>[];
556
- _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
557
575
  };
558
576
 
559
577
  export type MRT_Cell<TData extends Record<string, any>> = Omit<
@@ -575,8 +593,8 @@ export type MRT_SortingOption = LiteralUnion<
575
593
  >;
576
594
 
577
595
  export type MRT_SortingFn<TData extends Record<string, any>> =
578
- | SortingFn<TData>
579
- | MRT_SortingOption;
596
+ | MRT_SortingOption
597
+ | SortingFn<TData>;
580
598
 
581
599
  export type MRT_FilterOption = LiteralUnion<
582
600
  string & keyof typeof MRT_FilterFns
@@ -598,8 +616,8 @@ export type MRT_DisplayColumnIds =
598
616
  | 'mrt-row-drag'
599
617
  | 'mrt-row-expand'
600
618
  | 'mrt-row-numbers'
601
- | 'mrt-row-select'
602
- | 'mrt-row-pin';
619
+ | 'mrt-row-pin'
620
+ | 'mrt-row-select';
603
621
 
604
622
  /**
605
623
  * `columns` and `data` props are the only required props, but there are over 170 other optional props.
@@ -623,9 +641,19 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
623
641
  | 'onStateChange'
624
642
  | 'state'
625
643
  > & {
644
+ columnFilterDisplayMode?: 'custom' | 'popover' | 'subheader';
626
645
  columnFilterModeOptions?: Array<
627
646
  LiteralUnion<string & MRT_FilterOption>
628
647
  > | null;
648
+ columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<
649
+ HTMLDivElement,
650
+ HTMLTableCellElement
651
+ > | null>;
652
+ columnVirtualizerOptions?:
653
+ | ((props: {
654
+ table: MRT_TableInstance<TData>;
655
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>)
656
+ | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>;
629
657
  /**
630
658
  * The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
631
659
  *
@@ -637,15 +665,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
637
665
  * @link https://www.material-react-table.com/docs/api/column-options
638
666
  */
639
667
  columns: MRT_ColumnDef<TData>[];
640
- columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<
641
- HTMLDivElement,
642
- HTMLTableCellElement
643
- > | null>;
644
- columnVirtualizerOptions?:
645
- | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>
646
- | ((props: {
647
- table: MRT_TableInstance<TData>;
648
- }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>);
668
+ createDisplayMode?: 'custom' | 'modal' | 'row';
649
669
  /**
650
670
  * Pass your data as an array of objects. Objects can theoretically be any shape, but it's best to keep them consistent.
651
671
  *
@@ -664,19 +684,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
664
684
  displayColumnDefOptions?: Partial<{
665
685
  [key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef<TData>>;
666
686
  }>;
667
- createDisplayMode?: 'modal' | 'row' | 'custom';
668
- editDisplayMode?: 'modal' | 'row' | 'cell' | 'table' | 'custom';
669
- columnFilterDisplayMode?: 'subheader' | 'popover' | 'custom';
670
- paginationDisplayMode?: 'default' | 'pages' | 'custom';
671
- selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
672
- rowPinningDisplayMode?:
673
- | 'sticky'
674
- | 'top'
675
- | 'bottom'
676
- | 'top-and-bottom'
677
- | 'select-sticky'
678
- | 'select-top'
679
- | 'select-bottom';
687
+ editDisplayMode?: 'cell' | 'custom' | 'modal' | 'row' | 'table';
680
688
  enableBottomToolbar?: boolean;
681
689
  enableClickToCopy?: boolean;
682
690
  enableColumnActions?: boolean;
@@ -685,7 +693,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
685
693
  enableColumnOrdering?: boolean;
686
694
  enableColumnVirtualization?: boolean;
687
695
  enableDensityToggle?: boolean;
688
- enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
696
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
689
697
  enableExpandAll?: boolean;
690
698
  enableFacetedValues?: boolean;
691
699
  enableFilterMatchHighlighting?: boolean;
@@ -697,7 +705,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
697
705
  enableRowDragging?: boolean;
698
706
  enableRowNumbers?: boolean;
699
707
  enableRowOrdering?: boolean;
700
- enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean);
708
+ enableRowSelection?: ((row: MRT_Row<TData>) => boolean) | boolean;
701
709
  enableRowVirtualization?: boolean;
702
710
  enableSelectAll?: boolean;
703
711
  enableStickyFooter?: boolean;
@@ -719,7 +727,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
719
727
  /**
720
728
  * 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
721
729
  */
722
- layoutMode?: 'semantic' | 'grid';
730
+ layoutMode?: 'grid' | 'semantic';
723
731
  /**
724
732
  * Pass in either a locale imported from `material-react-table/locales/*` or a custom locale object.
725
733
  *
@@ -735,186 +743,200 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
735
743
  */
736
744
  memoMode?: 'cells' | 'rows' | 'table-body';
737
745
  muiBottomToolbarProps?:
738
- | ToolbarProps
739
- | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
740
- muiExpandAllButtonProps?:
741
- | IconButtonProps
742
- | ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps);
743
- muiExpandButtonProps?:
744
- | IconButtonProps
745
- | ((props: {
746
- table: MRT_TableInstance<TData>;
747
- row: MRT_Row<TData>;
748
- }) => IconButtonProps);
749
- muiLinearProgressProps?:
750
- | LinearProgressProps
746
+ | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps)
747
+ | ToolbarProps;
748
+ muiColumnActionsButtonProps?:
751
749
  | ((props: {
752
- isTopToolbar: boolean;
750
+ column: MRT_Column<TData>;
753
751
  table: MRT_TableInstance<TData>;
754
- }) => LinearProgressProps);
755
- muiSearchTextFieldProps?:
756
- | TextFieldProps
757
- | ((props: { table: MRT_TableInstance<TData> }) => TextFieldProps);
758
- muiSelectAllCheckboxProps?:
759
- | CheckboxProps
760
- | ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps);
761
- muiSelectCheckboxProps?:
762
- | (CheckboxProps | RadioProps)
752
+ }) => IconButtonProps)
753
+ | IconButtonProps;
754
+ muiColumnDragHandleProps?:
763
755
  | ((props: {
756
+ column: MRT_Column<TData>;
764
757
  table: MRT_TableInstance<TData>;
765
- row: MRT_Row<TData>;
766
- }) => CheckboxProps | RadioProps);
758
+ }) => IconButtonProps)
759
+ | IconButtonProps;
767
760
  muiCopyButtonProps?:
768
- | ButtonProps
769
761
  | ((props: {
770
762
  cell: MRT_Cell<TData>;
771
763
  column: MRT_Column<TData>;
772
764
  row: MRT_Row<TData>;
773
765
  table: MRT_TableInstance<TData>;
774
- }) => ButtonProps);
775
- muiEditTextFieldProps?:
776
- | TextFieldProps
766
+ }) => ButtonProps)
767
+ | ButtonProps;
768
+ muiCreateRowModalProps?:
777
769
  | ((props: {
778
- cell: MRT_Cell<TData>;
779
- column: MRT_Column<TData>;
780
770
  row: MRT_Row<TData>;
781
771
  table: MRT_TableInstance<TData>;
782
- }) => TextFieldProps);
783
- muiTableBodyCellProps?:
784
- | TableCellProps
772
+ }) => DialogProps)
773
+ | DialogProps;
774
+ muiDetailPanelProps?:
785
775
  | ((props: {
786
- cell: MRT_Cell<TData>;
787
- column: MRT_Column<TData>;
788
776
  row: MRT_Row<TData>;
789
777
  table: MRT_TableInstance<TData>;
790
- }) => TableCellProps);
791
- muiSkeletonProps?:
792
- | SkeletonProps
778
+ }) => TableCellProps)
779
+ | TableCellProps;
780
+ muiEditRowModalProps?:
793
781
  | ((props: {
794
- cell: MRT_Cell<TData>;
795
- column: MRT_Column<TData>;
796
782
  row: MRT_Row<TData>;
797
783
  table: MRT_TableInstance<TData>;
798
- }) => SkeletonProps);
799
- muiTableBodyProps?:
800
- | TableBodyProps
801
- | ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps);
802
- muiRowDragHandleProps?:
803
- | IconButtonProps
784
+ }) => DialogProps)
785
+ | DialogProps;
786
+ muiEditTextFieldProps?:
804
787
  | ((props: {
805
- table: MRT_TableInstance<TData>;
788
+ cell: MRT_Cell<TData>;
789
+ column: MRT_Column<TData>;
806
790
  row: MRT_Row<TData>;
807
- }) => IconButtonProps);
808
- muiTableBodyRowProps?:
809
- | TableRowProps
791
+ table: MRT_TableInstance<TData>;
792
+ }) => TextFieldProps)
793
+ | TextFieldProps;
794
+ muiExpandAllButtonProps?:
795
+ | ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps)
796
+ | IconButtonProps;
797
+ muiExpandButtonProps?:
810
798
  | ((props: {
811
- isDetailPanel?: boolean;
812
799
  row: MRT_Row<TData>;
813
- staticRowIndex: number;
814
800
  table: MRT_TableInstance<TData>;
815
- }) => TableRowProps);
816
- muiTableContainerProps?:
817
- | TableContainerProps
818
- | ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps);
819
- muiDetailPanelProps?:
820
- | TableCellProps
801
+ }) => IconButtonProps)
802
+ | IconButtonProps;
803
+ muiFilterAutocompleteProps?:
821
804
  | ((props: {
805
+ column: MRT_Column<TData>;
822
806
  table: MRT_TableInstance<TData>;
823
- row: MRT_Row<TData>;
824
- }) => TableCellProps);
825
- muiTableFooterCellProps?:
826
- | TableCellProps
807
+ }) => AutocompleteProps<any, any, any, any>)
808
+ | AutocompleteProps<any, any, any, any>;
809
+ muiFilterCheckboxProps?:
827
810
  | ((props: {
828
- table: MRT_TableInstance<TData>;
829
811
  column: MRT_Column<TData>;
830
- }) => TableCellProps);
831
- muiTableFooterProps?:
832
- | TableFooterProps
833
- | ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps);
834
- muiTableFooterRowProps?:
835
- | TableRowProps
836
- | ((props: {
837
812
  table: MRT_TableInstance<TData>;
838
- footerGroup: MRT_HeaderGroup<TData>;
839
- }) => TableRowProps);
840
- muiColumnActionsButtonProps?:
841
- | IconButtonProps
813
+ }) => CheckboxProps)
814
+ | CheckboxProps;
815
+ muiFilterDatePickerProps?:
842
816
  | ((props: {
843
- table: MRT_TableInstance<TData>;
844
817
  column: MRT_Column<TData>;
845
- }) => IconButtonProps);
846
- muiColumnDragHandleProps?:
847
- | IconButtonProps
848
- | ((props: {
818
+ rangeFilterIndex?: number;
849
819
  table: MRT_TableInstance<TData>;
850
- column: MRT_Column<TData>;
851
- }) => IconButtonProps);
852
- muiFilterCheckboxProps?:
853
- | CheckboxProps
820
+ }) => DatePickerProps<any>)
821
+ | DatePickerProps<any>;
822
+ muiFilterSliderProps?:
854
823
  | ((props: {
855
824
  column: MRT_Column<TData>;
856
825
  table: MRT_TableInstance<TData>;
857
- }) => CheckboxProps);
826
+ }) => SliderProps)
827
+ | SliderProps;
858
828
  muiFilterTextFieldProps?:
859
- | TextFieldProps
860
829
  | ((props: {
861
- table: MRT_TableInstance<TData>;
862
830
  column: MRT_Column<TData>;
863
831
  rangeFilterIndex?: number;
864
- }) => TextFieldProps);
865
- muiFilterSliderProps?:
866
- | SliderProps
832
+ table: MRT_TableInstance<TData>;
833
+ }) => TextFieldProps)
834
+ | TextFieldProps;
835
+ muiLinearProgressProps?:
836
+ | ((props: {
837
+ isTopToolbar: boolean;
838
+ table: MRT_TableInstance<TData>;
839
+ }) => LinearProgressProps)
840
+ | LinearProgressProps;
841
+ muiRowDragHandleProps?:
867
842
  | ((props: {
843
+ row: MRT_Row<TData>;
844
+ table: MRT_TableInstance<TData>;
845
+ }) => IconButtonProps)
846
+ | IconButtonProps;
847
+ muiSearchTextFieldProps?:
848
+ | ((props: { table: MRT_TableInstance<TData> }) => TextFieldProps)
849
+ | TextFieldProps;
850
+ muiSelectAllCheckboxProps?:
851
+ | ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps)
852
+ | CheckboxProps;
853
+ muiSelectCheckboxProps?:
854
+ | ((props: {
855
+ row: MRT_Row<TData>;
868
856
  table: MRT_TableInstance<TData>;
857
+ }) => CheckboxProps | RadioProps)
858
+ | (CheckboxProps | RadioProps);
859
+ muiSkeletonProps?:
860
+ | ((props: {
861
+ cell: MRT_Cell<TData>;
869
862
  column: MRT_Column<TData>;
870
- }) => SliderProps);
871
- muiCreateRowModalProps?:
872
- | DialogProps
863
+ row: MRT_Row<TData>;
864
+ table: MRT_TableInstance<TData>;
865
+ }) => SkeletonProps)
866
+ | SkeletonProps;
867
+ muiTableBodyCellProps?:
873
868
  | ((props: {
869
+ cell: MRT_Cell<TData>;
870
+ column: MRT_Column<TData>;
874
871
  row: MRT_Row<TData>;
875
872
  table: MRT_TableInstance<TData>;
876
- }) => DialogProps);
877
- muiEditRowModalProps?:
878
- | DialogProps
873
+ }) => TableCellProps)
874
+ | TableCellProps;
875
+ muiTableBodyProps?:
876
+ | ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps)
877
+ | TableBodyProps;
878
+ muiTableBodyRowProps?:
879
879
  | ((props: {
880
+ isDetailPanel?: boolean;
880
881
  row: MRT_Row<TData>;
882
+ staticRowIndex: number;
881
883
  table: MRT_TableInstance<TData>;
882
- }) => DialogProps);
883
- muiTableHeadCellProps?:
884
- | TableCellProps
884
+ }) => TableRowProps)
885
+ | TableRowProps;
886
+ muiTableContainerProps?:
887
+ | ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps)
888
+ | TableContainerProps;
889
+ muiTableFooterCellProps?:
885
890
  | ((props: {
891
+ column: MRT_Column<TData>;
892
+ table: MRT_TableInstance<TData>;
893
+ }) => TableCellProps)
894
+ | TableCellProps;
895
+ muiTableFooterProps?:
896
+ | ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps)
897
+ | TableFooterProps;
898
+ muiTableFooterRowProps?:
899
+ | ((props: {
900
+ footerGroup: MRT_HeaderGroup<TData>;
886
901
  table: MRT_TableInstance<TData>;
902
+ }) => TableRowProps)
903
+ | TableRowProps;
904
+ muiTableHeadCellProps?:
905
+ | ((props: {
887
906
  column: MRT_Column<TData>;
888
- }) => TableCellProps);
907
+ table: MRT_TableInstance<TData>;
908
+ }) => TableCellProps)
909
+ | TableCellProps;
889
910
  muiTableHeadProps?:
890
- | TableHeadProps
891
- | ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps);
911
+ | ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps)
912
+ | TableHeadProps;
892
913
  muiTableHeadRowProps?:
893
- | TableRowProps
894
914
  | ((props: {
895
- table: MRT_TableInstance<TData>;
896
915
  headerGroup: MRT_HeaderGroup<TData>;
897
- }) => TableRowProps);
916
+ table: MRT_TableInstance<TData>;
917
+ }) => TableRowProps)
918
+ | TableRowProps;
898
919
  muiTablePaginationProps?:
899
- | Partial<Omit<TablePaginationProps, 'rowsPerPage'>>
900
920
  | ((props: {
901
921
  table: MRT_TableInstance<TData>;
902
- }) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
922
+ }) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>)
923
+ | Partial<Omit<TablePaginationProps, 'rowsPerPage'>>;
903
924
  muiTablePaperProps?:
904
- | PaperProps
905
- | ((props: { table: MRT_TableInstance<TData> }) => PaperProps);
925
+ | ((props: { table: MRT_TableInstance<TData> }) => PaperProps)
926
+ | PaperProps;
906
927
  muiTableProps?:
907
- | TableProps
908
- | ((props: { table: MRT_TableInstance<TData> }) => TableProps);
928
+ | ((props: { table: MRT_TableInstance<TData> }) => TableProps)
929
+ | TableProps;
909
930
  muiToolbarAlertBannerChipProps?:
910
- | ChipProps
911
- | ((props: { table: MRT_TableInstance<TData> }) => ChipProps);
931
+ | ((props: { table: MRT_TableInstance<TData> }) => ChipProps)
932
+ | ChipProps;
912
933
  muiToolbarAlertBannerProps?:
913
- | AlertProps
914
- | ((props: { table: MRT_TableInstance<TData> }) => AlertProps);
934
+ | ((props: { table: MRT_TableInstance<TData> }) => AlertProps)
935
+ | AlertProps;
915
936
  muiTopToolbarProps?:
916
- | ToolbarProps
917
- | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
937
+ | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps)
938
+ | ToolbarProps;
939
+ onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
918
940
  onCreatingRowCancel?: (props: {
919
941
  row: MRT_Row<TData>;
920
942
  table: MRT_TableInstance<TData>;
@@ -926,7 +948,6 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
926
948
  table: MRT_TableInstance<TData>;
927
949
  values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
928
950
  }) => void;
929
- onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
930
951
  onDensityChange?: OnChangeFn<MRT_DensityState>;
931
952
  onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
932
953
  onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
@@ -943,38 +964,29 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
943
964
  values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
944
965
  }) => Promise<void> | void;
945
966
  onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
946
- onHoveredColumnChange?: OnChangeFn<MRT_Column<TData> | { id: string } | null>;
947
- onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | { id: string } | null>;
967
+ onHoveredColumnChange?: OnChangeFn<{ id: string } | MRT_Column<TData> | null>;
968
+ onHoveredRowChange?: OnChangeFn<{ id: string } | MRT_Row<TData> | null>;
948
969
  onIsFullScreenChange?: OnChangeFn<boolean>;
949
970
  onShowAlertBannerChange?: OnChangeFn<boolean>;
950
971
  onShowColumnFiltersChange?: OnChangeFn<boolean>;
951
972
  onShowGlobalFilterChange?: OnChangeFn<boolean>;
952
973
  onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
974
+ paginationDisplayMode?: 'custom' | 'default' | 'pages';
953
975
  positionActionsColumn?: 'first' | 'last';
954
976
  positionExpandColumn?: 'first' | 'last';
955
- positionGlobalFilter?: 'left' | 'right' | 'none';
956
- positionPagination?: 'bottom' | 'top' | 'both' | 'none';
957
- positionToolbarAlertBanner?: 'bottom' | 'top' | 'none';
958
- positionToolbarDropZone?: 'bottom' | 'top' | 'none' | 'both';
977
+ positionGlobalFilter?: 'left' | 'none' | 'right';
978
+ positionPagination?: 'both' | 'bottom' | 'none' | 'top';
979
+ positionToolbarAlertBanner?: 'bottom' | 'none' | 'top';
980
+ positionToolbarDropZone?: 'both' | 'bottom' | 'none' | 'top';
959
981
  renderBottomToolbar?:
960
- | ReactNode
961
- | ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
982
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
983
+ | ReactNode;
962
984
  renderBottomToolbarCustomActions?: (props: {
963
985
  table: MRT_TableInstance<TData>;
964
986
  }) => ReactNode;
965
- renderCreateRowModalContent?: (props: {
966
- internalEditComponents: ReactNode[];
967
- row: MRT_Row<TData>;
968
- table: MRT_TableInstance<TData>;
969
- }) => ReactNode;
970
- renderEditRowModalContent?: (props: {
971
- internalEditComponents: ReactNode[];
972
- row: MRT_Row<TData>;
973
- table: MRT_TableInstance<TData>;
974
- }) => ReactNode;
975
987
  renderColumnActionsMenuItems?: (props: {
976
- column: MRT_Column<TData>;
977
988
  closeMenu: () => void;
989
+ column: MRT_Column<TData>;
978
990
  internalColumnMenuItems: ReactNode[];
979
991
  table: MRT_TableInstance<TData>;
980
992
  }) => ReactNode[];
@@ -984,18 +996,28 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
984
996
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
985
997
  table: MRT_TableInstance<TData>;
986
998
  }) => ReactNode[];
999
+ renderCreateRowModalContent?: (props: {
1000
+ internalEditComponents: ReactNode[];
1001
+ row: MRT_Row<TData>;
1002
+ table: MRT_TableInstance<TData>;
1003
+ }) => ReactNode;
987
1004
  renderDetailPanel?: (props: {
988
1005
  row: MRT_Row<TData>;
989
1006
  table: MRT_TableInstance<TData>;
990
1007
  }) => ReactNode;
1008
+ renderEditRowModalContent?: (props: {
1009
+ internalEditComponents: ReactNode[];
1010
+ row: MRT_Row<TData>;
1011
+ table: MRT_TableInstance<TData>;
1012
+ }) => ReactNode;
1013
+ renderEmptyRowsFallback?: (props: {
1014
+ table: MRT_TableInstance<TData>;
1015
+ }) => ReactNode;
991
1016
  renderGlobalFilterModeMenuItems?: (props: {
992
1017
  internalFilterOptions: MRT_InternalFilterOption[];
993
1018
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
994
1019
  table: MRT_TableInstance<TData>;
995
1020
  }) => ReactNode[];
996
- renderEmptyRowsFallback?: (props: {
997
- table: MRT_TableInstance<TData>;
998
- }) => ReactNode;
999
1021
  renderRowActionMenuItems?: (props: {
1000
1022
  closeMenu: () => void;
1001
1023
  row: MRT_Row<TData>;
@@ -1010,23 +1032,32 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
1010
1032
  table: MRT_TableInstance<TData>;
1011
1033
  }) => ReactNode;
1012
1034
  renderTopToolbar?:
1013
- | ReactNode
1014
- | ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
1035
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
1036
+ | ReactNode;
1015
1037
  renderTopToolbarCustomActions?: (props: {
1016
1038
  table: MRT_TableInstance<TData>;
1017
1039
  }) => ReactNode;
1018
1040
  rowCount?: number;
1019
1041
  rowNumberMode?: 'original' | 'static';
1042
+ rowPinningDisplayMode?:
1043
+ | 'bottom'
1044
+ | 'select-bottom'
1045
+ | 'select-sticky'
1046
+ | 'select-top'
1047
+ | 'sticky'
1048
+ | 'top'
1049
+ | 'top-and-bottom';
1020
1050
  rowVirtualizerInstanceRef?: MutableRefObject<Virtualizer<
1021
1051
  HTMLDivElement,
1022
1052
  HTMLTableRowElement
1023
1053
  > | null>;
1024
1054
  rowVirtualizerOptions?:
1025
- | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>
1026
1055
  | ((props: {
1027
1056
  table: MRT_TableInstance<TData>;
1028
- }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>);
1057
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>)
1058
+ | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
1029
1059
  selectAllMode?: 'all' | 'page';
1060
+ selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
1030
1061
  /**
1031
1062
  * Manage state externally any way you want, then pass it back into MRT.
1032
1063
  */