@mui/x-data-grid 7.0.0-beta.6 → 7.0.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 (329) hide show
  1. package/CHANGELOG.md +311 -12
  2. package/DataGrid/DataGrid.js +57 -17
  3. package/DataGrid/useDataGridComponent.js +3 -0
  4. package/DataGrid/useDataGridProps.js +6 -7
  5. package/README.md +1 -1
  6. package/components/GridColumnHeaders.d.ts +1 -2
  7. package/components/GridColumnHeaders.js +6 -17
  8. package/components/GridFooter.js +2 -3
  9. package/components/GridHeader.js +1 -2
  10. package/components/GridHeaders.js +1 -4
  11. package/components/GridPagination.d.ts +6 -5
  12. package/components/GridPagination.js +14 -11
  13. package/components/GridRow.d.ts +1 -1
  14. package/components/GridRow.js +17 -36
  15. package/components/GridScrollArea.d.ts +10 -0
  16. package/components/GridScrollArea.js +150 -0
  17. package/components/base/GridFooterPlaceholder.js +1 -2
  18. package/components/base/GridOverlays.js +3 -6
  19. package/components/cell/GridActionsCell.js +4 -6
  20. package/components/cell/GridActionsCellItem.d.ts +8 -25
  21. package/components/cell/GridActionsCellItem.js +8 -5
  22. package/components/cell/GridBooleanCell.d.ts +1 -0
  23. package/components/cell/GridBooleanCell.js +3 -2
  24. package/components/cell/GridCell.d.ts +7 -0
  25. package/components/cell/GridCell.js +18 -11
  26. package/components/cell/GridEditBooleanCell.js +1 -2
  27. package/components/cell/GridEditDateCell.js +2 -3
  28. package/components/cell/GridEditInputCell.js +2 -2
  29. package/components/cell/GridEditSingleSelectCell.js +5 -8
  30. package/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -3
  31. package/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  32. package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -0
  33. package/components/columnHeaders/GridColumnGroupHeader.js +22 -13
  34. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +2 -3
  35. package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -0
  36. package/components/columnHeaders/GridColumnHeaderItem.js +26 -12
  37. package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
  38. package/components/columnHeaders/GridColumnHeaderTitle.js +2 -3
  39. package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -0
  40. package/components/columnHeaders/GridGenericColumnHeaderItem.js +7 -6
  41. package/components/columnSelection/GridCellCheckboxRenderer.js +3 -5
  42. package/components/columnSelection/GridHeaderCheckbox.js +1 -2
  43. package/components/columnsManagement/GridColumnsManagement.js +17 -21
  44. package/components/containers/GridRoot.js +3 -3
  45. package/components/containers/GridRootStyles.js +12 -20
  46. package/components/menu/GridMenu.js +4 -6
  47. package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  48. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -3
  49. package/components/panel/GridColumnsPanel.js +1 -2
  50. package/components/panel/GridPanel.d.ts +1 -10
  51. package/components/panel/GridPanel.js +1 -2
  52. package/components/panel/GridPreferencesPanel.js +2 -3
  53. package/components/panel/filterPanel/GridFilterForm.js +24 -27
  54. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
  55. package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  56. package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -1
  57. package/components/panel/filterPanel/GridFilterInputDate.js +3 -4
  58. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +11 -15
  59. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +10 -14
  60. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -1
  61. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +10 -11
  62. package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -1
  63. package/components/panel/filterPanel/GridFilterInputValue.js +5 -7
  64. package/components/panel/filterPanel/GridFilterPanel.js +5 -9
  65. package/components/panel/filterPanel/filterPanelUtils.js +1 -1
  66. package/components/toolbar/GridToolbarColumnsButton.js +3 -5
  67. package/components/toolbar/GridToolbarDensitySelector.js +8 -10
  68. package/components/toolbar/GridToolbarExport.js +2 -2
  69. package/components/toolbar/GridToolbarExportContainer.js +3 -5
  70. package/components/toolbar/GridToolbarFilterButton.js +3 -5
  71. package/components/toolbar/GridToolbarQuickFilter.js +4 -5
  72. package/components/virtualization/GridVirtualScrollbar.js +4 -0
  73. package/components/virtualization/GridVirtualScroller.js +6 -1
  74. package/components/virtualization/GridVirtualScrollerContent.js +1 -2
  75. package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  76. package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -2
  77. package/constants/gridClasses.d.ts +6 -32
  78. package/constants/gridClasses.js +1 -1
  79. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +5 -1
  80. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +1 -2
  81. package/hooks/core/useGridApiInitialization.js +4 -6
  82. package/hooks/features/clipboard/useGridClipboard.js +6 -5
  83. package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -16
  84. package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +4 -8
  85. package/hooks/features/columnGrouping/useGridColumnGrouping.js +12 -23
  86. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +23 -7
  87. package/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -101
  88. package/hooks/features/columnMenu/useGridColumnMenuSlots.js +2 -2
  89. package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -0
  90. package/hooks/features/columnResize/columnResizeSelector.js +3 -0
  91. package/hooks/features/columnResize/columnResizeState.d.ts +3 -0
  92. package/hooks/features/columnResize/columnResizeState.js +1 -0
  93. package/hooks/features/columnResize/gridColumnResizeApi.d.ts +44 -0
  94. package/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
  95. package/hooks/features/columnResize/index.d.ts +3 -0
  96. package/hooks/features/columnResize/index.js +3 -0
  97. package/hooks/features/columnResize/useGridColumnResize.d.ts +10 -0
  98. package/hooks/features/columnResize/useGridColumnResize.js +553 -0
  99. package/hooks/features/columns/gridColumnsSelector.js +1 -2
  100. package/hooks/features/columns/gridColumnsUtils.d.ts +0 -9
  101. package/hooks/features/columns/gridColumnsUtils.js +5 -22
  102. package/hooks/features/columns/useGridColumnSpanning.js +1 -2
  103. package/hooks/features/columns/useGridColumns.js +11 -19
  104. package/hooks/features/density/densitySelector.d.ts +4 -2
  105. package/hooks/features/density/densitySelector.js +8 -2
  106. package/hooks/features/density/densityState.d.ts +1 -4
  107. package/hooks/features/density/useGridDensity.d.ts +2 -4
  108. package/hooks/features/density/useGridDensity.js +21 -29
  109. package/hooks/features/dimensions/useGridDimensions.js +7 -10
  110. package/hooks/features/editing/useGridCellEditing.js +25 -8
  111. package/hooks/features/editing/useGridEditing.js +1 -2
  112. package/hooks/features/editing/useGridRowEditing.js +4 -6
  113. package/hooks/features/export/serializers/csvSerializer.d.ts +2 -0
  114. package/hooks/features/export/serializers/csvSerializer.js +25 -16
  115. package/hooks/features/export/useGridCsvExport.js +9 -10
  116. package/hooks/features/export/useGridPrintExport.js +17 -22
  117. package/hooks/features/export/utils.js +2 -3
  118. package/hooks/features/filter/gridFilterSelector.js +15 -22
  119. package/hooks/features/filter/gridFilterUtils.js +10 -16
  120. package/hooks/features/filter/useGridFilter.js +9 -15
  121. package/hooks/features/focus/useGridFocus.js +5 -6
  122. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +1 -0
  123. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
  124. package/hooks/features/headerFiltering/useGridHeaderFiltering.js +23 -5
  125. package/hooks/features/index.d.ts +1 -0
  126. package/hooks/features/index.js +1 -0
  127. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -2
  128. package/hooks/features/pagination/gridPaginationInterfaces.d.ts +19 -2
  129. package/hooks/features/pagination/gridPaginationSelector.d.ts +5 -0
  130. package/hooks/features/pagination/gridPaginationSelector.js +9 -4
  131. package/hooks/features/pagination/useGridPagination.d.ts +1 -6
  132. package/hooks/features/pagination/useGridPagination.js +9 -158
  133. package/hooks/features/pagination/useGridPaginationModel.d.ts +11 -0
  134. package/hooks/features/pagination/useGridPaginationModel.js +165 -0
  135. package/hooks/features/pagination/useGridRowCount.d.ts +8 -0
  136. package/hooks/features/pagination/useGridRowCount.js +94 -0
  137. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +7 -12
  138. package/hooks/features/rowSelection/useGridRowSelection.js +11 -16
  139. package/hooks/features/rows/gridRowsSelector.js +11 -19
  140. package/hooks/features/rows/gridRowsUtils.js +7 -9
  141. package/hooks/features/rows/useGridParamsApi.js +1 -1
  142. package/hooks/features/rows/useGridRows.js +4 -13
  143. package/hooks/features/rows/useGridRowsMeta.js +7 -13
  144. package/hooks/features/scroll/useGridScroll.js +3 -4
  145. package/hooks/features/sorting/gridSortingSelector.js +4 -7
  146. package/hooks/features/sorting/useGridSorting.js +8 -14
  147. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +4 -4
  148. package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  149. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
  150. package/hooks/features/virtualization/useGridVirtualScroller.js +220 -71
  151. package/hooks/utils/useGridApiEventHandler.js +5 -10
  152. package/hooks/utils/useGridNativeEventListener.js +1 -2
  153. package/hooks/utils/useLazyRef.d.ts +1 -2
  154. package/hooks/utils/useLazyRef.js +1 -11
  155. package/hooks/utils/useOnMount.d.ts +1 -2
  156. package/hooks/utils/useOnMount.js +1 -7
  157. package/hooks/utils/useTimeout.d.ts +1 -11
  158. package/hooks/utils/useTimeout.js +1 -36
  159. package/index.js +1 -1
  160. package/internals/index.d.ts +3 -1
  161. package/internals/index.js +2 -1
  162. package/internals/utils/getPinnedCellOffset.d.ts +3 -0
  163. package/internals/utils/getPinnedCellOffset.js +17 -0
  164. package/internals/utils/useProps.js +1 -2
  165. package/joy/joySlots.js +18 -63
  166. package/locales/jaJP.js +3 -4
  167. package/material/index.js +0 -2
  168. package/models/api/gridApiCommon.d.ts +3 -3
  169. package/models/api/gridCoreApi.d.ts +1 -5
  170. package/models/api/gridRowsMetaApi.d.ts +1 -1
  171. package/models/api/index.d.ts +1 -1
  172. package/models/api/index.js +0 -1
  173. package/models/events/gridEventLookup.d.ts +13 -0
  174. package/models/gridExport.d.ts +6 -0
  175. package/models/gridHeaderFilteringModel.d.ts +1 -0
  176. package/models/gridSlotsComponent.d.ts +0 -5
  177. package/models/gridStateCommunity.d.ts +3 -0
  178. package/models/params/gridScrollParams.d.ts +5 -3
  179. package/models/props/DataGridProps.d.ts +58 -28
  180. package/modern/DataGrid/DataGrid.js +57 -17
  181. package/modern/DataGrid/useDataGridComponent.js +3 -0
  182. package/modern/DataGrid/useDataGridProps.js +6 -7
  183. package/modern/components/GridColumnHeaders.js +6 -17
  184. package/modern/components/GridHeaders.js +1 -4
  185. package/modern/components/GridPagination.js +13 -6
  186. package/modern/components/GridRow.js +4 -19
  187. package/modern/components/GridScrollArea.js +150 -0
  188. package/modern/components/cell/GridActionsCell.js +1 -1
  189. package/modern/components/cell/GridActionsCellItem.js +4 -0
  190. package/modern/components/cell/GridBooleanCell.js +3 -2
  191. package/modern/components/cell/GridCell.js +11 -3
  192. package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  193. package/modern/components/columnHeaders/GridColumnGroupHeader.js +18 -8
  194. package/modern/components/columnHeaders/GridColumnHeaderItem.js +21 -6
  195. package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
  196. package/modern/components/containers/GridRoot.js +3 -3
  197. package/modern/components/containers/GridRootStyles.js +12 -20
  198. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  199. package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -1
  200. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  201. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  202. package/modern/components/toolbar/GridToolbarDensitySelector.js +5 -5
  203. package/modern/components/virtualization/GridVirtualScrollbar.js +4 -0
  204. package/modern/components/virtualization/GridVirtualScroller.js +6 -1
  205. package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  206. package/modern/constants/gridClasses.js +1 -1
  207. package/modern/hooks/features/clipboard/useGridClipboard.js +4 -2
  208. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +184 -97
  209. package/modern/hooks/features/columnResize/columnResizeSelector.js +3 -0
  210. package/modern/hooks/features/columnResize/columnResizeState.js +1 -0
  211. package/modern/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
  212. package/modern/hooks/features/columnResize/index.js +3 -0
  213. package/modern/hooks/features/columnResize/useGridColumnResize.js +553 -0
  214. package/modern/hooks/features/columns/gridColumnsUtils.js +4 -20
  215. package/modern/hooks/features/density/densitySelector.js +8 -2
  216. package/modern/hooks/features/density/useGridDensity.js +21 -29
  217. package/modern/hooks/features/dimensions/useGridDimensions.js +4 -5
  218. package/modern/hooks/features/editing/useGridCellEditing.js +22 -3
  219. package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
  220. package/modern/hooks/features/export/serializers/csvSerializer.js +23 -12
  221. package/modern/hooks/features/export/useGridCsvExport.js +2 -1
  222. package/modern/hooks/features/export/useGridPrintExport.js +8 -7
  223. package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
  224. package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
  225. package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
  226. package/modern/hooks/features/index.js +1 -0
  227. package/modern/hooks/features/pagination/gridPaginationSelector.js +8 -2
  228. package/modern/hooks/features/pagination/useGridPagination.js +8 -149
  229. package/modern/hooks/features/pagination/useGridPaginationModel.js +165 -0
  230. package/modern/hooks/features/pagination/useGridRowCount.js +94 -0
  231. package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -2
  232. package/modern/hooks/features/scroll/useGridScroll.js +1 -1
  233. package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  234. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
  235. package/modern/hooks/utils/useLazyRef.js +1 -11
  236. package/modern/hooks/utils/useOnMount.js +1 -7
  237. package/modern/hooks/utils/useTimeout.js +1 -36
  238. package/modern/index.js +1 -1
  239. package/modern/internals/index.js +2 -1
  240. package/modern/internals/utils/getPinnedCellOffset.js +17 -0
  241. package/modern/joy/joySlots.js +11 -50
  242. package/modern/locales/jaJP.js +3 -4
  243. package/modern/material/index.js +0 -2
  244. package/modern/models/api/index.js +0 -1
  245. package/modern/utils/cellBorderUtils.js +8 -0
  246. package/modern/utils/createSelector.js +1 -1
  247. package/modern/utils/domUtils.js +144 -0
  248. package/modern/utils/keyboardUtils.js +1 -1
  249. package/node/DataGrid/DataGrid.js +57 -17
  250. package/node/DataGrid/useDataGridComponent.js +3 -0
  251. package/node/DataGrid/useDataGridProps.js +6 -7
  252. package/node/components/GridColumnHeaders.js +6 -16
  253. package/node/components/GridHeaders.js +1 -4
  254. package/node/components/GridPagination.js +10 -4
  255. package/node/components/GridRow.js +3 -18
  256. package/node/components/GridScrollArea.js +158 -0
  257. package/node/components/cell/GridActionsCell.js +1 -1
  258. package/node/components/cell/GridActionsCellItem.js +4 -0
  259. package/node/components/cell/GridBooleanCell.js +3 -2
  260. package/node/components/cell/GridCell.js +12 -4
  261. package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  262. package/node/components/columnHeaders/GridColumnGroupHeader.js +18 -8
  263. package/node/components/columnHeaders/GridColumnHeaderItem.js +21 -6
  264. package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
  265. package/node/components/containers/GridRoot.js +2 -2
  266. package/node/components/containers/GridRootStyles.js +12 -20
  267. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  268. package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -1
  269. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  270. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  271. package/node/components/toolbar/GridToolbarDensitySelector.js +4 -4
  272. package/node/components/virtualization/GridVirtualScrollbar.js +4 -0
  273. package/node/components/virtualization/GridVirtualScroller.js +6 -1
  274. package/node/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  275. package/node/constants/gridClasses.js +1 -1
  276. package/node/hooks/features/clipboard/useGridClipboard.js +4 -2
  277. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +190 -103
  278. package/node/hooks/features/columnResize/columnResizeSelector.js +10 -0
  279. package/node/hooks/features/columnResize/columnResizeState.js +5 -0
  280. package/node/hooks/features/columnResize/gridColumnResizeApi.js +16 -0
  281. package/node/hooks/features/columnResize/index.js +38 -0
  282. package/node/hooks/features/columnResize/useGridColumnResize.js +564 -0
  283. package/node/hooks/features/columns/gridColumnsUtils.js +4 -21
  284. package/node/hooks/features/density/densitySelector.js +9 -3
  285. package/node/hooks/features/density/useGridDensity.js +22 -30
  286. package/node/hooks/features/dimensions/useGridDimensions.js +4 -5
  287. package/node/hooks/features/editing/useGridCellEditing.js +22 -3
  288. package/node/hooks/features/editing/useGridRowEditing.js +1 -1
  289. package/node/hooks/features/export/serializers/csvSerializer.js +23 -12
  290. package/node/hooks/features/export/useGridCsvExport.js +2 -1
  291. package/node/hooks/features/export/useGridPrintExport.js +8 -7
  292. package/node/hooks/features/filter/gridFilterUtils.js +1 -1
  293. package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +4 -1
  294. package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
  295. package/node/hooks/features/index.js +11 -0
  296. package/node/hooks/features/pagination/gridPaginationSelector.js +8 -2
  297. package/node/hooks/features/pagination/useGridPagination.js +9 -153
  298. package/node/hooks/features/pagination/useGridPaginationModel.js +176 -0
  299. package/node/hooks/features/pagination/useGridRowCount.js +103 -0
  300. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  301. package/node/hooks/features/scroll/useGridScroll.js +1 -1
  302. package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  303. package/node/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
  304. package/node/hooks/utils/useLazyRef.js +7 -13
  305. package/node/hooks/utils/useOnMount.js +8 -10
  306. package/node/hooks/utils/useTimeout.js +7 -37
  307. package/node/index.js +1 -1
  308. package/node/internals/index.js +27 -8
  309. package/node/internals/utils/getPinnedCellOffset.js +24 -0
  310. package/node/joy/joySlots.js +11 -50
  311. package/node/locales/jaJP.js +3 -4
  312. package/node/material/index.js +0 -2
  313. package/node/models/api/index.js +0 -11
  314. package/node/utils/cellBorderUtils.js +16 -0
  315. package/node/utils/createSelector.js +1 -1
  316. package/node/utils/domUtils.js +155 -0
  317. package/node/utils/keyboardUtils.js +1 -1
  318. package/package.json +4 -4
  319. package/utils/cellBorderUtils.d.ts +3 -0
  320. package/utils/cellBorderUtils.js +8 -0
  321. package/utils/createSelector.js +9 -9
  322. package/utils/domUtils.d.ts +14 -1
  323. package/utils/domUtils.js +144 -0
  324. package/utils/getGridLocalization.js +9 -12
  325. package/utils/keyboardUtils.js +1 -1
  326. package/components/columnHeaders/GridColumnHeadersInner.d.ts +0 -8
  327. package/components/columnHeaders/GridColumnHeadersInner.js +0 -58
  328. package/modern/components/columnHeaders/GridColumnHeadersInner.js +0 -58
  329. package/node/components/columnHeaders/GridColumnHeadersInner.js +0 -67
package/CHANGELOG.md CHANGED
@@ -3,6 +3,285 @@
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
+ ## v7.0.0
7
+
8
+ _Mar 22, 2024_
9
+
10
+ We're excited to [announce the first v7 stable release](https://mui.com/blog/mui-x-v7/)! 🎉🚀
11
+
12
+ This is now the officially supported major version, where we'll keep rolling out new features, bug fixes, and improvements.
13
+ Migration guides are available with a complete list of the breaking changes:
14
+
15
+ - [Data Grid](https://mui.com/x/migration/migration-data-grid-v6/)
16
+ - [Date and Time Pickers](https://mui.com/x/migration/migration-pickers-v6/)
17
+ - [Tree View](https://mui.com/x/migration/migration-tree-view-v6/)
18
+ - [Charts](https://mui.com/x/migration/migration-charts-v6/)
19
+
20
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
21
+
22
+ - 🚀 Improve the usage of custom `viewRenderers` on `DateTimePicker` (#12441) @LukasTy
23
+ - ✨ Set focus on the focused Tree Item instead of the Tree View (#12226) @flaviendelangle
24
+ - 🕹️ Support controlled `density` for the Data Grid (#12332) @MBilalShafi
25
+ - 🎁 Dynamic virtualization range for the Data Grid (#12353) @romgrk
26
+ - 🐞 Bugfixes
27
+ - 📚 Documentation improvements
28
+
29
+ ### Data Grid
30
+
31
+ #### Breaking changes
32
+
33
+ - The `density` is a [controlled prop](https://mui.com/x/react-data-grid/accessibility/#set-the-density-programmatically) now, if you were previously passing the `density` prop to the Data Grid, you will need to do one of the following:
34
+
35
+ 1. Move it to the `initialState.density` to initialize it.
36
+
37
+ ```diff
38
+ <DataGrid
39
+ - density="compact"
40
+ + initialState={{ density: "compact" }}
41
+ />
42
+ ```
43
+
44
+ 2. Move it to the state and use `onDensityChange` callback to update the `density` prop accordingly for it to work as expected.
45
+
46
+ ```diff
47
+ + const [density, setDensity] = React.useState<GridDensity>('compact');
48
+ <DataGrid
49
+ - density="compact"
50
+ + density={density}
51
+ + onDensityChange={(newDensity) => setDensity(newDensity)}
52
+ />
53
+ ```
54
+
55
+ - The selector `gridDensityValueSelector` was removed, use the `gridDensitySelector` instead.
56
+
57
+ - The props `rowBuffer` and `columnBuffer` were renamed to `rowBufferPx` and `columnBufferPx`.
58
+ Their value is now a pixel value rather than a number of items. Their default value is now `150`.
59
+
60
+ - The props `rowThreshold` and `columnThreshold` have been removed.
61
+ If you had the `rowThreshold` prop set to `0` to force new rows to be rendered more often – this is no longer necessary.
62
+
63
+ #### `@mui/x-data-grid@7.0.0`
64
+
65
+ - [DataGrid] Allow to control the grid density (#12332) @MBilalShafi
66
+ - [DataGrid] Dynamic virtualization range (#12353) @romgrk
67
+ - [DataGrid] Fix `ElementType` usage (#12479) @cherniavskii
68
+ - [DataGrid] Fix cell value formatting on copy (#12357) @sai6855
69
+ - [DataGrid] Fix checkbox selection is keeping selection when filtering (#11751) @g1mishra
70
+ - [DataGrid] Make `rows` an optional prop (#12478) @MBilalShafi
71
+
72
+ #### `@mui/x-data-grid-pro@7.0.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
73
+
74
+ Same changes as in `@mui/x-data-grid@7.0.0`.
75
+
76
+ #### `@mui/x-data-grid-premium@7.0.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
77
+
78
+ Same changes as in `@mui/x-data-grid-pro@7.0.0`, plus:
79
+
80
+ - [DataGridPremium] Add support for confirmation before clipboard paste (#12225) @cherniavskii
81
+ - [DataGridPremium] Fix single grouping column sorting (#9679) @cherniavskii
82
+ - [DataGridPremium] Fix boolean cell not rendered in group rows (#12492) @sai6855
83
+
84
+ ### Date and Time Pickers
85
+
86
+ #### Breaking changes
87
+
88
+ - The `DesktopDateTimePicker` view rendering has been optimized by using the same technique as for `DesktopDateTimeRangePicker`.
89
+ - The `dateTimeViewRenderers` have been removed in favor of reusing existing time view renderers (`renderTimeViewClock`, `renderDigitalClockTimeView` and `renderMultiSectionDigitalClockTimeView`) and date view renderer (`renderDateViewCalendar`).
90
+ - Passing `renderTimeViewClock` to time view renderers will no longer revert to the old behavior of rendering only date or time view.
91
+
92
+ #### `@mui/x-date-pickers@7.0.0`
93
+
94
+ - [fields] Allow to override the separator between the start and the end date in all range fields (#12174) @flaviendelangle
95
+ - [fields] Support format without separator (#12489) @flaviendelangle
96
+ - [pickers] Use renderer interceptor on `DesktopDateTimePicker` (#12441) @LukasTy
97
+
98
+ #### `@mui/x-date-pickers-pro@7.0.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
99
+
100
+ Same changes as in `@mui/x-date-pickers@7.0.0`, plus:
101
+
102
+ - [DateTimeRangePicker] Add component `JSDoc` (#12518) @LukasTy
103
+ - [DateTimeRangePicker] Fix views behavior regression (#12529) @LukasTy
104
+
105
+ ### Charts
106
+
107
+ #### `@mui/x-charts@7.0.0`
108
+
109
+ - [charts] Fix small typo in `CartesianContextProvider` (#12461) @Janpot
110
+
111
+ ### Tree View
112
+
113
+ #### Breaking changes
114
+
115
+ - The required `nodeId` prop used by the `TreeItem` has been renamed to `itemId` for consistency:
116
+
117
+ ```diff
118
+ <TreeView>
119
+ - <TreeItem label="Item 1" nodeId="one">
120
+ + <TreeItem label="Item 1" itemId="one">
121
+ </TreeView>
122
+ ```
123
+
124
+ - The focus is now applied to the Tree Item root element instead of the Tree View root element.
125
+
126
+ This change will allow new features that require the focus to be on the Tree Item,
127
+ like the drag and drop reordering of items.
128
+ It also solves several issues with focus management,
129
+ like the inability to scroll to the focused item when a lot of items are rendered.
130
+
131
+ This will mostly impact how you write tests to interact with the Tree View:
132
+
133
+ For example, if you were writing a test with `react-testing-library`, here is what the changes could look like:
134
+
135
+ ```diff
136
+ it('test example on first item', () => {
137
+ - const { getByRole } = render(
138
+ + const { getAllByRole } = render(
139
+ <SimpleTreeView>
140
+ <TreeItem nodeId="one" />
141
+ <TreeItem nodeId="two" />
142
+ </SimpleTreeView>
143
+ );
144
+
145
+ - const tree = getByRole('tree');
146
+ + const firstTreeItem = getAllByRole('treeitem')[0];
147
+ act(() => {
148
+ - tree.focus();
149
+ + firstTreeItem.focus();
150
+ });
151
+ - fireEvent.keyDown(tree, { key: 'ArrowDown' });
152
+ + fireEvent.keyDown(firstTreeItem, { key: 'ArrowDown' });
153
+ })
154
+ ```
155
+
156
+ #### `@mui/x-tree-view@7.0.0`
157
+
158
+ - [TreeView] Rename `nodeId` to `itemId` (#12418) @noraleonte
159
+ - [TreeView] Set focus on the focused Tree Item instead of the Tree View (#12226) @flaviendelangle
160
+ - [TreeView] Update JSDoc of the `ContentComponent` prop to avoid using the word "node" (#12476) @flaviendelangle
161
+
162
+ ### `@mui/x-codemod@7.0.0`
163
+
164
+ - [codemod] Add a codemod and update the grid migration guide (#12488) @MBilalShafi
165
+
166
+ ### Docs
167
+
168
+ - [docs] Finalize migration guide (#12501) @noraleonte
169
+ - [docs] Fix nested cells alignment in the popular features demo (#12450) @cherniavskii
170
+ - [docs] Fix some Vale errors (#12469) @oliviertassinari
171
+ - [docs] Remove mentions of pre release (#12513) @noraleonte
172
+ - [docs] Update branch name and tags (#12498) @cherniavskii
173
+ - [docs] Update links to v6 (#12496) @cherniavskii
174
+ - [docs] Update links to v7 docs (#12500) @noraleonte
175
+ - [docs] Update supported versions (#12508) @joserodolfofreitas
176
+ - [docs] Update "What's new in MUI X" page #12527 @cherniavskii
177
+
178
+ ### Core
179
+
180
+ - [core] Bump `@mui/material` peer dependency for all packages (#12516) @LukasTy
181
+ - [core] Fix `no-restricted-imports` ESLint rule not working for Data Grid packages (#12477) @cherniavskii
182
+ - [core] Lower the frequency of `no-response` action runs (#12491) @michaldudak
183
+ - [core] Remove leftover `legacy` `browserlistrc` entry (#12415) @LukasTy
184
+ - [core] Update NPM tag (#12511) @cherniavskii
185
+ - [core] Update supported browsers (browserlistrc) (#12521) @LukasTy
186
+ - [core] Use Circle CI context @oliviertassinari
187
+ - [license] Fix grammar on expired license error message (#12460) @joserodolfofreitas
188
+
189
+ ## 7.0.0-beta.7
190
+
191
+ _Mar 14, 2024_
192
+
193
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
194
+
195
+ - 🦥 The Lazy loading feature is now stable and the `lazyLoading` feature flag was removed from the `experimentalFeatures` prop.
196
+ - 🌍 Improve Japanese (ja-JP) locale for the Data Grid
197
+ - 🐞 Bugfixes
198
+ - 📚 Documentation improvements
199
+
200
+ ### Data Grid
201
+
202
+ #### Breaking changes
203
+
204
+ - The `columnHeader--showColumnBorder` class was replaced by `columnHeader--withLeftBorder` and `columnHeader--withRightBorder`.
205
+ - The `columnHeadersInner`, `columnHeadersInner--scrollable`, and `columnHeaderDropZone` classes were removed since the inner wrapper was removed in our effort to simplify the DOM structure and improve accessibility.
206
+ - The `pinnedColumnHeaders`, `pinnedColumnHeaders--left`, and `pinnedColumnHeaders--right` classes were removed along with the element they were applied to.
207
+ The pinned column headers now use `position: 'sticky'` and are rendered in the same row element as the regular column headers.
208
+
209
+ #### `@mui/x-data-grid@7.0.0-beta.7`
210
+
211
+ - [DataGrid] Fix focus visible style on scrollbar (#12402) @oliviertassinari
212
+ - [DataGrid] Fix the issue where pressing the Delete key resets various cell values to an empty string. (#12216) @sooster910
213
+ - [DataGrid] Make `rowCount` part of the state (#12381) @MBilalShafi
214
+ - [DataGrid] Make column resizing and autosizing available in Community plan (#12420) @cherniavskii
215
+ - [DataGrid] Remove `baseSwitch` slot (#12439) @romgrk
216
+ - [l10n] Improve Japanese (ja-JP) locale (#12398) @makoto14
217
+
218
+ #### `@mui/x-data-grid-pro@7.0.0-beta.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
219
+
220
+ Same changes as in `@mui/x-data-grid@7.0.0-beta.7`, plus:
221
+
222
+ - [DataGridPro] Add `inputRef` to the props passed to `colDef.renderHeaderFilter` (#12328) @vovarudomanenko
223
+ - [DataGridPro] Fix filler rendered for no reason when there are pinned columns (#12440) @cherniavskii
224
+ - [DataGridPro] Make lazy loading feature stable (#12421) @cherniavskii
225
+ - [DataGridPro] Render pinned and non-pinned column headers in one row (#12376) @cherniavskii
226
+
227
+ #### `@mui/x-data-grid-premium@7.0.0-beta.7` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
228
+
229
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.7`, plus:
230
+
231
+ - [DataGridPremium] Fix auto-scroll not working when selecting cell range (#12267) @cherniavskii
232
+
233
+ ### Date and Time Pickers
234
+
235
+ #### `@mui/x-date-pickers@7.0.0-beta.7`
236
+
237
+ - [fields] Fix `tabIndex` on accessible field DOM structure (#12311) @flaviendelangle
238
+ - [fields] Fix items alignment on multi input range fields (#12312) @flaviendelangle
239
+ - [pickers] Improve the customization of the range picker calendar header (#11988) @flaviendelangle
240
+ - [pickers] Keep the existing time when looking for closest enabled date (#12377) @LukasTy
241
+
242
+ #### `@mui/x-date-pickers-pro@7.0.0-beta.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
243
+
244
+ Same changes as in `@mui/x-date-pickers@7.0.0-beta.7`.
245
+
246
+ ### Charts
247
+
248
+ #### `@mui/x-charts@7.0.0-beta.7`
249
+
250
+ - [charts] Fix axis highlight when axis is reversed (#12407) @alexfauquette
251
+
252
+ ### Tree View
253
+
254
+ #### Breaking changes
255
+
256
+ The `onNodeFocus` callback has been renamed to `onItemFocus` for consistency:
257
+
258
+ ```diff
259
+ <SimpleTreeView
260
+ - onNodeFocus={onNodeFocus}
261
+ + onItemFocus={onItemFocus}
262
+ />
263
+ ```
264
+
265
+ #### `@mui/x-tree-view@7.0.0-beta.7`
266
+
267
+ - [TreeView] Clean the usage of the term "item" and "node" in API introduced during v7 (#12368) @noraleonte
268
+ - [TreeView] Introduce a new `TreeItem2` component and a new `useTreeItem2` hook (#11721) @flaviendelangle
269
+ - [TreeView] Rename `onNodeFocus` to `onItemFocus` (#12419) @noraleonte
270
+
271
+ ### Docs
272
+
273
+ - [docs] Add `legacy` bundle drop mention in migration pages (#12424) @LukasTy
274
+ - [docs] Add missing luxon `Info` import (#12427) @LukasTy
275
+ - [docs] Improve slots definitions for charts (#12408) @alexfauquette
276
+ - [docs] Polish What's new in MUI X blog titles (#12309) @oliviertassinari
277
+ - [docs] Replace `rel="noreferrer"` by `rel="noopener"` @oliviertassinari
278
+ - [docs] Update `date-fns` `weekStarsOn` overriding example (#12416) @LukasTy
279
+
280
+ ### Core
281
+
282
+ - [core] Fix CI (#12414) @flaviendelangle
283
+ - [core] Fix PR deploy link for Tree View doc pages (#12411) @flaviendelangle
284
+
6
285
  ## 7.0.0-beta.6
7
286
 
8
287
  _Mar 8, 2024_
@@ -156,7 +435,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
156
435
  ### Docs
157
436
 
158
437
  - [docs] Fix image layout shift when loading @oliviertassinari
159
- - [docs] Match Material UI repo comment for redirections @oliviertassinari
438
+ - [docs] Match Material UI repo comment for redirections @oliviertassinari
160
439
  - [docs] Non breaking spaces @oliviertassinari
161
440
  - [docs] Polish the Date Picker playground (#11869) @zanivan
162
441
  - [docs] Standardize WAI-ARIA references @oliviertassinari
@@ -167,9 +446,9 @@ Same changes as in `@mui/x-date-pickers@7.0.0-beta.5`.
167
446
  - [core] Remove grid folder from `getComponentInfo` RegExp (#12241) @flaviendelangle
168
447
  - [core] Remove `window.` reference for common globals @oliviertassinari
169
448
  - [core] Use runtime agnostic setTimeout type @oliviertassinari
170
- - [docs-infra] Fix Stack Overflow breaking space @oliviertassinari
449
+ - [docs-infra] Fix Stack Overflow breaking space @oliviertassinari
171
450
  - [docs-infra] Fix missing non breaking spaces @oliviertassinari
172
- - [github] Update `no-response` workflow (#12193) @MBilalShafi
451
+ - [infra] Update `no-response` workflow (#12193) @MBilalShafi
173
452
  - [infra] Fix missing permission reset @oliviertassinari
174
453
 
175
454
  ## 7.0.0-beta.4
@@ -186,7 +465,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
186
465
 
187
466
  ### Breaking changes
188
467
 
189
- - The support for IE11 has been removed from all MUI X packages. The `legacy` bundle that used to support old browsers like IE11 is no longer included.
468
+ - The support for IE11 has been removed from all MUI X packages. The `legacy` bundle that used to support old browsers like IE11 is no longer included.
190
469
 
191
470
  ### Data Grid
192
471
 
@@ -228,7 +507,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
228
507
  - The headless field hooks (e.g.: `useDateField`) now returns a new prop called `enableAccessibleFieldDOMStructure`.
229
508
  This property is utilized to determine whether the anticipated UI is constructed using an accessible DOM structure. Learn more about this new [accessible DOM structure](/x/react-date-pickers/fields/#accessible-dom-structure).
230
509
 
231
- When building a custom UI, you are most-likely only supporting one DOM structure, so you can remove `enableAccessibleFieldDOMStructure` before it is passed to the DOM:
510
+ When building a custom UI, you are most-likely only supporting one DOM structure, so you can remove `enableAccessibleFieldDOMStructure` before it is passed to the DOM:
232
511
 
233
512
  ```diff
234
513
  function MyCustomTextField(props) {
@@ -296,7 +575,7 @@ These components are no longer exported from `@mui/x-charts`:
296
575
  ### Docs
297
576
 
298
577
  - [docs] Add recipe for hiding separator on non-resizable columns (#12134) @michelengelen
299
- - [docs] Add small improvements to the Gauge Chart page (#12076) @danilo-leal
578
+ - [docs] Add small improvements to the Gauge page (#12076) @danilo-leal
300
579
  - [docs] Add the 'point' scaleType to the axis documentation (#12179) @alexfauquette
301
580
  - [docs] Clarify Pickers 'Component composition' section (#12097) @LukasTy
302
581
  - [docs] Fix "Licensing" page link (#12156) @LukasTy
@@ -879,7 +1158,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
879
1158
 
880
1159
  - [charts] Do not propagate `innerRadius` and `outerRadius` to the DOM (#11689) @alexfauquette
881
1160
  - [charts] Fix default `stackOffset` for `LineChart` (#11647) @alexfauquette
882
- - [charts] Remove a TS ignore (#11688) @alexfauquette
1161
+ - [charts] Remove a TypeScript ignore (#11688) @alexfauquette
883
1162
 
884
1163
  ### Tree View
885
1164
 
@@ -1308,7 +1587,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.7`.
1308
1587
  - [core] Fix release changelog (#11496) @romgrk
1309
1588
  - [core] Fix use of ::before & ::after (#11515) @oliviertassinari
1310
1589
  - [core] Localize the issue template to MUI X (#11511) @oliviertassinari
1311
- - [core] Regen api files (#11542) @flaviendelangle
1590
+ - [core] Regenerate API files (#11542) @flaviendelangle
1312
1591
  - [core] Remove issue emoji @oliviertassinari
1313
1592
  - [core] Sync the release instructions with MUI Core @oliviertassinari
1314
1593
  - [core] Yaml format match most common convention @oliviertassinari
@@ -1351,7 +1630,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
1351
1630
 
1352
1631
  - The `filterModel` now supports `Date` objects as values for `date` and `dateTime` column types.
1353
1632
  The `filterModel` still accepts strings as values for `date` and `dateTime` column types,
1354
- but all updates to the `filterModel` coming from the UI (e.g. filter panel) will set the value as a `Date` object.
1633
+ but all updates to the `filterModel` coming from the UI (for example filter panel) will set the value as a `Date` object.
1355
1634
 
1356
1635
  #### `@mui/x-data-grid@7.0.0-alpha.6`
1357
1636
 
@@ -1562,7 +1841,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.5`, plus:
1562
1841
  ### Core
1563
1842
 
1564
1843
  - [core] Automate cherry-pick of PRs from `next` -> `master` (#11382) @MBilalShafi
1565
- - [github] Update `no-response` workflow (#11369) @MBilalShafi
1844
+ - [infra] Update `no-response` workflow (#11369) @MBilalShafi
1566
1845
  - [test] Fix flaky screenshots (#11388) @cherniavskii
1567
1846
 
1568
1847
  ## 7.0.0-alpha.4
@@ -1731,7 +2010,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.3`, plus:
1731
2010
  The Firefox browser currently does not support this behavior because the [getWeekInfo](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo) API is not yet implemented.
1732
2011
 
1733
2012
  ```ts
1734
- import { Settings } from 'luxon';
2013
+ import { Settings, Info } from 'luxon';
1735
2014
 
1736
2015
  Settings.defaultWeekSettings = {
1737
2016
  firstDay: 1,
@@ -1800,7 +2079,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.3`.
1800
2079
 
1801
2080
  - [charts] Adjusted `defaultizeValueFormatter` util to accept an optional `series.valueFormatter` value (#11144) @michelengelen
1802
2081
  - [charts] Apply `labelStyle` and `tickLabelStyle` props on `<ChartsYAxis />` (#11180) @akamfoad
1803
- - [charts] Fix TS config (#11259) @alexfauquette
2082
+ - [charts] Fix TypeScript config (#11259) @alexfauquette
1804
2083
  - [charts] Fix error with empty dataset (#11063) @alexfauquette
1805
2084
  - [charts] Fix export strategy (#11235) @alexfauquette
1806
2085
  - [charts] Remove outdated prop-types (#11045) @alexfauquette
@@ -2521,6 +2800,26 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
2521
2800
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
2522
2801
  - [license] Correctly throw errors (#10924) @oliviertassinari
2523
2802
 
2803
+ ## 6.19.7
2804
+
2805
+ _Mar 14, 2024_
2806
+
2807
+ We'd like to offer a big thanks to @LukasTy who made this release possible.
2808
+
2809
+ ### Date Pickers
2810
+
2811
+ #### `@mui/x-date-pickers@6.19.7`
2812
+
2813
+ - [pickers] Keep the existing time when looking for closest enabled date (#12410) @LukasTy
2814
+
2815
+ #### `@mui/x-date-pickers-pro@6.19.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2816
+
2817
+ Same changes as in `@mui/x-date-pickers@6.19.7`.
2818
+
2819
+ ### Docs
2820
+
2821
+ - [docs] Add Pickers custom start of week section (#12425) @LukasTy
2822
+
2524
2823
  ## 6.19.6
2525
2824
 
2526
2825
  _Mar 1, 2024_
@@ -67,6 +67,21 @@ DataGridRaw.propTypes = {
67
67
  * @default false
68
68
  */
69
69
  autoPageSize: PropTypes.bool,
70
+ /**
71
+ * If `true`, columns are autosized after the datagrid is mounted.
72
+ * @default false
73
+ */
74
+ autosizeOnMount: PropTypes.bool,
75
+ /**
76
+ * The options for autosize when user-initiated.
77
+ */
78
+ autosizeOptions: PropTypes.shape({
79
+ columns: PropTypes.arrayOf(PropTypes.string),
80
+ expand: PropTypes.bool,
81
+ includeHeaders: PropTypes.bool,
82
+ includeOutliers: PropTypes.bool,
83
+ outliersFactor: PropTypes.number
84
+ }),
70
85
  /**
71
86
  * Controls the modes of the cells.
72
87
  */
@@ -86,10 +101,10 @@ DataGridRaw.propTypes = {
86
101
  */
87
102
  clipboardCopyCellDelimiter: PropTypes.string,
88
103
  /**
89
- * Number of extra columns to be rendered before/after the visible slice.
90
- * @default 3
104
+ * Column region in pixels to render before/after the viewport
105
+ * @default 150
91
106
  */
92
- columnBuffer: PropTypes.number,
107
+ columnBufferPx: PropTypes.number,
93
108
  columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
94
109
  /**
95
110
  * Sets the height in pixel of the column headers in the Data Grid.
@@ -100,11 +115,6 @@ DataGridRaw.propTypes = {
100
115
  * Set of columns of type [[GridColDef]][].
101
116
  */
102
117
  columns: PropTypes.arrayOf(PropTypes.object).isRequired,
103
- /**
104
- * Number of rows from the `columnBuffer` that can be visible before a new slice is rendered.
105
- * @default 3
106
- */
107
- columnThreshold: PropTypes.number,
108
118
  /**
109
119
  * Set the column visibility model of the Data Grid.
110
120
  * If defined, the Data Grid will ignore the `hide` property in [[GridColDef]].
@@ -115,6 +125,11 @@ DataGridRaw.propTypes = {
115
125
  * @default "standard"
116
126
  */
117
127
  density: PropTypes.oneOf(['comfortable', 'compact', 'standard']),
128
+ /**
129
+ * If `true`, column autosizing on header separator double-click is disabled.
130
+ * @default false
131
+ */
132
+ disableAutosize: PropTypes.bool,
118
133
  /**
119
134
  * If `true`, column filters are disabled.
120
135
  * @default false
@@ -125,6 +140,11 @@ DataGridRaw.propTypes = {
125
140
  * @default false
126
141
  */
127
142
  disableColumnMenu: PropTypes.bool,
143
+ /**
144
+ * If `true`, resizing columns is disabled.
145
+ * @default false
146
+ */
147
+ disableColumnResize: PropTypes.bool,
128
148
  /**
129
149
  * If `true`, hiding/showing columns is disabled.
130
150
  * @default false
@@ -422,12 +442,31 @@ DataGridRaw.propTypes = {
422
442
  * @param {GridCallbackDetails} details Additional details for this callback.
423
443
  */
424
444
  onColumnOrderChange: PropTypes.func,
445
+ /**
446
+ * Callback fired while a column is being resized.
447
+ * @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
448
+ * @param {MuiEvent<React.MouseEvent>} event The event object.
449
+ * @param {GridCallbackDetails} details Additional details for this callback.
450
+ */
451
+ onColumnResize: PropTypes.func,
425
452
  /**
426
453
  * Callback fired when the column visibility model changes.
427
454
  * @param {GridColumnVisibilityModel} model The new model.
428
455
  * @param {GridCallbackDetails} details Additional details for this callback.
429
456
  */
430
457
  onColumnVisibilityModelChange: PropTypes.func,
458
+ /**
459
+ * Callback fired when the width of a column is changed.
460
+ * @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
461
+ * @param {MuiEvent<React.MouseEvent>} event The event object.
462
+ * @param {GridCallbackDetails} details Additional details for this callback.
463
+ */
464
+ onColumnWidthChange: PropTypes.func,
465
+ /**
466
+ * Callback fired when the density changes.
467
+ * @param {GridDensity} density New density value.
468
+ */
469
+ onDensityChange: PropTypes.func,
431
470
  /**
432
471
  * Callback fired when the Filter model changes before the filters are applied.
433
472
  * @param {GridFilterModel} model With all properties from [[GridFilterModel]].
@@ -488,6 +527,11 @@ DataGridRaw.propTypes = {
488
527
  * @param {GridCallbackDetails} details Additional details for this callback.
489
528
  */
490
529
  onRowClick: PropTypes.func,
530
+ /**
531
+ * Callback fired when the row count has changed.
532
+ * @param {number} count Updated row count.
533
+ */
534
+ onRowCountChange: PropTypes.func,
491
535
  /**
492
536
  * Callback fired when a double click event comes from a row container element.
493
537
  * @param {GridRowParams} params With all properties from [[RowParams]].
@@ -565,10 +609,10 @@ DataGridRaw.propTypes = {
565
609
  */
566
610
  processRowUpdate: PropTypes.func,
567
611
  /**
568
- * Number of extra rows to be rendered before/after the visible slice.
569
- * @default 3
612
+ * Row region in pixels to render before/after the viewport
613
+ * @default 150
570
614
  */
571
- rowBuffer: PropTypes.number,
615
+ rowBufferPx: PropTypes.number,
572
616
  /**
573
617
  * Set the total number of rows, if it is different from the length of the value `rows` prop.
574
618
  * If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
@@ -592,8 +636,9 @@ DataGridRaw.propTypes = {
592
636
  rowPositionsDebounceMs: PropTypes.number,
593
637
  /**
594
638
  * Set of rows of type [[GridRowsProp]].
639
+ * @default []
595
640
  */
596
- rows: PropTypes.arrayOf(PropTypes.object).isRequired,
641
+ rows: PropTypes.arrayOf(PropTypes.object),
597
642
  /**
598
643
  * If `false`, the row selection mode is disabled.
599
644
  * @default true
@@ -608,11 +653,6 @@ DataGridRaw.propTypes = {
608
653
  * @default "margin"
609
654
  */
610
655
  rowSpacingType: PropTypes.oneOf(['border', 'margin']),
611
- /**
612
- * Number of rows from the `rowBuffer` that can be visible before a new slice is rendered.
613
- * @default 3
614
- */
615
- rowThreshold: PropTypes.number,
616
656
  /**
617
657
  * Override the height/width of the Data Grid inner scrollbar.
618
658
  */
@@ -26,6 +26,7 @@ import { useGridStatePersistence } from '../hooks/features/statePersistence/useG
26
26
  import { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
27
27
  import { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
28
28
  import { useGridVirtualization, virtualizationStateInitializer } from '../hooks/features/virtualization';
29
+ import { columnResizeStateInitializer, useGridColumnResize } from '../hooks/features/columnResize/useGridColumnResize';
29
30
  export const useDataGridComponent = (inputApiRef, props) => {
30
31
  const apiRef = useGridInitialization(inputApiRef, props);
31
32
 
@@ -48,6 +49,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
48
49
  useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
49
50
  useGridInitializeState(filterStateInitializer, apiRef, props);
50
51
  useGridInitializeState(densityStateInitializer, apiRef, props);
52
+ useGridInitializeState(columnResizeStateInitializer, apiRef, props);
51
53
  useGridInitializeState(paginationStateInitializer, apiRef, props);
52
54
  useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
53
55
  useGridInitializeState(columnMenuStateInitializer, apiRef, props);
@@ -66,6 +68,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
66
68
  useGridFilter(apiRef, props);
67
69
  useGridSorting(apiRef, props);
68
70
  useGridDensity(apiRef, props);
71
+ useGridColumnResize(apiRef, props);
69
72
  useGridPagination(apiRef, props);
70
73
  useGridRowsMeta(apiRef, props);
71
74
  useGridScroll(apiRef, props);
@@ -13,7 +13,6 @@ const DATA_GRID_FORCED_PROPS = {
13
13
  pagination: true,
14
14
  checkboxSelectionVisibleOnly: false,
15
15
  disableColumnReorder: true,
16
- disableColumnResize: true,
17
16
  keepColumnPositionIfDraggedOutside: false,
18
17
  signature: 'DataGrid'
19
18
  };
@@ -26,12 +25,10 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
26
25
  autoPageSize: false,
27
26
  checkboxSelection: false,
28
27
  checkboxSelectionVisibleOnly: false,
29
- columnBuffer: 3,
30
- rowBuffer: 3,
31
- columnThreshold: 3,
32
- rowThreshold: 3,
28
+ columnBufferPx: 150,
29
+ rowBufferPx: 150,
30
+ rows: [],
33
31
  rowSelection: true,
34
- density: 'standard',
35
32
  disableColumnFilter: false,
36
33
  disableColumnMenu: false,
37
34
  disableColumnSelector: false,
@@ -70,7 +67,9 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
70
67
  keepColumnPositionIfDraggedOutside: false,
71
68
  ignoreValueFormatterDuringExport: false,
72
69
  clipboardCopyCellDelimiter: '\t',
73
- rowPositionsDebounceMs: 166
70
+ rowPositionsDebounceMs: 166,
71
+ autosizeOnMount: false,
72
+ disableAutosize: false
74
73
  };
75
74
  const defaultSlots = DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
76
75
  export const useDataGridProps = inProps => {
package/README.md CHANGED
@@ -15,7 +15,7 @@ This component has the following peer dependencies that you will need to install
15
15
 
16
16
  ```json
17
17
  "peerDependencies": {
18
- "@mui/material": "^5.15.0",
18
+ "@mui/material": "^5.15.14",
19
19
  "react": "^17.0.0 || ^18.0.0",
20
20
  "react-dom": "^17.0.0 || ^18.0.0"
21
21
  },
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { UseGridColumnHeadersProps } from '../hooks/features/columnHeaders/useGridColumnHeaders';
3
- export interface GridColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement>, Omit<UseGridColumnHeadersProps, 'innerRef'> {
3
+ export interface GridColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement>, UseGridColumnHeadersProps {
4
4
  ref?: React.Ref<HTMLDivElement>;
5
- innerRef?: React.Ref<HTMLDivElement>;
6
5
  }
7
6
  declare const MemoizedGridColumnHeaders: React.ForwardRefExoticComponent<Omit<GridColumnHeadersProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
7
  export { MemoizedGridColumnHeaders as GridColumnHeaders };