@mui/x-data-grid-pro 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 (147) hide show
  1. package/CHANGELOG.md +199 -20
  2. package/DataGridPro/DataGridPro.js +26 -27
  3. package/DataGridPro/useDataGridProComponent.js +1 -8
  4. package/DataGridPro/useDataGridProProps.js +6 -27
  5. package/README.md +2 -2
  6. package/components/DataGridProColumnHeaders.js +10 -7
  7. package/components/DataGridProVirtualScroller.d.ts +1 -1
  8. package/components/DataGridProVirtualScroller.js +6 -3
  9. package/components/GridRowReorderCell.js +6 -6
  10. package/hooks/features/columnPinning/gridColumnPinningInterface.d.ts +6 -0
  11. package/hooks/features/columnPinning/useGridColumnPinning.d.ts +1 -1
  12. package/hooks/features/columnPinning/useGridColumnPinning.js +73 -28
  13. package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +67 -4
  14. package/hooks/features/columnResize/useGridColumnResize.js +32 -15
  15. package/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +2 -2
  16. package/hooks/features/detailPanel/useGridDetailPanel.d.ts +1 -1
  17. package/hooks/features/detailPanel/useGridDetailPanel.js +78 -18
  18. package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +5 -2
  19. package/hooks/features/rowReorder/useGridRowReorder.js +5 -1
  20. package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +2 -2
  21. package/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
  22. package/index.d.ts +0 -2
  23. package/index.js +2 -5
  24. package/internals/index.d.ts +0 -1
  25. package/internals/index.js +0 -1
  26. package/legacy/DataGridPro/DataGridPro.js +26 -27
  27. package/legacy/DataGridPro/useDataGridProComponent.js +1 -8
  28. package/legacy/DataGridPro/useDataGridProProps.js +1 -20
  29. package/legacy/components/DataGridProColumnHeaders.js +10 -7
  30. package/legacy/components/DataGridProVirtualScroller.js +6 -3
  31. package/legacy/components/GridRowReorderCell.js +8 -6
  32. package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +82 -33
  33. package/legacy/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +70 -5
  34. package/legacy/hooks/features/columnResize/useGridColumnResize.js +32 -15
  35. package/legacy/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +3 -1
  36. package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +78 -18
  37. package/legacy/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +5 -2
  38. package/legacy/hooks/features/rowReorder/useGridRowReorder.js +5 -1
  39. package/legacy/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
  40. package/legacy/index.js +2 -5
  41. package/legacy/internals/index.js +0 -1
  42. package/legacy/utils/releaseInfo.js +1 -1
  43. package/models/dataGridProProps.d.ts +0 -26
  44. package/models/gridApiPro.d.ts +1 -2
  45. package/models/gridStatePro.d.ts +0 -3
  46. package/modern/DataGridPro/DataGridPro.js +26 -27
  47. package/modern/DataGridPro/useDataGridProComponent.js +1 -8
  48. package/modern/DataGridPro/useDataGridProProps.js +1 -16
  49. package/modern/components/DataGridProColumnHeaders.js +11 -6
  50. package/modern/components/DataGridProVirtualScroller.js +6 -3
  51. package/modern/components/GridRowReorderCell.js +6 -6
  52. package/modern/hooks/features/columnPinning/useGridColumnPinning.js +73 -28
  53. package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +67 -4
  54. package/modern/hooks/features/columnResize/useGridColumnResize.js +32 -15
  55. package/modern/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +2 -2
  56. package/modern/hooks/features/detailPanel/useGridDetailPanel.js +76 -16
  57. package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +5 -2
  58. package/modern/hooks/features/rowReorder/useGridRowReorder.js +5 -1
  59. package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +2 -2
  60. package/modern/index.js +2 -5
  61. package/modern/internals/index.js +0 -1
  62. package/modern/utils/releaseInfo.js +1 -1
  63. package/node/DataGridPro/DataGridPro.js +26 -27
  64. package/node/DataGridPro/useDataGridProComponent.js +1 -11
  65. package/node/DataGridPro/useDataGridProProps.js +6 -28
  66. package/node/components/DataGridProColumnHeaders.js +11 -7
  67. package/node/components/DataGridProVirtualScroller.js +6 -3
  68. package/node/components/GridRowReorderCell.js +6 -6
  69. package/node/hooks/features/columnPinning/useGridColumnPinning.js +72 -24
  70. package/node/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +68 -5
  71. package/node/hooks/features/columnResize/useGridColumnResize.js +32 -14
  72. package/node/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +2 -2
  73. package/node/hooks/features/detailPanel/useGridDetailPanel.js +76 -17
  74. package/node/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +8 -2
  75. package/node/hooks/features/rowReorder/useGridRowReorder.js +5 -1
  76. package/node/hooks/features/treeData/useGridTreeDataPreProcessors.js +1 -1
  77. package/node/index.js +2 -30
  78. package/node/internals/index.js +0 -9
  79. package/node/utils/releaseInfo.js +1 -1
  80. package/package.json +8 -7
  81. package/typeOverloads/modules.d.ts +9 -21
  82. package/utils/releaseInfo.js +1 -1
  83. package/components/GridGroupingColumnLeafCell.d.ts +0 -4
  84. package/components/GridGroupingColumnLeafCell.js +0 -22
  85. package/components/GridGroupingCriteriaCell.d.ts +0 -7
  86. package/components/GridGroupingCriteriaCell.js +0 -78
  87. package/components/GridRowGroupableColumnMenuItems.d.ts +0 -11
  88. package/components/GridRowGroupableColumnMenuItems.js +0 -63
  89. package/components/GridRowGroupingColumnMenuItems.d.ts +0 -11
  90. package/components/GridRowGroupingColumnMenuItems.js +0 -58
  91. package/hooks/features/detailPanel/useGridDetailPanelCache.d.ts +0 -4
  92. package/hooks/features/detailPanel/useGridDetailPanelCache.js +0 -57
  93. package/hooks/features/rowGrouping/createGroupingColDef.d.ts +0 -43
  94. package/hooks/features/rowGrouping/createGroupingColDef.js +0 -318
  95. package/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +0 -37
  96. package/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +0 -1
  97. package/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +0 -4
  98. package/hooks/features/rowGrouping/gridRowGroupingSelector.js +0 -5
  99. package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +0 -27
  100. package/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -139
  101. package/hooks/features/rowGrouping/index.d.ts +0 -3
  102. package/hooks/features/rowGrouping/index.js +0 -3
  103. package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -11
  104. package/hooks/features/rowGrouping/useGridRowGrouping.js +0 -200
  105. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +0 -4
  106. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +0 -203
  107. package/legacy/components/GridGroupingColumnLeafCell.js +0 -20
  108. package/legacy/components/GridGroupingCriteriaCell.js +0 -74
  109. package/legacy/components/GridRowGroupableColumnMenuItems.js +0 -61
  110. package/legacy/components/GridRowGroupingColumnMenuItems.js +0 -56
  111. package/legacy/hooks/features/detailPanel/useGridDetailPanelCache.js +0 -57
  112. package/legacy/hooks/features/rowGrouping/createGroupingColDef.js +0 -319
  113. package/legacy/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +0 -1
  114. package/legacy/hooks/features/rowGrouping/gridRowGroupingSelector.js +0 -13
  115. package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -147
  116. package/legacy/hooks/features/rowGrouping/index.js +0 -3
  117. package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +0 -206
  118. package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +0 -217
  119. package/legacy/models/gridGroupingValueGetterParams.js +0 -1
  120. package/models/gridGroupingValueGetterParams.d.ts +0 -31
  121. package/models/gridGroupingValueGetterParams.js +0 -1
  122. package/modern/components/GridGroupingColumnLeafCell.js +0 -20
  123. package/modern/components/GridGroupingCriteriaCell.js +0 -76
  124. package/modern/components/GridRowGroupableColumnMenuItems.js +0 -61
  125. package/modern/components/GridRowGroupingColumnMenuItems.js +0 -56
  126. package/modern/hooks/features/detailPanel/useGridDetailPanelCache.js +0 -57
  127. package/modern/hooks/features/rowGrouping/createGroupingColDef.js +0 -302
  128. package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +0 -1
  129. package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.js +0 -5
  130. package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -137
  131. package/modern/hooks/features/rowGrouping/index.js +0 -3
  132. package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +0 -192
  133. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +0 -203
  134. package/modern/models/gridGroupingValueGetterParams.js +0 -1
  135. package/node/components/GridGroupingColumnLeafCell.js +0 -38
  136. package/node/components/GridGroupingCriteriaCell.js +0 -99
  137. package/node/components/GridRowGroupableColumnMenuItems.js +0 -82
  138. package/node/components/GridRowGroupingColumnMenuItems.js +0 -78
  139. package/node/hooks/features/detailPanel/useGridDetailPanelCache.js +0 -74
  140. package/node/hooks/features/rowGrouping/createGroupingColDef.js +0 -341
  141. package/node/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +0 -5
  142. package/node/hooks/features/rowGrouping/gridRowGroupingSelector.js +0 -18
  143. package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -172
  144. package/node/hooks/features/rowGrouping/index.js +0 -51
  145. package/node/hooks/features/rowGrouping/useGridRowGrouping.js +0 -228
  146. package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +0 -227
  147. package/node/models/gridGroupingValueGetterParams.js +0 -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
@@ -235,12 +235,6 @@ DataGridProRaw.propTypes = {
235
235
  */
236
236
  disableMultipleSelection: PropTypes.bool,
237
237
 
238
- /**
239
- * If `true`, the row grouping is disabled.
240
- * @default false
241
- */
242
- disableRowGrouping: PropTypes.bool,
243
-
244
238
  /**
245
239
  * If `true`, the selection on click on a row or cell is disabled.
246
240
  * @default false
@@ -276,7 +270,6 @@ DataGridProRaw.propTypes = {
276
270
  experimentalFeatures: PropTypes.shape({
277
271
  newEditingApi: PropTypes.bool,
278
272
  preventCommitWhileValidating: PropTypes.bool,
279
- rowGrouping: PropTypes.bool,
280
273
  warnIfFocusStateIsNotSynced: PropTypes.bool
281
274
  }),
282
275
 
@@ -330,6 +323,15 @@ DataGridProRaw.propTypes = {
330
323
  */
331
324
  getDetailPanelHeight: PropTypes.func,
332
325
 
326
+ /**
327
+ * Function that returns the estimated height for a row.
328
+ * Only works if dynamic row height is used.
329
+ * Once the row height is measured this value is discarded.
330
+ * @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
331
+ * @returns {number | null} The estimated row height value. If `null` or `undefined` then the default row height, based on the density, is applied.
332
+ */
333
+ getEstimatedRowHeight: PropTypes.func,
334
+
333
335
  /**
334
336
  * Function that applies CSS classes dynamically on rows.
335
337
  * @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
@@ -340,7 +342,7 @@ DataGridProRaw.propTypes = {
340
342
  /**
341
343
  * Function that sets the row height per row.
342
344
  * @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
343
- * @returns {GridRowHeightReturnValue} The row height value. If `null` or `undefined` then the default row height is applied.
345
+ * @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.
344
346
  */
345
347
  getRowHeight: PropTypes.func,
346
348
 
@@ -666,6 +668,22 @@ DataGridProRaw.propTypes = {
666
668
  */
667
669
  onFilterModelChange: PropTypes.func,
668
670
 
671
+ /**
672
+ * Callback fired when the menu is closed.
673
+ * @param {GridMenuParams} params With all properties from [[GridMenuParams]].
674
+ * @param {MuiEvent<{}>} event The event object.
675
+ * @param {GridCallbackDetails} details Additional details for this callback.
676
+ */
677
+ onMenuClose: PropTypes.func,
678
+
679
+ /**
680
+ * Callback fired when the menu is opened.
681
+ * @param {GridMenuParams} params With all properties from [[GridMenuParams]].
682
+ * @param {MuiEvent<{}>} event The event object.
683
+ * @param {GridCallbackDetails} details Additional details for this callback.
684
+ */
685
+ onMenuOpen: PropTypes.func,
686
+
669
687
  /**
670
688
  * Callback fired when the current page has changed.
671
689
  * @param {number} page Index of the page displayed on the Grid.
@@ -755,13 +773,6 @@ DataGridProRaw.propTypes = {
755
773
  */
756
774
  onRowEditStop: PropTypes.func,
757
775
 
758
- /**
759
- * Callback fired when the row grouping model changes.
760
- * @param {GridRowGroupingModel} model Columns used as grouping criteria.
761
- * @param {GridCallbackDetails} details Additional details for this callback.
762
- */
763
- onRowGroupingModelChange: PropTypes.func,
764
-
765
776
  /**
766
777
  * Callback fired when the `rowModesModel` prop changes.
767
778
  * @param {GridRowModesModel} rowModesModel Object containig which rows are in "edit" mode.
@@ -865,18 +876,6 @@ DataGridProRaw.propTypes = {
865
876
  */
866
877
  rowCount: PropTypes.number,
867
878
 
868
- /**
869
- * If `single`, all column we are grouping by will be represented in the same grouping the same column.
870
- * If `multiple`, each column we are grouping by will be represented in its own column.
871
- * @default 'single'
872
- */
873
- rowGroupingColumnMode: PropTypes.oneOf(['multiple', 'single']),
874
-
875
- /**
876
- * Set the row grouping model of the grid.
877
- */
878
- rowGroupingModel: PropTypes.arrayOf(PropTypes.string),
879
-
880
879
  /**
881
880
  * Set the height in pixel of a row in the grid.
882
881
  * @default 52
@@ -8,12 +8,9 @@ import { useGridTreeDataPreProcessors } from '../hooks/features/treeData/useGrid
8
8
  import { useGridColumnPinning, columnPinningStateInitializer } from '../hooks/features/columnPinning/useGridColumnPinning';
9
9
  import { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
10
10
  import { useGridDetailPanel, detailPanelStateInitializer } from '../hooks/features/detailPanel/useGridDetailPanel';
11
- import { useGridDetailPanelCache } from '../hooks/features/detailPanel/useGridDetailPanelCache';
12
11
  import { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
13
12
  import { useGridRowReorder } from '../hooks/features/rowReorder/useGridRowReorder';
14
13
  import { useGridRowReorderPreProcessors } from '../hooks/features/rowReorder/useGridRowReorderPreProcessors';
15
- import { useGridRowGrouping, rowGroupingStateInitializer } from '../hooks/features/rowGrouping/useGridRowGrouping';
16
- import { useGridRowGroupingPreProcessors } from '../hooks/features/rowGrouping/useGridRowGroupingPreProcessors';
17
14
  export const useDataGridProComponent = (inputApiRef, props) => {
18
15
  var _props$experimentalFe, _props$experimentalFe2;
19
16
 
@@ -24,7 +21,6 @@ export const useDataGridProComponent = (inputApiRef, props) => {
24
21
 
25
22
  useGridSelectionPreProcessors(apiRef, props);
26
23
  useGridRowReorderPreProcessors(apiRef, props);
27
- useGridRowGroupingPreProcessors(apiRef, props);
28
24
  useGridTreeDataPreProcessors(apiRef, props);
29
25
  useGridDetailPanelPreProcessors(apiRef, props); // The column pinning `hydrateColumns` pre-processor must be after every other `hydrateColumns` pre-processors
30
26
  // Because it changes the order of the columns.
@@ -35,7 +31,6 @@ export const useDataGridProComponent = (inputApiRef, props) => {
35
31
  * Register all state initializers here.
36
32
  */
37
33
 
38
- useGridInitializeState(rowGroupingStateInitializer, apiRef, props);
39
34
  useGridInitializeState(selectionStateInitializer, apiRef, props);
40
35
  useGridInitializeState(detailPanelStateInitializer, apiRef, props);
41
36
  useGridInitializeState(columnPinningStateInitializer, apiRef, props);
@@ -52,17 +47,15 @@ export const useDataGridProComponent = (inputApiRef, props) => {
52
47
  useGridInitializeState(paginationStateInitializer, apiRef, props);
53
48
  useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
54
49
  useGridInitializeState(columnMenuStateInitializer, apiRef, props);
55
- useGridRowGrouping(apiRef, props);
56
50
  useGridTreeData(apiRef);
57
51
  useGridKeyboardNavigation(apiRef, props);
58
52
  useGridSelection(apiRef, props);
59
- useGridDetailPanel(apiRef, props);
60
53
  useGridColumnPinning(apiRef, props);
61
54
  useGridColumns(apiRef, props);
62
55
  useGridRows(apiRef, props);
63
56
  useGridParamsApi(apiRef);
57
+ useGridDetailPanel(apiRef, props);
64
58
  useGridColumnSpanning(apiRef);
65
- useGridDetailPanelCache(apiRef, props);
66
59
  const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;
67
60
  useGridEditing(apiRef, props);
68
61
  useGridFocus(apiRef, props);
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { useThemeProps } from '@mui/material/styles';
4
4
  import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS, GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
5
- import { buildWarning } from '@mui/x-data-grid/internals';
6
5
 
7
6
  /**
8
7
  * The default values of `DataGridProPropsWithDefaultValue` to inject in the props of DataGridPro.
@@ -15,11 +14,8 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
15
14
  disableChildrenFiltering: false,
16
15
  disableChildrenSorting: false,
17
16
  rowReordering: false,
18
- getDetailPanelHeight: () => 500,
19
- disableRowGrouping: false,
20
- rowGroupingColumnMode: 'single'
17
+ getDetailPanelHeight: () => 500
21
18
  });
22
- const rowGroupingWarning = buildWarning(['MUI: The row grouping has been moved to the new `@mui/x-data-grid-premium` package.', 'The feature is deprecated in `@mui/x-data-grid-pro`, and it will soon be removed from this package.'], 'error');
23
19
  export const useDataGridProProps = inProps => {
24
20
  const themedProps = useThemeProps({
25
21
  props: inProps,
@@ -39,26 +35,9 @@ export const useDataGridProProps = inProps => {
39
35
  });
40
36
  return mergedComponents;
41
37
  }, [themedProps.components]);
42
-
43
- if (process.env.NODE_ENV !== 'production') {
44
- // eslint-disable-next-line react-hooks/rules-of-hooks
45
- React.useEffect(() => {
46
- var _themedProps$experime;
47
-
48
- if ((_themedProps$experime = themedProps.experimentalFeatures) != null && _themedProps$experime.rowGrouping) {
49
- rowGroupingWarning();
50
- }
51
- }, [themedProps.experimentalFeatures]);
52
- }
53
-
54
- return React.useMemo(() => {
55
- var _themedProps$experime2;
56
-
57
- return _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
58
- disableRowGrouping: themedProps.disableRowGrouping || !((_themedProps$experime2 = themedProps.experimentalFeatures) != null && _themedProps$experime2.rowGrouping),
59
- localeText,
60
- components,
61
- signature: 'DataGridPro'
62
- });
63
- }, [themedProps, localeText, components]);
38
+ return React.useMemo(() => _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
39
+ localeText,
40
+ components,
41
+ signature: 'DataGridPro'
42
+ }), [themedProps, localeText, components]);
64
43
  };
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
  ```
@@ -4,6 +4,7 @@ const _excluded = ["style", "className", "innerRef"];
4
4
  import * as React from 'react';
5
5
  import { unstable_composeClasses as composeClasses } from '@mui/material';
6
6
  import { styled, alpha } from '@mui/material/styles';
7
+ import { useEventCallback } from '@mui/material/utils';
7
8
  import { getDataGridUtilityClass, gridClasses, useGridSelector, useGridApiEventHandler, gridVisibleColumnFieldsSelector, GridColumnHeaderSeparatorSides } from '@mui/x-data-grid';
8
9
  import { GridColumnHeaders, GridColumnHeadersInner, useGridColumnHeaders } from '@mui/x-data-grid/internals';
9
10
  import { useGridRootProps } from '../hooks/utils/useGridRootProps';
@@ -76,17 +77,19 @@ export const DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function D
76
77
  const apiRef = useGridApiContext();
77
78
  const visibleColumnFields = useGridSelector(apiRef, gridVisibleColumnFieldsSelector);
78
79
  const [scrollbarSize, setScrollbarSize] = React.useState(0);
79
- const handleContentSizeChange = React.useCallback(() => {
80
- var _apiRef$current$windo;
80
+ const handleContentSizeChange = useEventCallback(() => {
81
+ const rootDimensions = apiRef.current.getRootDimensions();
81
82
 
82
- if (!((_apiRef$current$windo = apiRef.current.windowRef) != null && _apiRef$current$windo.current)) {
83
+ if (!rootDimensions) {
83
84
  return;
84
- } // TODO expose scrollbar size on getRootDimensions
85
+ }
85
86
 
87
+ const newScrollbarSize = rootDimensions.hasScrollY ? rootDimensions.scrollBarSize : 0;
86
88
 
87
- const newScrollbarSize = apiRef.current.windowRef.current.offsetWidth - apiRef.current.windowRef.current.clientWidth;
88
- setScrollbarSize(newScrollbarSize);
89
- }, [apiRef]);
89
+ if (scrollbarSize !== newScrollbarSize) {
90
+ setScrollbarSize(newScrollbarSize);
91
+ }
92
+ });
90
93
  useGridApiEventHandler(apiRef, 'virtualScrollerContentSizeChange', handleContentSizeChange);
91
94
  const pinnedColumns = useGridSelector(apiRef, gridPinnedColumnsSelector);
92
95
  const [leftPinnedColumns, rightPinnedColumns] = filterColumns(pinnedColumns, visibleColumnFields);
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { GridPinnedColumns } from '../hooks/features/columnPinning';
3
- export declare const filterColumns: (pinnedColumns: GridPinnedColumns, columns: string[]) => any[][];
3
+ export declare const filterColumns: (pinnedColumns: GridPinnedColumns, columns: string[]) => [string[], string[]];
4
4
  interface DataGridProVirtualScrollerProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  disableVirtualization?: boolean;
6
6
  }
@@ -84,7 +84,8 @@ const VirtualScrollerDetailPanel = styled(Box, {
84
84
  zIndex: 2,
85
85
  width: '100%',
86
86
  position: 'absolute',
87
- backgroundColor: theme.palette.background.default
87
+ backgroundColor: theme.palette.background.default,
88
+ overflow: 'auto'
88
89
  }));
89
90
  const VirtualScrollerPinnedColumns = styled('div', {
90
91
  name: 'MuiDataGrid',
@@ -241,7 +242,8 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
241
242
  renderContext: leftRenderContext,
242
243
  minFirstColumn: leftRenderContext.firstColumnIndex,
243
244
  maxLastColumn: leftRenderContext.lastColumnIndex,
244
- availableSpace: 0
245
+ availableSpace: 0,
246
+ ignoreAutoHeight: true
245
247
  })
246
248
  }), /*#__PURE__*/_jsx(GridVirtualScrollerRenderZone, _extends({}, getRenderZoneProps(), {
247
249
  children: getRows({
@@ -258,7 +260,8 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
258
260
  renderContext: rightRenderContext,
259
261
  minFirstColumn: rightRenderContext.firstColumnIndex,
260
262
  maxLastColumn: rightRenderContext.lastColumnIndex,
261
- availableSpace: 0
263
+ availableSpace: 0,
264
+ ignoreAutoHeight: true
262
265
  })
263
266
  }), detailPanels.length > 0 && /*#__PURE__*/_jsx(VirtualScrollerDetailPanels, {
264
267
  className: classes.detailPanels,
@@ -27,7 +27,7 @@ const GridRowReorderCell = params => {
27
27
 
28
28
  const cellValue = params.row.__reorder__ || params.id; // TODO: remove sortModel and treeDepth checks once row reorder is compatible
29
29
 
30
- const isDraggable = !!rootProps.rowReordering && !sortModel.length && treeDepth === 1 && Object.keys(editRowsState).length === 0;
30
+ const isDraggable = React.useMemo(() => !!rootProps.rowReordering && !sortModel.length && treeDepth === 1 && Object.keys(editRowsState).length === 0, [rootProps.rowReordering, sortModel, treeDepth, editRowsState]);
31
31
  const ownerState = {
32
32
  isDraggable,
33
33
  classes: rootProps.classes
@@ -42,21 +42,21 @@ const GridRowReorderCell = params => {
42
42
  } // The row might have been deleted
43
43
 
44
44
 
45
- if (!apiRef.current.getRow(params.row.id)) {
45
+ if (!apiRef.current.getRow(params.id)) {
46
46
  return;
47
47
  }
48
48
 
49
- apiRef.current.publishEvent(eventName, apiRef.current.getRowParams(params.row.id), event);
49
+ apiRef.current.publishEvent(eventName, apiRef.current.getRowParams(params.id), event);
50
50
 
51
51
  if (propHandler) {
52
52
  propHandler(event);
53
53
  }
54
- }, [apiRef, params.row.id]);
55
- const draggableEventHandlers = {
54
+ }, [apiRef, params.id]);
55
+ const draggableEventHandlers = isDraggable ? {
56
56
  onDragStart: publish('rowDragStart'),
57
57
  onDragOver: publish('rowDragOver'),
58
58
  onDragEnd: publish('rowDragEnd')
59
- };
59
+ } : null;
60
60
  return /*#__PURE__*/_jsxs("div", _extends({
61
61
  className: classes.root,
62
62
  draggable: isDraggable
@@ -39,4 +39,10 @@ export interface GridColumnPinningApi {
39
39
  */
40
40
  isColumnPinned: (field: string) => GridPinnedPosition | false;
41
41
  }
42
+ export interface GridColumnPinningInternalCache {
43
+ /**
44
+ * Stores the fields in their original position, before being pinned.
45
+ */
46
+ orderedFieldsBeforePinningColumns: string[] | null;
47
+ }
42
48
  export { GridPinnedPosition };
@@ -3,4 +3,4 @@ import { GridStateInitializer } from '@mui/x-data-grid/internals';
3
3
  import { GridApiPro } from '../../../models/gridApiPro';
4
4
  import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
5
5
  export declare const columnPinningStateInitializer: GridStateInitializer<Pick<DataGridProProcessedProps, 'pinnedColumns' | 'initialState' | 'disableColumnPinning'>>;
6
- export declare const useGridColumnPinning: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, 'initialState' | 'disableColumnPinning' | 'pinnedColumns' | 'onPinnedColumnsChange'>) => void;
6
+ export declare const useGridColumnPinning: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, 'disableColumnPinning' | 'pinnedColumns' | 'onPinnedColumnsChange'>) => void;