@mui/x-data-grid 5.11.0 → 5.12.1

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 (217) hide show
  1. package/CHANGELOG.md +237 -16
  2. package/DataGrid/DataGrid.js +26 -1
  3. package/README.md +3 -4
  4. package/components/GridRow.d.ts +1 -1
  5. package/components/GridRow.js +51 -12
  6. package/components/base/GridOverlays.js +1 -1
  7. package/components/cell/GridActionsCellItem.d.ts +1 -1
  8. package/components/cell/GridCell.d.ts +2 -1
  9. package/components/cell/GridCell.js +12 -7
  10. package/components/columnHeaders/GridColumnHeaderItem.js +4 -3
  11. package/components/containers/GridRoot.js +25 -5
  12. package/components/containers/GridRootStyles.js +7 -2
  13. package/components/menu/GridMenu.js +9 -2
  14. package/components/panel/GridColumnsPanel.js +10 -2
  15. package/components/panel/GridPanelWrapper.d.ts +1 -1
  16. package/components/panel/GridPanelWrapper.js +3 -3
  17. package/components/panel/filterPanel/GridFilterForm.d.ts +61 -4
  18. package/components/panel/filterPanel/GridFilterForm.js +88 -8
  19. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
  20. package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -5
  21. package/components/panel/filterPanel/GridFilterPanel.js +25 -9
  22. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  23. package/components/toolbar/GridToolbarQuickFilter.d.ts +7 -0
  24. package/components/toolbar/GridToolbarQuickFilter.js +58 -6
  25. package/constants/defaultGridSlotsComponents.js +4 -2
  26. package/constants/gridClasses.d.ts +16 -0
  27. package/constants/gridClasses.js +1 -1
  28. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -0
  29. package/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -9
  30. package/hooks/core/useGridStateInitialization.js +19 -6
  31. package/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
  32. package/hooks/features/columns/gridColumnsInterfaces.d.ts +3 -0
  33. package/hooks/features/columns/useGridColumns.js +13 -15
  34. package/hooks/features/editRows/useGridCellEditing.new.js +11 -4
  35. package/hooks/features/editRows/useGridEditing.old.js +1 -1
  36. package/hooks/features/editRows/useGridRowEditing.new.js +10 -4
  37. package/hooks/features/events/useGridEvents.d.ts +1 -1
  38. package/hooks/features/events/useGridEvents.js +2 -0
  39. package/hooks/features/filter/gridFilterSelector.d.ts +5 -0
  40. package/hooks/features/filter/gridFilterSelector.js +6 -0
  41. package/hooks/features/filter/gridFilterUtils.d.ts +10 -2
  42. package/hooks/features/filter/gridFilterUtils.js +3 -6
  43. package/hooks/features/filter/useGridFilter.js +29 -12
  44. package/hooks/features/pagination/useGridPage.js +1 -1
  45. package/hooks/features/pagination/useGridPageSize.js +1 -1
  46. package/hooks/features/rows/gridRowsState.d.ts +14 -5
  47. package/hooks/features/rows/gridRowsUtils.d.ts +13 -1
  48. package/hooks/features/rows/gridRowsUtils.js +54 -0
  49. package/hooks/features/rows/useGridRows.js +63 -102
  50. package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
  51. package/hooks/features/rows/useGridRowsMeta.js +107 -43
  52. package/hooks/features/selection/useGridSelection.js +1 -1
  53. package/hooks/features/sorting/useGridSorting.js +1 -1
  54. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -0
  55. package/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
  56. package/index.js +1 -1
  57. package/internals/index.d.ts +1 -0
  58. package/legacy/DataGrid/DataGrid.js +26 -1
  59. package/legacy/components/GridRow.js +56 -12
  60. package/legacy/components/base/GridOverlays.js +1 -1
  61. package/legacy/components/cell/GridCell.js +12 -7
  62. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +6 -3
  63. package/legacy/components/containers/GridRoot.js +23 -5
  64. package/legacy/components/containers/GridRootStyles.js +9 -6
  65. package/legacy/components/menu/GridMenu.js +9 -2
  66. package/legacy/components/panel/GridColumnsPanel.js +12 -2
  67. package/legacy/components/panel/GridPanelWrapper.js +3 -3
  68. package/legacy/components/panel/filterPanel/GridFilterForm.js +89 -8
  69. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
  70. package/legacy/components/panel/filterPanel/GridFilterPanel.js +27 -10
  71. package/legacy/components/toolbar/GridToolbarQuickFilter.js +68 -8
  72. package/legacy/constants/defaultGridSlotsComponents.js +4 -2
  73. package/legacy/constants/gridClasses.js +1 -1
  74. package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -10
  75. package/legacy/hooks/core/useGridStateInitialization.js +18 -6
  76. package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
  77. package/legacy/hooks/features/columns/useGridColumns.js +13 -15
  78. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +14 -7
  79. package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
  80. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +10 -4
  81. package/legacy/hooks/features/events/useGridEvents.js +2 -0
  82. package/legacy/hooks/features/filter/gridFilterSelector.js +8 -0
  83. package/legacy/hooks/features/filter/gridFilterUtils.js +4 -7
  84. package/legacy/hooks/features/filter/useGridFilter.js +33 -12
  85. package/legacy/hooks/features/pagination/useGridPage.js +1 -1
  86. package/legacy/hooks/features/pagination/useGridPageSize.js +1 -1
  87. package/legacy/hooks/features/rows/gridRowsUtils.js +55 -0
  88. package/legacy/hooks/features/rows/useGridRows.js +75 -111
  89. package/legacy/hooks/features/rows/useGridRowsMeta.js +104 -41
  90. package/legacy/hooks/features/selection/useGridSelection.js +1 -1
  91. package/legacy/hooks/features/sorting/useGridSorting.js +1 -1
  92. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +46 -22
  93. package/legacy/index.js +1 -1
  94. package/legacy/locales/heIL.js +9 -9
  95. package/legacy/locales/jaJP.js +28 -24
  96. package/legacy/locales/nbNO.js +127 -0
  97. package/legacy/locales/ruRU.js +9 -9
  98. package/legacy/locales/trTR.js +7 -7
  99. package/legacy/models/events/gridEvents.js +2 -0
  100. package/legacy/models/gridApiCaches.js +1 -0
  101. package/legacy/models/params/gridMenuParams.js +1 -0
  102. package/legacy/models/params/index.js +2 -1
  103. package/locales/heIL.js +9 -9
  104. package/locales/jaJP.js +24 -24
  105. package/locales/nbNO.d.ts +2 -0
  106. package/locales/nbNO.js +115 -0
  107. package/locales/ruRU.js +9 -9
  108. package/locales/trTR.js +7 -7
  109. package/models/api/gridCallbackDetails.d.ts +6 -1
  110. package/models/api/gridCoreApi.d.ts +2 -6
  111. package/models/api/gridFilterApi.d.ts +8 -1
  112. package/models/api/gridRowsMetaApi.d.ts +24 -0
  113. package/models/api/gridStateApi.d.ts +14 -3
  114. package/models/colDef/gridColDef.d.ts +3 -3
  115. package/models/events/gridEventLookup.d.ts +16 -1
  116. package/models/events/gridEvents.d.ts +3 -1
  117. package/models/events/gridEvents.js +2 -0
  118. package/models/gridApiCaches.d.ts +6 -0
  119. package/models/gridApiCaches.js +1 -0
  120. package/models/gridIconSlotsComponent.d.ts +10 -0
  121. package/models/params/gridMenuParams.d.ts +7 -0
  122. package/models/params/gridMenuParams.js +1 -0
  123. package/models/params/gridRowParams.d.ts +1 -1
  124. package/models/params/index.d.ts +1 -0
  125. package/models/params/index.js +2 -1
  126. package/models/props/DataGridProps.d.ts +24 -2
  127. package/modern/DataGrid/DataGrid.js +26 -1
  128. package/modern/components/GridRow.js +51 -12
  129. package/modern/components/base/GridOverlays.js +1 -1
  130. package/modern/components/cell/GridCell.js +12 -7
  131. package/modern/components/columnHeaders/GridColumnHeaderItem.js +4 -3
  132. package/modern/components/containers/GridRoot.js +25 -3
  133. package/modern/components/containers/GridRootStyles.js +7 -2
  134. package/modern/components/menu/GridMenu.js +9 -2
  135. package/modern/components/panel/GridColumnsPanel.js +10 -2
  136. package/modern/components/panel/GridPanelWrapper.js +3 -3
  137. package/modern/components/panel/filterPanel/GridFilterForm.js +88 -8
  138. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
  139. package/modern/components/panel/filterPanel/GridFilterPanel.js +25 -9
  140. package/modern/components/toolbar/GridToolbarQuickFilter.js +58 -6
  141. package/modern/constants/defaultGridSlotsComponents.js +4 -2
  142. package/modern/constants/gridClasses.js +1 -1
  143. package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -9
  144. package/modern/hooks/core/useGridStateInitialization.js +19 -6
  145. package/modern/hooks/features/columnMenu/useGridColumnMenu.js +22 -0
  146. package/modern/hooks/features/columns/useGridColumns.js +12 -14
  147. package/modern/hooks/features/editRows/useGridCellEditing.new.js +10 -3
  148. package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
  149. package/modern/hooks/features/editRows/useGridRowEditing.new.js +9 -3
  150. package/modern/hooks/features/events/useGridEvents.js +2 -0
  151. package/modern/hooks/features/filter/gridFilterSelector.js +6 -0
  152. package/modern/hooks/features/filter/gridFilterUtils.js +3 -6
  153. package/modern/hooks/features/filter/useGridFilter.js +29 -12
  154. package/modern/hooks/features/pagination/useGridPage.js +1 -1
  155. package/modern/hooks/features/pagination/useGridPageSize.js +1 -1
  156. package/modern/hooks/features/rows/gridRowsUtils.js +54 -0
  157. package/modern/hooks/features/rows/useGridRows.js +63 -102
  158. package/modern/hooks/features/rows/useGridRowsMeta.js +105 -37
  159. package/modern/hooks/features/selection/useGridSelection.js +1 -1
  160. package/modern/hooks/features/sorting/useGridSorting.js +1 -1
  161. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
  162. package/modern/index.js +1 -1
  163. package/modern/locales/heIL.js +9 -9
  164. package/modern/locales/jaJP.js +24 -24
  165. package/modern/locales/nbNO.js +115 -0
  166. package/modern/locales/ruRU.js +9 -9
  167. package/modern/locales/trTR.js +7 -7
  168. package/modern/models/events/gridEvents.js +2 -0
  169. package/modern/models/gridApiCaches.js +1 -0
  170. package/modern/models/params/gridMenuParams.js +1 -0
  171. package/modern/models/params/index.js +2 -1
  172. package/node/DataGrid/DataGrid.js +26 -1
  173. package/node/components/GridRow.js +53 -12
  174. package/node/components/base/GridOverlays.js +1 -1
  175. package/node/components/cell/GridCell.js +12 -7
  176. package/node/components/columnHeaders/GridColumnHeaderItem.js +4 -3
  177. package/node/components/containers/GridRoot.js +24 -3
  178. package/node/components/containers/GridRootStyles.js +7 -2
  179. package/node/components/menu/GridMenu.js +10 -2
  180. package/node/components/panel/GridColumnsPanel.js +10 -2
  181. package/node/components/panel/GridPanelWrapper.js +5 -3
  182. package/node/components/panel/filterPanel/GridFilterForm.js +91 -9
  183. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -1
  184. package/node/components/panel/filterPanel/GridFilterPanel.js +27 -9
  185. package/node/components/toolbar/GridToolbarQuickFilter.js +61 -6
  186. package/node/constants/defaultGridSlotsComponents.js +3 -1
  187. package/node/constants/gridClasses.js +1 -1
  188. package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +10 -8
  189. package/node/hooks/core/useGridStateInitialization.js +19 -6
  190. package/node/hooks/features/columnMenu/useGridColumnMenu.js +23 -0
  191. package/node/hooks/features/columns/useGridColumns.js +13 -15
  192. package/node/hooks/features/editRows/useGridCellEditing.new.js +11 -4
  193. package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
  194. package/node/hooks/features/editRows/useGridRowEditing.new.js +10 -4
  195. package/node/hooks/features/events/useGridEvents.js +2 -0
  196. package/node/hooks/features/filter/gridFilterSelector.js +9 -2
  197. package/node/hooks/features/filter/gridFilterUtils.js +4 -5
  198. package/node/hooks/features/filter/useGridFilter.js +28 -11
  199. package/node/hooks/features/pagination/useGridPage.js +1 -1
  200. package/node/hooks/features/pagination/useGridPageSize.js +1 -1
  201. package/node/hooks/features/rows/gridRowsUtils.js +67 -1
  202. package/node/hooks/features/rows/useGridRows.js +63 -99
  203. package/node/hooks/features/rows/useGridRowsMeta.js +107 -43
  204. package/node/hooks/features/selection/useGridSelection.js +1 -1
  205. package/node/hooks/features/sorting/useGridSorting.js +1 -1
  206. package/node/hooks/features/virtualization/useGridVirtualScroller.js +27 -7
  207. package/node/index.js +1 -1
  208. package/node/locales/heIL.js +9 -9
  209. package/node/locales/jaJP.js +24 -24
  210. package/node/locales/nbNO.js +125 -0
  211. package/node/locales/ruRU.js +9 -9
  212. package/node/locales/trTR.js +7 -7
  213. package/node/models/events/gridEvents.js +2 -0
  214. package/node/models/gridApiCaches.js +5 -0
  215. package/node/models/params/gridMenuParams.js +5 -0
  216. package/node/models/params/index.js +13 -0
  217. package/package.json +7 -5
package/CHANGELOG.md CHANGED
@@ -3,21 +3,247 @@
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.1
7
+
8
+ _Jun 9, 2022_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Add `reason` to `onFilterModelChange` (#4938) @m4theushw
13
+ - 🔎 Control quick filter input value via model prop (#5013) @alexfauquette
14
+ - 📚 Documentation improvements
15
+ - 🐞 Bugfixes
16
+
17
+ ### `@mui/x-data-grid@v5.12.1` / `@mui/x-data-grid-pro@v5.12.1` / `@mui/x-data-grid-premium@v5.12.1`
18
+
19
+ #### Changes
20
+
21
+ - [DataGrid] Add `reason` to `onFilterModelChange` (#4938) @m4theushw
22
+ - [DataGrid] Restore focus after dismissing the column menu (#5027) @m4theushw
23
+ - [DataGrid] Update quick filter input when model is modified (#5013) @alexfauquette
24
+ - [DataGrid] Fix implicit dependency on react-dom (#5121) @oliviertassinari
25
+ - [DataGrid] Support `getRowId` in row reordering (#5093) @flaviendelangle
26
+ - [DataGridPro] Fix column resizing in RTL mode (#4989) @cherniavskii
27
+ - [DataGridPro] Fix column resizing on touchscreen (#5056) @cherniavskii
28
+ - [l10n] Update Japanese (ja-JP) locale (#5122) @hikotq
29
+ - [l10n] Update Russian (ru-RU) locale (#5069) @Artboomy
30
+
31
+ ### `@mui/x-date-pickers@5.0.0-alpha.6` / `@mui/x-date-pickers-pro@5.0.0-alpha.6`
32
+
33
+ #### Changes
34
+
35
+ - [pickers] Fix usage of `maxDate` / `minDate` / `disableFuture` and `disablePast` (#5081) @flaviendelangle
36
+ - [pickers] Infer mask from `inputFormat` (#5060) @alexfauquette
37
+ - [pickers] Manage input value without using the focus (#4486) @alexfauquette
38
+ - [pickers] Use new localization for doc examples (#5097) @flaviendelangle
39
+ - [pickers] Fix `shouldDisableDate` in range pickers (#5123) @flaviendelangle
40
+ - [l10n] Add Brazilian Portuguese (pt-BR) locale (#5100) @jardelnovaes
41
+ - [l10n] Use `localText` for remaining texts (#4986) @alexfauquette
42
+
43
+ ### Docs
44
+
45
+ - [docs] Implement the focus management on data grid demo links (#5070) @alexfauquette
46
+ - [docs] Fix `301` link to render cell (#5106) @oliviertassinari
47
+ - [docs] Fix broken anchor link @oliviertassinari
48
+ - [docs] Improve movie dataset (#5142) @flaviendelangle
49
+ - [docs] Move all localization documentation in a unique page (#5072) @alexfauquette
50
+ - [docs] Section for overwriting core components i18n keys (#4998) @DanailH
51
+ - [docs] Small grammar and format fixes for Dynamic Row Height section (#5098) @samuelsycamore
52
+
53
+ ### Core
54
+
55
+ - [core] Allows to run tests with different date adapters (#5055) @alexfauquette
56
+ - [core] Prettify the l10n issue (#4928) @alexfauquette
57
+ - [core] Set correct `apiRef` type in row reorder pre processors #5125 @DanailH
58
+ - [core] Stop using `GridEvents` in technical doc (#5157) @flaviendelangle
59
+ - [core] Upgrade monorepo (#5101) @oliviertassinari
60
+ - [test] Fix dynamic row height test failing on Chrome (#5147) @m4theushw
61
+ - [test] Remove delay on server demo for regression tests (#5131) @alexfauquette
62
+
63
+ ## v5.12.0
64
+
65
+ _May 31, 2022_
66
+
67
+ We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
68
+
69
+ - 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/rows/#dynamic-row-height) (#4859) @m4theushw
70
+
71
+ <img src="https://user-images.githubusercontent.com/42154031/171183167-718d7bcd-ec0f-459e-97fe-0f650abb4a99.gif" width="800">
72
+
73
+ - ⚠️ Remove deprecated row grouping feature from `@mui/x-data-grid-pro`
74
+
75
+ Row grouping is available through the `@mui/x-data-grid-premium` package - see [Premium plan release blogpost](https://mui.com/blog/premium-plan-release/).
76
+
77
+ - 🐞 Bug fixes and improvements
78
+
79
+ ### `@mui/x-data-grid@v5.12.0` / `@mui/x-data-grid-pro@v5.12.0` / `@mui/x-data-grid-premium@v5.12.0`
80
+
81
+ #### Changes
82
+
83
+ - [DataGrid] Support dynamic row height (#4859) @m4theushw
84
+ - [DataGrid] Add `onMenuOpen` and `onMenuClose` props (#4825) @DanailH
85
+ - [DataGrid] Add generics to `GridActionsColDef` to match `GridColDef` (#4982) @subvertallchris
86
+ - [DataGrid] Disable drag event handlers when row or column reorder are disabled (#4857) @DanailH
87
+ - [DataGrid] Allow other attempts to stop edit mode if the first failed (#5016) @m4theushw
88
+ - [DataGrid] Better reflect the dependency on Material UI (#4795) @oliviertassinari
89
+ - [DataGrid] Add an id to the filter item created when opening the filter panel (#5014) @flaviendelangle
90
+ - [DataGrid] Use column visibility model on Hide All / Show All when enabled (#5050) @flaviendelangle
91
+ - [DataGridPro] Unpin columns back to original position (#4512) @m4theushw
92
+ - [DataGridPro] Remove experimental row grouping from Pro plan (#4949) @flaviendelangle
93
+ - [DataGridPro] Allow to scroll detail panel content if it overflows the panel (#4979) @cherniavskii
94
+ - [DataGridPro] Do not call `setRowIndex` when dragging a column over a row (#4987) @flaviendelangle
95
+ - [l10n] Add Norwegian (Bokmål) (nb-NO) locale (#5001) @spiftire
96
+ - [l10n] Add Turkish (tr-TR) locale (#5026) @Rassilion
97
+
98
+ ### `@mui/x-date-pickers@5.0.0-alpha.5` / `@mui/x-date-pickers-pro@5.0.0-alpha.5`
99
+
100
+ #### Breaking changes
101
+
102
+ - [pickers] Restructure props in `MonthPicker` / `YearPicker` and `DayPicker` (#4814) @flaviendelangle
103
+
104
+ The props of `MonthPicker` / `YearPicker` and `DayPicker` have been reworked to make them more consistent for a standalone usage (#4814) @flaviendelangle
105
+
106
+ **MonthPicker**: The prop `onMonthChange` has been removed, you can use `onChange` instead since every change is a month change
107
+
108
+ **YearPicker**: The prop `onYearPicker` has been removed, you can use `onChange` instead since every change is a year change
109
+
110
+ **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`)
111
+
112
+ #### Changes
113
+
114
+ - [pickers] Add German (de-DE) translations (#4974) @felixh10r
115
+ - [pickers] Support action bar on static pickers and improve typing (#5015) @flaviendelangle
116
+
117
+ ### Docs
118
+
119
+ - [docs] Add docs sections / pages for upcoming features on pickers (#4603) @flaviendelangle
120
+ - [docs] Add docs for filter panel components (#4919) @m4theushw
121
+ - [docs] Explain how to manage focus with `renderCell` (#4254) @alexfauquette
122
+ - [docs] Fix broken links to GitHub source (#5003) @Edwardveb
123
+ - [docs] Fix navigation links (#4956) @oliviertassinari
124
+ - [docs] Fix typo on rows docs (#4952) @jamesRadicl
125
+ - [docs] New WAI-ARIA guidelines location (#4957) @oliviertassinari
126
+ - [docs] Add "Slots" section to the right nav in the API pages (#4993) @DanailH
127
+ - [docs] Fix docs feedback widget not working (#4905) @cherniavskii
128
+ - [docs] Replace custom notes and warning with callouts (#5008) @flaviendelangle
129
+
130
+ ### Core
131
+
132
+ - [core] Avoid Order ID to refer to GitHub issues/PRs (#5005) @oliviertassinari
133
+ - [core] Improve the workflow for incomplete issues (#5012) @mnajdova
134
+ - [core] Remove dead code on row grouping tree creation (#4945) @flaviendelangle
135
+ - [core] Use new cache api for the row grouping last model tracking (#4980) @flaviendelangle
136
+ - [core] Ensure that PRs have atleast 1 label (#5011) @DanailH
137
+ - [core] Fix trailing-space @oliviertassinari
138
+ - [core] Stop Renovate PR updates when PR is on hold (#5020) @cherniavskii
139
+ - [license] Remove support for UTF-8 (#4893) @oliviertassinari
140
+ - [license] Tweak error messages (#4907) @mbrookes
141
+ - [test] Skip Safari and Firefox on broken tests (#4994) @alexfauquette
142
+ - [test] Make argos screenshots stable (#5061) @m4theushw
143
+
144
+ ## v5.11.1
145
+
146
+ _May 20, 2022_
147
+
148
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
149
+
150
+ - 🌍 Support localization on the date and time picker components (#4517) @alexfauquette
151
+
152
+ Texts can be translated in the pickers components, similar to what can be done in the data grid component. Check the [documentation](https://mui.com/x/react-date-pickers/localization/) for more information.
153
+
154
+ - 📃 Add support for column spanning when exporting to Excel (#4830) @cherniavskii
155
+
156
+ <img src="https://user-images.githubusercontent.com/13808724/167691417-bf6baeb9-d409-4134-acb6-aadaf6434de9.png" width="800">
157
+
158
+ - 🐞 Bugs fixes
159
+
160
+ ### `@mui/x-data-grid@v5.11.1` / `@mui/x-data-grid-pro@v5.11.1` / `@mui/x-data-grid-premium@v5.11.1`
161
+
162
+ #### Changes
163
+
164
+ - [DataGrid] Add a CSS class corresponding to current density (#4858) @m4theushw
165
+ - [DataGrid] Execute the pipe-processors in their initialization order (#4913) @flaviendelangle
166
+ - [DataGrid] Fix rendering of the no rows overlay when the `loading` prop is changed (#4910) @m4theushw
167
+ - [DataGridPremium] Add `exceljs` to the dependencies (#4939) @alexfauquette
168
+ - [DataGridPremium] Support column spanning in the Excel export (#4830) @cherniavskii
169
+ - [l10n] Improve Russian (ru-RU) locale (#4864) @arvkonstantin
170
+
171
+ ### `@mui/x-date-pickers@5.0.0-alpha.4` / `@mui/x-date-pickers-pro@5.0.0-alpha.4`
172
+
173
+ #### Breaking changes
174
+
175
+ - The props related to the action bar buttons have been removed (`clearable`, `showTodayButton`, `cancelText`, `okText`)
176
+
177
+ To decide which button must be displayed and in which order, you can now use the `actions` prop of the `actionBar` component slot props.
178
+
179
+ ```jsx
180
+ <DatePicker
181
+ componentsProps={{
182
+ actionBar: {
183
+ // The actions will be the same between desktop and mobile
184
+ actions: ['clear'],
185
+
186
+ // The actions will be different between desktop and mobile
187
+ actions: (variant) => (variant === 'desktop' ? [] : ['clear']),
188
+ },
189
+ }}
190
+ />
191
+ ```
192
+
193
+ The build-in `ActionBar` component supports 4 different actions: `'clear'`, `'cancel'`, `'accept'`, and `'today'`.
194
+ By default, the pickers will render the cancel and accept button on mobile and no action on desktop.
195
+
196
+ If you need other actions, you can provide your own component to the `ActionBar` component slot
197
+
198
+ ```jsx
199
+ <DatePicker components={{ ActionBar: CustomActionBar }} />
200
+ ```
201
+
202
+ #### Changes
203
+
204
+ - [DatePicker] Fix keyboard accessibility for first and last year (#4807) @alexfauquette
205
+ - [pickers] Add component slot for action bar (#4778) @alexfauquette
206
+ - [pickers] Add l10n support (#4517) @alexfauquette
207
+ - [pickers] Close Popper when pressing <kbd>Esc</kbd> inside a modal (#4499) @alexfauquette
208
+ - [pickers] Support class slots on toolbar components (#4855) @flaviendelangle
209
+ - [TimePicker] Fix time validation when current date is `null` (#4867) @flaviendelangle
210
+
211
+ ### Docs
212
+
213
+ - [docs] Add 301 redirect for columns page (#4940) @alexfauquette
214
+ - [docs] Avoid confusion with license key installation (#4891) @oliviertassinari
215
+ - [docs] Complete the instructions for pickers installation in readme (#4852) @alexfauquette
216
+ - [docs] Disable ads on paid-only pages (#4842) @flaviendelangle
217
+ - [docs] Don't redirect to localized doc on deploy preview (#4818) @m4theushw
218
+ - [docs] Limit `LICENSE` file to 80 char per line (#4873) @oliviertassinari
219
+ - [docs] Typo on OrderId @oliviertassinari
220
+ - [docs] Update feature comparison table (#4918) @cherniavskii
221
+
222
+ ### Core
223
+
224
+ - [core] Add new script to generate tree data rows from file tree (#4902) @flaviendelangle
225
+ - [core] Fix code style (#4874) @oliviertassinari
226
+ - [core] Fix React 18 peer dependency (#4908) @oliviertassinari
227
+ - [core] Fix link to the LICENSE file (#4875) @oliviertassinari
228
+ - [core] Fix transitive babel dependency (#4793) @oliviertassinari
229
+ - [core] New pipe processing `rowHydration` (#4896) @flaviendelangle
230
+ - [core] Remove dead code for the docs (#4791) @oliviertassinari
231
+ - [core] Run `yarn prettier` @oliviertassinari
232
+ - [core] Polishes on `CHANGELOG.md` (#4876) @oliviertassinari
233
+ - [core] Simplify rows cache management (#4933) @flaviendelangle
234
+ - [core] Use internal icons for quick filter (#4912) @alexfauquette
235
+
6
236
  ## v5.11.0
7
237
 
8
238
  _May 13, 2022_
9
239
 
10
240
  We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
11
241
 
12
- - 🚀 Premium plan release
13
-
14
- We’re happy to announce that the Premium plan is [finally out](https://mui.com/blog/premium-plan-release/)!
15
- With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
242
+ - 🚀 **Premium plan release**. We're happy to announce that the Premium plan is [finally out](https://mui.com/blog/premium-plan-release/)! With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
16
243
 
17
244
  This plan is available through the new `@mui/x-data-grid-premium` package, which contains the row grouping and the Excel export features.
18
245
 
19
- If you were already using the row grouping feature, you can upgrade by [installing](https://mui.com/x/react-data-grid/getting-started/#installation) `@mui/x-data-grid-premium` and replace `DataGridPro` with `DataGridPremium`, as follows.
20
- Note that the experimental flag is not required anymore to use the row grouping.
246
+ If you were already using the row grouping feature, you can upgrade by [installing](https://mui.com/x/react-data-grid/getting-started/#installation) `@mui/x-data-grid-premium` and replace `DataGridPro` with `DataGridPremium`, as follows. Note that the experimental flag is not required anymore to use the row grouping.
21
247
 
22
248
  ```diff
23
249
  -import { DataGridPro } from '@mui/x-data-grid-pro';
@@ -29,16 +255,11 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
29
255
 
30
256
  For more information about the revised pricing model please have a look at the [blog post](https://mui.com/blog/premium-plan-release/#the-new-licensing-model).
31
257
 
32
- - 👔 Add Excel export
33
-
34
- - 🔎 Quick filtering
35
-
36
- You can now add a quick filtering search bar to your grid.
37
- To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar.
258
+ - 👔 **Excel export**. You can find this new Premium feature at: https://mui.com/x/react-data-grid/export/#excel-export.
38
259
 
39
- More information about how to customize the filtering logic is in the [documentation](https://mui.com/x/react-data-grid/filtering/#quick-filter)
260
+ - 🔎 **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).
40
261
 
41
- ![image](https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png)
262
+ <img src="https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png" width="724">
42
263
 
43
264
  - 🐞 Bugs fixes
44
265
 
@@ -46,7 +267,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
46
267
 
47
268
  #### Breaking changes
48
269
 
49
- - Moving row grouping to premium package
270
+ - Move row grouping to the premium package (#4223) @flaviendelangle
50
271
 
51
272
  The use of `rowGrouping` in the `@mui/x-data-grid-pro` package is deprecated. The experimental flag will be removed in an upcoming release.
52
273
 
@@ -76,7 +297,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
76
297
 
77
298
  #### Breaking changes
78
299
 
79
- - Rework the auto-closing behavior of the pickers.
300
+ - Rework the auto-closing behavior of the pickers (#4408) @flaviendelangle
80
301
 
81
302
  The `disableCloseOnSelect` prop has been replaced by a new `closeOnSelect` prop which has the opposite behavior.
82
303
  The default behavior remains the same (close after the last step on desktop but not on mobile).
@@ -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,10 +19,9 @@ 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",
24
- "react": "^17.0.2 || ^18.0.0",
25
- "react-dom": "^17.0.2 || ^18.0.0"
22
+ "@mui/material": "^5.4.1",
23
+ "@mui/system": "^5.4.1",
24
+ "react": "^17.0.2 || ^18.0.0"
26
25
  },
27
26
  ```
28
27
 
@@ -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
@@ -71,7 +71,7 @@ export function GridOverlays() {
71
71
  overlay = /*#__PURE__*/_jsx(rootProps.components.NoResultsOverlay, _extends({}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.noResultsOverlay));
72
72
  }
73
73
 
74
- if (rootProps.loading) {
74
+ if (loading) {
75
75
  var _rootProps$components3;
76
76
 
77
77
  overlay = /*#__PURE__*/_jsx(rootProps.components.LoadingOverlay, _extends({}, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.loadingOverlay));
@@ -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,