material-react-table 2.0.0-alpha.0 → 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 (119) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/index.js +2480 -2392
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/MaterialReactTable.d.ts +1 -1
  5. package/dist/cjs/types/body/MRT_TableBodyRow.d.ts +3 -2
  6. package/dist/cjs/types/body/MRT_TableBodyRowPinButton.d.ts +7 -0
  7. package/dist/cjs/types/body/index.d.ts +1 -0
  8. package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
  9. package/dist/cjs/types/buttons/MRT_RowPinButton.d.ts +9 -0
  10. package/dist/cjs/types/buttons/index.d.ts +2 -1
  11. package/dist/cjs/types/column.utils.d.ts +7 -6
  12. package/dist/cjs/types/filterFns.d.ts +14 -14
  13. package/dist/cjs/types/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  14. package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  15. package/dist/cjs/types/hooks/useMRT_DisplayColumns.d.ts +3 -3
  16. package/dist/cjs/types/icons.d.ts +1 -1
  17. package/dist/cjs/types/inputs/MRT_FilterRangeSlider.d.ts +1 -1
  18. package/dist/cjs/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
  19. package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  20. package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -2
  21. package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +1 -1
  22. package/dist/cjs/types/types.d.ts +203 -197
  23. package/dist/esm/material-react-table.esm.js +2442 -2358
  24. package/dist/esm/material-react-table.esm.js.map +1 -1
  25. package/dist/esm/types/MaterialReactTable.d.ts +1 -1
  26. package/dist/esm/types/body/MRT_TableBodyRow.d.ts +3 -2
  27. package/dist/esm/types/body/MRT_TableBodyRowPinButton.d.ts +7 -0
  28. package/dist/esm/types/body/index.d.ts +1 -0
  29. package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +1 -1
  30. package/dist/esm/types/buttons/MRT_RowPinButton.d.ts +9 -0
  31. package/dist/esm/types/buttons/index.d.ts +2 -1
  32. package/dist/esm/types/column.utils.d.ts +7 -6
  33. package/dist/esm/types/filterFns.d.ts +14 -14
  34. package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  35. package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  36. package/dist/esm/types/hooks/useMRT_DisplayColumns.d.ts +3 -3
  37. package/dist/esm/types/icons.d.ts +1 -1
  38. package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +1 -1
  39. package/dist/esm/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
  40. package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  41. package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -2
  42. package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +1 -1
  43. package/dist/esm/types/types.d.ts +203 -197
  44. package/dist/index.d.ts +293 -272
  45. package/locales/en.esm.js +1 -0
  46. package/locales/en.esm.js.map +1 -1
  47. package/locales/en.js +1 -0
  48. package/locales/en.js.map +1 -1
  49. package/locales/fr.esm.js +1 -1
  50. package/locales/fr.esm.js.map +1 -1
  51. package/locales/fr.js +1 -1
  52. package/locales/fr.js.map +1 -1
  53. package/package.json +10 -9
  54. package/src/MaterialReactTable.tsx +2 -2
  55. package/src/body/MRT_TableBody.tsx +180 -76
  56. package/src/body/MRT_TableBodyCell.tsx +45 -43
  57. package/src/body/MRT_TableBodyCellValue.tsx +5 -5
  58. package/src/body/MRT_TableBodyRow.tsx +117 -29
  59. package/src/body/MRT_TableBodyRowGrabHandle.tsx +6 -5
  60. package/src/body/MRT_TableBodyRowPinButton.tsx +46 -0
  61. package/src/body/MRT_TableDetailPanel.tsx +16 -22
  62. package/src/body/index.ts +2 -1
  63. package/src/buttons/MRT_CopyButton.tsx +14 -20
  64. package/src/buttons/MRT_EditActionButtons.tsx +4 -4
  65. package/src/buttons/MRT_ExpandAllButton.tsx +7 -9
  66. package/src/buttons/MRT_ExpandButton.tsx +6 -7
  67. package/src/buttons/MRT_GrabHandleButton.tsx +12 -13
  68. package/src/buttons/MRT_RowPinButton.tsx +74 -0
  69. package/src/buttons/MRT_ShowHideColumnsButton.tsx +1 -1
  70. package/src/buttons/MRT_ToggleFullScreenButton.tsx +2 -2
  71. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +9 -10
  72. package/src/buttons/index.ts +2 -1
  73. package/src/column.utils.ts +33 -21
  74. package/src/filterFns.ts +29 -29
  75. package/src/footer/MRT_TableFooter.tsx +14 -8
  76. package/src/footer/MRT_TableFooterCell.tsx +8 -21
  77. package/src/footer/MRT_TableFooterRow.tsx +7 -8
  78. package/src/head/MRT_TableHead.tsx +12 -8
  79. package/src/head/MRT_TableHeadCell.tsx +18 -25
  80. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +18 -23
  81. package/src/head/MRT_TableHeadCellFilterContainer.tsx +11 -4
  82. package/src/head/MRT_TableHeadCellFilterLabel.tsx +106 -61
  83. package/src/head/MRT_TableHeadCellGrabHandle.tsx +8 -15
  84. package/src/head/MRT_TableHeadCellResizeHandle.tsx +11 -11
  85. package/src/head/MRT_TableHeadCellSortLabel.tsx +8 -8
  86. package/src/head/MRT_TableHeadRow.tsx +7 -8
  87. package/src/hooks/useMRT_DisplayColumns.tsx +17 -4
  88. package/src/hooks/useMRT_Effects.ts +3 -3
  89. package/src/hooks/useMRT_TableInstance.ts +17 -10
  90. package/src/hooks/useMRT_TableOptions.ts +9 -5
  91. package/src/icons.ts +2 -2
  92. package/src/inputs/MRT_EditCellTextField.tsx +23 -31
  93. package/src/inputs/MRT_FilterCheckbox.tsx +17 -29
  94. package/src/inputs/MRT_FilterRangeFields.tsx +1 -1
  95. package/src/inputs/MRT_FilterRangeSlider.tsx +12 -29
  96. package/src/inputs/MRT_FilterTextField.tsx +83 -99
  97. package/src/inputs/MRT_GlobalFilterTextField.tsx +29 -29
  98. package/src/inputs/MRT_SelectCheckbox.tsx +35 -21
  99. package/src/locales/en.ts +1 -1
  100. package/src/locales/fr.ts +1 -1
  101. package/src/menus/MRT_ColumnActionMenu.tsx +14 -14
  102. package/src/menus/MRT_FilterOptionMenu.tsx +35 -35
  103. package/src/menus/MRT_RowActionMenu.tsx +17 -18
  104. package/src/menus/MRT_ShowHideColumnsMenu.tsx +6 -6
  105. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +5 -5
  106. package/src/modals/MRT_EditRowModal.tsx +12 -20
  107. package/src/sortingFns.ts +1 -1
  108. package/src/table/MRT_Table.tsx +14 -19
  109. package/src/table/MRT_TableContainer.tsx +14 -20
  110. package/src/table/MRT_TablePaper.tsx +16 -20
  111. package/src/toolbar/MRT_BottomToolbar.tsx +18 -24
  112. package/src/toolbar/MRT_LinearProgressBar.tsx +8 -7
  113. package/src/toolbar/MRT_TablePagination.tsx +23 -25
  114. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +11 -14
  115. package/src/toolbar/MRT_ToolbarDropZone.tsx +6 -6
  116. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +8 -5
  117. package/src/toolbar/MRT_TopToolbar.tsx +14 -20
  118. package/src/types.ts +269 -252
  119. 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> =
@@ -107,7 +107,6 @@ export interface MRT_Localization {
107
107
  clearSearch: string;
108
108
  clearSort: string;
109
109
  clickToCopy: string;
110
- create?: string;
111
110
  collapse: string;
112
111
  collapseAll: string;
113
112
  columnActions: string;
@@ -157,6 +156,7 @@ export interface MRT_Localization {
157
156
  noResultsFound: string;
158
157
  of: string;
159
158
  or: string;
159
+ pin?: string;
160
160
  pinToLeft: string;
161
161
  pinToRight: string;
162
162
  resetColumnSize: string;
@@ -200,7 +200,9 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
200
200
  | 'getAllColumns'
201
201
  | 'getAllFlatColumns'
202
202
  | 'getAllLeafColumns'
203
+ | 'getBottomRows'
203
204
  | 'getCenterLeafColumns'
205
+ | 'getCenterRows'
204
206
  | 'getColumn'
205
207
  | 'getExpandedRowModel'
206
208
  | 'getFlatHeaders'
@@ -213,12 +215,15 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
213
215
  | 'getRowModel'
214
216
  | 'getSelectedRowModel'
215
217
  | 'getState'
218
+ | 'getTopRows'
216
219
  | 'options'
217
220
  > & {
218
221
  getAllColumns: () => MRT_Column<TData>[];
219
222
  getAllFlatColumns: () => MRT_Column<TData>[];
220
223
  getAllLeafColumns: () => MRT_Column<TData>[];
224
+ getBottomRows: () => MRT_Row<TData>[];
221
225
  getCenterLeafColumns: () => MRT_Column<TData>[];
226
+ getCenterRows: () => MRT_Row<TData>[];
222
227
  getColumn: (columnId: string) => MRT_Column<TData>;
223
228
  getExpandedRowModel: () => MRT_RowModel<TData>;
224
229
  getFlatHeaders: () => MRT_Header<TData>[];
@@ -231,6 +236,7 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
231
236
  getRowModel: () => MRT_RowModel<TData>;
232
237
  getSelectedRowModel: () => MRT_RowModel<TData>;
233
238
  getState: () => MRT_TableState<TData>;
239
+ getTopRows: () => MRT_Row<TData>[];
234
240
  options: MRT_DefinedTableOptions<TData>;
235
241
  refs: {
236
242
  bottomToolbarRef: MutableRefObject<HTMLDivElement>;
@@ -238,12 +244,14 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
238
244
  filterInputRefs: MutableRefObject<Record<string, HTMLInputElement>>;
239
245
  searchInputRef: MutableRefObject<HTMLInputElement>;
240
246
  tableContainerRef: MutableRefObject<HTMLDivElement>;
247
+ tableFooterRef: MutableRefObject<HTMLTableSectionElement>;
241
248
  tableHeadCellRefs: MutableRefObject<Record<string, HTMLTableCellElement>>;
249
+ tableHeadRef: MutableRefObject<HTMLTableSectionElement>;
242
250
  tablePaperRef: MutableRefObject<HTMLDivElement>;
243
251
  topToolbarRef: MutableRefObject<HTMLDivElement>;
244
252
  };
245
- setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
246
253
  setColumnFilterFns: Dispatch<SetStateAction<MRT_ColumnFilterFnsState>>;
254
+ setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
247
255
  setDensity: Dispatch<SetStateAction<MRT_DensityState>>;
248
256
  setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
249
257
  setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
@@ -251,10 +259,10 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
251
259
  setEditingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
252
260
  setGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
253
261
  setHoveredColumn: Dispatch<
254
- SetStateAction<MRT_Column<TData> | { id: string } | null>
262
+ SetStateAction<{ id: string } | MRT_Column<TData> | null>
255
263
  >;
256
264
  setHoveredRow: Dispatch<
257
- SetStateAction<MRT_Row<TData> | { id: string } | null>
265
+ SetStateAction<{ id: string } | MRT_Row<TData> | null>
258
266
  >;
259
267
  setIsFullScreen: Dispatch<SetStateAction<boolean>>;
260
268
  setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
@@ -265,8 +273,8 @@ export type MRT_TableInstance<TData extends Record<string, any>> = Omit<
265
273
 
266
274
  export type MRT_DefinedTableOptions<TData extends Record<string, any>> =
267
275
  MRT_TableOptions<TData> & {
268
- localization: MRT_Localization;
269
276
  icons: MRT_Icons;
277
+ localization: MRT_Localization;
270
278
  };
271
279
 
272
280
  export type MRT_TableState<TData extends Record<string, any>> = TableState & {
@@ -278,8 +286,8 @@ export type MRT_TableState<TData extends Record<string, any>> = TableState & {
278
286
  editingCell: MRT_Cell<TData> | null;
279
287
  editingRow: MRT_Row<TData> | null;
280
288
  globalFilterFn: MRT_FilterOption;
281
- hoveredColumn: MRT_Column<TData> | { id: string } | null;
282
- hoveredRow: MRT_Row<TData> | { id: string } | null;
289
+ hoveredColumn: { id: string } | MRT_Column<TData> | null;
290
+ hoveredRow: { id: string } | MRT_Row<TData> | null;
283
291
  isFullScreen: boolean;
284
292
  isLoading: boolean;
285
293
  isSaving: boolean;
@@ -312,8 +320,8 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
312
320
  }) => ReactNode;
313
321
  Cell?: (props: {
314
322
  cell: MRT_Cell<TData>;
315
- renderedCellValue: number | string | ReactNode;
316
323
  column: MRT_Column<TData>;
324
+ renderedCellValue: ReactNode | number | string;
317
325
  row: MRT_Row<TData>;
318
326
  rowRef?: RefObject<HTMLTableRowElement>;
319
327
  table: MRT_TableInstance<TData>;
@@ -331,12 +339,12 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
331
339
  table: MRT_TableInstance<TData>;
332
340
  }) => ReactNode;
333
341
  Footer?:
334
- | ReactNode
335
342
  | ((props: {
336
343
  column: MRT_Column<TData>;
337
344
  footer: MRT_Header<TData>;
338
345
  table: MRT_TableInstance<TData>;
339
- }) => ReactNode);
346
+ }) => ReactNode)
347
+ | ReactNode;
340
348
  GroupedCell?: (props: {
341
349
  cell: MRT_Cell<TData>;
342
350
  column: MRT_Column<TData>;
@@ -344,12 +352,12 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
344
352
  table: MRT_TableInstance<TData>;
345
353
  }) => ReactNode;
346
354
  Header?:
347
- | ReactNode
348
355
  | ((props: {
349
356
  column: MRT_Column<TData>;
350
357
  header: MRT_Header<TData>;
351
358
  table: MRT_TableInstance<TData>;
352
- }) => ReactNode);
359
+ }) => ReactNode)
360
+ | ReactNode;
353
361
  PlaceholderCell?: (props: {
354
362
  cell: MRT_Cell<TData>;
355
363
  column: MRT_Column<TData>;
@@ -371,8 +379,8 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
371
379
  * @example accessorKey: 'username' //simple
372
380
  * @example accessorKey: 'name.firstName' //deep key dot notation
373
381
  */
374
- accessorKey?: (string & {}) | DeepKeys<TData>;
375
- aggregationFn?: MRT_AggregationFn<TData> | Array<MRT_AggregationFn<TData>>;
382
+ accessorKey?: DeepKeys<TData> | (string & {});
383
+ aggregationFn?: Array<MRT_AggregationFn<TData>> | MRT_AggregationFn<TData>;
376
384
  /**
377
385
  * Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
378
386
  * Leave this blank if you are just creating a normal data column.
@@ -386,17 +394,17 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
386
394
  LiteralUnion<string & MRT_FilterOption>
387
395
  > | null;
388
396
  columns?: MRT_ColumnDef<TData>[];
389
- editSelectOptions?: (string | { text: string; value: any })[];
390
- editVariant?: 'text' | 'select';
397
+ editSelectOptions?: ({ text: string; value: any } | string)[];
398
+ editVariant?: 'select' | 'text';
391
399
  enableClickToCopy?: boolean;
392
400
  enableColumnActions?: boolean;
393
401
  enableColumnDragging?: boolean;
394
402
  enableColumnFilterModes?: boolean;
395
403
  enableColumnOrdering?: boolean;
396
- enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
404
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
397
405
  enableFilterMatchHighlighting?: boolean;
398
406
  filterFn?: MRT_FilterFn<TData>;
399
- filterSelectOptions?: (string | { text: string; value: any })[];
407
+ filterSelectOptions?: ({ text: string; value: any } | string)[];
400
408
  filterVariant?:
401
409
  | 'checkbox'
402
410
  | 'multi-select'
@@ -422,73 +430,73 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
422
430
  * @default gets set to the same value as `accessorKey` by default
423
431
  */
424
432
  id?: LiteralUnion<string & keyof TData>;
425
- muiCopyButtonProps?:
426
- | ButtonProps
433
+ muiColumnActionsButtonProps?:
427
434
  | ((props: {
428
- cell: MRT_Cell<TData>;
429
435
  column: MRT_Column<TData>;
430
- row: MRT_Row<TData>;
431
436
  table: MRT_TableInstance<TData>;
432
- }) => ButtonProps);
433
- muiEditTextFieldProps?:
434
- | TextFieldProps
437
+ }) => IconButtonProps)
438
+ | IconButtonProps;
439
+ muiColumnDragHandleProps?:
435
440
  | ((props: {
436
- cell: MRT_Cell<TData>;
437
441
  column: MRT_Column<TData>;
438
- row: MRT_Row<TData>;
439
442
  table: MRT_TableInstance<TData>;
440
- }) => TextFieldProps);
441
- muiTableBodyCellProps?:
442
- | TableCellProps
443
+ }) => IconButtonProps)
444
+ | IconButtonProps;
445
+ muiCopyButtonProps?:
443
446
  | ((props: {
444
447
  cell: MRT_Cell<TData>;
445
448
  column: MRT_Column<TData>;
446
449
  row: MRT_Row<TData>;
447
450
  table: MRT_TableInstance<TData>;
448
- }) => TableCellProps);
449
- muiTableFooterCellProps?:
450
- | TableCellProps
451
+ }) => ButtonProps)
452
+ | ButtonProps;
453
+ muiEditTextFieldProps?:
451
454
  | ((props: {
452
- table: MRT_TableInstance<TData>;
455
+ cell: MRT_Cell<TData>;
453
456
  column: MRT_Column<TData>;
454
- }) => TableCellProps);
455
- muiColumnActionsButtonProps?:
456
- | IconButtonProps
457
- | ((props: {
457
+ row: MRT_Row<TData>;
458
458
  table: MRT_TableInstance<TData>;
459
- column: MRT_Column<TData>;
460
- }) => IconButtonProps);
461
- muiColumnDragHandleProps?:
462
- | IconButtonProps
459
+ }) => TextFieldProps)
460
+ | TextFieldProps;
461
+ muiFilterCheckboxProps?:
463
462
  | ((props: {
464
- table: MRT_TableInstance<TData>;
465
463
  column: MRT_Column<TData>;
466
- }) => IconButtonProps);
467
- muiFilterCheckboxProps?:
468
- | CheckboxProps
464
+ table: MRT_TableInstance<TData>;
465
+ }) => CheckboxProps)
466
+ | CheckboxProps;
467
+ muiFilterSliderProps?:
469
468
  | ((props: {
470
469
  column: MRT_Column<TData>;
471
470
  table: MRT_TableInstance<TData>;
472
- }) => CheckboxProps);
471
+ }) => SliderProps)
472
+ | SliderProps;
473
473
  muiFilterTextFieldProps?:
474
- | TextFieldProps
475
474
  | ((props: {
476
- table: MRT_TableInstance<TData>;
477
475
  column: MRT_Column<TData>;
478
476
  rangeFilterIndex?: number;
479
- }) => TextFieldProps);
480
- muiFilterSliderProps?:
481
- | SliderProps
477
+ table: MRT_TableInstance<TData>;
478
+ }) => TextFieldProps)
479
+ | TextFieldProps;
480
+ muiTableBodyCellProps?:
482
481
  | ((props: {
482
+ cell: MRT_Cell<TData>;
483
+ column: MRT_Column<TData>;
484
+ row: MRT_Row<TData>;
483
485
  table: MRT_TableInstance<TData>;
486
+ }) => TableCellProps)
487
+ | TableCellProps;
488
+ muiTableFooterCellProps?:
489
+ | ((props: {
484
490
  column: MRT_Column<TData>;
485
- }) => TextFieldProps);
491
+ table: MRT_TableInstance<TData>;
492
+ }) => TableCellProps)
493
+ | TableCellProps;
486
494
  muiTableHeadCellProps?:
487
- | TableCellProps
488
495
  | ((props: {
489
- table: MRT_TableInstance<TData>;
490
496
  column: MRT_Column<TData>;
491
- }) => TableCellProps);
497
+ table: MRT_TableInstance<TData>;
498
+ }) => TableCellProps)
499
+ | TableCellProps;
492
500
  renderColumnActionsMenuItems?: (props: {
493
501
  closeMenu: () => void;
494
502
  column: MRT_Column<TData>;
@@ -506,16 +514,16 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<
506
514
 
507
515
  export type MRT_DefinedColumnDef<TData extends Record<string, any>> = Omit<
508
516
  MRT_ColumnDef<TData>,
509
- 'id' | 'defaultDisplayColumn'
517
+ 'defaultDisplayColumn' | 'id'
510
518
  > & {
519
+ _filterFn: MRT_FilterOption;
511
520
  defaultDisplayColumn: Partial<MRT_ColumnDef<TData>>;
512
521
  id: string;
513
- _filterFn: MRT_FilterOption;
514
522
  };
515
523
 
516
524
  export type MRT_Column<TData extends Record<string, any>> = Omit<
517
525
  Column<TData, unknown>,
518
- 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'
526
+ 'columnDef' | 'columns' | 'filterFn' | 'footer' | 'header'
519
527
  > & {
520
528
  columnDef: MRT_DefinedColumnDef<TData>;
521
529
  columns?: MRT_Column<TData>[];
@@ -540,12 +548,12 @@ export type MRT_HeaderGroup<TData extends Record<string, any>> = Omit<
540
548
 
541
549
  export type MRT_Row<TData extends Record<string, any>> = Omit<
542
550
  Row<TData>,
543
- 'getVisibleCells' | 'getAllCells' | 'subRows' | '_valuesCache'
551
+ '_valuesCache' | 'getAllCells' | 'getVisibleCells' | 'subRows'
544
552
  > & {
553
+ _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
545
554
  getAllCells: () => MRT_Cell<TData>[];
546
555
  getVisibleCells: () => MRT_Cell<TData>[];
547
556
  subRows?: MRT_Row<TData>[];
548
- _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
549
557
  };
550
558
 
551
559
  export type MRT_Cell<TData extends Record<string, any>> = Omit<
@@ -567,8 +575,8 @@ export type MRT_SortingOption = LiteralUnion<
567
575
  >;
568
576
 
569
577
  export type MRT_SortingFn<TData extends Record<string, any>> =
570
- | SortingFn<TData>
571
- | MRT_SortingOption;
578
+ | MRT_SortingOption
579
+ | SortingFn<TData>;
572
580
 
573
581
  export type MRT_FilterOption = LiteralUnion<
574
582
  string & keyof typeof MRT_FilterFns
@@ -579,10 +587,10 @@ export type MRT_FilterFn<TData extends Record<string, any>> =
579
587
  | MRT_FilterOption;
580
588
 
581
589
  export type MRT_InternalFilterOption = {
590
+ divider: boolean;
591
+ label: string;
582
592
  option: string;
583
593
  symbol: string;
584
- label: string;
585
- divider: boolean;
586
594
  };
587
595
 
588
596
  export type MRT_DisplayColumnIds =
@@ -590,6 +598,7 @@ export type MRT_DisplayColumnIds =
590
598
  | 'mrt-row-drag'
591
599
  | 'mrt-row-expand'
592
600
  | 'mrt-row-numbers'
601
+ | 'mrt-row-pin'
593
602
  | 'mrt-row-select';
594
603
 
595
604
  /**
@@ -614,9 +623,19 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
614
623
  | 'onStateChange'
615
624
  | 'state'
616
625
  > & {
626
+ columnFilterDisplayMode?: 'custom' | 'popover' | 'subheader';
617
627
  columnFilterModeOptions?: Array<
618
628
  LiteralUnion<string & MRT_FilterOption>
619
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>>;
620
639
  /**
621
640
  * The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
622
641
  *
@@ -628,15 +647,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
628
647
  * @link https://www.material-react-table.com/docs/api/column-options
629
648
  */
630
649
  columns: MRT_ColumnDef<TData>[];
631
- columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<
632
- HTMLDivElement,
633
- HTMLTableCellElement
634
- > | null>;
635
- columnVirtualizerOptions?:
636
- | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>
637
- | ((props: {
638
- table: MRT_TableInstance<TData>;
639
- }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>);
650
+ createDisplayMode?: 'custom' | 'modal' | 'row';
640
651
  /**
641
652
  * Pass your data as an array of objects. Objects can theoretically be any shape, but it's best to keep them consistent.
642
653
  *
@@ -655,11 +666,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
655
666
  displayColumnDefOptions?: Partial<{
656
667
  [key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef<TData>>;
657
668
  }>;
658
- createDisplayMode?: 'modal' | 'row' | 'custom';
659
- editDisplayMode?: 'modal' | 'row' | 'cell' | 'table' | 'custom';
660
- columnFilterDisplayMode?: 'subheader' | 'popover' | 'custom';
661
- paginationDisplayMode?: 'default' | 'pages' | 'custom';
662
- selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
669
+ editDisplayMode?: 'cell' | 'custom' | 'modal' | 'row' | 'table';
663
670
  enableBottomToolbar?: boolean;
664
671
  enableClickToCopy?: boolean;
665
672
  enableColumnActions?: boolean;
@@ -668,7 +675,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
668
675
  enableColumnOrdering?: boolean;
669
676
  enableColumnVirtualization?: boolean;
670
677
  enableDensityToggle?: boolean;
671
- enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
678
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
672
679
  enableExpandAll?: boolean;
673
680
  enableFacetedValues?: boolean;
674
681
  enableFilterMatchHighlighting?: boolean;
@@ -680,7 +687,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
680
687
  enableRowDragging?: boolean;
681
688
  enableRowNumbers?: boolean;
682
689
  enableRowOrdering?: boolean;
683
- enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean);
690
+ enableRowSelection?: ((row: MRT_Row<TData>) => boolean) | boolean;
684
691
  enableRowVirtualization?: boolean;
685
692
  enableSelectAll?: boolean;
686
693
  enableStickyFooter?: boolean;
@@ -702,7 +709,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
702
709
  /**
703
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
704
711
  */
705
- layoutMode?: 'semantic' | 'grid';
712
+ layoutMode?: 'grid' | 'semantic';
706
713
  /**
707
714
  * Pass in either a locale imported from `material-react-table/locales/*` or a custom locale object.
708
715
  *
@@ -718,186 +725,187 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
718
725
  */
719
726
  memoMode?: 'cells' | 'rows' | 'table-body';
720
727
  muiBottomToolbarProps?:
721
- | ToolbarProps
722
- | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
723
- muiExpandAllButtonProps?:
724
- | IconButtonProps
725
- | ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps);
726
- muiExpandButtonProps?:
727
- | IconButtonProps
728
- | ((props: {
729
- table: MRT_TableInstance<TData>;
730
- row: MRT_Row<TData>;
731
- }) => IconButtonProps);
732
- muiLinearProgressProps?:
733
- | LinearProgressProps
728
+ | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps)
729
+ | ToolbarProps;
730
+ muiColumnActionsButtonProps?:
734
731
  | ((props: {
735
- isTopToolbar: boolean;
732
+ column: MRT_Column<TData>;
736
733
  table: MRT_TableInstance<TData>;
737
- }) => LinearProgressProps);
738
- muiSearchTextFieldProps?:
739
- | TextFieldProps
740
- | ((props: { table: MRT_TableInstance<TData> }) => TextFieldProps);
741
- muiSelectAllCheckboxProps?:
742
- | CheckboxProps
743
- | ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps);
744
- muiSelectCheckboxProps?:
745
- | (CheckboxProps | RadioProps)
734
+ }) => IconButtonProps)
735
+ | IconButtonProps;
736
+ muiColumnDragHandleProps?:
746
737
  | ((props: {
738
+ column: MRT_Column<TData>;
747
739
  table: MRT_TableInstance<TData>;
748
- row: MRT_Row<TData>;
749
- }) => CheckboxProps | RadioProps);
740
+ }) => IconButtonProps)
741
+ | IconButtonProps;
750
742
  muiCopyButtonProps?:
751
- | ButtonProps
752
743
  | ((props: {
753
744
  cell: MRT_Cell<TData>;
754
745
  column: MRT_Column<TData>;
755
746
  row: MRT_Row<TData>;
756
747
  table: MRT_TableInstance<TData>;
757
- }) => ButtonProps);
758
- muiEditTextFieldProps?:
759
- | TextFieldProps
748
+ }) => ButtonProps)
749
+ | ButtonProps;
750
+ muiCreateRowModalProps?:
760
751
  | ((props: {
761
- cell: MRT_Cell<TData>;
762
- column: MRT_Column<TData>;
763
752
  row: MRT_Row<TData>;
764
753
  table: MRT_TableInstance<TData>;
765
- }) => TextFieldProps);
766
- muiTableBodyCellProps?:
767
- | TableCellProps
754
+ }) => DialogProps)
755
+ | DialogProps;
756
+ muiDetailPanelProps?:
768
757
  | ((props: {
769
- cell: MRT_Cell<TData>;
770
- column: MRT_Column<TData>;
771
758
  row: MRT_Row<TData>;
772
759
  table: MRT_TableInstance<TData>;
773
- }) => TableCellProps);
774
- muiSkeletonProps?:
775
- | SkeletonProps
760
+ }) => TableCellProps)
761
+ | TableCellProps;
762
+ muiEditRowModalProps?:
776
763
  | ((props: {
777
- cell: MRT_Cell<TData>;
778
- column: MRT_Column<TData>;
779
764
  row: MRT_Row<TData>;
780
765
  table: MRT_TableInstance<TData>;
781
- }) => SkeletonProps);
782
- muiTableBodyProps?:
783
- | TableBodyProps
784
- | ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps);
785
- muiRowDragHandleProps?:
786
- | IconButtonProps
766
+ }) => DialogProps)
767
+ | DialogProps;
768
+ muiEditTextFieldProps?:
787
769
  | ((props: {
788
- table: MRT_TableInstance<TData>;
770
+ cell: MRT_Cell<TData>;
771
+ column: MRT_Column<TData>;
789
772
  row: MRT_Row<TData>;
790
- }) => IconButtonProps);
791
- muiTableBodyRowProps?:
792
- | TableRowProps
773
+ table: MRT_TableInstance<TData>;
774
+ }) => TextFieldProps)
775
+ | TextFieldProps;
776
+ muiExpandAllButtonProps?:
777
+ | ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps)
778
+ | IconButtonProps;
779
+ muiExpandButtonProps?:
793
780
  | ((props: {
794
- isDetailPanel?: boolean;
795
781
  row: MRT_Row<TData>;
796
- staticRowIndex: number;
797
782
  table: MRT_TableInstance<TData>;
798
- }) => TableRowProps);
799
- muiTableContainerProps?:
800
- | TableContainerProps
801
- | ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps);
802
- muiDetailPanelProps?:
803
- | TableCellProps
783
+ }) => IconButtonProps)
784
+ | IconButtonProps;
785
+ muiFilterCheckboxProps?:
804
786
  | ((props: {
787
+ column: MRT_Column<TData>;
805
788
  table: MRT_TableInstance<TData>;
806
- row: MRT_Row<TData>;
807
- }) => TableCellProps);
808
- muiTableFooterCellProps?:
809
- | TableCellProps
789
+ }) => CheckboxProps)
790
+ | CheckboxProps;
791
+ muiFilterSliderProps?:
810
792
  | ((props: {
793
+ column: MRT_Column<TData>;
811
794
  table: MRT_TableInstance<TData>;
795
+ }) => SliderProps)
796
+ | SliderProps;
797
+ muiFilterTextFieldProps?:
798
+ | ((props: {
812
799
  column: MRT_Column<TData>;
813
- }) => TableCellProps);
814
- muiTableFooterProps?:
815
- | TableFooterProps
816
- | ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps);
817
- muiTableFooterRowProps?:
818
- | TableRowProps
800
+ rangeFilterIndex?: number;
801
+ table: MRT_TableInstance<TData>;
802
+ }) => TextFieldProps)
803
+ | TextFieldProps;
804
+ muiLinearProgressProps?:
819
805
  | ((props: {
806
+ isTopToolbar: boolean;
820
807
  table: MRT_TableInstance<TData>;
821
- footerGroup: MRT_HeaderGroup<TData>;
822
- }) => TableRowProps);
823
- muiColumnActionsButtonProps?:
824
- | IconButtonProps
808
+ }) => LinearProgressProps)
809
+ | LinearProgressProps;
810
+ muiRowDragHandleProps?:
825
811
  | ((props: {
812
+ row: MRT_Row<TData>;
826
813
  table: MRT_TableInstance<TData>;
827
- column: MRT_Column<TData>;
828
- }) => IconButtonProps);
829
- muiColumnDragHandleProps?:
830
- | 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?:
831
823
  | ((props: {
824
+ row: MRT_Row<TData>;
832
825
  table: MRT_TableInstance<TData>;
833
- column: MRT_Column<TData>;
834
- }) => IconButtonProps);
835
- muiFilterCheckboxProps?:
836
- | CheckboxProps
826
+ }) => CheckboxProps | RadioProps)
827
+ | (CheckboxProps | RadioProps);
828
+ muiSkeletonProps?:
837
829
  | ((props: {
830
+ cell: MRT_Cell<TData>;
838
831
  column: MRT_Column<TData>;
832
+ row: MRT_Row<TData>;
839
833
  table: MRT_TableInstance<TData>;
840
- }) => CheckboxProps);
841
- muiFilterTextFieldProps?:
842
- | TextFieldProps
834
+ }) => SkeletonProps)
835
+ | SkeletonProps;
836
+ muiTableBodyCellProps?:
843
837
  | ((props: {
844
- table: MRT_TableInstance<TData>;
838
+ cell: MRT_Cell<TData>;
845
839
  column: MRT_Column<TData>;
846
- rangeFilterIndex?: number;
847
- }) => TextFieldProps);
848
- muiFilterSliderProps?:
849
- | SliderProps
850
- | ((props: {
840
+ row: MRT_Row<TData>;
851
841
  table: MRT_TableInstance<TData>;
852
- column: MRT_Column<TData>;
853
- }) => TextFieldProps);
854
- muiCreateRowModalProps?:
855
- | DialogProps
842
+ }) => TableCellProps)
843
+ | TableCellProps;
844
+ muiTableBodyProps?:
845
+ | ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps)
846
+ | TableBodyProps;
847
+ muiTableBodyRowProps?:
856
848
  | ((props: {
849
+ isDetailPanel?: boolean;
857
850
  row: MRT_Row<TData>;
851
+ staticRowIndex: number;
858
852
  table: MRT_TableInstance<TData>;
859
- }) => DialogProps);
860
- muiEditRowModalProps?:
861
- | DialogProps
853
+ }) => TableRowProps)
854
+ | TableRowProps;
855
+ muiTableContainerProps?:
856
+ | ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps)
857
+ | TableContainerProps;
858
+ muiTableFooterCellProps?:
862
859
  | ((props: {
863
- row: MRT_Row<TData>;
860
+ column: MRT_Column<TData>;
864
861
  table: MRT_TableInstance<TData>;
865
- }) => DialogProps);
866
- muiTableHeadCellProps?:
867
- | TableCellProps
862
+ }) => TableCellProps)
863
+ | TableCellProps;
864
+ muiTableFooterProps?:
865
+ | ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps)
866
+ | TableFooterProps;
867
+ muiTableFooterRowProps?:
868
868
  | ((props: {
869
+ footerGroup: MRT_HeaderGroup<TData>;
869
870
  table: MRT_TableInstance<TData>;
871
+ }) => TableRowProps)
872
+ | TableRowProps;
873
+ muiTableHeadCellProps?:
874
+ | ((props: {
870
875
  column: MRT_Column<TData>;
871
- }) => TableCellProps);
876
+ table: MRT_TableInstance<TData>;
877
+ }) => TableCellProps)
878
+ | TableCellProps;
872
879
  muiTableHeadProps?:
873
- | TableHeadProps
874
- | ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps);
880
+ | ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps)
881
+ | TableHeadProps;
875
882
  muiTableHeadRowProps?:
876
- | TableRowProps
877
883
  | ((props: {
878
- table: MRT_TableInstance<TData>;
879
884
  headerGroup: MRT_HeaderGroup<TData>;
880
- }) => TableRowProps);
885
+ table: MRT_TableInstance<TData>;
886
+ }) => TableRowProps)
887
+ | TableRowProps;
881
888
  muiTablePaginationProps?:
882
- | Partial<Omit<TablePaginationProps, 'rowsPerPage'>>
883
889
  | ((props: {
884
890
  table: MRT_TableInstance<TData>;
885
- }) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
891
+ }) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>)
892
+ | Partial<Omit<TablePaginationProps, 'rowsPerPage'>>;
886
893
  muiTablePaperProps?:
887
- | PaperProps
888
- | ((props: { table: MRT_TableInstance<TData> }) => PaperProps);
894
+ | ((props: { table: MRT_TableInstance<TData> }) => PaperProps)
895
+ | PaperProps;
889
896
  muiTableProps?:
890
- | TableProps
891
- | ((props: { table: MRT_TableInstance<TData> }) => TableProps);
897
+ | ((props: { table: MRT_TableInstance<TData> }) => TableProps)
898
+ | TableProps;
892
899
  muiToolbarAlertBannerChipProps?:
893
- | ChipProps
894
- | ((props: { table: MRT_TableInstance<TData> }) => ChipProps);
900
+ | ((props: { table: MRT_TableInstance<TData> }) => ChipProps)
901
+ | ChipProps;
895
902
  muiToolbarAlertBannerProps?:
896
- | AlertProps
897
- | ((props: { table: MRT_TableInstance<TData> }) => AlertProps);
903
+ | ((props: { table: MRT_TableInstance<TData> }) => AlertProps)
904
+ | AlertProps;
898
905
  muiTopToolbarProps?:
899
- | ToolbarProps
900
- | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
906
+ | ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps)
907
+ | ToolbarProps;
908
+ onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
901
909
  onCreatingRowCancel?: (props: {
902
910
  row: MRT_Row<TData>;
903
911
  table: MRT_TableInstance<TData>;
@@ -909,7 +917,6 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
909
917
  table: MRT_TableInstance<TData>;
910
918
  values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
911
919
  }) => void;
912
- onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
913
920
  onDensityChange?: OnChangeFn<MRT_DensityState>;
914
921
  onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
915
922
  onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
@@ -926,38 +933,29 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
926
933
  values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
927
934
  }) => Promise<void> | void;
928
935
  onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
929
- onHoveredColumnChange?: OnChangeFn<MRT_Column<TData> | { id: string } | null>;
930
- 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>;
931
938
  onIsFullScreenChange?: OnChangeFn<boolean>;
932
939
  onShowAlertBannerChange?: OnChangeFn<boolean>;
933
940
  onShowColumnFiltersChange?: OnChangeFn<boolean>;
934
941
  onShowGlobalFilterChange?: OnChangeFn<boolean>;
935
942
  onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
943
+ paginationDisplayMode?: 'custom' | 'default' | 'pages';
936
944
  positionActionsColumn?: 'first' | 'last';
937
945
  positionExpandColumn?: 'first' | 'last';
938
- positionGlobalFilter?: 'left' | 'right' | 'none';
939
- positionPagination?: 'bottom' | 'top' | 'both' | 'none';
940
- positionToolbarAlertBanner?: 'bottom' | 'top' | 'none';
941
- 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';
942
950
  renderBottomToolbar?:
943
- | ReactNode
944
- | ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
951
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
952
+ | ReactNode;
945
953
  renderBottomToolbarCustomActions?: (props: {
946
954
  table: MRT_TableInstance<TData>;
947
955
  }) => ReactNode;
948
- renderCreateRowModalContent?: (props: {
949
- internalEditComponents: ReactNode[];
950
- row: MRT_Row<TData>;
951
- table: MRT_TableInstance<TData>;
952
- }) => ReactNode;
953
- renderEditRowModalContent?: (props: {
954
- internalEditComponents: ReactNode[];
955
- row: MRT_Row<TData>;
956
- table: MRT_TableInstance<TData>;
957
- }) => ReactNode;
958
956
  renderColumnActionsMenuItems?: (props: {
959
- column: MRT_Column<TData>;
960
957
  closeMenu: () => void;
958
+ column: MRT_Column<TData>;
961
959
  internalColumnMenuItems: ReactNode[];
962
960
  table: MRT_TableInstance<TData>;
963
961
  }) => ReactNode[];
@@ -967,18 +965,28 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
967
965
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
968
966
  table: MRT_TableInstance<TData>;
969
967
  }) => ReactNode[];
968
+ renderCreateRowModalContent?: (props: {
969
+ internalEditComponents: ReactNode[];
970
+ row: MRT_Row<TData>;
971
+ table: MRT_TableInstance<TData>;
972
+ }) => ReactNode;
970
973
  renderDetailPanel?: (props: {
971
974
  row: MRT_Row<TData>;
972
975
  table: MRT_TableInstance<TData>;
973
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;
974
985
  renderGlobalFilterModeMenuItems?: (props: {
975
986
  internalFilterOptions: MRT_InternalFilterOption[];
976
987
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
977
988
  table: MRT_TableInstance<TData>;
978
989
  }) => ReactNode[];
979
- renderEmptyRowsFallback?: (props: {
980
- table: MRT_TableInstance<TData>;
981
- }) => ReactNode;
982
990
  renderRowActionMenuItems?: (props: {
983
991
  closeMenu: () => void;
984
992
  row: MRT_Row<TData>;
@@ -993,23 +1001,32 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
993
1001
  table: MRT_TableInstance<TData>;
994
1002
  }) => ReactNode;
995
1003
  renderTopToolbar?:
996
- | ReactNode
997
- | ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
1004
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
1005
+ | ReactNode;
998
1006
  renderTopToolbarCustomActions?: (props: {
999
1007
  table: MRT_TableInstance<TData>;
1000
1008
  }) => ReactNode;
1001
1009
  rowCount?: number;
1002
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';
1003
1019
  rowVirtualizerInstanceRef?: MutableRefObject<Virtualizer<
1004
1020
  HTMLDivElement,
1005
1021
  HTMLTableRowElement
1006
1022
  > | null>;
1007
1023
  rowVirtualizerOptions?:
1008
- | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>
1009
1024
  | ((props: {
1010
1025
  table: MRT_TableInstance<TData>;
1011
- }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>);
1026
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>)
1027
+ | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
1012
1028
  selectAllMode?: 'all' | 'page';
1029
+ selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
1013
1030
  /**
1014
1031
  * Manage state externally any way you want, then pass it back into MRT.
1015
1032
  */