@novastera-oss/material-react-table 4.0.0-beta.7

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 (324) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +233 -0
  3. package/dist/index.cjs +5190 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.ts +1871 -0
  6. package/dist/index.js +5084 -0
  7. package/dist/index.js.map +1 -0
  8. package/locales/ar/index.d.ts +3 -0
  9. package/locales/ar/index.esm.d.ts +3 -0
  10. package/locales/ar/index.esm.js +96 -0
  11. package/locales/ar/index.js +98 -0
  12. package/locales/ar/package.json +6 -0
  13. package/locales/az/index.d.ts +3 -0
  14. package/locales/az/index.esm.d.ts +3 -0
  15. package/locales/az/index.esm.js +96 -0
  16. package/locales/az/index.js +98 -0
  17. package/locales/az/package.json +6 -0
  18. package/locales/bg/index.d.ts +3 -0
  19. package/locales/bg/index.esm.d.ts +3 -0
  20. package/locales/bg/index.esm.js +96 -0
  21. package/locales/bg/index.js +98 -0
  22. package/locales/bg/package.json +6 -0
  23. package/locales/cs/index.d.ts +3 -0
  24. package/locales/cs/index.esm.d.ts +3 -0
  25. package/locales/cs/index.esm.js +96 -0
  26. package/locales/cs/index.js +98 -0
  27. package/locales/cs/package.json +6 -0
  28. package/locales/da/index.d.ts +3 -0
  29. package/locales/da/index.esm.d.ts +3 -0
  30. package/locales/da/index.esm.js +96 -0
  31. package/locales/da/index.js +98 -0
  32. package/locales/da/package.json +6 -0
  33. package/locales/de/index.d.ts +3 -0
  34. package/locales/de/index.esm.d.ts +3 -0
  35. package/locales/de/index.esm.js +96 -0
  36. package/locales/de/index.js +98 -0
  37. package/locales/de/package.json +6 -0
  38. package/locales/el/index.d.ts +3 -0
  39. package/locales/el/index.esm.d.ts +3 -0
  40. package/locales/el/index.esm.js +96 -0
  41. package/locales/el/index.js +98 -0
  42. package/locales/el/package.json +6 -0
  43. package/locales/en/index.d.ts +3 -0
  44. package/locales/en/index.esm.d.ts +3 -0
  45. package/locales/en/index.esm.js +96 -0
  46. package/locales/en/index.js +98 -0
  47. package/locales/en/package.json +6 -0
  48. package/locales/es/index.d.ts +3 -0
  49. package/locales/es/index.esm.d.ts +3 -0
  50. package/locales/es/index.esm.js +96 -0
  51. package/locales/es/index.js +98 -0
  52. package/locales/es/package.json +6 -0
  53. package/locales/et/index.d.ts +3 -0
  54. package/locales/et/index.esm.d.ts +3 -0
  55. package/locales/et/index.esm.js +96 -0
  56. package/locales/et/index.js +98 -0
  57. package/locales/et/package.json +6 -0
  58. package/locales/fa/index.d.ts +3 -0
  59. package/locales/fa/index.esm.d.ts +3 -0
  60. package/locales/fa/index.esm.js +96 -0
  61. package/locales/fa/index.js +98 -0
  62. package/locales/fa/package.json +6 -0
  63. package/locales/fi/index.d.ts +3 -0
  64. package/locales/fi/index.esm.d.ts +3 -0
  65. package/locales/fi/index.esm.js +96 -0
  66. package/locales/fi/index.js +98 -0
  67. package/locales/fi/package.json +6 -0
  68. package/locales/fr/index.d.ts +3 -0
  69. package/locales/fr/index.esm.d.ts +3 -0
  70. package/locales/fr/index.esm.js +96 -0
  71. package/locales/fr/index.js +98 -0
  72. package/locales/fr/package.json +6 -0
  73. package/locales/he/index.d.ts +3 -0
  74. package/locales/he/index.esm.d.ts +3 -0
  75. package/locales/he/index.esm.js +96 -0
  76. package/locales/he/index.js +98 -0
  77. package/locales/he/package.json +6 -0
  78. package/locales/hr/index.d.ts +3 -0
  79. package/locales/hr/index.esm.d.ts +3 -0
  80. package/locales/hr/index.esm.js +96 -0
  81. package/locales/hr/index.js +98 -0
  82. package/locales/hr/package.json +6 -0
  83. package/locales/hu/index.d.ts +3 -0
  84. package/locales/hu/index.esm.d.ts +3 -0
  85. package/locales/hu/index.esm.js +96 -0
  86. package/locales/hu/index.js +98 -0
  87. package/locales/hu/package.json +6 -0
  88. package/locales/hy/index.d.ts +3 -0
  89. package/locales/hy/index.esm.d.ts +3 -0
  90. package/locales/hy/index.esm.js +96 -0
  91. package/locales/hy/index.js +98 -0
  92. package/locales/hy/package.json +6 -0
  93. package/locales/id/index.d.ts +3 -0
  94. package/locales/id/index.esm.d.ts +3 -0
  95. package/locales/id/index.esm.js +96 -0
  96. package/locales/id/index.js +98 -0
  97. package/locales/id/package.json +6 -0
  98. package/locales/it/index.d.ts +3 -0
  99. package/locales/it/index.esm.d.ts +3 -0
  100. package/locales/it/index.esm.js +96 -0
  101. package/locales/it/index.js +98 -0
  102. package/locales/it/package.json +6 -0
  103. package/locales/ja/index.d.ts +3 -0
  104. package/locales/ja/index.esm.d.ts +3 -0
  105. package/locales/ja/index.esm.js +96 -0
  106. package/locales/ja/index.js +98 -0
  107. package/locales/ja/package.json +6 -0
  108. package/locales/ko/index.d.ts +3 -0
  109. package/locales/ko/index.esm.d.ts +3 -0
  110. package/locales/ko/index.esm.js +96 -0
  111. package/locales/ko/index.js +98 -0
  112. package/locales/ko/package.json +6 -0
  113. package/locales/nl/index.d.ts +3 -0
  114. package/locales/nl/index.esm.d.ts +3 -0
  115. package/locales/nl/index.esm.js +96 -0
  116. package/locales/nl/index.js +98 -0
  117. package/locales/nl/package.json +6 -0
  118. package/locales/no/index.d.ts +3 -0
  119. package/locales/no/index.esm.d.ts +3 -0
  120. package/locales/no/index.esm.js +96 -0
  121. package/locales/no/index.js +98 -0
  122. package/locales/no/package.json +6 -0
  123. package/locales/np/index.d.ts +3 -0
  124. package/locales/np/index.esm.d.ts +3 -0
  125. package/locales/np/index.esm.js +96 -0
  126. package/locales/np/index.js +98 -0
  127. package/locales/np/package.json +6 -0
  128. package/locales/pl/index.d.ts +3 -0
  129. package/locales/pl/index.esm.d.ts +3 -0
  130. package/locales/pl/index.esm.js +96 -0
  131. package/locales/pl/index.js +98 -0
  132. package/locales/pl/package.json +6 -0
  133. package/locales/pt/index.d.ts +3 -0
  134. package/locales/pt/index.esm.d.ts +3 -0
  135. package/locales/pt/index.esm.js +96 -0
  136. package/locales/pt/index.js +98 -0
  137. package/locales/pt/package.json +6 -0
  138. package/locales/pt-BR/index.d.ts +3 -0
  139. package/locales/pt-BR/index.esm.d.ts +3 -0
  140. package/locales/pt-BR/index.esm.js +96 -0
  141. package/locales/pt-BR/index.js +98 -0
  142. package/locales/pt-BR/package.json +6 -0
  143. package/locales/ro/index.d.ts +3 -0
  144. package/locales/ro/index.esm.d.ts +3 -0
  145. package/locales/ro/index.esm.js +96 -0
  146. package/locales/ro/index.js +98 -0
  147. package/locales/ro/package.json +6 -0
  148. package/locales/ru/index.d.ts +3 -0
  149. package/locales/ru/index.esm.d.ts +3 -0
  150. package/locales/ru/index.esm.js +96 -0
  151. package/locales/ru/index.js +98 -0
  152. package/locales/ru/package.json +6 -0
  153. package/locales/sk/index.d.ts +3 -0
  154. package/locales/sk/index.esm.d.ts +3 -0
  155. package/locales/sk/index.esm.js +96 -0
  156. package/locales/sk/index.js +98 -0
  157. package/locales/sk/package.json +6 -0
  158. package/locales/sr-Cyrl-RS/index.d.ts +3 -0
  159. package/locales/sr-Cyrl-RS/index.esm.d.ts +3 -0
  160. package/locales/sr-Cyrl-RS/index.esm.js +96 -0
  161. package/locales/sr-Cyrl-RS/index.js +98 -0
  162. package/locales/sr-Cyrl-RS/package.json +6 -0
  163. package/locales/sr-Latn-RS/index.d.ts +3 -0
  164. package/locales/sr-Latn-RS/index.esm.d.ts +3 -0
  165. package/locales/sr-Latn-RS/index.esm.js +96 -0
  166. package/locales/sr-Latn-RS/index.js +98 -0
  167. package/locales/sr-Latn-RS/package.json +6 -0
  168. package/locales/sv/index.d.ts +3 -0
  169. package/locales/sv/index.esm.d.ts +3 -0
  170. package/locales/sv/index.esm.js +96 -0
  171. package/locales/sv/index.js +98 -0
  172. package/locales/sv/package.json +6 -0
  173. package/locales/tr/index.d.ts +3 -0
  174. package/locales/tr/index.esm.d.ts +3 -0
  175. package/locales/tr/index.esm.js +96 -0
  176. package/locales/tr/index.js +98 -0
  177. package/locales/tr/package.json +6 -0
  178. package/locales/uk/index.d.ts +3 -0
  179. package/locales/uk/index.esm.d.ts +3 -0
  180. package/locales/uk/index.esm.js +96 -0
  181. package/locales/uk/index.js +98 -0
  182. package/locales/uk/package.json +6 -0
  183. package/locales/vi/index.d.ts +3 -0
  184. package/locales/vi/index.esm.d.ts +3 -0
  185. package/locales/vi/index.esm.js +96 -0
  186. package/locales/vi/index.js +98 -0
  187. package/locales/vi/package.json +6 -0
  188. package/locales/zh-Hans/index.d.ts +3 -0
  189. package/locales/zh-Hans/index.esm.d.ts +3 -0
  190. package/locales/zh-Hans/index.esm.js +96 -0
  191. package/locales/zh-Hans/index.js +98 -0
  192. package/locales/zh-Hans/package.json +6 -0
  193. package/locales/zh-Hant/index.d.ts +3 -0
  194. package/locales/zh-Hant/index.esm.d.ts +3 -0
  195. package/locales/zh-Hant/index.esm.js +96 -0
  196. package/locales/zh-Hant/index.js +98 -0
  197. package/locales/zh-Hant/package.json +6 -0
  198. package/package.json +103 -0
  199. package/src/components/MaterialReactTable.tsx +36 -0
  200. package/src/components/body/MRT_TableBody.tsx +233 -0
  201. package/src/components/body/MRT_TableBodyCell.tsx +356 -0
  202. package/src/components/body/MRT_TableBodyCellValue.tsx +130 -0
  203. package/src/components/body/MRT_TableBodyRow.tsx +306 -0
  204. package/src/components/body/MRT_TableBodyRowGrabHandle.tsx +61 -0
  205. package/src/components/body/MRT_TableBodyRowPinButton.tsx +58 -0
  206. package/src/components/body/MRT_TableDetailPanel.tsx +118 -0
  207. package/src/components/buttons/MRT_ColumnPinningButtons.tsx +73 -0
  208. package/src/components/buttons/MRT_CopyButton.tsx +91 -0
  209. package/src/components/buttons/MRT_EditActionButtons.tsx +135 -0
  210. package/src/components/buttons/MRT_ExpandAllButton.tsx +82 -0
  211. package/src/components/buttons/MRT_ExpandButton.tsx +106 -0
  212. package/src/components/buttons/MRT_GrabHandleButton.tsx +66 -0
  213. package/src/components/buttons/MRT_RowPinButton.tsx +84 -0
  214. package/src/components/buttons/MRT_ShowHideColumnsButton.tsx +50 -0
  215. package/src/components/buttons/MRT_ToggleDensePaddingButton.tsx +52 -0
  216. package/src/components/buttons/MRT_ToggleFiltersButton.tsx +40 -0
  217. package/src/components/buttons/MRT_ToggleFullScreenButton.tsx +51 -0
  218. package/src/components/buttons/MRT_ToggleGlobalFilterButton.tsx +46 -0
  219. package/src/components/buttons/MRT_ToggleRowActionMenuButton.tsx +126 -0
  220. package/src/components/footer/MRT_TableFooter.tsx +92 -0
  221. package/src/components/footer/MRT_TableFooterCell.tsx +111 -0
  222. package/src/components/footer/MRT_TableFooterRow.tsx +99 -0
  223. package/src/components/head/MRT_TableHead.tsx +95 -0
  224. package/src/components/head/MRT_TableHeadCell.tsx +357 -0
  225. package/src/components/head/MRT_TableHeadCellColumnActionsButton.tsx +100 -0
  226. package/src/components/head/MRT_TableHeadCellFilterContainer.tsx +52 -0
  227. package/src/components/head/MRT_TableHeadCellFilterLabel.tsx +180 -0
  228. package/src/components/head/MRT_TableHeadCellGrabHandle.tsx +91 -0
  229. package/src/components/head/MRT_TableHeadCellResizeHandle.tsx +96 -0
  230. package/src/components/head/MRT_TableHeadCellSortLabel.tsx +102 -0
  231. package/src/components/head/MRT_TableHeadRow.tsx +94 -0
  232. package/src/components/inputs/MRT_EditCellTextField.tsx +195 -0
  233. package/src/components/inputs/MRT_FilterCheckbox.tsx +94 -0
  234. package/src/components/inputs/MRT_FilterRangeFields.tsx +42 -0
  235. package/src/components/inputs/MRT_FilterRangeSlider.tsx +145 -0
  236. package/src/components/inputs/MRT_FilterTextField.tsx +610 -0
  237. package/src/components/inputs/MRT_GlobalFilterTextField.tsx +166 -0
  238. package/src/components/inputs/MRT_SelectCheckbox.tsx +133 -0
  239. package/src/components/menus/MRT_ActionMenuItem.tsx +62 -0
  240. package/src/components/menus/MRT_CellActionMenu.tsx +109 -0
  241. package/src/components/menus/MRT_ColumnActionMenu.tsx +354 -0
  242. package/src/components/menus/MRT_FilterOptionMenu.tsx +294 -0
  243. package/src/components/menus/MRT_RowActionMenu.tsx +90 -0
  244. package/src/components/menus/MRT_ShowHideColumnsMenu.tsx +181 -0
  245. package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +204 -0
  246. package/src/components/modals/MRT_EditRowModal.tsx +114 -0
  247. package/src/components/table/MRT_Table.tsx +86 -0
  248. package/src/components/table/MRT_TableContainer.tsx +115 -0
  249. package/src/components/table/MRT_TableLoadingOverlay.tsx +58 -0
  250. package/src/components/table/MRT_TablePaper.tsx +91 -0
  251. package/src/components/toolbar/MRT_BottomToolbar.tsx +112 -0
  252. package/src/components/toolbar/MRT_LinearProgressBar.tsx +53 -0
  253. package/src/components/toolbar/MRT_TablePagination.tsx +241 -0
  254. package/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +182 -0
  255. package/src/components/toolbar/MRT_ToolbarDropZone.tsx +82 -0
  256. package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +73 -0
  257. package/src/components/toolbar/MRT_TopToolbar.tsx +134 -0
  258. package/src/fns/aggregationFns.ts +3 -0
  259. package/src/fns/filterFns.ts +196 -0
  260. package/src/fns/sortingFns.ts +33 -0
  261. package/src/hooks/display-columns/getMRT_RowActionsColumnDef.tsx +28 -0
  262. package/src/hooks/display-columns/getMRT_RowDragColumnDef.tsx +29 -0
  263. package/src/hooks/display-columns/getMRT_RowExpandColumnDef.tsx +91 -0
  264. package/src/hooks/display-columns/getMRT_RowNumbersColumnDef.tsx +30 -0
  265. package/src/hooks/display-columns/getMRT_RowPinningColumnDef.tsx +24 -0
  266. package/src/hooks/display-columns/getMRT_RowSelectColumnDef.tsx +34 -0
  267. package/src/hooks/display-columns/getMRT_RowSpacerColumnDef.tsx +33 -0
  268. package/src/hooks/useMRT_ColumnVirtualizer.ts +124 -0
  269. package/src/hooks/useMRT_Effects.ts +106 -0
  270. package/src/hooks/useMRT_RowVirtualizer.ts +88 -0
  271. package/src/hooks/useMRT_Rows.ts +44 -0
  272. package/src/hooks/useMRT_TableInstance.ts +317 -0
  273. package/src/hooks/useMRT_TableOptions.ts +270 -0
  274. package/src/hooks/useMaterialReactTable.ts +12 -0
  275. package/src/icons.ts +73 -0
  276. package/src/index.ts +91 -0
  277. package/src/locales/ar.ts +97 -0
  278. package/src/locales/az.ts +97 -0
  279. package/src/locales/bg.ts +97 -0
  280. package/src/locales/cs.ts +98 -0
  281. package/src/locales/da.ts +97 -0
  282. package/src/locales/de.ts +97 -0
  283. package/src/locales/el.ts +97 -0
  284. package/src/locales/en.ts +97 -0
  285. package/src/locales/es.ts +97 -0
  286. package/src/locales/et.ts +98 -0
  287. package/src/locales/fa.ts +97 -0
  288. package/src/locales/fi.ts +98 -0
  289. package/src/locales/fr.ts +97 -0
  290. package/src/locales/he.ts +97 -0
  291. package/src/locales/hr.ts +97 -0
  292. package/src/locales/hu.ts +97 -0
  293. package/src/locales/hy.ts +97 -0
  294. package/src/locales/id.ts +98 -0
  295. package/src/locales/it.ts +97 -0
  296. package/src/locales/ja.ts +97 -0
  297. package/src/locales/ko.ts +97 -0
  298. package/src/locales/mk.ts +96 -0
  299. package/src/locales/nl.ts +97 -0
  300. package/src/locales/no.ts +99 -0
  301. package/src/locales/np.ts +98 -0
  302. package/src/locales/pl.ts +97 -0
  303. package/src/locales/pt-BR.ts +97 -0
  304. package/src/locales/pt.ts +97 -0
  305. package/src/locales/ro.ts +97 -0
  306. package/src/locales/ru.ts +97 -0
  307. package/src/locales/sk.ts +98 -0
  308. package/src/locales/sr-Cyrl-RS.ts +97 -0
  309. package/src/locales/sr-Latn-RS.ts +97 -0
  310. package/src/locales/sv.ts +97 -0
  311. package/src/locales/tr.ts +97 -0
  312. package/src/locales/uk.ts +97 -0
  313. package/src/locales/vi.ts +97 -0
  314. package/src/locales/zh-Hans.ts +96 -0
  315. package/src/locales/zh-Hant.ts +96 -0
  316. package/src/types.ts +1298 -0
  317. package/src/utils/cell.utils.ts +234 -0
  318. package/src/utils/column.utils.ts +209 -0
  319. package/src/utils/displayColumn.utils.ts +152 -0
  320. package/src/utils/row.utils.ts +260 -0
  321. package/src/utils/style.utils.ts +221 -0
  322. package/src/utils/tanstack.helpers.ts +64 -0
  323. package/src/utils/utils.ts +56 -0
  324. package/src/utils/virtualization.utils.ts +24 -0
package/src/types.ts ADDED
@@ -0,0 +1,1298 @@
1
+ import {
2
+ type Dispatch,
3
+ type ReactNode,
4
+ type RefObject,
5
+ type SetStateAction,
6
+ } from 'react';
7
+ import {
8
+ type AccessorFn,
9
+ type AggregationFn,
10
+ type Cell,
11
+ type Column,
12
+ type ColumnDef,
13
+ type ColumnFiltersState,
14
+ type ColumnOrderState,
15
+ type ColumnPinningState,
16
+ type ColumnSizingInfoState,
17
+ type ColumnSizingState,
18
+ type DeepKeys,
19
+ type DeepValue,
20
+ type ExpandedState,
21
+ type FilterFn,
22
+ type GroupingState,
23
+ type Header,
24
+ type HeaderGroup,
25
+ type OnChangeFn,
26
+ type PaginationState,
27
+ type Row,
28
+ type RowSelectionState,
29
+ type SortingFn,
30
+ type SortingState,
31
+ type Table,
32
+ type TableOptions,
33
+ type TableState,
34
+ type Updater,
35
+ type VisibilityState,
36
+ } from '@tanstack/react-table';
37
+ import {
38
+ type VirtualItem,
39
+ type Virtualizer,
40
+ type VirtualizerOptions,
41
+ } from '@tanstack/react-virtual';
42
+ import { type AlertProps } from '@mui/material/Alert';
43
+ import { type AutocompleteProps } from '@mui/material/Autocomplete';
44
+ import { type BoxProps } from '@mui/material/Box';
45
+ import { type ButtonProps } from '@mui/material/Button';
46
+ import { type CheckboxProps } from '@mui/material/Checkbox';
47
+ import { type ChipProps } from '@mui/material/Chip';
48
+ import { type CircularProgressProps } from '@mui/material/CircularProgress';
49
+ import { type DialogProps } from '@mui/material/Dialog';
50
+ import { type IconButtonProps } from '@mui/material/IconButton';
51
+ import { type LinearProgressProps } from '@mui/material/LinearProgress';
52
+ import { type PaginationProps } from '@mui/material/Pagination';
53
+ import { type PaperProps } from '@mui/material/Paper';
54
+ import { type RadioProps } from '@mui/material/Radio';
55
+ import { type SelectProps } from '@mui/material/Select';
56
+ import { type SkeletonProps } from '@mui/material/Skeleton';
57
+ import { type SliderProps } from '@mui/material/Slider';
58
+ import { type TableProps } from '@mui/material/Table';
59
+ import { type TableBodyProps } from '@mui/material/TableBody';
60
+ import { type TableCellProps } from '@mui/material/TableCell';
61
+ import { type TableContainerProps } from '@mui/material/TableContainer';
62
+ import { type TableFooterProps } from '@mui/material/TableFooter';
63
+ import { type TableHeadProps } from '@mui/material/TableHead';
64
+ import { type TableRowProps } from '@mui/material/TableRow';
65
+ import { type TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';
66
+
67
+ export type DistributiveOmit<T, K extends keyof any> = T extends any
68
+ ? Omit<T, K>
69
+ : never;
70
+
71
+ export type TextFieldProps = DistributiveOmit<
72
+ MuiTextFieldProps,
73
+ 'InputProps' | 'inputProps' | 'SelectProps' | 'components' | 'componentsProps'
74
+ >;
75
+ import { type Theme } from '@mui/material/styles';
76
+ import {
77
+ type DatePickerProps,
78
+ type DateTimePickerProps,
79
+ type TimePickerProps,
80
+ } from '@mui/x-date-pickers';
81
+ import { type MRT_AggregationFns } from './fns/aggregationFns';
82
+ import { type MRT_FilterFns } from './fns/filterFns';
83
+ import { type MRT_SortingFns } from './fns/sortingFns';
84
+ import { type MRT_Icons } from './icons';
85
+
86
+ export type { MRT_Icons };
87
+ export type LiteralUnion<T extends U, U = string> =
88
+ | T
89
+ | (U & Record<never, never>);
90
+
91
+ export type Prettify<T> = { [K in keyof T]: T[K] } & unknown;
92
+
93
+ export type Xor<A, B> =
94
+ | Prettify<A & { [k in keyof B]?: never }>
95
+ | Prettify<B & { [k in keyof A]?: never }>;
96
+
97
+ export type DropdownOption =
98
+ | {
99
+ label?: string;
100
+ value: any;
101
+ }
102
+ | string;
103
+
104
+ export type MRT_DensityState = 'comfortable' | 'compact' | 'spacious';
105
+
106
+ export type MRT_ColumnFilterFnsState = Record<string, MRT_FilterOption>;
107
+
108
+ export type MRT_RowData = Record<string, any>;
109
+
110
+ export type MRT_ColumnFiltersState = ColumnFiltersState;
111
+ export type MRT_ColumnOrderState = ColumnOrderState;
112
+ export type MRT_ColumnPinningState = ColumnPinningState;
113
+ export type MRT_ColumnSizingInfoState = ColumnSizingInfoState;
114
+ export type MRT_ColumnSizingState = ColumnSizingState;
115
+ export type MRT_ExpandedState = ExpandedState;
116
+ export type MRT_GroupingState = GroupingState;
117
+ export type MRT_PaginationState = PaginationState;
118
+ export type MRT_RowSelectionState = RowSelectionState;
119
+ export type MRT_SortingState = SortingState;
120
+ export type MRT_Updater<T> = Updater<T>;
121
+ export type MRT_VirtualItem = VirtualItem;
122
+ export type MRT_VisibilityState = VisibilityState;
123
+
124
+ export type MRT_VirtualizerOptions<
125
+ TScrollElement extends Element | Window = Element | Window,
126
+ TItemElement extends Element = Element,
127
+ > = VirtualizerOptions<TScrollElement, TItemElement>;
128
+
129
+ export type MRT_ColumnVirtualizer<
130
+ TScrollElement extends Element | Window = HTMLDivElement,
131
+ TItemElement extends Element = HTMLTableCellElement,
132
+ > = Virtualizer<TScrollElement, TItemElement> & {
133
+ virtualColumns: MRT_VirtualItem[];
134
+ virtualPaddingLeft?: number;
135
+ virtualPaddingRight?: number;
136
+ };
137
+
138
+ export type MRT_RowVirtualizer<
139
+ TScrollElement extends Element | Window = HTMLDivElement,
140
+ TItemElement extends Element = HTMLTableRowElement,
141
+ > = Virtualizer<TScrollElement, TItemElement> & {
142
+ virtualRows: MRT_VirtualItem[];
143
+ };
144
+
145
+ export type MRT_ColumnHelper<TData extends MRT_RowData> = {
146
+ accessor: <
147
+ TAccessor extends AccessorFn<TData> | DeepKeys<TData>,
148
+ TValue extends TAccessor extends AccessorFn<TData, infer TReturn>
149
+ ? TReturn
150
+ : TAccessor extends DeepKeys<TData>
151
+ ? DeepValue<TData, TAccessor>
152
+ : never,
153
+ >(
154
+ accessor: TAccessor,
155
+ column: MRT_DisplayColumnDef<TData, TValue>,
156
+ ) => MRT_ColumnDef<TData, TValue>;
157
+ display: (column: MRT_DisplayColumnDef<TData>) => MRT_ColumnDef<TData>;
158
+ group: (column: MRT_GroupColumnDef<TData>) => MRT_ColumnDef<TData>;
159
+ };
160
+
161
+ export interface MRT_Localization {
162
+ // language of the localization as BCP 47 language tag for number formatting
163
+ language: string;
164
+ actions: string;
165
+ and: string;
166
+ cancel: string;
167
+ changeFilterMode: string;
168
+ changeSearchMode: string;
169
+ clearFilter: string;
170
+ clearSearch: string;
171
+ clearSelection: string;
172
+ clearSort: string;
173
+ clickToCopy: string;
174
+ collapse: string;
175
+ collapseAll: string;
176
+ columnActions: string;
177
+ copiedToClipboard: string;
178
+ copy: string;
179
+ dropToGroupBy: string;
180
+ edit: string;
181
+ expand: string;
182
+ expandAll: string;
183
+ filterArrIncludes: string;
184
+ filterArrIncludesAll: string;
185
+ filterArrIncludesSome: string;
186
+ filterBetween: string;
187
+ filterBetweenInclusive: string;
188
+ filterByColumn: string;
189
+ filterContains: string;
190
+ filterEmpty: string;
191
+ filterEndsWith: string;
192
+ filterEquals: string;
193
+ filterEqualsString: string;
194
+ filterFuzzy: string;
195
+ filterGreaterThan: string;
196
+ filterGreaterThanOrEqualTo: string;
197
+ filterIncludesString: string;
198
+ filterIncludesStringSensitive: string;
199
+ filteringByColumn: string;
200
+ filterInNumberRange: string;
201
+ filterLessThan: string;
202
+ filterLessThanOrEqualTo: string;
203
+ filterMode: string;
204
+ filterNotEmpty: string;
205
+ filterNotEquals: string;
206
+ filterStartsWith: string;
207
+ filterWeakEquals: string;
208
+ goToFirstPage: string;
209
+ goToLastPage: string;
210
+ goToNextPage: string;
211
+ goToPreviousPage: string;
212
+ grab: string;
213
+ groupByColumn: string;
214
+ groupedBy: string;
215
+ hideAll: string;
216
+ hideColumn: string;
217
+ max: string;
218
+ min: string;
219
+ move: string;
220
+ noRecordsToDisplay: string;
221
+ noResultsFound: string;
222
+ of: string;
223
+ or: string;
224
+ pin: string;
225
+ pinToLeft: string;
226
+ pinToRight: string;
227
+ resetColumnSize: string;
228
+ resetOrder: string;
229
+ rowActions: string;
230
+ rowNumber: string;
231
+ rowNumbers: string;
232
+ rowsPerPage: string;
233
+ save: string;
234
+ search: string;
235
+ select: string;
236
+ selectedCountOfRowCountRowsSelected: string;
237
+ showAll: string;
238
+ showAllColumns: string;
239
+ showHideColumns: string;
240
+ showHideFilters: string;
241
+ showHideSearch: string;
242
+ sortByColumnAsc: string;
243
+ sortByColumnDesc: string;
244
+ sortedByColumnAsc: string;
245
+ sortedByColumnDesc: string;
246
+ thenBy: string;
247
+ toggleDensity: string;
248
+ toggleFullScreen: string;
249
+ toggleSelectAll: string;
250
+ toggleSelectRow: string;
251
+ toggleVisibility: string;
252
+ ungroupByColumn: string;
253
+ unpin: string;
254
+ unpinAll: string;
255
+ }
256
+
257
+ export interface MRT_Theme {
258
+ baseBackgroundColor: string;
259
+ cellNavigationOutlineColor: string;
260
+ draggingBorderColor: string;
261
+ matchHighlightColor: string;
262
+ menuBackgroundColor: string;
263
+ pinnedRowBackgroundColor: string;
264
+ selectedRowBackgroundColor: string;
265
+ }
266
+
267
+ export interface MRT_RowModel<TData extends MRT_RowData> {
268
+ flatRows: MRT_Row<TData>[];
269
+ rows: MRT_Row<TData>[];
270
+ rowsById: { [key: string]: MRT_Row<TData> };
271
+ }
272
+
273
+ export type MRT_TableInstance<TData extends MRT_RowData> = Omit<
274
+ Table<TData>,
275
+ | 'getAllColumns'
276
+ | 'getAllFlatColumns'
277
+ | 'getAllLeafColumns'
278
+ | 'getBottomRows'
279
+ | 'getCenterLeafColumns'
280
+ | 'getCenterRows'
281
+ | 'getColumn'
282
+ | 'getExpandedRowModel'
283
+ | 'getFlatHeaders'
284
+ | 'getFooterGroups'
285
+ | 'getHeaderGroups'
286
+ | 'getLeafHeaders'
287
+ | 'getLeftLeafColumns'
288
+ | 'getPaginationRowModel'
289
+ | 'getPreFilteredRowModel'
290
+ | 'getPrePaginationRowModel'
291
+ | 'getRightLeafColumns'
292
+ | 'getRowModel'
293
+ | 'getSelectedRowModel'
294
+ | 'getState'
295
+ | 'getTopRows'
296
+ | 'options'
297
+ > & {
298
+ getAllColumns: () => MRT_Column<TData>[];
299
+ getAllFlatColumns: () => MRT_Column<TData>[];
300
+ getAllLeafColumns: () => MRT_Column<TData>[];
301
+ getBottomRows: () => MRT_Row<TData>[];
302
+ getCenterLeafColumns: () => MRT_Column<TData>[];
303
+ getCenterRows: () => MRT_Row<TData>[];
304
+ getColumn: (columnId: string) => MRT_Column<TData>;
305
+ getExpandedRowModel: () => MRT_RowModel<TData>;
306
+ getFlatHeaders: () => MRT_Header<TData>[];
307
+ getFooterGroups: () => MRT_HeaderGroup<TData>[];
308
+ getHeaderGroups: () => MRT_HeaderGroup<TData>[];
309
+ getLeafHeaders: () => MRT_Header<TData>[];
310
+ getLeftLeafColumns: () => MRT_Column<TData>[];
311
+ getPaginationRowModel: () => MRT_RowModel<TData>;
312
+ getPreFilteredRowModel: () => MRT_RowModel<TData>;
313
+ getPrePaginationRowModel: () => MRT_RowModel<TData>;
314
+ getRightLeafColumns: () => MRT_Column<TData>[];
315
+ getRowModel: () => MRT_RowModel<TData>;
316
+ getSelectedRowModel: () => MRT_RowModel<TData>;
317
+ getState: () => MRT_TableState<TData>;
318
+ getTopRows: () => MRT_Row<TData>[];
319
+ options: MRT_StatefulTableOptions<TData>;
320
+ refs: {
321
+ actionCellRef: RefObject<HTMLTableCellElement | null>;
322
+ bottomToolbarRef: RefObject<HTMLDivElement | null>;
323
+ editInputRefs: RefObject<Record<string, HTMLInputElement> | null>;
324
+ filterInputRefs: RefObject<Record<string, HTMLInputElement> | null>;
325
+ lastSelectedRowId: RefObject<null | string>;
326
+ searchInputRef: RefObject<HTMLInputElement | null>;
327
+ tableContainerRef: RefObject<HTMLDivElement | null>;
328
+ tableFooterRef: RefObject<HTMLTableSectionElement | null>;
329
+ tableHeadCellRefs: RefObject<Record<string, HTMLTableCellElement> | null>;
330
+ tableHeadRef: RefObject<HTMLTableSectionElement | null>;
331
+ tablePaperRef: RefObject<HTMLDivElement | null>;
332
+ topToolbarRef: RefObject<HTMLDivElement | null>;
333
+ };
334
+ setActionCell: Dispatch<SetStateAction<MRT_Cell<TData> | null>>;
335
+ setColumnFilterFns: Dispatch<SetStateAction<MRT_ColumnFilterFnsState>>;
336
+ setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
337
+ setDensity: Dispatch<SetStateAction<MRT_DensityState>>;
338
+ setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
339
+ setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
340
+ setEditingCell: Dispatch<SetStateAction<MRT_Cell<TData> | null>>;
341
+ setEditingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
342
+ setGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
343
+ setHoveredColumn: Dispatch<SetStateAction<Partial<MRT_Column<TData>> | null>>;
344
+ setHoveredRow: Dispatch<SetStateAction<Partial<MRT_Row<TData>> | null>>;
345
+ setIsFullScreen: Dispatch<SetStateAction<boolean>>;
346
+ setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
347
+ setShowColumnFilters: Dispatch<SetStateAction<boolean>>;
348
+ setShowGlobalFilter: Dispatch<SetStateAction<boolean>>;
349
+ setShowToolbarDropZone: Dispatch<SetStateAction<boolean>>;
350
+ };
351
+
352
+ export type MRT_DefinedTableOptions<TData extends MRT_RowData> = Omit<
353
+ MRT_TableOptions<TData>,
354
+ 'icons' | 'localization' | 'mrtTheme'
355
+ > & {
356
+ icons: MRT_Icons;
357
+ localization: MRT_Localization;
358
+ mrtTheme: Required<MRT_Theme>;
359
+ };
360
+
361
+ export type MRT_StatefulTableOptions<TData extends MRT_RowData> =
362
+ MRT_DefinedTableOptions<TData> & {
363
+ state: Pick<
364
+ MRT_TableState<TData>,
365
+ | 'columnFilterFns'
366
+ | 'columnOrder'
367
+ | 'columnSizingInfo'
368
+ | 'creatingRow'
369
+ | 'density'
370
+ | 'draggingColumn'
371
+ | 'draggingRow'
372
+ | 'editingCell'
373
+ | 'editingRow'
374
+ | 'globalFilterFn'
375
+ | 'grouping'
376
+ | 'hoveredColumn'
377
+ | 'hoveredRow'
378
+ | 'isFullScreen'
379
+ | 'pagination'
380
+ | 'showAlertBanner'
381
+ | 'showColumnFilters'
382
+ | 'showGlobalFilter'
383
+ | 'showToolbarDropZone'
384
+ >;
385
+ };
386
+
387
+ export interface MRT_TableState<TData extends MRT_RowData> extends TableState {
388
+ actionCell?: MRT_Cell<TData> | null;
389
+ columnFilterFns: MRT_ColumnFilterFnsState;
390
+ creatingRow: MRT_Row<TData> | null;
391
+ density: MRT_DensityState;
392
+ draggingColumn: MRT_Column<TData> | null;
393
+ draggingRow: MRT_Row<TData> | null;
394
+ editingCell: MRT_Cell<TData> | null;
395
+ editingRow: MRT_Row<TData> | null;
396
+ globalFilterFn: MRT_FilterOption;
397
+ hoveredColumn: Partial<MRT_Column<TData>> | null;
398
+ hoveredRow: Partial<MRT_Row<TData>> | null;
399
+ isFullScreen: boolean;
400
+ isLoading: boolean;
401
+ isSaving: boolean;
402
+ showAlertBanner: boolean;
403
+ showColumnFilters: boolean;
404
+ showGlobalFilter: boolean;
405
+ showLoadingOverlay: boolean;
406
+ showProgressBars: boolean;
407
+ showSkeletons: boolean;
408
+ showToolbarDropZone: boolean;
409
+ }
410
+
411
+ export interface MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown>
412
+ extends Omit<
413
+ ColumnDef<TData, TValue>,
414
+ | 'accessorKey'
415
+ | 'aggregatedCell'
416
+ | 'aggregationFn'
417
+ | 'cell'
418
+ | 'columns'
419
+ | 'filterFn'
420
+ | 'footer'
421
+ | 'header'
422
+ | 'id'
423
+ | 'sortingFn'
424
+ > {
425
+ /**
426
+ * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
427
+ * Specify a function here to point to the correct property in the data object.
428
+ *
429
+ * @example accessorFn: (row) => row.username
430
+ */
431
+ accessorFn?: (originalRow: TData) => TValue;
432
+ /**
433
+ * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
434
+ * Specify which key in the row this column should use to access the correct data.
435
+ * Also supports Deep Key Dot Notation.
436
+ *
437
+ * @example accessorKey: 'username' //simple
438
+ * @example accessorKey: 'name.firstName' //deep key dot notation
439
+ */
440
+ accessorKey?: DeepKeys<TData> | (string & {});
441
+ AggregatedCell?: (props: {
442
+ cell: MRT_Cell<TData, TValue>;
443
+ column: MRT_Column<TData, TValue>;
444
+ row: MRT_Row<TData>;
445
+ table: MRT_TableInstance<TData>;
446
+ staticColumnIndex?: number;
447
+ staticRowIndex?: number;
448
+ }) => ReactNode;
449
+ aggregationFn?: Array<MRT_AggregationFn<TData>> | MRT_AggregationFn<TData>;
450
+ Cell?: (props: {
451
+ cell: MRT_Cell<TData, TValue>;
452
+ column: MRT_Column<TData, TValue>;
453
+ renderedCellValue: ReactNode;
454
+ row: MRT_Row<TData>;
455
+ rowRef?: RefObject<HTMLTableRowElement | null>;
456
+ staticColumnIndex?: number;
457
+ staticRowIndex?: number;
458
+ table: MRT_TableInstance<TData>;
459
+ }) => ReactNode;
460
+ /**
461
+ * Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
462
+ * Leave this blank if you are just creating a normal data column.
463
+ *
464
+ * @default 'data'
465
+ *
466
+ * @example columnDefType: 'display'
467
+ */
468
+ columnDefType?: 'data' | 'display' | 'group';
469
+ columnFilterModeOptions?: Array<
470
+ LiteralUnion<string & MRT_FilterOption>
471
+ > | null;
472
+ columns?: MRT_ColumnDef<TData, TValue>[];
473
+ Edit?: (props: {
474
+ cell: MRT_Cell<TData, TValue>;
475
+ column: MRT_Column<TData, TValue>;
476
+ row: MRT_Row<TData>;
477
+ table: MRT_TableInstance<TData>;
478
+ }) => ReactNode;
479
+ editSelectOptions?:
480
+ | ((props: {
481
+ cell: MRT_Cell<TData, TValue>;
482
+ column: MRT_Column<TData>;
483
+ row: MRT_Row<TData>;
484
+ table: MRT_TableInstance<TData>;
485
+ }) => DropdownOption[])
486
+ | DropdownOption[];
487
+ editVariant?: 'select' | 'text';
488
+ enableClickToCopy?:
489
+ | 'context-menu'
490
+ | ((cell: MRT_Cell<TData>) => 'context-menu' | boolean)
491
+ | boolean;
492
+ enableColumnActions?: boolean;
493
+ enableColumnDragging?: boolean;
494
+ enableColumnFilterModes?: boolean;
495
+ enableColumnOrdering?: boolean;
496
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
497
+ enableFilterMatchHighlighting?: boolean;
498
+ Filter?: (props: {
499
+ column: MRT_Column<TData, TValue>;
500
+ header: MRT_Header<TData>;
501
+ rangeFilterIndex?: number;
502
+ table: MRT_TableInstance<TData>;
503
+ }) => ReactNode;
504
+ filterFn?: MRT_FilterFn<TData>;
505
+ filterSelectOptions?: DropdownOption[];
506
+ filterVariant?:
507
+ | 'autocomplete'
508
+ | 'checkbox'
509
+ | 'date'
510
+ | 'date-range'
511
+ | 'datetime'
512
+ | 'datetime-range'
513
+ | 'multi-select'
514
+ | 'range'
515
+ | 'range-slider'
516
+ | 'select'
517
+ | 'text'
518
+ | 'time'
519
+ | 'time-range';
520
+ /**
521
+ * footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
522
+ */
523
+ footer?: string;
524
+ Footer?:
525
+ | ((props: {
526
+ column: MRT_Column<TData, TValue>;
527
+ footer: MRT_Header<TData>;
528
+ table: MRT_TableInstance<TData>;
529
+ }) => ReactNode)
530
+ | ReactNode;
531
+ GroupedCell?: (props: {
532
+ cell: MRT_Cell<TData, TValue>;
533
+ column: MRT_Column<TData, TValue>;
534
+ row: MRT_Row<TData>;
535
+ table: MRT_TableInstance<TData>;
536
+ staticColumnIndex?: number;
537
+ staticRowIndex?: number;
538
+ }) => ReactNode;
539
+ /**
540
+ * If `layoutMode` is `'grid'` or `'grid-no-grow'`, you can specify the flex grow value for individual columns to still grow and take up remaining space, or set to `false`/0 to not grow.
541
+ */
542
+ grow?: boolean | number;
543
+ /**
544
+ * header must be a string. If you want custom JSX to render the header, you can also specify a `Header` option. (Capital H)
545
+ */
546
+ header: string;
547
+ Header?:
548
+ | ((props: {
549
+ column: MRT_Column<TData, TValue>;
550
+ header: MRT_Header<TData>;
551
+ table: MRT_TableInstance<TData>;
552
+ }) => ReactNode)
553
+ | ReactNode;
554
+ /**
555
+ * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
556
+ *
557
+ * If you have also specified an `accessorFn`, MRT still needs to have a valid `id` to be able to identify the column uniquely.
558
+ *
559
+ * `id` defaults to the `accessorKey` or `header` if not specified.
560
+ *
561
+ * @default gets set to the same value as `accessorKey` by default
562
+ */
563
+ id?: LiteralUnion<string & keyof TData>;
564
+ muiColumnActionsButtonProps?:
565
+ | ((props: {
566
+ column: MRT_Column<TData>;
567
+ table: MRT_TableInstance<TData>;
568
+ }) => IconButtonProps)
569
+ | IconButtonProps;
570
+ muiColumnDragHandleProps?:
571
+ | ((props: {
572
+ column: MRT_Column<TData>;
573
+ table: MRT_TableInstance<TData>;
574
+ }) => IconButtonProps)
575
+ | IconButtonProps;
576
+ muiCopyButtonProps?:
577
+ | ((props: {
578
+ cell: MRT_Cell<TData, TValue>;
579
+ column: MRT_Column<TData>;
580
+ row: MRT_Row<TData>;
581
+ table: MRT_TableInstance<TData>;
582
+ }) => ButtonProps)
583
+ | ButtonProps;
584
+ muiEditTextFieldProps?:
585
+ | ((props: {
586
+ cell: MRT_Cell<TData, TValue>;
587
+ column: MRT_Column<TData>;
588
+ row: MRT_Row<TData>;
589
+ table: MRT_TableInstance<TData>;
590
+ }) => TextFieldProps)
591
+ | TextFieldProps;
592
+ muiFilterAutocompleteProps?:
593
+ | ((props: {
594
+ column: MRT_Column<TData>;
595
+ table: MRT_TableInstance<TData>;
596
+ }) => AutocompleteProps<any, any, any, any>)
597
+ | AutocompleteProps<any, any, any, any>;
598
+ muiFilterCheckboxProps?:
599
+ | ((props: {
600
+ column: MRT_Column<TData>;
601
+ table: MRT_TableInstance<TData>;
602
+ }) => CheckboxProps)
603
+ | CheckboxProps;
604
+ muiFilterDatePickerProps?:
605
+ | ((props: {
606
+ column: MRT_Column<TData>;
607
+ rangeFilterIndex?: number;
608
+ table: MRT_TableInstance<TData>;
609
+ }) => DatePickerProps)
610
+ | DatePickerProps;
611
+ muiFilterDateTimePickerProps?:
612
+ | ((props: {
613
+ column: MRT_Column<TData>;
614
+ rangeFilterIndex?: number;
615
+ table: MRT_TableInstance<TData>;
616
+ }) => DateTimePickerProps)
617
+ | DateTimePickerProps;
618
+ muiFilterSliderProps?:
619
+ | ((props: {
620
+ column: MRT_Column<TData>;
621
+ table: MRT_TableInstance<TData>;
622
+ }) => SliderProps)
623
+ | SliderProps;
624
+ muiFilterTextFieldProps?:
625
+ | ((props: {
626
+ column: MRT_Column<TData>;
627
+ rangeFilterIndex?: number;
628
+ table: MRT_TableInstance<TData>;
629
+ }) => TextFieldProps)
630
+ | TextFieldProps;
631
+ muiFilterTimePickerProps?:
632
+ | ((props: {
633
+ column: MRT_Column<TData>;
634
+ rangeFilterIndex?: number;
635
+ table: MRT_TableInstance<TData>;
636
+ }) => TimePickerProps)
637
+ | TimePickerProps;
638
+ muiTableBodyCellProps?:
639
+ | ((props: {
640
+ cell: MRT_Cell<TData, TValue>;
641
+ column: MRT_Column<TData>;
642
+ row: MRT_Row<TData>;
643
+ table: MRT_TableInstance<TData>;
644
+ }) => TableCellProps)
645
+ | TableCellProps;
646
+ muiTableFooterCellProps?:
647
+ | ((props: {
648
+ column: MRT_Column<TData>;
649
+ table: MRT_TableInstance<TData>;
650
+ }) => TableCellProps)
651
+ | TableCellProps;
652
+ muiTableHeadCellProps?:
653
+ | ((props: {
654
+ column: MRT_Column<TData>;
655
+ table: MRT_TableInstance<TData>;
656
+ }) => TableCellProps)
657
+ | TableCellProps;
658
+ PlaceholderCell?: (props: {
659
+ cell: MRT_Cell<TData, TValue>;
660
+ column: MRT_Column<TData, TValue>;
661
+ row: MRT_Row<TData>;
662
+ table: MRT_TableInstance<TData>;
663
+ }) => ReactNode;
664
+ renderCellActionMenuItems?: (props: {
665
+ cell: MRT_Cell<TData>;
666
+ closeMenu: () => void;
667
+ column: MRT_Column<TData>;
668
+ internalMenuItems: ReactNode[];
669
+ row: MRT_Row<TData>;
670
+ staticColumnIndex?: number;
671
+ staticRowIndex?: number;
672
+ table: MRT_TableInstance<TData>;
673
+ }) => ReactNode[];
674
+ renderColumnActionsMenuItems?: (props: {
675
+ closeMenu: () => void;
676
+ column: MRT_Column<TData>;
677
+ internalColumnMenuItems: ReactNode[];
678
+ table: MRT_TableInstance<TData>;
679
+ }) => ReactNode[];
680
+ renderColumnFilterModeMenuItems?: (props: {
681
+ column: MRT_Column<TData>;
682
+ internalFilterOptions: MRT_InternalFilterOption[];
683
+ onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
684
+ table: MRT_TableInstance<TData>;
685
+ }) => ReactNode[];
686
+ sortingFn?: MRT_SortingFn<TData>;
687
+ visibleInShowHideMenu?: boolean;
688
+ }
689
+
690
+ export type MRT_DisplayColumnDef<
691
+ TData extends MRT_RowData,
692
+ TValue = unknown,
693
+ > = Omit<MRT_ColumnDef<TData, TValue>, 'accessorFn' | 'accessorKey'>;
694
+
695
+ export type MRT_GroupColumnDef<TData extends MRT_RowData> =
696
+ MRT_DisplayColumnDef<TData, any> & {
697
+ columns: MRT_ColumnDef<TData>[];
698
+ };
699
+
700
+ export type MRT_DefinedColumnDef<
701
+ TData extends MRT_RowData,
702
+ TValue = unknown,
703
+ > = Omit<MRT_ColumnDef<TData, TValue>, 'defaultDisplayColumn' | 'id'> & {
704
+ _filterFn: MRT_FilterOption;
705
+ defaultDisplayColumn: Partial<MRT_ColumnDef<TData, TValue>>;
706
+ id: string;
707
+ };
708
+
709
+ export type MRT_Column<TData extends MRT_RowData, TValue = unknown> = Omit<
710
+ Column<TData, TValue>,
711
+ 'columnDef' | 'columns' | 'filterFn' | 'footer' | 'header'
712
+ > & {
713
+ columnDef: MRT_DefinedColumnDef<TData, TValue>;
714
+ columns?: MRT_Column<TData, TValue>[];
715
+ filterFn?: MRT_FilterFn<TData>;
716
+ footer: string;
717
+ header: string;
718
+ };
719
+
720
+ export type MRT_Header<TData extends MRT_RowData> = Omit<
721
+ Header<TData, unknown>,
722
+ 'column'
723
+ > & {
724
+ column: MRT_Column<TData>;
725
+ };
726
+
727
+ export type MRT_HeaderGroup<TData extends MRT_RowData> = Omit<
728
+ HeaderGroup<TData>,
729
+ 'headers'
730
+ > & {
731
+ headers: MRT_Header<TData>[];
732
+ };
733
+
734
+ export type MRT_Row<TData extends MRT_RowData> = Omit<
735
+ Row<TData>,
736
+ | '_valuesCache'
737
+ | 'getAllCells'
738
+ | 'getParentRow'
739
+ | 'getParentRows'
740
+ | 'getRow'
741
+ | 'getVisibleCells'
742
+ | 'subRows'
743
+ > & {
744
+ _valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
745
+ getAllCells: () => MRT_Cell<TData>[];
746
+ getParentRow: () => MRT_Row<TData> | null;
747
+ getParentRows: () => MRT_Row<TData>[];
748
+ getRow: () => MRT_Row<TData>;
749
+ getVisibleCells: () => MRT_Cell<TData>[];
750
+ subRows?: MRT_Row<TData>[];
751
+ };
752
+
753
+ export type MRT_Cell<TData extends MRT_RowData, TValue = unknown> = Omit<
754
+ Cell<TData, TValue>,
755
+ 'column' | 'row'
756
+ > & {
757
+ column: MRT_Column<TData, TValue>;
758
+ row: MRT_Row<TData>;
759
+ };
760
+
761
+ export type MRT_AggregationOption = string & keyof typeof MRT_AggregationFns;
762
+
763
+ export type MRT_AggregationFn<TData extends MRT_RowData> =
764
+ | AggregationFn<TData>
765
+ | MRT_AggregationOption;
766
+
767
+ export type MRT_SortingOption = LiteralUnion<
768
+ string & keyof typeof MRT_SortingFns
769
+ >;
770
+
771
+ export type MRT_SortingFn<TData extends MRT_RowData> =
772
+ | MRT_SortingOption
773
+ | SortingFn<TData>;
774
+
775
+ export type MRT_FilterOption = LiteralUnion<
776
+ string & keyof typeof MRT_FilterFns
777
+ >;
778
+
779
+ export type MRT_FilterFn<TData extends MRT_RowData> =
780
+ | FilterFn<TData>
781
+ | MRT_FilterOption;
782
+
783
+ export type MRT_InternalFilterOption = {
784
+ divider: boolean;
785
+ label: string;
786
+ option: string;
787
+ symbol: string;
788
+ };
789
+
790
+ export type MRT_DisplayColumnIds =
791
+ | 'mrt-row-actions'
792
+ | 'mrt-row-drag'
793
+ | 'mrt-row-expand'
794
+ | 'mrt-row-numbers'
795
+ | 'mrt-row-pin'
796
+ | 'mrt-row-select'
797
+ | 'mrt-row-spacer';
798
+
799
+ /**
800
+ * `columns` and `data` props are the only required props, but there are over 170 other optional props.
801
+ *
802
+ * See more info on creating columns and data on the official docs site:
803
+ * @link https://www.material-react-table.com/docs/getting-started/usage
804
+ *
805
+ * See the full props list on the official docs site:
806
+ * @link https://www.material-react-table.com/docs/api/props
807
+ */
808
+ export interface MRT_TableOptions<TData extends MRT_RowData>
809
+ extends Omit<
810
+ Partial<TableOptions<TData>>,
811
+ | 'columns'
812
+ | 'data'
813
+ | 'defaultColumn'
814
+ | 'enableRowSelection'
815
+ | 'expandRowsFn'
816
+ | 'getRowId'
817
+ | 'globalFilterFn'
818
+ | 'initialState'
819
+ | 'onStateChange'
820
+ | 'state'
821
+ > {
822
+ columnFilterDisplayMode?: 'custom' | 'popover' | 'subheader';
823
+ columnFilterModeOptions?: Array<
824
+ LiteralUnion<string & MRT_FilterOption>
825
+ > | null;
826
+ /**
827
+ * The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` table option.
828
+ *
829
+ * See more info on creating columns on the official docs site:
830
+ * @link https://www.material-react-table.com/docs/guides/data-columns
831
+ * @link https://www.material-react-table.com/docs/guides/display-columns
832
+ *
833
+ * See all Columns Options on the official docs site:
834
+ * @link https://www.material-react-table.com/docs/api/column-options
835
+ */
836
+ columns: MRT_ColumnDef<TData, any>[];
837
+ columnVirtualizerInstanceRef?: RefObject<MRT_ColumnVirtualizer | null>;
838
+ columnVirtualizerOptions?:
839
+ | ((props: {
840
+ table: MRT_TableInstance<TData>;
841
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>)
842
+ | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>;
843
+ createDisplayMode?: 'custom' | 'modal' | 'row';
844
+ /**
845
+ * Pass your data as an array of objects. Objects can theoretically be any shape, but it's best to keep them consistent.
846
+ *
847
+ * See the usage guide for more info on creating columns and data:
848
+ * @link https://www.material-react-table.com/docs/getting-started/usage
849
+ */
850
+ data: TData[];
851
+ /**
852
+ * Instead of specifying a bunch of the same options for each column, you can just change an option in the `defaultColumn` table option to change a default option for all columns.
853
+ */
854
+ defaultColumn?: Partial<MRT_ColumnDef<TData>>;
855
+ /**
856
+ * Change the default options for display columns.
857
+ */
858
+ defaultDisplayColumn?: Partial<MRT_DisplayColumnDef<TData>>;
859
+ displayColumnDefOptions?: Partial<{
860
+ [key in MRT_DisplayColumnIds]: Partial<MRT_DisplayColumnDef<TData>>;
861
+ }>;
862
+ editDisplayMode?: 'cell' | 'custom' | 'modal' | 'row' | 'table';
863
+ enableBatchRowSelection?: boolean;
864
+ enableBottomToolbar?: boolean;
865
+ enableCellActions?: ((cell: MRT_Cell<TData>) => boolean) | boolean;
866
+ enableClickToCopy?:
867
+ | 'context-menu'
868
+ | ((cell: MRT_Cell<TData>) => 'context-menu' | boolean)
869
+ | boolean;
870
+ enableColumnActions?: boolean;
871
+ enableColumnDragging?: boolean;
872
+ enableColumnFilterModes?: boolean;
873
+ enableColumnOrdering?: boolean;
874
+ enableColumnVirtualization?: boolean;
875
+ enableDensityToggle?: boolean;
876
+ enableEditing?: ((row: MRT_Row<TData>) => boolean) | boolean;
877
+ enableExpandAll?: boolean;
878
+ enableFacetedValues?: boolean;
879
+ enableFilterMatchHighlighting?: boolean;
880
+ enableFullScreenToggle?: boolean;
881
+ enableGlobalFilterModes?: boolean;
882
+ enableGlobalFilterRankedResults?: boolean;
883
+ enableKeyboardShortcuts?: boolean;
884
+ enablePagination?: boolean;
885
+ enableRowActions?: boolean;
886
+ enableRowDragging?: boolean;
887
+ enableRowNumbers?: boolean;
888
+ enableRowOrdering?: boolean;
889
+ enableRowSelection?: ((row: MRT_Row<TData>) => boolean) | boolean;
890
+ enableRowVirtualization?: boolean;
891
+ enableSelectAll?: boolean;
892
+ enableStickyFooter?: boolean;
893
+ enableStickyHeader?: boolean;
894
+ enableTableFooter?: boolean;
895
+ enableTableHead?: boolean;
896
+ enableToolbarInternalActions?: boolean;
897
+ enableTopToolbar?: boolean;
898
+ expandRowsFn?: (dataRow: TData) => TData[];
899
+ getRowId?: (
900
+ originalRow: TData,
901
+ index: number,
902
+ parentRow: MRT_Row<TData>,
903
+ ) => string;
904
+ globalFilterFn?: MRT_FilterOption;
905
+ globalFilterModeOptions?: MRT_FilterOption[] | null;
906
+ icons?: Partial<MRT_Icons>;
907
+ id?: string;
908
+ initialState?: Partial<MRT_TableState<TData>>;
909
+ /**
910
+ * 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
911
+ */
912
+ layoutMode?: 'grid' | 'grid-no-grow' | 'semantic';
913
+ /**
914
+ * Pass in either a locale imported from `material-react-table/locales/*` or a custom locale object.
915
+ *
916
+ * See the localization (i18n) guide for more info:
917
+ * @link https://www.material-react-table.com/docs/guides/localization
918
+ */
919
+ localization?: Partial<MRT_Localization>;
920
+ /**
921
+ * Memoize cells, rows, or the entire table body to potentially improve render performance.
922
+ *
923
+ * @warning This will break some dynamic rendering features. See the memoization guide for more info:
924
+ * @link https://www.material-react-table.com/docs/guides/memoize-components
925
+ */
926
+ memoMode?: 'cells' | 'rows' | 'table-body';
927
+ mrtTheme?: ((theme: Theme) => Partial<MRT_Theme>) | Partial<MRT_Theme>;
928
+ muiBottomToolbarProps?:
929
+ | ((props: { table: MRT_TableInstance<TData> }) => BoxProps)
930
+ | BoxProps;
931
+ muiCircularProgressProps?:
932
+ | ((props: {
933
+ table: MRT_TableInstance<TData>;
934
+ }) => CircularProgressProps & { Component?: ReactNode })
935
+ | (CircularProgressProps & { Component?: ReactNode });
936
+ muiColumnActionsButtonProps?:
937
+ | ((props: {
938
+ column: MRT_Column<TData>;
939
+ table: MRT_TableInstance<TData>;
940
+ }) => IconButtonProps)
941
+ | IconButtonProps;
942
+ muiColumnDragHandleProps?:
943
+ | ((props: {
944
+ column: MRT_Column<TData>;
945
+ table: MRT_TableInstance<TData>;
946
+ }) => IconButtonProps)
947
+ | IconButtonProps;
948
+ muiCopyButtonProps?:
949
+ | ((props: {
950
+ cell: MRT_Cell<TData>;
951
+ column: MRT_Column<TData>;
952
+ row: MRT_Row<TData>;
953
+ table: MRT_TableInstance<TData>;
954
+ }) => ButtonProps)
955
+ | ButtonProps;
956
+ muiCreateRowModalProps?:
957
+ | ((props: {
958
+ row: MRT_Row<TData>;
959
+ table: MRT_TableInstance<TData>;
960
+ }) => DialogProps)
961
+ | DialogProps;
962
+ muiDetailPanelProps?:
963
+ | ((props: {
964
+ row: MRT_Row<TData>;
965
+ table: MRT_TableInstance<TData>;
966
+ }) => TableCellProps)
967
+ | TableCellProps;
968
+ muiEditRowDialogProps?:
969
+ | ((props: {
970
+ row: MRT_Row<TData>;
971
+ table: MRT_TableInstance<TData>;
972
+ }) => DialogProps)
973
+ | DialogProps;
974
+ muiEditTextFieldProps?:
975
+ | ((props: {
976
+ cell: MRT_Cell<TData>;
977
+ column: MRT_Column<TData>;
978
+ row: MRT_Row<TData>;
979
+ table: MRT_TableInstance<TData>;
980
+ }) => TextFieldProps)
981
+ | TextFieldProps;
982
+ muiExpandAllButtonProps?:
983
+ | ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps)
984
+ | IconButtonProps;
985
+ muiExpandButtonProps?:
986
+ | ((props: {
987
+ row: MRT_Row<TData>;
988
+ staticRowIndex?: number;
989
+ table: MRT_TableInstance<TData>;
990
+ }) => IconButtonProps)
991
+ | IconButtonProps;
992
+ muiFilterAutocompleteProps?:
993
+ | ((props: {
994
+ column: MRT_Column<TData>;
995
+ table: MRT_TableInstance<TData>;
996
+ }) => AutocompleteProps<any, any, any, any>)
997
+ | AutocompleteProps<any, any, any, any>;
998
+ muiFilterCheckboxProps?:
999
+ | ((props: {
1000
+ column: MRT_Column<TData>;
1001
+ table: MRT_TableInstance<TData>;
1002
+ }) => CheckboxProps)
1003
+ | CheckboxProps;
1004
+ muiFilterDatePickerProps?:
1005
+ | ((props: {
1006
+ column: MRT_Column<TData>;
1007
+ rangeFilterIndex?: number;
1008
+ table: MRT_TableInstance<TData>;
1009
+ }) => DatePickerProps)
1010
+ | DatePickerProps;
1011
+ muiFilterDateTimePickerProps?:
1012
+ | ((props: {
1013
+ column: MRT_Column<TData>;
1014
+ rangeFilterIndex?: number;
1015
+ table: MRT_TableInstance<TData>;
1016
+ }) => DateTimePickerProps)
1017
+ | DateTimePickerProps;
1018
+ muiFilterSliderProps?:
1019
+ | ((props: {
1020
+ column: MRT_Column<TData>;
1021
+ table: MRT_TableInstance<TData>;
1022
+ }) => SliderProps)
1023
+ | SliderProps;
1024
+ muiFilterTextFieldProps?:
1025
+ | ((props: {
1026
+ column: MRT_Column<TData>;
1027
+ rangeFilterIndex?: number;
1028
+ table: MRT_TableInstance<TData>;
1029
+ }) => TextFieldProps)
1030
+ | TextFieldProps;
1031
+ muiFilterTimePickerProps?:
1032
+ | ((props: {
1033
+ column: MRT_Column<TData>;
1034
+ rangeFilterIndex?: number;
1035
+ table: MRT_TableInstance<TData>;
1036
+ }) => TimePickerProps)
1037
+ | TimePickerProps;
1038
+ muiLinearProgressProps?:
1039
+ | ((props: {
1040
+ isTopToolbar: boolean;
1041
+ table: MRT_TableInstance<TData>;
1042
+ }) => LinearProgressProps)
1043
+ | LinearProgressProps;
1044
+ muiPaginationProps?:
1045
+ | ((props: { table: MRT_TableInstance<TData> }) => Partial<
1046
+ PaginationProps & {
1047
+ SelectProps?: Partial<SelectProps>;
1048
+ disabled?: boolean;
1049
+ rowsPerPageOptions?: { label: string; value: number }[] | number[];
1050
+ showRowsPerPage?: boolean;
1051
+ }
1052
+ >)
1053
+ | Partial<
1054
+ PaginationProps & {
1055
+ SelectProps?: Partial<SelectProps>;
1056
+ disabled?: boolean;
1057
+ rowsPerPageOptions?: { label: string; value: number }[] | number[];
1058
+ showRowsPerPage?: boolean;
1059
+ }
1060
+ >;
1061
+ muiRowDragHandleProps?:
1062
+ | ((props: {
1063
+ row: MRT_Row<TData>;
1064
+ table: MRT_TableInstance<TData>;
1065
+ }) => IconButtonProps)
1066
+ | IconButtonProps;
1067
+ muiSearchTextFieldProps?:
1068
+ | ((props: { table: MRT_TableInstance<TData> }) => TextFieldProps)
1069
+ | TextFieldProps;
1070
+ muiSelectAllCheckboxProps?:
1071
+ | ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps)
1072
+ | CheckboxProps;
1073
+ muiSelectCheckboxProps?:
1074
+ | ((props: {
1075
+ row: MRT_Row<TData>;
1076
+ staticRowIndex?: number;
1077
+ table: MRT_TableInstance<TData>;
1078
+ }) => CheckboxProps | RadioProps)
1079
+ | (CheckboxProps | RadioProps);
1080
+ muiSkeletonProps?:
1081
+ | ((props: {
1082
+ cell: MRT_Cell<TData>;
1083
+ column: MRT_Column<TData>;
1084
+ row: MRT_Row<TData>;
1085
+ table: MRT_TableInstance<TData>;
1086
+ }) => SkeletonProps)
1087
+ | SkeletonProps;
1088
+ muiTableBodyCellProps?:
1089
+ | ((props: {
1090
+ cell: MRT_Cell<TData>;
1091
+ column: MRT_Column<TData>;
1092
+ row: MRT_Row<TData>;
1093
+ table: MRT_TableInstance<TData>;
1094
+ }) => TableCellProps)
1095
+ | TableCellProps;
1096
+ muiTableBodyProps?:
1097
+ | ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps)
1098
+ | TableBodyProps;
1099
+ muiTableBodyRowProps?:
1100
+ | ((props: {
1101
+ isDetailPanel?: boolean;
1102
+ row: MRT_Row<TData>;
1103
+ staticRowIndex: number;
1104
+ table: MRT_TableInstance<TData>;
1105
+ }) => TableRowProps)
1106
+ | TableRowProps;
1107
+ muiTableContainerProps?:
1108
+ | ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps)
1109
+ | TableContainerProps;
1110
+ muiTableFooterCellProps?:
1111
+ | ((props: {
1112
+ column: MRT_Column<TData>;
1113
+ table: MRT_TableInstance<TData>;
1114
+ }) => TableCellProps)
1115
+ | TableCellProps;
1116
+ muiTableFooterProps?:
1117
+ | ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps)
1118
+ | TableFooterProps;
1119
+ muiTableFooterRowProps?:
1120
+ | ((props: {
1121
+ footerGroup: MRT_HeaderGroup<TData>;
1122
+ table: MRT_TableInstance<TData>;
1123
+ }) => TableRowProps)
1124
+ | TableRowProps;
1125
+ muiTableHeadCellProps?:
1126
+ | ((props: {
1127
+ column: MRT_Column<TData>;
1128
+ table: MRT_TableInstance<TData>;
1129
+ }) => TableCellProps)
1130
+ | TableCellProps;
1131
+ muiTableHeadProps?:
1132
+ | ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps)
1133
+ | TableHeadProps;
1134
+ muiTableHeadRowProps?:
1135
+ | ((props: {
1136
+ headerGroup: MRT_HeaderGroup<TData>;
1137
+ table: MRT_TableInstance<TData>;
1138
+ }) => TableRowProps)
1139
+ | TableRowProps;
1140
+ muiTablePaperProps?:
1141
+ | ((props: { table: MRT_TableInstance<TData> }) => PaperProps)
1142
+ | PaperProps;
1143
+ muiTableProps?:
1144
+ | ((props: { table: MRT_TableInstance<TData> }) => TableProps)
1145
+ | TableProps;
1146
+ muiToolbarAlertBannerChipProps?:
1147
+ | ((props: { table: MRT_TableInstance<TData> }) => ChipProps)
1148
+ | ChipProps;
1149
+ muiToolbarAlertBannerProps?:
1150
+ | ((props: { table: MRT_TableInstance<TData> }) => AlertProps)
1151
+ | AlertProps;
1152
+ muiTopToolbarProps?:
1153
+ | ((props: { table: MRT_TableInstance<TData> }) => BoxProps)
1154
+ | BoxProps;
1155
+ onActionCellChange?: OnChangeFn<MRT_Cell<TData> | null>;
1156
+ onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
1157
+ onCreatingRowCancel?: (props: {
1158
+ row: MRT_Row<TData>;
1159
+ table: MRT_TableInstance<TData>;
1160
+ }) => void;
1161
+ onCreatingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
1162
+ onCreatingRowSave?: (props: {
1163
+ exitCreatingMode: () => void;
1164
+ row: MRT_Row<TData>;
1165
+ table: MRT_TableInstance<TData>;
1166
+ values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
1167
+ }) => Promise<void> | void;
1168
+ onDensityChange?: OnChangeFn<MRT_DensityState>;
1169
+ onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
1170
+ onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
1171
+ onEditingCellChange?: OnChangeFn<MRT_Cell<TData> | null>;
1172
+ onEditingRowCancel?: (props: {
1173
+ row: MRT_Row<TData>;
1174
+ table: MRT_TableInstance<TData>;
1175
+ }) => void;
1176
+ onEditingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
1177
+ onEditingRowSave?: (props: {
1178
+ exitEditingMode: () => void;
1179
+ row: MRT_Row<TData>;
1180
+ table: MRT_TableInstance<TData>;
1181
+ values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
1182
+ }) => Promise<void> | void;
1183
+ onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
1184
+ onHoveredColumnChange?: OnChangeFn<Partial<MRT_Column<TData>> | null>;
1185
+ onHoveredRowChange?: OnChangeFn<Partial<MRT_Row<TData>> | null>;
1186
+ onIsFullScreenChange?: OnChangeFn<boolean>;
1187
+ onShowAlertBannerChange?: OnChangeFn<boolean>;
1188
+ onShowColumnFiltersChange?: OnChangeFn<boolean>;
1189
+ onShowGlobalFilterChange?: OnChangeFn<boolean>;
1190
+ onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
1191
+ paginationDisplayMode?: 'custom' | 'default' | 'pages';
1192
+ positionActionsColumn?: 'first' | 'last';
1193
+ positionCreatingRow?: 'bottom' | 'top' | number;
1194
+ positionExpandColumn?: 'first' | 'last';
1195
+ positionGlobalFilter?: 'left' | 'none' | 'right';
1196
+ positionPagination?: 'both' | 'bottom' | 'none' | 'top';
1197
+ positionToolbarAlertBanner?: 'bottom' | 'head-overlay' | 'none' | 'top';
1198
+ positionToolbarDropZone?: 'both' | 'bottom' | 'none' | 'top';
1199
+ renderBottomToolbar?:
1200
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
1201
+ | ReactNode;
1202
+ renderBottomToolbarCustomActions?: (props: {
1203
+ table: MRT_TableInstance<TData>;
1204
+ }) => ReactNode;
1205
+ renderCaption?:
1206
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
1207
+ | ReactNode;
1208
+ renderCellActionMenuItems?: (props: {
1209
+ cell: MRT_Cell<TData>;
1210
+ closeMenu: () => void;
1211
+ column: MRT_Column<TData>;
1212
+ internalMenuItems: ReactNode[];
1213
+ row: MRT_Row<TData>;
1214
+ staticColumnIndex?: number;
1215
+ staticRowIndex?: number;
1216
+ table: MRT_TableInstance<TData>;
1217
+ }) => ReactNode[];
1218
+ renderColumnActionsMenuItems?: (props: {
1219
+ closeMenu: () => void;
1220
+ column: MRT_Column<TData>;
1221
+ internalColumnMenuItems: ReactNode[];
1222
+ table: MRT_TableInstance<TData>;
1223
+ }) => ReactNode[];
1224
+ renderColumnFilterModeMenuItems?: (props: {
1225
+ column: MRT_Column<TData>;
1226
+ internalFilterOptions: MRT_InternalFilterOption[];
1227
+ onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
1228
+ table: MRT_TableInstance<TData>;
1229
+ }) => ReactNode[];
1230
+ renderCreateRowDialogContent?: (props: {
1231
+ internalEditComponents: ReactNode[];
1232
+ row: MRT_Row<TData>;
1233
+ table: MRT_TableInstance<TData>;
1234
+ }) => ReactNode;
1235
+ renderDetailPanel?: (props: {
1236
+ row: MRT_Row<TData>;
1237
+ table: MRT_TableInstance<TData>;
1238
+ }) => ReactNode;
1239
+ renderEditRowDialogContent?: (props: {
1240
+ internalEditComponents: ReactNode[];
1241
+ row: MRT_Row<TData>;
1242
+ table: MRT_TableInstance<TData>;
1243
+ }) => ReactNode;
1244
+ renderEmptyRowsFallback?: (props: {
1245
+ table: MRT_TableInstance<TData>;
1246
+ }) => ReactNode;
1247
+ renderGlobalFilterModeMenuItems?: (props: {
1248
+ internalFilterOptions: MRT_InternalFilterOption[];
1249
+ onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
1250
+ table: MRT_TableInstance<TData>;
1251
+ }) => ReactNode[];
1252
+ renderRowActionMenuItems?: (props: {
1253
+ closeMenu: () => void;
1254
+ row: MRT_Row<TData>;
1255
+ staticRowIndex?: number;
1256
+ table: MRT_TableInstance<TData>;
1257
+ }) => ReactNode[] | undefined;
1258
+ renderRowActions?: (props: {
1259
+ cell: MRT_Cell<TData>;
1260
+ row: MRT_Row<TData>;
1261
+ staticRowIndex?: number;
1262
+ table: MRT_TableInstance<TData>;
1263
+ }) => ReactNode;
1264
+ renderToolbarAlertBannerContent?: (props: {
1265
+ groupedAlert: ReactNode | null;
1266
+ selectedAlert: ReactNode | null;
1267
+ table: MRT_TableInstance<TData>;
1268
+ }) => ReactNode;
1269
+ renderToolbarInternalActions?: (props: {
1270
+ table: MRT_TableInstance<TData>;
1271
+ }) => ReactNode;
1272
+ renderTopToolbar?:
1273
+ | ((props: { table: MRT_TableInstance<TData> }) => ReactNode)
1274
+ | ReactNode;
1275
+ renderTopToolbarCustomActions?: (props: {
1276
+ table: MRT_TableInstance<TData>;
1277
+ }) => ReactNode;
1278
+ rowNumberDisplayMode?: 'original' | 'static';
1279
+ rowPinningDisplayMode?:
1280
+ | 'bottom'
1281
+ | 'select-bottom'
1282
+ | 'select-sticky'
1283
+ | 'select-top'
1284
+ | 'sticky'
1285
+ | 'top'
1286
+ | 'top-and-bottom';
1287
+ rowVirtualizerInstanceRef?: RefObject<MRT_RowVirtualizer | null>;
1288
+ rowVirtualizerOptions?:
1289
+ | ((props: {
1290
+ table: MRT_TableInstance<TData>;
1291
+ }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>)
1292
+ | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
1293
+ selectAllMode?: 'all' | 'page';
1294
+ /**
1295
+ * Manage state externally any way you want, then pass it back into MRT.
1296
+ */
1297
+ state?: Partial<MRT_TableState<TData>>;
1298
+ }