@mui/x-data-grid 5.14.0 → 5.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/CHANGELOG.md +62 -5
  2. package/DataGrid/DataGrid.js +6 -0
  3. package/DataGrid/useDataGridProps.js +1 -0
  4. package/colDef/gridStringColDef.js +1 -1
  5. package/components/GridRow.js +5 -1
  6. package/components/base/GridOverlays.js +2 -2
  7. package/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
  8. package/components/containers/GridRoot.js +4 -2
  9. package/constants/gridClasses.d.ts +16 -0
  10. package/constants/gridClasses.js +1 -1
  11. package/constants/localeTextConstants.js +1 -1
  12. package/hooks/features/dimensions/useGridDimensions.js +6 -1
  13. package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
  14. package/hooks/features/editRows/useGridCellEditing.new.js +6 -3
  15. package/hooks/features/editRows/useGridEditing.new.d.ts +1 -1
  16. package/hooks/features/editRows/useGridEditing.new.js +4 -0
  17. package/hooks/features/editRows/useGridEditing.old.js +1 -1
  18. package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
  19. package/hooks/features/editRows/useGridRowEditing.new.js +2 -2
  20. package/hooks/features/export/utils.js +8 -1
  21. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  22. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +42 -34
  23. package/hooks/features/pagination/useGridPageSize.js +3 -1
  24. package/hooks/features/rows/gridRowsSelector.d.ts +14 -0
  25. package/hooks/features/rows/gridRowsSelector.js +20 -1
  26. package/hooks/features/rows/gridRowsState.d.ts +8 -1
  27. package/hooks/features/rows/gridRowsUtils.d.ts +4 -0
  28. package/hooks/features/rows/gridRowsUtils.js +21 -3
  29. package/hooks/features/rows/index.d.ts +1 -1
  30. package/hooks/features/rows/index.js +1 -1
  31. package/hooks/features/rows/useGridRowsMeta.js +19 -4
  32. package/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
  33. package/hooks/features/scroll/useGridScroll.js +7 -2
  34. package/hooks/features/selection/useGridSelection.js +7 -3
  35. package/hooks/features/sorting/useGridSorting.js +8 -0
  36. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -1
  37. package/hooks/features/virtualization/useGridVirtualScroller.js +31 -16
  38. package/index.js +1 -1
  39. package/internals/index.d.ts +4 -1
  40. package/internals/index.js +3 -0
  41. package/legacy/DataGrid/DataGrid.js +6 -0
  42. package/legacy/DataGrid/useDataGridProps.js +1 -0
  43. package/legacy/colDef/gridStringColDef.js +1 -1
  44. package/legacy/components/GridRow.js +5 -1
  45. package/legacy/components/base/GridOverlays.js +2 -2
  46. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
  47. package/legacy/components/containers/GridRoot.js +4 -2
  48. package/legacy/constants/gridClasses.js +1 -1
  49. package/legacy/constants/localeTextConstants.js +1 -1
  50. package/legacy/hooks/features/dimensions/useGridDimensions.js +6 -1
  51. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +6 -3
  52. package/legacy/hooks/features/editRows/useGridEditing.new.js +4 -0
  53. package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
  54. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +2 -2
  55. package/legacy/hooks/features/export/utils.js +13 -1
  56. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +47 -34
  57. package/legacy/hooks/features/pagination/useGridPageSize.js +3 -1
  58. package/legacy/hooks/features/rows/gridRowsSelector.js +23 -0
  59. package/legacy/hooks/features/rows/gridRowsUtils.js +21 -3
  60. package/legacy/hooks/features/rows/index.js +1 -1
  61. package/legacy/hooks/features/rows/useGridRowsMeta.js +19 -4
  62. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
  63. package/legacy/hooks/features/scroll/useGridScroll.js +7 -2
  64. package/legacy/hooks/features/selection/useGridSelection.js +7 -3
  65. package/legacy/hooks/features/sorting/useGridSorting.js +8 -0
  66. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +32 -16
  67. package/legacy/index.js +1 -1
  68. package/legacy/internals/index.js +3 -0
  69. package/legacy/locales/arSD.js +1 -1
  70. package/legacy/locales/bgBG.js +1 -1
  71. package/legacy/locales/csCZ.js +1 -1
  72. package/legacy/locales/daDK.js +1 -1
  73. package/legacy/locales/deDE.js +1 -1
  74. package/legacy/locales/elGR.js +1 -1
  75. package/legacy/locales/esES.js +1 -1
  76. package/legacy/locales/faIR.js +1 -1
  77. package/legacy/locales/fiFI.js +1 -1
  78. package/legacy/locales/frFR.js +1 -1
  79. package/legacy/locales/heIL.js +1 -1
  80. package/legacy/locales/huHU.js +1 -1
  81. package/legacy/locales/itIT.js +1 -1
  82. package/legacy/locales/jaJP.js +3 -3
  83. package/legacy/locales/koKR.js +1 -1
  84. package/legacy/locales/nbNO.js +1 -1
  85. package/legacy/locales/nlNL.js +1 -1
  86. package/legacy/locales/plPL.js +1 -1
  87. package/legacy/locales/ptBR.js +1 -1
  88. package/legacy/locales/roRO.js +1 -1
  89. package/legacy/locales/ruRU.js +1 -1
  90. package/legacy/locales/skSK.js +1 -1
  91. package/legacy/locales/svSE.js +1 -1
  92. package/legacy/locales/trTR.js +1 -1
  93. package/legacy/locales/ukUA.js +1 -1
  94. package/legacy/locales/viVN.js +1 -1
  95. package/legacy/locales/zhCN.js +37 -33
  96. package/legacy/locales/zhTW.js +1 -1
  97. package/locales/arSD.js +1 -1
  98. package/locales/bgBG.js +1 -1
  99. package/locales/csCZ.js +1 -1
  100. package/locales/daDK.js +1 -1
  101. package/locales/deDE.js +1 -1
  102. package/locales/elGR.js +1 -1
  103. package/locales/esES.js +1 -1
  104. package/locales/faIR.js +1 -1
  105. package/locales/fiFI.js +1 -1
  106. package/locales/frFR.js +1 -1
  107. package/locales/heIL.js +1 -1
  108. package/locales/huHU.js +1 -1
  109. package/locales/itIT.js +1 -1
  110. package/locales/jaJP.js +3 -3
  111. package/locales/koKR.js +1 -1
  112. package/locales/nbNO.js +1 -1
  113. package/locales/nlNL.js +1 -1
  114. package/locales/plPL.js +1 -1
  115. package/locales/ptBR.js +1 -1
  116. package/locales/roRO.js +1 -1
  117. package/locales/ruRU.js +1 -1
  118. package/locales/skSK.js +1 -1
  119. package/locales/svSE.js +1 -1
  120. package/locales/trTR.js +1 -1
  121. package/locales/ukUA.js +1 -1
  122. package/locales/viVN.js +1 -1
  123. package/locales/zhCN.js +33 -33
  124. package/locales/zhTW.js +1 -1
  125. package/models/gridRows.d.ts +5 -0
  126. package/models/props/DataGridProps.d.ts +5 -0
  127. package/modern/DataGrid/DataGrid.js +6 -0
  128. package/modern/DataGrid/useDataGridProps.js +1 -0
  129. package/modern/colDef/gridStringColDef.js +1 -1
  130. package/modern/components/GridRow.js +5 -1
  131. package/modern/components/base/GridOverlays.js +2 -2
  132. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
  133. package/modern/components/containers/GridRoot.js +4 -2
  134. package/modern/constants/gridClasses.js +1 -1
  135. package/modern/constants/localeTextConstants.js +1 -1
  136. package/modern/hooks/features/dimensions/useGridDimensions.js +6 -1
  137. package/modern/hooks/features/editRows/useGridCellEditing.new.js +4 -3
  138. package/modern/hooks/features/editRows/useGridEditing.new.js +4 -0
  139. package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
  140. package/modern/hooks/features/editRows/useGridRowEditing.new.js +2 -2
  141. package/modern/hooks/features/export/utils.js +6 -1
  142. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +42 -30
  143. package/modern/hooks/features/pagination/useGridPageSize.js +3 -1
  144. package/modern/hooks/features/rows/gridRowsSelector.js +18 -1
  145. package/modern/hooks/features/rows/gridRowsUtils.js +19 -3
  146. package/modern/hooks/features/rows/index.js +1 -1
  147. package/modern/hooks/features/rows/useGridRowsMeta.js +17 -4
  148. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
  149. package/modern/hooks/features/scroll/useGridScroll.js +5 -2
  150. package/modern/hooks/features/selection/useGridSelection.js +7 -1
  151. package/modern/hooks/features/sorting/useGridSorting.js +8 -0
  152. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +30 -15
  153. package/modern/index.js +1 -1
  154. package/modern/internals/index.js +3 -0
  155. package/modern/locales/arSD.js +1 -1
  156. package/modern/locales/bgBG.js +1 -1
  157. package/modern/locales/csCZ.js +1 -1
  158. package/modern/locales/daDK.js +1 -1
  159. package/modern/locales/deDE.js +1 -1
  160. package/modern/locales/elGR.js +1 -1
  161. package/modern/locales/esES.js +1 -1
  162. package/modern/locales/faIR.js +1 -1
  163. package/modern/locales/fiFI.js +1 -1
  164. package/modern/locales/frFR.js +1 -1
  165. package/modern/locales/heIL.js +1 -1
  166. package/modern/locales/huHU.js +1 -1
  167. package/modern/locales/itIT.js +1 -1
  168. package/modern/locales/jaJP.js +3 -3
  169. package/modern/locales/koKR.js +1 -1
  170. package/modern/locales/nbNO.js +1 -1
  171. package/modern/locales/nlNL.js +1 -1
  172. package/modern/locales/plPL.js +1 -1
  173. package/modern/locales/ptBR.js +1 -1
  174. package/modern/locales/roRO.js +1 -1
  175. package/modern/locales/ruRU.js +1 -1
  176. package/modern/locales/skSK.js +1 -1
  177. package/modern/locales/svSE.js +1 -1
  178. package/modern/locales/trTR.js +1 -1
  179. package/modern/locales/ukUA.js +1 -1
  180. package/modern/locales/viVN.js +1 -1
  181. package/modern/locales/zhCN.js +33 -33
  182. package/modern/locales/zhTW.js +1 -1
  183. package/node/DataGrid/DataGrid.js +6 -0
  184. package/node/DataGrid/useDataGridProps.js +1 -0
  185. package/node/colDef/gridStringColDef.js +1 -1
  186. package/node/components/GridRow.js +5 -1
  187. package/node/components/base/GridOverlays.js +2 -2
  188. package/node/components/columnSelection/GridCellCheckboxRenderer.js +5 -0
  189. package/node/components/containers/GridRoot.js +3 -1
  190. package/node/constants/gridClasses.js +1 -1
  191. package/node/constants/localeTextConstants.js +1 -1
  192. package/node/hooks/features/dimensions/useGridDimensions.js +7 -1
  193. package/node/hooks/features/editRows/useGridCellEditing.new.js +6 -3
  194. package/node/hooks/features/editRows/useGridEditing.new.js +4 -0
  195. package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
  196. package/node/hooks/features/editRows/useGridRowEditing.new.js +2 -2
  197. package/node/hooks/features/export/utils.js +7 -0
  198. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +43 -34
  199. package/node/hooks/features/pagination/useGridPageSize.js +4 -1
  200. package/node/hooks/features/rows/gridRowsSelector.js +24 -2
  201. package/node/hooks/features/rows/gridRowsUtils.js +23 -2
  202. package/node/hooks/features/rows/index.js +70 -12
  203. package/node/hooks/features/rows/useGridRowsMeta.js +20 -4
  204. package/node/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
  205. package/node/hooks/features/scroll/useGridScroll.js +7 -1
  206. package/node/hooks/features/selection/useGridSelection.js +7 -3
  207. package/node/hooks/features/sorting/useGridSorting.js +8 -0
  208. package/node/hooks/features/virtualization/useGridVirtualScroller.js +31 -16
  209. package/node/index.js +1 -1
  210. package/node/internals/index.js +28 -0
  211. package/node/locales/arSD.js +1 -1
  212. package/node/locales/bgBG.js +1 -1
  213. package/node/locales/csCZ.js +1 -1
  214. package/node/locales/daDK.js +1 -1
  215. package/node/locales/deDE.js +1 -1
  216. package/node/locales/elGR.js +1 -1
  217. package/node/locales/esES.js +1 -1
  218. package/node/locales/faIR.js +1 -1
  219. package/node/locales/fiFI.js +1 -1
  220. package/node/locales/frFR.js +1 -1
  221. package/node/locales/heIL.js +1 -1
  222. package/node/locales/huHU.js +1 -1
  223. package/node/locales/itIT.js +1 -1
  224. package/node/locales/jaJP.js +3 -3
  225. package/node/locales/koKR.js +1 -1
  226. package/node/locales/nbNO.js +1 -1
  227. package/node/locales/nlNL.js +1 -1
  228. package/node/locales/plPL.js +1 -1
  229. package/node/locales/ptBR.js +1 -1
  230. package/node/locales/roRO.js +1 -1
  231. package/node/locales/ruRU.js +1 -1
  232. package/node/locales/skSK.js +1 -1
  233. package/node/locales/svSE.js +1 -1
  234. package/node/locales/trTR.js +1 -1
  235. package/node/locales/ukUA.js +1 -1
  236. package/node/locales/viVN.js +1 -1
  237. package/node/locales/zhCN.js +33 -33
  238. package/node/locales/zhTW.js +1 -1
  239. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,63 @@
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
+ ## 5.15.0
7
+
8
+ _Jul 29, 2022_
9
+
10
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Introduce aggregation (#5592) @flaviendelangle
13
+
14
+ Premium users can now aggregate data in the grid.
15
+ Extract information like sum, average, count, and others with a couple of clicks.
16
+
17
+ https://user-images.githubusercontent.com/45398769/181581503-77cc412e-9d9e-4de1-8bc3-c3bccc54cdaa.mp4
18
+
19
+ To enable this feature, add `experimentalFeatures={{ aggregation: true }}`.
20
+ Aggregation functions are customizable and they combine well with row grouping.
21
+ See the [documentation](https://mui.com/x/react-data-grid/aggregation/) to explore everything it has to offer.
22
+
23
+ - 🚀 Introduce row pinning (#4863) @cherniavskii
24
+
25
+ Pro users can now pin rows on top or bottom of the grid.
26
+
27
+ https://user-images.githubusercontent.com/45398769/181581493-56c733a3-6dd5-4546-bf8d-3f2dff72b14a.mp4
28
+
29
+ To do so, enable the feature with `experimentalFeatures={{ rowPinning: true }}` and provide the pinned rows data to the `pinnedRows` prop.
30
+ For more details, see the [documentation](https://mui.com/x/react-data-grid/row-pinning/).
31
+
32
+ - 🌍 Add simplified Chinese (zh-CN) locale to pickers (#5584) @gamecss
33
+ - 📚 Documentation improvements
34
+
35
+ ### `@mui/x-data-grid@v5.15.0` / `@mui/x-data-grid-pro@v5.15.0` / `@mui/x-data-grid-premium@v5.15.0`
36
+
37
+ #### Changes
38
+
39
+ - [DataGrid] Add prop to keep modifications while processing props (#5309) @m4theushw
40
+ - [DataGrid] Fix container width change on React 18 (#5566) @m4theushw
41
+ - [DataGrid] Fix ellipsis style convention (#5587) @oliviertassinari
42
+ - [DataGridPro] Implement row pinning (#4863) @cherniavskii
43
+ - [DataGridPremium] Make aggregation public (#5592) @cherniavskii
44
+ - [l10n] Improve simplified Chinese (zh-CN) locale (#5584) @gamecss
45
+
46
+ ### `@mui/x-date-pickers@v5.0.0-beta.3` / `@mui/x-date-picker-pro@5.0.0-beta.3`
47
+
48
+ #### Changes
49
+
50
+ - [l10n] Add simplified Chinese (zh-CN) locale (#5584) @gamecss
51
+
52
+ ### Docs
53
+
54
+ - [docs] Split docs page about rows (#5195) @flaviendelangle
55
+ - [docs] Add warning clarifications (#5399) @alexfauquette
56
+ - [docs] Correct slot CSS classes for Pro and Premium components (#5452) @alexfauquette
57
+ - [docs] Fix internal link to `valueParser` (#5450) @alexfauquette
58
+
59
+ ### Core
60
+
61
+ - [core] Upgrade monorepo (#5560) @m4theushw
62
+
6
63
  ## 5.14.0
7
64
 
8
65
  _Jul 21, 2022_
@@ -306,7 +363,7 @@ _May 31, 2022_
306
363
 
307
364
  We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
308
365
 
309
- - 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/rows/#dynamic-row-height) (#4859) @m4theushw
366
+ - 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/row-height/#dynamic-row-height) (#4859) @m4theushw
310
367
 
311
368
  <img src="https://user-images.githubusercontent.com/42154031/171183167-718d7bcd-ec0f-459e-97fe-0f650abb4a99.gif" width="800">
312
369
 
@@ -623,7 +680,7 @@ _Apr 25, 2022_
623
680
 
624
681
  We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
625
682
 
626
- - 🎁 Introduce [Row reorder](https://mui.com/x/react-data-grid/rows/#row-reorder) (#4034) @DanailH
683
+ - 🎁 Introduce [Row reorder](https://mui.com/x/react-data-grid/row-ordering/) (#4034) @DanailH
627
684
 
628
685
  <img src="https://user-images.githubusercontent.com/5858539/165091263-23472fbb-a989-44b8-849a-d2185adfe13b.gif" width="800">
629
686
 
@@ -887,7 +944,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
887
944
  <DataGrid getRowSpacing={() => ({ top: 10, bottom: 10 })} />
888
945
  ```
889
946
 
890
- Check the [documentation](https://mui.com/x/react-data-grid/rows/#row-spacing) for more information.
947
+ Check the [documentation](https://mui.com/x/react-data-grid/row-height/#row-spacing) for more information.
891
948
 
892
949
  ### `@mui/x-data-grid@v5.6.1` / `@mui/x-data-grid-pro@v5.6.1`
893
950
 
@@ -1141,7 +1198,7 @@ _Jan 28, 2022_
1141
1198
 
1142
1199
  A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
1143
1200
 
1144
- - 🚣 Introduce [variable row height](https://mui.com/x/react-data-grid/rows/#variable-row-height) (#438) @DanailH
1201
+ - 🚣 Introduce [variable row height](https://mui.com/x/react-data-grid/row-height/#variable-row-height) (#438) @DanailH
1145
1202
 
1146
1203
  Allows for setting a row-specific height.
1147
1204
  By default, all rows have the same height, but now you can set the height on a per-row basis.
@@ -3793,7 +3850,7 @@ Big thanks to the 7 contributors who made this release possible. Here are some h
3793
3850
  - 🎁 Add `onRowsScrollEnd` to support infinite loading (#1199) @DanailH
3794
3851
  This is an XGrid feature. Provides the ability to tap into the `onRowsScrollEnd` which is called when the scroll reaches the bottom of the grid viewport allowing developers to load additional data. It can be used with a combination of `scrollBottomThreshold` to control the area in which the `onRowsScrollEnd` is called.
3795
3852
 
3796
- See the documentation for [more details](https://mui.com/x/react-data-grid/rows/#infinite-loading).
3853
+ See the documentation for [more details](https://mui.com/x/react-data-grid/row-updates/#infinite-loading).
3797
3854
 
3798
3855
  - 🕹 Provide the ability to sort by multiple columns using Shift+click (#1203) @dtassone
3799
3856
  - 🇵🇱 Added pl-PL locale (#1117) @LarsKumbier
@@ -155,6 +155,12 @@ DataGridRaw.propTypes = {
155
155
  */
156
156
  disableExtendRowFullWidth: PropTypes.bool,
157
157
 
158
+ /**
159
+ * If `true`, modification to a cell will not be discarded if the mode is changed from "edit" to "view" while processing props.
160
+ * @default false
161
+ */
162
+ disableIgnoreModificationsIfProcessingProps: PropTypes.bool,
163
+
158
164
  /**
159
165
  * If `true`, the selection on click on a row or cell is disabled.
160
166
  * @default false
@@ -41,6 +41,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
41
41
  disableMultipleColumnsSorting: false,
42
42
  disableSelectionOnClick: false,
43
43
  disableVirtualization: false,
44
+ disableIgnoreModificationsIfProcessingProps: false,
44
45
  editMode: GridEditModes.Cell,
45
46
  filterMode: GridFeatureModeConstant.client,
46
47
  headerHeight: 56,
@@ -17,7 +17,7 @@ export const GRID_STRING_COL_DEF = {
17
17
  groupable: true,
18
18
  pinnable: true,
19
19
  // @ts-ignore
20
- private_aggregable: true,
20
+ aggregable: true,
21
21
  editable: false,
22
22
  sortComparator: gridStringOrNumberComparator,
23
23
  type: 'string',
@@ -120,7 +120,11 @@ function GridRow(props) {
120
120
  // doesn't care about pagination and considers the rows from the current page only, so the
121
121
  // first row always has index=0. We need to subtract the index of the first row to make it
122
122
  // compatible with the index used by the virtualization.
123
- apiRef.current.unstable_setLastMeasuredRowIndex(index - currentPage.range.firstRowIndex);
123
+ const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId); // pinned rows are not part of the visible rows
124
+
125
+ if (rowIndex != null) {
126
+ apiRef.current.unstable_setLastMeasuredRowIndex(rowIndex);
127
+ }
124
128
  }
125
129
 
126
130
  const rootElement = ref.current;
@@ -45,8 +45,8 @@ function GridOverlayWrapper(props) {
45
45
  position: 'absolute',
46
46
  top: headerHeight,
47
47
  bottom: height === 'auto' ? 0 : undefined,
48
- zIndex: 3,
49
- // should be above pinned columns and detail panel
48
+ zIndex: 4,
49
+ // should be above pinned columns, pinned rows and detail panel
50
50
  pointerEvents: 'none'
51
51
  }
52
52
  }, props));
@@ -85,6 +85,11 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
85
85
 
86
86
  const isSelectable = apiRef.current.isRowSelectable(id);
87
87
  const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
88
+
89
+ if (rowNode.isPinned) {
90
+ return null;
91
+ }
92
+
88
93
  return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({
89
94
  ref: handleRef,
90
95
  tabIndex: tabIndex,
@@ -12,7 +12,7 @@ import { useGridSelector } from '../../hooks/utils/useGridSelector';
12
12
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
13
13
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
14
14
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
15
- import { gridRowCountSelector } from '../../hooks/features/rows/gridRowsSelector';
15
+ import { gridPinnedRowsCountSelector, gridRowCountSelector } from '../../hooks/features/rows/gridRowsSelector';
16
16
  import { gridDensityValueSelector } from '../../hooks/features/density/densitySelector';
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
 
@@ -43,6 +43,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
43
43
  const densityValue = useGridSelector(apiRef, gridDensityValueSelector);
44
44
  const rootContainerRef = React.useRef(null);
45
45
  const handleRef = useForkRef(rootContainerRef, ref);
46
+ const pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);
46
47
  const ownerState = {
47
48
  density: densityValue,
48
49
  classes: rootProps.classes,
@@ -70,7 +71,8 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
70
71
  className: clsx(className, classes.root),
71
72
  role: "grid",
72
73
  "aria-colcount": visibleColumns.length,
73
- "aria-rowcount": totalRowCount,
74
+ "aria-rowcount": totalRowCount + pinnedRowsCount + 1 // +1 for the header row
75
+ ,
74
76
  "aria-multiselectable": !rootProps.disableMultipleSelection,
75
77
  "aria-label": rootProps['aria-label'],
76
78
  "aria-labelledby": rootProps['aria-labelledby']
@@ -444,6 +444,22 @@ export interface GridClasses {
444
444
  * Styles applied to the toggle of the grouping criteria cell
445
445
  */
446
446
  groupingCriteriaCellToggle: string;
447
+ /**
448
+ * Styles applied to the pinned rows container.
449
+ */
450
+ pinnedRows: string;
451
+ /**
452
+ * Styles applied to the top pinned rows container.
453
+ */
454
+ 'pinnedRows--top': string;
455
+ /**
456
+ * Styles applied to the bottom pinned rows container.
457
+ */
458
+ 'pinnedRows--bottom': string;
459
+ /**
460
+ * Styles applied to pinned rows render zones.
461
+ */
462
+ pinnedRowsRenderZone: string;
447
463
  }
448
464
  export declare type GridClassKey = keyof GridClasses;
449
465
  export declare function getDataGridUtilityClass(slot: string): string;
@@ -2,4 +2,4 @@ import { generateUtilityClasses, generateUtilityClass } from '@mui/material';
2
2
  export function getDataGridUtilityClass(slot) {
3
3
  return generateUtilityClass('MuiDataGrid', slot);
4
4
  }
5
- export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);
5
+ export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
@@ -19,7 +19,7 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
19
19
  toolbarFiltersTooltipShow: 'Show filters',
20
20
  toolbarFiltersTooltipActive: count => count !== 1 ? `${count} active filters` : `${count} active filter`,
21
21
  // Quick filter toolbar field
22
- toolbarQuickFilterPlaceholder: 'Search...',
22
+ toolbarQuickFilterPlaceholder: 'Search',
23
23
  toolbarQuickFilterLabel: 'Search',
24
24
  toolbarQuickFilterDeleteIconLabel: 'Clear',
25
25
  // Export selector toolbar button text
@@ -8,6 +8,7 @@ import { gridDensityHeaderHeightSelector, gridDensityRowHeightSelector } from '.
8
8
  import { useGridSelector } from '../../utils';
9
9
  import { getVisibleRows } from '../../utils/useGridVisibleRows';
10
10
  import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
11
+ import { calculatePinnedRowsHeight } from '../rows/gridRowsUtils';
11
12
  const isTestEnvironment = process.env.NODE_ENV === 'test';
12
13
 
13
14
  const hasScroll = ({
@@ -47,6 +48,7 @@ export function useGridDimensions(apiRef, props) {
47
48
 
48
49
  const rootElement = (_apiRef$current$rootE = apiRef.current.rootElementRef) == null ? void 0 : _apiRef$current$rootE.current;
49
50
  const columnsTotalWidth = gridColumnsTotalWidthSelector(apiRef);
51
+ const pinnedRowsHeight = calculatePinnedRowsHeight(apiRef);
50
52
 
51
53
  if (!rootDimensionsRef.current) {
52
54
  return;
@@ -92,7 +94,10 @@ export function useGridDimensions(apiRef, props) {
92
94
  width: Math.round(columnsTotalWidth),
93
95
  height: rowsMeta.currentPageTotalHeight
94
96
  },
95
- container: viewportOuterSize,
97
+ container: {
98
+ width: viewportOuterSize.width,
99
+ height: viewportOuterSize.height - pinnedRowsHeight.top - pinnedRowsHeight.bottom
100
+ },
96
101
  scrollBarSize
97
102
  });
98
103
  hasScrollY = scrollInformation.hasScrollY;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
- export declare const useGridCellEditing: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'editMode' | 'processRowUpdate' | 'onCellEditStart' | 'onCellEditStop' | 'cellModesModel' | 'onCellModesModelChange' | 'onProcessRowUpdateError' | 'signature'>) => void;
4
+ export declare const useGridCellEditing: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'editMode' | 'processRowUpdate' | 'onCellEditStart' | 'onCellEditStop' | 'cellModesModel' | 'onCellModesModelChange' | 'onProcessRowUpdateError' | 'signature' | 'disableIgnoreModificationsIfProcessingProps'>) => void;
@@ -141,6 +141,7 @@ export const useGridCellEditing = (apiRef, props) => {
141
141
  field,
142
142
  reason
143
143
  } = params;
144
+ apiRef.current.unstable_runPendingEditCellValueMutation(id, field);
144
145
  let cellToFocusAfter;
145
146
 
146
147
  if (reason === GridCellEditStopReasons.enterKeyDown) {
@@ -154,7 +155,7 @@ export const useGridCellEditing = (apiRef, props) => {
154
155
  let ignoreModifications = reason === 'escapeKeyDown';
155
156
  const editingState = gridEditRowsStateSelector(apiRef.current.state);
156
157
 
157
- if (editingState[id][field].isProcessingProps) {
158
+ if (editingState[id][field].isProcessingProps && !props.disableIgnoreModificationsIfProcessingProps) {
158
159
  // The user wants to stop editing the cell but we can't wait for the props to be processed.
159
160
  // In this case, discard the modifications.
160
161
  ignoreModifications = true;
@@ -166,7 +167,7 @@ export const useGridCellEditing = (apiRef, props) => {
166
167
  ignoreModifications,
167
168
  cellToFocusAfter
168
169
  });
169
- }, [apiRef]);
170
+ }, [apiRef, props.disableIgnoreModificationsIfProcessingProps]);
170
171
  useGridApiEventHandler(apiRef, 'cellDoubleClick', runIfEditModeIsCell(handleCellDoubleClick));
171
172
  useGridApiEventHandler(apiRef, 'cellFocusOut', runIfEditModeIsCell(handleCellFocusOut));
172
173
  useGridApiEventHandler(apiRef, 'cellKeyDown', runIfEditModeIsCell(handleCellKeyDown));
@@ -343,6 +344,8 @@ export const useGridCellEditing = (apiRef, props) => {
343
344
  }
344
345
  }, [apiRef, onProcessRowUpdateError, processRowUpdate, throwIfNotInMode, updateFieldInCellModesModel, updateOrDeleteFieldState]);
345
346
  const setCellEditingEditCellValue = React.useCallback(async params => {
347
+ var _editingState$id, _editingState$id$fiel;
348
+
346
349
  const {
347
350
  id,
348
351
  field,
@@ -394,7 +397,7 @@ export const useGridCellEditing = (apiRef, props) => {
394
397
  newProps.value = column.preProcessEditCellProps ? editingState[id][field].value : parsedValue;
395
398
  updateOrDeleteFieldState(id, field, newProps);
396
399
  editingState = gridEditRowsStateSelector(apiRef.current.state);
397
- return !editingState[id][field].error;
400
+ return !((_editingState$id = editingState[id]) != null && (_editingState$id$fiel = _editingState$id[field]) != null && _editingState$id$fiel.error);
398
401
  }, [apiRef, throwIfNotEditable, throwIfNotInMode, updateOrDeleteFieldState]);
399
402
  const getRowWithUpdatedValuesFromCellEditing = React.useCallback((id, field) => {
400
403
  const column = apiRef.current.getColumn(field);
@@ -3,4 +3,4 @@ import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  import { GridStateInitializer } from '../../utils/useGridInitializeState';
5
5
  export declare const editingStateInitializer: GridStateInitializer;
6
- export declare const useGridEditing: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'isCellEditable' | 'editMode' | 'processRowUpdate'>) => void;
6
+ export declare const useGridEditing: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'isCellEditable' | 'editMode' | 'processRowUpdate' | 'disableIgnoreModificationsIfProcessingProps'>) => void;
@@ -31,6 +31,10 @@ export const useGridEditing = (apiRef, props) => {
31
31
  return isCellEditableProp(params);
32
32
  }
33
33
 
34
+ if (params.rowNode.isPinned) {
35
+ return false;
36
+ }
37
+
34
38
  return true;
35
39
  }, [isCellEditableProp]);
36
40
 
@@ -30,7 +30,7 @@ export function useGridEditing(apiRef, props) {
30
30
  stateSelector: gridEditRowsStateSelector,
31
31
  changeEvent: 'editRowsModelChange'
32
32
  });
33
- const isCellEditable = React.useCallback(params => !params.rowNode.isAutoGenerated && !!params.colDef.editable && !!params.colDef.renderEditCell && (!props.isCellEditable || props.isCellEditable(params)), // eslint-disable-next-line react-hooks/exhaustive-deps
33
+ const isCellEditable = React.useCallback(params => !params.rowNode.isAutoGenerated && !params.rowNode.isPinned && !!params.colDef.editable && !!params.colDef.renderEditCell && (!props.isCellEditable || props.isCellEditable(params)), // eslint-disable-next-line react-hooks/exhaustive-deps
34
34
  [props.isCellEditable]);
35
35
 
36
36
  const maybeDebounce = (id, field, debounceMs, callback) => {
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
- export declare const useGridRowEditing: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'editMode' | 'processRowUpdate' | 'onRowEditStart' | 'onRowEditStop' | 'onProcessRowUpdateError' | 'rowModesModel' | 'onRowModesModelChange' | 'signature'>) => void;
4
+ export declare const useGridRowEditing: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'editMode' | 'processRowUpdate' | 'onRowEditStart' | 'onRowEditStop' | 'onProcessRowUpdateError' | 'rowModesModel' | 'onRowModesModelChange' | 'signature' | 'disableIgnoreModificationsIfProcessingProps'>) => void;
@@ -214,7 +214,7 @@ export const useGridRowEditing = (apiRef, props) => {
214
214
  let ignoreModifications = reason === 'escapeKeyDown';
215
215
  const editingState = gridEditRowsStateSelector(apiRef.current.state);
216
216
 
217
- if (!ignoreModifications) {
217
+ if (!ignoreModifications && !props.disableIgnoreModificationsIfProcessingProps) {
218
218
  // The user wants to stop editing the cell but we can't wait for the props to be processed.
219
219
  // In this case, discard the modifications if any field is processing its props.
220
220
  ignoreModifications = Object.values(editingState[id]).some(fieldProps => {
@@ -228,7 +228,7 @@ export const useGridRowEditing = (apiRef, props) => {
228
228
  field,
229
229
  cellToFocusAfter
230
230
  });
231
- }, [apiRef]);
231
+ }, [apiRef, props.disableIgnoreModificationsIfProcessingProps]);
232
232
  useGridApiEventHandler(apiRef, 'cellDoubleClick', runIfEditModeIsRow(handleCellDoubleClick));
233
233
  useGridApiEventHandler(apiRef, 'cellFocusIn', runIfEditModeIsRow(handleCellFocusIn));
234
234
  useGridApiEventHandler(apiRef, 'cellFocusOut', runIfEditModeIsRow(handleCellFocusOut));
@@ -1,6 +1,6 @@
1
1
  import { gridColumnDefinitionsSelector, gridVisibleColumnDefinitionsSelector } from '../columns';
2
2
  import { gridFilteredSortedRowIdsSelector } from '../filter';
3
- import { gridRowTreeSelector } from '../rows/gridRowsSelector';
3
+ import { gridPinnedRowsSelector, gridRowTreeSelector } from '../rows/gridRowsSelector';
4
4
  export const getColumnsToExport = ({
5
5
  apiRef,
6
6
  options
@@ -17,6 +17,8 @@ export const getColumnsToExport = ({
17
17
  export const defaultGetRowsToExport = ({
18
18
  apiRef
19
19
  }) => {
20
+ var _pinnedRows$top, _pinnedRows$bottom;
21
+
20
22
  const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
21
23
  const rowTree = gridRowTreeSelector(apiRef);
22
24
  const selectedRows = apiRef.current.getSelectedRows();
@@ -25,6 +27,11 @@ export const defaultGetRowsToExport = ({
25
27
 
26
28
  return ((_rowTree$id$position = rowTree[id].position) != null ? _rowTree$id$position : 'body') === 'body';
27
29
  });
30
+ const pinnedRows = gridPinnedRowsSelector(apiRef);
31
+ const topPinnedRowsIds = (pinnedRows == null ? void 0 : (_pinnedRows$top = pinnedRows.top) == null ? void 0 : _pinnedRows$top.map(row => row.id)) || [];
32
+ const bottomPinnedRowsIds = (pinnedRows == null ? void 0 : (_pinnedRows$bottom = pinnedRows.bottom) == null ? void 0 : _pinnedRows$bottom.map(row => row.id)) || [];
33
+ bodyRows.unshift(...topPinnedRowsIds);
34
+ bodyRows.push(...bottomPinnedRowsIds);
28
35
 
29
36
  if (selectedRows.size > 0) {
30
37
  return bodyRows.filter(id => selectedRows.has(id));
@@ -10,4 +10,4 @@ import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
10
10
  * @requires useGridScroll (method) - can be after
11
11
  * @requires useGridColumnSpanning (method) - can be after
12
12
  */
13
- export declare const useGridKeyboardNavigation: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'pagination' | 'paginationMode'>) => void;
13
+ export declare const useGridKeyboardNavigation: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'pagination' | 'paginationMode' | 'getRowId'>) => void;