@mui/x-data-grid 5.7.0 → 5.10.0

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 (524) hide show
  1. package/CHANGELOG.md +241 -53
  2. package/DataGrid/DataGrid.d.ts +8 -3
  3. package/DataGrid/DataGrid.js +28 -5
  4. package/DataGrid/useDataGridComponent.js +5 -5
  5. package/DataGrid/useDataGridProps.d.ts +2 -1
  6. package/LICENSE +21 -0
  7. package/README.md +6 -4
  8. package/colDef/gridBooleanColDef.d.ts +1 -1
  9. package/colDef/gridBooleanOperators.d.ts +1 -1
  10. package/colDef/gridDateColDef.d.ts +5 -9
  11. package/colDef/gridDateColDef.js +2 -2
  12. package/colDef/gridDateOperators.d.ts +1 -1
  13. package/{models/colDef → colDef}/gridDefaultColumnTypes.d.ts +1 -1
  14. package/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
  15. package/colDef/gridNumericColDef.d.ts +1 -1
  16. package/colDef/gridNumericOperators.d.ts +2 -2
  17. package/colDef/gridStringColDef.d.ts +1 -1
  18. package/colDef/gridStringOperators.d.ts +1 -1
  19. package/colDef/index.d.ts +1 -0
  20. package/colDef/index.js +2 -1
  21. package/components/GridRow.d.ts +4 -0
  22. package/components/GridRow.js +55 -24
  23. package/components/base/GridOverlays.js +4 -3
  24. package/components/cell/GridActionsCell.d.ts +5 -1
  25. package/components/cell/GridActionsCell.js +170 -21
  26. package/components/cell/GridActionsCellItem.d.ts +66 -4
  27. package/components/cell/GridActionsCellItem.js +7 -5
  28. package/components/cell/GridCell.d.ts +5 -4
  29. package/components/cell/GridCell.js +30 -9
  30. package/components/cell/GridEditInputCell.js +3 -3
  31. package/components/cell/GridEditSingleSelectCell.js +24 -15
  32. package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +12 -0
  33. package/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
  34. package/components/columnHeaders/GridColumnHeaderItem.js +9 -12
  35. package/components/columnHeaders/GridColumnHeaders.d.ts +0 -1
  36. package/components/columnHeaders/GridColumnHeaders.js +1 -1
  37. package/components/columnHeaders/index.d.ts +1 -0
  38. package/components/columnHeaders/index.js +1 -0
  39. package/components/columnSelection/GridCellCheckboxRenderer.d.ts +3 -3
  40. package/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
  41. package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
  42. package/components/containers/GridRoot.js +29 -17
  43. package/components/containers/GridRootStyles.js +36 -1
  44. package/components/menu/GridMenu.js +1 -0
  45. package/components/menu/columnMenu/GridColumnMenu.js +1 -1
  46. package/components/panel/GridPanel.d.ts +2 -2
  47. package/components/panel/GridPanel.js +1 -0
  48. package/components/panel/GridPreferencesPanel.js +1 -1
  49. package/components/panel/filterPanel/GridFilterForm.js +14 -10
  50. package/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
  51. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -15
  52. package/components/panel/filterPanel/GridFilterInputValue.js +22 -15
  53. package/components/toolbar/GridToolbarDensitySelector.js +1 -1
  54. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  55. package/components/virtualization/GridVirtualScroller.js +2 -0
  56. package/components/virtualization/GridVirtualScrollerContent.js +1 -3
  57. package/constants/defaultGridSlotsComponents.js +4 -2
  58. package/constants/gridClasses.d.ts +35 -3
  59. package/constants/gridClasses.js +1 -1
  60. package/constants/gridDetailPanelToggleField.d.ts +1 -0
  61. package/constants/gridDetailPanelToggleField.js +2 -0
  62. package/constants/localeTextConstants.js +3 -1
  63. package/hooks/core/index.d.ts +1 -1
  64. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +85 -0
  65. package/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
  66. package/hooks/core/pipeProcessing/index.d.ts +4 -0
  67. package/hooks/core/pipeProcessing/index.js +4 -0
  68. package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +32 -0
  69. package/hooks/core/pipeProcessing/useGridPipeProcessing.js +108 -0
  70. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +3 -0
  71. package/{modern/hooks/core/preProcessing/useGridRegisterPreProcessor.js → hooks/core/pipeProcessing/useGridRegisterPipeApplier.js} +2 -6
  72. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +4 -0
  73. package/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeProcessor.js} +2 -6
  74. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +27 -16
  75. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
  76. package/hooks/core/useGridInitialization.js +2 -2
  77. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +0 -1
  78. package/hooks/features/columnHeaders/useGridColumnHeaders.js +77 -11
  79. package/hooks/features/columnMenu/useGridColumnMenu.js +2 -1
  80. package/hooks/features/columns/gridColumnsInterfaces.d.ts +3 -1
  81. package/hooks/features/columns/gridColumnsSelector.d.ts +6 -6
  82. package/hooks/features/columns/gridColumnsUtils.d.ts +22 -4
  83. package/hooks/features/columns/gridColumnsUtils.js +105 -20
  84. package/hooks/features/columns/useGridColumnSpanning.d.ts +7 -0
  85. package/hooks/features/columns/useGridColumnSpanning.js +109 -0
  86. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  87. package/hooks/features/columns/useGridColumns.js +55 -40
  88. package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
  89. package/hooks/features/dimensions/useGridDimensions.js +5 -4
  90. package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
  91. package/hooks/features/editRows/useGridCellEditing.new.js +40 -17
  92. package/hooks/features/editRows/useGridEditing.new.js +7 -3
  93. package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
  94. package/hooks/features/editRows/useGridRowEditing.new.js +44 -21
  95. package/hooks/features/events/useGridEvents.d.ts +1 -1
  96. package/hooks/features/events/useGridEvents.js +2 -0
  97. package/hooks/features/filter/gridFilterSelector.d.ts +3 -9
  98. package/hooks/features/filter/useGridFilter.js +18 -13
  99. package/hooks/features/focus/useGridFocus.js +19 -9
  100. package/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.d.ts +3 -5
  101. package/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +66 -13
  102. package/hooks/features/pagination/gridPaginationSelector.d.ts +1 -3
  103. package/hooks/features/pagination/useGridPage.js +9 -4
  104. package/hooks/features/pagination/useGridPageSize.js +3 -3
  105. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
  106. package/hooks/features/rows/gridRowsSelector.d.ts +2 -1
  107. package/hooks/features/rows/gridRowsSelector.js +1 -0
  108. package/hooks/features/rows/gridRowsState.d.ts +4 -0
  109. package/hooks/features/rows/gridRowsUtils.d.ts +8 -0
  110. package/hooks/features/rows/gridRowsUtils.js +11 -0
  111. package/hooks/features/rows/index.d.ts +1 -0
  112. package/hooks/features/rows/index.js +1 -1
  113. package/hooks/features/rows/useGridRows.d.ts +2 -2
  114. package/hooks/features/rows/useGridRows.js +27 -7
  115. package/hooks/features/rows/useGridRowsMeta.js +7 -14
  116. package/hooks/features/scroll/useGridScroll.d.ts +2 -0
  117. package/hooks/features/scroll/useGridScroll.js +27 -14
  118. package/hooks/features/selection/gridSelectionSelector.d.ts +1 -3
  119. package/hooks/features/selection/useGridSelection.d.ts +4 -2
  120. package/hooks/features/selection/useGridSelection.js +75 -27
  121. package/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
  122. package/hooks/features/sorting/gridSortingSelector.d.ts +1 -3
  123. package/hooks/features/sorting/gridSortingUtils.d.ts +1 -2
  124. package/hooks/features/sorting/useGridSorting.js +13 -13
  125. package/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  126. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +9 -0
  127. package/hooks/features/virtualization/useGridVirtualScroller.js +64 -27
  128. package/hooks/utils/useGridRootProps.d.ts +1 -1
  129. package/hooks/utils/useGridVisibleRows.d.ts +2 -2
  130. package/index.js +1 -1
  131. package/internals/index.d.ts +4 -6
  132. package/internals/index.js +3 -3
  133. package/legacy/DataGrid/DataGrid.js +28 -5
  134. package/legacy/DataGrid/useDataGridComponent.js +5 -5
  135. package/legacy/colDef/gridDateColDef.js +2 -2
  136. package/legacy/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
  137. package/legacy/colDef/index.js +2 -1
  138. package/legacy/components/GridRow.js +53 -24
  139. package/legacy/components/base/GridOverlays.js +4 -3
  140. package/legacy/components/cell/GridActionsCell.js +188 -27
  141. package/legacy/components/cell/GridActionsCellItem.js +7 -5
  142. package/legacy/components/cell/GridCell.js +31 -9
  143. package/legacy/components/cell/GridEditInputCell.js +3 -3
  144. package/legacy/components/cell/GridEditSingleSelectCell.js +35 -26
  145. package/legacy/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
  146. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +9 -12
  147. package/legacy/components/columnHeaders/GridColumnHeaders.js +2 -3
  148. package/legacy/components/columnHeaders/index.js +1 -0
  149. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +23 -5
  150. package/legacy/components/containers/GridRoot.js +34 -17
  151. package/legacy/components/containers/GridRootStyles.js +26 -5
  152. package/legacy/components/menu/GridMenu.js +1 -0
  153. package/legacy/components/menu/columnMenu/GridColumnMenu.js +1 -1
  154. package/legacy/components/panel/GridPanel.js +1 -0
  155. package/legacy/components/panel/GridPreferencesPanel.js +1 -1
  156. package/legacy/components/panel/filterPanel/GridFilterForm.js +14 -10
  157. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
  158. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -17
  159. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +22 -17
  160. package/legacy/components/toolbar/GridToolbarDensitySelector.js +1 -1
  161. package/legacy/components/virtualization/GridVirtualScroller.js +2 -0
  162. package/legacy/components/virtualization/GridVirtualScrollerContent.js +1 -3
  163. package/legacy/constants/defaultGridSlotsComponents.js +4 -2
  164. package/legacy/constants/gridClasses.js +1 -1
  165. package/legacy/constants/gridDetailPanelToggleField.js +2 -0
  166. package/legacy/constants/localeTextConstants.js +3 -1
  167. package/legacy/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
  168. package/legacy/hooks/core/pipeProcessing/index.js +4 -0
  169. package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +119 -0
  170. package/legacy/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeApplier.js} +2 -6
  171. package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +27 -0
  172. package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
  173. package/legacy/hooks/core/useGridInitialization.js +2 -2
  174. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +90 -11
  175. package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +2 -1
  176. package/legacy/hooks/features/columns/gridColumnsUtils.js +120 -32
  177. package/legacy/hooks/features/columns/useGridColumnSpanning.js +107 -0
  178. package/legacy/hooks/features/columns/useGridColumns.js +55 -40
  179. package/legacy/hooks/features/dimensions/useGridDimensions.js +5 -4
  180. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +36 -15
  181. package/legacy/hooks/features/editRows/useGridEditing.new.js +7 -3
  182. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +53 -30
  183. package/legacy/hooks/features/events/useGridEvents.js +2 -0
  184. package/legacy/hooks/features/filter/useGridFilter.js +18 -13
  185. package/legacy/hooks/features/focus/useGridFocus.js +19 -9
  186. package/legacy/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +66 -12
  187. package/legacy/hooks/features/pagination/useGridPage.js +11 -4
  188. package/legacy/hooks/features/pagination/useGridPageSize.js +3 -3
  189. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
  190. package/legacy/hooks/features/rows/gridRowsSelector.js +3 -0
  191. package/legacy/hooks/features/rows/gridRowsUtils.js +13 -0
  192. package/legacy/hooks/features/rows/index.js +1 -1
  193. package/legacy/hooks/features/rows/useGridRows.js +35 -9
  194. package/legacy/hooks/features/rows/useGridRowsMeta.js +7 -14
  195. package/legacy/hooks/features/scroll/useGridScroll.js +27 -14
  196. package/legacy/hooks/features/selection/useGridSelection.js +77 -27
  197. package/legacy/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
  198. package/legacy/hooks/features/sorting/useGridSorting.js +8 -10
  199. package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  200. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +75 -37
  201. package/legacy/index.js +1 -1
  202. package/legacy/internals/index.js +3 -3
  203. package/legacy/locales/arSD.js +3 -1
  204. package/legacy/locales/bgBG.js +3 -1
  205. package/legacy/locales/csCZ.js +2 -0
  206. package/legacy/locales/daDK.js +37 -31
  207. package/legacy/locales/deDE.js +3 -1
  208. package/legacy/locales/elGR.js +2 -0
  209. package/legacy/locales/esES.js +2 -0
  210. package/legacy/locales/faIR.js +3 -1
  211. package/legacy/locales/fiFI.js +2 -0
  212. package/legacy/locales/frFR.js +2 -0
  213. package/legacy/locales/heIL.js +3 -1
  214. package/legacy/locales/huHU.js +122 -0
  215. package/legacy/locales/index.js +1 -0
  216. package/legacy/locales/itIT.js +2 -0
  217. package/legacy/locales/jaJP.js +2 -0
  218. package/legacy/locales/koKR.js +2 -0
  219. package/legacy/locales/nlNL.js +2 -0
  220. package/legacy/locales/plPL.js +3 -1
  221. package/legacy/locales/ptBR.js +3 -1
  222. package/legacy/locales/ruRU.js +2 -0
  223. package/legacy/locales/skSK.js +2 -0
  224. package/legacy/locales/trTR.js +3 -1
  225. package/legacy/locales/ukUA.js +2 -0
  226. package/legacy/locales/viVN.js +2 -0
  227. package/legacy/locales/zhCN.js +2 -0
  228. package/{modern/hooks/core/preProcessing/gridPreProcessingApi.js → legacy/models/api/gridColumnSpanning.js} +0 -0
  229. package/legacy/models/colDef/index.js +1 -2
  230. package/legacy/models/events/gridEvents.js +10 -3
  231. package/legacy/models/gridColumnSpanning.js +1 -0
  232. package/legacy/models/gridRows.js +1 -33
  233. package/legacy/models/index.js +2 -2
  234. package/legacy/models/params/gridPreferencePanelParams.js +1 -0
  235. package/legacy/models/params/index.js +2 -1
  236. package/locales/arSD.js +3 -1
  237. package/locales/bgBG.js +3 -1
  238. package/locales/csCZ.js +2 -0
  239. package/locales/daDK.js +33 -31
  240. package/locales/deDE.js +3 -1
  241. package/locales/elGR.js +2 -0
  242. package/locales/esES.js +2 -0
  243. package/locales/faIR.js +3 -1
  244. package/locales/fiFI.js +2 -0
  245. package/locales/frFR.js +2 -0
  246. package/locales/heIL.js +3 -1
  247. package/locales/huHU.d.ts +2 -0
  248. package/locales/huHU.js +110 -0
  249. package/locales/index.d.ts +1 -0
  250. package/locales/index.js +1 -0
  251. package/locales/itIT.js +2 -0
  252. package/locales/jaJP.js +2 -0
  253. package/locales/koKR.js +2 -0
  254. package/locales/nlNL.js +2 -0
  255. package/locales/plPL.js +3 -1
  256. package/locales/ptBR.js +3 -1
  257. package/locales/ruRU.js +2 -0
  258. package/locales/skSK.js +2 -0
  259. package/locales/trTR.js +3 -1
  260. package/locales/ukUA.js +2 -0
  261. package/locales/viVN.js +2 -0
  262. package/locales/zhCN.js +2 -0
  263. package/models/api/gridApiCommon.d.ts +3 -2
  264. package/models/api/gridColumnSpanning.d.ts +28 -0
  265. package/models/api/gridColumnSpanning.js +1 -0
  266. package/models/api/gridEditingApi.d.ts +51 -5
  267. package/models/api/gridLocaleTextApi.d.ts +1 -0
  268. package/models/api/gridParamsApi.d.ts +5 -5
  269. package/models/api/gridRowApi.d.ts +8 -2
  270. package/models/colDef/gridColDef.d.ts +38 -28
  271. package/models/colDef/index.d.ts +0 -1
  272. package/models/colDef/index.js +1 -2
  273. package/models/events/gridEventLookup.d.ts +30 -9
  274. package/models/events/gridEvents.d.ts +50 -17
  275. package/models/events/gridEvents.js +10 -3
  276. package/models/gridCell.d.ts +1 -0
  277. package/models/gridColumnSpanning.d.ts +12 -0
  278. package/models/gridColumnSpanning.js +1 -0
  279. package/models/gridEditRowModel.d.ts +1 -1
  280. package/models/gridFilterOperator.d.ts +3 -2
  281. package/models/gridIconSlotsComponent.d.ts +5 -0
  282. package/models/gridRows.d.ts +10 -18
  283. package/models/gridRows.js +1 -31
  284. package/models/gridSlotsComponent.d.ts +5 -0
  285. package/models/gridSlotsComponentsProps.d.ts +1 -0
  286. package/models/gridSortModel.d.ts +3 -4
  287. package/models/index.d.ts +1 -1
  288. package/models/index.js +2 -2
  289. package/models/params/gridCellParams.d.ts +25 -15
  290. package/models/params/gridColumnHeaderParams.d.ts +3 -2
  291. package/models/params/gridEditCellParams.d.ts +2 -3
  292. package/models/params/gridPreferencePanelParams.d.ts +3 -0
  293. package/models/params/gridPreferencePanelParams.js +1 -0
  294. package/models/params/gridRowParams.d.ts +12 -8
  295. package/models/params/gridValueOptionsParams.d.ts +3 -3
  296. package/models/params/index.d.ts +1 -0
  297. package/models/params/index.js +2 -1
  298. package/models/props/DataGridProps.d.ts +37 -17
  299. package/modern/DataGrid/DataGrid.js +28 -5
  300. package/modern/DataGrid/useDataGridComponent.js +5 -5
  301. package/modern/colDef/gridDateColDef.js +2 -2
  302. package/modern/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
  303. package/modern/colDef/index.js +2 -1
  304. package/modern/components/GridRow.js +53 -22
  305. package/modern/components/base/GridOverlays.js +4 -3
  306. package/modern/components/cell/GridActionsCell.js +168 -21
  307. package/modern/components/cell/GridActionsCellItem.js +7 -5
  308. package/modern/components/cell/GridCell.js +30 -9
  309. package/modern/components/cell/GridEditInputCell.js +3 -3
  310. package/modern/components/cell/GridEditSingleSelectCell.js +22 -13
  311. package/modern/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
  312. package/modern/components/columnHeaders/GridColumnHeaderItem.js +7 -10
  313. package/modern/components/columnHeaders/GridColumnHeaders.js +1 -1
  314. package/modern/components/columnHeaders/index.js +1 -0
  315. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
  316. package/modern/components/containers/GridRoot.js +29 -17
  317. package/modern/components/containers/GridRootStyles.js +36 -1
  318. package/modern/components/menu/GridMenu.js +1 -0
  319. package/modern/components/menu/columnMenu/GridColumnMenu.js +1 -1
  320. package/modern/components/panel/GridPanel.js +1 -0
  321. package/modern/components/panel/GridPreferencesPanel.js +1 -1
  322. package/modern/components/panel/filterPanel/GridFilterForm.js +10 -6
  323. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +11 -6
  324. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +20 -13
  325. package/modern/components/panel/filterPanel/GridFilterInputValue.js +20 -13
  326. package/modern/components/toolbar/GridToolbarDensitySelector.js +1 -1
  327. package/modern/components/virtualization/GridVirtualScroller.js +2 -0
  328. package/modern/components/virtualization/GridVirtualScrollerContent.js +1 -3
  329. package/modern/constants/defaultGridSlotsComponents.js +4 -2
  330. package/modern/constants/gridClasses.js +1 -1
  331. package/modern/constants/gridDetailPanelToggleField.js +2 -0
  332. package/modern/constants/localeTextConstants.js +3 -1
  333. package/modern/hooks/core/pipeProcessing/gridPipeProcessingApi.js +1 -0
  334. package/modern/hooks/core/pipeProcessing/index.js +4 -0
  335. package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +108 -0
  336. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +27 -0
  337. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +27 -0
  338. package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
  339. package/modern/hooks/core/useGridInitialization.js +2 -2
  340. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +77 -11
  341. package/modern/hooks/features/columnMenu/useGridColumnMenu.js +2 -1
  342. package/modern/hooks/features/columns/gridColumnsUtils.js +105 -20
  343. package/modern/hooks/features/columns/useGridColumnSpanning.js +107 -0
  344. package/modern/hooks/features/columns/useGridColumns.js +55 -40
  345. package/modern/hooks/features/dimensions/useGridDimensions.js +5 -4
  346. package/modern/hooks/features/editRows/useGridCellEditing.new.js +40 -17
  347. package/modern/hooks/features/editRows/useGridEditing.new.js +7 -3
  348. package/modern/hooks/features/editRows/useGridRowEditing.new.js +44 -21
  349. package/modern/hooks/features/events/useGridEvents.js +2 -0
  350. package/modern/hooks/features/filter/useGridFilter.js +18 -13
  351. package/modern/hooks/features/focus/useGridFocus.js +19 -9
  352. package/modern/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +64 -13
  353. package/modern/hooks/features/pagination/useGridPage.js +9 -4
  354. package/modern/hooks/features/pagination/useGridPageSize.js +3 -3
  355. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
  356. package/modern/hooks/features/rows/gridRowsSelector.js +1 -0
  357. package/modern/hooks/features/rows/gridRowsUtils.js +11 -0
  358. package/modern/hooks/features/rows/index.js +1 -1
  359. package/modern/hooks/features/rows/useGridRows.js +25 -5
  360. package/modern/hooks/features/rows/useGridRowsMeta.js +7 -14
  361. package/modern/hooks/features/scroll/useGridScroll.js +25 -10
  362. package/modern/hooks/features/selection/useGridSelection.js +75 -27
  363. package/modern/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
  364. package/modern/hooks/features/sorting/useGridSorting.js +13 -13
  365. package/modern/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  366. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +64 -23
  367. package/modern/index.js +1 -1
  368. package/modern/internals/index.js +3 -3
  369. package/modern/locales/arSD.js +3 -1
  370. package/modern/locales/bgBG.js +3 -1
  371. package/modern/locales/csCZ.js +2 -0
  372. package/modern/locales/daDK.js +33 -31
  373. package/modern/locales/deDE.js +3 -1
  374. package/modern/locales/elGR.js +2 -0
  375. package/modern/locales/esES.js +2 -0
  376. package/modern/locales/faIR.js +3 -1
  377. package/modern/locales/fiFI.js +2 -0
  378. package/modern/locales/frFR.js +2 -0
  379. package/modern/locales/heIL.js +3 -1
  380. package/modern/locales/huHU.js +110 -0
  381. package/modern/locales/index.js +1 -0
  382. package/modern/locales/itIT.js +2 -0
  383. package/modern/locales/jaJP.js +2 -0
  384. package/modern/locales/koKR.js +2 -0
  385. package/modern/locales/nlNL.js +2 -0
  386. package/modern/locales/plPL.js +3 -1
  387. package/modern/locales/ptBR.js +3 -1
  388. package/modern/locales/ruRU.js +2 -0
  389. package/modern/locales/skSK.js +2 -0
  390. package/modern/locales/trTR.js +3 -1
  391. package/modern/locales/ukUA.js +2 -0
  392. package/modern/locales/viVN.js +2 -0
  393. package/modern/locales/zhCN.js +2 -0
  394. package/modern/models/api/gridColumnSpanning.js +1 -0
  395. package/modern/models/colDef/index.js +1 -2
  396. package/modern/models/events/gridEvents.js +10 -3
  397. package/modern/models/gridColumnSpanning.js +1 -0
  398. package/modern/models/gridRows.js +1 -31
  399. package/modern/models/index.js +2 -2
  400. package/modern/models/params/gridPreferencePanelParams.js +1 -0
  401. package/modern/models/params/index.js +2 -1
  402. package/node/DataGrid/DataGrid.js +28 -5
  403. package/node/DataGrid/useDataGridComponent.js +6 -6
  404. package/node/colDef/gridDateColDef.js +2 -2
  405. package/node/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
  406. package/node/colDef/index.js +13 -0
  407. package/node/components/GridRow.js +56 -24
  408. package/node/components/base/GridOverlays.js +3 -2
  409. package/node/components/cell/GridActionsCell.js +172 -21
  410. package/node/components/cell/GridActionsCellItem.js +7 -4
  411. package/node/components/cell/GridCell.js +30 -9
  412. package/node/components/cell/GridEditInputCell.js +3 -3
  413. package/node/components/cell/GridEditSingleSelectCell.js +25 -15
  414. package/node/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +23 -5
  415. package/node/components/columnHeaders/GridColumnHeaderItem.js +9 -13
  416. package/node/components/columnHeaders/GridColumnHeaders.js +1 -1
  417. package/node/components/columnHeaders/index.js +13 -0
  418. package/node/components/columnSelection/GridCellCheckboxRenderer.js +22 -5
  419. package/node/components/containers/GridRoot.js +28 -17
  420. package/node/components/containers/GridRootStyles.js +36 -1
  421. package/node/components/menu/GridMenu.js +1 -0
  422. package/node/components/menu/columnMenu/GridColumnMenu.js +1 -1
  423. package/node/components/panel/GridPanel.js +1 -0
  424. package/node/components/panel/GridPreferencesPanel.js +1 -1
  425. package/node/components/panel/filterPanel/GridFilterForm.js +15 -10
  426. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +14 -8
  427. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +23 -15
  428. package/node/components/panel/filterPanel/GridFilterInputValue.js +23 -15
  429. package/node/components/toolbar/GridToolbarDensitySelector.js +1 -1
  430. package/node/components/virtualization/GridVirtualScroller.js +2 -0
  431. package/node/components/virtualization/GridVirtualScrollerContent.js +1 -3
  432. package/node/constants/defaultGridSlotsComponents.js +3 -1
  433. package/node/constants/gridClasses.js +1 -1
  434. package/node/constants/gridDetailPanelToggleField.js +9 -0
  435. package/node/constants/localeTextConstants.js +3 -1
  436. package/node/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
  437. package/node/hooks/core/pipeProcessing/index.js +57 -0
  438. package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +124 -0
  439. package/node/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeApplier.js} +4 -7
  440. package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +42 -0
  441. package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
  442. package/node/hooks/core/useGridInitialization.js +2 -2
  443. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +81 -11
  444. package/node/hooks/features/columnMenu/useGridColumnMenu.js +2 -1
  445. package/node/hooks/features/columns/gridColumnsUtils.js +114 -25
  446. package/node/hooks/features/columns/useGridColumnSpanning.js +130 -0
  447. package/node/hooks/features/columns/useGridColumns.js +55 -40
  448. package/node/hooks/features/dimensions/useGridDimensions.js +5 -4
  449. package/node/hooks/features/editRows/useGridCellEditing.new.js +42 -17
  450. package/node/hooks/features/editRows/useGridEditing.new.js +6 -2
  451. package/node/hooks/features/editRows/useGridRowEditing.new.js +45 -21
  452. package/node/hooks/features/events/useGridEvents.js +2 -0
  453. package/node/hooks/features/filter/useGridFilter.js +18 -13
  454. package/node/hooks/features/focus/useGridFocus.js +19 -9
  455. package/node/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +69 -13
  456. package/node/hooks/features/pagination/useGridPage.js +8 -3
  457. package/node/hooks/features/pagination/useGridPageSize.js +3 -3
  458. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +20 -5
  459. package/node/hooks/features/rows/gridRowsSelector.js +3 -1
  460. package/node/hooks/features/rows/gridRowsUtils.js +18 -0
  461. package/node/hooks/features/rows/index.js +15 -1
  462. package/node/hooks/features/rows/useGridRows.js +29 -9
  463. package/node/hooks/features/rows/useGridRowsMeta.js +7 -15
  464. package/node/hooks/features/scroll/useGridScroll.js +28 -14
  465. package/node/hooks/features/selection/useGridSelection.js +75 -26
  466. package/node/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
  467. package/node/hooks/features/sorting/useGridSorting.js +13 -13
  468. package/node/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  469. package/node/hooks/features/virtualization/useGridVirtualScroller.js +69 -27
  470. package/node/index.js +1 -1
  471. package/node/internals/index.js +12 -12
  472. package/node/locales/arSD.js +3 -1
  473. package/node/locales/bgBG.js +3 -1
  474. package/node/locales/csCZ.js +2 -0
  475. package/node/locales/daDK.js +33 -31
  476. package/node/locales/deDE.js +3 -1
  477. package/node/locales/elGR.js +2 -0
  478. package/node/locales/esES.js +2 -0
  479. package/node/locales/faIR.js +3 -1
  480. package/node/locales/fiFI.js +2 -0
  481. package/node/locales/frFR.js +2 -0
  482. package/node/locales/heIL.js +3 -1
  483. package/node/locales/huHU.js +120 -0
  484. package/node/locales/index.js +13 -0
  485. package/node/locales/itIT.js +2 -0
  486. package/node/locales/jaJP.js +2 -0
  487. package/node/locales/koKR.js +2 -0
  488. package/node/locales/nlNL.js +2 -0
  489. package/node/locales/plPL.js +3 -1
  490. package/node/locales/ptBR.js +3 -1
  491. package/node/locales/ruRU.js +2 -0
  492. package/node/locales/skSK.js +2 -0
  493. package/node/locales/trTR.js +3 -1
  494. package/node/locales/ukUA.js +2 -0
  495. package/node/locales/viVN.js +2 -0
  496. package/node/locales/zhCN.js +2 -0
  497. package/node/models/api/gridColumnSpanning.js +5 -0
  498. package/node/models/colDef/index.js +0 -13
  499. package/node/models/events/gridEvents.js +10 -3
  500. package/node/models/gridColumnSpanning.js +5 -0
  501. package/node/models/gridRows.js +1 -34
  502. package/node/models/index.js +13 -13
  503. package/node/models/params/gridPreferencePanelParams.js +5 -0
  504. package/node/models/params/index.js +13 -0
  505. package/package.json +4 -4
  506. package/utils/domUtils.d.ts +2 -2
  507. package/components/columnHeaders/ColumnHeaderFilterIcon.d.ts +0 -5
  508. package/hooks/core/preProcessing/gridPreProcessingApi.d.ts +0 -67
  509. package/hooks/core/preProcessing/index.d.ts +0 -3
  510. package/hooks/core/preProcessing/index.js +0 -3
  511. package/hooks/core/preProcessing/useGridPreProcessing.d.ts +0 -6
  512. package/hooks/core/preProcessing/useGridPreProcessing.js +0 -53
  513. package/hooks/core/preProcessing/useGridRegisterPreProcessor.d.ts +0 -7
  514. package/hooks/features/keyboard/useGridKeyboard.d.ts +0 -10
  515. package/hooks/features/keyboard/useGridKeyboard.js +0 -70
  516. package/legacy/hooks/core/preProcessing/index.js +0 -3
  517. package/legacy/hooks/core/preProcessing/useGridPreProcessing.js +0 -62
  518. package/legacy/hooks/features/keyboard/useGridKeyboard.js +0 -70
  519. package/modern/hooks/core/preProcessing/index.js +0 -3
  520. package/modern/hooks/core/preProcessing/useGridPreProcessing.js +0 -53
  521. package/modern/hooks/features/keyboard/useGridKeyboard.js +0 -70
  522. package/node/hooks/core/preProcessing/index.js +0 -44
  523. package/node/hooks/core/preProcessing/useGridPreProcessing.js +0 -72
  524. package/node/hooks/features/keyboard/useGridKeyboard.js +0 -91
@@ -1,4 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["colDef", "id", "api", "hasFocus", "isEditable", "field", "value", "formattedValue", "row", "rowNode", "cellMode", "getValue", "tabIndex", "position", "focusElementRef"];
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
4
6
  import IconButton from '@mui/material/IconButton';
@@ -7,26 +9,33 @@ import { unstable_useId as useId } from '@mui/material/utils';
7
9
  import { gridClasses } from '../../constants/gridClasses';
8
10
  import { GridMenu } from '../menu/GridMenu';
9
11
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
12
+ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
10
13
  import { jsx as _jsx } from "react/jsx-runtime";
11
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
15
 
13
16
  const hasActions = colDef => typeof colDef.getActions === 'function';
14
17
 
15
18
  const GridActionsCell = props => {
19
+ const {
20
+ colDef,
21
+ id,
22
+ hasFocus,
23
+ tabIndex,
24
+ position = 'bottom-end',
25
+ focusElementRef
26
+ } = props,
27
+ other = _objectWithoutPropertiesLoose(props, _excluded);
28
+
29
+ const [focusedButtonIndex, setFocusedButtonIndex] = React.useState(-1);
16
30
  const [open, setOpen] = React.useState(false);
31
+ const apiRef = useGridApiContext();
32
+ const rootRef = React.useRef(null);
17
33
  const buttonRef = React.useRef(null);
34
+ const ignoreCallToFocus = React.useRef(false);
18
35
  const touchRippleRefs = React.useRef({});
19
36
  const menuId = useId();
20
37
  const buttonId = useId();
21
38
  const rootProps = useGridRootProps();
22
- const {
23
- colDef,
24
- id,
25
- api,
26
- hasFocus,
27
- position = 'bottom-end'
28
- } = props; // TODO apply the rest to the root element
29
-
30
39
  React.useLayoutEffect(() => {
31
40
  if (!hasFocus) {
32
41
  Object.entries(touchRippleRefs.current).forEach(([index, ref]) => {
@@ -36,56 +45,144 @@ const GridActionsCell = props => {
36
45
  });
37
46
  }
38
47
  }, [hasFocus]);
48
+ React.useEffect(() => {
49
+ if (focusedButtonIndex >= 0) {
50
+ var _rootRef$current;
51
+
52
+ const child = (_rootRef$current = rootRef.current) == null ? void 0 : _rootRef$current.children[focusedButtonIndex];
53
+ child.focus();
54
+ }
55
+ }, [focusedButtonIndex]);
56
+ React.useEffect(() => {
57
+ if (!hasFocus) {
58
+ setFocusedButtonIndex(-1);
59
+ ignoreCallToFocus.current = false;
60
+ }
61
+ }, [hasFocus]);
62
+ React.useImperativeHandle(focusElementRef, () => ({
63
+ focus() {
64
+ // If ignoreCallToFocus is true, then one of the buttons was clicked and the focus is already set
65
+ if (!ignoreCallToFocus.current) {
66
+ setFocusedButtonIndex(0);
67
+ }
68
+ }
69
+
70
+ }), []);
39
71
 
40
72
  if (!hasActions(colDef)) {
41
73
  throw new Error('MUI: Missing the `getActions` property in the `GridColDef`.');
42
74
  }
43
75
 
44
- const showMenu = () => setOpen(true);
45
-
46
- const hideMenu = () => setOpen(false);
47
-
48
- const options = colDef.getActions(api.getRowParams(id));
76
+ const options = colDef.getActions(apiRef.current.getRowParams(id));
49
77
  const iconButtons = options.filter(option => !option.props.showInMenu);
50
78
  const menuButtons = options.filter(option => option.props.showInMenu);
79
+ const numberOfButtons = iconButtons.length + (menuButtons.length ? 1 : 0);
80
+
81
+ const showMenu = () => {
82
+ setOpen(true);
83
+ setFocusedButtonIndex(numberOfButtons - 1);
84
+ ignoreCallToFocus.current = true;
85
+ };
86
+
87
+ const hideMenu = () => {
88
+ setOpen(false);
89
+ };
51
90
 
52
91
  const handleTouchRippleRef = index => instance => {
53
92
  touchRippleRefs.current[index] = instance;
54
93
  };
55
94
 
56
- return /*#__PURE__*/_jsxs("div", {
95
+ const handleButtonClick = (index, onClick) => event => {
96
+ setFocusedButtonIndex(index);
97
+ ignoreCallToFocus.current = true;
98
+
99
+ if (onClick) {
100
+ onClick(event);
101
+ }
102
+ };
103
+
104
+ const handleRootKeyDown = event => {
105
+ if (numberOfButtons <= 1) {
106
+ return;
107
+ }
108
+
109
+ let newIndex = focusedButtonIndex;
110
+
111
+ if (event.key === 'ArrowRight') {
112
+ newIndex += 1;
113
+ } else if (event.key === 'ArrowLeft') {
114
+ newIndex -= 1;
115
+ }
116
+
117
+ if (newIndex < 0 || newIndex >= numberOfButtons) {
118
+ return; // We're already in the first or last item = do nothing and let the grid listen the event
119
+ }
120
+
121
+ if (newIndex !== focusedButtonIndex) {
122
+ event.preventDefault(); // Prevent scrolling
123
+
124
+ event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp
125
+
126
+ setFocusedButtonIndex(newIndex);
127
+ }
128
+ };
129
+
130
+ const handleListKeyDown = event => {
131
+ if (event.key === 'Tab') {
132
+ event.preventDefault();
133
+ }
134
+
135
+ if (['Tab', 'Enter', 'Escape'].includes(event.key)) {
136
+ hideMenu();
137
+ }
138
+ };
139
+
140
+ return /*#__PURE__*/_jsxs("div", _extends({
141
+ role: "menu",
142
+ ref: rootRef,
143
+ tabIndex: -1,
57
144
  className: gridClasses.actionsCell,
145
+ onKeyDown: handleRootKeyDown
146
+ }, other, {
58
147
  children: [iconButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
59
148
  key: index,
60
- touchRippleRef: handleTouchRippleRef(index)
61
- })), menuButtons.length > 0 && /*#__PURE__*/_jsx(IconButton, {
149
+ touchRippleRef: handleTouchRippleRef(index),
150
+ onClick: handleButtonClick(index, button.props.onClick),
151
+ tabIndex: focusedButtonIndex === index ? tabIndex : -1
152
+ })), menuButtons.length > 0 && buttonId && /*#__PURE__*/_jsx(IconButton, {
62
153
  ref: buttonRef,
63
154
  id: buttonId,
64
- "aria-label": api.getLocaleText('actionsCellMore'),
155
+ "aria-label": apiRef.current.getLocaleText('actionsCellMore'),
65
156
  "aria-controls": menuId,
66
157
  "aria-expanded": open ? 'true' : undefined,
67
158
  "aria-haspopup": "true",
159
+ role: "menuitem",
68
160
  size: "small",
69
161
  onClick: showMenu,
162
+ touchRippleRef: handleTouchRippleRef(buttonId),
163
+ tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1,
70
164
  children: /*#__PURE__*/_jsx(rootProps.components.MoreActionsIcon, {
71
165
  fontSize: "small"
72
166
  })
73
167
  }), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {
74
- id: menuId,
75
168
  onClickAway: hideMenu,
76
169
  onClick: hideMenu,
77
170
  open: open,
78
171
  target: buttonRef.current,
79
172
  position: position,
80
- "aria-labelledby": buttonId,
81
173
  children: /*#__PURE__*/_jsx(MenuList, {
174
+ id: menuId,
82
175
  className: gridClasses.menuList,
176
+ onKeyDown: handleListKeyDown,
177
+ "aria-labelledby": buttonId,
178
+ variant: "menu",
179
+ autoFocusItem: true,
83
180
  children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
84
181
  key: index
85
182
  }))
86
183
  })
87
184
  })]
88
- });
185
+ }));
89
186
  };
90
187
 
91
188
  process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes = {
@@ -100,11 +197,42 @@ process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes = {
100
197
  */
101
198
  api: PropTypes.any.isRequired,
102
199
 
200
+ /**
201
+ * The mode of the cell.
202
+ */
203
+ cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
204
+
103
205
  /**
104
206
  * The column of the row that the current cell belongs to.
105
207
  */
106
208
  colDef: PropTypes.object.isRequired,
107
209
 
210
+ /**
211
+ * The column field of the cell that triggered the event.
212
+ */
213
+ field: PropTypes.string.isRequired,
214
+
215
+ /**
216
+ * A ref allowing to set imperative focus.
217
+ * It can be passed to the element that should receive focus.
218
+ * @ignore - do not document.
219
+ */
220
+ focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
221
+ current: PropTypes.shape({
222
+ focus: PropTypes.func.isRequired
223
+ })
224
+ })]),
225
+ formattedValue: PropTypes.any,
226
+
227
+ /**
228
+ * Get the cell value of a row and field.
229
+ * @param {GridRowId} id The row id.
230
+ * @param {string} field The field.
231
+ * @returns {any} The cell value.
232
+ * @deprecated Use `params.row` to directly access the fields you want instead.
233
+ */
234
+ getValue: PropTypes.func.isRequired,
235
+
108
236
  /**
109
237
  * If true, the cell is the active element.
110
238
  */
@@ -114,7 +242,28 @@ process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes = {
114
242
  * The grid row id.
115
243
  */
116
244
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
117
- position: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top'])
245
+
246
+ /**
247
+ * If true, the cell is editable.
248
+ */
249
+ isEditable: PropTypes.bool,
250
+ position: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
251
+
252
+ /**
253
+ * The row model of the row that the current cell belongs to.
254
+ */
255
+ row: PropTypes.object.isRequired,
256
+
257
+ /**
258
+ * The node of the row that the current cell belongs to.
259
+ */
260
+ rowNode: PropTypes.object.isRequired,
261
+
262
+ /**
263
+ * the tabIndex value.
264
+ */
265
+ tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
266
+ value: PropTypes.any
118
267
  } : void 0;
119
268
  export { GridActionsCell };
120
269
  export const renderActionsCell = params => /*#__PURE__*/_jsx(GridActionsCell, _extends({}, params));
@@ -10,8 +10,70 @@ export declare type GridActionsCellItemProps = {
10
10
  } & IconButtonProps) | ({
11
11
  showInMenu: true;
12
12
  } & MenuItemProps));
13
- declare const GridActionsCellItem: {
14
- (props: GridActionsCellItemProps): JSX.Element;
15
- propTypes: any;
16
- };
13
+ declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Pick<{
14
+ label: string;
15
+ icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
16
+ } & {
17
+ showInMenu?: false | undefined;
18
+ icon: React.ReactElement;
19
+ } & {
20
+ children?: React.ReactNode;
21
+ classes?: Partial<import("@mui/material/IconButton").IconButtonClasses> | undefined;
22
+ color?: "inherit" | "default" | "warning" | "error" | "success" | "info" | "primary" | "secondary" | undefined;
23
+ disabled?: boolean | undefined;
24
+ disableFocusRipple?: boolean | undefined;
25
+ edge?: false | "end" | "start" | undefined;
26
+ size?: "medium" | "large" | "small" | undefined;
27
+ sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
28
+ } & Omit<{
29
+ action?: React.Ref<import("@mui/material").ButtonBaseActions> | undefined;
30
+ centerRipple?: boolean | undefined;
31
+ children?: React.ReactNode;
32
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
33
+ disabled?: boolean | undefined;
34
+ disableRipple?: boolean | undefined;
35
+ disableTouchRipple?: boolean | undefined;
36
+ focusRipple?: boolean | undefined;
37
+ focusVisibleClassName?: string | undefined;
38
+ LinkComponent?: React.ElementType<any> | undefined;
39
+ onFocusVisible?: React.FocusEventHandler<any> | undefined;
40
+ sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
41
+ tabIndex?: number | undefined;
42
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
43
+ touchRippleRef?: React.Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
44
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & {
45
+ ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
46
+ }, "color" | "size" | "disabled" | "children" | "action" | "tabIndex" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge">, "hidden" | "color" | "size" | "icon" | "translate" | "disabled" | "form" | "label" | "slot" | "title" | "children" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "showInMenu"> | Pick<{
47
+ label: string;
48
+ icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
49
+ } & {
50
+ showInMenu: true;
51
+ } & {
52
+ autoFocus?: boolean | undefined;
53
+ classes?: Partial<import("@mui/material/MenuItem").MenuItemClasses> | undefined;
54
+ dense?: boolean | undefined;
55
+ disabled?: boolean | undefined;
56
+ disableGutters?: boolean | undefined;
57
+ divider?: boolean | undefined;
58
+ selected?: boolean | undefined;
59
+ sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
60
+ } & Omit<{
61
+ action?: React.Ref<import("@mui/material").ButtonBaseActions> | undefined;
62
+ centerRipple?: boolean | undefined;
63
+ children?: React.ReactNode;
64
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
65
+ disabled?: boolean | undefined;
66
+ disableRipple?: boolean | undefined;
67
+ disableTouchRipple?: boolean | undefined;
68
+ focusRipple?: boolean | undefined;
69
+ focusVisibleClassName?: string | undefined;
70
+ LinkComponent?: React.ElementType<any> | undefined;
71
+ onFocusVisible?: React.FocusEventHandler<any> | undefined;
72
+ sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
73
+ tabIndex?: number | undefined;
74
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
75
+ touchRippleRef?: React.Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
76
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof React.LiHTMLAttributes<HTMLLIElement>> & {
77
+ ref?: ((instance: HTMLLIElement | null) => void) | React.RefObject<HTMLLIElement> | null | undefined;
78
+ }, "dense" | "disabled" | "children" | "action" | "autoFocus" | "tabIndex" | "selected" | "sx" | "divider" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableGutters">, "hidden" | "color" | "dense" | "icon" | "translate" | "disabled" | "label" | "slot" | "title" | "children" | "key" | "action" | "autoFocus" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "selected" | "value" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "divider" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableGutters" | "showInMenu">) & React.RefAttributes<HTMLButtonElement>>;
17
79
  export { GridActionsCellItem };
@@ -8,8 +8,7 @@ import MenuItem from '@mui/material/MenuItem';
8
8
  import ListItemIcon from '@mui/material/ListItemIcon';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
-
12
- const GridActionsCellItem = props => {
11
+ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
13
12
  const {
14
13
  label,
15
14
  icon,
@@ -26,7 +25,9 @@ const GridActionsCellItem = props => {
26
25
 
27
26
  if (!showInMenu) {
28
27
  return /*#__PURE__*/_jsx(IconButton, _extends({
28
+ ref: ref,
29
29
  size: "small",
30
+ role: "menuitem",
30
31
  "aria-label": label
31
32
  }, other, {
32
33
  onClick: handleClick,
@@ -36,14 +37,15 @@ const GridActionsCellItem = props => {
36
37
  }));
37
38
  }
38
39
 
39
- return /*#__PURE__*/_jsxs(MenuItem, _extends({}, other, {
40
+ return /*#__PURE__*/_jsxs(MenuItem, _extends({
41
+ ref: ref
42
+ }, other, {
40
43
  onClick: onClick,
41
44
  children: [icon && /*#__PURE__*/_jsx(ListItemIcon, {
42
45
  children: icon
43
46
  }), label]
44
47
  }));
45
- };
46
-
48
+ });
47
49
  process.env.NODE_ENV !== "production" ? GridActionsCellItem.propTypes = {
48
50
  // ----------------------------- Warning --------------------------------
49
51
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -1,22 +1,23 @@
1
1
  import * as React from 'react';
2
- import { GridCellMode, GridCellValue, GridRowId } from '../../models';
2
+ import { GridCellMode, GridRowId } from '../../models';
3
3
  import { GridAlignment } from '../../models/colDef/gridColDef';
4
- export interface GridCellProps {
4
+ export interface GridCellProps<V = any, F = V> {
5
5
  align: GridAlignment;
6
6
  className?: string;
7
7
  colIndex: number;
8
8
  field: string;
9
9
  rowId: GridRowId;
10
- formattedValue?: GridCellValue;
10
+ formattedValue?: F;
11
11
  hasFocus?: boolean;
12
12
  height: number;
13
13
  isEditable?: boolean;
14
14
  showRightBorder?: boolean;
15
- value?: GridCellValue;
15
+ value?: V;
16
16
  width: number;
17
17
  cellMode?: GridCellMode;
18
18
  children: React.ReactNode;
19
19
  tabIndex: 0 | -1;
20
+ colSpan?: number;
20
21
  onClick?: React.MouseEventHandler<HTMLDivElement>;
21
22
  onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
22
23
  onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["align", "children", "colIndex", "cellMode", "field", "formattedValue", "hasFocus", "height", "isEditable", "rowId", "tabIndex", "value", "width", "className", "showRightBorder", "extendRowFullWidth", "row", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onKeyDown", "onDragEnter", "onDragOver"];
3
+ const _excluded = ["align", "children", "colIndex", "colDef", "cellMode", "field", "formattedValue", "hasFocus", "height", "isEditable", "rowId", "tabIndex", "value", "width", "className", "showRightBorder", "extendRowFullWidth", "row", "colSpan", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onKeyDown", "onDragEnter", "onDragOver"];
4
4
 
5
5
  /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
6
6
  import * as React from 'react';
@@ -66,6 +66,7 @@ function GridCell(props) {
66
66
  width,
67
67
  className,
68
68
  showRightBorder,
69
+ colSpan,
69
70
  onClick,
70
71
  onDoubleClick,
71
72
  onMouseDown,
@@ -78,6 +79,7 @@ function GridCell(props) {
78
79
 
79
80
  const valueToRender = formattedValue == null ? value : formattedValue;
80
81
  const cellRef = React.useRef(null);
82
+ const focusElementRef = React.useRef(null);
81
83
  const apiRef = useGridApiContext();
82
84
  const rootProps = useGridRootProps();
83
85
  const ownerState = {
@@ -128,7 +130,7 @@ function GridCell(props) {
128
130
 
129
131
  if (cellRef.current && !cellRef.current.contains(doc.activeElement)) {
130
132
  const focusableElement = cellRef.current.querySelector('[tabindex="0"]');
131
- const elementToFocus = focusableElement || cellRef.current;
133
+ const elementToFocus = focusElementRef.current || focusableElement || cellRef.current;
132
134
 
133
135
  if (doesSupportPreventScroll()) {
134
136
  elementToFocus.focus({
@@ -162,6 +164,26 @@ function GridCell(props) {
162
164
  };
163
165
  }
164
166
 
167
+ const column = apiRef.current.getColumn(field);
168
+ const managesOwnFocus = column.type === 'actions';
169
+
170
+ const renderChildren = () => {
171
+ if (children == null) {
172
+ return /*#__PURE__*/_jsx("div", {
173
+ className: classes.content,
174
+ children: valueToRender == null ? void 0 : valueToRender.toString()
175
+ });
176
+ }
177
+
178
+ if ( /*#__PURE__*/React.isValidElement(children) && managesOwnFocus) {
179
+ return /*#__PURE__*/React.cloneElement(children, {
180
+ focusElementRef
181
+ });
182
+ }
183
+
184
+ return children;
185
+ };
186
+
165
187
  return /*#__PURE__*/_jsx("div", _extends({
166
188
  ref: cellRef,
167
189
  className: clsx(className, classes.root),
@@ -169,8 +191,9 @@ function GridCell(props) {
169
191
  "data-field": field,
170
192
  "data-colindex": colIndex,
171
193
  "aria-colindex": colIndex + 1,
194
+ "aria-colspan": colSpan,
172
195
  style: style,
173
- tabIndex: cellMode === 'view' || !isEditable ? tabIndex : -1,
196
+ tabIndex: (cellMode === 'view' || !isEditable) && !managesOwnFocus ? tabIndex : -1,
174
197
  onClick: publish(GridEvents.cellClick, onClick),
175
198
  onDoubleClick: publish(GridEvents.cellDoubleClick, onDoubleClick),
176
199
  onMouseDown: publish(GridEvents.cellMouseDown, onMouseDown),
@@ -180,10 +203,7 @@ function GridCell(props) {
180
203
  onDragOver: publish(GridEvents.cellDragOver, onDragOver)
181
204
  }, other, {
182
205
  onFocus: handleFocus,
183
- children: children != null ? children : /*#__PURE__*/_jsx("div", {
184
- className: classes.content,
185
- children: valueToRender == null ? void 0 : valueToRender.toString()
186
- })
206
+ children: renderChildren()
187
207
  }));
188
208
  }
189
209
 
@@ -197,8 +217,9 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
197
217
  children: PropTypes.node,
198
218
  className: PropTypes.string,
199
219
  colIndex: PropTypes.number.isRequired,
220
+ colSpan: PropTypes.number,
200
221
  field: PropTypes.string.isRequired,
201
- formattedValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
222
+ formattedValue: PropTypes.any,
202
223
  hasFocus: PropTypes.bool,
203
224
  height: PropTypes.number.isRequired,
204
225
  isEditable: PropTypes.bool,
@@ -212,7 +233,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
212
233
  rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
213
234
  showRightBorder: PropTypes.bool,
214
235
  tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
215
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
236
+ value: PropTypes.any,
216
237
  width: PropTypes.number.isRequired
217
238
  } : void 0;
218
239
  export { GridCell };
@@ -120,13 +120,13 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
120
120
  /**
121
121
  * The cell value formatted with the column valueFormatter.
122
122
  */
123
- formattedValue: PropTypes.any.isRequired,
123
+ formattedValue: PropTypes.any,
124
124
 
125
125
  /**
126
126
  * Get the cell value of a row and field.
127
127
  * @param {GridRowId} id The row id.
128
128
  * @param {string} field The field.
129
- * @returns {GridCellValue} The cell value.
129
+ * @returns {any} The cell value.
130
130
  * @deprecated Use `params.row` to directly access the fields you want instead.
131
131
  */
132
132
  getValue: PropTypes.func.isRequired,
@@ -151,7 +151,7 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
151
151
  /**
152
152
  * The row model of the row that the current cell belongs to.
153
153
  */
154
- row: PropTypes.any.isRequired,
154
+ row: PropTypes.object.isRequired,
155
155
 
156
156
  /**
157
157
  * The node of the row that the current cell belongs to.