@kissesses/mantine-react-table-open 9.0.3

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