@mui/x-tree-view 7.0.0-beta.0 β†’ 7.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,271 @@
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-beta.2
7
+
8
+ _Feb 9, 2024_
9
+
10
+ We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - πŸš€ Add slot typings on the Data Grid components (#11795) @romgrk
13
+ - 🎁 Support UTC date formatting in Charts tooltip (#11943) @shaharyar-shamshi
14
+ - 🌍 Improve Danish (da-DK) locale Data Grid (#11877) @ShahrazH
15
+ - 🐞 Bugfixes
16
+ - πŸ“š Documentation improvements
17
+
18
+ ### Data Grid
19
+
20
+ #### `@mui/x-data-grid@v7.0.0-beta.2`
21
+
22
+ - [DataGrid] Add `removeAllFilterItems` as a reason of `onFilterModelChange` callback (#11911) @shaharyar-shamshi
23
+ - [DataGrid] Add slot typings (#11795) @romgrk
24
+ - [DataGrid] Add support for dialogs in menu actions (#11909) @cherniavskii
25
+ - [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11609) @pcorpet
26
+ - [DataGrid] Fix incorrect computation of `lastPage` in `GridPagination` (#11958) @MBilalShafi
27
+ - [DataGrid] Improve vertical scrolling performance (#11924) @romgrk
28
+ - [l10n] Improve Danish (da-DK) locale (#11877) @ShahrazH
29
+
30
+ #### `@mui/x-data-grid-pro@v7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
+
32
+ Same changes as in `@mui/x-data-grid@v7.0.0-beta.2`.
33
+
34
+ #### `@mui/x-data-grid-premium@v7.0.0-beta.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
35
+
36
+ Same changes as in `@mui/x-data-grid-pro@v7.0.0-beta.2`, plus:
37
+
38
+ - [DataGridPremium] Fix autosize grouping cell (#11870) @romgrk
39
+ - [DataGridPremium] Fix clipboard paste not working with Caps Lock enabled (#11965) @shaharyar-shamshi
40
+
41
+ ### Date Pickers
42
+
43
+ #### `@mui/x-date-pickers@v7.0.0-beta.2`
44
+
45
+ - [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11936) @LukasTy
46
+ - [pickers] Limit the valid values of `TDate` (#11791) @flaviendelangle
47
+
48
+ #### `@mui/x-date-pickers-pro@v7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
49
+
50
+ Same changes as in `@mui/x-date-pickers@v7.0.0-beta.2`.
51
+
52
+ ### Charts / `@mui/x-charts@v7.0.0-beta.2`
53
+
54
+ - [charts] Add `reverse` property to axes (#11899) @alexfauquette
55
+ - [charts] Allow series ids to be numbers (#11941) @alexfauquette
56
+ - [charts] Support UTC date formatting in tooltip (#11943) @shaharyar-shamshi
57
+
58
+ ### Tree View / `@mui/x-tree-view@v7.0.0-beta.2`
59
+
60
+ - [TreeView] Correctly detect if an item is expandable (#11963) @swalker326
61
+ - [TreeView] Polish the default design & revise the simple version pages (#11529) @danilo-leal
62
+
63
+ ### License
64
+
65
+ #### Breaking changes
66
+
67
+ - If you're using the [commercial license](https://next.mui.com/x/introduction/licensing), you need to update the import path:
68
+
69
+ ```diff
70
+ -import { LicenseInfo } from '@mui/x-license-pro';
71
+ +import { LicenseInfo } from '@mui/x-license';
72
+ ```
73
+
74
+ `@mui/x-license@v7.0.0-beta.2`
75
+
76
+ - [license] Rename `@mui/x-license-pro` to `@mui/x-license` (#11938) @cherniavskii
77
+
78
+ ### Docs
79
+
80
+ - [docs] Add a note about `AdapterDateFnsV3` on the Getting Started page (#11985) @flaviendelangle
81
+ - [docs] Add missing `Charts` breaking change steps (#11971) @alexfauquette
82
+ - [docs] Fix `ChartsTooltip` typo (#11961) @thisisharsh7
83
+ - [docs] Refactor `Localization` documentation sections (#11989) @LukasTy
84
+ - [docs] Use "cannot" instead of "can't" or "can not" (#11986) @flaviendelangle
85
+ - [docs] Add quick fixes to the migration guide (#11806) @danilo-leal
86
+ - [docs] Avoid use of shorthand (#12000) @oliviertassinari
87
+ - [docs] Avoid the use of MUIΒ Core @oliviertassinari
88
+ - [docs] Fix image size and dark mode @oliviertassinari
89
+ - [docs] Follow blank line convention with use client @oliviertassinari
90
+ - [docs] Stable layout between light and dark mode @oliviertassinari
91
+
92
+ ### Core
93
+
94
+ - [core] Add `docs:serve` script (#11935) @cherniavskii
95
+ - [core] Bump monorepo (#12001) @cherniavskii
96
+ - [core] Deprecate `LicenseInfo` re-exports (#11956) @cherniavskii
97
+ - [core] Fix `test_types` failing on the `next` branch (#11944) @cherniavskii
98
+ - [core] Fix failing `test_static` on the next branch (#11977) @cherniavskii
99
+ - [core] Flatten grid packages folder (#11946) @cherniavskii
100
+ - [core] Improve license info deprecation message (#11974) @cherniavskii
101
+ - [core] Integrate changes from Core #40842 PR (#11801) @michaldudak
102
+ - [core] Move next config to ESM (#11882) @Janpot
103
+ - [core] Add auto-message on closed issues (#11805) @michelengelen
104
+ - [core] Simplify bug reproduction (#11849) @oliviertassinari
105
+ - [core] Fix npm reference @oliviertassinari
106
+ - [core] Normalize issue template @oliviertassinari
107
+
108
+ ## 7.0.0-beta.1
109
+
110
+ _Feb 1, 2024_
111
+
112
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
113
+
114
+ - πŸƒ Improve the filtering performance of the Data Grid by changing the `GridColDef` methods signatures (#11573) @cherniavskii
115
+ - 🎁 The Line Chart component now has animation by default (#11620) @alexfauquette
116
+ - πŸš€ All charts have click handlers (#11411) @alexfauquette
117
+ Test their respective documentation demonstrations to know more about the data format:
118
+
119
+ - [Scatter Chart](https://next.mui.com/x/react-charts/scatter/#click-event)
120
+ - [Line Chart](https://next.mui.com/x/react-charts/lines/#click-event)
121
+ - [Bar Chart](https://next.mui.com/x/react-charts/bars/#click-event)
122
+ - [Pie Chart](https://next.mui.com/x/react-charts/pie/#click-event)
123
+
124
+ Big thanks to @giladappsforce and @yaredtsy for their contribution on exploring this feature.
125
+
126
+ ### Data Grid
127
+
128
+ ### Breaking changes
129
+
130
+ - The signature of `GridColDef['valueGetter']` has been changed for performance reasons:
131
+
132
+ ```diff
133
+ - valueGetter: ({ value, row }) => value,
134
+ + valueGetter: (value, row, column, apiRef) => value,
135
+ ```
136
+
137
+ The `GridValueGetterParams` interface has been removed:
138
+
139
+ ```diff
140
+ - const customValueGetter = (params: GridValueGetterParams) => params.row.budget;
141
+ + const customValueGetter: GridValueGetterFn = (value, row) => row.budget;
142
+ ```
143
+
144
+ - The signature of `GridColDef['valueFormatter']` has been changed for performance reasons:
145
+
146
+ ```diff
147
+ - valueFormatter: ({ value }) => value,
148
+ + valueFormatter: (value, row, column, apiRef) => value,
149
+ ```
150
+
151
+ The `GridValueFormatterParams` interface has been removed:
152
+
153
+ ```diff
154
+ - const gridDateFormatter = ({ value, field, id }: GridValueFormatterParams<Date>) => value.toLocaleDateString();
155
+ + const gridDateFormatter: GridValueFormatter = (value: Date) => value.toLocaleDateString();
156
+ ```
157
+
158
+ - The signature of `GridColDef['valueSetter']` has been changed for performance reasons:
159
+
160
+ ```diff
161
+ - valueSetter: (params) => {
162
+ - const [firstName, lastName] = params.value!.toString().split(' ');
163
+ - return { ...params.row, firstName, lastName };
164
+ - }
165
+ + valueSetter: (value, row) => {
166
+ + const [firstName, lastName] = value!.toString().split(' ');
167
+ + return { ...row, firstName, lastName };
168
+ +}
169
+ ```
170
+
171
+ The `GridValueSetterParams` interface has been removed:
172
+
173
+ ```diff
174
+ - const setFullName = (params: GridValueSetterParams) => {
175
+ - const [firstName, lastName] = params.value!.toString().split(' ');
176
+ - return { ...params.row, firstName, lastName };
177
+ - };
178
+ + const setFullName: GridValueSetter<Row> = (value, row) => {
179
+ + const [firstName, lastName] = value!.toString().split(' ');
180
+ + return { ...row, firstName, lastName };
181
+ + }
182
+ ```
183
+
184
+ - The signature of `GridColDef['valueParser']` has been changed for performance reasons:
185
+
186
+ ```diff
187
+ - valueParser: (value, params: GridCellParams) => value.toLowerCase(),
188
+ + valueParser: (value, row, column, apiRef) => value.toLowerCase(),
189
+ ```
190
+
191
+ - The signature of `GridColDef['colSpan']` has been changed for performance reasons:
192
+
193
+ ```diff
194
+ - colSpan: ({ row, field, value }: GridCellParams) => (row.id === 'total' ? 2 : 1),
195
+ + colSpan: (value, row, column, apiRef) => (row.id === 'total' ? 2 : 1),
196
+ ```
197
+
198
+ - The signature of `GridColDef['pastedValueParser']` has been changed for performance reasons:
199
+
200
+ ```diff
201
+ - pastedValueParser: (value, params) => new Date(value),
202
+ + pastedValueParser: (value, row, column, apiRef) => new Date(value),
203
+ ```
204
+
205
+ - The signature of `GridColDef['groupingValueGetter']` has been changed for performance reasons:
206
+
207
+ ```diff
208
+ - groupingValueGetter: (params) => params.value.name,
209
+ + groupingValueGetter: (value: { name: string }) => value.name,
210
+ ```
211
+
212
+ #### `@mui/x-data-grid@7.0.0-beta.1`
213
+
214
+ - [DataGrid] Add `toggleAllMode` prop to the `columnsManagement` slot (#10794) @H999
215
+ - [DataGrid] Change `GridColDef` methods signatures (#11573) @cherniavskii
216
+ - [DataGrid] Fix row reorder with cell selection (#11783) @PEsteves8
217
+ - [DataGrid] Make columns management' casing consistent (#11858) @MBilalShafi
218
+ - [l10n] Improve Hebrew (he-IL) locale (#11788) @danielmishan85
219
+
220
+ #### `@mui/x-data-grid-pro@7.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
221
+
222
+ Same changes as in `@mui/x-data-grid@7.0.0-beta.1`.
223
+
224
+ #### `@mui/x-data-grid-premium@7.0.0-beta.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
225
+
226
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.1`.
227
+
228
+ ### Date Pickers
229
+
230
+ #### `@mui/x-date-pickers@7.0.0-beta.1`
231
+
232
+ - [TimePicker] Add missing toolbar classes descriptions (#11856) @LukasTy
233
+
234
+ #### `@mui/x-date-pickers-pro@7.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
235
+
236
+ Same changes as in `@mui/x-date-pickers@7.0.0-beta.1`.
237
+
238
+ ### Charts
239
+
240
+ #### Breaking changes
241
+
242
+ - The line chart now have animation by default.
243
+ You can disable it with `skipAnimation` prop.
244
+ See [animation documentation](next.mui.com/x/react-charts/lines/#animation) for more information.
245
+
246
+ - Pie charts `onClick` get renamed `onItemClick` for consistency with other charts click callback.
247
+
248
+ `@mui/x-charts@7.0.0-beta.1`
249
+
250
+ - [charts] Add `onClick` support (#11411) @alexfauquette
251
+ - [charts] Add line animation (#11620) @alexfauquette
252
+ - [charts] Document how to modify color according to values (#11824) @alexfauquette
253
+ - [charts] Fix Tooltip crash with out of range lines (#11898) @alexfauquette
254
+
255
+ ### Docs
256
+
257
+ - [docs] Add a general uplift to the changelog page (#11396) @danilo-leal
258
+ - [docs] Do not reference the Tree View overview page in the API pages (#11826) @flaviendelangle
259
+ - [docs] Fix charts API links (#11832) @alexfauquette
260
+ - [docs] Improve Support page (#11556) @oliviertassinari
261
+ - [docs] Improve column visibility documentation (#11857) @MBilalShafi
262
+ - [docs] Polish header @oliviertassinari
263
+ - [docs] Sync support page with core @oliviertassinari
264
+ - [docs] Update whats new page with "v7 Beta blogpost" content (#11879) @joserodolfofreitas
265
+
266
+ ### Core
267
+
268
+ - [core] Rely on immutable ref when possible (#11847) @oliviertassinari
269
+ - [core] Bump monorepo (#11897) @alexfauquette
270
+
6
271
  ## 7.0.0-beta.0
7
272
 
8
273
  _Jan 26, 2024_
@@ -1873,6 +2138,146 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
1873
2138
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
1874
2139
  - [license] Correctly throw errors (#10924) @oliviertassinari
1875
2140
 
2141
+ ## v6.19.4
2142
+
2143
+ _Feb 9, 2024_
2144
+
2145
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
2146
+
2147
+ - 🌍 Improve Danish (da-DK) locale on the Data Grid (#11972) @ShahrazH
2148
+ - 🐞 Bugfixes
2149
+ - πŸ“š Documentation improvements
2150
+
2151
+ ### Data Grid
2152
+
2153
+ #### `@mui/x-data-grid@v6.19.4`
2154
+
2155
+ - [DataGrid] Add support for dialogs in menu actions (#11937) @cherniavskii
2156
+ - [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11992) @pcorpet
2157
+ - [DataGrid] Fix row reorder with cell selection (#11878) @PEsteves8
2158
+ - [DataGrid] Replace `eval` with `new Function` (#11962) @cherniavskii
2159
+ - [l10n] Improve Danish (da-DK) locale (#11972) @ShahrazH
2160
+
2161
+ #### `@mui/x-data-grid-pro@v6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2162
+
2163
+ Same changes as in `@mui/x-data-grid@v6.19.4`.
2164
+
2165
+ #### `@mui/x-data-grid-premium@v6.19.4` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
2166
+
2167
+ Same changes as in `@mui/x-data-grid-pro@v6.19.4`, plus:
2168
+
2169
+ - [DataGridPremium] Fix autosize grouping cell (#11990) @romgrk
2170
+ - [DataGridPremium] Fix error after closing print export (#11889) @cherniavskii
2171
+
2172
+ ### Date Pickers
2173
+
2174
+ #### `@mui/x-date-pickers@v6.19.4`
2175
+
2176
+ - [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11940) @LukasTy
2177
+
2178
+ #### `@mui/x-date-pickers-pro@v6.19.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2179
+
2180
+ Same changes as in `@mui/x-date-pickers@v6.19.4`.
2181
+
2182
+ ### Charts / `@mui/x-charts@v6.19.4`
2183
+
2184
+ - [charts] Add `reverse` property to axes (#11959) @alexfauquette
2185
+ - [charts] Allow series ids to be numbers (#11960) @alexfauquette
2186
+ - [charts] Fix Proptypes error by supporting string values for axes (#11953) @alexfauquette
2187
+
2188
+ ### Docs
2189
+
2190
+ - [docs] Add a note about `AdapterDateFnsV3` on the Getting Started page (#11987) @flaviendelangle
2191
+ - [docs] Avoid the use of MUI Core @oliviertassinari
2192
+ - [docs] Fix API links (#11930) @alexfauquette
2193
+ - [docs] Fix `ChartsTooltip` typo (#11967) @thisisharsh7
2194
+ - [docs] Refactor `Localization` documentation sections (#11997) @LukasTy
2195
+ - [code] Simplify bug reproduction (#11932) @alexfauquette
2196
+
2197
+ ## 6.19.3
2198
+
2199
+ _Feb 1, 2024_
2200
+
2201
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
2202
+
2203
+ - 🌍 Improve Hebrew (he-IL) locale (#11831) @danielmishan85
2204
+ - 🐞 Bugfixes
2205
+ - πŸ“š Documentation improvements
2206
+
2207
+ ### Data Grid
2208
+
2209
+ #### `@mui/x-data-grid@6.19.3`
2210
+
2211
+ - [l10n] Improve Hebrew (he-IL) locale (@danielmishan85) (#11831)
2212
+
2213
+ #### `@mui/x-data-grid-pro@6.19.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2214
+
2215
+ Same changes as in `@mui/x-data-grid@6.19.3`.
2216
+
2217
+ #### `@mui/x-data-grid-premium@6.19.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
2218
+
2219
+ Same changes as in `@mui/x-data-grid-pro@6.19.3`.
2220
+
2221
+ ### Date Pickers
2222
+
2223
+ #### `@mui/x-date-pickers@6.19.3`
2224
+
2225
+ - [TimePicker] Add missing toolbar classes descriptions (#11862) @LukasTy
2226
+
2227
+ #### `@mui/x-date-pickers-pro@6.19.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2228
+
2229
+ Same changes as in `@mui/x-date-pickers@6.19.3`.
2230
+
2231
+ ### Charts / `@mui/x-charts@6.19.3`
2232
+
2233
+ - [charts] Document how to modify color according to values (#11854) @alexfauquette
2234
+
2235
+ ### Docs
2236
+
2237
+ - [docs] Add a general uplift to the whats new page (#11883) @danilo-leal
2238
+ - [docs] Fix 404 (#11852) @alexfauquette
2239
+ - [docs] Fix <title> generation (#11825) @alexfauquette
2240
+ - [docs] Fix docs:api when typo in slots typing (#11861) @alexfauquette
2241
+ - [docs] Improve Support page (#11556) @oliviertassinari
2242
+ - [docs] Sync support page with core @oliviertassinari
2243
+ - [docs] These API don't exist in MUI X v6 @oliviertassinari
2244
+ - [docs] Update whats new page with v7 Beta blogpost content (#11886) @joserodolfofreitas
2245
+
2246
+ ## 6.19.2
2247
+
2248
+ _Jan 25, 2024_
2249
+
2250
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
2251
+
2252
+ - πŸš€ Apply the `layout.tabs` class to `Tabs` slot (@LukasTy) (#11782)
2253
+ - 🐞 Bugfixes
2254
+
2255
+ ### Date Pickers
2256
+
2257
+ #### `@mui/x-date-pickers@6.19.2`
2258
+
2259
+ - [pickers] Apply the `layout.tabs` class to `Tabs` slot (@LukasTy) (#11782)
2260
+
2261
+ #### `@mui/x-date-pickers-pro@6.19.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2262
+
2263
+ Same changes as in `@mui/x-date-pickers@6.19.2`, plus:
2264
+
2265
+ - [DateRangePicker] Remove `calendars` prop on `Mobile` (@LukasTy) (#11771)
2266
+
2267
+ ### Data Grid
2268
+
2269
+ #### `@mui/x-data-grid@6.19.2`
2270
+
2271
+ - [DataGrid] Fix support for tree with more than 50,000 children (@zenazn) (#11808)
2272
+
2273
+ #### `@mui/x-data-grid-pro@6.19.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
2274
+
2275
+ Same changes as in `@mui/x-data-grid@6.19.2`.
2276
+
2277
+ #### `@mui/x-data-grid-premium@6.19.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
2278
+
2279
+ Same changes as in `@mui/x-data-grid-pro@6.19.2`.
2280
+
1876
2281
  ## 6.19.1
1877
2282
 
1878
2283
  _Jan 19, 2024_
@@ -6876,7 +7281,7 @@ You can find more information about the new api, including how to set those tran
6876
7281
  - [core] Add link to the security page on the `README` (#6073) @oliviertassinari
6877
7282
  - [core] Fix scroll restoration in the docs (#5938) @oliviertassinari
6878
7283
  - [core] Remove the Storybook (#6099) @flaviendelangle
6879
- - [core] Tag release as `next` in NPM (#6256) @m4theushw
7284
+ - [core] Tag release as `next` in npm (#6256) @m4theushw
6880
7285
  - [core] Update monorepo (#6180) @flaviendelangle
6881
7286
  - [core] Use the `next` branch for Prettier (#6097) @flaviendelangle
6882
7287
  - [core] Use the official repository for `@mui/monorepo` instead of a fork (#6189) @oliviertassinari
@@ -59,12 +59,14 @@ const StyledTreeItemContent = styled(TreeItemContent, {
59
59
  })(({
60
60
  theme
61
61
  }) => ({
62
- padding: '0 8px',
62
+ padding: theme.spacing(0.5, 1),
63
+ borderRadius: theme.shape.borderRadius,
63
64
  width: '100%',
64
65
  boxSizing: 'border-box',
65
66
  // prevent width + padding to overflow
66
67
  display: 'flex',
67
68
  alignItems: 'center',
69
+ gap: theme.spacing(1),
68
70
  cursor: 'pointer',
69
71
  WebkitTapHighlightColor: 'transparent',
70
72
  '&:hover': {
@@ -95,8 +97,7 @@ const StyledTreeItemContent = styled(TreeItemContent, {
95
97
  }
96
98
  },
97
99
  [`& .${treeItemClasses.iconContainer}`]: {
98
- marginRight: 4,
99
- width: 15,
100
+ width: 16,
100
101
  display: 'flex',
101
102
  flexShrink: 0,
102
103
  justifyContent: 'center',
@@ -105,7 +106,6 @@ const StyledTreeItemContent = styled(TreeItemContent, {
105
106
  }
106
107
  },
107
108
  [`& .${treeItemClasses.label}`]: _extends({
108
- paddingLeft: 4,
109
109
  width: '100%',
110
110
  boxSizing: 'border-box',
111
111
  // prevent width + padding to overflow
@@ -121,7 +121,7 @@ const TreeItemGroup = styled(Collapse, {
121
121
  })({
122
122
  margin: 0,
123
123
  padding: 0,
124
- marginLeft: 17
124
+ paddingLeft: 12
125
125
  });
126
126
 
127
127
  /**
@@ -179,7 +179,13 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
179
179
  endIcon: (_inSlots$endIcon = inSlots == null ? void 0 : inSlots.endIcon) != null ? _inSlots$endIcon : contextIcons.slots.endIcon,
180
180
  icon: inSlots == null ? void 0 : inSlots.icon
181
181
  };
182
- const expandable = Boolean(Array.isArray(children) ? children.length : children);
182
+ const isExpandable = reactChildren => {
183
+ if (Array.isArray(reactChildren)) {
184
+ return reactChildren.length > 0 && reactChildren.some(isExpandable);
185
+ }
186
+ return Boolean(reactChildren);
187
+ };
188
+ const expandable = isExpandable(children);
183
189
  const expanded = instance.isNodeExpanded(nodeId);
184
190
  const focused = instance.isNodeFocused(nodeId);
185
191
  const selected = instance.isNodeSelected(nodeId);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.0.0-beta.0
2
+ * @mui/x-tree-view v7.0.0-beta.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -69,7 +69,13 @@ const useTreeViewJSXNodesItemPlugin = ({
69
69
  const {
70
70
  instance
71
71
  } = useTreeViewContext();
72
- const expandable = Boolean(Array.isArray(children) ? children.length : children);
72
+ const isExpandable = reactChildren => {
73
+ if (Array.isArray(reactChildren)) {
74
+ return reactChildren.length > 0 && reactChildren.some(isExpandable);
75
+ }
76
+ return Boolean(reactChildren);
77
+ };
78
+ const expandable = isExpandable(children);
73
79
  const [treeItemElement, setTreeItemElement] = React.useState(null);
74
80
  const contentRef = React.useRef(null);
75
81
  const handleRef = useForkRef(setTreeItemElement, ref);
@@ -56,12 +56,14 @@ var StyledTreeItemContent = styled(TreeItemContent, {
56
56
  })(function (_ref3) {
57
57
  var theme = _ref3.theme;
58
58
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
59
- padding: '0 8px',
59
+ padding: theme.spacing(0.5, 1),
60
+ borderRadius: theme.shape.borderRadius,
60
61
  width: '100%',
61
62
  boxSizing: 'border-box',
62
63
  // prevent width + padding to overflow
63
64
  display: 'flex',
64
65
  alignItems: 'center',
66
+ gap: theme.spacing(1),
65
67
  cursor: 'pointer',
66
68
  WebkitTapHighlightColor: 'transparent',
67
69
  '&:hover': {
@@ -88,8 +90,7 @@ var StyledTreeItemContent = styled(TreeItemContent, {
88
90
  }, "&.".concat(treeItemClasses.focused), {
89
91
  backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.primary.mainChannel, " / calc(").concat(theme.vars.palette.action.selectedOpacity, " + ").concat(theme.vars.palette.action.focusOpacity, "))") : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
90
92
  })), "& .".concat(treeItemClasses.iconContainer), {
91
- marginRight: 4,
92
- width: 15,
93
+ width: 16,
93
94
  display: 'flex',
94
95
  flexShrink: 0,
95
96
  justifyContent: 'center',
@@ -97,7 +98,6 @@ var StyledTreeItemContent = styled(TreeItemContent, {
97
98
  fontSize: 18
98
99
  }
99
100
  }), "& .".concat(treeItemClasses.label), _extends({
100
- paddingLeft: 4,
101
101
  width: '100%',
102
102
  boxSizing: 'border-box',
103
103
  // prevent width + padding to overflow
@@ -115,7 +115,7 @@ var TreeItemGroup = styled(Collapse, {
115
115
  })({
116
116
  margin: 0,
117
117
  padding: 0,
118
- marginLeft: 17
118
+ paddingLeft: 12
119
119
  });
120
120
 
121
121
  /**
@@ -169,7 +169,13 @@ export var TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps, i
169
169
  endIcon: (_inSlots$endIcon = inSlots == null ? void 0 : inSlots.endIcon) != null ? _inSlots$endIcon : contextIcons.slots.endIcon,
170
170
  icon: inSlots == null ? void 0 : inSlots.icon
171
171
  };
172
- var expandable = Boolean(Array.isArray(children) ? children.length : children);
172
+ var isExpandable = function isExpandable(reactChildren) {
173
+ if (Array.isArray(reactChildren)) {
174
+ return reactChildren.length > 0 && reactChildren.some(isExpandable);
175
+ }
176
+ return Boolean(reactChildren);
177
+ };
178
+ var expandable = isExpandable(children);
173
179
  var expanded = instance.isNodeExpanded(nodeId);
174
180
  var focused = instance.isNodeFocused(nodeId);
175
181
  var selected = instance.isNodeSelected(nodeId);
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.0.0-beta.0
2
+ * @mui/x-tree-view v7.0.0-beta.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -65,7 +65,13 @@ var useTreeViewJSXNodesItemPlugin = function useTreeViewJSXNodesItemPlugin(_ref2
65
65
  inContentProps = props.ContentProps;
66
66
  var _useTreeViewContext = useTreeViewContext(),
67
67
  instance = _useTreeViewContext.instance;
68
- var expandable = Boolean(Array.isArray(children) ? children.length : children);
68
+ var isExpandable = function isExpandable(reactChildren) {
69
+ if (Array.isArray(reactChildren)) {
70
+ return reactChildren.length > 0 && reactChildren.some(isExpandable);
71
+ }
72
+ return Boolean(reactChildren);
73
+ };
74
+ var expandable = isExpandable(children);
69
75
  var _React$useState = React.useState(null),
70
76
  _React$useState2 = _slicedToArray(_React$useState, 2),
71
77
  treeItemElement = _React$useState2[0],
@@ -59,12 +59,14 @@ const StyledTreeItemContent = styled(TreeItemContent, {
59
59
  })(({
60
60
  theme
61
61
  }) => ({
62
- padding: '0 8px',
62
+ padding: theme.spacing(0.5, 1),
63
+ borderRadius: theme.shape.borderRadius,
63
64
  width: '100%',
64
65
  boxSizing: 'border-box',
65
66
  // prevent width + padding to overflow
66
67
  display: 'flex',
67
68
  alignItems: 'center',
69
+ gap: theme.spacing(1),
68
70
  cursor: 'pointer',
69
71
  WebkitTapHighlightColor: 'transparent',
70
72
  '&:hover': {
@@ -95,8 +97,7 @@ const StyledTreeItemContent = styled(TreeItemContent, {
95
97
  }
96
98
  },
97
99
  [`& .${treeItemClasses.iconContainer}`]: {
98
- marginRight: 4,
99
- width: 15,
100
+ width: 16,
100
101
  display: 'flex',
101
102
  flexShrink: 0,
102
103
  justifyContent: 'center',
@@ -105,7 +106,6 @@ const StyledTreeItemContent = styled(TreeItemContent, {
105
106
  }
106
107
  },
107
108
  [`& .${treeItemClasses.label}`]: _extends({
108
- paddingLeft: 4,
109
109
  width: '100%',
110
110
  boxSizing: 'border-box',
111
111
  // prevent width + padding to overflow
@@ -121,7 +121,7 @@ const TreeItemGroup = styled(Collapse, {
121
121
  })({
122
122
  margin: 0,
123
123
  padding: 0,
124
- marginLeft: 17
124
+ paddingLeft: 12
125
125
  });
126
126
 
127
127
  /**
@@ -178,7 +178,13 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
178
178
  endIcon: inSlots?.endIcon ?? contextIcons.slots.endIcon,
179
179
  icon: inSlots?.icon
180
180
  };
181
- const expandable = Boolean(Array.isArray(children) ? children.length : children);
181
+ const isExpandable = reactChildren => {
182
+ if (Array.isArray(reactChildren)) {
183
+ return reactChildren.length > 0 && reactChildren.some(isExpandable);
184
+ }
185
+ return Boolean(reactChildren);
186
+ };
187
+ const expandable = isExpandable(children);
182
188
  const expanded = instance.isNodeExpanded(nodeId);
183
189
  const focused = instance.isNodeFocused(nodeId);
184
190
  const selected = instance.isNodeSelected(nodeId);
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.0.0-beta.0
2
+ * @mui/x-tree-view v7.0.0-beta.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -69,7 +69,13 @@ const useTreeViewJSXNodesItemPlugin = ({
69
69
  const {
70
70
  instance
71
71
  } = useTreeViewContext();
72
- const expandable = Boolean(Array.isArray(children) ? children.length : children);
72
+ const isExpandable = reactChildren => {
73
+ if (Array.isArray(reactChildren)) {
74
+ return reactChildren.length > 0 && reactChildren.some(isExpandable);
75
+ }
76
+ return Boolean(reactChildren);
77
+ };
78
+ const expandable = isExpandable(children);
73
79
  const [treeItemElement, setTreeItemElement] = React.useState(null);
74
80
  const contentRef = React.useRef(null);
75
81
  const handleRef = useForkRef(setTreeItemElement, ref);
@@ -67,12 +67,14 @@ const StyledTreeItemContent = (0, _styles.styled)(_TreeItemContent.TreeItemConte
67
67
  })(({
68
68
  theme
69
69
  }) => ({
70
- padding: '0 8px',
70
+ padding: theme.spacing(0.5, 1),
71
+ borderRadius: theme.shape.borderRadius,
71
72
  width: '100%',
72
73
  boxSizing: 'border-box',
73
74
  // prevent width + padding to overflow
74
75
  display: 'flex',
75
76
  alignItems: 'center',
77
+ gap: theme.spacing(1),
76
78
  cursor: 'pointer',
77
79
  WebkitTapHighlightColor: 'transparent',
78
80
  '&:hover': {
@@ -103,8 +105,7 @@ const StyledTreeItemContent = (0, _styles.styled)(_TreeItemContent.TreeItemConte
103
105
  }
104
106
  },
105
107
  [`& .${_treeItemClasses.treeItemClasses.iconContainer}`]: {
106
- marginRight: 4,
107
- width: 15,
108
+ width: 16,
108
109
  display: 'flex',
109
110
  flexShrink: 0,
110
111
  justifyContent: 'center',
@@ -113,7 +114,6 @@ const StyledTreeItemContent = (0, _styles.styled)(_TreeItemContent.TreeItemConte
113
114
  }
114
115
  },
115
116
  [`& .${_treeItemClasses.treeItemClasses.label}`]: (0, _extends2.default)({
116
- paddingLeft: 4,
117
117
  width: '100%',
118
118
  boxSizing: 'border-box',
119
119
  // prevent width + padding to overflow
@@ -129,7 +129,7 @@ const TreeItemGroup = (0, _styles.styled)(_Collapse.default, {
129
129
  })({
130
130
  margin: 0,
131
131
  padding: 0,
132
- marginLeft: 17
132
+ paddingLeft: 12
133
133
  });
134
134
 
135
135
  /**
@@ -186,7 +186,13 @@ const TreeItem = exports.TreeItem = /*#__PURE__*/React.forwardRef(function TreeI
186
186
  endIcon: inSlots?.endIcon ?? contextIcons.slots.endIcon,
187
187
  icon: inSlots?.icon
188
188
  };
189
- const expandable = Boolean(Array.isArray(children) ? children.length : children);
189
+ const isExpandable = reactChildren => {
190
+ if (Array.isArray(reactChildren)) {
191
+ return reactChildren.length > 0 && reactChildren.some(isExpandable);
192
+ }
193
+ return Boolean(reactChildren);
194
+ };
195
+ const expandable = isExpandable(children);
190
196
  const expanded = instance.isNodeExpanded(nodeId);
191
197
  const focused = instance.isNodeFocused(nodeId);
192
198
  const selected = instance.isNodeSelected(nodeId);
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.0.0-beta.0
2
+ * @mui/x-tree-view v7.0.0-beta.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -79,7 +79,13 @@ const useTreeViewJSXNodesItemPlugin = ({
79
79
  const {
80
80
  instance
81
81
  } = (0, _useTreeViewContext.useTreeViewContext)();
82
- const expandable = Boolean(Array.isArray(children) ? children.length : children);
82
+ const isExpandable = reactChildren => {
83
+ if (Array.isArray(reactChildren)) {
84
+ return reactChildren.length > 0 && reactChildren.some(isExpandable);
85
+ }
86
+ return Boolean(reactChildren);
87
+ };
88
+ const expandable = isExpandable(children);
83
89
  const [treeItemElement, setTreeItemElement] = React.useState(null);
84
90
  const contentRef = React.useRef(null);
85
91
  const handleRef = (0, _useForkRef.default)(setTreeItemElement, ref);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-tree-view",
3
- "version": "7.0.0-beta.0",
3
+ "version": "7.0.0-beta.2",
4
4
  "description": "The community edition of the tree view components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -32,10 +32,10 @@
32
32
  "directory": "packages/x-tree-view"
33
33
  },
34
34
  "dependencies": {
35
- "@babel/runtime": "^7.23.8",
36
- "@mui/base": "^5.0.0-beta.33",
37
- "@mui/system": "^5.15.6",
38
- "@mui/utils": "^5.15.6",
35
+ "@babel/runtime": "^7.23.9",
36
+ "@mui/base": "^5.0.0-beta.34",
37
+ "@mui/system": "^5.15.7",
38
+ "@mui/utils": "^5.15.7",
39
39
  "@types/react-transition-group": "^4.4.10",
40
40
  "clsx": "^2.1.0",
41
41
  "prop-types": "^15.8.1",