@mui/x-tree-view 7.0.0-alpha.8 → 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 (139) hide show
  1. package/CHANGELOG.md +379 -2
  2. package/README.md +1 -1
  3. package/RichTreeView/RichTreeView.js +10 -36
  4. package/RichTreeView/RichTreeView.types.d.ts +6 -9
  5. package/RichTreeView/index.d.ts +1 -1
  6. package/SimpleTreeView/SimpleTreeView.js +12 -37
  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/{modern/TreeItem/useTreeItem.js → TreeItem/useTreeItemState.js} +4 -2
  18. package/TreeView/TreeView.js +0 -21
  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/corePlugins/useTreeViewInstanceEvents/useTreeViewInstanceEvents.types.d.ts +3 -2
  31. package/internals/index.d.ts +15 -0
  32. package/internals/index.js +4 -0
  33. package/internals/models/helpers.d.ts +7 -1
  34. package/internals/models/plugin.d.ts +64 -20
  35. package/internals/models/treeView.d.ts +1 -2
  36. package/internals/package.json +6 -0
  37. package/internals/plugins/defaultPlugins.d.ts +6 -4
  38. package/internals/plugins/defaultPlugins.js +2 -2
  39. package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +8 -10
  40. package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.types.d.ts +7 -3
  41. package/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +0 -6
  42. package/internals/plugins/useTreeViewFocus/useTreeViewFocus.types.d.ts +12 -6
  43. package/internals/plugins/useTreeViewIcons/index.d.ts +2 -0
  44. package/internals/plugins/useTreeViewIcons/index.js +1 -0
  45. package/internals/plugins/useTreeViewIcons/useTreeViewIcons.d.ts +3 -0
  46. package/internals/plugins/useTreeViewIcons/useTreeViewIcons.js +22 -0
  47. package/internals/plugins/useTreeViewIcons/useTreeViewIcons.types.d.ts +43 -0
  48. package/internals/plugins/useTreeViewId/useTreeViewId.types.d.ts +6 -2
  49. package/internals/plugins/useTreeViewJSXNodes/useTreeViewJSXNodes.types.d.ts +6 -4
  50. package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.types.d.ts +9 -6
  51. package/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +11 -0
  52. package/internals/plugins/useTreeViewNodes/useTreeViewNodes.types.d.ts +10 -2
  53. package/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +9 -5
  54. package/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +15 -5
  55. package/internals/useTreeView/useTreeView.js +7 -3
  56. package/internals/useTreeView/useTreeView.types.d.ts +6 -6
  57. package/internals/useTreeView/useTreeViewModels.js +10 -11
  58. package/internals/utils/extractPluginParamsFromProps.d.ts +8 -5
  59. package/internals/utils/extractPluginParamsFromProps.js +17 -6
  60. package/legacy/RichTreeView/RichTreeView.js +3 -27
  61. package/legacy/SimpleTreeView/SimpleTreeView.js +4 -28
  62. package/legacy/TreeItem/TreeItem.js +63 -39
  63. package/legacy/TreeItem/TreeItemContent.js +9 -12
  64. package/legacy/TreeItem/index.js +1 -1
  65. package/legacy/TreeItem/{useTreeItem.js → useTreeItemState.js} +2 -2
  66. package/legacy/TreeView/TreeView.js +0 -21
  67. package/legacy/icons/icons.js +9 -0
  68. package/legacy/icons/index.js +1 -0
  69. package/legacy/index.js +3 -2
  70. package/legacy/internals/index.js +4 -0
  71. package/legacy/internals/plugins/defaultPlugins.js +2 -2
  72. package/legacy/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +10 -10
  73. package/legacy/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +0 -6
  74. package/legacy/internals/plugins/useTreeViewIcons/index.js +1 -0
  75. package/legacy/internals/plugins/useTreeViewIcons/useTreeViewIcons.js +21 -0
  76. package/legacy/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +11 -0
  77. package/legacy/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +12 -6
  78. package/legacy/internals/useTreeView/useTreeView.js +6 -2
  79. package/legacy/internals/useTreeView/useTreeViewModels.js +10 -11
  80. package/legacy/internals/utils/extractPluginParamsFromProps.js +11 -2
  81. package/modern/RichTreeView/RichTreeView.js +10 -36
  82. package/modern/SimpleTreeView/SimpleTreeView.js +12 -37
  83. package/modern/TreeItem/TreeItem.js +61 -39
  84. package/modern/TreeItem/TreeItemContent.js +2 -5
  85. package/modern/TreeItem/index.js +1 -1
  86. package/{TreeItem/useTreeItem.js → modern/TreeItem/useTreeItemState.js} +4 -2
  87. package/modern/TreeView/TreeView.js +0 -21
  88. package/modern/icons/icons.js +9 -0
  89. package/modern/icons/index.js +1 -0
  90. package/modern/index.js +3 -2
  91. package/modern/internals/index.js +4 -0
  92. package/modern/internals/plugins/defaultPlugins.js +2 -2
  93. package/modern/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +7 -10
  94. package/modern/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +0 -3
  95. package/modern/internals/plugins/useTreeViewIcons/index.js +1 -0
  96. package/modern/internals/plugins/useTreeViewIcons/useTreeViewIcons.js +22 -0
  97. package/modern/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +8 -0
  98. package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +9 -5
  99. package/modern/internals/useTreeView/useTreeView.js +7 -3
  100. package/modern/internals/useTreeView/useTreeViewModels.js +10 -11
  101. package/modern/internals/utils/extractPluginParamsFromProps.js +17 -6
  102. package/node/RichTreeView/RichTreeView.js +10 -36
  103. package/node/SimpleTreeView/SimpleTreeView.js +12 -37
  104. package/node/TreeItem/TreeItem.js +61 -39
  105. package/node/TreeItem/TreeItemContent.js +2 -5
  106. package/node/TreeItem/index.js +4 -4
  107. package/node/TreeItem/{useTreeItem.js → useTreeItemState.js} +5 -3
  108. package/node/TreeView/TreeView.js +0 -21
  109. package/node/icons/icons.js +17 -0
  110. package/node/icons/index.js +16 -0
  111. package/node/index.js +13 -1
  112. package/node/internals/index.js +33 -0
  113. package/node/internals/plugins/defaultPlugins.js +2 -2
  114. package/node/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +7 -10
  115. package/node/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +0 -3
  116. package/node/internals/plugins/useTreeViewIcons/index.js +12 -0
  117. package/node/internals/plugins/useTreeViewIcons/useTreeViewIcons.js +29 -0
  118. package/node/internals/plugins/useTreeViewNodes/useTreeViewNodes.js +8 -0
  119. package/node/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +9 -5
  120. package/node/internals/useTreeView/useTreeView.js +7 -3
  121. package/node/internals/useTreeView/useTreeViewModels.js +10 -11
  122. package/node/internals/utils/extractPluginParamsFromProps.js +18 -6
  123. package/package.json +7 -7
  124. package/themeAugmentation/components.d.ts +4 -4
  125. package/internals/plugins/useTreeViewContextValueBuilder/index.d.ts +0 -2
  126. package/internals/plugins/useTreeViewContextValueBuilder/index.js +0 -1
  127. package/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.d.ts +0 -3
  128. package/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.js +0 -32
  129. package/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.d.ts +0 -29
  130. package/legacy/internals/plugins/useTreeViewContextValueBuilder/index.js +0 -1
  131. package/legacy/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.js +0 -34
  132. package/modern/internals/plugins/useTreeViewContextValueBuilder/index.js +0 -1
  133. package/modern/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.js +0 -32
  134. package/node/internals/plugins/useTreeViewContextValueBuilder/index.js +0 -12
  135. package/node/internals/plugins/useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.js +0 -39
  136. /package/internals/plugins/{useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.js → useTreeViewIcons/useTreeViewIcons.types.js} +0 -0
  137. /package/legacy/internals/plugins/{useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.js → useTreeViewIcons/useTreeViewIcons.types.js} +0 -0
  138. /package/modern/internals/plugins/{useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.js → useTreeViewIcons/useTreeViewIcons.types.js} +0 -0
  139. /package/node/internals/plugins/{useTreeViewContextValueBuilder/useTreeViewContextValueBuilder.types.js → useTreeViewIcons/useTreeViewIcons.types.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,344 @@
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
+
6
344
  ## 7.0.0-alpha.8
7
345
 
8
346
  _Jan 11, 2024_
@@ -103,8 +441,8 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
103
441
  id: 'node-1',
104
442
  label: 'Node 1',
105
443
  children: [
106
- { id: 'node-1-1', label: Node 1.1' },
107
- { 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' },
108
446
  ],
109
447
  },
110
448
  {
@@ -1119,10 +1457,20 @@ And if you need the exact same output you can apply the following transformation
1119
1457
  - The `adapter.toISO` method have been removed, you can directly use your date library:
1120
1458
 
1121
1459
  ```diff
1460
+ // For Day.js
1122
1461
  -const isoString = adapter.toISO(value);
1123
1462
  +const isoString = value.toISOString();
1463
+
1464
+ // For Luxon
1465
+ -const isoString = adapter.toISO(value);
1124
1466
  +const isoString = value.toUTC().toISO({ format: 'extended' });
1467
+
1468
+ // For DateFns
1469
+ -const isoString = adapter.toISO(value);
1125
1470
  +const isoString = dateFns.formatISO(value, { format: 'extended' });
1471
+
1472
+ // For Moment
1473
+ -const isoString = adapter.toISO(value);
1126
1474
  +const isoString = value.toISOString();
1127
1475
  ```
1128
1476
 
@@ -1424,6 +1772,35 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
1424
1772
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
1425
1773
  - [license] Correctly throw errors (#10924) @oliviertassinari
1426
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
+
1427
1804
  ## 6.19.0
1428
1805
 
1429
1806
  _Jan 11, 2024_
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.8.6",
18
+ "@mui/material": "^5.15.0",
19
19
  "react": "^17.0.0 || ^18.0.0",
20
20
  "react-dom": "^17.0.0 || ^18.0.0"
21
21
  },
@@ -1,6 +1,4 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
1
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["slots", "slotProps"];
4
2
  import * as React from 'react';
5
3
  import PropTypes from 'prop-types';
6
4
  import { styled, useThemeProps } from '@mui/material/styles';
@@ -83,19 +81,16 @@ const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps
83
81
  childrenWarning();
84
82
  }
85
83
  }
86
- const _extractPluginParamsF = extractPluginParamsFromProps({
87
- props,
88
- plugins: DEFAULT_TREE_VIEW_PLUGINS,
89
- rootRef: ref
90
- }),
91
- {
92
- pluginParams,
93
- otherProps: {
94
- slots,
95
- slotProps
96
- }
97
- } = _extractPluginParamsF,
98
- otherProps = _objectWithoutPropertiesLoose(_extractPluginParamsF.otherProps, _excluded);
84
+ const {
85
+ pluginParams,
86
+ slots,
87
+ slotProps,
88
+ otherProps
89
+ } = extractPluginParamsFromProps({
90
+ props,
91
+ plugins: DEFAULT_TREE_VIEW_PLUGINS,
92
+ rootRef: ref
93
+ });
99
94
  const {
100
95
  getRootProps,
101
96
  contextValue,
@@ -143,34 +138,13 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
143
138
  * Override or extend the styles applied to the component.
144
139
  */
145
140
  classes: PropTypes.object,
146
- /**
147
- * className applied to the root element.
148
- */
149
141
  className: PropTypes.string,
150
- /**
151
- * The default icon used to collapse the node.
152
- */
153
- defaultCollapseIcon: PropTypes.node,
154
- /**
155
- * The default icon displayed next to a end node. This is applied to all
156
- * tree nodes and can be overridden by the TreeItem `icon` prop.
157
- */
158
- defaultEndIcon: PropTypes.node,
159
142
  /**
160
143
  * Expanded node ids.
161
144
  * Used when the item's expansion is not controlled.
162
145
  * @default []
163
146
  */
164
147
  defaultExpandedNodes: PropTypes.arrayOf(PropTypes.string),
165
- /**
166
- * The default icon used to expand the node.
167
- */
168
- defaultExpandIcon: PropTypes.node,
169
- /**
170
- * The default icon displayed next to a parent node. This is applied to all
171
- * parent nodes and can be overridden by the TreeItem `icon` prop.
172
- */
173
- defaultParentIcon: PropTypes.node,
174
148
  /**
175
149
  * Selected node ids. (Uncontrolled)
176
150
  * When `multiSelect` is true this takes an array of strings; when false (default) a string.
@@ -3,17 +3,17 @@ import { Theme } from '@mui/material/styles';
3
3
  import { SxProps } from '@mui/system';
4
4
  import { SlotComponentProps } from '@mui/base/utils';
5
5
  import { RichTreeViewClasses } from './richTreeViewClasses';
6
- import { DefaultTreeViewPluginParameters } from '../internals/plugins/defaultPlugins';
6
+ import { DefaultTreeViewPluginParameters, DefaultTreeViewPluginSlotProps, DefaultTreeViewPluginSlots } from '../internals/plugins/defaultPlugins';
7
7
  import { TreeItem, TreeItemProps } from '../TreeItem';
8
8
  import { TreeViewItemId } from '../models';
9
9
  interface RichTreeViewItemSlotOwnerState {
10
10
  nodeId: TreeViewItemId;
11
11
  label: string;
12
12
  }
13
- export interface RichTreeViewSlotsComponent {
13
+ export interface RichTreeViewSlots extends DefaultTreeViewPluginSlots {
14
14
  /**
15
15
  * Element rendered at the root.
16
- * @default TreeViewRoot
16
+ * @default RichTreeViewRoot
17
17
  */
18
18
  root?: React.ElementType;
19
19
  /**
@@ -22,14 +22,11 @@ export interface RichTreeViewSlotsComponent {
22
22
  */
23
23
  item?: React.JSXElementConstructor<TreeItemProps>;
24
24
  }
25
- export interface RichTreeViewSlotsComponentsProps<R extends {}, Multiple extends boolean | undefined> {
25
+ export interface RichTreeViewSlotProps<R extends {}, Multiple extends boolean | undefined> extends DefaultTreeViewPluginSlotProps {
26
26
  root?: SlotComponentProps<'ul', {}, RichTreeViewProps<R, Multiple>>;
27
27
  item?: SlotComponentProps<typeof TreeItem, {}, RichTreeViewItemSlotOwnerState>;
28
28
  }
29
29
  export interface RichTreeViewPropsBase extends React.HTMLAttributes<HTMLUListElement> {
30
- /**
31
- * className applied to the root element.
32
- */
33
30
  className?: string;
34
31
  /**
35
32
  * Override or extend the styles applied to the component.
@@ -45,11 +42,11 @@ export interface RichTreeViewProps<R extends {}, Multiple extends boolean | unde
45
42
  * Overridable component slots.
46
43
  * @default {}
47
44
  */
48
- slots?: RichTreeViewSlotsComponent;
45
+ slots?: RichTreeViewSlots;
49
46
  /**
50
47
  * The props used for each component slot.
51
48
  * @default {}
52
49
  */
53
- slotProps?: RichTreeViewSlotsComponentsProps<R, Multiple>;
50
+ slotProps?: RichTreeViewSlotProps<R, Multiple>;
54
51
  }
55
52
  export {};
@@ -1,3 +1,3 @@
1
1
  export * from './RichTreeView';
2
2
  export * from './richTreeViewClasses';
3
- export type { RichTreeViewProps, RichTreeViewPropsBase } from './RichTreeView.types';
3
+ export type { RichTreeViewProps, RichTreeViewPropsBase, RichTreeViewSlots, RichTreeViewSlotProps, } from './RichTreeView.types';
@@ -1,6 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["slots", "slotProps"];
4
2
  import * as React from 'react';
5
3
  import PropTypes from 'prop-types';
6
4
  import { styled, useThemeProps } from '@mui/material/styles';
@@ -57,20 +55,18 @@ const SimpleTreeView = /*#__PURE__*/React.forwardRef(function SimpleTreeView(inP
57
55
  itemsPropWarning();
58
56
  }
59
57
  }
60
- const _extractPluginParamsF = extractPluginParamsFromProps({
61
- props: _extends({}, props, {
62
- items: EMPTY_ITEMS
63
- }),
64
- plugins: SIMPLE_TREE_VIEW_PLUGINS,
65
- rootRef: ref
58
+ const {
59
+ pluginParams,
60
+ slots,
61
+ slotProps,
62
+ otherProps
63
+ } = extractPluginParamsFromProps({
64
+ props: _extends({}, props, {
65
+ items: EMPTY_ITEMS
66
66
  }),
67
- {
68
- pluginParams,
69
- otherProps: {
70
- slots
71
- }
72
- } = _extractPluginParamsF,
73
- otherProps = _objectWithoutPropertiesLoose(_extractPluginParamsF.otherProps, _excluded);
67
+ plugins: SIMPLE_TREE_VIEW_PLUGINS,
68
+ rootRef: ref
69
+ });
74
70
  const {
75
71
  getRootProps,
76
72
  contextValue
@@ -79,7 +75,7 @@ const SimpleTreeView = /*#__PURE__*/React.forwardRef(function SimpleTreeView(inP
79
75
  const Root = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : SimpleTreeViewRoot;
80
76
  const rootProps = useSlotProps({
81
77
  elementType: Root,
82
- externalSlotProps: {},
78
+ externalSlotProps: slotProps == null ? void 0 : slotProps.root,
83
79
  externalForwardedProps: otherProps,
84
80
  className: classes.root,
85
81
  getSlotProps: getRootProps,
@@ -103,34 +99,13 @@ process.env.NODE_ENV !== "production" ? SimpleTreeView.propTypes = {
103
99
  * Override or extend the styles applied to the component.
104
100
  */
105
101
  classes: PropTypes.object,
106
- /**
107
- * className applied to the root element.
108
- */
109
102
  className: PropTypes.string,
110
- /**
111
- * The default icon used to collapse the node.
112
- */
113
- defaultCollapseIcon: PropTypes.node,
114
- /**
115
- * The default icon displayed next to a end node. This is applied to all
116
- * tree nodes and can be overridden by the TreeItem `icon` prop.
117
- */
118
- defaultEndIcon: PropTypes.node,
119
103
  /**
120
104
  * Expanded node ids.
121
105
  * Used when the item's expansion is not controlled.
122
106
  * @default []
123
107
  */
124
108
  defaultExpandedNodes: PropTypes.arrayOf(PropTypes.string),
125
- /**
126
- * The default icon used to expand the node.
127
- */
128
- defaultExpandIcon: PropTypes.node,
129
- /**
130
- * The default icon displayed next to a parent node. This is applied to all
131
- * parent nodes and can be overridden by the TreeItem `icon` prop.
132
- */
133
- defaultParentIcon: PropTypes.node,
134
109
  /**
135
110
  * Selected node ids. (Uncontrolled)
136
111
  * When `multiSelect` is true this takes an array of strings; when false (default) a string.
@@ -1,6 +1,8 @@
1
- import { DefaultTreeViewPluginParameters } from '../internals/plugins/defaultPlugins';
1
+ import { DefaultTreeViewPluginParameters, DefaultTreeViewPluginSlotProps, DefaultTreeViewPluginSlots } from '../internals/plugins/defaultPlugins';
2
2
  import { ConvertPluginsIntoSignatures } from '../internals/models';
3
- export declare const SIMPLE_TREE_VIEW_PLUGINS: readonly [import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewId").UseTreeViewIdSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewNodes").UseTreeViewNodesSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewExpansion").UseTreeViewExpansionSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewSelection").UseTreeViewSelectionSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewFocus").UseTreeViewFocusSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewKeyboardNavigation").UseTreeViewKeyboardNavigationSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewContextValueBuilder").UseTreeViewContextValueBuilderSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewJSXNodes").UseTreeViewJSXNodesSignature>];
3
+ export declare const SIMPLE_TREE_VIEW_PLUGINS: readonly [import("../internals/models").TreeViewPlugin<import("../internals").UseTreeViewIdSignature>, import("../internals/models").TreeViewPlugin<import("../internals").UseTreeViewNodesSignature>, import("../internals/models").TreeViewPlugin<import("../internals").UseTreeViewExpansionSignature>, import("../internals/models").TreeViewPlugin<import("../internals").UseTreeViewSelectionSignature>, import("../internals/models").TreeViewPlugin<import("../internals").UseTreeViewFocusSignature>, import("../internals/models").TreeViewPlugin<import("../internals").UseTreeViewKeyboardNavigationSignature>, import("../internals/models").TreeViewPlugin<import("../internals").UseTreeViewIconsSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewJSXNodes").UseTreeViewJSXNodesSignature>];
4
4
  export type SimpleTreeViewPlugins = ConvertPluginsIntoSignatures<typeof SIMPLE_TREE_VIEW_PLUGINS>;
5
+ export type SimpleTreeViewPluginSlots = DefaultTreeViewPluginSlots;
6
+ export type SimpleTreeViewPluginSlotProps = DefaultTreeViewPluginSlotProps;
5
7
  export interface SimpleTreeViewPluginParameters<Multiple extends boolean | undefined> extends Omit<DefaultTreeViewPluginParameters<any, Multiple>, 'items' | 'isItemDisabled'> {
6
8
  }
@@ -3,11 +3,15 @@ import { Theme } from '@mui/material/styles';
3
3
  import { SlotComponentProps } from '@mui/base/utils';
4
4
  import { SxProps } from '@mui/system';
5
5
  import { SimpleTreeViewClasses } from './simpleTreeViewClasses';
6
- import { SimpleTreeViewPluginParameters } from './SimpleTreeView.plugins';
7
- export interface SimpleTreeViewSlots {
8
- root: React.ElementType;
6
+ import { SimpleTreeViewPluginParameters, SimpleTreeViewPluginSlotProps, SimpleTreeViewPluginSlots } from './SimpleTreeView.plugins';
7
+ export interface SimpleTreeViewSlots extends SimpleTreeViewPluginSlots {
8
+ /**
9
+ * Element rendered at the root.
10
+ * @default SimpleTreeViewRoot
11
+ */
12
+ root?: React.ElementType;
9
13
  }
10
- export interface SimpleTreeViewSlotProps {
14
+ export interface SimpleTreeViewSlotProps extends SimpleTreeViewPluginSlotProps {
11
15
  root?: SlotComponentProps<'ul', {}, {}>;
12
16
  }
13
17
  export interface SimpleTreeViewProps<Multiple extends boolean | undefined> extends SimpleTreeViewPluginParameters<Multiple>, React.HTMLAttributes<HTMLUListElement> {
@@ -23,9 +27,6 @@ export interface SimpleTreeViewProps<Multiple extends boolean | undefined> exten
23
27
  * The props used for each component slot.
24
28
  */
25
29
  slotProps?: SimpleTreeViewSlotProps;
26
- /**
27
- * className applied to the root element.
28
- */
29
30
  className?: string;
30
31
  /**
31
32
  * Override or extend the styles applied to the component.