@mui/x-tree-view 8.9.2 → 8.10.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
@@ -5,6 +5,303 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.10.2
9
+
10
+ _Aug 20, 2025_
11
+
12
+ We'd like to extend a big thank you to the 10 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🌎 Improve Finnish (fi-FI) locale on the Data Grid
15
+
16
+ Special thanks go out to the community members for their valuable contributions:
17
+ @lauri-heinonen-2025-04, @Methuselah96, @sai6855, @wilcoschoneveld
18
+
19
+ The following are all team members who have contributed to this release:
20
+ @alexfauquette, @cherniavskii, @flaviendelangle, @Janpot, @oliviertassinari, @rita-codes
21
+
22
+ ### Data Grid
23
+
24
+ #### `@mui/x-data-grid@8.10.2`
25
+
26
+ - [DataGrid] Fix display for `<GridEditSingleSelect />` when `density='compact'` (#19249) @sai6855
27
+ - [DataGrid] Fix column header sortable classname when using `disableColumnSorting` (#19222) @wilcoschoneveld
28
+ - [l10n] Improve finnish (fi-FI) locale (#19163) @lauri-heinonen-2025-04
29
+
30
+ #### `@mui/x-data-grid-pro@8.10.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@8.10.2`, plus:
33
+
34
+ - [DataGridPro] Fix quick filter not working in List View mode (#19254) @cherniavskii
35
+
36
+ #### `@mui/x-data-grid-premium@8.10.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link "Premium plan")
37
+
38
+ Same changes as in `@mui/x-data-grid-pro@8.10.2`.
39
+
40
+ ### Date and Time Pickers
41
+
42
+ #### `@mui/x-date-pickers@8.10.2`
43
+
44
+ Internal changes.
45
+
46
+ #### `@mui/x-date-pickers-pro@8.10.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
47
+
48
+ Same changes as in `@mui/x-date-pickers@8.10.2`.
49
+
50
+ ### Charts
51
+
52
+ #### `@mui/x-charts@8.10.2`
53
+
54
+ Internal changes.
55
+
56
+ #### `@mui/x-charts-pro@8.10.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
57
+
58
+ Same changes as in `@mui/x-charts@8.10.2`.
59
+
60
+ ### Tree View
61
+
62
+ #### `@mui/x-tree-view@8.10.2`
63
+
64
+ - [tree view] Add `aria-hidden` to the Tree Item Checkbox (#19246) @flaviendelangle
65
+
66
+ #### `@mui/x-tree-view-pro@8.10.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
67
+
68
+ Same changes as in `@mui/x-tree-view@8.10.2`.
69
+
70
+ ### Codemod
71
+
72
+ #### `@mui/x-codemod@8.10.2`
73
+
74
+ Internal changes.
75
+
76
+ ### Docs
77
+
78
+ - [docs] Fix links to the pyramid chart (#19250) @alexfauquette
79
+
80
+ ### Core
81
+
82
+ - [internal] Avoid script for CI only @oliviertassinari
83
+ - [internal] Fix `renovate.json` @oliviertassinari
84
+ - [internal] Polish renovate config @oliviertassinari
85
+ - [internal] Rename core to internal (#19203) @oliviertassinari
86
+ - [internal] Update link to GitHub labels @oliviertassinari
87
+
88
+ ### Miscellaneous
89
+
90
+ - [code-infra] Prepare for incoming `execa` update (#19229) @Janpot
91
+ - [virtualizer] Fix type import (#19192) @Methuselah96
92
+ - [virtualizer] Improve type export (#19192) @Methuselah96
93
+
94
+ ## 8.10.1
95
+
96
+ _Aug 15, 2025_
97
+
98
+ We'd like to extend a big thank you to the 8 contributors who made this release possible. Here are some highlights ✨:
99
+
100
+ - 📊 Y-axes can now be grouped by category when using `band` and `point` scales.
101
+ - 📚 Documentation improvements
102
+
103
+ The following are all team members who have contributed to this release:
104
+ @alexfauquette, @bernardobelchior, @Janpot, @JCQuintas, @mnajdova, @oliviertassinari, @prakhargupta1, @romgrk
105
+
106
+ ### Data Grid
107
+
108
+ #### `@mui/x-data-grid@8.10.1`
109
+
110
+ - [DataGrid] Fix scroll jumping (#19156) @romgrk
111
+ - [DataGrid] Fix scroll restoration (#19182) @romgrk
112
+ - [DataGrid] Fix "no row with id" error (#19193) @romgrk
113
+
114
+ #### `@mui/x-data-grid-pro@8.10.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
115
+
116
+ Same changes as in `@mui/x-data-grid@8.10.1`.
117
+
118
+ #### `@mui/x-data-grid-premium@8.10.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link "Premium plan")
119
+
120
+ Same changes as in `@mui/x-data-grid-pro@8.10.1`.
121
+
122
+ ### Date and Time Pickers
123
+
124
+ #### `@mui/x-date-pickers@8.10.0`
125
+
126
+ Internal changes.
127
+
128
+ #### `@mui/x-date-pickers-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
129
+
130
+ Same changes as in `@mui/x-date-pickers@8.10.0`.
131
+
132
+ ### Charts
133
+
134
+ - Axes can now be grouped by category when using `band` and `point` scales
135
+
136
+ <img width="643" height="455" alt="Bar chart with y-axis grouped per categories" src="https://github.com/user-attachments/assets/59044afe-bcc5-4152-8bf1-225db0635025" />
137
+
138
+ #### `@mui/x-charts@8.10.1`
139
+
140
+ - [charts] Allow y-axis to be grouped (#19081) @JCQuintas
141
+ - [charts] Fix default axis highlight for axes without data attribute (#18985) @alexfauquette
142
+ - [charts] Fix tooltip mark unexpected wrapping in mobile (#19122) @bernardobelchior
143
+ - [charts] Prevent overflow on charts tooltip (#19123) @bernardobelchior
144
+
145
+ #### `@mui/x-charts-pro@8.10.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
146
+
147
+ Same changes as in `@mui/x-charts@8.10.1`.
148
+
149
+ ### Tree View
150
+
151
+ #### `@mui/x-tree-view@8.10.1`
152
+
153
+ Internal changes.
154
+
155
+ #### `@mui/x-tree-view-pro@8.10.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
156
+
157
+ Same changes as in `@mui/x-tree-view@8.10.1`.
158
+
159
+ ### Codemod
160
+
161
+ #### `@mui/x-codemod@8.10.1`
162
+
163
+ Internal changes.
164
+
165
+ ### Docs
166
+
167
+ - [docs] Add all planned charts on the overview page (#19077) @prakhargupta1
168
+ - [docs] Add future charts components link in the sidebar (#19140) @prakhargupta1
169
+ - [docs] Fix Heatmap docs duplicate text (#19138) @JCQuintas
170
+ - [docs] Remove preview from Toolbar & Funnel (#19131) @mnajdova
171
+ - [docs] Reproduce npm sparkline (#19089) @alexfauquette
172
+
173
+ ### Core
174
+
175
+ - [core] Fix licensing model name (#19025) @oliviertassinari
176
+ - [core] Fix usage of `:catalog` for `@babel/runtime` (#19028) @oliviertassinari
177
+ - [core] Refactor virtualizer API (#18995) @romgrk
178
+
179
+ ### Miscellaneous
180
+
181
+ - [code-infra] Remove namespaces (#19071) @Janpot
182
+ - [code-infra] Fix `fs-extra` removal from `formattedTSDemos` script (#19132) @bernardobelchior
183
+ - [code-infra] Remove unused code and dependency (#19139) @bernardobelchior
184
+ - [code-infra] Replace `fs-extra` with `node:fs` where possible (#19127) @bernardobelchior
185
+ - [internal] Edit, keep `lockFileMaintenance` simple @oliviertassinari
186
+ - [internal] Fix writing style action name @oliviertassinari
187
+ - [internal] Make it clear that `lockFileMaintenance` is enabled @oliviertassinari
188
+ - [support-infra] Remove default issue label (#19104) @oliviertassinari
189
+
190
+ ## 8.10.0
191
+
192
+ _Aug 8, 2025_
193
+
194
+ We'd like to extend a big thank you to the 17 contributors who made this release possible. Here are some highlights ✨:
195
+
196
+ - 📊 [`FunnelChart`](https://mui.com/x/react-charts/funnel/) marked as stable
197
+ - 📈 [Zoom slider](https://mui.com/x/react-charts/zoom-and-pan/#zoom-slider) and [Preview](https://mui.com/x/react-charts/zoom-and-pan/#preview) marked as stable
198
+ - 📈 Supporting [label groups](https://mui.com/x/react-charts/axis/#grouped-axes) in band and point axis
199
+ - 🌎 Improve Norwegian Nynorsk (nn-NO) locale on the Data Grid
200
+ - 🐞 Bugfixes
201
+ - 📚 Documentation improvements
202
+
203
+ Special thanks go out to the community members for their valuable contributions:
204
+ @AnderzL7, @aqeelat, @dwrth, @noobyogi0010, @nusr, @sai6855
205
+
206
+ The following are all team members who have contributed to this release:
207
+ @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mapache-salvaje, @MBilalShafi, @oliviertassinari, @rita-codes, @romgrk
208
+
209
+ ### Data Grid
210
+
211
+ #### `@mui/x-data-grid@8.10.0`
212
+
213
+ - [DataGrid] Move spread operator in `BaseSelect` to allow `variant` change (#19026) @dwrth
214
+ - [DataGrid] Use `use-sync-external-store` shim (#19063) @romgrk
215
+ - [DataGrid] Allow skipping cache in `dataSource.fetchRows()` API method (#18904) @MBilalShafi
216
+ - [DataGrid] Do not call `preProcessEditCellProps()` if cell is not editable based on `isCellEditable()` (#18405) @nusr
217
+ - [DataGrid] Fix `renderCountry` throwing an error when used in tree data (#19068) @cherniavskii
218
+ - [DataGrid] Fix performance issue for root level "select all" (#19015) @MBilalShafi
219
+ - [DataGrid] Fix pagination `slotProps` being ignored by the grid (#19095) @romgrk
220
+ - [l10n] Improve Norwegian Nynorsk (nn-NO) locale (#19076) @AnderzL7
221
+
222
+ #### `@mui/x-data-grid-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
223
+
224
+ Same changes as in `@mui/x-data-grid@8.10.0`, plus:
225
+
226
+ - [DataGridPro] Fix row reorder not working with column reorder disabled (#19016) @MBilalShafi
227
+ - [DataGridPro] Fix header filters cache sharing issue (#19090) @MBilalShafi
228
+
229
+ #### `@mui/x-data-grid-premium@8.10.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
230
+
231
+ Same changes as in `@mui/x-data-grid-pro@8.10.0`, plus:
232
+
233
+ - [DataGridPremium] Allow additional derived columns customization via `valueFormatter` (#18982) @arminmeh
234
+ - [DataGridPremium] Fix complex `singleSelect` columns not working in pivot model (#18971) @cherniavskii
235
+
236
+ ### Date and Time Pickers
237
+
238
+ #### `@mui/x-date-pickers@8.10.0`
239
+
240
+ - [pickers] `MuiPickersLayout-toolbar` is overlapping the Calendar in RTL `MobileDatePicker` variant (#18981) @rita-codes
241
+
242
+ #### `@mui/x-date-pickers-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
243
+
244
+ Same changes as in `@mui/x-date-pickers@8.10.0`.
245
+
246
+ ### Charts
247
+
248
+ #### `@mui/x-charts@8.10.0`
249
+
250
+ - [charts] Add `groups` to `band` and `point` axis config (#18766) @JCQuintas
251
+ - [charts] Animation example using `motion` library (#18993) @JCQuintas
252
+ - [charts] Deprecate `Unstable_` radar exports (#19079) @JCQuintas
253
+ - [charts] Improve grouped axis logic (#19069) @JCQuintas
254
+ - [charts] Fix type assertion in axis highlight components (#19060) @sai6855
255
+ - [charts] Remove unnecessary type assertion in tooltip `valueFormatter` in heatmap (#19047) @sai6855
256
+
257
+ #### `@mui/x-charts-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
258
+
259
+ Same changes as in `@mui/x-charts@8.10.0`, plus:
260
+
261
+ - [charts-pro] Fix `slotProps.tooltip.trigger` not respected in `ScatterChartPro` and `FunnelChart` (#18902) @bernardobelchior
262
+ - [charts-pro] Fix zoom filtering adjusting axis too soon (#18992) @bernardobelchior
263
+ - [charts-pro] Mark `FunnelChart` as stable (#19048) @JCQuintas
264
+ - [charts-pro] Mark zoom slider and preview as stable (#19049) @JCQuintas
265
+ - [charts-pro] Refactor `createAxisFilterMapper` (#18998) @bernardobelchior
266
+
267
+ ### Tree View
268
+
269
+ #### `@mui/x-tree-view@8.10.0`
270
+
271
+ Internal changes.
272
+
273
+ #### `@mui/x-tree-view-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
274
+
275
+ Same changes as in `@mui/x-tree-view@8.10.0`.
276
+
277
+ ### Codemod
278
+
279
+ #### `@mui/x-codemod@8.10.0`
280
+
281
+ Internal changes.
282
+
283
+ ### Docs
284
+
285
+ - [docs] Add CSS bundler breaking change to migration guide (#17436) @romgrk
286
+ - [docs] `RichTreeViewPro` demo for dragging via custom drag-handle is not working properly (#19008) @rita-codes
287
+ - [docs] Fix broken link to D3 in Charts (#19020) @oliviertassinari
288
+ - [docs] Revise the Charts Animation doc (#18990) @mapache-salvaje
289
+ - [docs] Fix incorrect code in line chart preview (#19023) @noobyogi0010
290
+ - [docs] Improve bundling instructions for the Data Grid (#19065) @romgrk
291
+ - [docs] Reduce image size in the inventory grid demo (#19004) @arminmeh
292
+
293
+ ### Core
294
+
295
+ - [core] Fix ESLint reference name @oliviertassinari
296
+
297
+ ### Miscellaneous
298
+
299
+ - [infra] Remove bundle size tracking for subpaths (#19072) @Janpot
300
+ - [infra] Accept `PORT` env on `docs:dev` script (#19014) @JCQuintas
301
+ - [infra] Skip codesandbox iframe demos in regressions tests (#18970) @cherniavskii
302
+ - [infra] Remove package.json `module` field (#18961) @Janpot
303
+ - [internal] Remove peer dependency on `@mui/system` (#19062) @aqeelat
304
+
8
305
  ## 8.9.2
9
306
 
10
307
  _Jul 31, 2025_
@@ -418,8 +715,8 @@ Same changes as in `@mui/x-tree-view@8.7.0`, plus:
418
715
 
419
716
  - [code-infra] Bump code-infra version and fix breaking changes (#18653) @brijeshb42
420
717
  - [code-infra] Ensure `material-ui/disallow-react-api-in-server-components` ESLint rule is applied (#18570) @LukasTy
421
- - [code-infra] Migrate to flat eslint config (#18562) @brijeshb42
422
- - [code-infra] Refactor eslint config (#18643) @LukasTy
718
+ - [code-infra] Migrate to flat ESLint config (#18562) @brijeshb42
719
+ - [code-infra] Refactor ESLint config (#18643) @LukasTy
423
720
  - [infra] Add renovatebot rule for latest infra packages (#18609) @Janpot
424
721
  - [infra] Move pushArgos script to code-infra (#18667) @Janpot
425
722
  - [infra] Updates release script to fetch latest major version from upstream (#18552) @michelengelen
@@ -1333,7 +1630,7 @@ Same changes as in `@mui/x-tree-view@8.2.0`.
1333
1630
  - [core] Fix all Vale errors @oliviertassinari
1334
1631
  - [core] Move `loadStyleSheets` to internals and use it in data grid and charts (#17548) @bernardobelchior
1335
1632
  - [core] Remove empty version (#17582) @oliviertassinari
1336
- - [core] Remove eslint from codemod spec files (#17443) @alexfauquette
1633
+ - [core] Remove ESLint from codemod spec files (#17443) @alexfauquette
1337
1634
  - [core] Remove unnecessary versions (#17597) @oliviertassinari
1338
1635
  - [code-infra] Allow postinstall scripts for packages requesting it (#17635) @LukasTy
1339
1636
  - [code-infra] Data Grid `vitest` changes (#17619) @JCQuintas
@@ -6827,7 +7124,7 @@ Same changes as in `@mui/x-date-pickers@7.8.0`.
6827
7124
 
6828
7125
  ### Core
6829
7126
 
6830
- - [core] Add eslint rule to restrict import from `../internals` root (#13633) @JCQuintas
7127
+ - [core] Add ESLint rule to restrict import from `../internals` root (#13633) @JCQuintas
6831
7128
  - [docs-infra] Sync `\_app` folder with monorepo (#13582) @Janpot
6832
7129
  - [license] Allow usage of Charts and Tree View Pro package for old premium licenses (#13619) @flaviendelangle
6833
7130
 
@@ -6965,7 +7262,7 @@ Same changes as in `@mui/x-date-pickers@7.7.0`.
6965
7262
 
6966
7263
  - [charts] Add watermark on the pro `ResponsiveChartContainer` (#13398) @alexfauquette
6967
7264
  - [charts] Allow to specify y-axis configuration (#13438) @alexfauquette
6968
- - [charts] Fix eslint for react compiler (#13444) @alexfauquette
7265
+ - [charts] Fix ESLint for react compiler (#13444) @alexfauquette
6969
7266
  - [charts] Improve themeAugmentation typing (#13433) @noraleonte
6970
7267
  - [charts] Move the `ZAxisContextProvider` by default in the `ChartContainer` (#13465) @alexfauquette
6971
7268
  - [charts] Use plugins to define series extremum and colors (#13397) @alexfauquette
@@ -7512,7 +7809,7 @@ Same changes as in `@mui/x-date-pickers@7.3.1`.
7512
7809
  - [core] Use `describeTreeView` for focus tests (#12698) @flaviendelangle
7513
7810
  - [core] Use `describeTreeView` for type-ahead tests (#12811) @flaviendelangle
7514
7811
  - [code-infra] Change package manager to `pnpm` (#11875) @LukasTy
7515
- - [code-infra] Closer sync with eslint config of codebase (#12864) @oliviertassinari
7812
+ - [code-infra] Closer sync with ESLint config of codebase (#12864) @oliviertassinari
7516
7813
  - [support-infra] Add release announcement to GitHub workflows (#11867) (#12843) @michelengelen
7517
7814
 
7518
7815
  ## 7.3.0
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v8.9.2
2
+ * @mui/x-tree-view v8.10.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -26,6 +26,14 @@ export function TreeViewChildrenItemProvider(props) {
26
26
  }
27
27
  const previousChildrenIds = selectorItemOrderedChildrenIds(store.value, itemId ?? null) ?? [];
28
28
  const escapedIdAttr = escapeOperandAttributeSelector(idAttribute ?? rootRef.current.id);
29
+
30
+ // If collapsed, skip childrenIds update prevents clearing the parent's indeterminate state after opening a sibling.
31
+ if (itemId != null) {
32
+ const itemRoot = rootRef.current.querySelector(`*[id="${escapedIdAttr}"][role="treeitem"]`);
33
+ if (itemRoot && itemRoot.getAttribute('aria-expanded') === 'false') {
34
+ return;
35
+ }
36
+ }
29
37
  const childrenElements = rootRef.current.querySelectorAll(`${itemId == null ? '' : `*[id="${escapedIdAttr}"] `}[role="treeitem"]:not(*[id="${escapedIdAttr}"] [role="treeitem"] [role="treeitem"])`);
30
38
  const childrenIds = Array.from(childrenElements).map(child => childrenIdAttrToIdRef.current.get(child.id));
31
39
  const hasChanged = childrenIds.length !== previousChildrenIds.length || childrenIds.some((childId, index) => childId !== previousChildrenIds[index]);
@@ -20,7 +20,7 @@ export type { UseTreeViewItemsSignature, UseTreeViewItemsParameters, UseTreeView
20
20
  export { useTreeViewLabel } from "./plugins/useTreeViewLabel/index.js";
21
21
  export { selectorIsItemBeingEdited, selectorIsAnyItemBeingEdited } from "./plugins/useTreeViewLabel/useTreeViewLabel.selectors.js";
22
22
  export type { UseTreeViewLabelSignature, UseTreeViewLabelParameters } from "./plugins/useTreeViewLabel/index.js";
23
- export { selectorIsItemExpanded } from "./plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.js";
23
+ export { selectorIsItemExpanded, selectorExpandedItems } from "./plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.js";
24
24
  export { selectorIsItemSelected } from "./plugins/useTreeViewSelection/useTreeViewSelection.selectors.js";
25
25
  export { selectorDataSourceState, selectorGetTreeItemError } from "./plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.js";
26
26
  export type { UseTreeViewLazyLoadingSignature } from "./plugins/useTreeViewLazyLoading/index.js";
@@ -15,7 +15,7 @@ export { useTreeViewItems, buildSiblingIndexes, TREE_VIEW_ROOT_PARENT_ID } from
15
15
  export { selectorItemMetaLookup, selectorItemMeta, selectorItemIndex, selectorItemOrderedChildrenIds } from "./plugins/useTreeViewItems/useTreeViewItems.selectors.js";
16
16
  export { useTreeViewLabel } from "./plugins/useTreeViewLabel/index.js";
17
17
  export { selectorIsItemBeingEdited, selectorIsAnyItemBeingEdited } from "./plugins/useTreeViewLabel/useTreeViewLabel.selectors.js";
18
- export { selectorIsItemExpanded } from "./plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.js";
18
+ export { selectorIsItemExpanded, selectorExpandedItems } from "./plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.js";
19
19
  export { selectorIsItemSelected } from "./plugins/useTreeViewSelection/useTreeViewSelection.selectors.js";
20
20
  export { selectorDataSourceState, selectorGetTreeItemError } from "./plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.js";
21
21
  export { useTreeViewJSXItems } from "./plugins/useTreeViewJSXItems/index.js";
@@ -43,6 +43,9 @@ export const useTreeViewExpansion = ({
43
43
  }
44
44
  params.onExpandedItemsChange?.(event, value);
45
45
  };
46
+ const resetItemExpansion = useEventCallback(() => {
47
+ setExpandedItems(null, []);
48
+ });
46
49
  const applyItemExpansion = useEventCallback(({
47
50
  itemId,
48
51
  event,
@@ -124,7 +127,8 @@ export const useTreeViewExpansion = ({
124
127
  instance: {
125
128
  setItemExpansion,
126
129
  applyItemExpansion,
127
- expandAllSiblings
130
+ expandAllSiblings,
131
+ resetItemExpansion
128
132
  }
129
133
  };
130
134
  };
@@ -26,7 +26,7 @@ export interface UseTreeViewExpansionInstance extends UseTreeViewExpansionPublic
26
26
  */
27
27
  expandAllSiblings: (event: React.KeyboardEvent, itemId: TreeViewItemId) => void;
28
28
  /**
29
- * APply the new expansion status of a given item.
29
+ * Apply the new expansion status of a given item.
30
30
  * Is used by the `setItemExpansion` method and by the `useTreeViewLazyLoading` plugin.
31
31
  * Unlike `setItemExpansion`, this method does not trigger the lazy loading.
32
32
  * @param {object} parameters The parameters of the method.
@@ -39,6 +39,10 @@ export interface UseTreeViewExpansionInstance extends UseTreeViewExpansionPublic
39
39
  event: React.SyntheticEvent | null;
40
40
  shouldBeExpanded: boolean;
41
41
  }) => void;
42
+ /**
43
+ * Reset the expansion state of all items.
44
+ */
45
+ resetItemExpansion: () => void;
42
46
  }
43
47
  export interface UseTreeViewExpansionParameters {
44
48
  /**
@@ -1,24 +1,22 @@
1
1
  export class TreeViewStore {
2
2
  constructor(value) {
3
- this.value = void 0;
4
- this.listeners = void 0;
5
- this.subscribe = fn => {
6
- this.listeners.add(fn);
7
- return () => {
8
- this.listeners.delete(fn);
9
- };
10
- };
11
- this.getSnapshot = () => {
12
- return this.value;
13
- };
14
- this.update = updater => {
15
- const newState = updater(this.value);
16
- if (newState !== this.value) {
17
- this.value = newState;
18
- this.listeners.forEach(l => l(newState));
19
- }
20
- };
21
3
  this.value = value;
22
4
  this.listeners = new Set();
23
5
  }
6
+ subscribe = fn => {
7
+ this.listeners.add(fn);
8
+ return () => {
9
+ this.listeners.delete(fn);
10
+ };
11
+ };
12
+ getSnapshot = () => {
13
+ return this.value;
14
+ };
15
+ update = updater => {
16
+ const newState = updater(this.value);
17
+ if (newState !== this.value) {
18
+ this.value = newState;
19
+ this.listeners.forEach(l => l(newState));
20
+ }
21
+ };
24
22
  }
@@ -1,11 +1,9 @@
1
1
  export class FinalizationRegistryBasedCleanupTracking {
2
- constructor() {
3
- this.registry = new FinalizationRegistry(unsubscribe => {
4
- if (typeof unsubscribe === 'function') {
5
- unsubscribe();
6
- }
7
- });
8
- }
2
+ registry = (() => new FinalizationRegistry(unsubscribe => {
3
+ if (typeof unsubscribe === 'function') {
4
+ unsubscribe();
5
+ }
6
+ }))();
9
7
  register(object, unsubscribe, unregisterToken) {
10
8
  this.registry.register(object, unsubscribe, unregisterToken);
11
9
  }
@@ -1,9 +1,9 @@
1
1
  // If no effect ran after this amount of time, we assume that the render was not committed by React
2
2
  const CLEANUP_TIMER_LOOP_MILLIS = 1000;
3
3
  export class TimerBasedCleanupTracking {
4
+ timeouts = (() => new Map())();
5
+ cleanupTimeout = (() => CLEANUP_TIMER_LOOP_MILLIS)();
4
6
  constructor(timeout = CLEANUP_TIMER_LOOP_MILLIS) {
5
- this.timeouts = new Map();
6
- this.cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;
7
7
  this.cleanupTimeout = timeout;
8
8
  }
9
9
  register(object, unsubscribe, unregisterToken) {
@@ -202,7 +202,8 @@ export const useTreeItem = parameters => {
202
202
  const getCheckboxProps = (externalProps = {}) => {
203
203
  const externalEventHandlers = extractEventHandlers(externalProps);
204
204
  const props = _extends({}, externalEventHandlers, {
205
- ref: checkboxRef
205
+ ref: checkboxRef,
206
+ 'aria-hidden': true
206
207
  }, externalProps);
207
208
  const enhancedCheckboxProps = propsEnhancers.checkbox?.(_extends({}, sharedPropsEnhancerParams, {
208
209
  externalEventHandlers
@@ -81,6 +81,7 @@ export interface UseTreeItemLabelInputSlotOwnProps {}
81
81
  export type UseTreeItemLabelInputSlotProps<ExternalProps = {}> = ExternalProps & UseTreeItemLabelInputSlotOwnProps;
82
82
  export interface UseTreeItemCheckboxSlotOwnProps {
83
83
  ref: React.RefObject<HTMLButtonElement | null>;
84
+ 'aria-hidden': true;
84
85
  }
85
86
  export type UseTreeItemCheckboxSlotProps<ExternalProps = {}> = ExternalProps & UseTreeItemCheckboxSlotOwnProps;
86
87
  export type UseTreeItemErrorContainerSlotProps<ExternalProps = {}> = ExternalProps & {};
@@ -2,8 +2,6 @@ export class DataSourceCacheDefault {
2
2
  constructor({
3
3
  ttl = 300_000
4
4
  }) {
5
- this.cache = void 0;
6
- this.ttl = void 0;
7
5
  this.cache = {};
8
6
  this.ttl = ttl;
9
7
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v8.9.2
2
+ * @mui/x-tree-view v8.10.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -34,6 +34,14 @@ function TreeViewChildrenItemProvider(props) {
34
34
  }
35
35
  const previousChildrenIds = (0, _useTreeViewItems.selectorItemOrderedChildrenIds)(store.value, itemId ?? null) ?? [];
36
36
  const escapedIdAttr = (0, _utils.escapeOperandAttributeSelector)(idAttribute ?? rootRef.current.id);
37
+
38
+ // If collapsed, skip childrenIds update prevents clearing the parent's indeterminate state after opening a sibling.
39
+ if (itemId != null) {
40
+ const itemRoot = rootRef.current.querySelector(`*[id="${escapedIdAttr}"][role="treeitem"]`);
41
+ if (itemRoot && itemRoot.getAttribute('aria-expanded') === 'false') {
42
+ return;
43
+ }
44
+ }
37
45
  const childrenElements = rootRef.current.querySelectorAll(`${itemId == null ? '' : `*[id="${escapedIdAttr}"] `}[role="treeitem"]:not(*[id="${escapedIdAttr}"] [role="treeitem"] [role="treeitem"])`);
38
46
  const childrenIds = Array.from(childrenElements).map(child => childrenIdAttrToIdRef.current.get(child.id));
39
47
  const hasChanged = childrenIds.length !== previousChildrenIds.length || childrenIds.some((childId, index) => childId !== previousChildrenIds[index]);
@@ -20,7 +20,7 @@ export type { UseTreeViewItemsSignature, UseTreeViewItemsParameters, UseTreeView
20
20
  export { useTreeViewLabel } from "./plugins/useTreeViewLabel/index.js";
21
21
  export { selectorIsItemBeingEdited, selectorIsAnyItemBeingEdited } from "./plugins/useTreeViewLabel/useTreeViewLabel.selectors.js";
22
22
  export type { UseTreeViewLabelSignature, UseTreeViewLabelParameters } from "./plugins/useTreeViewLabel/index.js";
23
- export { selectorIsItemExpanded } from "./plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.js";
23
+ export { selectorIsItemExpanded, selectorExpandedItems } from "./plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.js";
24
24
  export { selectorIsItemSelected } from "./plugins/useTreeViewSelection/useTreeViewSelection.selectors.js";
25
25
  export { selectorDataSourceState, selectorGetTreeItemError } from "./plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.js";
26
26
  export type { UseTreeViewLazyLoadingSignature } from "./plugins/useTreeViewLazyLoading/index.js";
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "selectorDataSourceState", {
51
51
  return _useTreeViewLazyLoading.selectorDataSourceState;
52
52
  }
53
53
  });
54
+ Object.defineProperty(exports, "selectorExpandedItems", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _useTreeViewExpansion2.selectorExpandedItems;
58
+ }
59
+ });
54
60
  Object.defineProperty(exports, "selectorGetTreeItemError", {
55
61
  enumerable: true,
56
62
  get: function () {
@@ -50,6 +50,9 @@ const useTreeViewExpansion = ({
50
50
  }
51
51
  params.onExpandedItemsChange?.(event, value);
52
52
  };
53
+ const resetItemExpansion = (0, _useEventCallback.default)(() => {
54
+ setExpandedItems(null, []);
55
+ });
53
56
  const applyItemExpansion = (0, _useEventCallback.default)(({
54
57
  itemId,
55
58
  event,
@@ -131,7 +134,8 @@ const useTreeViewExpansion = ({
131
134
  instance: {
132
135
  setItemExpansion,
133
136
  applyItemExpansion,
134
- expandAllSiblings
137
+ expandAllSiblings,
138
+ resetItemExpansion
135
139
  }
136
140
  };
137
141
  };
@@ -26,7 +26,7 @@ export interface UseTreeViewExpansionInstance extends UseTreeViewExpansionPublic
26
26
  */
27
27
  expandAllSiblings: (event: React.KeyboardEvent, itemId: TreeViewItemId) => void;
28
28
  /**
29
- * APply the new expansion status of a given item.
29
+ * Apply the new expansion status of a given item.
30
30
  * Is used by the `setItemExpansion` method and by the `useTreeViewLazyLoading` plugin.
31
31
  * Unlike `setItemExpansion`, this method does not trigger the lazy loading.
32
32
  * @param {object} parameters The parameters of the method.
@@ -39,6 +39,10 @@ export interface UseTreeViewExpansionInstance extends UseTreeViewExpansionPublic
39
39
  event: React.SyntheticEvent | null;
40
40
  shouldBeExpanded: boolean;
41
41
  }) => void;
42
+ /**
43
+ * Reset the expansion state of all items.
44
+ */
45
+ resetItemExpansion: () => void;
42
46
  }
43
47
  export interface UseTreeViewExpansionParameters {
44
48
  /**
@@ -6,26 +6,24 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.TreeViewStore = void 0;
7
7
  class TreeViewStore {
8
8
  constructor(value) {
9
- this.value = void 0;
10
- this.listeners = void 0;
11
- this.subscribe = fn => {
12
- this.listeners.add(fn);
13
- return () => {
14
- this.listeners.delete(fn);
15
- };
16
- };
17
- this.getSnapshot = () => {
18
- return this.value;
19
- };
20
- this.update = updater => {
21
- const newState = updater(this.value);
22
- if (newState !== this.value) {
23
- this.value = newState;
24
- this.listeners.forEach(l => l(newState));
25
- }
26
- };
27
9
  this.value = value;
28
10
  this.listeners = new Set();
29
11
  }
12
+ subscribe = fn => {
13
+ this.listeners.add(fn);
14
+ return () => {
15
+ this.listeners.delete(fn);
16
+ };
17
+ };
18
+ getSnapshot = () => {
19
+ return this.value;
20
+ };
21
+ update = updater => {
22
+ const newState = updater(this.value);
23
+ if (newState !== this.value) {
24
+ this.value = newState;
25
+ this.listeners.forEach(l => l(newState));
26
+ }
27
+ };
30
28
  }
31
29
  exports.TreeViewStore = TreeViewStore;
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.FinalizationRegistryBasedCleanupTracking = void 0;
7
7
  class FinalizationRegistryBasedCleanupTracking {
8
- constructor() {
9
- this.registry = new FinalizationRegistry(unsubscribe => {
10
- if (typeof unsubscribe === 'function') {
11
- unsubscribe();
12
- }
13
- });
14
- }
8
+ registry = new FinalizationRegistry(unsubscribe => {
9
+ if (typeof unsubscribe === 'function') {
10
+ unsubscribe();
11
+ }
12
+ });
15
13
  register(object, unsubscribe, unregisterToken) {
16
14
  this.registry.register(object, unsubscribe, unregisterToken);
17
15
  }
@@ -7,9 +7,9 @@ exports.TimerBasedCleanupTracking = void 0;
7
7
  // If no effect ran after this amount of time, we assume that the render was not committed by React
8
8
  const CLEANUP_TIMER_LOOP_MILLIS = 1000;
9
9
  class TimerBasedCleanupTracking {
10
+ timeouts = new Map();
11
+ cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;
10
12
  constructor(timeout = CLEANUP_TIMER_LOOP_MILLIS) {
11
- this.timeouts = new Map();
12
- this.cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;
13
13
  this.cleanupTimeout = timeout;
14
14
  }
15
15
  register(object, unsubscribe, unregisterToken) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-tree-view",
3
- "version": "8.9.2",
3
+ "version": "8.10.2",
4
4
  "author": "MUI Team",
5
5
  "description": "The community edition of the MUI X Tree View components.",
6
6
  "main": "./index.js",
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.28.2",
36
- "@mui/utils": "^7.2.0",
36
+ "@mui/utils": "^7.3.1",
37
37
  "@types/react-transition-group": "^4.4.12",
38
38
  "clsx": "^2.1.1",
39
39
  "prop-types": "^15.8.1",
40
40
  "react-transition-group": "^4.4.5",
41
41
  "reselect": "^5.1.1",
42
42
  "use-sync-external-store": "^1.5.0",
43
- "@mui/x-internals": "8.9.2"
43
+ "@mui/x-internals": "8.10.2"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@emotion/react": "^11.9.0",
@@ -61,32 +61,30 @@
61
61
  "engines": {
62
62
  "node": ">=14.0.0"
63
63
  },
64
- "private": false,
65
- "module": "./esm/index.js",
64
+ "type": "commonjs",
65
+ "types": "./index.d.ts",
66
66
  "exports": {
67
67
  "./package.json": "./package.json",
68
68
  ".": {
69
- "require": {
70
- "types": "./index.d.ts",
71
- "default": "./index.js"
72
- },
73
69
  "import": {
74
70
  "types": "./esm/index.d.ts",
75
71
  "default": "./esm/index.js"
72
+ },
73
+ "require": {
74
+ "types": "./index.d.ts",
75
+ "default": "./index.js"
76
76
  }
77
77
  },
78
78
  "./*": {
79
- "require": {
80
- "types": "./*/index.d.ts",
81
- "default": "./*/index.js"
82
- },
83
79
  "import": {
84
80
  "types": "./esm/*/index.d.ts",
85
81
  "default": "./esm/*/index.js"
82
+ },
83
+ "require": {
84
+ "types": "./*/index.d.ts",
85
+ "default": "./*/index.js"
86
86
  }
87
87
  },
88
- "./esm": null,
89
- "./modern": null
90
- },
91
- "types": "./index.d.ts"
88
+ "./esm": null
89
+ }
92
90
  }
@@ -209,7 +209,8 @@ const useTreeItem = parameters => {
209
209
  const getCheckboxProps = (externalProps = {}) => {
210
210
  const externalEventHandlers = (0, _extractEventHandlers.default)(externalProps);
211
211
  const props = (0, _extends2.default)({}, externalEventHandlers, {
212
- ref: checkboxRef
212
+ ref: checkboxRef,
213
+ 'aria-hidden': true
213
214
  }, externalProps);
214
215
  const enhancedCheckboxProps = propsEnhancers.checkbox?.((0, _extends2.default)({}, sharedPropsEnhancerParams, {
215
216
  externalEventHandlers
@@ -81,6 +81,7 @@ export interface UseTreeItemLabelInputSlotOwnProps {}
81
81
  export type UseTreeItemLabelInputSlotProps<ExternalProps = {}> = ExternalProps & UseTreeItemLabelInputSlotOwnProps;
82
82
  export interface UseTreeItemCheckboxSlotOwnProps {
83
83
  ref: React.RefObject<HTMLButtonElement | null>;
84
+ 'aria-hidden': true;
84
85
  }
85
86
  export type UseTreeItemCheckboxSlotProps<ExternalProps = {}> = ExternalProps & UseTreeItemCheckboxSlotOwnProps;
86
87
  export type UseTreeItemErrorContainerSlotProps<ExternalProps = {}> = ExternalProps & {};
package/utils/cache.js CHANGED
@@ -8,8 +8,6 @@ class DataSourceCacheDefault {
8
8
  constructor({
9
9
  ttl = 300_000
10
10
  }) {
11
- this.cache = void 0;
12
- this.ttl = void 0;
13
11
  this.cache = {};
14
12
  this.ttl = ttl;
15
13
  }