@mui/x-data-grid 5.10.0 → 5.11.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 (490) hide show
  1. package/CHANGELOG.md +163 -10
  2. package/DataGrid/DataGrid.js +35 -1
  3. package/DataGrid/useDataGridProps.js +2 -1
  4. package/README.md +1 -1
  5. package/colDef/gridActionsColDef.js +2 -1
  6. package/colDef/gridBooleanColDef.js +2 -1
  7. package/colDef/gridCheckboxSelectionColDef.js +1 -0
  8. package/colDef/gridDateColDef.js +4 -2
  9. package/colDef/gridNumericColDef.js +3 -2
  10. package/colDef/gridNumericOperators.d.ts +2 -0
  11. package/colDef/gridNumericOperators.js +11 -0
  12. package/colDef/gridSingleSelectColDef.js +3 -2
  13. package/colDef/gridSingleSelectOperators.d.ts +3 -0
  14. package/colDef/gridSingleSelectOperators.js +52 -0
  15. package/colDef/gridStringColDef.js +3 -2
  16. package/colDef/gridStringOperators.d.ts +2 -0
  17. package/colDef/gridStringOperators.js +12 -0
  18. package/components/GridFooter.d.ts +4 -2
  19. package/components/GridFooter.js +11 -2
  20. package/components/GridRow.js +4 -5
  21. package/components/GridRowCount.d.ts +4 -1
  22. package/components/GridRowCount.js +1 -0
  23. package/components/GridScrollArea.js +3 -4
  24. package/components/GridSelectedRowCount.d.ts +4 -1
  25. package/components/GridSelectedRowCount.js +2 -1
  26. package/components/base/GridBody.js +1 -2
  27. package/components/base/GridOverlays.js +1 -2
  28. package/components/cell/GridActionsCell.js +13 -4
  29. package/components/cell/GridCell.js +8 -8
  30. package/components/cell/GridEditBooleanCell.d.ts +15 -3
  31. package/components/cell/GridEditBooleanCell.js +101 -6
  32. package/components/cell/GridEditDateCell.d.ts +16 -4
  33. package/components/cell/GridEditDateCell.js +99 -5
  34. package/components/cell/GridEditInputCell.d.ts +11 -5
  35. package/components/cell/GridEditInputCell.js +29 -5
  36. package/components/cell/GridEditSingleSelectCell.d.ts +12 -4
  37. package/components/cell/GridEditSingleSelectCell.js +28 -5
  38. package/components/cell/index.d.ts +2 -0
  39. package/components/cell/index.js +2 -0
  40. package/components/columnHeaders/GridColumnHeaderItem.js +15 -16
  41. package/components/columnHeaders/GridColumnHeaders.d.ts +2 -0
  42. package/components/columnHeaders/GridColumnHeadersInner.d.ts +2 -0
  43. package/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
  44. package/components/columnSelection/GridHeaderCheckbox.js +4 -5
  45. package/components/containers/GridFooterContainer.d.ts +8 -2
  46. package/components/containers/GridFooterContainer.js +11 -2
  47. package/components/containers/GridToolbarContainer.d.ts +8 -2
  48. package/components/containers/GridToolbarContainer.js +12 -2
  49. package/components/panel/GridPanelContent.d.ts +8 -1
  50. package/components/panel/GridPanelContent.js +13 -2
  51. package/components/panel/GridPanelFooter.d.ts +8 -1
  52. package/components/panel/GridPanelFooter.js +13 -2
  53. package/components/panel/GridPanelHeader.d.ts +8 -1
  54. package/components/panel/GridPanelHeader.js +13 -2
  55. package/components/toolbar/GridToolbar.d.ts +12 -2
  56. package/components/toolbar/GridToolbar.js +30 -7
  57. package/components/toolbar/GridToolbarExport.d.ts +5 -4
  58. package/components/toolbar/GridToolbarExport.js +15 -20
  59. package/components/toolbar/GridToolbarQuickFilter.d.ts +20 -0
  60. package/components/toolbar/GridToolbarQuickFilter.js +88 -0
  61. package/components/toolbar/index.d.ts +3 -1
  62. package/components/toolbar/index.js +3 -2
  63. package/components/virtualization/GridVirtualScroller.d.ts +4 -1
  64. package/components/virtualization/GridVirtualScrollerContent.d.ts +4 -1
  65. package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +4 -1
  66. package/constants/localeTextConstants.js +5 -0
  67. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +7 -0
  68. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +4 -4
  69. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
  70. package/hooks/core/useGridApiInitialization.js +3 -3
  71. package/hooks/core/useGridErrorHandler.js +1 -2
  72. package/hooks/core/useGridStateInitialization.js +1 -2
  73. package/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -6
  74. package/hooks/features/columnMenu/useGridColumnMenu.js +3 -4
  75. package/hooks/features/columns/useGridColumnSpanning.js +1 -2
  76. package/hooks/features/columns/useGridColumns.js +8 -9
  77. package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
  78. package/hooks/features/dimensions/useGridDimensions.js +8 -9
  79. package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
  80. package/hooks/features/editRows/useGridCellEditing.new.js +133 -32
  81. package/hooks/features/editRows/useGridCellEditing.old.js +20 -21
  82. package/hooks/features/editRows/useGridEditing.old.js +4 -5
  83. package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
  84. package/hooks/features/editRows/useGridRowEditing.new.js +122 -42
  85. package/hooks/features/editRows/useGridRowEditing.old.js +21 -22
  86. package/hooks/features/events/useGridEvents.js +17 -18
  87. package/hooks/features/export/serializers/csvSerializer.js +5 -5
  88. package/hooks/features/export/useGridCsvExport.js +23 -16
  89. package/hooks/features/export/useGridPrintExport.js +22 -0
  90. package/hooks/features/export/utils.d.ts +3 -1
  91. package/hooks/features/export/utils.js +13 -0
  92. package/hooks/features/filter/gridFilterState.d.ts +1 -2
  93. package/hooks/features/filter/gridFilterState.js +3 -1
  94. package/hooks/features/filter/gridFilterUtils.d.ts +8 -0
  95. package/hooks/features/filter/gridFilterUtils.js +84 -2
  96. package/hooks/features/filter/useGridFilter.js +20 -8
  97. package/hooks/features/focus/useGridFocus.d.ts +1 -1
  98. package/hooks/features/focus/useGridFocus.js +29 -33
  99. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -5
  100. package/hooks/features/pagination/useGridPage.js +3 -4
  101. package/hooks/features/pagination/useGridPageSize.js +2 -3
  102. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
  103. package/hooks/features/rows/gridRowsSelector.d.ts +1 -0
  104. package/hooks/features/rows/gridRowsSelector.js +1 -0
  105. package/hooks/features/rows/gridRowsState.d.ts +3 -7
  106. package/hooks/features/rows/gridRowsUtils.d.ts +2 -1
  107. package/hooks/features/rows/gridRowsUtils.js +25 -1
  108. package/hooks/features/rows/useGridRows.js +100 -60
  109. package/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
  110. package/hooks/features/scroll/useGridScroll.js +6 -1
  111. package/hooks/features/selection/useGridSelection.d.ts +1 -1
  112. package/hooks/features/selection/useGridSelection.js +13 -10
  113. package/hooks/features/sorting/useGridSorting.js +8 -9
  114. package/hooks/features/virtualization/useGridVirtualScroller.js +6 -7
  115. package/hooks/utils/useGridApiEventHandler.d.ts +4 -1
  116. package/hooks/utils/useGridApiEventHandler.js +22 -9
  117. package/hooks/utils/useGridNativeEventListener.js +1 -2
  118. package/hooks/utils/useGridSelector.js +1 -1
  119. package/index.d.ts +2 -0
  120. package/index.js +1 -1
  121. package/internals/index.d.ts +4 -1
  122. package/internals/index.js +5 -2
  123. package/legacy/DataGrid/DataGrid.js +35 -1
  124. package/legacy/DataGrid/useDataGridProps.js +2 -1
  125. package/legacy/colDef/gridActionsColDef.js +2 -1
  126. package/legacy/colDef/gridBooleanColDef.js +2 -1
  127. package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -0
  128. package/legacy/colDef/gridDateColDef.js +4 -2
  129. package/legacy/colDef/gridNumericColDef.js +3 -2
  130. package/legacy/colDef/gridNumericOperators.js +28 -18
  131. package/legacy/colDef/gridSingleSelectColDef.js +3 -2
  132. package/legacy/colDef/gridSingleSelectOperators.js +55 -6
  133. package/legacy/colDef/gridStringColDef.js +3 -2
  134. package/legacy/colDef/gridStringOperators.js +25 -14
  135. package/legacy/components/GridFooter.js +11 -2
  136. package/legacy/components/GridRow.js +4 -5
  137. package/legacy/components/GridRowCount.js +1 -0
  138. package/legacy/components/GridScrollArea.js +3 -4
  139. package/legacy/components/GridSelectedRowCount.js +2 -1
  140. package/legacy/components/base/GridBody.js +1 -2
  141. package/legacy/components/base/GridOverlays.js +1 -2
  142. package/legacy/components/cell/GridActionsCell.js +13 -4
  143. package/legacy/components/cell/GridCell.js +8 -8
  144. package/legacy/components/cell/GridEditBooleanCell.js +132 -11
  145. package/legacy/components/cell/GridEditDateCell.js +148 -42
  146. package/legacy/components/cell/GridEditInputCell.js +61 -12
  147. package/legacy/components/cell/GridEditSingleSelectCell.js +41 -13
  148. package/legacy/components/cell/index.js +2 -0
  149. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +15 -16
  150. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
  151. package/legacy/components/columnSelection/GridHeaderCheckbox.js +4 -5
  152. package/legacy/components/containers/GridFooterContainer.js +11 -2
  153. package/legacy/components/containers/GridToolbarContainer.js +12 -2
  154. package/legacy/components/panel/GridPanelContent.js +13 -2
  155. package/legacy/components/panel/GridPanelFooter.js +13 -2
  156. package/legacy/components/panel/GridPanelHeader.js +13 -2
  157. package/legacy/components/toolbar/GridToolbar.js +31 -6
  158. package/legacy/components/toolbar/GridToolbarExport.js +18 -19
  159. package/legacy/components/toolbar/GridToolbarQuickFilter.js +103 -0
  160. package/legacy/components/toolbar/index.js +3 -2
  161. package/legacy/constants/localeTextConstants.js +5 -0
  162. package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
  163. package/legacy/hooks/core/useGridApiInitialization.js +3 -3
  164. package/legacy/hooks/core/useGridErrorHandler.js +1 -2
  165. package/legacy/hooks/core/useGridStateInitialization.js +1 -2
  166. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -6
  167. package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +3 -4
  168. package/legacy/hooks/features/columns/useGridColumnSpanning.js +1 -2
  169. package/legacy/hooks/features/columns/useGridColumns.js +8 -9
  170. package/legacy/hooks/features/dimensions/useGridDimensions.js +8 -9
  171. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +213 -83
  172. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +20 -21
  173. package/legacy/hooks/features/editRows/useGridEditing.old.js +4 -5
  174. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +126 -42
  175. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +20 -21
  176. package/legacy/hooks/features/events/useGridEvents.js +17 -18
  177. package/legacy/hooks/features/export/serializers/csvSerializer.js +5 -5
  178. package/legacy/hooks/features/export/useGridCsvExport.js +24 -17
  179. package/legacy/hooks/features/export/useGridPrintExport.js +22 -0
  180. package/legacy/hooks/features/export/utils.js +14 -0
  181. package/legacy/hooks/features/filter/gridFilterState.js +3 -1
  182. package/legacy/hooks/features/filter/gridFilterUtils.js +96 -2
  183. package/legacy/hooks/features/filter/useGridFilter.js +20 -8
  184. package/legacy/hooks/features/focus/useGridFocus.js +31 -35
  185. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -5
  186. package/legacy/hooks/features/pagination/useGridPage.js +3 -4
  187. package/legacy/hooks/features/pagination/useGridPageSize.js +2 -3
  188. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
  189. package/legacy/hooks/features/rows/gridRowsSelector.js +3 -0
  190. package/legacy/hooks/features/rows/gridRowsUtils.js +27 -1
  191. package/legacy/hooks/features/rows/useGridRows.js +104 -60
  192. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
  193. package/legacy/hooks/features/scroll/useGridScroll.js +6 -1
  194. package/legacy/hooks/features/selection/useGridSelection.js +13 -10
  195. package/legacy/hooks/features/sorting/useGridSorting.js +8 -9
  196. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +6 -7
  197. package/legacy/hooks/utils/useGridApiEventHandler.js +20 -9
  198. package/legacy/hooks/utils/useGridNativeEventListener.js +1 -2
  199. package/legacy/hooks/utils/useGridSelector.js +1 -1
  200. package/legacy/index.js +1 -1
  201. package/legacy/internals/index.js +5 -2
  202. package/legacy/locales/arSD.js +5 -0
  203. package/legacy/locales/bgBG.js +5 -0
  204. package/legacy/locales/csCZ.js +5 -0
  205. package/legacy/locales/daDK.js +5 -0
  206. package/legacy/locales/deDE.js +10 -5
  207. package/legacy/locales/elGR.js +5 -0
  208. package/legacy/locales/esES.js +5 -0
  209. package/legacy/locales/faIR.js +5 -0
  210. package/legacy/locales/fiFI.js +5 -0
  211. package/legacy/locales/frFR.js +5 -0
  212. package/legacy/locales/heIL.js +5 -0
  213. package/legacy/locales/huHU.js +5 -0
  214. package/legacy/locales/itIT.js +5 -0
  215. package/legacy/locales/jaJP.js +5 -0
  216. package/legacy/locales/koKR.js +5 -0
  217. package/legacy/locales/nlNL.js +5 -0
  218. package/legacy/locales/plPL.js +5 -0
  219. package/legacy/locales/ptBR.js +5 -0
  220. package/legacy/locales/ruRU.js +5 -0
  221. package/legacy/locales/skSK.js +5 -0
  222. package/legacy/locales/trTR.js +5 -0
  223. package/legacy/locales/ukUA.js +5 -0
  224. package/legacy/locales/viVN.js +5 -0
  225. package/legacy/locales/zhCN.js +5 -0
  226. package/legacy/models/events/gridEvents.js +2 -0
  227. package/legacy/models/index.js +4 -3
  228. package/legacy/utils/createSelector.js +18 -2
  229. package/legacy/utils/exportAs.js +1 -1
  230. package/locales/arSD.js +5 -0
  231. package/locales/bgBG.js +5 -0
  232. package/locales/csCZ.js +5 -0
  233. package/locales/daDK.js +5 -0
  234. package/locales/deDE.js +10 -5
  235. package/locales/elGR.js +5 -0
  236. package/locales/esES.js +5 -0
  237. package/locales/faIR.js +5 -0
  238. package/locales/fiFI.js +5 -0
  239. package/locales/frFR.js +5 -0
  240. package/locales/heIL.js +5 -0
  241. package/locales/huHU.js +5 -0
  242. package/locales/itIT.js +5 -0
  243. package/locales/jaJP.js +5 -0
  244. package/locales/koKR.js +5 -0
  245. package/locales/nlNL.js +5 -0
  246. package/locales/plPL.js +5 -0
  247. package/locales/ptBR.js +5 -0
  248. package/locales/ruRU.js +5 -0
  249. package/locales/skSK.js +5 -0
  250. package/locales/trTR.js +5 -0
  251. package/locales/ukUA.js +5 -0
  252. package/locales/viVN.js +5 -0
  253. package/locales/zhCN.js +5 -0
  254. package/models/api/gridCoreApi.d.ts +10 -0
  255. package/models/api/gridEditingApi.d.ts +23 -4
  256. package/models/api/gridFilterApi.d.ts +5 -0
  257. package/models/api/gridFocusApi.d.ts +1 -0
  258. package/models/api/gridLocaleTextApi.d.ts +4 -0
  259. package/models/api/gridRowApi.d.ts +28 -0
  260. package/models/api/index.d.ts +1 -1
  261. package/models/colDef/gridColDef.d.ts +13 -0
  262. package/models/events/gridEventLookup.d.ts +273 -3
  263. package/models/events/gridEvents.d.ts +2 -277
  264. package/models/events/gridEvents.js +2 -0
  265. package/models/gridExport.d.ts +29 -2
  266. package/models/gridFilterModel.d.ts +11 -0
  267. package/models/gridFilterOperator.d.ts +1 -1
  268. package/models/gridStateCommunity.d.ts +0 -2
  269. package/models/index.d.ts +1 -1
  270. package/models/index.js +4 -3
  271. package/models/props/DataGridProps.d.ts +56 -28
  272. package/modern/DataGrid/DataGrid.js +35 -1
  273. package/modern/DataGrid/useDataGridProps.js +2 -1
  274. package/modern/colDef/gridActionsColDef.js +2 -1
  275. package/modern/colDef/gridBooleanColDef.js +2 -1
  276. package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
  277. package/modern/colDef/gridDateColDef.js +4 -2
  278. package/modern/colDef/gridNumericColDef.js +3 -2
  279. package/modern/colDef/gridNumericOperators.js +11 -0
  280. package/modern/colDef/gridSingleSelectColDef.js +3 -2
  281. package/modern/colDef/gridSingleSelectOperators.js +52 -0
  282. package/modern/colDef/gridStringColDef.js +3 -2
  283. package/modern/colDef/gridStringOperators.js +12 -0
  284. package/modern/components/GridFooter.js +11 -2
  285. package/modern/components/GridRow.js +4 -5
  286. package/modern/components/GridRowCount.js +1 -0
  287. package/modern/components/GridScrollArea.js +3 -4
  288. package/modern/components/GridSelectedRowCount.js +2 -1
  289. package/modern/components/base/GridBody.js +1 -2
  290. package/modern/components/base/GridOverlays.js +1 -2
  291. package/modern/components/cell/GridActionsCell.js +14 -3
  292. package/modern/components/cell/GridCell.js +8 -8
  293. package/modern/components/cell/GridEditBooleanCell.js +101 -6
  294. package/modern/components/cell/GridEditDateCell.js +99 -5
  295. package/modern/components/cell/GridEditInputCell.js +29 -5
  296. package/modern/components/cell/GridEditSingleSelectCell.js +28 -5
  297. package/modern/components/cell/index.js +2 -0
  298. package/modern/components/columnHeaders/GridColumnHeaderItem.js +15 -16
  299. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -3
  300. package/modern/components/columnSelection/GridHeaderCheckbox.js +4 -5
  301. package/modern/components/containers/GridFooterContainer.js +11 -2
  302. package/modern/components/containers/GridToolbarContainer.js +12 -2
  303. package/modern/components/panel/GridPanelContent.js +13 -2
  304. package/modern/components/panel/GridPanelFooter.js +13 -2
  305. package/modern/components/panel/GridPanelHeader.js +13 -2
  306. package/modern/components/toolbar/GridToolbar.js +30 -7
  307. package/modern/components/toolbar/GridToolbarExport.js +15 -20
  308. package/modern/components/toolbar/GridToolbarQuickFilter.js +86 -0
  309. package/modern/components/toolbar/index.js +3 -2
  310. package/modern/constants/localeTextConstants.js +5 -0
  311. package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
  312. package/modern/hooks/core/useGridApiInitialization.js +3 -3
  313. package/modern/hooks/core/useGridErrorHandler.js +1 -2
  314. package/modern/hooks/core/useGridStateInitialization.js +1 -2
  315. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -6
  316. package/modern/hooks/features/columnMenu/useGridColumnMenu.js +3 -4
  317. package/modern/hooks/features/columns/useGridColumnSpanning.js +1 -2
  318. package/modern/hooks/features/columns/useGridColumns.js +8 -9
  319. package/modern/hooks/features/dimensions/useGridDimensions.js +8 -9
  320. package/modern/hooks/features/editRows/useGridCellEditing.new.js +131 -32
  321. package/modern/hooks/features/editRows/useGridCellEditing.old.js +20 -21
  322. package/modern/hooks/features/editRows/useGridEditing.old.js +4 -5
  323. package/modern/hooks/features/editRows/useGridRowEditing.new.js +120 -42
  324. package/modern/hooks/features/editRows/useGridRowEditing.old.js +21 -22
  325. package/modern/hooks/features/events/useGridEvents.js +17 -18
  326. package/modern/hooks/features/export/serializers/csvSerializer.js +5 -5
  327. package/modern/hooks/features/export/useGridCsvExport.js +21 -16
  328. package/modern/hooks/features/export/useGridPrintExport.js +20 -0
  329. package/modern/hooks/features/export/utils.js +13 -0
  330. package/modern/hooks/features/filter/gridFilterState.js +3 -1
  331. package/modern/hooks/features/filter/gridFilterUtils.js +80 -2
  332. package/modern/hooks/features/filter/useGridFilter.js +20 -8
  333. package/modern/hooks/features/focus/useGridFocus.js +29 -33
  334. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -5
  335. package/modern/hooks/features/pagination/useGridPage.js +3 -4
  336. package/modern/hooks/features/pagination/useGridPageSize.js +2 -3
  337. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
  338. package/modern/hooks/features/rows/gridRowsSelector.js +1 -0
  339. package/modern/hooks/features/rows/gridRowsUtils.js +23 -1
  340. package/modern/hooks/features/rows/useGridRows.js +100 -60
  341. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
  342. package/modern/hooks/features/scroll/useGridScroll.js +6 -1
  343. package/modern/hooks/features/selection/useGridSelection.js +13 -10
  344. package/modern/hooks/features/sorting/useGridSorting.js +8 -9
  345. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +6 -7
  346. package/modern/hooks/utils/useGridApiEventHandler.js +20 -9
  347. package/modern/hooks/utils/useGridNativeEventListener.js +1 -2
  348. package/modern/hooks/utils/useGridSelector.js +1 -1
  349. package/modern/index.js +1 -1
  350. package/modern/internals/index.js +5 -2
  351. package/modern/locales/arSD.js +5 -0
  352. package/modern/locales/bgBG.js +5 -0
  353. package/modern/locales/csCZ.js +5 -0
  354. package/modern/locales/daDK.js +5 -0
  355. package/modern/locales/deDE.js +10 -5
  356. package/modern/locales/elGR.js +5 -0
  357. package/modern/locales/esES.js +5 -0
  358. package/modern/locales/faIR.js +5 -0
  359. package/modern/locales/fiFI.js +5 -0
  360. package/modern/locales/frFR.js +5 -0
  361. package/modern/locales/heIL.js +5 -0
  362. package/modern/locales/huHU.js +5 -0
  363. package/modern/locales/itIT.js +5 -0
  364. package/modern/locales/jaJP.js +5 -0
  365. package/modern/locales/koKR.js +5 -0
  366. package/modern/locales/nlNL.js +5 -0
  367. package/modern/locales/plPL.js +5 -0
  368. package/modern/locales/ptBR.js +5 -0
  369. package/modern/locales/ruRU.js +5 -0
  370. package/modern/locales/skSK.js +5 -0
  371. package/modern/locales/trTR.js +5 -0
  372. package/modern/locales/ukUA.js +5 -0
  373. package/modern/locales/viVN.js +5 -0
  374. package/modern/locales/zhCN.js +5 -0
  375. package/modern/models/events/gridEvents.js +2 -0
  376. package/modern/models/index.js +4 -3
  377. package/modern/utils/createSelector.js +20 -2
  378. package/modern/utils/exportAs.js +1 -1
  379. package/node/DataGrid/DataGrid.js +35 -1
  380. package/node/DataGrid/useDataGridProps.js +2 -1
  381. package/node/colDef/gridActionsColDef.js +2 -1
  382. package/node/colDef/gridBooleanColDef.js +2 -1
  383. package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
  384. package/node/colDef/gridDateColDef.js +4 -2
  385. package/node/colDef/gridNumericColDef.js +2 -1
  386. package/node/colDef/gridNumericOperators.js +15 -1
  387. package/node/colDef/gridSingleSelectColDef.js +2 -1
  388. package/node/colDef/gridSingleSelectOperators.js +56 -1
  389. package/node/colDef/gridStringColDef.js +2 -1
  390. package/node/colDef/gridStringOperators.js +16 -1
  391. package/node/components/GridFooter.js +10 -1
  392. package/node/components/GridRow.js +4 -6
  393. package/node/components/GridRowCount.js +1 -0
  394. package/node/components/GridScrollArea.js +3 -5
  395. package/node/components/GridSelectedRowCount.js +2 -1
  396. package/node/components/base/GridBody.js +1 -3
  397. package/node/components/base/GridOverlays.js +1 -3
  398. package/node/components/cell/GridActionsCell.js +13 -4
  399. package/node/components/cell/GridCell.js +7 -7
  400. package/node/components/cell/GridEditBooleanCell.js +100 -5
  401. package/node/components/cell/GridEditDateCell.js +98 -4
  402. package/node/components/cell/GridEditInputCell.js +29 -5
  403. package/node/components/cell/GridEditSingleSelectCell.js +28 -6
  404. package/node/components/cell/index.js +26 -0
  405. package/node/components/columnHeaders/GridColumnHeaderItem.js +15 -17
  406. package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -4
  407. package/node/components/columnSelection/GridHeaderCheckbox.js +4 -6
  408. package/node/components/containers/GridFooterContainer.js +10 -1
  409. package/node/components/containers/GridToolbarContainer.js +11 -1
  410. package/node/components/panel/GridPanelContent.js +11 -1
  411. package/node/components/panel/GridPanelFooter.js +11 -1
  412. package/node/components/panel/GridPanelHeader.js +11 -1
  413. package/node/components/toolbar/GridToolbar.js +32 -7
  414. package/node/components/toolbar/GridToolbarExport.js +14 -19
  415. package/node/components/toolbar/GridToolbarQuickFilter.js +111 -0
  416. package/node/components/toolbar/index.js +42 -11
  417. package/node/constants/localeTextConstants.js +5 -0
  418. package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -8
  419. package/node/hooks/core/useGridApiInitialization.js +3 -4
  420. package/node/hooks/core/useGridErrorHandler.js +1 -3
  421. package/node/hooks/core/useGridStateInitialization.js +1 -3
  422. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -7
  423. package/node/hooks/features/columnMenu/useGridColumnMenu.js +3 -5
  424. package/node/hooks/features/columns/useGridColumnSpanning.js +1 -3
  425. package/node/hooks/features/columns/useGridColumns.js +8 -10
  426. package/node/hooks/features/dimensions/useGridDimensions.js +8 -10
  427. package/node/hooks/features/editRows/useGridCellEditing.new.js +133 -32
  428. package/node/hooks/features/editRows/useGridCellEditing.old.js +20 -22
  429. package/node/hooks/features/editRows/useGridEditing.old.js +4 -6
  430. package/node/hooks/features/editRows/useGridRowEditing.new.js +122 -43
  431. package/node/hooks/features/editRows/useGridRowEditing.old.js +21 -23
  432. package/node/hooks/features/events/useGridEvents.js +17 -19
  433. package/node/hooks/features/export/serializers/csvSerializer.js +5 -5
  434. package/node/hooks/features/export/useGridCsvExport.js +26 -17
  435. package/node/hooks/features/export/useGridPrintExport.js +25 -0
  436. package/node/hooks/features/export/utils.js +19 -2
  437. package/node/hooks/features/filter/gridFilterState.js +3 -1
  438. package/node/hooks/features/filter/gridFilterUtils.js +92 -3
  439. package/node/hooks/features/filter/useGridFilter.js +21 -9
  440. package/node/hooks/features/focus/useGridFocus.js +29 -34
  441. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -6
  442. package/node/hooks/features/pagination/useGridPage.js +3 -5
  443. package/node/hooks/features/pagination/useGridPageSize.js +2 -4
  444. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -8
  445. package/node/hooks/features/rows/gridRowsSelector.js +3 -1
  446. package/node/hooks/features/rows/gridRowsUtils.js +29 -1
  447. package/node/hooks/features/rows/useGridRows.js +101 -60
  448. package/node/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
  449. package/node/hooks/features/scroll/useGridScroll.js +6 -1
  450. package/node/hooks/features/selection/useGridSelection.js +13 -11
  451. package/node/hooks/features/sorting/useGridSorting.js +8 -10
  452. package/node/hooks/features/virtualization/useGridVirtualScroller.js +6 -8
  453. package/node/hooks/utils/useGridApiEventHandler.js +22 -10
  454. package/node/hooks/utils/useGridNativeEventListener.js +1 -3
  455. package/node/hooks/utils/useGridSelector.js +1 -1
  456. package/node/index.js +1 -1
  457. package/node/internals/index.js +39 -3
  458. package/node/locales/arSD.js +5 -0
  459. package/node/locales/bgBG.js +5 -0
  460. package/node/locales/csCZ.js +5 -0
  461. package/node/locales/daDK.js +5 -0
  462. package/node/locales/deDE.js +10 -5
  463. package/node/locales/elGR.js +5 -0
  464. package/node/locales/esES.js +5 -0
  465. package/node/locales/faIR.js +5 -0
  466. package/node/locales/fiFI.js +5 -0
  467. package/node/locales/frFR.js +5 -0
  468. package/node/locales/heIL.js +5 -0
  469. package/node/locales/huHU.js +5 -0
  470. package/node/locales/itIT.js +5 -0
  471. package/node/locales/jaJP.js +5 -0
  472. package/node/locales/koKR.js +5 -0
  473. package/node/locales/nlNL.js +5 -0
  474. package/node/locales/plPL.js +5 -0
  475. package/node/locales/ptBR.js +5 -0
  476. package/node/locales/ruRU.js +5 -0
  477. package/node/locales/skSK.js +5 -0
  478. package/node/locales/trTR.js +5 -0
  479. package/node/locales/ukUA.js +5 -0
  480. package/node/locales/viVN.js +5 -0
  481. package/node/locales/zhCN.js +5 -0
  482. package/node/models/events/gridEvents.js +2 -0
  483. package/node/models/index.js +0 -13
  484. package/node/utils/createSelector.js +25 -4
  485. package/node/utils/exportAs.js +1 -1
  486. package/package.json +1 -1
  487. package/utils/createSelector.d.ts +2 -1
  488. package/utils/createSelector.js +20 -2
  489. package/utils/exportAs.d.ts +2 -2
  490. package/utils/exportAs.js +1 -1
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { GridEvents } from '../../models/events';
4
3
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
5
4
  import { GridMainContainer } from '../containers/GridMainContainer';
6
5
  import { GridAutoSizer } from '../GridAutoSizer';
@@ -46,7 +45,7 @@ function GridBody(props) {
46
45
  apiRef.current.renderingZoneRef = renderingZoneRef; // TODO remove, nobody should have access to internal parts of the virtualization
47
46
 
48
47
  const handleResize = React.useCallback(size => {
49
- apiRef.current.publishEvent(GridEvents.resize, size);
48
+ apiRef.current.publishEvent('resize', size);
50
49
  }, [apiRef]);
51
50
  return /*#__PURE__*/_jsxs(GridMainContainer, {
52
51
  children: [/*#__PURE__*/_jsx(GridOverlays, {}), /*#__PURE__*/_jsx(ColumnHeadersComponent, {
@@ -7,7 +7,6 @@ import { gridRowCountSelector, gridRowsLoadingSelector } from '../../hooks/featu
7
7
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
8
8
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
9
9
  import { gridDensityHeaderHeightSelector } from '../../hooks/features/density/densitySelector';
10
- import { GridEvents } from '../../models/events';
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
 
13
12
  function GridOverlayWrapper(props) {
@@ -19,7 +18,7 @@ function GridOverlayWrapper(props) {
19
18
  setViewportInnerSize(apiRef.current.getRootDimensions()?.viewportInnerSize ?? null);
20
19
  }, [apiRef]);
21
20
  useEnhancedEffect(() => {
22
- return apiRef.current.subscribeEvent(GridEvents.viewportInnerSizeChange, handleViewportSizeChange);
21
+ return apiRef.current.subscribeEvent('viewportInnerSizeChange', handleViewportSizeChange);
23
22
  }, [apiRef, handleViewportSizeChange]);
24
23
  let height = viewportInnerSize?.height ?? 0;
25
24
 
@@ -46,10 +46,16 @@ const GridActionsCell = props => {
46
46
  }
47
47
  }, [hasFocus]);
48
48
  React.useEffect(() => {
49
- if (focusedButtonIndex >= 0) {
50
- const child = rootRef.current?.children[focusedButtonIndex];
51
- child.focus();
49
+ if (focusedButtonIndex < 0 || !rootRef.current) {
50
+ return;
51
+ }
52
+
53
+ if (focusedButtonIndex >= rootRef.current.children.length) {
54
+ return;
52
55
  }
56
+
57
+ const child = rootRef.current.children[focusedButtonIndex];
58
+ child.focus();
53
59
  }, [focusedButtonIndex]);
54
60
  React.useEffect(() => {
55
61
  if (!hasFocus) {
@@ -75,6 +81,11 @@ const GridActionsCell = props => {
75
81
  const iconButtons = options.filter(option => !option.props.showInMenu);
76
82
  const menuButtons = options.filter(option => option.props.showInMenu);
77
83
  const numberOfButtons = iconButtons.length + (menuButtons.length ? 1 : 0);
84
+ React.useEffect(() => {
85
+ if (focusedButtonIndex >= numberOfButtons) {
86
+ setFocusedButtonIndex(numberOfButtons - 1);
87
+ }
88
+ }, [focusedButtonIndex, numberOfButtons]);
78
89
 
79
90
  const showMenu = () => {
80
91
  setOpen(true);
@@ -9,7 +9,7 @@ import clsx from 'clsx';
9
9
  import { unstable_composeClasses as composeClasses } from '@mui/material';
10
10
  import { ownerDocument, capitalize } from '@mui/material/utils';
11
11
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
12
- import { GridEvents, GridCellModes } from '../../models';
12
+ import { GridCellModes } from '../../models';
13
13
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
14
14
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
15
15
  import { gridFocusCellSelector } from '../../hooks/features/focus/gridFocusStateSelector';
@@ -192,13 +192,13 @@ function GridCell(props) {
192
192
  "aria-colspan": colSpan,
193
193
  style: style,
194
194
  tabIndex: (cellMode === 'view' || !isEditable) && !managesOwnFocus ? tabIndex : -1,
195
- onClick: publish(GridEvents.cellClick, onClick),
196
- onDoubleClick: publish(GridEvents.cellDoubleClick, onDoubleClick),
197
- onMouseDown: publish(GridEvents.cellMouseDown, onMouseDown),
198
- onMouseUp: publishMouseUp(GridEvents.cellMouseUp),
199
- onKeyDown: publish(GridEvents.cellKeyDown, onKeyDown),
200
- onDragEnter: publish(GridEvents.cellDragEnter, onDragEnter),
201
- onDragOver: publish(GridEvents.cellDragOver, onDragOver)
195
+ onClick: publish('cellClick', onClick),
196
+ onDoubleClick: publish('cellDoubleClick', onDoubleClick),
197
+ onMouseDown: publish('cellMouseDown', onMouseDown),
198
+ onMouseUp: publishMouseUp('cellMouseUp'),
199
+ onKeyDown: publish('cellKeyDown', onKeyDown),
200
+ onDragEnter: publish('cellDragEnter', onDragEnter),
201
+ onDragOver: publish('cellDragOver', onDragOver)
202
202
  }, other, {
203
203
  onFocus: handleFocus,
204
204
  children: renderChildren()
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error"];
3
+ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
4
4
  import * as React from 'react';
5
+ import PropTypes from 'prop-types';
5
6
  import clsx from 'clsx';
6
7
  import { unstable_composeClasses as composeClasses } from '@mui/material';
7
8
  import { unstable_useId as useId, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
@@ -19,14 +20,15 @@ const useUtilityClasses = ownerState => {
19
20
  return composeClasses(slots, getDataGridUtilityClass, classes);
20
21
  };
21
22
 
22
- export function GridEditBooleanCell(props) {
23
+ function GridEditBooleanCell(props) {
23
24
  const {
24
25
  id: idProp,
25
26
  value,
26
27
  api,
27
28
  field,
28
29
  className,
29
- hasFocus
30
+ hasFocus,
31
+ onValueChange
30
32
  } = props,
31
33
  other = _objectWithoutPropertiesLoose(props, _excluded);
32
34
 
@@ -38,15 +40,20 @@ export function GridEditBooleanCell(props) {
38
40
  classes: rootProps.classes
39
41
  };
40
42
  const classes = useUtilityClasses(ownerState);
41
- const handleChange = React.useCallback(event => {
43
+ const handleChange = React.useCallback(async event => {
42
44
  const newValue = event.target.checked;
45
+
46
+ if (onValueChange) {
47
+ await onValueChange(event, newValue);
48
+ }
49
+
43
50
  setValueState(newValue);
44
- api.setEditCellValue({
51
+ await api.setEditCellValue({
45
52
  id: idProp,
46
53
  field,
47
54
  value: newValue
48
55
  }, event);
49
- }, [api, field, idProp]);
56
+ }, [api, field, idProp, onValueChange]);
50
57
  React.useEffect(() => {
51
58
  setValueState(value);
52
59
  }, [value]);
@@ -68,4 +75,92 @@ export function GridEditBooleanCell(props) {
68
75
  }, rootProps.componentsProps?.baseCheckbox))
69
76
  }));
70
77
  }
78
+
79
+ process.env.NODE_ENV !== "production" ? GridEditBooleanCell.propTypes = {
80
+ // ----------------------------- Warning --------------------------------
81
+ // | These PropTypes are generated from the TypeScript type definitions |
82
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
83
+ // ----------------------------------------------------------------------
84
+
85
+ /**
86
+ * GridApi that let you manipulate the grid.
87
+ * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
88
+ */
89
+ api: PropTypes.any.isRequired,
90
+
91
+ /**
92
+ * The mode of the cell.
93
+ */
94
+ cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
95
+
96
+ /**
97
+ * The column of the row that the current cell belongs to.
98
+ */
99
+ colDef: PropTypes.object.isRequired,
100
+
101
+ /**
102
+ * The column field of the cell that triggered the event.
103
+ */
104
+ field: PropTypes.string.isRequired,
105
+
106
+ /**
107
+ * The cell value formatted with the column valueFormatter.
108
+ */
109
+ formattedValue: PropTypes.any,
110
+
111
+ /**
112
+ * Get the cell value of a row and field.
113
+ * @param {GridRowId} id The row id.
114
+ * @param {string} field The field.
115
+ * @returns {any} The cell value.
116
+ * @deprecated Use `params.row` to directly access the fields you want instead.
117
+ */
118
+ getValue: PropTypes.func.isRequired,
119
+
120
+ /**
121
+ * If true, the cell is the active element.
122
+ */
123
+ hasFocus: PropTypes.bool.isRequired,
124
+
125
+ /**
126
+ * The grid row id.
127
+ */
128
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
129
+
130
+ /**
131
+ * If true, the cell is editable.
132
+ */
133
+ isEditable: PropTypes.bool,
134
+ isProcessingProps: PropTypes.bool,
135
+ isValidating: PropTypes.bool,
136
+
137
+ /**
138
+ * Callback called when the value is changed by the user.
139
+ * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
140
+ * @param {boolean} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
141
+ * @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
142
+ */
143
+ onValueChange: PropTypes.func,
144
+
145
+ /**
146
+ * The row model of the row that the current cell belongs to.
147
+ */
148
+ row: PropTypes.object.isRequired,
149
+
150
+ /**
151
+ * The node of the row that the current cell belongs to.
152
+ */
153
+ rowNode: PropTypes.object.isRequired,
154
+
155
+ /**
156
+ * the tabIndex value.
157
+ */
158
+ tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
159
+
160
+ /**
161
+ * The cell value, but if the column has valueGetter, use getValue.
162
+ */
163
+ value: PropTypes.any
164
+ } : void 0;
165
+ export { GridEditBooleanCell };
71
166
  export const renderEditBooleanCell = params => /*#__PURE__*/_jsx(GridEditBooleanCell, _extends({}, params));
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "inputProps", "isValidating", "isProcessingProps"];
3
+ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "inputProps", "isValidating", "isProcessingProps", "onValueChange"];
4
4
  import * as React from 'react';
5
+ import PropTypes from 'prop-types';
5
6
  import { unstable_composeClasses as composeClasses } from '@mui/material';
6
7
  import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
7
8
  import InputBase from '@mui/material/InputBase';
@@ -19,7 +20,7 @@ const useUtilityClasses = ownerState => {
19
20
  return composeClasses(slots, getDataGridUtilityClass, classes);
20
21
  };
21
22
 
22
- export function GridEditDateCell(props) {
23
+ function GridEditDateCell(props) {
23
24
  const {
24
25
  id,
25
26
  value: valueProp,
@@ -27,7 +28,8 @@ export function GridEditDateCell(props) {
27
28
  field,
28
29
  colDef,
29
30
  hasFocus,
30
- inputProps
31
+ inputProps,
32
+ onValueChange
31
33
  } = props,
32
34
  other = _objectWithoutPropertiesLoose(props, _excluded);
33
35
 
@@ -64,7 +66,7 @@ export function GridEditDateCell(props) {
64
66
  classes: rootProps.classes
65
67
  };
66
68
  const classes = useUtilityClasses(ownerState);
67
- const handleChange = React.useCallback(event => {
69
+ const handleChange = React.useCallback(async event => {
68
70
  const newFormattedDate = event.target.value;
69
71
  let newParsedDate;
70
72
 
@@ -83,6 +85,10 @@ export function GridEditDateCell(props) {
83
85
  }
84
86
  }
85
87
 
88
+ if (onValueChange) {
89
+ await onValueChange(event, newParsedDate);
90
+ }
91
+
86
92
  setValueState({
87
93
  parsed: newParsedDate,
88
94
  formatted: newFormattedDate
@@ -92,7 +98,7 @@ export function GridEditDateCell(props) {
92
98
  field,
93
99
  value: newParsedDate
94
100
  }, event);
95
- }, [api, field, id]);
101
+ }, [api, field, id, onValueChange]);
96
102
  React.useEffect(() => {
97
103
  setValueState(state => {
98
104
  if (valueTransformed.parsed !== state.parsed && valueTransformed.parsed?.getTime() !== state.parsed?.getTime()) {
@@ -119,4 +125,92 @@ export function GridEditDateCell(props) {
119
125
  onChange: handleChange
120
126
  }, other));
121
127
  }
128
+
129
+ process.env.NODE_ENV !== "production" ? GridEditDateCell.propTypes = {
130
+ // ----------------------------- Warning --------------------------------
131
+ // | These PropTypes are generated from the TypeScript type definitions |
132
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
133
+ // ----------------------------------------------------------------------
134
+
135
+ /**
136
+ * GridApi that let you manipulate the grid.
137
+ * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
138
+ */
139
+ api: PropTypes.any.isRequired,
140
+
141
+ /**
142
+ * The mode of the cell.
143
+ */
144
+ cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
145
+
146
+ /**
147
+ * The column of the row that the current cell belongs to.
148
+ */
149
+ colDef: PropTypes.object.isRequired,
150
+
151
+ /**
152
+ * The column field of the cell that triggered the event.
153
+ */
154
+ field: PropTypes.string.isRequired,
155
+
156
+ /**
157
+ * The cell value formatted with the column valueFormatter.
158
+ */
159
+ formattedValue: PropTypes.any,
160
+
161
+ /**
162
+ * Get the cell value of a row and field.
163
+ * @param {GridRowId} id The row id.
164
+ * @param {string} field The field.
165
+ * @returns {any} The cell value.
166
+ * @deprecated Use `params.row` to directly access the fields you want instead.
167
+ */
168
+ getValue: PropTypes.func.isRequired,
169
+
170
+ /**
171
+ * If true, the cell is the active element.
172
+ */
173
+ hasFocus: PropTypes.bool.isRequired,
174
+
175
+ /**
176
+ * The grid row id.
177
+ */
178
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
179
+
180
+ /**
181
+ * If true, the cell is editable.
182
+ */
183
+ isEditable: PropTypes.bool,
184
+ isProcessingProps: PropTypes.bool,
185
+ isValidating: PropTypes.bool,
186
+
187
+ /**
188
+ * Callback called when the value is changed by the user.
189
+ * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
190
+ * @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
191
+ * @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
192
+ */
193
+ onValueChange: PropTypes.func,
194
+
195
+ /**
196
+ * The row model of the row that the current cell belongs to.
197
+ */
198
+ row: PropTypes.object.isRequired,
199
+
200
+ /**
201
+ * The node of the row that the current cell belongs to.
202
+ */
203
+ rowNode: PropTypes.object.isRequired,
204
+
205
+ /**
206
+ * the tabIndex value.
207
+ */
208
+ tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
209
+
210
+ /**
211
+ * The cell value, but if the column has valueGetter, use getValue.
212
+ */
213
+ value: PropTypes.any
214
+ } : void 0;
215
+ export { GridEditDateCell };
122
216
  export const renderEditDateCell = params => /*#__PURE__*/_jsx(GridEditDateCell, _extends({}, params));
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "isValidating", "debounceMs", "isProcessingProps"];
3
+ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/material';
@@ -48,7 +48,8 @@ function GridEditInputCell(props) {
48
48
  colDef,
49
49
  hasFocus,
50
50
  debounceMs = rootProps.experimentalFeatures?.newEditingApi ? 200 : SUBMIT_FILTER_STROKE_TIME,
51
- isProcessingProps
51
+ isProcessingProps,
52
+ onValueChange
52
53
  } = props,
53
54
  other = _objectWithoutPropertiesLoose(props, _excluded);
54
55
 
@@ -58,8 +59,13 @@ function GridEditInputCell(props) {
58
59
  classes: rootProps.classes
59
60
  };
60
61
  const classes = useUtilityClasses(ownerState);
61
- const handleChange = React.useCallback(event => {
62
+ const handleChange = React.useCallback(async event => {
62
63
  const newValue = event.target.value;
64
+
65
+ if (onValueChange) {
66
+ await onValueChange(event, newValue);
67
+ }
68
+
63
69
  setValueState(newValue);
64
70
  api.setEditCellValue({
65
71
  id,
@@ -67,7 +73,7 @@ function GridEditInputCell(props) {
67
73
  value: newValue,
68
74
  debounceMs
69
75
  }, event);
70
- }, [api, debounceMs, field, id]);
76
+ }, [api, debounceMs, field, id, onValueChange]);
71
77
  React.useEffect(() => {
72
78
  setValueState(value);
73
79
  }, [value]);
@@ -146,6 +152,14 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
146
152
  isProcessingProps: PropTypes.bool,
147
153
  isValidating: PropTypes.bool,
148
154
 
155
+ /**
156
+ * Callback called when the value is changed by the user.
157
+ * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
158
+ * @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
159
+ * @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
160
+ */
161
+ onValueChange: PropTypes.func,
162
+
149
163
  /**
150
164
  * The row model of the row that the current cell belongs to.
151
165
  */
@@ -154,7 +168,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
154
168
  /**
155
169
  * The node of the row that the current cell belongs to.
156
170
  */
157
- rowNode: PropTypes.object.isRequired
171
+ rowNode: PropTypes.object.isRequired,
172
+
173
+ /**
174
+ * the tabIndex value.
175
+ */
176
+ tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
177
+
178
+ /**
179
+ * The cell value, but if the column has valueGetter, use getValue.
180
+ */
181
+ value: PropTypes.any
158
182
  } : void 0;
159
183
  export { GridEditInputCell };
160
184
  export const renderEditInputCell = params => /*#__PURE__*/_jsx(GridEditInputCell, _extends({}, params));
@@ -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 = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error"];
3
+ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
@@ -8,7 +8,6 @@ import MenuItem from '@mui/material/MenuItem';
8
8
  import { isEscapeKey } from '../../utils/keyboardUtils';
9
9
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
10
10
  import { GridEditModes } from '../../models/gridEditRowModel';
11
- import { GridEvents } from '../../models/events/gridEvents';
12
11
  import { getValueFromValueOptions } from '../panel/filterPanel/filterPanelUtils';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
13
 
@@ -32,7 +31,8 @@ function GridEditSingleSelectCell(props) {
32
31
  row,
33
32
  colDef,
34
33
  hasFocus,
35
- error
34
+ error,
35
+ onValueChange
36
36
  } = props,
37
37
  other = _objectWithoutPropertiesLoose(props, _excluded);
38
38
 
@@ -77,6 +77,11 @@ function GridEditSingleSelectCell(props) {
77
77
  const target = event.target; // NativeSelect casts the value to a string.
78
78
 
79
79
  const formattedTargetValue = getValueFromValueOptions(target.value, valueOptionsFormatted);
80
+
81
+ if (onValueChange) {
82
+ await onValueChange(event, formattedTargetValue);
83
+ }
84
+
80
85
  const isValid = await api.setEditCellValue({
81
86
  id,
82
87
  field,
@@ -103,7 +108,7 @@ function GridEditSingleSelectCell(props) {
103
108
  if (event.key) {
104
109
  // TODO v6: remove once we stop ignoring events fired from portals
105
110
  const params = api.getCellParams(id, field);
106
- api.publishEvent(GridEvents.cellNavigationKeyDown, params, event);
111
+ api.publishEvent('cellNavigationKeyDown', params, event);
107
112
  }
108
113
  }
109
114
  };
@@ -212,6 +217,14 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
212
217
  isProcessingProps: PropTypes.bool,
213
218
  isValidating: PropTypes.bool,
214
219
 
220
+ /**
221
+ * Callback called when the value is changed by the user.
222
+ * @param {SelectChangeEvent<any>} event The event source of the callback.
223
+ * @param {any} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
224
+ * @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
225
+ */
226
+ onValueChange: PropTypes.func,
227
+
215
228
  /**
216
229
  * The row model of the row that the current cell belongs to.
217
230
  */
@@ -220,7 +233,17 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
220
233
  /**
221
234
  * The node of the row that the current cell belongs to.
222
235
  */
223
- rowNode: PropTypes.object.isRequired
236
+ rowNode: PropTypes.object.isRequired,
237
+
238
+ /**
239
+ * the tabIndex value.
240
+ */
241
+ tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
242
+
243
+ /**
244
+ * The cell value, but if the column has valueGetter, use getValue.
245
+ */
246
+ value: PropTypes.any
224
247
  } : void 0;
225
248
  export { GridEditSingleSelectCell };
226
249
  export const renderEditSingleSelectCell = params => /*#__PURE__*/_jsx(GridEditSingleSelectCell, _extends({}, params));
@@ -1,4 +1,6 @@
1
1
  export * from './GridCell';
2
+ export * from './GridEditBooleanCell';
3
+ export * from './GridEditDateCell';
2
4
  export * from './GridEditInputCell';
3
5
  export * from './GridEditSingleSelectCell';
4
6
  export * from './GridActionsCell';
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
4
4
  import clsx from 'clsx';
5
5
  import { unstable_composeClasses as composeClasses } from '@mui/material';
6
6
  import { unstable_useId as useId } from '@mui/material/utils';
7
- import { GridEvents } from '../../models/events';
8
7
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
9
8
  import { GridColumnHeaderSortIcon } from './GridColumnHeaderSortIcon';
10
9
  import { GridColumnHeaderTitle } from './GridColumnHeaderTitle';
@@ -85,25 +84,25 @@ function GridColumnHeaderItem(props) {
85
84
  apiRef.current.publishEvent(eventName, apiRef.current.getColumnHeaderParams(column.field), event);
86
85
  }, [apiRef, column.field]);
87
86
  const mouseEventsHandlers = {
88
- onClick: publish(GridEvents.columnHeaderClick),
89
- onDoubleClick: publish(GridEvents.columnHeaderDoubleClick),
90
- onMouseOver: publish(GridEvents.columnHeaderOver),
87
+ onClick: publish('columnHeaderClick'),
88
+ onDoubleClick: publish('columnHeaderDoubleClick'),
89
+ onMouseOver: publish('columnHeaderOver'),
91
90
  // TODO remove as it's not used
92
- onMouseOut: publish(GridEvents.columnHeaderOut),
91
+ onMouseOut: publish('columnHeaderOut'),
93
92
  // TODO remove as it's not used
94
- onMouseEnter: publish(GridEvents.columnHeaderEnter),
93
+ onMouseEnter: publish('columnHeaderEnter'),
95
94
  // TODO remove as it's not used
96
- onMouseLeave: publish(GridEvents.columnHeaderLeave),
95
+ onMouseLeave: publish('columnHeaderLeave'),
97
96
  // TODO remove as it's not used
98
- onKeyDown: publish(GridEvents.columnHeaderKeyDown),
99
- onFocus: publish(GridEvents.columnHeaderFocus),
100
- onBlur: publish(GridEvents.columnHeaderBlur)
97
+ onKeyDown: publish('columnHeaderKeyDown'),
98
+ onFocus: publish('columnHeaderFocus'),
99
+ onBlur: publish('columnHeaderBlur')
101
100
  };
102
101
  const draggableEventHandlers = {
103
- onDragStart: publish(GridEvents.columnHeaderDragStart),
104
- onDragEnter: publish(GridEvents.columnHeaderDragEnter),
105
- onDragOver: publish(GridEvents.columnHeaderDragOver),
106
- onDragEnd: publish(GridEvents.columnHeaderDragEnd)
102
+ onDragStart: publish('columnHeaderDragStart'),
103
+ onDragEnter: publish('columnHeaderDragEnter'),
104
+ onDragOver: publish('columnHeaderDragOver'),
105
+ onDragEnd: publish('columnHeaderDragEnd')
107
106
  };
108
107
  const removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY;
109
108
  const showRightBorder = !isLastColumn ? rootProps.showColumnRightBorder : !removeLastBorderRight && !extendRowFullWidth;
@@ -115,7 +114,7 @@ function GridColumnHeaderItem(props) {
115
114
 
116
115
  const classes = useUtilityClasses(ownerState);
117
116
  const width = column.computedWidth;
118
- let ariaSort;
117
+ let ariaSort = 'none';
119
118
 
120
119
  if (sortDirection != null) {
121
120
  ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
@@ -198,7 +197,7 @@ function GridColumnHeaderItem(props) {
198
197
  resizable: !rootProps.disableColumnResize && !!column.resizable,
199
198
  resizing: isResizing,
200
199
  height: headerHeight,
201
- onMouseDown: publish(GridEvents.columnSeparatorMouseDown),
200
+ onMouseDown: publish('columnSeparatorMouseDown'),
202
201
  side: separatorSide
203
202
  }), /*#__PURE__*/_jsx(GridColumnHeaderMenu, {
204
203
  columnMenuId: columnMenuId,
@@ -5,7 +5,6 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/material';
7
7
  import { useForkRef } from '@mui/material/utils';
8
- import { GridEvents } from '../../models/events';
9
8
  import { isNavigationKey, isSpaceKey } from '../../utils/keyboardUtils';
10
9
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
11
10
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
@@ -48,7 +47,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
48
47
  value: event.target.checked,
49
48
  id
50
49
  };
51
- apiRef.current.publishEvent(GridEvents.rowSelectionCheckboxChange, params, event);
50
+ apiRef.current.publishEvent('rowSelectionCheckboxChange', params, event);
52
51
  };
53
52
 
54
53
  React.useLayoutEffect(() => {
@@ -71,7 +70,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
71
70
  }
72
71
 
73
72
  if (isNavigationKey(event.key) && !event.shiftKey) {
74
- apiRef.current.publishEvent(GridEvents.cellNavigationKeyDown, props, event);
73
+ apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
75
74
  }
76
75
  }, [apiRef, props]);
77
76
  const isSelectable = !rootProps.isRowSelectable || rootProps.isRowSelectable(apiRef.current.getRowParams(id));