@mui/x-data-grid 5.11.1 → 5.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/CHANGELOG.md +199 -20
  2. package/DataGrid/DataGrid.js +26 -1
  3. package/README.md +2 -2
  4. package/colDef/gridCheckboxSelectionColDef.d.ts +1 -0
  5. package/colDef/gridCheckboxSelectionColDef.js +2 -1
  6. package/colDef/gridDateOperators.d.ts +1 -1
  7. package/colDef/gridNumericColDef.js +1 -1
  8. package/components/GridRow.d.ts +1 -1
  9. package/components/GridRow.js +51 -12
  10. package/components/cell/GridActionsCellItem.d.ts +1 -1
  11. package/components/cell/GridCell.d.ts +2 -1
  12. package/components/cell/GridCell.js +12 -7
  13. package/components/columnHeaders/GridColumnHeaderItem.js +9 -6
  14. package/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
  15. package/components/columnSelection/GridHeaderCheckbox.js +0 -1
  16. package/components/containers/GridRootStyles.js +8 -3
  17. package/components/menu/GridMenu.js +9 -2
  18. package/components/panel/GridColumnsPanel.js +12 -7
  19. package/components/panel/GridPanelWrapper.d.ts +1 -1
  20. package/components/panel/GridPanelWrapper.js +3 -3
  21. package/components/panel/filterPanel/GridFilterForm.d.ts +61 -4
  22. package/components/panel/filterPanel/GridFilterForm.js +88 -8
  23. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
  24. package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -5
  25. package/components/panel/filterPanel/GridFilterPanel.js +26 -11
  26. package/components/toolbar/GridToolbarColumnsButton.js +0 -1
  27. package/components/toolbar/GridToolbarDensitySelector.js +0 -1
  28. package/components/toolbar/GridToolbarExportContainer.js +0 -1
  29. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  30. package/components/toolbar/GridToolbarFilterButton.js +0 -1
  31. package/components/toolbar/GridToolbarQuickFilter.d.ts +7 -0
  32. package/components/toolbar/GridToolbarQuickFilter.js +57 -4
  33. package/constants/defaultGridSlotsComponents.js +2 -1
  34. package/constants/gridClasses.d.ts +4 -0
  35. package/constants/gridClasses.js +1 -1
  36. package/constants/localeTextConstants.js +1 -0
  37. package/hooks/core/useGridStateInitialization.js +19 -6
  38. package/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
  39. package/hooks/features/columns/gridColumnsInterfaces.d.ts +3 -0
  40. package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
  41. package/hooks/features/columns/useGridColumnSpanning.js +1 -1
  42. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  43. package/hooks/features/columns/useGridColumns.js +13 -15
  44. package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
  45. package/hooks/features/dimensions/useGridDimensions.js +9 -8
  46. package/hooks/features/editRows/useGridCellEditing.new.js +11 -4
  47. package/hooks/features/editRows/useGridEditing.old.js +1 -1
  48. package/hooks/features/editRows/useGridRowEditing.new.js +10 -4
  49. package/hooks/features/events/useGridEvents.d.ts +1 -1
  50. package/hooks/features/events/useGridEvents.js +2 -0
  51. package/hooks/features/filter/gridFilterSelector.d.ts +5 -0
  52. package/hooks/features/filter/gridFilterSelector.js +6 -0
  53. package/hooks/features/filter/gridFilterState.d.ts +1 -1
  54. package/hooks/features/filter/gridFilterUtils.d.ts +10 -2
  55. package/hooks/features/filter/gridFilterUtils.js +3 -6
  56. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  57. package/hooks/features/filter/useGridFilter.js +29 -12
  58. package/hooks/features/pagination/useGridPage.js +1 -1
  59. package/hooks/features/pagination/useGridPageSize.js +1 -1
  60. package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
  61. package/hooks/features/rows/useGridRowsMeta.js +133 -67
  62. package/hooks/features/selection/useGridSelection.js +1 -1
  63. package/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
  64. package/hooks/features/sorting/useGridSorting.d.ts +1 -1
  65. package/hooks/features/sorting/useGridSorting.js +1 -1
  66. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -1
  67. package/hooks/features/virtualization/useGridVirtualScroller.js +65 -11
  68. package/index.js +1 -1
  69. package/internals/index.d.ts +1 -0
  70. package/legacy/DataGrid/DataGrid.js +26 -1
  71. package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -1
  72. package/legacy/colDef/gridNumericColDef.js +1 -1
  73. package/legacy/components/GridRow.js +56 -12
  74. package/legacy/components/cell/GridCell.js +12 -7
  75. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +11 -6
  76. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
  77. package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -1
  78. package/legacy/components/containers/GridRootStyles.js +10 -7
  79. package/legacy/components/menu/GridMenu.js +9 -2
  80. package/legacy/components/panel/GridColumnsPanel.js +14 -7
  81. package/legacy/components/panel/GridPanelWrapper.js +3 -3
  82. package/legacy/components/panel/filterPanel/GridFilterForm.js +89 -8
  83. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
  84. package/legacy/components/panel/filterPanel/GridFilterPanel.js +28 -12
  85. package/legacy/components/toolbar/GridToolbarColumnsButton.js +0 -1
  86. package/legacy/components/toolbar/GridToolbarDensitySelector.js +0 -1
  87. package/legacy/components/toolbar/GridToolbarExportContainer.js +0 -1
  88. package/legacy/components/toolbar/GridToolbarFilterButton.js +0 -1
  89. package/legacy/components/toolbar/GridToolbarQuickFilter.js +67 -6
  90. package/legacy/constants/defaultGridSlotsComponents.js +2 -1
  91. package/legacy/constants/gridClasses.js +1 -1
  92. package/legacy/constants/localeTextConstants.js +1 -0
  93. package/legacy/hooks/core/useGridStateInitialization.js +18 -6
  94. package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
  95. package/legacy/hooks/features/columns/useGridColumnSpanning.js +1 -1
  96. package/legacy/hooks/features/columns/useGridColumns.js +13 -15
  97. package/legacy/hooks/features/dimensions/useGridDimensions.js +9 -8
  98. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +14 -7
  99. package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
  100. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +10 -4
  101. package/legacy/hooks/features/events/useGridEvents.js +2 -0
  102. package/legacy/hooks/features/filter/gridFilterSelector.js +8 -0
  103. package/legacy/hooks/features/filter/gridFilterUtils.js +4 -7
  104. package/legacy/hooks/features/filter/useGridFilter.js +33 -12
  105. package/legacy/hooks/features/pagination/useGridPage.js +1 -1
  106. package/legacy/hooks/features/pagination/useGridPageSize.js +1 -1
  107. package/legacy/hooks/features/rows/useGridRowsMeta.js +133 -66
  108. package/legacy/hooks/features/selection/useGridSelection.js +1 -1
  109. package/legacy/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
  110. package/legacy/hooks/features/sorting/useGridSorting.js +1 -1
  111. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +84 -26
  112. package/legacy/index.js +1 -1
  113. package/legacy/locales/arSD.js +1 -0
  114. package/legacy/locales/bgBG.js +1 -0
  115. package/legacy/locales/csCZ.js +1 -0
  116. package/legacy/locales/daDK.js +1 -0
  117. package/legacy/locales/deDE.js +1 -0
  118. package/legacy/locales/elGR.js +1 -0
  119. package/legacy/locales/esES.js +1 -0
  120. package/legacy/locales/faIR.js +1 -0
  121. package/legacy/locales/fiFI.js +1 -0
  122. package/legacy/locales/frFR.js +1 -0
  123. package/legacy/locales/heIL.js +10 -9
  124. package/legacy/locales/huHU.js +1 -0
  125. package/legacy/locales/itIT.js +1 -0
  126. package/legacy/locales/jaJP.js +29 -24
  127. package/legacy/locales/koKR.js +1 -0
  128. package/legacy/locales/nbNO.js +128 -0
  129. package/legacy/locales/nlNL.js +1 -0
  130. package/legacy/locales/plPL.js +1 -0
  131. package/legacy/locales/ptBR.js +1 -0
  132. package/legacy/locales/ruRU.js +7 -6
  133. package/legacy/locales/skSK.js +1 -0
  134. package/legacy/locales/trTR.js +8 -7
  135. package/legacy/locales/ukUA.js +1 -0
  136. package/legacy/locales/viVN.js +1 -0
  137. package/legacy/locales/zhCN.js +1 -0
  138. package/legacy/models/events/gridEvents.js +2 -0
  139. package/legacy/models/gridApiCaches.js +1 -0
  140. package/legacy/models/params/gridMenuParams.js +1 -0
  141. package/legacy/models/params/index.js +2 -1
  142. package/locales/arSD.js +1 -0
  143. package/locales/bgBG.js +1 -0
  144. package/locales/csCZ.js +1 -0
  145. package/locales/daDK.js +1 -0
  146. package/locales/deDE.js +1 -0
  147. package/locales/elGR.js +1 -0
  148. package/locales/esES.js +1 -0
  149. package/locales/faIR.js +1 -0
  150. package/locales/fiFI.js +1 -0
  151. package/locales/frFR.js +1 -0
  152. package/locales/heIL.js +10 -9
  153. package/locales/huHU.js +1 -0
  154. package/locales/itIT.js +1 -0
  155. package/locales/jaJP.js +25 -24
  156. package/locales/koKR.js +1 -0
  157. package/locales/nbNO.d.ts +2 -0
  158. package/locales/nbNO.js +116 -0
  159. package/locales/nlNL.js +1 -0
  160. package/locales/plPL.js +1 -0
  161. package/locales/ptBR.js +1 -0
  162. package/locales/ruRU.js +7 -6
  163. package/locales/skSK.js +1 -0
  164. package/locales/trTR.js +8 -7
  165. package/locales/ukUA.js +1 -0
  166. package/locales/viVN.js +1 -0
  167. package/locales/zhCN.js +1 -0
  168. package/models/api/gridCallbackDetails.d.ts +6 -1
  169. package/models/api/gridCoreApi.d.ts +2 -6
  170. package/models/api/gridFilterApi.d.ts +8 -1
  171. package/models/api/gridLocaleTextApi.d.ts +1 -0
  172. package/models/api/gridRowsMetaApi.d.ts +24 -0
  173. package/models/api/gridStateApi.d.ts +14 -3
  174. package/models/colDef/gridColDef.d.ts +4 -4
  175. package/models/events/gridEventLookup.d.ts +16 -1
  176. package/models/events/gridEvents.d.ts +3 -1
  177. package/models/events/gridEvents.js +2 -0
  178. package/models/gridApiCaches.d.ts +6 -0
  179. package/models/gridApiCaches.js +1 -0
  180. package/models/gridIconSlotsComponent.d.ts +5 -0
  181. package/models/params/gridMenuParams.d.ts +7 -0
  182. package/models/params/gridMenuParams.js +1 -0
  183. package/models/params/gridRowParams.d.ts +1 -1
  184. package/models/params/index.d.ts +1 -0
  185. package/models/params/index.js +2 -1
  186. package/models/props/DataGridProps.d.ts +24 -2
  187. package/modern/DataGrid/DataGrid.js +26 -1
  188. package/modern/colDef/gridCheckboxSelectionColDef.js +2 -1
  189. package/modern/colDef/gridNumericColDef.js +1 -1
  190. package/modern/components/GridRow.js +51 -12
  191. package/modern/components/cell/GridCell.js +12 -7
  192. package/modern/components/columnHeaders/GridColumnHeaderItem.js +9 -6
  193. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
  194. package/modern/components/columnSelection/GridHeaderCheckbox.js +0 -1
  195. package/modern/components/containers/GridRootStyles.js +8 -3
  196. package/modern/components/menu/GridMenu.js +9 -2
  197. package/modern/components/panel/GridColumnsPanel.js +12 -7
  198. package/modern/components/panel/GridPanelWrapper.js +3 -3
  199. package/modern/components/panel/filterPanel/GridFilterForm.js +88 -8
  200. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
  201. package/modern/components/panel/filterPanel/GridFilterPanel.js +26 -11
  202. package/modern/components/toolbar/GridToolbarColumnsButton.js +0 -1
  203. package/modern/components/toolbar/GridToolbarDensitySelector.js +0 -1
  204. package/modern/components/toolbar/GridToolbarExportContainer.js +0 -1
  205. package/modern/components/toolbar/GridToolbarFilterButton.js +0 -1
  206. package/modern/components/toolbar/GridToolbarQuickFilter.js +57 -4
  207. package/modern/constants/defaultGridSlotsComponents.js +2 -1
  208. package/modern/constants/gridClasses.js +1 -1
  209. package/modern/constants/localeTextConstants.js +1 -0
  210. package/modern/hooks/core/useGridStateInitialization.js +19 -6
  211. package/modern/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
  212. package/modern/hooks/features/columns/useGridColumnSpanning.js +1 -1
  213. package/modern/hooks/features/columns/useGridColumns.js +12 -14
  214. package/modern/hooks/features/dimensions/useGridDimensions.js +9 -8
  215. package/modern/hooks/features/editRows/useGridCellEditing.new.js +10 -3
  216. package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
  217. package/modern/hooks/features/editRows/useGridRowEditing.new.js +9 -3
  218. package/modern/hooks/features/events/useGridEvents.js +2 -0
  219. package/modern/hooks/features/filter/gridFilterSelector.js +6 -0
  220. package/modern/hooks/features/filter/gridFilterUtils.js +3 -6
  221. package/modern/hooks/features/filter/useGridFilter.js +29 -12
  222. package/modern/hooks/features/pagination/useGridPage.js +1 -1
  223. package/modern/hooks/features/pagination/useGridPageSize.js +1 -1
  224. package/modern/hooks/features/rows/useGridRowsMeta.js +129 -59
  225. package/modern/hooks/features/selection/useGridSelection.js +1 -1
  226. package/modern/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
  227. package/modern/hooks/features/sorting/useGridSorting.js +1 -1
  228. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +65 -11
  229. package/modern/index.js +1 -1
  230. package/modern/locales/arSD.js +1 -0
  231. package/modern/locales/bgBG.js +1 -0
  232. package/modern/locales/csCZ.js +1 -0
  233. package/modern/locales/daDK.js +1 -0
  234. package/modern/locales/deDE.js +1 -0
  235. package/modern/locales/elGR.js +1 -0
  236. package/modern/locales/esES.js +1 -0
  237. package/modern/locales/faIR.js +1 -0
  238. package/modern/locales/fiFI.js +1 -0
  239. package/modern/locales/frFR.js +1 -0
  240. package/modern/locales/heIL.js +10 -9
  241. package/modern/locales/huHU.js +1 -0
  242. package/modern/locales/itIT.js +1 -0
  243. package/modern/locales/jaJP.js +25 -24
  244. package/modern/locales/koKR.js +1 -0
  245. package/modern/locales/nbNO.js +116 -0
  246. package/modern/locales/nlNL.js +1 -0
  247. package/modern/locales/plPL.js +1 -0
  248. package/modern/locales/ptBR.js +1 -0
  249. package/modern/locales/ruRU.js +7 -6
  250. package/modern/locales/skSK.js +1 -0
  251. package/modern/locales/trTR.js +8 -7
  252. package/modern/locales/ukUA.js +1 -0
  253. package/modern/locales/viVN.js +1 -0
  254. package/modern/locales/zhCN.js +1 -0
  255. package/modern/models/events/gridEvents.js +2 -0
  256. package/modern/models/gridApiCaches.js +1 -0
  257. package/modern/models/params/gridMenuParams.js +1 -0
  258. package/modern/models/params/index.js +2 -1
  259. package/node/DataGrid/DataGrid.js +26 -1
  260. package/node/colDef/gridCheckboxSelectionColDef.js +4 -2
  261. package/node/colDef/gridNumericColDef.js +1 -1
  262. package/node/components/GridRow.js +53 -12
  263. package/node/components/cell/GridCell.js +12 -7
  264. package/node/components/columnHeaders/GridColumnHeaderItem.js +9 -6
  265. package/node/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
  266. package/node/components/columnSelection/GridHeaderCheckbox.js +0 -1
  267. package/node/components/containers/GridRootStyles.js +8 -3
  268. package/node/components/menu/GridMenu.js +10 -2
  269. package/node/components/panel/GridColumnsPanel.js +12 -7
  270. package/node/components/panel/GridPanelWrapper.js +5 -3
  271. package/node/components/panel/filterPanel/GridFilterForm.js +91 -9
  272. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
  273. package/node/components/panel/filterPanel/GridFilterPanel.js +28 -11
  274. package/node/components/toolbar/GridToolbarColumnsButton.js +0 -1
  275. package/node/components/toolbar/GridToolbarDensitySelector.js +0 -1
  276. package/node/components/toolbar/GridToolbarExportContainer.js +0 -1
  277. package/node/components/toolbar/GridToolbarFilterButton.js +0 -1
  278. package/node/components/toolbar/GridToolbarQuickFilter.js +61 -4
  279. package/node/constants/defaultGridSlotsComponents.js +2 -1
  280. package/node/constants/gridClasses.js +1 -1
  281. package/node/constants/localeTextConstants.js +1 -0
  282. package/node/hooks/core/useGridStateInitialization.js +19 -6
  283. package/node/hooks/features/columnMenu/useGridColumnMenu.js +23 -0
  284. package/node/hooks/features/columns/useGridColumnSpanning.js +11 -16
  285. package/node/hooks/features/columns/useGridColumns.js +13 -15
  286. package/node/hooks/features/dimensions/useGridDimensions.js +9 -8
  287. package/node/hooks/features/editRows/useGridCellEditing.new.js +11 -4
  288. package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
  289. package/node/hooks/features/editRows/useGridRowEditing.new.js +10 -4
  290. package/node/hooks/features/events/useGridEvents.js +2 -0
  291. package/node/hooks/features/filter/gridFilterSelector.js +9 -2
  292. package/node/hooks/features/filter/gridFilterUtils.js +4 -5
  293. package/node/hooks/features/filter/useGridFilter.js +28 -11
  294. package/node/hooks/features/pagination/useGridPage.js +1 -1
  295. package/node/hooks/features/pagination/useGridPageSize.js +1 -1
  296. package/node/hooks/features/rows/useGridRowsMeta.js +136 -69
  297. package/node/hooks/features/selection/useGridSelection.js +1 -1
  298. package/node/hooks/features/selection/useGridSelectionPreProcessors.js +7 -5
  299. package/node/hooks/features/sorting/useGridSorting.js +1 -1
  300. package/node/hooks/features/virtualization/useGridVirtualScroller.js +65 -12
  301. package/node/index.js +1 -1
  302. package/node/locales/arSD.js +1 -0
  303. package/node/locales/bgBG.js +1 -0
  304. package/node/locales/csCZ.js +1 -0
  305. package/node/locales/daDK.js +1 -0
  306. package/node/locales/deDE.js +1 -0
  307. package/node/locales/elGR.js +1 -0
  308. package/node/locales/esES.js +1 -0
  309. package/node/locales/faIR.js +1 -0
  310. package/node/locales/fiFI.js +1 -0
  311. package/node/locales/frFR.js +1 -0
  312. package/node/locales/heIL.js +10 -9
  313. package/node/locales/huHU.js +1 -0
  314. package/node/locales/itIT.js +1 -0
  315. package/node/locales/jaJP.js +25 -24
  316. package/node/locales/koKR.js +1 -0
  317. package/node/locales/nbNO.js +126 -0
  318. package/node/locales/nlNL.js +1 -0
  319. package/node/locales/plPL.js +1 -0
  320. package/node/locales/ptBR.js +1 -0
  321. package/node/locales/ruRU.js +7 -6
  322. package/node/locales/skSK.js +1 -0
  323. package/node/locales/trTR.js +8 -7
  324. package/node/locales/ukUA.js +1 -0
  325. package/node/locales/viVN.js +1 -0
  326. package/node/locales/zhCN.js +1 -0
  327. package/node/models/events/gridEvents.js +2 -0
  328. package/node/models/gridApiCaches.js +5 -0
  329. package/node/models/params/gridMenuParams.js +5 -0
  330. package/node/models/params/index.js +13 -0
  331. package/package.json +6 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,187 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## v5.12.2
7
+
8
+ _Jun 16, 2022_
9
+
10
+ We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🚀 Performance improvement for dynamic row height (#5135) @m4theushw
13
+ - 🕒 Add demo of how to use the data grid with date pickers (#5053) @cherniavskii
14
+ - 📚 Documentation improvements
15
+ - 🐞 Bugfixes
16
+
17
+ ### `@mui/x-data-grid@v5.12.2` / `@mui/x-data-grid-pro@v5.12.2` / `@mui/x-data-grid-premium@v5.12.2`
18
+
19
+ #### Changes
20
+
21
+ - [DataGrid] Fix for cosmetic bug on column filter badge (#5170) @simbahandiane
22
+ - [DataGrid] Hide vertical scrollbar if `autoHeight` is enabled (#5164) @m4theushw
23
+ - [DataGrid] Use exponential search to render non-measured rows (#5135) @m4theushw
24
+ - [DataGridPro] Fix label of the detail panel toggle column (#5191) @m4theushw
25
+ - [DataGridPro] Refresh detail panel caches when props change (#5110) @m4theushw
26
+
27
+ ### Docs
28
+
29
+ - [docs] Add example with custom checkbox column (#5161) @flaviendelangle
30
+ - [docs] Batch small changes (#5177) @oliviertassinari
31
+ - [docs] Fix demo currency format (#5034) @oliviertassinari
32
+ - [docs] Fix outdated license description to match the EULA (#5219) @joserodolfofreitas
33
+ - [docs] Fix redundant headers (#5104) @oliviertassinari
34
+ - [docs] Fix some capitalization to match the guidelines (#5105) @oliviertassinari
35
+ - [docs] Improve the `getRowId` doc section (#5156) @flaviendelangle
36
+ - [docs] Instruction to deal with invalid license message (#5074) @joserodolfofreitas
37
+ - [docs] Use redirection in the code (#5114) @oliviertassinari
38
+ - [docs] Add demo of how to use the data grid with date pickers (#5053) @cherniavskii
39
+
40
+ ### Core
41
+
42
+ - [core] Improve inline code rendering within the details tag (#5166) @Harmouch101
43
+ - [core] Remove unused props from plugin typing (#5185) @flaviendelangle
44
+ - [core] Use the scrollbar size from `useGridDimensions` on `DataGridProColumnHeaders` (#5201) @flaviendelangle
45
+ - [core] Fix `GridColTypeDef` type (#5167) @cherniavskii
46
+ - [core] Fix `GridColTypeDef` usage in demo (#5197) @cherniavskii
47
+ - [test] Add `waitFor` before asserting height (#5203) @m4theushw
48
+
49
+ ## v5.12.1
50
+
51
+ _Jun 9, 2022_
52
+
53
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
54
+
55
+ - 🎁 Add `reason` to `onFilterModelChange` (#4938) @m4theushw
56
+ - 🔎 Control quick filter input value via model prop (#5013) @alexfauquette
57
+ - 📚 Documentation improvements
58
+ - 🐞 Bugfixes
59
+
60
+ ### `@mui/x-data-grid@v5.12.1` / `@mui/x-data-grid-pro@v5.12.1` / `@mui/x-data-grid-premium@v5.12.1`
61
+
62
+ #### Changes
63
+
64
+ - [DataGrid] Add `reason` to `onFilterModelChange` (#4938) @m4theushw
65
+ - [DataGrid] Restore focus after dismissing the column menu (#5027) @m4theushw
66
+ - [DataGrid] Update quick filter input when model is modified (#5013) @alexfauquette
67
+ - [DataGrid] Fix implicit dependency on react-dom (#5121) @oliviertassinari
68
+ - [DataGrid] Support `getRowId` in row reordering (#5093) @flaviendelangle
69
+ - [DataGridPro] Fix column resizing in RTL mode (#4989) @cherniavskii
70
+ - [DataGridPro] Fix column resizing on touchscreen (#5056) @cherniavskii
71
+ - [l10n] Update Japanese (ja-JP) locale (#5122) @hikotq
72
+ - [l10n] Update Russian (ru-RU) locale (#5069) @Artboomy
73
+
74
+ ### `@mui/x-date-pickers@5.0.0-alpha.6` / `@mui/x-date-pickers-pro@5.0.0-alpha.6`
75
+
76
+ #### Changes
77
+
78
+ - [pickers] Fix usage of `maxDate` / `minDate` / `disableFuture` and `disablePast` (#5081) @flaviendelangle
79
+ - [pickers] Infer mask from `inputFormat` (#5060) @alexfauquette
80
+ - [pickers] Manage input value without using the focus (#4486) @alexfauquette
81
+ - [pickers] Use new localization for doc examples (#5097) @flaviendelangle
82
+ - [pickers] Fix `shouldDisableDate` in range pickers (#5123) @flaviendelangle
83
+ - [l10n] Add Brazilian Portuguese (pt-BR) locale (#5100) @jardelnovaes
84
+ - [l10n] Use `localText` for remaining texts (#4986) @alexfauquette
85
+
86
+ ### Docs
87
+
88
+ - [docs] Implement the focus management on data grid demo links (#5070) @alexfauquette
89
+ - [docs] Fix `301` link to render cell (#5106) @oliviertassinari
90
+ - [docs] Fix broken anchor link @oliviertassinari
91
+ - [docs] Improve movie dataset (#5142) @flaviendelangle
92
+ - [docs] Move all localization documentation in a unique page (#5072) @alexfauquette
93
+ - [docs] Section for overwriting core components i18n keys (#4998) @DanailH
94
+ - [docs] Small grammar and format fixes for Dynamic Row Height section (#5098) @samuelsycamore
95
+
96
+ ### Core
97
+
98
+ - [core] Allows to run tests with different date adapters (#5055) @alexfauquette
99
+ - [core] Prettify the l10n issue (#4928) @alexfauquette
100
+ - [core] Set correct `apiRef` type in row reorder pre processors #5125 @DanailH
101
+ - [core] Stop using `GridEvents` in technical doc (#5157) @flaviendelangle
102
+ - [core] Upgrade monorepo (#5101) @oliviertassinari
103
+ - [test] Fix dynamic row height test failing on Chrome (#5147) @m4theushw
104
+ - [test] Remove delay on server demo for regression tests (#5131) @alexfauquette
105
+
106
+ ## v5.12.0
107
+
108
+ _May 31, 2022_
109
+
110
+ We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
111
+
112
+ - 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/rows/#dynamic-row-height) (#4859) @m4theushw
113
+
114
+ <img src="https://user-images.githubusercontent.com/42154031/171183167-718d7bcd-ec0f-459e-97fe-0f650abb4a99.gif" width="800">
115
+
116
+ - ⚠️ Remove deprecated row grouping feature from `@mui/x-data-grid-pro`
117
+
118
+ Row grouping is available through the `@mui/x-data-grid-premium` package - see [Premium plan release blogpost](https://mui.com/blog/premium-plan-release/).
119
+
120
+ - 🐞 Bug fixes and improvements
121
+
122
+ ### `@mui/x-data-grid@v5.12.0` / `@mui/x-data-grid-pro@v5.12.0` / `@mui/x-data-grid-premium@v5.12.0`
123
+
124
+ #### Changes
125
+
126
+ - [DataGrid] Support dynamic row height (#4859) @m4theushw
127
+ - [DataGrid] Add `onMenuOpen` and `onMenuClose` props (#4825) @DanailH
128
+ - [DataGrid] Add generics to `GridActionsColDef` to match `GridColDef` (#4982) @subvertallchris
129
+ - [DataGrid] Disable drag event handlers when row or column reorder are disabled (#4857) @DanailH
130
+ - [DataGrid] Allow other attempts to stop edit mode if the first failed (#5016) @m4theushw
131
+ - [DataGrid] Better reflect the dependency on Material UI (#4795) @oliviertassinari
132
+ - [DataGrid] Add an id to the filter item created when opening the filter panel (#5014) @flaviendelangle
133
+ - [DataGrid] Use column visibility model on Hide All / Show All when enabled (#5050) @flaviendelangle
134
+ - [DataGridPro] Unpin columns back to original position (#4512) @m4theushw
135
+ - [DataGridPro] Remove experimental row grouping from Pro plan (#4949) @flaviendelangle
136
+ - [DataGridPro] Allow to scroll detail panel content if it overflows the panel (#4979) @cherniavskii
137
+ - [DataGridPro] Do not call `setRowIndex` when dragging a column over a row (#4987) @flaviendelangle
138
+ - [l10n] Add Norwegian (Bokmål) (nb-NO) locale (#5001) @spiftire
139
+ - [l10n] Add Turkish (tr-TR) locale (#5026) @Rassilion
140
+
141
+ ### `@mui/x-date-pickers@5.0.0-alpha.5` / `@mui/x-date-pickers-pro@5.0.0-alpha.5`
142
+
143
+ #### Breaking changes
144
+
145
+ - [pickers] Restructure props in `MonthPicker` / `YearPicker` and `DayPicker` (#4814) @flaviendelangle
146
+
147
+ The props of `MonthPicker` / `YearPicker` and `DayPicker` have been reworked to make them more consistent for a standalone usage (#4814) @flaviendelangle
148
+
149
+ **MonthPicker**: The prop `onMonthChange` has been removed, you can use `onChange` instead since every change is a month change
150
+
151
+ **YearPicker**: The prop `onYearPicker` has been removed, you can use `onChange` instead since every change is a year change
152
+
153
+ **DayPicker**: The prop `isDateDisabled` has been removed, you can now use the same validation props as for the other components (`maxDate`, `minDate`, `shouldDisableDate`, `disableFuture` and `disablePast`)
154
+
155
+ #### Changes
156
+
157
+ - [pickers] Add German (de-DE) translations (#4974) @felixh10r
158
+ - [pickers] Support action bar on static pickers and improve typing (#5015) @flaviendelangle
159
+
160
+ ### Docs
161
+
162
+ - [docs] Add docs sections / pages for upcoming features on pickers (#4603) @flaviendelangle
163
+ - [docs] Add docs for filter panel components (#4919) @m4theushw
164
+ - [docs] Explain how to manage focus with `renderCell` (#4254) @alexfauquette
165
+ - [docs] Fix broken links to GitHub source (#5003) @Edwardveb
166
+ - [docs] Fix navigation links (#4956) @oliviertassinari
167
+ - [docs] Fix typo on rows docs (#4952) @jamesRadicl
168
+ - [docs] New WAI-ARIA guidelines location (#4957) @oliviertassinari
169
+ - [docs] Add "Slots" section to the right nav in the API pages (#4993) @DanailH
170
+ - [docs] Fix docs feedback widget not working (#4905) @cherniavskii
171
+ - [docs] Replace custom notes and warning with callouts (#5008) @flaviendelangle
172
+
173
+ ### Core
174
+
175
+ - [core] Avoid Order ID to refer to GitHub issues/PRs (#5005) @oliviertassinari
176
+ - [core] Improve the workflow for incomplete issues (#5012) @mnajdova
177
+ - [core] Remove dead code on row grouping tree creation (#4945) @flaviendelangle
178
+ - [core] Use new cache api for the row grouping last model tracking (#4980) @flaviendelangle
179
+ - [core] Ensure that PRs have atleast 1 label (#5011) @DanailH
180
+ - [core] Fix trailing-space @oliviertassinari
181
+ - [core] Stop Renovate PR updates when PR is on hold (#5020) @cherniavskii
182
+ - [license] Remove support for UTF-8 (#4893) @oliviertassinari
183
+ - [license] Tweak error messages (#4907) @mbrookes
184
+ - [test] Skip Safari and Firefox on broken tests (#4994) @alexfauquette
185
+ - [test] Make argos screenshots stable (#5061) @m4theushw
186
+
6
187
  ## v5.11.1
7
188
 
8
189
  _May 20, 2022_
@@ -38,30 +219,28 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
38
219
 
39
220
  To decide which button must be displayed and in which order, you can now use the `actions` prop of the `actionBar` component slot props.
40
221
 
41
- ```jsx
42
- <DatePicker
43
- componentsProps={{
44
- actionBar: {
45
- // The actions will be the same between desktop and mobile
46
- actions: ['clear'],
222
+ ```jsx
223
+ <DatePicker
224
+ componentsProps={{
225
+ actionBar: {
226
+ // The actions will be the same between desktop and mobile
227
+ actions: ['clear'],
47
228
 
48
- // The actions will be different between desktop and mobile
49
- actions: (variant) => variant === 'desktop' ? [] : ['clear'],
50
- }
51
- }}
52
- />
53
- ```
229
+ // The actions will be different between desktop and mobile
230
+ actions: (variant) => (variant === 'desktop' ? [] : ['clear']),
231
+ },
232
+ }}
233
+ />
234
+ ```
54
235
 
55
236
  The build-in `ActionBar` component supports 4 different actions: `'clear'`, `'cancel'`, `'accept'`, and `'today'`.
56
237
  By default, the pickers will render the cancel and accept button on mobile and no action on desktop.
57
238
 
58
239
  If you need other actions, you can provide your own component to the `ActionBar` component slot
59
240
 
60
- ```jsx
61
- <DatePicker
62
- components={{ ActionBar: CustomActionBar }}
63
- />
64
- ```
241
+ ```jsx
242
+ <DatePicker components={{ ActionBar: CustomActionBar }} />
243
+ ```
65
244
 
66
245
  #### Changes
67
246
 
@@ -121,7 +300,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
121
300
 
122
301
  - 👔 **Excel export**. You can find this new Premium feature at: https://mui.com/x/react-data-grid/export/#excel-export.
123
302
 
124
- - 🔎 **Quick filtering**. You can now add a quick filtering search bar to your grid. To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar. More information about how to customize the filtering logic is in the [documentation]( https://mui.com/x/react-data-grid/filtering/#quick-filter).
303
+ - 🔎 **Quick filtering**. You can now add a quick filtering search bar to your grid. To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar. More information about how to customize the filtering logic is in the [documentation](https://mui.com/x/react-data-grid/filtering/#quick-filter).
125
304
 
126
305
  <img src="https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png" width="724">
127
306
 
@@ -3948,9 +4127,9 @@ Big thanks to the 8 contributors who made this release possible. Here are some h
3948
4127
 
3949
4128
  ### Docs
3950
4129
 
3951
- - [docs] Data Grid depends on side effects (#666) @oliviertassinari
4130
+ - [docs] Data grid depends on side effects (#666) @oliviertassinari
3952
4131
  - [docs] Clarify the purpose of x-grid-data-generator (#634) @Elius94
3953
- - [docs] Data Grid is in the lab (#612) @oliviertassinari
4132
+ - [docs] Data grid is in the lab (#612) @oliviertassinari
3954
4133
  - [docs] Fix Demo app, downgrade webpack-cli, known issue in latest version (#647) @dtassone
3955
4134
  - [docs] Fix typo in columns.md @stojy
3956
4135
  - [docs] Reduce confusion on /export page (#646) @SerdarMustafa1
@@ -229,6 +229,15 @@ DataGridRaw.propTypes = {
229
229
  */
230
230
  getDetailPanelContent: PropTypes.func,
231
231
 
232
+ /**
233
+ * Function that returns the estimated height for a row.
234
+ * Only works if dynamic row height is used.
235
+ * Once the row height is measured this value is discarded.
236
+ * @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
237
+ * @returns {number | null} The estimated row height value. If `null` or `undefined` then the default row height, based on the density, is applied.
238
+ */
239
+ getEstimatedRowHeight: PropTypes.func,
240
+
232
241
  /**
233
242
  * Function that applies CSS classes dynamically on rows.
234
243
  * @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
@@ -239,7 +248,7 @@ DataGridRaw.propTypes = {
239
248
  /**
240
249
  * Function that sets the row height per row.
241
250
  * @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
242
- * @returns {GridRowHeightReturnValue} The row height value. If `null` or `undefined` then the default row height is applied.
251
+ * @returns {GridRowHeightReturnValue} The row height value. If `null` or `undefined` then the default row height is applied. If "auto" then the row height is calculated based on the content.
243
252
  */
244
253
  getRowHeight: PropTypes.func,
245
254
 
@@ -506,6 +515,22 @@ DataGridRaw.propTypes = {
506
515
  */
507
516
  onFilterModelChange: PropTypes.func,
508
517
 
518
+ /**
519
+ * Callback fired when the menu is closed.
520
+ * @param {GridMenuParams} params With all properties from [[GridMenuParams]].
521
+ * @param {MuiEvent<{}>} event The event object.
522
+ * @param {GridCallbackDetails} details Additional details for this callback.
523
+ */
524
+ onMenuClose: PropTypes.func,
525
+
526
+ /**
527
+ * Callback fired when the menu is opened.
528
+ * @param {GridMenuParams} params With all properties from [[GridMenuParams]].
529
+ * @param {MuiEvent<{}>} event The event object.
530
+ * @param {GridCallbackDetails} details Additional details for this callback.
531
+ */
532
+ onMenuOpen: PropTypes.func,
533
+
509
534
  /**
510
535
  * Callback fired when the current page has changed.
511
536
  * @param {number} page Index of the page displayed on the Grid.
package/README.md CHANGED
@@ -19,8 +19,8 @@ This component has the following peer dependencies that you will need to install
19
19
 
20
20
  ```json
21
21
  "peerDependencies": {
22
- "@mui/material": "^5.2.8",
23
- "@mui/system": "^5.2.8",
22
+ "@mui/material": "^5.4.1",
23
+ "@mui/system": "^5.4.1",
24
24
  "react": "^17.0.2 || ^18.0.0"
25
25
  },
26
26
  ```
@@ -1,2 +1,3 @@
1
1
  import { GridColDef } from '../models/colDef/gridColDef';
2
+ export declare const GRID_CHECKBOX_SELECTION_FIELD = "__check__";
2
3
  export declare const GRID_CHECKBOX_SELECTION_COL_DEF: GridColDef;
@@ -5,8 +5,9 @@ import { GridHeaderCheckbox } from '../components/columnSelection/GridHeaderChec
5
5
  import { selectedIdsLookupSelector } from '../hooks/features/selection/gridSelectionSelector';
6
6
  import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
+ export const GRID_CHECKBOX_SELECTION_FIELD = '__check__';
8
9
  export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {
9
- field: '__check__',
10
+ field: GRID_CHECKBOX_SELECTION_FIELD,
10
11
  type: 'checkboxSelection',
11
12
  width: 50,
12
13
  resizable: false,
@@ -1,2 +1,2 @@
1
1
  import { GridFilterOperator } from '../models/gridFilterOperator';
2
- export declare const getGridDateOperators: (showTime?: boolean | undefined) => GridFilterOperator<any, string | number | Date, any>[];
2
+ export declare const getGridDateOperators: (showTime?: boolean | undefined) => GridFilterOperator<any, string | Date, any>[];
@@ -11,7 +11,7 @@ export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
11
11
  valueParser: value => value === '' ? null : Number(value),
12
12
  valueFormatter: ({
13
13
  value
14
- }) => value && isNumber(value) && value.toLocaleString() || value,
14
+ }) => isNumber(value) ? value.toLocaleString() : value || '',
15
15
  filterOperators: getGridNumericOperators(),
16
16
  getApplyQuickFilterFn: getGridNumericQuickFilterFn
17
17
  });
@@ -11,7 +11,7 @@ export interface GridRowProps {
11
11
  * If some rows above have expanded children, this index also take those children into account.
12
12
  */
13
13
  index: number;
14
- rowHeight: number;
14
+ rowHeight: number | 'auto';
15
15
  containerWidth: number;
16
16
  row: GridRowModel;
17
17
  firstColumnToRender: number;
@@ -20,6 +20,8 @@ import { findParentElementFromClassName } from '../utils/domUtils';
20
20
  import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../colDef/gridCheckboxSelectionColDef';
21
21
  import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef';
22
22
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../constants/gridDetailPanelToggleField';
23
+ import { gridSortModelSelector } from '../hooks/features/sorting/gridSortingSelector';
24
+ import { gridRowTreeDepthSelector } from '../hooks/features/rows/gridRowsSelector';
23
25
  import { jsx as _jsx } from "react/jsx-runtime";
24
26
  import { jsxs as _jsxs } from "react/jsx-runtime";
25
27
 
@@ -29,25 +31,24 @@ const useUtilityClasses = ownerState => {
29
31
  editing,
30
32
  selected,
31
33
  isLastVisible,
34
+ rowHeight,
32
35
  classes
33
36
  } = ownerState;
34
37
  const slots = {
35
- root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isLastVisible && 'row--lastVisible']
38
+ root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isLastVisible && 'row--lastVisible', rowHeight === 'auto' && 'row--dynamicHeight']
36
39
  };
37
40
  return composeClasses(slots, getDataGridUtilityClass, classes);
38
41
  };
39
42
 
40
43
  const EmptyCell = ({
41
- width,
42
- height
44
+ width
43
45
  }) => {
44
- if (!width || !height) {
46
+ if (!width) {
45
47
  return null;
46
48
  }
47
49
 
48
50
  const style = {
49
- width,
50
- height
51
+ width
51
52
  };
52
53
  return /*#__PURE__*/_jsx("div", {
53
54
  className: "MuiDataGrid-cell",
@@ -84,9 +85,12 @@ function GridRow(props) {
84
85
  const ariaRowIndex = index + 2; // 1 for the header row and 1 as it's 1-based
85
86
 
86
87
  const apiRef = useGridApiContext();
88
+ const ref = React.useRef(null);
87
89
  const rootProps = useGridRootProps();
88
90
  const currentPage = useGridVisibleRows(apiRef, rootProps);
89
91
  const columnsTotalWidth = useGridSelector(apiRef, gridColumnsTotalWidthSelector);
92
+ const sortModel = useGridSelector(apiRef, gridSortModelSelector);
93
+ const treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
90
94
  const {
91
95
  hasScrollX,
92
96
  hasScrollY
@@ -99,9 +103,41 @@ function GridRow(props) {
99
103
  isLastVisible,
100
104
  classes: rootProps.classes,
101
105
  editing: apiRef.current.getRowMode(rowId) === GridRowModes.Edit,
102
- editable: rootProps.editMode === GridEditModes.Row
106
+ editable: rootProps.editMode === GridEditModes.Row,
107
+ rowHeight
103
108
  };
104
109
  const classes = useUtilityClasses(ownerState);
110
+ React.useLayoutEffect(() => {
111
+ if (rowHeight === 'auto' && ref.current && typeof ResizeObserver === 'undefined') {
112
+ // Fallback for IE
113
+ apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
114
+ }
115
+ });
116
+ React.useLayoutEffect(() => {
117
+ if (currentPage.range) {
118
+ // The index prop is relative to the rows from all pages. As example, the index prop of the
119
+ // first row is 5 if pageSize=5 and page=1. However, the index used by the virtualization
120
+ // doesn't care about pagination and considers the rows from the current page only, so the
121
+ // first row always has index=0. We need to subtract the index of the first row to make it
122
+ // compatible with the index used by the virtualization.
123
+ apiRef.current.unstable_setLastMeasuredRowIndex(index - currentPage.range.firstRowIndex);
124
+ }
125
+
126
+ const rootElement = ref.current;
127
+ const hasFixedHeight = rowHeight !== 'auto';
128
+
129
+ if (!rootElement || hasFixedHeight || typeof ResizeObserver === 'undefined') {
130
+ return undefined;
131
+ }
132
+
133
+ const resizeObserver = new ResizeObserver(entries => {
134
+ const [entry] = entries;
135
+ const height = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
136
+ apiRef.current.unstable_storeRowHeightMeasurement(rowId, height);
137
+ });
138
+ resizeObserver.observe(rootElement);
139
+ return () => resizeObserver.disconnect();
140
+ }, [apiRef, currentPage.range, index, rowHeight, rowId]);
105
141
  const publish = React.useCallback((eventName, propHandler) => event => {
106
142
  // Ignore portal
107
143
  // The target is not an element when triggered by a Select inside the cell
@@ -159,7 +195,8 @@ function GridRow(props) {
159
195
  }, [apiRef, onClick, publish, rowId]);
160
196
 
161
197
  const style = _extends({}, styleProp, {
162
- maxHeight: rowHeight,
198
+ maxHeight: rowHeight === 'auto' ? 'none' : rowHeight,
199
+ // max-height doesn't support "auto"
163
200
  minHeight: rowHeight
164
201
  });
165
202
 
@@ -199,6 +236,7 @@ function GridRow(props) {
199
236
  const showRightBorder = !isLastColumn ? rootProps.showCellRightBorder : !removeLastBorderRight && rootProps.disableExtendRowFullWidth;
200
237
  const cellParams = apiRef.current.getCellParams(rowId, column.field);
201
238
  const classNames = [];
239
+ const disableDragEvents = rootProps.disableColumnReorder && column.disableReorder || !rootProps.rowReordering && !!sortModel.length && treeDepth > 1 && Object.keys(editRowsState).length > 0;
202
240
 
203
241
  if (column.cellClassName) {
204
242
  classNames.push(clsx(typeof column.cellClassName === 'function' ? column.cellClassName(cellParams) : column.cellClassName));
@@ -269,7 +307,8 @@ function GridRow(props) {
269
307
  hasFocus: hasFocus,
270
308
  tabIndex: tabIndex,
271
309
  className: clsx(classNames),
272
- colSpan: colSpan
310
+ colSpan: colSpan,
311
+ disableDragEvents: disableDragEvents
273
312
  }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.cell, {
274
313
  children: content
275
314
  }), column.field));
@@ -278,6 +317,7 @@ function GridRow(props) {
278
317
 
279
318
  const emptyCellWidth = containerWidth - columnsTotalWidth;
280
319
  return /*#__PURE__*/_jsxs("div", _extends({
320
+ ref: ref,
281
321
  "data-id": rowId,
282
322
  "data-rowindex": index,
283
323
  role: "row",
@@ -291,8 +331,7 @@ function GridRow(props) {
291
331
  onMouseLeave: publish('rowMouseLeave', onMouseLeave)
292
332
  }, other, {
293
333
  children: [cells, emptyCellWidth > 0 && /*#__PURE__*/_jsx(EmptyCell, {
294
- width: emptyCellWidth,
295
- height: rowHeight
334
+ width: emptyCellWidth
296
335
  })]
297
336
  }));
298
337
  }
@@ -317,7 +356,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
317
356
  lastColumnToRender: PropTypes.number.isRequired,
318
357
  renderedColumns: PropTypes.arrayOf(PropTypes.object).isRequired,
319
358
  row: PropTypes.any.isRequired,
320
- rowHeight: PropTypes.number.isRequired,
359
+ rowHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
321
360
  rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
322
361
  selected: PropTypes.bool.isRequired,
323
362
  visibleColumns: PropTypes.arrayOf(PropTypes.object).isRequired
@@ -75,5 +75,5 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Pick<{
75
75
  touchRippleRef?: React.Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
76
76
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof React.LiHTMLAttributes<HTMLLIElement>> & {
77
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>>;
78
+ }, "dense" | "disabled" | "children" | "action" | "autoFocus" | "tabIndex" | "selected" | "sx" | "disableGutters" | "divider" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef">, "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" | "disableGutters" | "divider" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "showInMenu">) & React.RefAttributes<HTMLButtonElement>>;
79
79
  export { GridActionsCellItem };
@@ -9,7 +9,7 @@ export interface GridCellProps<V = any, F = V> {
9
9
  rowId: GridRowId;
10
10
  formattedValue?: F;
11
11
  hasFocus?: boolean;
12
- height: number;
12
+ height: number | 'auto';
13
13
  isEditable?: boolean;
14
14
  showRightBorder?: boolean;
15
15
  value?: V;
@@ -18,6 +18,7 @@ export interface GridCellProps<V = any, F = V> {
18
18
  children: React.ReactNode;
19
19
  tabIndex: 0 | -1;
20
20
  colSpan?: number;
21
+ disableDragEvents?: boolean;
21
22
  onClick?: React.MouseEventHandler<HTMLDivElement>;
22
23
  onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
23
24
  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", "colDef", "cellMode", "field", "formattedValue", "hasFocus", "height", "isEditable", "rowId", "tabIndex", "value", "width", "className", "showRightBorder", "extendRowFullWidth", "row", "colSpan", "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", "disableDragEvents", "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';
@@ -67,6 +67,7 @@ function GridCell(props) {
67
67
  className,
68
68
  showRightBorder,
69
69
  colSpan,
70
+ disableDragEvents,
70
71
  onClick,
71
72
  onDoubleClick,
72
73
  onMouseDown,
@@ -119,7 +120,8 @@ function GridCell(props) {
119
120
  minWidth: width,
120
121
  maxWidth: width,
121
122
  minHeight: height,
122
- maxHeight: height
123
+ maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
124
+
123
125
  };
124
126
  React.useLayoutEffect(() => {
125
127
  if (!hasFocus || cellMode === GridCellModes.Edit) {
@@ -184,6 +186,10 @@ function GridCell(props) {
184
186
  return children;
185
187
  };
186
188
 
189
+ const draggableEventHandlers = disableDragEvents ? null : {
190
+ onDragEnter: publish('cellDragEnter', onDragEnter),
191
+ onDragOver: publish('cellDragOver', onDragOver)
192
+ };
187
193
  return /*#__PURE__*/_jsx("div", _extends({
188
194
  ref: cellRef,
189
195
  className: clsx(className, classes.root),
@@ -198,10 +204,8 @@ function GridCell(props) {
198
204
  onDoubleClick: publish('cellDoubleClick', onDoubleClick),
199
205
  onMouseDown: publish('cellMouseDown', onMouseDown),
200
206
  onMouseUp: publishMouseUp('cellMouseUp'),
201
- onKeyDown: publish('cellKeyDown', onKeyDown),
202
- onDragEnter: publish('cellDragEnter', onDragEnter),
203
- onDragOver: publish('cellDragOver', onDragOver)
204
- }, other, {
207
+ onKeyDown: publish('cellKeyDown', onKeyDown)
208
+ }, draggableEventHandlers, other, {
205
209
  onFocus: handleFocus,
206
210
  children: renderChildren()
207
211
  }));
@@ -218,10 +222,11 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
218
222
  className: PropTypes.string,
219
223
  colIndex: PropTypes.number.isRequired,
220
224
  colSpan: PropTypes.number,
225
+ disableDragEvents: PropTypes.bool,
221
226
  field: PropTypes.string.isRequired,
222
227
  formattedValue: PropTypes.any,
223
228
  hasFocus: PropTypes.bool,
224
- height: PropTypes.number.isRequired,
229
+ height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
225
230
  isEditable: PropTypes.bool,
226
231
  onClick: PropTypes.func,
227
232
  onDoubleClick: PropTypes.func,