@mui/x-tree-view 7.0.0-alpha.7 → 7.0.0-alpha.9

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 (164) hide show
  1. package/CHANGELOG.md +554 -51
  2. package/README.md +1 -1
  3. package/RichTreeView/RichTreeView.js +14 -79
  4. package/RichTreeView/RichTreeView.types.d.ts +6 -9
  5. package/RichTreeView/index.d.ts +1 -1
  6. package/SimpleTreeView/SimpleTreeView.js +17 -75
  7. package/SimpleTreeView/SimpleTreeView.plugins.d.ts +4 -2
  8. package/SimpleTreeView/SimpleTreeView.types.d.ts +8 -7
  9. package/SimpleTreeView/index.d.ts +1 -1
  10. package/TreeItem/TreeItem.js +62 -39
  11. package/TreeItem/TreeItem.types.d.ts +33 -17
  12. package/TreeItem/TreeItemContent.d.ts +0 -3
  13. package/TreeItem/TreeItemContent.js +2 -5
  14. package/TreeItem/index.d.ts +2 -2
  15. package/TreeItem/index.js +1 -1
  16. package/TreeItem/{useTreeItem.d.ts → useTreeItemState.d.ts} +1 -1
  17. package/TreeItem/{useTreeItem.js → useTreeItemState.js} +4 -2
  18. package/TreeView/TreeView.js +1 -22
  19. package/TreeView/TreeView.types.d.ts +5 -1
  20. package/TreeView/index.d.ts +1 -1
  21. package/icons/icons.d.ts +6 -0
  22. package/icons/icons.js +9 -0
  23. package/icons/index.d.ts +1 -0
  24. package/icons/index.js +1 -0
  25. package/icons/package.json +6 -0
  26. package/index.d.ts +1 -0
  27. package/index.js +3 -2
  28. package/internals/TreeViewProvider/TreeViewContext.d.ts +4 -2
  29. package/internals/TreeViewProvider/TreeViewProvider.types.d.ts +3 -11
  30. package/internals/TreeViewProvider/useTreeViewContext.js +1 -1
  31. package/internals/corePlugins/useTreeViewInstanceEvents/useTreeViewInstanceEvents.js +2 -1
  32. package/internals/corePlugins/useTreeViewInstanceEvents/useTreeViewInstanceEvents.types.d.ts +3 -2
  33. package/internals/index.d.ts +15 -0
  34. package/internals/index.js +4 -0
  35. package/internals/models/MuiCancellableEvent.d.ts +4 -0
  36. package/internals/models/helpers.d.ts +7 -1
  37. package/internals/models/plugin.d.ts +65 -20
  38. package/internals/models/treeView.d.ts +1 -2
  39. package/internals/package.json +6 -0
  40. package/internals/plugins/defaultPlugins.d.ts +6 -4
  41. package/internals/plugins/defaultPlugins.js +2 -2
  42. package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +14 -10
  43. package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.types.d.ts +7 -3
  44. package/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +2 -5
  45. package/internals/plugins/useTreeViewFocus/useTreeViewFocus.types.d.ts +12 -6
  46. package/internals/plugins/useTreeViewIcons/index.d.ts +2 -0
  47. package/internals/plugins/useTreeViewIcons/index.js +1 -0
  48. package/internals/plugins/useTreeViewIcons/useTreeViewIcons.d.ts +3 -0
  49. package/internals/plugins/useTreeViewIcons/useTreeViewIcons.js +22 -0
  50. package/internals/plugins/useTreeViewIcons/useTreeViewIcons.types.d.ts +43 -0
  51. package/internals/plugins/useTreeViewId/useTreeViewId.js +3 -0
  52. package/internals/plugins/useTreeViewId/useTreeViewId.types.d.ts +6 -2
  53. package/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.js +2 -1
  54. package/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.types.d.ts +6 -4
  55. package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +155 -112
  56. package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.types.d.ts +9 -6
  57. package/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +21 -3
  58. package/internals/plugins/useTreeViewNodes/useTreeViewNodes.types.d.ts +10 -2
  59. package/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +17 -5
  60. package/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +15 -5
  61. package/internals/useTreeView/useTreeView.js +7 -3
  62. package/internals/useTreeView/useTreeView.types.d.ts +6 -6
  63. package/internals/useTreeView/useTreeViewModels.js +12 -13
  64. package/internals/utils/extractPluginParamsFromProps.d.ts +16 -0
  65. package/internals/utils/extractPluginParamsFromProps.js +38 -0
  66. package/legacy/RichTreeView/RichTreeView.js +15 -77
  67. package/legacy/SimpleTreeView/SimpleTreeView.js +14 -70
  68. package/legacy/TreeItem/TreeItem.js +63 -39
  69. package/legacy/TreeItem/TreeItemContent.js +9 -12
  70. package/legacy/TreeItem/index.js +1 -1
  71. package/legacy/TreeItem/{useTreeItem.js → useTreeItemState.js} +2 -2
  72. package/legacy/TreeView/TreeView.js +1 -22
  73. package/legacy/icons/icons.js +9 -0
  74. package/legacy/icons/index.js +1 -0
  75. package/legacy/index.js +3 -2
  76. package/legacy/internals/TreeViewProvider/useTreeViewContext.js +1 -1
  77. package/legacy/internals/corePlugins/useTreeViewInstanceEvents/useTreeViewInstanceEvents.js +2 -1
  78. package/legacy/internals/index.js +4 -0
  79. package/legacy/internals/plugins/defaultPlugins.js +2 -2
  80. package/legacy/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +16 -10
  81. package/legacy/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +2 -5
  82. package/legacy/internals/plugins/useTreeViewIcons/index.js +1 -0
  83. package/legacy/internals/plugins/useTreeViewIcons/useTreeViewIcons.js +21 -0
  84. package/legacy/internals/plugins/useTreeViewIcons/useTreeViewIcons.types.js +1 -0
  85. package/legacy/internals/plugins/useTreeViewId/useTreeViewId.js +3 -0
  86. package/legacy/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.js +2 -1
  87. package/legacy/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +157 -110
  88. package/legacy/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +20 -2
  89. package/legacy/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +20 -6
  90. package/legacy/internals/useTreeView/useTreeView.js +6 -2
  91. package/legacy/internals/useTreeView/useTreeViewModels.js +12 -13
  92. package/legacy/internals/utils/extractPluginParamsFromProps.js +36 -0
  93. package/modern/RichTreeView/RichTreeView.js +14 -79
  94. package/modern/SimpleTreeView/SimpleTreeView.js +17 -75
  95. package/modern/TreeItem/TreeItem.js +61 -39
  96. package/modern/TreeItem/TreeItemContent.js +2 -5
  97. package/modern/TreeItem/index.js +1 -1
  98. package/modern/TreeItem/{useTreeItem.js → useTreeItemState.js} +4 -2
  99. package/modern/TreeView/TreeView.js +1 -22
  100. package/modern/icons/icons.js +9 -0
  101. package/modern/icons/index.js +1 -0
  102. package/modern/index.js +3 -2
  103. package/modern/internals/TreeViewProvider/useTreeViewContext.js +1 -1
  104. package/modern/internals/corePlugins/useTreeViewInstanceEvents/useTreeViewInstanceEvents.js +2 -1
  105. package/modern/internals/index.js +4 -0
  106. package/modern/internals/models/MuiCancellableEvent.js +1 -0
  107. package/modern/internals/plugins/defaultPlugins.js +2 -2
  108. package/modern/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +14 -11
  109. package/modern/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +3 -3
  110. package/modern/internals/plugins/useTreeViewIcons/index.js +1 -0
  111. package/modern/internals/plugins/useTreeViewIcons/useTreeViewIcons.js +22 -0
  112. package/modern/internals/plugins/useTreeViewIcons/useTreeViewIcons.types.js +1 -0
  113. package/modern/internals/plugins/useTreeViewId/useTreeViewId.js +3 -0
  114. package/modern/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.js +2 -1
  115. package/modern/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +155 -112
  116. package/modern/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +18 -3
  117. package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +18 -6
  118. package/modern/internals/useTreeView/useTreeView.js +7 -3
  119. package/modern/internals/useTreeView/useTreeViewModels.js +12 -13
  120. package/modern/internals/utils/extractPluginParamsFromProps.js +38 -0
  121. package/node/RichTreeView/RichTreeView.js +14 -79
  122. package/node/SimpleTreeView/SimpleTreeView.js +17 -75
  123. package/node/TreeItem/TreeItem.js +61 -39
  124. package/node/TreeItem/TreeItemContent.js +2 -5
  125. package/node/TreeItem/index.js +4 -4
  126. package/node/TreeItem/{useTreeItem.js → useTreeItemState.js} +5 -3
  127. package/node/TreeView/TreeView.js +1 -22
  128. package/node/icons/icons.js +17 -0
  129. package/node/icons/index.js +16 -0
  130. package/node/index.js +13 -1
  131. package/node/internals/TreeViewProvider/useTreeViewContext.js +1 -1
  132. package/node/internals/corePlugins/useTreeViewInstanceEvents/useTreeViewInstanceEvents.js +2 -1
  133. package/node/internals/index.js +33 -0
  134. package/node/internals/plugins/defaultPlugins.js +2 -2
  135. package/node/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +14 -11
  136. package/node/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +3 -3
  137. package/node/internals/plugins/useTreeViewIcons/index.js +12 -0
  138. package/node/internals/plugins/useTreeViewIcons/useTreeViewIcons.js +29 -0
  139. package/node/internals/plugins/useTreeViewIcons/useTreeViewIcons.types.js +5 -0
  140. package/node/internals/plugins/useTreeViewId/useTreeViewId.js +4 -1
  141. package/node/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.js +2 -1
  142. package/node/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +155 -112
  143. package/node/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +18 -3
  144. package/node/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +18 -6
  145. package/node/internals/useTreeView/useTreeView.js +7 -3
  146. package/node/internals/useTreeView/useTreeViewModels.js +12 -13
  147. package/node/internals/utils/extractPluginParamsFromProps.js +46 -0
  148. package/package.json +7 -7
  149. package/themeAugmentation/components.d.ts +4 -4
  150. package/internals/plugins/useTreeViewContextValueBuilder/index.d.ts +0 -2
  151. package/internals/plugins/useTreeViewContextValueBuilder/index.js +0 -1
  152. package/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.d.ts +0 -3
  153. package/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.js +0 -26
  154. package/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.d.ts +0 -29
  155. package/legacy/internals/plugins/useTreeViewContextValueBuilder/index.js +0 -1
  156. package/legacy/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.js +0 -28
  157. package/modern/internals/plugins/useTreeViewContextValueBuilder/index.js +0 -1
  158. package/modern/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.js +0 -26
  159. package/node/internals/plugins/useTreeViewContextValueBuilder/index.js +0 -12
  160. package/node/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.js +0 -33
  161. /package/internals/{plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.js → models/MuiCancellableEvent.js} +0 -0
  162. /package/{legacy/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.js → internals/plugins/useTreeViewIcons/useTreeViewIcons.types.js} +0 -0
  163. /package/{modern/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.js → legacy/internals/models/MuiCancellableEvent.js} +0 -0
  164. /package/node/internals/{plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.js → models/MuiCancellableEvent.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,428 @@
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
+ ## 7.0.0-alpha.9
7
+
8
+ _Jan 19, 2024_
9
+
10
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 The Data Grid headers have been refactored to bring immense improvements to scrolling, state management, and overall performance of the grid.
13
+ - ⚙️ The Data Grid disabled column-specific features like filtering, sorting, grouping, etc. could now be accessed programmatically. See the related [docs](https://next.mui.com/x/react-data-grid/api-object/#access-the-disabled-column-features) section.
14
+ - 🚀 Uplift the `SimpleTreeView` customization examples (#11424) @noraleonte
15
+ - 🌍 Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11668) on the Data Grid @BCaspari
16
+ - 🐞 Bugfixes
17
+ - 💔 Bump `@mui/material` peer dependency for all packages (#11692) @LukasTy
18
+ The minimum required version of `@mui/material` is now `5.15.0`.
19
+
20
+ ### Data Grid
21
+
22
+ #### Breaking changes
23
+
24
+ - The `ariaV7` experimental flag has been removed and the Data Grid now uses the improved accessibility implementation by default.
25
+ If you were using the `ariaV7` flag, you can remove it from the `experimentalFeatures` prop:
26
+
27
+ ```diff
28
+ -<DataGrid experimentalFeatures={{ ariaV7: true }} />
29
+ +<DataGrid />
30
+ ```
31
+
32
+ The most notable changes that might affect your application or tests are:
33
+
34
+ - The `role="grid"` attribute along with related ARIA attributes are now applied to the inner `div` element instead of the root `div` element:
35
+
36
+ ```diff
37
+ -<div class="MuiDataGrid-root" role="grid" aria-colcount="5" aria-rowcount="101" aria-multiselectable="false">
38
+ +<div class="MuiDataGrid-root">
39
+ <div class="MuiDataGrid-toolbarContainer"></div>
40
+ - <div class="MuiDataGrid-main"></div>
41
+ + <div class="MuiDataGrid-main" role="grid" aria-colcount="5" aria-rowcount="101" aria-multiselectable="false"></div>
42
+ <div class="MuiDataGrid-footerContainer"></div>
43
+ </div>
44
+ ```
45
+
46
+ - When the [Tree data](https://next.mui.com/x/react-data-grid/tree-data/) feature is used, the grid role is now `role="treegrid"` instead of `role="grid"`.
47
+ - The Data Grid cells now have `role="gridcell"` instead of `role="cell"`.
48
+
49
+ - The buttons in toolbar composable components `GridToolbarColumnsButton`, `GridToolbarFilterButton`, `GridToolbarDensity`, and `GridToolbarExport` are now wrapped with a tooltip component and have a consistent interface. To override some props corresponding to the toolbar buttons or their corresponding tooltips, you can use the `slotProps` prop. Following is an example diff. See [Toolbar section](https://next.mui.com/x/react-data-grid/components/#toolbar) for more details.
50
+
51
+ ```diff
52
+ function CustomToolbar() {
53
+ return (
54
+ <GridToolbarContainer>
55
+ <GridToolbarColumnsButton />
56
+ <GridToolbarFilterButton
57
+ - title="Custom filter" // 🛑 This was previously forwarded to the tooltip component
58
+ + slotProps={{ tooltip: { title: 'Custom filter' } }} // ✅ This is the correct way now
59
+ />
60
+ <GridToolbarDensitySelector
61
+ - variant="outlined" // 🛑 This was previously forwarded to the button component
62
+ + slotProps={{ button: { variant: 'outlined' } }} // ✅ This is the correct way now
63
+ />
64
+ </GridToolbarContainer>
65
+ );
66
+ }
67
+ ```
68
+
69
+ - Column grouping is now enabled by default. The flag `columnGrouping` is no longer needed to be passed to the `experimentalFeatures` prop to enable it.
70
+
71
+ ```diff
72
+ -<DataGrid experimentalFeatures={{ columnGrouping: true }} />
73
+ +<DataGrid />
74
+ ```
75
+
76
+ - The column grouping API methods `getColumnGroupPath` and `getAllGroupDetails` are no longer prefixed with `unstable_`.
77
+
78
+ - The column grouping selectors `gridFocusColumnGroupHeaderSelector` and `gridTabIndexColumnGroupHeaderSelector` are no longer prefixed with `unstable_`.
79
+
80
+ - The disabled column specific features like `hiding`, `sorting`, `filtering`, `pinning`, `row grouping`, etc could now be controlled programmatically using `initialState`, respective controlled models, or the [API object](https://next.mui.com/x/react-data-grid/api-object/). See the related [docs](https://next.mui.com/x/react-data-grid/api-object/#access-the-disabled-column-features) section.
81
+
82
+ #### `@mui/x-data-grid@7.0.0-alpha.9`
83
+
84
+ - [DataGrid] Allow to filter non-filterable columns programmatically (#11538) @MBilalShafi
85
+ - [DataGrid] Allow to programmatically sort unsortable columns (#11512) @MBilalShafi
86
+ - [DataGrid] Fix incorrect default value for `filterModel.logicOperator` (#11673) @MBilalShafi
87
+ - [DataGrid] Make `column grouping` feature stable (#11698) @MBilalShafi
88
+ - [DataGrid] Remove the `ariaV7` experimental flag (#11428) @cherniavskii
89
+ - [DataGrid] Start the FAQ page (#11686) @MBilalShafi
90
+ - [DataGrid] Sticky headers (#10059) @romgrk
91
+ - [DataGrid] Wrap toolbar buttons with tooltip (#11357) @MBilalShafi
92
+ - [l10n] Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11668) @BCaspari
93
+
94
+ #### `@mui/x-data-grid-pro@7.0.0-alpha.9` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
95
+
96
+ Same changes as in `@mui/x-data-grid@7.0.0-alpha.9`, plus:
97
+
98
+ - [DataGridPro] Allow non-pinnable columns to be pinned programmatically (#11680) @MBilalShafi
99
+
100
+ #### `@mui/x-data-grid-premium@7.0.0-alpha.9` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
101
+
102
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.9`, plus:
103
+
104
+ - [DataGridPremium] Allow aggregation to be applied for non-aggregable columns (#11574) @MBilalShafi
105
+ - [DataGridPremium] Allow programmatically grouping non-groupable columns (#11539) @MBilalShafi
106
+
107
+ ### Date Pickers
108
+
109
+ #### Breaking changes
110
+
111
+ - The `locales` export has been removed from the root of the packages.
112
+ If you were importing locales from the root, be sure to update it:
113
+
114
+ ```diff
115
+ -import { frFR } from '@mui/x-date-pickers';
116
+ +import { frFR } from '@mui/x-date-pickers/locales';
117
+ ```
118
+
119
+ #### `@mui/x-date-pickers@7.0.0-alpha.9`
120
+
121
+ - [fields] Make `PickersTextField` and its dependencies public (#11581) @flaviendelangle
122
+ - [fields] Support farsi digits (#11639) @flaviendelangle
123
+ - [pickers] Fix AdapterLuxon `getWeekNumber` behavior (#11697) @LukasTy
124
+ - [pickers] Stop root exporting `locales` (#11612) @LukasTy
125
+
126
+ #### `@mui/x-date-pickers-pro@7.0.0-alpha.9` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
127
+
128
+ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
129
+
130
+ ### Charts / `@mui/x-charts@7.0.0-alpha.9`
131
+
132
+ - [charts] Do not propagate `innerRadius` and `outerRadius` to the DOM (#11689) @alexfauquette
133
+ - [charts] Fix default `stackOffset` for `LineChart` (#11647) @alexfauquette
134
+ - [charts] Remove a TS ignore (#11688) @alexfauquette
135
+
136
+ ### Tree View
137
+
138
+ #### Breaking changes
139
+
140
+ - The `expandIcon` / `defaultExpandIcon` props, used to expand the children of a node (rendered when it is collapsed),
141
+ is now defined as a slot both on the Tree View and the Tree Item components.
142
+
143
+ If you were using the `ChevronRight` icon from `@mui/icons-material`,
144
+ you can stop passing it to your component because it is now the default value:
145
+
146
+ ```diff
147
+ -import ChevronRightIcon from '@mui/icons-material/ChevronRight';
148
+
149
+ <SimpleTreeView
150
+ - defaultExpandIcon={<ChevronRightIcon />}
151
+ >
152
+ {items}
153
+ </SimpleTreeView>
154
+ ```
155
+
156
+ If you were passing another icon to your Tree View component,
157
+ you need to use the new `expandIcon` slot on this component:
158
+
159
+ ```diff
160
+ <SimpleTreeView
161
+ - defaultExpandIcon={<MyCustomExpandIcon />}
162
+ + slots={{ expandIcon: MyCustomExpandIcon }}
163
+ >
164
+ {items}
165
+ </SimpleTreeView>
166
+ ```
167
+
168
+ If you were passing another icon to your Tree Item component,
169
+ you need to use the new `expandIcon` slot on this component:
170
+
171
+ ```diff
172
+ <SimpleTreeView>
173
+ <TreeItem
174
+ nodeId="1"
175
+ label="Node 1"
176
+ - expandIcon={<MyCustomExpandIcon />}
177
+ + slots={{ expandIcon: MyCustomExpandIcon }}
178
+ />
179
+ </SimpleTreeView>
180
+ ```
181
+
182
+ - The `collapseIcon` / `defaultCollapseIcon` props, used to collapse the children of a node (rendered when it is expanded),
183
+ is now defined as a slot both on the Tree View and the Tree Item components.
184
+
185
+ If you were using the `ExpandMore` icon from `@mui/icons-material`,
186
+ you can stop passing it to your component because it is now the default value:
187
+
188
+ ```diff
189
+ - import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
190
+
191
+ <SimpleTreeView
192
+ - defaultCollapseIcon={<ExpandMoreIcon />}
193
+ >
194
+ {items}
195
+ </SimpleTreeView>
196
+ ```
197
+
198
+ If you were passing another icon to your Tree View component,
199
+ you need to use the new `collapseIcon` slot on this component:
200
+
201
+ ```diff
202
+ <SimpleTreeView
203
+ - defaultCollapseIcon={<MyCustomCollapseIcon />}
204
+ + slots={{ collapseIcon: MyCustomCollapseIcon }}
205
+ >
206
+ {items}
207
+ </SimpleTreeView>
208
+ ```
209
+
210
+ If you were passing another icon to your Tree Item component,
211
+ you need to use the new `collapseIcon` slot on this component:
212
+
213
+ ```diff
214
+ <SimpleTreeView>
215
+ <TreeItem
216
+ nodeId="1"
217
+ label="Node 1"
218
+ - collapseIcon={<MyCustomCollapseIcon />}
219
+ + slots={{ collapseIcon: MyCustomCollapseIcon }}
220
+ />
221
+ </SimpleTreeView>
222
+ ```
223
+
224
+ - The `useTreeItem` hook has been renamed `useTreeItemState`.
225
+ This will help create a new headless version of the `TreeItem` component based on a future `useTreeItem` hook.
226
+
227
+ ```diff
228
+ -import { TreeItem, useTreeItem } from '@mui/x-tree-view/TreeItem';
229
+ +import { TreeItem, useTreeItemState } from '@mui/x-tree-view/TreeItem';
230
+
231
+ const CustomContent = React.forwardRef((props, ref) => {
232
+ - const { disabled } = useTreeItem(props.nodeId);
233
+ + const { disabled } = useTreeItemState(props.nodeId);
234
+
235
+ // Render some UI
236
+ });
237
+
238
+ function App() {
239
+ return (
240
+ <SimpleTreeView>
241
+ <TreeItem ContentComponent={CustomContent} />
242
+ </SimpleTreeView>
243
+ )
244
+ }
245
+ ```
246
+
247
+ - The `parentIcon` prop has been removed from the Tree View components.
248
+
249
+ If you were passing an icon to your Tree View component,
250
+ you can achieve the same behavior
251
+ by passing the same icon to both the `collapseIcon` and the `expandIcon` slots on this component:
252
+
253
+ ```diff
254
+ <SimpleTreeView
255
+ - defaultParentIcon={<MyCustomParentIcon />}
256
+ + slots={{ collapseIcon: MyCustomParentIcon, expandIcon: MyCustomParentIcon }}
257
+ >
258
+ {items}
259
+ </SimpleTreeView>
260
+ ```
261
+
262
+ - The `endIcon` / `defaultEndIcon` props, rendered next to an item without children,
263
+ is now defined as a slot both on the Tree View and the Tree Item components.
264
+
265
+ If you were passing an icon to your Tree View component,
266
+ you need to use the new `endIcon` slot on this component:
267
+
268
+ ```diff
269
+ <SimpleTreeView
270
+ - defaultEndIcon={<MyCustomEndIcon />}
271
+ + slots={{ endIcon: MyCustomEndIcon }}
272
+ >
273
+ {items}
274
+ </SimpleTreeView>
275
+ ```
276
+
277
+ If you were passing an icon to your Tree Item component,
278
+ you need to use the new `endIcon` slot on this component:
279
+
280
+ ```diff
281
+ <SimpleTreeView>
282
+ <TreeItem
283
+ nodeId="1"
284
+ label="Node 1"
285
+ - endIcon={<MyCustomEndIcon />}
286
+ + slots={{ endIcon: MyCustomEndIcon }}
287
+ />
288
+ </SimpleTreeView>
289
+ ```
290
+
291
+ - The `icon` prop, rendered next to an item without children,
292
+ is now defined as a slot on the Tree Item component.
293
+
294
+ If you were passing an icon to your Tree Item component,
295
+ you need to use the new `icon` slot on this component:
296
+
297
+ ```diff
298
+ <SimpleTreeView>
299
+ <TreeItem
300
+ nodeId="1"
301
+ label="Node 1"
302
+ - icon={<MyCustomIcon />}
303
+ + slots={{ icon: MyCustomIcon }}
304
+ />
305
+ </SimpleTreeView>
306
+ ```
307
+
308
+ #### `@mui/x-tree-view@7.0.0-alpha.9`
309
+
310
+ - [TreeView] Adjust expansion and selection docs (#11723) @noraleonte
311
+ - [TreeView] Improve plugin signature definition (#11665) @flaviendelangle
312
+ - [TreeView] Make each plugin responsible for its context value (#11623) @flaviendelangle
313
+ - [TreeView] Migrate remaining icon props to slots (#11713) @flaviendelangle
314
+ - [TreeView] Pass through `Theme` generic to variants (#11480) @dhulme
315
+ - [TreeView] Rename `useTreeItem` to `useTreeItemState` (#11712) @flaviendelangle
316
+ - [TreeView] Add `slots` and `slotProps` on the Tree View components (#11664) @flaviendelangle
317
+ - [TreeView] Explore a better plugin model API (#11567) @flaviendelangle
318
+
319
+ ### Docs
320
+
321
+ - [docs] Clean the pickers migration guide (#11694) @flaviendelangle
322
+ - [docs] Cleanup and fix Pickers Playground styling (#11700) @LukasTy
323
+ - [docs] First draft of the Tree View custom plugin doc (#11564) @flaviendelangle
324
+ - [docs] Fix Pickers migration syntax and diffs (#11695) @LukasTy
325
+ - [docs] Fix generated tree view API docs (#11737) @LukasTy
326
+ - [docs] Generate docs for Tree View slots (#11730) @flaviendelangle
327
+ - [docs] Improve codemod for v7 (#11650) @oliviertassinari
328
+ - [docs] Improve data grid `pageSizeOptions` prop documentation (#11682) @oliviertassinari
329
+ - [docs] Parse markdown on API docs demo titles (#11728) @LukasTy
330
+ - [docs] Remove the description from the `className` prop (#11693) @oliviertassinari
331
+ - [docs] Uplift `SimpleTreeView` customization examples (#11424) @noraleonte
332
+ - [docs] Uplift the Date Pickers playground (#11555) @danilo-leal
333
+
334
+ ### Core
335
+
336
+ - [core] Bump `@mui/material` peer dependency for all packages (#11692) @LukasTy
337
+ - [core] Make `karma` run in parallel (#11571) @romgrk
338
+ - [core] make `karma-parallel` run under a new command (#11716) @romgrk
339
+ - [code-infra] Migrate all prettier APIs to the async version (#11732) @Janpot
340
+ - [code-infra] Update the Babel macro path (#11479) @michaldudak
341
+ - [docs-infra] Enforce brand name rules (#11651) @oliviertassinari
342
+ - [test] Fix flaky Data Grid test (#11725) @cherniavskii
343
+
344
+ ## 7.0.0-alpha.8
345
+
346
+ _Jan 11, 2024_
347
+
348
+ We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
349
+
350
+ - ⏰ Support date-fns v3 (#11659) @LukasTy
351
+ Pickers support both v2 and v3 of date-fns. For v3 use `AdapterDateFnsV3`.
352
+ ```js
353
+ // with date-fns v2.x
354
+ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
355
+ import de from 'date-fns/locale/de';
356
+ ```
357
+ ```js
358
+ // with date-fns v3.x
359
+ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
360
+ import { de } from 'date-fns/locale/de';
361
+ ```
362
+
363
+ ### Data Grid
364
+
365
+ #### Breaking changes
366
+
367
+ - The import path for locales has been changed:
368
+
369
+ ```diff
370
+ -import { enUS } from '@mui/x-data-grid';
371
+ +import { enUS } from '@mui/x-data-grid/locales';
372
+
373
+ -import { enUS } from '@mui/x-data-grid-pro';
374
+ +import { enUS } from '@mui/x-data-grid-pro/locales';
375
+
376
+ -import { enUS } from '@mui/x-data-grid-premium';
377
+ +import { enUS } from '@mui/x-data-grid-premium/locales';
378
+ ```
379
+
380
+ #### `@mui/x-data-grid@7.0.0-alpha.8`
381
+
382
+ - [DataGrid] Stop exporting locales from the package root (#11614) @cherniavskii
383
+
384
+ #### `@mui/x-data-grid-pro@7.0.0-alpha.8` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
385
+
386
+ Same changes as in `@mui/x-data-grid@7.0.0-alpha.8`.
387
+
388
+ #### `@mui/x-data-grid-premium@7.0.0-alpha.8` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
389
+
390
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.8`.
391
+
392
+ ### Date Pickers
393
+
394
+ #### `@mui/x-date-pickers@7.0.0-alpha.8`
395
+
396
+ - [pickers] Add `date-fns@3.x` adapter (#11462) @LukasTy
397
+ - [pickers] Avoid deeper than 2nd level imports (#11588) @LukasTy
398
+ - [pickers] Fix clearable behavior blocking focus return to `OpenPickerButton` (#11642) @noraleonte
399
+ - [pickers] Move `DateRange` to `@mui/x-date-pickers-pro/models` (#11611) @flaviendelangle
400
+ - [l10n] Add missing Danish (da-DK) locale export (#11640) @etlos
401
+
402
+ #### `@mui/x-date-pickers-pro@7.0.0-alpha.8` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
403
+
404
+ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.8`.
405
+
406
+ ### Tree View / `@mui/x-tree-view@7.0.0-alpha.8`
407
+
408
+ - [tree view] Cleanup `onKeyDown` handler (#11481) @flaviendelangle
409
+ - [tree view] Define the parameters used by each plugin to avoid listing them in each component (#11473) @flaviendelangle
410
+
411
+ ### Docs
412
+
413
+ - [docs] Fix parsing of `x-date-pickers-pro` demo adapter imports (#11628) @LukasTy
414
+ - [docs] Improve `git diff` format @oliviertassinari
415
+ - [docs] Push up the MUI X brand (#11533) @oliviertassinari
416
+ - [docs] Remove old data grid translation files (#11646) @cherniavskii
417
+ - [docs] Improve Server-side data grid docs (#11589) @oliviertassinari
418
+ - [docs] Improve charts landing page (#11570) @oliviertassinari
419
+
420
+ ### Core
421
+
422
+ - [core] Lock `jsdom` version (#11652) @cherniavskii
423
+ - [core] Remove PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD (#11608) @oliviertassinari
424
+ - [core] Simplify isSsr logic (#11606) @oliviertassinari
425
+ - [core] Sync playwright cache between MUI X and Material UI (#11607) @oliviertassinari
426
+ - [core] Use MUI X official name in errors (#11645) @oliviertassinari
427
+
6
428
  ## 7.0.0-alpha.7
7
429
 
8
430
  _Jan 5, 2024_
@@ -19,8 +441,8 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
19
441
  id: 'node-1',
20
442
  label: 'Node 1',
21
443
  children: [
22
- { id: 'node-1-1', label: Node 1.1' },
23
- { id: 'node-1-2', label: Node 1.2' },
444
+ { id: 'node-1-1', label: 'Node 1.1' },
445
+ { id: 'node-1-2', label: 'Node 1.2' },
24
446
  ],
25
447
  },
26
448
  {
@@ -28,7 +450,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
28
450
  label: 'Node 2',
29
451
  },
30
452
  ];
31
-
453
+
32
454
  <RichTreeView
33
455
  items={MUI_X_PRODUCTS}
34
456
  defaultCollapseIcon={<ExpandMoreIcon />}
@@ -88,10 +510,10 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.7`.
88
510
  <TreeView
89
511
  - onNodeToggle={handleExpansionChange}
90
512
  + onExpandedNodesChange={handleExpansionChange}
91
-
513
+
92
514
  - expanded={expandedNodes}
93
515
  + expandedNodes={expandedNodes}
94
-
516
+
95
517
  - defaultExpanded={defaultExpandedNodes}
96
518
  + defaultExpandedNodes={defaultExpandedNodes}
97
519
  />
@@ -274,10 +696,10 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.5`.
274
696
  The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsProps` with `SlotProps`.
275
697
 
276
698
  ```diff
277
- - DateCalendarSlotsComponent
278
- + DateCalendarSlots
279
- - DateCalendarSlotsComponentsProps
280
- + DateCalendarSlotProps
699
+ -DateCalendarSlotsComponent
700
+ -DateCalendarSlotsComponentsProps
701
+ +DateCalendarSlots
702
+ +DateCalendarSlotProps
281
703
  ```
282
704
 
283
705
  - Move `inputRef` inside the props passed to the field hooks
@@ -285,26 +707,26 @@ The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsP
285
707
  The field hooks now only receive the props instead of an object containing both the props and the `inputRef`.
286
708
 
287
709
  ```diff
288
- - const { inputRef, ...otherProps } = props
289
- - const fieldResponse = useDateField({ props: otherProps, inputRef });
290
- + const fieldResponse = useDateField(props);
710
+ -const { inputRef, ...otherProps } = props
711
+ -const fieldResponse = useDateField({ props: otherProps, inputRef });
712
+ +const fieldResponse = useDateField(props);
291
713
  ```
292
714
 
293
715
  If you are using a multi input range field hook, the same applies to `startInputRef` and `endInputRef` params
294
716
 
295
717
  ```diff
296
- - const { inputRef: startInputRef, ...otherStartTextFieldProps } = startTextFieldProps
297
- - const { inputRef: endInputRef, ...otherEndTextFieldProps } = endTextFieldProps
298
-
299
- const fieldResponse = useMultiInputDateRangeField({
300
- sharedProps,
301
- - startTextFieldProps: otherStartTextFieldProps,
302
- - endTextFieldProps: otherEndTextFieldProps,
303
- - startInputRef
304
- - endInputRef,
305
- + startTextFieldProps,
306
- + endTextFieldProps
307
- });
718
+ -const { inputRef: startInputRef, ...otherStartTextFieldProps } = startTextFieldProps
719
+ -const { inputRef: endInputRef, ...otherEndTextFieldProps } = endTextFieldProps
720
+
721
+ const fieldResponse = useMultiInputDateRangeField({
722
+ sharedProps,
723
+ - startTextFieldProps: otherStartTextFieldProps,
724
+ - endTextFieldProps: otherEndTextFieldProps,
725
+ - startInputRef
726
+ - endInputRef,
727
+ + startTextFieldProps,
728
+ + endTextFieldProps
729
+ });
308
730
  ```
309
731
 
310
732
  - Rename the ref returned by the field hooks to `inputRef`
@@ -313,26 +735,26 @@ The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsP
313
735
  This ref was previously named `ref` and has been renamed `inputRef` for extra clarity.
314
736
 
315
737
  ```diff
316
- const fieldResponse = useDateField(props);
738
+ const fieldResponse = useDateField(props);
317
739
 
318
- - return <input ref={fieldResponse.ref} />
319
- + return <input ref={fieldResponse.inputRef} />
740
+ -return <input ref={fieldResponse.ref} />
741
+ +return <input ref={fieldResponse.inputRef} />
320
742
  ```
321
743
 
322
744
  If you are using a multi input range field hook, the same applies to the ref in the `startDate` and `endDate` objects
323
745
 
324
746
  ```diff
325
- const fieldResponse = useDateField(props);
747
+ const fieldResponse = useDateField(props);
326
748
 
327
- return (
328
- <div>
329
- - <input ref={fieldResponse.startDate.ref} />
330
- + <input ref={fieldResponse.startDate.inputRef} />
331
- <span>–</span>
332
- - <input ref={fieldResponse.endDate.ref} />
333
- + <input ref={fieldResponse.endDate.inputRef} />
334
- </div>
335
- )
749
+ return (
750
+ <div>
751
+ - <input ref={fieldResponse.startDate.ref} />
752
+ + <input ref={fieldResponse.startDate.inputRef} />
753
+ <span>–</span>
754
+ - <input ref={fieldResponse.endDate.ref} />
755
+ + <input ref={fieldResponse.endDate.inputRef} />
756
+ </div>
757
+ )
336
758
  ```
337
759
 
338
760
  - Restructure the API of `useClearableField`
@@ -342,23 +764,23 @@ The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsP
342
764
  You should now be able to directly pass the returned value from your field hook (e.g: `useDateField`) to `useClearableField`
343
765
 
344
766
  ```diff
345
- const fieldResponse = useDateField(props);
346
-
347
- - const { InputProps, onClear, clearable, slots, slotProps, ...otherFieldProps } = fieldResponse
348
- - const { InputProps: ProcessedInputProps, fieldProps: processedFieldProps } = useClearableField({
349
- - fieldProps: otherFieldProps,
350
- - InputProps,
351
- - clearable,
352
- - onClear,
353
- - slots,
354
- - slotProps,
355
- - });
767
+ const fieldResponse = useDateField(props);
768
+
769
+ -const { InputProps, onClear, clearable, slots, slotProps, ...otherFieldProps } = fieldResponse
770
+ -const { InputProps: ProcessedInputProps, fieldProps: processedFieldProps } = useClearableField({
771
+ - fieldProps: otherFieldProps,
772
+ - InputProps,
773
+ - clearable,
774
+ - onClear,
775
+ - slots,
776
+ - slotProps,
777
+ -});
356
778
  -
357
- - return <MyCustomTextField {...processedFieldProps} InputProps={ProcessedInputProps} />
779
+ - return <MyCustomTextField {...processedFieldProps} InputProps={ProcessedInputProps} />
358
780
 
359
- + const processedFieldProps = useClearableField(fieldResponse);
781
+ +const processedFieldProps = useClearableField(fieldResponse);
360
782
  +
361
- + return <MyCustomTextField {...processedFieldProps} />
783
+ +return <MyCustomTextField {...processedFieldProps} />
362
784
  ```
363
785
 
364
786
  #### `@mui/x-date-pickers@7.0.0-alpha.5`
@@ -1035,10 +1457,20 @@ And if you need the exact same output you can apply the following transformation
1035
1457
  - The `adapter.toISO` method have been removed, you can directly use your date library:
1036
1458
 
1037
1459
  ```diff
1460
+ // For Day.js
1038
1461
  -const isoString = adapter.toISO(value);
1039
1462
  +const isoString = value.toISOString();
1463
+
1464
+ // For Luxon
1465
+ -const isoString = adapter.toISO(value);
1040
1466
  +const isoString = value.toUTC().toISO({ format: 'extended' });
1467
+
1468
+ // For DateFns
1469
+ -const isoString = adapter.toISO(value);
1041
1470
  +const isoString = dateFns.formatISO(value, { format: 'extended' });
1471
+
1472
+ // For Moment
1473
+ -const isoString = adapter.toISO(value);
1042
1474
  +const isoString = value.toISOString();
1043
1475
  ```
1044
1476
 
@@ -1340,6 +1772,77 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
1340
1772
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
1341
1773
  - [license] Correctly throw errors (#10924) @oliviertassinari
1342
1774
 
1775
+ ## 6.19.1
1776
+
1777
+ _Jan 19, 2024_
1778
+
1779
+ We'd like to offer a big thanks to the 1 contributors who made this release possible. Here are some highlights ✨:
1780
+
1781
+ - 🌍 Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11717) @BCaspari
1782
+ - 🐞 Bugfixes
1783
+
1784
+ ### Data Grid
1785
+
1786
+ #### `@mui/x-data-grid@6.19.1`
1787
+
1788
+ - [l10n] Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11717) @BCaspari
1789
+
1790
+ #### `@mui/x-data-grid-pro@6.19.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
1791
+
1792
+ Same changes as in `@mui/x-data-grid@6.19.1`.
1793
+
1794
+ #### `@mui/x-data-grid-premium@6.19.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
1795
+
1796
+ Same changes as in `@mui/x-data-grid-pro@6.19.1`.
1797
+
1798
+ ### Charts / `@mui/x-charts@6.19.1`
1799
+
1800
+ - [charts] Add `arcLabelRadius` property (#11563) @alexfauquette
1801
+ - [charts] Do not propagate `innerRadius` and `outerRadius` to the DOM (#11719) @alexfauquette
1802
+ - [charts] Fix default `stackOffset` for `LineChart` (#11703) @alexfauquette
1803
+
1804
+ ## 6.19.0
1805
+
1806
+ _Jan 11, 2024_
1807
+
1808
+ We'd like to offer a big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
1809
+
1810
+ - ⏰ Support date-fns v3 (#11659) @LukasTy
1811
+ Pickers support both v2 and v3 of date-fns. For v3 use `AdapterDateFnsV3`.
1812
+ ```js
1813
+ // with date-fns v2.x
1814
+ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
1815
+ import de from 'date-fns/locale/de';
1816
+ ```
1817
+ ```js
1818
+ // with date-fns v3.x
1819
+ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
1820
+ import { de } from 'date-fns/locale/de';
1821
+ ```
1822
+
1823
+ ### Date Pickers
1824
+
1825
+ #### `@mui/x-date-pickers@6.19.0`
1826
+
1827
+ - [pickers] Add date-fns@3.x adapter (#11659) @LukasTy
1828
+ - [pickers] Fix clearable behavior blocking focus return to `OpenPickerButton` (#11643) @noraleonte
1829
+ - [l10n] Add missing Danish (da-DK) locale export (#11641) @etlos
1830
+
1831
+ #### `@mui/x-date-pickers-pro@6.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
1832
+
1833
+ Same changes as in `@mui/x-date-pickers@6.19.0`.
1834
+
1835
+ ### Docs
1836
+
1837
+ - [docs] Add missing component @oliviertassinari
1838
+ - [docs] Fix parsing of `x-date-pickers-pro` demo adapter imports (#11637) @LukasTy
1839
+ - [docs] Push up the MUI X brand (#11533) @oliviertassinari
1840
+ - [docs] Improve Server-side data grid docs (#11589) @oliviertassinari
1841
+ - [docs] Add demo to the charts overview page (#11586) @danilo-leal
1842
+ - [docs] Fix 404 links in the docs @oliviertassinari
1843
+ - [docs] Improve landing page (#11570) @oliviertassinari
1844
+ - [docs] Give a general revision to the docs (#11249) @danilo-leal
1845
+
1343
1846
  ## 6.18.7
1344
1847
 
1345
1848
  _Jan 5, 2024_