@mui/x-tree-view 7.17.0 → 7.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +208 -5
  2. package/RichTreeView/RichTreeView.js +2 -0
  3. package/RichTreeView/RichTreeView.plugins.d.ts +1 -1
  4. package/SimpleTreeView/SimpleTreeView.js +2 -0
  5. package/SimpleTreeView/SimpleTreeView.plugins.d.ts +1 -1
  6. package/TreeItem/TreeItem.js +9 -1
  7. package/TreeItem/TreeItemContent.js +1 -1
  8. package/TreeItem/useTreeItemState.js +2 -0
  9. package/TreeItem2/TreeItem2.d.ts +6 -6
  10. package/TreeItem2/TreeItem2.js +2 -0
  11. package/TreeView/TreeView.js +2 -0
  12. package/hooks/useTreeItem2Utils/useTreeItem2Utils.d.ts +24 -6
  13. package/hooks/useTreeItem2Utils/useTreeItem2Utils.js +10 -8
  14. package/hooks/useTreeViewApiRef.js +2 -0
  15. package/index.js +1 -1
  16. package/internals/TreeViewProvider/TreeViewChildrenItemProvider.js +7 -1
  17. package/internals/TreeViewProvider/TreeViewProvider.js +2 -1
  18. package/internals/TreeViewProvider/TreeViewProvider.types.d.ts +2 -1
  19. package/internals/TreeViewProvider/useTreeViewContext.d.ts +1 -1
  20. package/internals/corePlugins/corePlugins.d.ts +1 -1
  21. package/internals/corePlugins/useTreeViewId/useTreeViewId.js +28 -7
  22. package/internals/corePlugins/useTreeViewId/useTreeViewId.types.d.ts +11 -13
  23. package/internals/corePlugins/useTreeViewId/useTreeViewId.utils.d.ts +17 -0
  24. package/internals/corePlugins/useTreeViewId/useTreeViewId.utils.js +26 -0
  25. package/internals/models/plugin.d.ts +4 -1
  26. package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +3 -1
  27. package/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +1 -1
  28. package/internals/plugins/useTreeViewItems/useTreeViewItems.js +9 -2
  29. package/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +11 -5
  30. package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +6 -0
  31. package/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +16 -8
  32. package/internals/plugins/useTreeViewLabel/useTreeViewLabel.types.d.ts +3 -2
  33. package/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +3 -1
  34. package/internals/useTreeView/extractPluginParamsFromProps.d.ts +1 -1
  35. package/internals/useTreeView/extractPluginParamsFromProps.js +7 -3
  36. package/modern/RichTreeView/RichTreeView.js +2 -0
  37. package/modern/SimpleTreeView/SimpleTreeView.js +2 -0
  38. package/modern/TreeItem/TreeItem.js +9 -1
  39. package/modern/TreeItem/TreeItemContent.js +1 -1
  40. package/modern/TreeItem/useTreeItemState.js +2 -0
  41. package/modern/TreeItem2/TreeItem2.js +2 -0
  42. package/modern/TreeView/TreeView.js +2 -0
  43. package/modern/hooks/useTreeItem2Utils/useTreeItem2Utils.js +10 -8
  44. package/modern/hooks/useTreeViewApiRef.js +2 -0
  45. package/modern/index.js +1 -1
  46. package/modern/internals/TreeViewProvider/TreeViewChildrenItemProvider.js +7 -1
  47. package/modern/internals/TreeViewProvider/TreeViewProvider.js +2 -1
  48. package/modern/internals/corePlugins/useTreeViewId/useTreeViewId.js +28 -7
  49. package/modern/internals/corePlugins/useTreeViewId/useTreeViewId.utils.js +26 -0
  50. package/modern/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +3 -1
  51. package/modern/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +1 -1
  52. package/modern/internals/plugins/useTreeViewItems/useTreeViewItems.js +9 -2
  53. package/modern/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +11 -5
  54. package/modern/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +6 -0
  55. package/modern/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +16 -8
  56. package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +3 -1
  57. package/modern/internals/useTreeView/extractPluginParamsFromProps.js +7 -3
  58. package/modern/useTreeItem2/useTreeItem2.js +7 -1
  59. package/node/RichTreeView/RichTreeView.js +1 -0
  60. package/node/SimpleTreeView/SimpleTreeView.js +1 -0
  61. package/node/TreeItem/TreeItem.js +8 -1
  62. package/node/TreeItem/TreeItemContent.js +1 -1
  63. package/node/TreeItem/useTreeItemState.js +1 -0
  64. package/node/TreeItem2/TreeItem2.js +1 -0
  65. package/node/TreeView/TreeView.js +1 -0
  66. package/node/hooks/useTreeItem2Utils/useTreeItem2Utils.js +10 -9
  67. package/node/hooks/useTreeViewApiRef.js +1 -0
  68. package/node/index.js +1 -1
  69. package/node/internals/TreeViewProvider/TreeViewChildrenItemProvider.js +7 -1
  70. package/node/internals/TreeViewProvider/TreeViewProvider.js +2 -1
  71. package/node/internals/corePlugins/useTreeViewId/useTreeViewId.js +29 -8
  72. package/node/internals/corePlugins/useTreeViewId/useTreeViewId.utils.js +34 -0
  73. package/node/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +3 -1
  74. package/node/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +1 -1
  75. package/node/internals/plugins/useTreeViewItems/useTreeViewItems.js +9 -2
  76. package/node/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +11 -5
  77. package/node/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +6 -0
  78. package/node/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +16 -8
  79. package/node/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +3 -1
  80. package/node/internals/useTreeView/extractPluginParamsFromProps.js +7 -3
  81. package/node/useTreeItem2/useTreeItem2.js +7 -1
  82. package/package.json +3 -3
  83. package/useTreeItem2/index.d.ts +2 -2
  84. package/useTreeItem2/useTreeItem2.js +7 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,209 @@
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.19.0
7
+
8
+ _Oct 4, 2024_
9
+
10
+ We'd like to offer a big thanks to the 26 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🔁 Automatic parents and children selection for Data Grid ["tree data"](https://mui.com/x/react-data-grid/tree-data/) and ["row grouping"](https://mui.com/x/react-data-grid/row-grouping/) features
13
+ - 💫 Support `minHeight` and `maxHeight` on flex parent container for the Data Grid component
14
+ - 🎁 Export `publicAPI` from the `useTreeItem2Utils` hook for the Tree View
15
+ - 🌍 Improve Bulgarian (bg-BG), Croatian (hr-HR), French (fr-FR), German (de-DE), Japanese (ja-JP) and Vietnamese (vi-VN) locales and add Portuguese (pt-PT) locale on the Data Grid component
16
+ - 🌏 Improve Czech (cs-CZ) and Portuguese (pt-BR) locales and add Bulgarian (bg-BG), Croatian (hr-HR) and Portuguese (pt-PT) locales on the Pickers components
17
+ - 🐞 Bugfixes
18
+ - 📚 Documentation improvements
19
+
20
+ Special thanks goes out to our community contributors who have helped make this release possible:
21
+ @AWAIS97, @chucamphong, @GMchris, @JakubSveda, @k-rajat19, @k725, @lhilgert9, @ruiaraujo012, @Sanderand, @thomasmoon, @vallereaugabriel.
22
+ Following are all team members who have contributed to this release:
23
+ @alexfauquette, @arminmeh, @arthurbalduini, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @MBilalShafi, @michelengelen, @noraleonte, @oliviertassinari, @romgrk, @sai6855, @samuelsycamore.
24
+
25
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
26
+
27
+ ### Data Grid
28
+
29
+ #### `@mui/x-data-grid@7.19.0`
30
+
31
+ - [DataGrid] Fix column definition `undefined` value (#14456) @sai6855
32
+ - [DataGrid] Fix `checkboxSelectionVisibleOnly` reset the selection on filtering (#14677) @MBilalShafi
33
+ - [DataGrid] Fix background colors when `CSSVarsProvider` is used (#12901) @cherniavskii
34
+ - [DataGrid] Fix error when initializing aggregation with row spanning (#14710) @MBilalShafi
35
+ - [DataGrid] Fix scroll to cell logic for keyboard navigating cells and drag selection with pinned columns (#14550) @KenanYusuf
36
+ - [DataGrid] Support `minHeight` and `maxHeight` on flex parent container (#14614) @cherniavskii
37
+ - [l10n] Add missing Portuguese (pt-PT) translations (#14707) @ruiaraujo012
38
+ - [l10n] Improve Bulgarian (bg-BG) locale (#14451) @GMchris
39
+ - [l10n] Improve Croatian (hr-HR) locale (#14794) @arminmeh
40
+ - [l10n] Improve French (fr-FR) locale (#14750) @vallereaugabriel
41
+ - [l10n] Improve German (de-DE) locale (#14755) @lhilgert9
42
+ - [l10n] Improve Japanese (ja-JP) locale (#14381) @k725
43
+ - [l10n] Improve Vietnamese (vi-VN) locale (#14769) @chucamphong
44
+
45
+ #### `@mui/x-data-grid-pro@7.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
46
+
47
+ Same changes as in `@mui/x-data-grid@7.19.0`, plus:
48
+
49
+ - [DataGridPro] Fix dragging styles removal in column reorder (#14680) @k-rajat19
50
+ - [DataGridPro] Fix row pre-processing running with a stale data source (#14810) @MBilalShafi
51
+ - [DataGridPro] Fix `onRowsScrollEnd` not firing on very fast scrolling (#14171) @arminmeh
52
+
53
+ #### `@mui/x-data-grid-premium@7.19.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
54
+
55
+ Same changes as in `@mui/x-data-grid-pro@7.19.0`, plus:
56
+
57
+ - [DataGridPremium] Automatic parents and children selection (#13757) @MBilalShafi
58
+
59
+ ### Date and Time Pickers
60
+
61
+ #### `@mui/x-date-pickers@7.19.0`
62
+
63
+ - [pickers] Fix left-right keyboard nav with `yearsOrder="desc"` and `direction="rtl"` (#14682) @thomasmoon
64
+ - [pickers] Improve `PickerValidDate` type (#14771) @flaviendelangle
65
+ - [pickers] Improve typing of the range pickers (#14716) @flaviendelangle
66
+ - [l10n] Add Bulgarian (bg-BG) locale (#14469) @GMchris
67
+ - [l10n] Add Croatian (hr-HR) locale (#14795) @arminmeh
68
+ - [l10n] Add Portuguese (pt-PT) locale (#14722) @ruiaraujo012
69
+ - [l10n] Improve Czech (cs-CZ) locale (#14732) @JakubSveda
70
+ - [l10n] Improve Portuguese (pt-BR) locale (#14725) @arthurbalduini
71
+
72
+ #### `@mui/x-date-pickers-pro@7.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
73
+
74
+ Same changes as in `@mui/x-date-pickers@7.19.0`.
75
+
76
+ ### Charts
77
+
78
+ #### `@mui/x-charts@7.19.0`
79
+
80
+ - [charts] Fix `LineChart` area animation being stuck when resizing container (#14711) @alexfauquette
81
+ - [charts] Improve types and start using `warnOnce` (#14792) @JCQuintas
82
+
83
+ #### `@mui/x-charts-pro@7.0.0-beta.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
84
+
85
+ Same changes as in `@mui/x-charts@7.19.0`.
86
+
87
+ ### Tree View
88
+
89
+ #### `@mui/x-tree-view@7.19.0`
90
+
91
+ - [TreeView] Apply experimental features in `getDefaultizedParams` instead of in the plugin render (#14661) @flaviendelangle
92
+ - [TreeView] Export `publicAPI` form `useTreeItem2Utils` (#14729) @noraleonte
93
+ - [TreeView] Fix cursor navigation interfering with browser shortcut keys (#14798) @sai6855
94
+ - [TreeView] Fix invalid test for items reordering (#14665) @flaviendelangle
95
+ - [TreeView] Remove `instance.getTreeItemIdAttribute` (#14667) @flaviendelangle
96
+
97
+ ### Docs
98
+
99
+ - [docs] Added warning callout for Firefox reordering bug (#14516) @michelengelen
100
+ - [docs] Copyedit `pages.ts` navigation (#14782) @samuelsycamore
101
+ - [docs] Fix typo in row spanning doc (#14770) @flaviendelangle
102
+ - [docs] Fix typo in the Tree View migration guide to v7 (#14727) @Sanderand
103
+ - [docs] Fix typo in usage of Moment guide for UTC and timezones (#14780) @AWAIS97
104
+ - [docs] Fix what's new link to use absolute URL (#14543) @oliviertassinari
105
+
106
+ ### Core
107
+
108
+ - [core] Fix class name composition order (#14775) @oliviertassinari
109
+ - [core] Replace minWidth, maxWidth with width (#14776) @oliviertassinari
110
+ - [code-infra] Remove custom playwright installation steps (#14728) @Janpot
111
+ - [code-infra] Replace or remove all instances of `e` identifier (#14724) @samuelsycamore
112
+ - [infra] Adds community contribution section to the changelog script (#14799) @michelengelen
113
+ - [infra] Fix line break in Stack Overflow message @oliviertassinari
114
+ - [test] Fix `Escape` event firing event (#14797) @oliviertassinari
115
+
116
+ ## 7.18.0
117
+
118
+ _Sep 20, 2024_
119
+
120
+ We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
121
+
122
+ - 💫 Support [Row spanning](https://mui.com/x/react-data-grid/row-spanning/) on the Data Grid that automatically merges the consecutive cells in a column based on the cell value
123
+
124
+ <img width="600" src="https://github.com/user-attachments/assets/d32ec936-d238-4c92-9e1a-af6788d74cdf" alt="data grid row spanning" />
125
+
126
+ - ⏰ Support `date-fns` v4 (#14673) @LukasTy
127
+ - 🎉 Add option for Pickers to change the order of displayed years (#11780) @thomasmoon
128
+ - 🐞 Bugfixes
129
+ - 📚 Documentation improvements
130
+
131
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
132
+
133
+ ### Data Grid
134
+
135
+ #### `@mui/x-data-grid@7.18.0`
136
+
137
+ - [DataGrid] Add default reset value in row edit mode (#14050) @michelengelen
138
+ - [DataGrid] Add `columnGroupHeaderHeight` prop for sizing column group headers (#14637) @KenanYusuf
139
+ - [DataGrid] Fix `document` reference when the grid is rendered in a popup window (#14649) @arminmeh
140
+ - [DataGrid] Remove `minFirstColumn` from `GetHeadersParams` interface (#14450) @k-rajat19
141
+ - [DataGrid] Row spanning (#14124) @MBilalShafi
142
+
143
+ #### `@mui/x-data-grid-pro@7.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
144
+
145
+ Same changes as in `@mui/x-data-grid@7.18.0`, plus:
146
+
147
+ - [DataGridPro] Fix `onRowsScrollEnd` being triggered instantly when bottom pinned row is present (#14602) @arminmeh
148
+ - [DataGridPro] Fix header filters rendering issue for `isEmpty` and `isNotEmpty` filter operators (#14493) @k-rajat19
149
+ - [DataGridPro] Fix pinned columns in RTL mode (#14586) @KenanYusuf
150
+
151
+ #### `@mui/x-data-grid-premium@7.18.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
152
+
153
+ Same changes as in `@mui/x-data-grid-pro@7.18.0`.
154
+
155
+ ### Date and Time Pickers
156
+
157
+ #### `@mui/x-date-pickers@7.18.0`
158
+
159
+ - [pickers] Add option to change the order of displayed years (#11780) @thomasmoon
160
+ - [pickers] Support `date-fns` v4 (#14673) @LukasTy
161
+
162
+ #### `@mui/x-date-pickers-pro@7.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
163
+
164
+ Same changes as in `@mui/x-date-pickers@7.18.0`.
165
+
166
+ ### Charts
167
+
168
+ #### `@mui/x-charts@7.18.0`
169
+
170
+ - [charts] Add a `PolarProvider` to manage polar axes (#14642) @alexfauquette
171
+ - [charts] Fix `LineChart` animation being stuck with initial drawing area value (#14553) @JCQuintas
172
+ - [charts] Fix legend slot typing (#14657) @alexfauquette
173
+ - [charts] Pass the axis index to extremum getter (#14641) @alexfauquette
174
+ - [charts] Provide hooks to create custom tooltip (#14377) @alexfauquette
175
+
176
+ #### `@mui/x-charts-pro@7.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
177
+
178
+ Same changes as in `@mui/x-charts@7.18.0`.
179
+
180
+ ### Tree View
181
+
182
+ #### `@mui/x-tree-view@7.18.0`
183
+
184
+ - [TreeView] Add `"use client"` directive to every public component and hook (#14579) @flaviendelangle
185
+
186
+ ### Docs
187
+
188
+ - [docs] Add `groupingValueGetter` callout in column definition docs (#14599) @michelengelen
189
+ - [docs] Clean v6 => v7 migration guide (#14652) @flaviendelangle
190
+ - [docs] Copy `vale-action.yml` from main repo @oliviertassinari
191
+ - [docs] Edit the Pickers Getting started doc (#14555) @samuelsycamore
192
+ - [docs] Fix TypeScript capitalization @oliviertassinari
193
+ - [docs] Fix Vale error @oliviertassinari
194
+ - [docs] Make the migration guide diff a bit easier to read @oliviertassinari
195
+ - [docs] Report Vale at warning level (#14660) @oliviertassinari
196
+ - [docs] Warn about the `valueGetter` and `valueFormatter` signature change (#14613) @cherniavskii
197
+ - [docs] Polish code formatting (#14603) @oliviertassinari
198
+ - [test] Spy on `observe` method to avoid flaky wait for a callback (#14640) @arminmeh
199
+
200
+ ### Core
201
+
202
+ - [core] Fix 301 link to Next.js and git diff @oliviertassinari
203
+ - [core] Fix failing CI on `master` (#14644) @cherniavskii
204
+ - [core] Fix `package.json` repository rule @oliviertassinari
205
+ - [core] MUI X repository moved to a new location @oliviertassinari
206
+ - [docs-infra] Strengthen CSP (#14581) @oliviertassinari
207
+ - [license] Finish renaming of LicensingModel (#14615) @oliviertassinari
208
+
6
209
  ## 7.17.0
7
210
 
8
211
  _Sep 13, 2024_
@@ -75,7 +278,7 @@ Same changes as in `@mui/x-charts@7.17.0`.
75
278
  ### Docs
76
279
 
77
280
  - [docs] Add missing callout on "Imperative API" tree view sections (#14503) @flaviendelangle
78
- - [docs] Fix broken redirection to MUI X v5 @oliviertassinari
281
+ - [docs] Fix broken redirection to MUI X v5 @oliviertassinari
79
282
  - [docs] Fix multiple `console.error` messages on `charts` docs (#14554) @JCQuintas
80
283
  - [docs] Fixed typo in Row Grouping recipes (#14549) @Miodini
81
284
  - [docs] Match title with blog posts @oliviertassinari
@@ -195,7 +398,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
195
398
 
196
399
  - 💫 Support Material UI v6 (`@mui/material@6`) peer dependency (#14142) @cherniavskii
197
400
 
198
- You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
401
+ You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
199
402
 
200
403
  - 🐞 Bugfixes
201
404
 
@@ -240,7 +443,7 @@ Same changes as in `@mui/x-charts@7.15.0`, plus:
240
443
 
241
444
  - [docs] Fix sentence case `h2` @oliviertassinari
242
445
  - [docs] Clarify contribution guide references @oliviertassinari
243
- - [docs] Fix Stack Overflow issue canned response @oliviertassinari
446
+ - [docs] Fix Stack Overflow issue canned response @oliviertassinari
244
447
  - [docs] Fix outdated link to support page @oliviertassinari
245
448
  - [docs] Fix use of Material UI @oliviertassinari
246
449
  - [docs] Update deprecated props in docs (#14295) @JCQuintas
@@ -498,7 +701,7 @@ The [Pro plan](https://mui.com/x/introduction/licensing/#pro-plan) is receiving
498
701
 
499
702
  As always, every feature released as part of the MIT plan will remain free and MIT licensed forever.
500
703
 
501
- This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
704
+ This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
502
705
 
503
706
  ### Highlights
504
707
 
@@ -563,7 +766,7 @@ Same changes as in `@mui/x-date-pickers@7.12.0`.
563
766
  #### `@mui/x-charts@7.12.0`
564
767
 
565
768
  - [charts] Fix incorrect `axisId` prop being allowed in xAxis/yAxis config. Use `id` instead. (#13986) @JCQuintas
566
- - [charts] Use vendor to have Common JS bundle working out of the box (#13608) @alexfauquette
769
+ - [charts] Use vendor to have CommonJS bundle working out of the box (#13608) @alexfauquette
567
770
  - [charts] Divide the `SeriesProvider` to use in filtering (#14026) @JCQuintas
568
771
 
569
772
  ### Tree View
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -6,7 +6,7 @@ import { UseTreeViewFocusParameters } from '../internals/plugins/useTreeViewFocu
6
6
  import { UseTreeViewIconsParameters } from '../internals/plugins/useTreeViewIcons';
7
7
  import { ConvertPluginsIntoSignatures, MergeSignaturesProperty } from '../internals/models';
8
8
  import { UseTreeViewLabelParameters } from '../internals/plugins/useTreeViewLabel';
9
- export declare const RICH_TREE_VIEW_PLUGINS: readonly [import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewItems").UseTreeViewItemsSignature>, 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/useTreeViewIcons").UseTreeViewIconsSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewLabel").UseTreeViewLabelSignature>];
9
+ export declare const RICH_TREE_VIEW_PLUGINS: readonly [import("../internals").TreeViewPlugin<import("../internals").UseTreeViewItemsSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewExpansionSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewSelectionSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewFocusSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewKeyboardNavigationSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewIconsSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewLabelSignature>];
10
10
  export type RichTreeViewPluginSignatures = ConvertPluginsIntoSignatures<typeof RICH_TREE_VIEW_PLUGINS>;
11
11
  export type RichTreeViewPluginSlots = MergeSignaturesProperty<RichTreeViewPluginSignatures, 'slots'>;
12
12
  export type RichTreeViewPluginSlotProps = MergeSignaturesProperty<RichTreeViewPluginSignatures, 'slotProps'>;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -5,7 +5,7 @@ import { UseTreeViewSelectionParameters } from '../internals/plugins/useTreeView
5
5
  import { UseTreeViewFocusParameters } from '../internals/plugins/useTreeViewFocus';
6
6
  import { UseTreeViewIconsParameters } from '../internals/plugins/useTreeViewIcons';
7
7
  import { ConvertPluginsIntoSignatures, MergeSignaturesProperty } from '../internals/models';
8
- export declare const SIMPLE_TREE_VIEW_PLUGINS: readonly [import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewItems").UseTreeViewItemsSignature>, 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/useTreeViewIcons").UseTreeViewIconsSignature>, import("../internals/models").TreeViewPlugin<import("../internals/plugins/useTreeViewJSXItems").UseTreeViewJSXItemsSignature>];
8
+ export declare const SIMPLE_TREE_VIEW_PLUGINS: readonly [import("../internals").TreeViewPlugin<import("../internals").UseTreeViewItemsSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewExpansionSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewSelectionSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewFocusSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewKeyboardNavigationSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewIconsSignature>, import("../internals").TreeViewPlugin<import("../internals").UseTreeViewJSXItemsSignature>];
9
9
  export type SimpleTreeViewPluginSignatures = ConvertPluginsIntoSignatures<typeof SIMPLE_TREE_VIEW_PLUGINS>;
10
10
  export type SimpleTreeViewPluginSlots = MergeSignaturesProperty<SimpleTreeViewPluginSignatures, 'slots'>;
11
11
  export type SimpleTreeViewPluginSlotProps = MergeSignaturesProperty<SimpleTreeViewPluginSignatures, 'slotProps'>;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"],
@@ -26,6 +28,7 @@ import { TreeItem2Provider } from "../TreeItem2Provider/index.js";
26
28
  import { TreeViewItemDepthContext } from "../internals/TreeViewItemDepthContext/index.js";
27
29
  import { useTreeItemState } from "./useTreeItemState.js";
28
30
  import { isTargetInDescendants } from "../internals/utils/tree.js";
31
+ import { generateTreeItemIdAttribute } from "../internals/corePlugins/useTreeViewId/useTreeViewId.utils.js";
29
32
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
30
33
  const useThemeProps = createUseThemeProps('MuiTreeItem');
31
34
  const useUtilityClasses = ownerState => {
@@ -183,6 +186,7 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
183
186
  expansion: {
184
187
  expansionTrigger
185
188
  },
189
+ treeId,
186
190
  instance
187
191
  } = useTreeViewContext();
188
192
  const depthContext = React.useContext(TreeViewItemDepthContext);
@@ -339,7 +343,11 @@ export const TreeItem = /*#__PURE__*/React.forwardRef(function TreeItem(inProps,
339
343
  }
340
344
  instance.handleItemKeyDown(event, itemId);
341
345
  };
342
- const idAttribute = instance.getTreeItemIdAttribute(itemId, id);
346
+ const idAttribute = generateTreeItemIdAttribute({
347
+ itemId,
348
+ treeId,
349
+ id
350
+ });
343
351
  const tabIndex = instance.canItemBeTabbed(itemId) ? 0 : -1;
344
352
  const sharedPropsEnhancerParams = {
345
353
  rootRefObject,
@@ -77,7 +77,7 @@ const TreeItemContent = /*#__PURE__*/React.forwardRef(function TreeItemContent(p
77
77
  /*#__PURE__*/
78
78
  /* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
79
79
  _jsxs("div", _extends({}, other, {
80
- className: clsx(className, classes.root, expanded && classes.expanded, selected && classes.selected, focused && classes.focused, disabled && classes.disabled, editing && classes.editing, editable && classes.editable),
80
+ className: clsx(classes.root, className, expanded && classes.expanded, selected && classes.selected, focused && classes.focused, disabled && classes.disabled, editing && classes.editing, editable && classes.editable),
81
81
  onClick: handleClick,
82
82
  onMouseDown: handleMouseDown,
83
83
  ref: ref,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { useTreeViewContext } from "../internals/TreeViewProvider/index.js";
2
4
  import { useTreeViewLabel } from "../internals/plugins/useTreeViewLabel/index.js";
3
5
  import { hasPlugin } from "../internals/utils/plugins.js";
@@ -2,21 +2,21 @@ import * as React from 'react';
2
2
  import { CheckboxProps } from '@mui/material/Checkbox';
3
3
  import { TreeItem2Props } from './TreeItem2.types';
4
4
  import { UseTreeItem2Status } from '../useTreeItem2';
5
- export declare const TreeItem2Root: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, keyof React.ClassAttributes<HTMLLIElement> | keyof React.LiHTMLAttributes<HTMLLIElement>>, {}>;
6
- export declare const TreeItem2Content: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
5
+ export declare const TreeItem2Root: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, keyof React.ClassAttributes<HTMLLIElement> | keyof React.LiHTMLAttributes<HTMLLIElement>>, {}>;
6
+ export declare const TreeItem2Content: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
7
7
  status: UseTreeItem2Status;
8
8
  indentationAtItemLevel?: true;
9
9
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
- export declare const TreeItem2Label: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
10
+ export declare const TreeItem2Label: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
11
11
  editable?: boolean;
12
12
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
- export declare const TreeItem2IconContainer: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
14
- export declare const TreeItem2GroupTransition: import("@emotion/styled").StyledComponent<import("@mui/material/Collapse").CollapseProps & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
13
+ export declare const TreeItem2IconContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
14
+ export declare const TreeItem2GroupTransition: import("@emotion/styled").StyledComponent<import("@mui/material").CollapseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
15
15
  indentationAtItemLevel?: true;
16
16
  }, {}, {}>;
17
17
  export declare const TreeItem2Checkbox: import("@emotion/styled").StyledComponent<Pick<Omit<CheckboxProps & {
18
18
  visible: boolean;
19
- }, "ref"> & React.RefAttributes<HTMLButtonElement>, "hidden" | "visible" | "color" | "content" | "size" | "style" | "icon" | "translate" | "disabled" | "form" | "slot" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "name" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "readOnly" | "required" | "action" | "checked" | "component" | "sx" | "classes" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "checkedIcon" | "inputProps" | "inputRef" | "indeterminate" | "indeterminateIcon" | keyof React.RefAttributes<HTMLButtonElement>> & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
19
+ }, "ref"> & React.RefAttributes<HTMLButtonElement>, "hidden" | "visible" | "color" | "content" | "size" | "style" | "icon" | "translate" | "disabled" | "form" | "slot" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "name" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "readOnly" | "required" | "action" | "checked" | "component" | "sx" | "classes" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "checkedIcon" | "inputProps" | "inputRef" | "indeterminate" | "indeterminateIcon" | keyof React.RefAttributes<HTMLButtonElement>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
20
20
  type TreeItem2Component = ((props: TreeItem2Props & React.RefAttributes<HTMLLIElement>) => React.JSX.Element) & {
21
21
  propTypes?: any;
22
22
  };
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["visible"],
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,6 +1,11 @@
1
1
  import * as React from 'react';
2
+ import { UseTreeViewSelectionSignature } from '../../internals/plugins/useTreeViewSelection';
3
+ import { UseTreeViewExpansionSignature } from '../../internals/plugins/useTreeViewExpansion';
4
+ import { UseTreeViewItemsSignature } from '../../internals/plugins/useTreeViewItems';
5
+ import { UseTreeViewFocusSignature } from '../../internals/plugins/useTreeViewFocus';
2
6
  import { UseTreeViewLabelSignature } from '../../internals/plugins/useTreeViewLabel';
3
7
  import type { UseTreeItem2Status } from '../../useTreeItem2';
8
+ import { TreeViewPublicAPI } from '../../internals/models';
4
9
  export interface UseTreeItem2Interactions {
5
10
  handleExpansion: (event: React.MouseEvent) => void;
6
11
  handleSelection: (event: React.MouseEvent) => void;
@@ -9,16 +14,29 @@ export interface UseTreeItem2Interactions {
9
14
  handleSaveItemLabel: (event: React.SyntheticEvent, label: string) => void;
10
15
  handleCancelItemLabelEditing: (event: React.SyntheticEvent) => void;
11
16
  }
12
- interface UseTreeItem2UtilsReturnValue {
13
- interactions: UseTreeItem2Interactions;
14
- status: UseTreeItem2Status;
15
- }
17
+ /**
18
+ * Plugins that need to be present in the Tree View in order for `useTreeItem2Utils` to work correctly.
19
+ */
20
+ type UseTreeItem2UtilsMinimalPlugins = readonly [
21
+ UseTreeViewSelectionSignature,
22
+ UseTreeViewExpansionSignature,
23
+ UseTreeViewItemsSignature,
24
+ UseTreeViewFocusSignature
25
+ ];
16
26
  /**
17
27
  * Plugins that `useTreeItem2Utils` can use if they are present, but are not required.
18
28
  */
19
29
  export type UseTreeItem2UtilsOptionalPlugins = readonly [UseTreeViewLabelSignature];
20
- export declare const useTreeItem2Utils: ({ itemId, children, }: {
30
+ interface UseTreeItem2UtilsReturnValue<TSignatures extends UseTreeItem2UtilsMinimalPlugins, TOptionalSignatures extends UseTreeItem2UtilsOptionalPlugins> {
31
+ interactions: UseTreeItem2Interactions;
32
+ status: UseTreeItem2Status;
33
+ /**
34
+ * The object the allows Tree View manipulation.
35
+ */
36
+ publicAPI: TreeViewPublicAPI<TSignatures, TOptionalSignatures>;
37
+ }
38
+ export declare const useTreeItem2Utils: <TSignatures extends UseTreeItem2UtilsMinimalPlugins = UseTreeItem2UtilsMinimalPlugins, TOptionalSignatures extends UseTreeItem2UtilsOptionalPlugins = UseTreeItem2UtilsOptionalPlugins>({ itemId, children, }: {
21
39
  itemId: string;
22
40
  children: React.ReactNode;
23
- }) => UseTreeItem2UtilsReturnValue;
41
+ }) => UseTreeItem2UtilsReturnValue<TSignatures, TOptionalSignatures>;
24
42
  export {};
@@ -1,12 +1,6 @@
1
1
  import { useTreeViewContext } from "../../internals/TreeViewProvider/index.js";
2
2
  import { useTreeViewLabel } from "../../internals/plugins/useTreeViewLabel/index.js";
3
3
  import { hasPlugin } from "../../internals/utils/plugins.js";
4
- const isItemExpandable = reactChildren => {
5
- if (Array.isArray(reactChildren)) {
6
- return reactChildren.length > 0 && reactChildren.some(isItemExpandable);
7
- }
8
- return Boolean(reactChildren);
9
- };
10
4
 
11
5
  /**
12
6
  * Plugins that need to be present in the Tree View in order for `useTreeItem2Utils` to work correctly.
@@ -16,6 +10,12 @@ const isItemExpandable = reactChildren => {
16
10
  * Plugins that `useTreeItem2Utils` can use if they are present, but are not required.
17
11
  */
18
12
 
13
+ const isItemExpandable = reactChildren => {
14
+ if (Array.isArray(reactChildren)) {
15
+ return reactChildren.length > 0 && reactChildren.some(isItemExpandable);
16
+ }
17
+ return Boolean(reactChildren);
18
+ };
19
19
  export const useTreeItem2Utils = ({
20
20
  itemId,
21
21
  children
@@ -24,7 +24,8 @@ export const useTreeItem2Utils = ({
24
24
  instance,
25
25
  selection: {
26
26
  multiSelect
27
- }
27
+ },
28
+ publicAPI
28
29
  } = useTreeViewContext();
29
30
  const status = {
30
31
  expandable: isItemExpandable(children),
@@ -134,6 +135,7 @@ export const useTreeItem2Utils = ({
134
135
  };
135
136
  return {
136
137
  interactions,
137
- status
138
+ status,
139
+ publicAPI
138
140
  };
139
141
  };
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * Hook that instantiates a [[TreeViewApiRef]].
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.17.0
2
+ * @mui/x-tree-view v7.19.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { useTreeViewContext } from "./useTreeViewContext.js";
4
4
  import { escapeOperandAttributeSelector } from "../utils/utils.js";
5
+ import { generateTreeItemIdAttribute } from "../corePlugins/useTreeViewId/useTreeViewId.utils.js";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
7
  export const TreeViewChildrenItemContext = /*#__PURE__*/React.createContext(null);
7
8
  if (process.env.NODE_ENV !== 'production') {
@@ -14,6 +15,7 @@ export function TreeViewChildrenItemProvider(props) {
14
15
  } = props;
15
16
  const {
16
17
  instance,
18
+ treeId,
17
19
  rootRef
18
20
  } = useTreeViewContext();
19
21
  const childrenIdAttrToIdRef = React.useRef(new Map());
@@ -28,7 +30,11 @@ export function TreeViewChildrenItemProvider(props) {
28
30
  // Undefined during 1st render
29
31
  const itemMeta = instance.getItemMeta(itemId);
30
32
  if (itemMeta !== undefined) {
31
- idAttr = instance.getTreeItemIdAttribute(itemId, itemMeta.idAttribute);
33
+ idAttr = generateTreeItemIdAttribute({
34
+ itemId,
35
+ treeId,
36
+ id: itemMeta.idAttribute
37
+ });
32
38
  }
33
39
  }
34
40
  if (idAttr == null) {
@@ -14,7 +14,8 @@ export function TreeViewProvider(props) {
14
14
  return /*#__PURE__*/_jsx(TreeViewContext.Provider, {
15
15
  value: value,
16
16
  children: value.wrapRoot({
17
- children
17
+ children,
18
+ instance: value.instance
18
19
  })
19
20
  });
20
21
  }
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { MergeSignaturesProperty, TreeItemWrapper, TreeRootWrapper, TreeViewAnyPluginSignature, TreeViewInstance, TreeViewItemPluginResponse, TreeViewPublicAPI } from '../models';
3
+ import { TreeViewCorePluginSignatures } from '../corePlugins';
3
4
  export type TreeViewItemPluginsRunner = <TProps extends {}>(props: TProps) => Required<TreeViewItemPluginResponse>;
4
- export type TreeViewContextValue<TSignatures extends readonly TreeViewAnyPluginSignature[], TOptionalSignatures extends readonly TreeViewAnyPluginSignature[] = []> = MergeSignaturesProperty<TSignatures, 'contextValue'> & Partial<MergeSignaturesProperty<TOptionalSignatures, 'contextValue'>> & {
5
+ export type TreeViewContextValue<TSignatures extends readonly TreeViewAnyPluginSignature[], TOptionalSignatures extends readonly TreeViewAnyPluginSignature[] = []> = MergeSignaturesProperty<[...TreeViewCorePluginSignatures, ...TSignatures], 'contextValue'> & Partial<MergeSignaturesProperty<TOptionalSignatures, 'contextValue'>> & {
5
6
  instance: TreeViewInstance<TSignatures, TOptionalSignatures>;
6
7
  publicAPI: TreeViewPublicAPI<TSignatures, TOptionalSignatures>;
7
8
  rootRef: React.RefObject<HTMLUListElement>;
@@ -1,3 +1,3 @@
1
1
  import { TreeViewAnyPluginSignature } from '../models';
2
2
  import { TreeViewContextValue } from './TreeViewProvider.types';
3
- export declare const useTreeViewContext: <TSignatures extends readonly TreeViewAnyPluginSignature[], TOptionalSignatures extends readonly TreeViewAnyPluginSignature[] = []>() => NonNullable<TreeViewContextValue<TSignatures, TOptionalSignatures>>;
3
+ export declare const useTreeViewContext: <TSignatures extends readonly TreeViewAnyPluginSignature[], TOptionalSignatures extends readonly TreeViewAnyPluginSignature[] = []>() => TreeViewContextValue<TSignatures, TOptionalSignatures>;
@@ -4,7 +4,7 @@ import { ConvertPluginsIntoSignatures } from '../models';
4
4
  * Internal plugins that create the tools used by the other plugins.
5
5
  * These plugins are used by the tree view components.
6
6
  */
7
- export declare const TREE_VIEW_CORE_PLUGINS: readonly [import("../models").TreeViewPlugin<import("./useTreeViewInstanceEvents").UseTreeViewInstanceEventsSignature>, import("../models").TreeViewPlugin<import("./useTreeViewOptionalPlugins").UseTreeViewOptionalPluginsSignature>, import("../models").TreeViewPlugin<import("./useTreeViewId").UseTreeViewIdSignature>];
7
+ export declare const TREE_VIEW_CORE_PLUGINS: readonly [import("..").TreeViewPlugin<import("./useTreeViewInstanceEvents").UseTreeViewInstanceEventsSignature>, import("..").TreeViewPlugin<import("./useTreeViewOptionalPlugins").UseTreeViewOptionalPluginsSignature>, import("..").TreeViewPlugin<import("./useTreeViewId").UseTreeViewIdSignature>];
8
8
  export type TreeViewCorePluginSignatures = ConvertPluginsIntoSignatures<typeof TREE_VIEW_CORE_PLUGINS>;
9
9
  export interface TreeViewCorePluginParameters extends UseTreeViewIdParameters {
10
10
  }