material-react-table 2.0.0-alpha.1 → 2.0.0-alpha.2

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 (134) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/index.js +2400 -2365
  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/menus/MRT_ColumnActionMenu.d.ts +4 -4
  15. package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  16. package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -2
  17. package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +1 -1
  18. package/dist/cjs/types/types.d.ts +198 -198
  19. package/dist/esm/material-react-table.esm.js +2027 -1993
  20. package/dist/esm/material-react-table.esm.js.map +1 -1
  21. package/dist/esm/types/MaterialReactTable.d.ts +1 -1
  22. package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
  23. package/dist/esm/types/buttons/MRT_RowPinButton.d.ts +2 -2
  24. package/dist/esm/types/column.utils.d.ts +6 -6
  25. package/dist/esm/types/filterFns.d.ts +14 -14
  26. package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  27. package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  28. package/dist/esm/types/hooks/useMRT_DisplayColumns.d.ts +3 -3
  29. package/dist/esm/types/icons.d.ts +1 -1
  30. package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +1 -1
  31. package/dist/esm/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
  32. package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  33. package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -2
  34. package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +1 -1
  35. package/dist/esm/types/types.d.ts +198 -198
  36. package/dist/index.d.ts +239 -239
  37. package/locales/fr.esm.js +1 -1
  38. package/locales/fr.esm.js.map +1 -1
  39. package/locales/fr.js +1 -1
  40. package/locales/fr.js.map +1 -1
  41. package/locales/tr.d.ts +2 -0
  42. package/locales/tr.esm.d.ts +2 -0
  43. package/locales/tr.esm.js +93 -0
  44. package/locales/tr.esm.js.map +1 -0
  45. package/locales/tr.js +97 -0
  46. package/locales/tr.js.map +1 -0
  47. package/locales/uk.d.ts +2 -0
  48. package/locales/uk.esm.d.ts +2 -0
  49. package/locales/uk.esm.js +93 -0
  50. package/locales/uk.esm.js.map +1 -0
  51. package/locales/uk.js +97 -0
  52. package/locales/uk.js.map +1 -0
  53. package/locales/vi.d.ts +2 -0
  54. package/locales/vi.esm.d.ts +2 -0
  55. package/locales/vi.esm.js +93 -0
  56. package/locales/vi.esm.js.map +1 -0
  57. package/locales/vi.js +97 -0
  58. package/locales/vi.js.map +1 -0
  59. package/locales/zh-Hans.d.ts +2 -0
  60. package/locales/zh-Hans.esm.d.ts +2 -0
  61. package/locales/zh-Hans.esm.js +93 -0
  62. package/locales/zh-Hans.esm.js.map +1 -0
  63. package/locales/zh-Hans.js +97 -0
  64. package/locales/zh-Hans.js.map +1 -0
  65. package/locales/zh-Hant.d.ts +2 -0
  66. package/locales/zh-Hant.esm.d.ts +2 -0
  67. package/locales/zh-Hant.esm.js +93 -0
  68. package/locales/zh-Hant.esm.js.map +1 -0
  69. package/locales/zh-Hant.js +97 -0
  70. package/locales/zh-Hant.js.map +1 -0
  71. package/package.json +2 -1
  72. package/src/MaterialReactTable.tsx +2 -2
  73. package/src/body/MRT_TableBody.tsx +9 -9
  74. package/src/body/MRT_TableBodyCell.tsx +22 -22
  75. package/src/body/MRT_TableBodyCellValue.tsx +5 -5
  76. package/src/body/MRT_TableBodyRow.tsx +32 -32
  77. package/src/body/MRT_TableBodyRowGrabHandle.tsx +2 -2
  78. package/src/body/MRT_TableBodyRowPinButton.tsx +3 -3
  79. package/src/body/MRT_TableDetailPanel.tsx +3 -3
  80. package/src/buttons/MRT_CopyButton.tsx +1 -1
  81. package/src/buttons/MRT_EditActionButtons.tsx +4 -4
  82. package/src/buttons/MRT_ExpandAllButton.tsx +3 -3
  83. package/src/buttons/MRT_ExpandButton.tsx +1 -1
  84. package/src/buttons/MRT_GrabHandleButton.tsx +10 -10
  85. package/src/buttons/MRT_RowPinButton.tsx +5 -5
  86. package/src/buttons/MRT_ShowHideColumnsButton.tsx +1 -1
  87. package/src/buttons/MRT_ToggleFullScreenButton.tsx +2 -2
  88. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +8 -8
  89. package/src/column.utils.ts +23 -17
  90. package/src/filterFns.ts +29 -29
  91. package/src/footer/MRT_TableFooter.tsx +9 -9
  92. package/src/footer/MRT_TableFooterCell.tsx +1 -1
  93. package/src/footer/MRT_TableFooterRow.tsx +2 -2
  94. package/src/head/MRT_TableHead.tsx +9 -9
  95. package/src/head/MRT_TableHeadCell.tsx +10 -6
  96. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +9 -6
  97. package/src/head/MRT_TableHeadCellFilterContainer.tsx +11 -4
  98. package/src/head/MRT_TableHeadCellFilterLabel.tsx +106 -61
  99. package/src/head/MRT_TableHeadCellGrabHandle.tsx +2 -2
  100. package/src/head/MRT_TableHeadCellResizeHandle.tsx +11 -11
  101. package/src/head/MRT_TableHeadCellSortLabel.tsx +8 -8
  102. package/src/head/MRT_TableHeadRow.tsx +2 -2
  103. package/src/hooks/useMRT_DisplayColumns.tsx +5 -5
  104. package/src/hooks/useMRT_Effects.ts +3 -3
  105. package/src/hooks/useMRT_TableInstance.ts +15 -14
  106. package/src/hooks/useMRT_TableOptions.ts +3 -3
  107. package/src/icons.ts +2 -2
  108. package/src/inputs/MRT_EditCellTextField.tsx +9 -9
  109. package/src/inputs/MRT_FilterCheckbox.tsx +7 -7
  110. package/src/inputs/MRT_FilterRangeFields.tsx +1 -1
  111. package/src/inputs/MRT_FilterRangeSlider.tsx +6 -6
  112. package/src/inputs/MRT_FilterTextField.tsx +75 -75
  113. package/src/inputs/MRT_GlobalFilterTextField.tsx +26 -26
  114. package/src/inputs/MRT_SelectCheckbox.tsx +7 -7
  115. package/src/locales/fr.ts +1 -1
  116. package/src/menus/MRT_ColumnActionMenu.tsx +14 -14
  117. package/src/menus/MRT_FilterOptionMenu.tsx +35 -35
  118. package/src/menus/MRT_RowActionMenu.tsx +7 -7
  119. package/src/menus/MRT_ShowHideColumnsMenu.tsx +6 -6
  120. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +5 -5
  121. package/src/modals/MRT_EditRowModal.tsx +8 -8
  122. package/src/sortingFns.ts +1 -1
  123. package/src/table/MRT_Table.tsx +7 -7
  124. package/src/table/MRT_TableContainer.tsx +10 -10
  125. package/src/table/MRT_TablePaper.tsx +9 -9
  126. package/src/toolbar/MRT_BottomToolbar.tsx +5 -5
  127. package/src/toolbar/MRT_LinearProgressBar.tsx +4 -4
  128. package/src/toolbar/MRT_TablePagination.tsx +19 -19
  129. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +4 -4
  130. package/src/toolbar/MRT_ToolbarDropZone.tsx +6 -6
  131. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +8 -5
  132. package/src/toolbar/MRT_TopToolbar.tsx +7 -7
  133. package/src/types.ts +263 -263
  134. 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,35 @@ 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 AlertProps } from '@mui/material/Alert';
42
+ import { type ButtonProps } from '@mui/material/Button';
43
+ import { type CheckboxProps } from '@mui/material/Checkbox';
44
+ import { type ChipProps } from '@mui/material/Chip';
45
+ import { type DialogProps } from '@mui/material/Dialog';
46
+ import { type IconButtonProps } from '@mui/material/IconButton';
47
+ import { type LinearProgressProps } from '@mui/material/LinearProgress';
48
+ import { type PaperProps } from '@mui/material/Paper';
49
+ import { type RadioProps } from '@mui/material/Radio';
50
+ import { type SkeletonProps } from '@mui/material/Skeleton';
51
+ import { type SliderProps } from '@mui/material/Slider';
52
+ import { type TableProps } from '@mui/material/Table';
53
+ import { type TableBodyProps } from '@mui/material/TableBody';
54
+ import { type TableCellProps } from '@mui/material/TableCell';
55
+ import { type TableContainerProps } from '@mui/material/TableContainer';
56
+ import { type TableFooterProps } from '@mui/material/TableFooter';
57
+ import { type TableHeadProps } from '@mui/material/TableHead';
58
+ import { type TablePaginationProps } from '@mui/material/TablePagination';
59
+ import { type TableRowProps } from '@mui/material/TableRow';
60
+ import { type TextFieldProps } from '@mui/material/TextField';
61
+ import { type ToolbarProps } from '@mui/material/Toolbar';
62
62
  import { type MRT_AggregationFns } from './aggregationFns';
63
63
  import { type MRT_FilterFns } from './filterFns';
64
- import { type MRT_SortingFns } from './sortingFns';
65
64
  import { type MRT_Icons } from './icons';
65
+ import { type MRT_SortingFns } from './sortingFns';
66
66
 
67
67
  export type { MRT_Icons };
68
68
  export type LiteralUnion<T extends U, U = string> =
@@ -129,10 +129,9 @@ export interface MRT_Localization {
129
129
  filterFuzzy: string;
130
130
  filterGreaterThan: string;
131
131
  filterGreaterThanOrEqualTo: string;
132
+ filterInNumberRange: string;
132
133
  filterIncludesString: string;
133
134
  filterIncludesStringSensitive: string;
134
- filteringByColumn: string;
135
- filterInNumberRange: string;
136
135
  filterLessThan: string;
137
136
  filterLessThanOrEqualTo: string;
138
137
  filterMode: string;
@@ -140,6 +139,7 @@ export interface MRT_Localization {
140
139
  filterNotEquals: string;
141
140
  filterStartsWith: string;
142
141
  filterWeakEquals: string;
142
+ filteringByColumn: string;
143
143
  goToFirstPage: string;
144
144
  goToLastPage: string;
145
145
  goToNextPage: string;
@@ -244,14 +244,14 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
244
244
  filterInputRefs: MutableRefObject<Record<string, HTMLInputElement>>;
245
245
  searchInputRef: MutableRefObject<HTMLInputElement>;
246
246
  tableContainerRef: MutableRefObject<HTMLDivElement>;
247
+ tableFooterRef: MutableRefObject<HTMLTableSectionElement>;
247
248
  tableHeadCellRefs: MutableRefObject<Record<string, HTMLTableCellElement>>;
249
+ tableHeadRef: MutableRefObject<HTMLTableSectionElement>;
248
250
  tablePaperRef: MutableRefObject<HTMLDivElement>;
249
251
  topToolbarRef: MutableRefObject<HTMLDivElement>;
250
- tableHeadRef: MutableRefObject<HTMLTableSectionElement>;
251
- tableFooterRef: MutableRefObject<HTMLTableSectionElement>;
252
252
  };
253
- setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
254
253
  setColumnFilterFns: Dispatch<SetStateAction<MRT_ColumnFilterFnsState>>;
254
+ setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
255
255
  setDensity: Dispatch<SetStateAction<MRT_DensityState>>;
256
256
  setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
257
257
  setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
@@ -259,10 +259,10 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
259
259
  setEditingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
260
260
  setGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
261
261
  setHoveredColumn: Dispatch<
262
- SetStateAction<MRT_Column<TData> | { id: string } | null>
262
+ SetStateAction<{ id: string } | MRT_Column<TData> | null>
263
263
  >;
264
264
  setHoveredRow: Dispatch<
265
- SetStateAction<MRT_Row<TData> | { id: string } | null>
265
+ SetStateAction<{ id: string } | MRT_Row<TData> | null>
266
266
  >;
267
267
  setIsFullScreen: Dispatch<SetStateAction<boolean>>;
268
268
  setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
@@ -273,8 +273,8 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
273
273
 
274
274
  export type MRT_DefinedTableOptions<TData extends Record<string, any>> =
275
275
  MRT_TableOptions<TData> & {
276
- localization: MRT_Localization;
277
276
  icons: MRT_Icons;
277
+ localization: MRT_Localization;
278
278
  };
279
279
 
280
280
  export type MRT_TableState<TData extends Record<string, any>> = TableState & {
@@ -286,8 +286,8 @@ export type MRT_TableState<TData extends Record<string, any>> = TableState & {
286
286
  editingCell: MRT_Cell<TData> | null;
287
287
  editingRow: MRT_Row<TData> | null;
288
288
  globalFilterFn: MRT_FilterOption;
289
- hoveredColumn: MRT_Column<TData> | { id: string } | null;
290
- hoveredRow: MRT_Row<TData> | { id: string } | null;
289
+ hoveredColumn: { id: string } | MRT_Column<TData> | null;
290
+ hoveredRow: { id: string } | MRT_Row<TData> | null;
291
291
  isFullScreen: boolean;
292
292
  isLoading: boolean;
293
293
  isSaving: boolean;
@@ -320,8 +320,8 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
320
320
  }) => ReactNode;
321
321
  Cell?: (props: {
322
322
  cell: MRT_Cell<TData>;
323
- renderedCellValue: number | string | ReactNode;
324
323
  column: MRT_Column<TData>;
324
+ renderedCellValue: ReactNode | number | string;
325
325
  row: MRT_Row<TData>;
326
326
  rowRef?: RefObject<HTMLTableRowElement>;
327
327
  table: MRT_TableInstance<TData>;
@@ -339,12 +339,12 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
339
339
  table: MRT_TableInstance<TData>;
340
340
  }) => ReactNode;
341
341
  Footer?:
342
- | ReactNode
343
342
  | ((props: {
344
343
  column: MRT_Column<TData>;
345
344
  footer: MRT_Header<TData>;
346
345
  table: MRT_TableInstance<TData>;
347
- }) => ReactNode);
346
+ }) => ReactNode)
347
+ | ReactNode;
348
348
  GroupedCell?: (props: {
349
349
  cell: MRT_Cell<TData>;
350
350
  column: MRT_Column<TData>;
@@ -352,12 +352,12 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
352
352
  table: MRT_TableInstance<TData>;
353
353
  }) => ReactNode;
354
354
  Header?:
355
- | ReactNode
356
355
  | ((props: {
357
356
  column: MRT_Column<TData>;
358
357
  header: MRT_Header<TData>;
359
358
  table: MRT_TableInstance<TData>;
360
- }) => ReactNode);
359
+ }) => ReactNode)
360
+ | ReactNode;
361
361
  PlaceholderCell?: (props: {
362
362
  cell: MRT_Cell<TData>;
363
363
  column: MRT_Column<TData>;
@@ -379,8 +379,8 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
379
379
  * @example accessorKey: 'username' //simple
380
380
  * @example accessorKey: 'name.firstName' //deep key dot notation
381
381
  */
382
- accessorKey?: (string & {}) | DeepKeys<TData>;
383
- aggregationFn?: MRT_AggregationFn<TData> | Array<MRT_AggregationFn<TData>>;
382
+ accessorKey?: DeepKeys<TData> | (string & {});
383
+ aggregationFn?: Array<MRT_AggregationFn<TData>> | MRT_AggregationFn<TData>;
384
384
  /**
385
385
  * Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
386
386
  * Leave this blank if you are just creating a normal data column.
@@ -394,17 +394,17 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
394
394
  LiteralUnion<string & MRT_FilterOption>
395
395
  > | null;
396
396
  columns?: MRT_ColumnDef<TData>[];
397
- editSelectOptions?: (string | { text: string; value: any })[];
398
- editVariant?: 'text' | 'select';
397
+ editSelectOptions?: ({ text: string; value: any } | string)[];
398
+ editVariant?: 'select' | 'text';
399
399
  enableClickToCopy?: boolean;
400
400
  enableColumnActions?: boolean;
401
401
  enableColumnDragging?: boolean;
402
402
  enableColumnFilterModes?: boolean;
403
403
  enableColumnOrdering?: boolean;
404
- enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
404
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
405
405
  enableFilterMatchHighlighting?: boolean;
406
406
  filterFn?: MRT_FilterFn<TData>;
407
- filterSelectOptions?: (string | { text: string; value: any })[];
407
+ filterSelectOptions?: ({ text: string; value: any } | string)[];
408
408
  filterVariant?:
409
409
  | 'checkbox'
410
410
  | 'multi-select'
@@ -430,73 +430,73 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
430
430
  * @default gets set to the same value as `accessorKey` by default
431
431
  */
432
432
  id?: LiteralUnion<string & keyof TData>;
433
- muiCopyButtonProps?:
434
- | ButtonProps
433
+ muiColumnActionsButtonProps?:
435
434
  | ((props: {
436
- cell: MRT_Cell<TData>;
437
435
  column: MRT_Column<TData>;
438
- row: MRT_Row<TData>;
439
436
  table: MRT_TableInstance<TData>;
440
- }) => ButtonProps);
441
- muiEditTextFieldProps?:
442
- | TextFieldProps
437
+ }) => IconButtonProps)
438
+ | IconButtonProps;
439
+ muiColumnDragHandleProps?:
443
440
  | ((props: {
444
- cell: MRT_Cell<TData>;
445
441
  column: MRT_Column<TData>;
446
- row: MRT_Row<TData>;
447
442
  table: MRT_TableInstance<TData>;
448
- }) => TextFieldProps);
449
- muiTableBodyCellProps?:
450
- | TableCellProps
443
+ }) => IconButtonProps)
444
+ | IconButtonProps;
445
+ muiCopyButtonProps?:
451
446
  | ((props: {
452
447
  cell: MRT_Cell<TData>;
453
448
  column: MRT_Column<TData>;
454
449
  row: MRT_Row<TData>;
455
450
  table: MRT_TableInstance<TData>;
456
- }) => TableCellProps);
457
- muiTableFooterCellProps?:
458
- | TableCellProps
451
+ }) => ButtonProps)
452
+ | ButtonProps;
453
+ muiEditTextFieldProps?:
459
454
  | ((props: {
460
- table: MRT_TableInstance<TData>;
455
+ cell: MRT_Cell<TData>;
461
456
  column: MRT_Column<TData>;
462
- }) => TableCellProps);
463
- muiColumnActionsButtonProps?:
464
- | IconButtonProps
465
- | ((props: {
457
+ row: MRT_Row<TData>;
466
458
  table: MRT_TableInstance<TData>;
467
- column: MRT_Column<TData>;
468
- }) => IconButtonProps);
469
- muiColumnDragHandleProps?:
470
- | IconButtonProps
459
+ }) => TextFieldProps)
460
+ | TextFieldProps;
461
+ muiFilterCheckboxProps?:
471
462
  | ((props: {
472
- table: MRT_TableInstance<TData>;
473
463
  column: MRT_Column<TData>;
474
- }) => IconButtonProps);
475
- muiFilterCheckboxProps?:
476
- | CheckboxProps
464
+ table: MRT_TableInstance<TData>;
465
+ }) => CheckboxProps)
466
+ | CheckboxProps;
467
+ muiFilterSliderProps?:
477
468
  | ((props: {
478
469
  column: MRT_Column<TData>;
479
470
  table: MRT_TableInstance<TData>;
480
- }) => CheckboxProps);
471
+ }) => SliderProps)
472
+ | SliderProps;
481
473
  muiFilterTextFieldProps?:
482
- | TextFieldProps
483
474
  | ((props: {
484
- table: MRT_TableInstance<TData>;
485
475
  column: MRT_Column<TData>;
486
476
  rangeFilterIndex?: number;
487
- }) => TextFieldProps);
488
- muiFilterSliderProps?:
489
- | SliderProps
477
+ table: MRT_TableInstance<TData>;
478
+ }) => TextFieldProps)
479
+ | TextFieldProps;
480
+ muiTableBodyCellProps?:
490
481
  | ((props: {
482
+ cell: MRT_Cell<TData>;
483
+ column: MRT_Column<TData>;
484
+ row: MRT_Row<TData>;
491
485
  table: MRT_TableInstance<TData>;
486
+ }) => TableCellProps)
487
+ | TableCellProps;
488
+ muiTableFooterCellProps?:
489
+ | ((props: {
492
490
  column: MRT_Column<TData>;
493
- }) => SliderProps);
491
+ table: MRT_TableInstance<TData>;
492
+ }) => TableCellProps)
493
+ | TableCellProps;
494
494
  muiTableHeadCellProps?:
495
- | TableCellProps
496
495
  | ((props: {
497
- table: MRT_TableInstance<TData>;
498
496
  column: MRT_Column<TData>;
499
- }) => TableCellProps);
497
+ table: MRT_TableInstance<TData>;
498
+ }) => TableCellProps)
499
+ | TableCellProps;
500
500
  renderColumnActionsMenuItems?: (props: {
501
501
  closeMenu: () => void;
502
502
  column: MRT_Column<TData>;
@@ -514,16 +514,16 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
514
514
 
515
515
  export type MRT_DefinedColumnDef<TData extends Record<string, any>> = Omit<
516
516
  MRT_ColumnDef<TData>,
517
- 'id' | 'defaultDisplayColumn'
517
+ 'defaultDisplayColumn' | 'id'
518
518
  > & {
519
+ _filterFn: MRT_FilterOption;
519
520
  defaultDisplayColumn: Partial<MRT_ColumnDef<TData>>;
520
521
  id: string;
521
- _filterFn: MRT_FilterOption;
522
522
  };
523
523
 
524
524
  export type MRT_Column<TData extends Record<string, any>> = Omit<
525
525
  Column<TData, unknown>,
526
- 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'
526
+ 'columnDef' | 'columns' | 'filterFn' | 'footer' | 'header'
527
527
  > & {
528
528
  columnDef: MRT_DefinedColumnDef<TData>;
529
529
  columns?: MRT_Column<TData>[];
@@ -548,12 +548,12 @@ export type MRT_HeaderGroup<TData extends Record<string, any>> = Omit<
548
548
 
549
549
  export type MRT_Row<TData extends Record<string, any>> = Omit<
550
550
  Row<TData>,
551
- 'getVisibleCells' | 'getAllCells' | 'subRows' | '_valuesCache'
551
+ '_valuesCache' | 'getAllCells' | 'getVisibleCells' | 'subRows'
552
552
  > & {
553
+ _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
553
554
  getAllCells: () => MRT_Cell<TData>[];
554
555
  getVisibleCells: () => MRT_Cell<TData>[];
555
556
  subRows?: MRT_Row<TData>[];
556
- _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
557
557
  };
558
558
 
559
559
  export type MRT_Cell<TData extends Record<string, any>> = Omit<
@@ -575,8 +575,8 @@ export type MRT_SortingOption = LiteralUnion<
575
575
  >;
576
576
 
577
577
  export type MRT_SortingFn<TData extends Record<string, any>> =
578
- | SortingFn<TData>
579
- | MRT_SortingOption;
578
+ | MRT_SortingOption
579
+ | SortingFn<TData>;
580
580
 
581
581
  export type MRT_FilterOption = LiteralUnion<
582
582
  string & keyof typeof MRT_FilterFns
@@ -598,8 +598,8 @@ export type MRT_DisplayColumnIds =
598
598
  | 'mrt-row-drag'
599
599
  | 'mrt-row-expand'
600
600
  | 'mrt-row-numbers'
601
- | 'mrt-row-select'
602
- | 'mrt-row-pin';
601
+ | 'mrt-row-pin'
602
+ | 'mrt-row-select';
603
603
 
604
604
  /**
605
605
  * `columns` and `data` props are the only required props, but there are over 170 other optional props.
@@ -623,9 +623,19 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
623
623
  | 'onStateChange'
624
624
  | 'state'
625
625
  > & {
626
+ columnFilterDisplayMode?: 'custom' | 'popover' | 'subheader';
626
627
  columnFilterModeOptions?: Array<
627
628
  LiteralUnion<string & MRT_FilterOption>
628
629
  > | null;
630
+ columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<
631
+ HTMLDivElement,
632
+ HTMLTableCellElement
633
+ > | null>;
634
+ columnVirtualizerOptions?:
635
+ | ((props: {
636
+ table: MRT_TableInstance<TData>;
637
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>)
638
+ | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>;
629
639
  /**
630
640
  * The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
631
641
  *
@@ -637,15 +647,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
637
647
  * @link https://www.material-react-table.com/docs/api/column-options
638
648
  */
639
649
  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>>);
650
+ createDisplayMode?: 'custom' | 'modal' | 'row';
649
651
  /**
650
652
  * Pass your data as an array of objects. Objects can theoretically be any shape, but it's best to keep them consistent.
651
653
  *
@@ -664,19 +666,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
664
666
  displayColumnDefOptions?: Partial<{
665
667
  [key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef<TData>>;
666
668
  }>;
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';
669
+ editDisplayMode?: 'cell' | 'custom' | 'modal' | 'row' | 'table';
680
670
  enableBottomToolbar?: boolean;
681
671
  enableClickToCopy?: boolean;
682
672
  enableColumnActions?: boolean;
@@ -685,7 +675,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
685
675
  enableColumnOrdering?: boolean;
686
676
  enableColumnVirtualization?: boolean;
687
677
  enableDensityToggle?: boolean;
688
- enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
678
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
689
679
  enableExpandAll?: boolean;
690
680
  enableFacetedValues?: boolean;
691
681
  enableFilterMatchHighlighting?: boolean;
@@ -697,7 +687,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
697
687
  enableRowDragging?: boolean;
698
688
  enableRowNumbers?: boolean;
699
689
  enableRowOrdering?: boolean;
700
- enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean);
690
+ enableRowSelection?: ((row: MRT_Row<TData>) => boolean) | boolean;
701
691
  enableRowVirtualization?: boolean;
702
692
  enableSelectAll?: boolean;
703
693
  enableStickyFooter?: boolean;
@@ -719,7 +709,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
719
709
  /**
720
710
  * 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
711
  */
722
- layoutMode?: 'semantic' | 'grid';
712
+ layoutMode?: 'grid' | 'semantic';
723
713
  /**
724
714
  * Pass in either a locale imported from `material-react-table/locales/*` or a custom locale object.
725
715
  *
@@ -735,186 +725,187 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
735
725
  */
736
726
  memoMode?: 'cells' | 'rows' | 'table-body';
737
727
  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
728
+ | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps)
729
+ | ToolbarProps;
730
+ muiColumnActionsButtonProps?:
751
731
  | ((props: {
752
- isTopToolbar: boolean;
732
+ column: MRT_Column<TData>;
753
733
  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)
734
+ }) => IconButtonProps)
735
+ | IconButtonProps;
736
+ muiColumnDragHandleProps?:
763
737
  | ((props: {
738
+ column: MRT_Column<TData>;
764
739
  table: MRT_TableInstance<TData>;
765
- row: MRT_Row<TData>;
766
- }) => CheckboxProps | RadioProps);
740
+ }) => IconButtonProps)
741
+ | IconButtonProps;
767
742
  muiCopyButtonProps?:
768
- | ButtonProps
769
743
  | ((props: {
770
744
  cell: MRT_Cell<TData>;
771
745
  column: MRT_Column<TData>;
772
746
  row: MRT_Row<TData>;
773
747
  table: MRT_TableInstance<TData>;
774
- }) => ButtonProps);
775
- muiEditTextFieldProps?:
776
- | TextFieldProps
748
+ }) => ButtonProps)
749
+ | ButtonProps;
750
+ muiCreateRowModalProps?:
777
751
  | ((props: {
778
- cell: MRT_Cell<TData>;
779
- column: MRT_Column<TData>;
780
752
  row: MRT_Row<TData>;
781
753
  table: MRT_TableInstance<TData>;
782
- }) => TextFieldProps);
783
- muiTableBodyCellProps?:
784
- | TableCellProps
754
+ }) => DialogProps)
755
+ | DialogProps;
756
+ muiDetailPanelProps?:
785
757
  | ((props: {
786
- cell: MRT_Cell<TData>;
787
- column: MRT_Column<TData>;
788
758
  row: MRT_Row<TData>;
789
759
  table: MRT_TableInstance<TData>;
790
- }) => TableCellProps);
791
- muiSkeletonProps?:
792
- | SkeletonProps
760
+ }) => TableCellProps)
761
+ | TableCellProps;
762
+ muiEditRowModalProps?:
793
763
  | ((props: {
794
- cell: MRT_Cell<TData>;
795
- column: MRT_Column<TData>;
796
764
  row: MRT_Row<TData>;
797
765
  table: MRT_TableInstance<TData>;
798
- }) => SkeletonProps);
799
- muiTableBodyProps?:
800
- | TableBodyProps
801
- | ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps);
802
- muiRowDragHandleProps?:
803
- | IconButtonProps
766
+ }) => DialogProps)
767
+ | DialogProps;
768
+ muiEditTextFieldProps?:
804
769
  | ((props: {
805
- table: MRT_TableInstance<TData>;
770
+ cell: MRT_Cell<TData>;
771
+ column: MRT_Column<TData>;
806
772
  row: MRT_Row<TData>;
807
- }) => IconButtonProps);
808
- muiTableBodyRowProps?:
809
- | TableRowProps
773
+ table: MRT_TableInstance<TData>;
774
+ }) => TextFieldProps)
775
+ | TextFieldProps;
776
+ muiExpandAllButtonProps?:
777
+ | ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps)
778
+ | IconButtonProps;
779
+ muiExpandButtonProps?:
810
780
  | ((props: {
811
- isDetailPanel?: boolean;
812
781
  row: MRT_Row<TData>;
813
- staticRowIndex: number;
814
782
  table: MRT_TableInstance<TData>;
815
- }) => TableRowProps);
816
- muiTableContainerProps?:
817
- | TableContainerProps
818
- | ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps);
819
- muiDetailPanelProps?:
820
- | TableCellProps
783
+ }) => IconButtonProps)
784
+ | IconButtonProps;
785
+ muiFilterCheckboxProps?:
821
786
  | ((props: {
787
+ column: MRT_Column<TData>;
822
788
  table: MRT_TableInstance<TData>;
823
- row: MRT_Row<TData>;
824
- }) => TableCellProps);
825
- muiTableFooterCellProps?:
826
- | TableCellProps
789
+ }) => CheckboxProps)
790
+ | CheckboxProps;
791
+ muiFilterSliderProps?:
827
792
  | ((props: {
793
+ column: MRT_Column<TData>;
828
794
  table: MRT_TableInstance<TData>;
795
+ }) => SliderProps)
796
+ | SliderProps;
797
+ muiFilterTextFieldProps?:
798
+ | ((props: {
829
799
  column: MRT_Column<TData>;
830
- }) => TableCellProps);
831
- muiTableFooterProps?:
832
- | TableFooterProps
833
- | ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps);
834
- muiTableFooterRowProps?:
835
- | TableRowProps
800
+ rangeFilterIndex?: number;
801
+ table: MRT_TableInstance<TData>;
802
+ }) => TextFieldProps)
803
+ | TextFieldProps;
804
+ muiLinearProgressProps?:
836
805
  | ((props: {
806
+ isTopToolbar: boolean;
837
807
  table: MRT_TableInstance<TData>;
838
- footerGroup: MRT_HeaderGroup<TData>;
839
- }) => TableRowProps);
840
- muiColumnActionsButtonProps?:
841
- | IconButtonProps
808
+ }) => LinearProgressProps)
809
+ | LinearProgressProps;
810
+ muiRowDragHandleProps?:
842
811
  | ((props: {
812
+ row: MRT_Row<TData>;
843
813
  table: MRT_TableInstance<TData>;
844
- column: MRT_Column<TData>;
845
- }) => IconButtonProps);
846
- muiColumnDragHandleProps?:
847
- | IconButtonProps
814
+ }) => IconButtonProps)
815
+ | IconButtonProps;
816
+ muiSearchTextFieldProps?:
817
+ | ((props: { table: MRT_TableInstance<TData> }) => TextFieldProps)
818
+ | TextFieldProps;
819
+ muiSelectAllCheckboxProps?:
820
+ | ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps)
821
+ | CheckboxProps;
822
+ muiSelectCheckboxProps?:
848
823
  | ((props: {
824
+ row: MRT_Row<TData>;
849
825
  table: MRT_TableInstance<TData>;
850
- column: MRT_Column<TData>;
851
- }) => IconButtonProps);
852
- muiFilterCheckboxProps?:
853
- | CheckboxProps
826
+ }) => CheckboxProps | RadioProps)
827
+ | (CheckboxProps | RadioProps);
828
+ muiSkeletonProps?:
854
829
  | ((props: {
830
+ cell: MRT_Cell<TData>;
855
831
  column: MRT_Column<TData>;
832
+ row: MRT_Row<TData>;
856
833
  table: MRT_TableInstance<TData>;
857
- }) => CheckboxProps);
858
- muiFilterTextFieldProps?:
859
- | TextFieldProps
834
+ }) => SkeletonProps)
835
+ | SkeletonProps;
836
+ muiTableBodyCellProps?:
860
837
  | ((props: {
861
- table: MRT_TableInstance<TData>;
838
+ cell: MRT_Cell<TData>;
862
839
  column: MRT_Column<TData>;
863
- rangeFilterIndex?: number;
864
- }) => TextFieldProps);
865
- muiFilterSliderProps?:
866
- | SliderProps
867
- | ((props: {
840
+ row: MRT_Row<TData>;
868
841
  table: MRT_TableInstance<TData>;
869
- column: MRT_Column<TData>;
870
- }) => SliderProps);
871
- muiCreateRowModalProps?:
872
- | DialogProps
842
+ }) => TableCellProps)
843
+ | TableCellProps;
844
+ muiTableBodyProps?:
845
+ | ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps)
846
+ | TableBodyProps;
847
+ muiTableBodyRowProps?:
873
848
  | ((props: {
849
+ isDetailPanel?: boolean;
874
850
  row: MRT_Row<TData>;
851
+ staticRowIndex: number;
875
852
  table: MRT_TableInstance<TData>;
876
- }) => DialogProps);
877
- muiEditRowModalProps?:
878
- | DialogProps
853
+ }) => TableRowProps)
854
+ | TableRowProps;
855
+ muiTableContainerProps?:
856
+ | ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps)
857
+ | TableContainerProps;
858
+ muiTableFooterCellProps?:
879
859
  | ((props: {
880
- row: MRT_Row<TData>;
860
+ column: MRT_Column<TData>;
881
861
  table: MRT_TableInstance<TData>;
882
- }) => DialogProps);
883
- muiTableHeadCellProps?:
884
- | TableCellProps
862
+ }) => TableCellProps)
863
+ | TableCellProps;
864
+ muiTableFooterProps?:
865
+ | ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps)
866
+ | TableFooterProps;
867
+ muiTableFooterRowProps?:
885
868
  | ((props: {
869
+ footerGroup: MRT_HeaderGroup<TData>;
886
870
  table: MRT_TableInstance<TData>;
871
+ }) => TableRowProps)
872
+ | TableRowProps;
873
+ muiTableHeadCellProps?:
874
+ | ((props: {
887
875
  column: MRT_Column<TData>;
888
- }) => TableCellProps);
876
+ table: MRT_TableInstance<TData>;
877
+ }) => TableCellProps)
878
+ | TableCellProps;
889
879
  muiTableHeadProps?:
890
- | TableHeadProps
891
- | ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps);
880
+ | ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps)
881
+ | TableHeadProps;
892
882
  muiTableHeadRowProps?:
893
- | TableRowProps
894
883
  | ((props: {
895
- table: MRT_TableInstance<TData>;
896
884
  headerGroup: MRT_HeaderGroup<TData>;
897
- }) => TableRowProps);
885
+ table: MRT_TableInstance<TData>;
886
+ }) => TableRowProps)
887
+ | TableRowProps;
898
888
  muiTablePaginationProps?:
899
- | Partial<Omit<TablePaginationProps, 'rowsPerPage'>>
900
889
  | ((props: {
901
890
  table: MRT_TableInstance<TData>;
902
- }) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
891
+ }) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>)
892
+ | Partial<Omit<TablePaginationProps, 'rowsPerPage'>>;
903
893
  muiTablePaperProps?:
904
- | PaperProps
905
- | ((props: { table: MRT_TableInstance<TData> }) => PaperProps);
894
+ | ((props: { table: MRT_TableInstance<TData> }) => PaperProps)
895
+ | PaperProps;
906
896
  muiTableProps?:
907
- | TableProps
908
- | ((props: { table: MRT_TableInstance<TData> }) => TableProps);
897
+ | ((props: { table: MRT_TableInstance<TData> }) => TableProps)
898
+ | TableProps;
909
899
  muiToolbarAlertBannerChipProps?:
910
- | ChipProps
911
- | ((props: { table: MRT_TableInstance<TData> }) => ChipProps);
900
+ | ((props: { table: MRT_TableInstance<TData> }) => ChipProps)
901
+ | ChipProps;
912
902
  muiToolbarAlertBannerProps?:
913
- | AlertProps
914
- | ((props: { table: MRT_TableInstance<TData> }) => AlertProps);
903
+ | ((props: { table: MRT_TableInstance<TData> }) => AlertProps)
904
+ | AlertProps;
915
905
  muiTopToolbarProps?:
916
- | ToolbarProps
917
- | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
906
+ | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps)
907
+ | ToolbarProps;
908
+ onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
918
909
  onCreatingRowCancel?: (props: {
919
910
  row: MRT_Row<TData>;
920
911
  table: MRT_TableInstance<TData>;
@@ -926,7 +917,6 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
926
917
  table: MRT_TableInstance<TData>;
927
918
  values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
928
919
  }) => void;
929
- onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
930
920
  onDensityChange?: OnChangeFn<MRT_DensityState>;
931
921
  onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
932
922
  onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
@@ -943,38 +933,29 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
943
933
  values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
944
934
  }) => Promise<void> | void;
945
935
  onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
946
- onHoveredColumnChange?: OnChangeFn<MRT_Column<TData> | { id: string } | null>;
947
- onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | { id: string } | null>;
936
+ onHoveredColumnChange?: OnChangeFn<{ id: string } | MRT_Column<TData> | null>;
937
+ onHoveredRowChange?: OnChangeFn<{ id: string } | MRT_Row<TData> | null>;
948
938
  onIsFullScreenChange?: OnChangeFn<boolean>;
949
939
  onShowAlertBannerChange?: OnChangeFn<boolean>;
950
940
  onShowColumnFiltersChange?: OnChangeFn<boolean>;
951
941
  onShowGlobalFilterChange?: OnChangeFn<boolean>;
952
942
  onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
943
+ paginationDisplayMode?: 'custom' | 'default' | 'pages';
953
944
  positionActionsColumn?: 'first' | 'last';
954
945
  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';
946
+ positionGlobalFilter?: 'left' | 'none' | 'right';
947
+ positionPagination?: 'both' | 'bottom' | 'none' | 'top';
948
+ positionToolbarAlertBanner?: 'bottom' | 'none' | 'top';
949
+ positionToolbarDropZone?: 'both' | 'bottom' | 'none' | 'top';
959
950
  renderBottomToolbar?:
960
- | ReactNode
961
- | ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
951
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
952
+ | ReactNode;
962
953
  renderBottomToolbarCustomActions?: (props: {
963
954
  table: MRT_TableInstance<TData>;
964
955
  }) => 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
956
  renderColumnActionsMenuItems?: (props: {
976
- column: MRT_Column<TData>;
977
957
  closeMenu: () => void;
958
+ column: MRT_Column<TData>;
978
959
  internalColumnMenuItems: ReactNode[];
979
960
  table: MRT_TableInstance<TData>;
980
961
  }) => ReactNode[];
@@ -984,18 +965,28 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
984
965
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
985
966
  table: MRT_TableInstance<TData>;
986
967
  }) => ReactNode[];
968
+ renderCreateRowModalContent?: (props: {
969
+ internalEditComponents: ReactNode[];
970
+ row: MRT_Row<TData>;
971
+ table: MRT_TableInstance<TData>;
972
+ }) => ReactNode;
987
973
  renderDetailPanel?: (props: {
988
974
  row: MRT_Row<TData>;
989
975
  table: MRT_TableInstance<TData>;
990
976
  }) => ReactNode;
977
+ renderEditRowModalContent?: (props: {
978
+ internalEditComponents: ReactNode[];
979
+ row: MRT_Row<TData>;
980
+ table: MRT_TableInstance<TData>;
981
+ }) => ReactNode;
982
+ renderEmptyRowsFallback?: (props: {
983
+ table: MRT_TableInstance<TData>;
984
+ }) => ReactNode;
991
985
  renderGlobalFilterModeMenuItems?: (props: {
992
986
  internalFilterOptions: MRT_InternalFilterOption[];
993
987
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
994
988
  table: MRT_TableInstance<TData>;
995
989
  }) => ReactNode[];
996
- renderEmptyRowsFallback?: (props: {
997
- table: MRT_TableInstance<TData>;
998
- }) => ReactNode;
999
990
  renderRowActionMenuItems?: (props: {
1000
991
  closeMenu: () => void;
1001
992
  row: MRT_Row<TData>;
@@ -1010,23 +1001,32 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
1010
1001
  table: MRT_TableInstance<TData>;
1011
1002
  }) => ReactNode;
1012
1003
  renderTopToolbar?:
1013
- | ReactNode
1014
- | ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
1004
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
1005
+ | ReactNode;
1015
1006
  renderTopToolbarCustomActions?: (props: {
1016
1007
  table: MRT_TableInstance<TData>;
1017
1008
  }) => ReactNode;
1018
1009
  rowCount?: number;
1019
1010
  rowNumberMode?: 'original' | 'static';
1011
+ rowPinningDisplayMode?:
1012
+ | 'bottom'
1013
+ | 'select-bottom'
1014
+ | 'select-sticky'
1015
+ | 'select-top'
1016
+ | 'sticky'
1017
+ | 'top'
1018
+ | 'top-and-bottom';
1020
1019
  rowVirtualizerInstanceRef?: MutableRefObject<Virtualizer<
1021
1020
  HTMLDivElement,
1022
1021
  HTMLTableRowElement
1023
1022
  > | null>;
1024
1023
  rowVirtualizerOptions?:
1025
- | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>
1026
1024
  | ((props: {
1027
1025
  table: MRT_TableInstance<TData>;
1028
- }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>);
1026
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>)
1027
+ | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
1029
1028
  selectAllMode?: 'all' | 'page';
1029
+ selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
1030
1030
  /**
1031
1031
  * Manage state externally any way you want, then pass it back into MRT.
1032
1032
  */