@mui/x-tree-view 9.10.0 → 9.11.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.
- package/CHANGELOG.md +224 -0
- package/README.md +1 -11
- package/RichTreeView/RichTreeView.js +2 -0
- package/RichTreeView/RichTreeView.mjs +2 -0
- package/SimpleTreeView/SimpleTreeView.js +1 -0
- package/SimpleTreeView/SimpleTreeView.mjs +1 -0
- package/TreeItemIcon/TreeItemIcon.js +1 -0
- package/TreeItemIcon/TreeItemIcon.mjs +1 -0
- package/hooks/useTreeItemUtils/useTreeItemUtils.js +2 -0
- package/hooks/useTreeItemUtils/useTreeItemUtils.mjs +2 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/MinimalTreeViewStore/MinimalTreeViewStore.d.mts +2 -1
- package/internals/MinimalTreeViewStore/MinimalTreeViewStore.d.ts +2 -1
- package/internals/RichTreeViewStore/RichTreeViewStore.d.mts +8 -2
- package/internals/RichTreeViewStore/RichTreeViewStore.d.ts +8 -2
- package/internals/RichTreeViewStore/RichTreeViewStore.js +5 -2
- package/internals/RichTreeViewStore/RichTreeViewStore.mjs +5 -2
- package/internals/plugins/items/TreeViewItemsPlugin.d.mts +27 -0
- package/internals/plugins/items/TreeViewItemsPlugin.d.ts +27 -0
- package/internals/plugins/items/TreeViewItemsPlugin.js +81 -35
- package/internals/plugins/items/TreeViewItemsPlugin.mjs +82 -36
- package/internals/plugins/items/utils.d.mts +28 -0
- package/internals/plugins/items/utils.d.ts +28 -0
- package/internals/plugins/items/utils.js +49 -0
- package/internals/plugins/items/utils.mjs +48 -0
- package/internals/plugins/selection/TreeViewSelectionPlugin.d.mts +15 -0
- package/internals/plugins/selection/TreeViewSelectionPlugin.d.ts +15 -0
- package/internals/plugins/selection/TreeViewSelectionPlugin.js +66 -17
- package/internals/plugins/selection/TreeViewSelectionPlugin.mjs +66 -17
- package/internals/plugins/selection/itemPlugin.js +13 -36
- package/internals/plugins/selection/itemPlugin.mjs +14 -37
- package/internals/plugins/selection/selectors.d.mts +11 -0
- package/internals/plugins/selection/selectors.d.ts +11 -0
- package/internals/plugins/selection/selectors.js +56 -3
- package/internals/plugins/selection/selectors.mjs +56 -3
- package/models/items.d.mts +2 -1
- package/models/items.d.ts +2 -1
- package/package.json +3 -3
- package/useTreeItem/useTreeItem.types.d.mts +4 -0
- package/useTreeItem/useTreeItem.types.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,229 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.11.0
|
|
4
|
+
|
|
5
|
+
_Aug 6, 2026_
|
|
6
|
+
|
|
7
|
+
We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
8
|
+
|
|
9
|
+
- ✨ Add `addItems()` and `getItemSelection()` API methods to Tree View
|
|
10
|
+
|
|
11
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
12
|
+
@12joan, @Anexus5919, @kevincorizi-sbt, @mixelburg, @mustafajw07, @strazto
|
|
13
|
+
|
|
14
|
+
The following team members contributed to this release:
|
|
15
|
+
@flaviendelangle, @hasdfa, @JCQuintas, @LukasTy, @MBilalShafi, @michelengelen, @noraleonte, @rita-codes
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### `@mui/x-data-grid@9.11.0`
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Fix `updateRows` stripping class prototypes from rows in datasource mode (#22288) @mixelburg
|
|
22
|
+
- [DataGrid] Do not re-fetch data when an `Activity` becomes visible (#22603) @12joan
|
|
23
|
+
- [DataGrid] Fix toolbar button stealing focus when a sibling's disabled state changes (#23204) @MBilalShafi
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid-pro@9.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
26
|
+
|
|
27
|
+
Same changes as in `@mui/x-data-grid@9.11.0`.
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-premium@9.11.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid-pro@9.11.0`.
|
|
32
|
+
|
|
33
|
+
### Date and Time Pickers
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-date-pickers@9.11.0`
|
|
36
|
+
|
|
37
|
+
- [pickers] Fix day shift when editing dates predating timezone standardization (#23296) @JCQuintas
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-date-pickers-pro@9.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
40
|
+
|
|
41
|
+
Same changes as in `@mui/x-date-pickers@9.11.0`, plus:
|
|
42
|
+
|
|
43
|
+
- [DateRangePicker] Fix disabled filler cells showing the range highlight (#23293) @JCQuintas
|
|
44
|
+
|
|
45
|
+
### Charts
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-charts@9.11.0`
|
|
48
|
+
|
|
49
|
+
- [charts] Activate the focused item with `Enter`/`Space` (#23218) @JCQuintas
|
|
50
|
+
- [charts] Extract the axis click payload builders (#23215) @JCQuintas
|
|
51
|
+
- [charts] Fix `GestureManager` event listener leak on chart unmount (#23283) @kevincorizi-sbt
|
|
52
|
+
- [charts] Fix `slotProps.legend.position` and `direction` in `RadarChart` (#23254) @JCQuintas
|
|
53
|
+
- [charts] Fix axis clicks being discarded on slight pointer movement (#23244) @noraleonte
|
|
54
|
+
- [charts] Fix image export of charts sized by their parent element (#23255) @JCQuintas
|
|
55
|
+
- [charts] Forward `experimentalFeatures` on `RadarChart` and `Heatmap` (#23216) @JCQuintas
|
|
56
|
+
- [charts] Hide focus indicator when the chart loses focus (#23213) @JCQuintas
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-charts-pro@9.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
59
|
+
|
|
60
|
+
Same changes as in `@mui/x-charts@9.11.0`.
|
|
61
|
+
|
|
62
|
+
#### `@mui/x-charts-premium@9.11.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
63
|
+
|
|
64
|
+
Same changes as in `@mui/x-charts-pro@9.11.0`, plus:
|
|
65
|
+
|
|
66
|
+
- [charts-premium] Fix `RangeBar` type override (#23217) @JCQuintas
|
|
67
|
+
|
|
68
|
+
### Tree View
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-tree-view@9.11.0`
|
|
71
|
+
|
|
72
|
+
- [tree view] Add `addItems()` API method (#23159) @JCQuintas
|
|
73
|
+
- [tree view] Add `getItemSelection` API method (#23257) @noraleonte
|
|
74
|
+
- [tree view] Ignore `keepExistingSelection` when `multiSelect` is `false` (#23242) @JCQuintas
|
|
75
|
+
- [tree view] Prevent duplicate ids in multi-select arrow navigation (#23006) @Anexus5919
|
|
76
|
+
|
|
77
|
+
#### `@mui/x-tree-view-pro@9.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
78
|
+
|
|
79
|
+
Same changes as in `@mui/x-tree-view@9.11.0`, plus:
|
|
80
|
+
|
|
81
|
+
- [tree view] Discard superseded lazy-loading responses (#23005) @Anexus5919
|
|
82
|
+
|
|
83
|
+
### Scheduler
|
|
84
|
+
|
|
85
|
+
#### `@mui/x-scheduler@9.0.0-beta.8`
|
|
86
|
+
|
|
87
|
+
- [scheduler] Add `localeText` prop to standalone views (#23210) @rita-codes
|
|
88
|
+
- [scheduler] Finetune touch experience for time grid events and introduce editing drawer (#22624) @noraleonte
|
|
89
|
+
- [scheduler] Introduce the edit dialog form context & lifecycle contract (#23284) @rita-codes
|
|
90
|
+
- [scheduler] Refactor edit dialog General tab into section components (#23206) @rita-codes
|
|
91
|
+
- [scheduler] Replace copied Base UI internals with `@base-ui/react/internals` imports (#21972) @flaviendelangle
|
|
92
|
+
- [scheduler] Hide resource picker when no resources are provided (#23290) @mustafajw07
|
|
93
|
+
- [scheduler] Support multi-resource occurrences in `EventTimeline` (#23240) @mustafajw07
|
|
94
|
+
|
|
95
|
+
#### `@mui/x-scheduler-premium@9.0.0-beta.8` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
96
|
+
|
|
97
|
+
Same changes as in `@mui/x-scheduler@9.0.0-beta.8`.
|
|
98
|
+
|
|
99
|
+
### Codemod
|
|
100
|
+
|
|
101
|
+
#### `@mui/x-codemod@9.11.0`
|
|
102
|
+
|
|
103
|
+
- [codemod] Remove unused `@babel/core` and `@babel/traverse` dependencies (#23245) @LukasTy
|
|
104
|
+
|
|
105
|
+
### Docs
|
|
106
|
+
|
|
107
|
+
- [docs] Add recipe for adding new rows from clipboard copy (#22913) @michelengelen
|
|
108
|
+
- [docs] Clarify the package versions in v8 upgrade guides (#22376) @strazto
|
|
109
|
+
- [docs] Replace README peer dependency lists with an npm install command (#23256) @LukasTy
|
|
110
|
+
|
|
111
|
+
### Core
|
|
112
|
+
|
|
113
|
+
- [code-infra] Align action pin version comments (#23238) @LukasTy
|
|
114
|
+
|
|
115
|
+
### Miscellaneous
|
|
116
|
+
|
|
117
|
+
- [chat] Drop the undeclared `@mui/icons-material` dependency (#23252) @LukasTy
|
|
118
|
+
- [chat] Sanitize image part URLs and share the URL allow-list with markdown (#23058) @hasdfa
|
|
119
|
+
- [test] Type the `PickersTextField` test stub instead of `as any` (#23194) @LukasTy
|
|
120
|
+
|
|
121
|
+
## 9.10.1
|
|
122
|
+
|
|
123
|
+
_Jul 23, 2026_
|
|
124
|
+
|
|
125
|
+
We'd like to extend a big thank you to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
126
|
+
|
|
127
|
+
- 🦮 Improve accessibility of the Charts and Pickers components.
|
|
128
|
+
- 🐞 Bugfixes
|
|
129
|
+
- 📚 Documentation improvements
|
|
130
|
+
|
|
131
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
132
|
+
@kevincorizi-sbt, @mustafajw07, @SamanPandey-in
|
|
133
|
+
|
|
134
|
+
The following team members contributed to this release:
|
|
135
|
+
@brijeshb42, @hasdfa, @JCQuintas, @LukasTy, @michelengelen, @noraleonte, @rita-codes, @silviuaavram
|
|
136
|
+
|
|
137
|
+
### Data Grid
|
|
138
|
+
|
|
139
|
+
#### `@mui/x-data-grid@9.10.1`
|
|
140
|
+
|
|
141
|
+
- [data grid] Fix `getColumn` return type not reflecting that it can return undefined (#23165) @JCQuintas
|
|
142
|
+
|
|
143
|
+
#### `@mui/x-data-grid-pro@9.10.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
144
|
+
|
|
145
|
+
Same changes as in `@mui/x-data-grid@9.10.1`.
|
|
146
|
+
|
|
147
|
+
#### `@mui/x-data-grid-premium@9.10.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
148
|
+
|
|
149
|
+
Same changes as in `@mui/x-data-grid-pro@9.10.1`.
|
|
150
|
+
|
|
151
|
+
### Date and Time Pickers
|
|
152
|
+
|
|
153
|
+
#### `@mui/x-date-pickers@9.10.1`
|
|
154
|
+
|
|
155
|
+
- [pickers] Fix format placeholder brightness with a start adornment (#23189) @LukasTy
|
|
156
|
+
|
|
157
|
+
#### `@mui/x-date-pickers-pro@9.10.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
158
|
+
|
|
159
|
+
Same changes as in `@mui/x-date-pickers@9.10.1`, plus:
|
|
160
|
+
|
|
161
|
+
- [DateRangePicker] Fix broken active range position underline in single input range fields (#23166) @LukasTy
|
|
162
|
+
|
|
163
|
+
### Charts
|
|
164
|
+
|
|
165
|
+
#### `@mui/x-charts@9.10.1`
|
|
166
|
+
|
|
167
|
+
- [charts] Fix pie chart disappearing when an arc spans almost the full circle (#23145) @JCQuintas
|
|
168
|
+
- [charts] Set `aria-hidden` on accessibility proxy divs at initialization (#23186) @kevincorizi-sbt
|
|
169
|
+
- [charts] Fix keyboard navigation on series with different lengths (#23182) @JCQuintas
|
|
170
|
+
- [charts] Fix out of bounds keyboard navigation (#23180) @silviuaavram
|
|
171
|
+
|
|
172
|
+
#### `@mui/x-charts-pro@9.10.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
173
|
+
|
|
174
|
+
Same changes as in `@mui/x-charts@9.10.1`, plus:
|
|
175
|
+
|
|
176
|
+
- [charts-pro] Fix highlight shifting on sampled bar charts (#23190) @noraleonte
|
|
177
|
+
- [charts-pro] Sampled band highlight falls back to single-band width for Date/object values (#23024) @SamanPandey-in
|
|
178
|
+
|
|
179
|
+
#### `@mui/x-charts-premium@9.10.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
180
|
+
|
|
181
|
+
Same changes as in `@mui/x-charts-pro@9.10.1`.
|
|
182
|
+
|
|
183
|
+
### Tree View
|
|
184
|
+
|
|
185
|
+
#### `@mui/x-tree-view@9.10.1`
|
|
186
|
+
|
|
187
|
+
- [TreeView] Fix selection propagation to exclude disabled items (#23012) @michelengelen
|
|
188
|
+
|
|
189
|
+
#### `@mui/x-tree-view-pro@9.10.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
190
|
+
|
|
191
|
+
Same changes as in `@mui/x-tree-view@9.10.1`.
|
|
192
|
+
|
|
193
|
+
### Scheduler
|
|
194
|
+
|
|
195
|
+
#### `@mui/x-scheduler@9.0.0-beta.7`
|
|
196
|
+
|
|
197
|
+
- [scheduler] Polish `EventCalendar` rendering for multi-resource events (#23161) @mustafajw07
|
|
198
|
+
- [scheduler] Responsive header (#22954) @noraleonte
|
|
199
|
+
|
|
200
|
+
#### `@mui/x-scheduler-premium@9.0.0-beta.7` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
201
|
+
|
|
202
|
+
Same changes as in `@mui/x-scheduler@9.0.0-beta.7`, plus:
|
|
203
|
+
|
|
204
|
+
- [scheduler-premium] Add the dependencies data model (#23117) @rita-codes
|
|
205
|
+
- [scheduler-premium] Dependencies - Render the FS arrow (#23162) @rita-codes
|
|
206
|
+
|
|
207
|
+
### Codemod
|
|
208
|
+
|
|
209
|
+
#### `@mui/x-codemod@9.10.1`
|
|
210
|
+
|
|
211
|
+
Internal changes.
|
|
212
|
+
|
|
213
|
+
### Docs
|
|
214
|
+
|
|
215
|
+
- [docs] Fix clearing, layout shift, and prop leak in Pickers demos (#23191) @LukasTy
|
|
216
|
+
|
|
217
|
+
### Core
|
|
218
|
+
|
|
219
|
+
- [code-infra] Validate working of specific code-infra canary (#23207) @brijeshb42
|
|
220
|
+
|
|
221
|
+
### Miscellaneous
|
|
222
|
+
|
|
223
|
+
- [chat] Normalize message part link URLs (#23187) @hasdfa
|
|
224
|
+
- [x-chat] Fix object URL leaks for submitted attachments (#23198) @hasdfa
|
|
225
|
+
- [internals] Make disposable types self-contained without `esnext.disposable` lib (#23164) @JCQuintas
|
|
226
|
+
|
|
3
227
|
## 9.10.0
|
|
4
228
|
|
|
5
229
|
_Jul 17, 2026_
|
package/README.md
CHANGED
|
@@ -8,17 +8,7 @@ It's part of [MUI X](https://mui.com/x/), an open-core extension of our Core li
|
|
|
8
8
|
Install the package in your project directory with:
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
npm install @mui/x-tree-view
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
This component has the following peer dependencies that you need to install as well.
|
|
15
|
-
|
|
16
|
-
```json
|
|
17
|
-
"peerDependencies": {
|
|
18
|
-
"@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0",
|
|
19
|
-
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
20
|
-
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
21
|
-
},
|
|
11
|
+
npm install @mui/x-tree-view @mui/material @emotion/react @emotion/styled
|
|
22
12
|
```
|
|
23
13
|
|
|
24
14
|
## Documentation
|
|
@@ -143,10 +143,12 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes /* remove-proptyp
|
|
|
143
143
|
*/
|
|
144
144
|
apiRef: _propTypes.default.shape({
|
|
145
145
|
current: _propTypes.default.shape({
|
|
146
|
+
addItems: _propTypes.default.func,
|
|
146
147
|
focusItem: _propTypes.default.func,
|
|
147
148
|
getItem: _propTypes.default.func,
|
|
148
149
|
getItemDOMElement: _propTypes.default.func,
|
|
149
150
|
getItemOrderedChildrenIds: _propTypes.default.func,
|
|
151
|
+
getItemSelection: _propTypes.default.func,
|
|
150
152
|
getItemTree: _propTypes.default.func,
|
|
151
153
|
getParentId: _propTypes.default.func,
|
|
152
154
|
isItemExpanded: _propTypes.default.func,
|
|
@@ -136,10 +136,12 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes /* remove-proptyp
|
|
|
136
136
|
*/
|
|
137
137
|
apiRef: PropTypes.shape({
|
|
138
138
|
current: PropTypes.shape({
|
|
139
|
+
addItems: PropTypes.func,
|
|
139
140
|
focusItem: PropTypes.func,
|
|
140
141
|
getItem: PropTypes.func,
|
|
141
142
|
getItemDOMElement: PropTypes.func,
|
|
142
143
|
getItemOrderedChildrenIds: PropTypes.func,
|
|
144
|
+
getItemSelection: PropTypes.func,
|
|
143
145
|
getItemTree: PropTypes.func,
|
|
144
146
|
getParentId: PropTypes.func,
|
|
145
147
|
isItemExpanded: PropTypes.func,
|
|
@@ -127,6 +127,7 @@ process.env.NODE_ENV !== "production" ? SimpleTreeView.propTypes /* remove-propt
|
|
|
127
127
|
getItem: _propTypes.default.func,
|
|
128
128
|
getItemDOMElement: _propTypes.default.func,
|
|
129
129
|
getItemOrderedChildrenIds: _propTypes.default.func,
|
|
130
|
+
getItemSelection: _propTypes.default.func,
|
|
130
131
|
getItemTree: _propTypes.default.func,
|
|
131
132
|
getParentId: _propTypes.default.func,
|
|
132
133
|
isItemExpanded: _propTypes.default.func,
|
|
@@ -120,6 +120,7 @@ process.env.NODE_ENV !== "production" ? SimpleTreeView.propTypes /* remove-propt
|
|
|
120
120
|
getItem: PropTypes.func,
|
|
121
121
|
getItemDOMElement: PropTypes.func,
|
|
122
122
|
getItemOrderedChildrenIds: PropTypes.func,
|
|
123
|
+
getItemSelection: PropTypes.func,
|
|
123
124
|
getItemTree: PropTypes.func,
|
|
124
125
|
getParentId: PropTypes.func,
|
|
125
126
|
isItemExpanded: PropTypes.func,
|
|
@@ -90,6 +90,7 @@ process.env.NODE_ENV !== "production" ? TreeItemIcon.propTypes /* remove-proptyp
|
|
|
90
90
|
expandable: _propTypes.default.bool.isRequired,
|
|
91
91
|
expanded: _propTypes.default.bool.isRequired,
|
|
92
92
|
focused: _propTypes.default.bool.isRequired,
|
|
93
|
+
indeterminate: _propTypes.default.bool,
|
|
93
94
|
loading: _propTypes.default.bool.isRequired,
|
|
94
95
|
selected: _propTypes.default.bool.isRequired
|
|
95
96
|
}).isRequired
|
|
@@ -83,6 +83,7 @@ process.env.NODE_ENV !== "production" ? TreeItemIcon.propTypes /* remove-proptyp
|
|
|
83
83
|
expandable: PropTypes.bool.isRequired,
|
|
84
84
|
expanded: PropTypes.bool.isRequired,
|
|
85
85
|
focused: PropTypes.bool.isRequired,
|
|
86
|
+
indeterminate: PropTypes.bool,
|
|
86
87
|
loading: PropTypes.bool.isRequired,
|
|
87
88
|
selected: PropTypes.bool.isRequired
|
|
88
89
|
}).isRequired
|
|
@@ -35,6 +35,7 @@ const useTreeItemUtils = ({
|
|
|
35
35
|
const isExpanded = (0, _store.useStore)(store, _selectors.expansionSelectors.isItemExpanded, itemId);
|
|
36
36
|
const isFocused = (0, _store.useStore)(store, _selectors2.focusSelectors.isItemFocused, itemId);
|
|
37
37
|
const isSelected = (0, _store.useStore)(store, _selectors4.selectionSelectors.isItemSelected, itemId);
|
|
38
|
+
const isIndeterminate = (0, _store.useStore)(store, _selectors4.selectionSelectors.isItemIndeterminate, itemId);
|
|
38
39
|
const isDisabled = (0, _store.useStore)(store, _selectors3.itemsSelectors.isItemDisabled, itemId);
|
|
39
40
|
const isEditing = (0, _store.useStore)(store, _selectors6.labelSelectors.isItemBeingEdited, itemId);
|
|
40
41
|
const isEditable = (0, _store.useStore)(store, _selectors6.labelSelectors.isItemEditable, itemId);
|
|
@@ -43,6 +44,7 @@ const useTreeItemUtils = ({
|
|
|
43
44
|
expanded: isExpanded,
|
|
44
45
|
focused: isFocused,
|
|
45
46
|
selected: isSelected,
|
|
47
|
+
indeterminate: isIndeterminate,
|
|
46
48
|
disabled: isDisabled,
|
|
47
49
|
editing: isEditing,
|
|
48
50
|
editable: isEditable,
|
|
@@ -29,6 +29,7 @@ export const useTreeItemUtils = ({
|
|
|
29
29
|
const isExpanded = useStore(store, expansionSelectors.isItemExpanded, itemId);
|
|
30
30
|
const isFocused = useStore(store, focusSelectors.isItemFocused, itemId);
|
|
31
31
|
const isSelected = useStore(store, selectionSelectors.isItemSelected, itemId);
|
|
32
|
+
const isIndeterminate = useStore(store, selectionSelectors.isItemIndeterminate, itemId);
|
|
32
33
|
const isDisabled = useStore(store, itemsSelectors.isItemDisabled, itemId);
|
|
33
34
|
const isEditing = useStore(store, labelSelectors.isItemBeingEdited, itemId);
|
|
34
35
|
const isEditable = useStore(store, labelSelectors.isItemEditable, itemId);
|
|
@@ -37,6 +38,7 @@ export const useTreeItemUtils = ({
|
|
|
37
38
|
expanded: isExpanded,
|
|
38
39
|
focused: isFocused,
|
|
39
40
|
selected: isSelected,
|
|
41
|
+
indeterminate: isIndeterminate,
|
|
40
42
|
disabled: isDisabled,
|
|
41
43
|
editing: isEditing,
|
|
42
44
|
editable: isEditable,
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Store } from '@mui/x-internals/store';
|
|
2
|
-
import { disposeSymbol } from '@mui/x-internals/disposable';
|
|
2
|
+
import { DisposableStack, disposeSymbol } from '@mui/x-internals/disposable';
|
|
3
3
|
import type { MinimalTreeViewParameters, TreeViewParametersToStateMapper, MinimalTreeViewState } from "./MinimalTreeViewStore.types.mjs";
|
|
4
4
|
import type { TreeViewValidItem } from "../../models/index.mjs";
|
|
5
5
|
import { TimeoutManager } from "./TimeoutManager.mjs";
|
|
@@ -52,6 +52,7 @@ export declare class MinimalTreeViewStore<R extends TreeViewValidItem<R>, Multip
|
|
|
52
52
|
shouldBeExpanded?: boolean;
|
|
53
53
|
}) => void;
|
|
54
54
|
focusItem: (event: React.SyntheticEvent | null, itemId: import("../../index.mjs").TreeViewItemId) => void;
|
|
55
|
+
getItemSelection: (itemId: import("../../index.mjs").TreeViewItemId) => import("../../index.mjs").TreeViewItemSelectionStatus;
|
|
55
56
|
setItemSelection: ({
|
|
56
57
|
itemId,
|
|
57
58
|
event,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Store } from '@mui/x-internals/store';
|
|
2
|
-
import { disposeSymbol } from '@mui/x-internals/disposable';
|
|
2
|
+
import { DisposableStack, disposeSymbol } from '@mui/x-internals/disposable';
|
|
3
3
|
import type { MinimalTreeViewParameters, TreeViewParametersToStateMapper, MinimalTreeViewState } from "./MinimalTreeViewStore.types.js";
|
|
4
4
|
import type { TreeViewValidItem } from "../../models/index.js";
|
|
5
5
|
import { TimeoutManager } from "./TimeoutManager.js";
|
|
@@ -52,6 +52,7 @@ export declare class MinimalTreeViewStore<R extends TreeViewValidItem<R>, Multip
|
|
|
52
52
|
shouldBeExpanded?: boolean;
|
|
53
53
|
}) => void;
|
|
54
54
|
focusItem: (event: React.SyntheticEvent | null, itemId: import("../../index.js").TreeViewItemId) => void;
|
|
55
|
+
getItemSelection: (itemId: import("../../index.js").TreeViewItemId) => import("../../index.js").TreeViewItemSelectionStatus;
|
|
55
56
|
setItemSelection: ({
|
|
56
57
|
itemId,
|
|
57
58
|
event,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TreeViewValidItem } from "../../models/index.mjs";
|
|
2
|
-
import { TreeViewLabelEditingPlugin } from "../plugins/labelEditing/index.mjs";
|
|
3
2
|
import { MinimalTreeViewStore } from "../MinimalTreeViewStore/index.mjs";
|
|
4
|
-
import
|
|
3
|
+
import { TreeViewLabelEditingPlugin } from "../plugins/labelEditing/index.mjs";
|
|
4
|
+
import type { RichTreeViewState, RichTreeViewStoreParameters } from "./RichTreeViewStore.types.mjs";
|
|
5
5
|
export declare class ExtendableRichTreeViewStore<R extends TreeViewValidItem<R>, Multiple extends boolean | undefined, State extends RichTreeViewState<R, Multiple> = RichTreeViewState<R, Multiple>, Parameters extends RichTreeViewStoreParameters<R, Multiple> = RichTreeViewStoreParameters<R, Multiple>> extends MinimalTreeViewStore<R, Multiple, State, Parameters> {
|
|
6
6
|
labelEditing: TreeViewLabelEditingPlugin;
|
|
7
7
|
/**
|
|
@@ -24,6 +24,11 @@ export declare class ExtendableRichTreeViewStore<R extends TreeViewValidItem<R>,
|
|
|
24
24
|
itemId: import("../../index.mjs").TreeViewItemId;
|
|
25
25
|
shouldBeDisabled?: boolean;
|
|
26
26
|
}) => void;
|
|
27
|
+
addItems: ({
|
|
28
|
+
items,
|
|
29
|
+
parentId,
|
|
30
|
+
index
|
|
31
|
+
}: import("../plugins/items/index.mjs").AddItemsParameters<R>) => void;
|
|
27
32
|
isItemExpanded: (itemId: import("../../index.mjs").TreeViewItemId) => boolean;
|
|
28
33
|
setItemExpansion: ({
|
|
29
34
|
itemId,
|
|
@@ -35,6 +40,7 @@ export declare class ExtendableRichTreeViewStore<R extends TreeViewValidItem<R>,
|
|
|
35
40
|
shouldBeExpanded?: boolean;
|
|
36
41
|
}) => void;
|
|
37
42
|
focusItem: (event: React.SyntheticEvent | null, itemId: import("../../index.mjs").TreeViewItemId) => void;
|
|
43
|
+
getItemSelection: (itemId: import("../../index.mjs").TreeViewItemId) => import("../../index.mjs").TreeViewItemSelectionStatus;
|
|
38
44
|
setItemSelection: ({
|
|
39
45
|
itemId,
|
|
40
46
|
event,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TreeViewValidItem } from "../../models/index.js";
|
|
2
|
-
import { TreeViewLabelEditingPlugin } from "../plugins/labelEditing/index.js";
|
|
3
2
|
import { MinimalTreeViewStore } from "../MinimalTreeViewStore/index.js";
|
|
4
|
-
import
|
|
3
|
+
import { TreeViewLabelEditingPlugin } from "../plugins/labelEditing/index.js";
|
|
4
|
+
import type { RichTreeViewState, RichTreeViewStoreParameters } from "./RichTreeViewStore.types.js";
|
|
5
5
|
export declare class ExtendableRichTreeViewStore<R extends TreeViewValidItem<R>, Multiple extends boolean | undefined, State extends RichTreeViewState<R, Multiple> = RichTreeViewState<R, Multiple>, Parameters extends RichTreeViewStoreParameters<R, Multiple> = RichTreeViewStoreParameters<R, Multiple>> extends MinimalTreeViewStore<R, Multiple, State, Parameters> {
|
|
6
6
|
labelEditing: TreeViewLabelEditingPlugin;
|
|
7
7
|
/**
|
|
@@ -24,6 +24,11 @@ export declare class ExtendableRichTreeViewStore<R extends TreeViewValidItem<R>,
|
|
|
24
24
|
itemId: import("../../index.js").TreeViewItemId;
|
|
25
25
|
shouldBeDisabled?: boolean;
|
|
26
26
|
}) => void;
|
|
27
|
+
addItems: ({
|
|
28
|
+
items,
|
|
29
|
+
parentId,
|
|
30
|
+
index
|
|
31
|
+
}: import("../plugins/items/index.js").AddItemsParameters<R>) => void;
|
|
27
32
|
isItemExpanded: (itemId: import("../../index.js").TreeViewItemId) => boolean;
|
|
28
33
|
setItemExpansion: ({
|
|
29
34
|
itemId,
|
|
@@ -35,6 +40,7 @@ export declare class ExtendableRichTreeViewStore<R extends TreeViewValidItem<R>,
|
|
|
35
40
|
shouldBeExpanded?: boolean;
|
|
36
41
|
}) => void;
|
|
37
42
|
focusItem: (event: React.SyntheticEvent | null, itemId: import("../../index.js").TreeViewItemId) => void;
|
|
43
|
+
getItemSelection: (itemId: import("../../index.js").TreeViewItemId) => import("../../index.js").TreeViewItemSelectionStatus;
|
|
38
44
|
setItemSelection: ({
|
|
39
45
|
itemId,
|
|
40
46
|
event,
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.RichTreeViewStore = exports.ExtendableRichTreeViewStore = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _labelEditing = require("../plugins/labelEditing");
|
|
10
9
|
var _MinimalTreeViewStore = require("../MinimalTreeViewStore");
|
|
10
|
+
var _labelEditing = require("../plugins/labelEditing");
|
|
11
11
|
var _RichTreeViewStore = require("./RichTreeViewStore.utils");
|
|
12
12
|
class ExtendableRichTreeViewStore extends _MinimalTreeViewStore.MinimalTreeViewStore {
|
|
13
13
|
labelEditing = new _labelEditing.TreeViewLabelEditingPlugin(this);
|
|
@@ -18,7 +18,10 @@ class ExtendableRichTreeViewStore extends _MinimalTreeViewStore.MinimalTreeViewS
|
|
|
18
18
|
*/
|
|
19
19
|
static rawMapper = _RichTreeViewStore.parametersToStateMapper;
|
|
20
20
|
buildPublicAPI() {
|
|
21
|
-
return (0, _extends2.default)({}, super.buildPublicAPI(), this.labelEditing.buildPublicAPI()
|
|
21
|
+
return (0, _extends2.default)({}, super.buildPublicAPI(), this.labelEditing.buildPublicAPI(), {
|
|
22
|
+
// `addItems` is not exposed on the Simple Tree View, where the items are defined with JSX.
|
|
23
|
+
addItems: this.items.addItems
|
|
24
|
+
});
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
exports.ExtendableRichTreeViewStore = ExtendableRichTreeViewStore;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { TreeViewLabelEditingPlugin } from "../plugins/labelEditing/index.mjs";
|
|
3
2
|
import { MinimalTreeViewStore } from "../MinimalTreeViewStore/index.mjs";
|
|
3
|
+
import { TreeViewLabelEditingPlugin } from "../plugins/labelEditing/index.mjs";
|
|
4
4
|
import { parametersToStateMapper } from "./RichTreeViewStore.utils.mjs";
|
|
5
5
|
export class ExtendableRichTreeViewStore extends MinimalTreeViewStore {
|
|
6
6
|
labelEditing = new TreeViewLabelEditingPlugin(this);
|
|
@@ -11,7 +11,10 @@ export class ExtendableRichTreeViewStore extends MinimalTreeViewStore {
|
|
|
11
11
|
*/
|
|
12
12
|
static rawMapper = parametersToStateMapper;
|
|
13
13
|
buildPublicAPI() {
|
|
14
|
-
return _extends({}, super.buildPublicAPI(), this.labelEditing.buildPublicAPI()
|
|
14
|
+
return _extends({}, super.buildPublicAPI(), this.labelEditing.buildPublicAPI(), {
|
|
15
|
+
// `addItems` is not exposed on the Simple Tree View, where the items are defined with JSX.
|
|
16
|
+
addItems: this.items.addItems
|
|
17
|
+
});
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
export class RichTreeViewStore extends ExtendableRichTreeViewStore {
|
|
@@ -58,6 +58,16 @@ export declare class TreeViewItemsPlugin<R extends TreeViewValidItem<R>> {
|
|
|
58
58
|
* @param {boolean } parameters.shouldBeDisabled true if the item should be disabled.
|
|
59
59
|
*/
|
|
60
60
|
private setIsItemDisabled;
|
|
61
|
+
/**
|
|
62
|
+
* Add items to the tree.
|
|
63
|
+
* The items are added as children of the item with the given `parentId`, or at the root level if `parentId` is `null` or not defined.
|
|
64
|
+
* @param {AddItemsParameters<R>} parameters The items to add and their position in the tree.
|
|
65
|
+
*/
|
|
66
|
+
addItems: ({
|
|
67
|
+
items,
|
|
68
|
+
parentId,
|
|
69
|
+
index
|
|
70
|
+
}: AddItemsParameters<R>) => void;
|
|
61
71
|
buildPublicAPI: () => {
|
|
62
72
|
getItem: (itemId: TreeViewItemId) => R;
|
|
63
73
|
getItemDOMElement: (itemId: TreeViewItemId) => HTMLElement | null;
|
|
@@ -102,4 +112,21 @@ export declare class TreeViewItemsPlugin<R extends TreeViewValidItem<R>> {
|
|
|
102
112
|
* @param {TreeViewItemId} itemId The id of the item being clicked.
|
|
103
113
|
*/
|
|
104
114
|
handleItemClick: (event: React.MouseEvent, itemId: TreeViewItemId) => void;
|
|
115
|
+
}
|
|
116
|
+
export interface AddItemsParameters<R extends TreeViewValidItem<R>> {
|
|
117
|
+
/**
|
|
118
|
+
* The items to add to the tree.
|
|
119
|
+
*/
|
|
120
|
+
items: readonly R[];
|
|
121
|
+
/**
|
|
122
|
+
* The id of the item to add the items to.
|
|
123
|
+
* If `null` or not defined, the items are added at the root level.
|
|
124
|
+
* @default null
|
|
125
|
+
*/
|
|
126
|
+
parentId?: TreeViewItemId | null;
|
|
127
|
+
/**
|
|
128
|
+
* The position in the parent's children at which the items are inserted.
|
|
129
|
+
* If not defined, the items are appended after the existing children.
|
|
130
|
+
*/
|
|
131
|
+
index?: number;
|
|
105
132
|
}
|
|
@@ -58,6 +58,16 @@ export declare class TreeViewItemsPlugin<R extends TreeViewValidItem<R>> {
|
|
|
58
58
|
* @param {boolean } parameters.shouldBeDisabled true if the item should be disabled.
|
|
59
59
|
*/
|
|
60
60
|
private setIsItemDisabled;
|
|
61
|
+
/**
|
|
62
|
+
* Add items to the tree.
|
|
63
|
+
* The items are added as children of the item with the given `parentId`, or at the root level if `parentId` is `null` or not defined.
|
|
64
|
+
* @param {AddItemsParameters<R>} parameters The items to add and their position in the tree.
|
|
65
|
+
*/
|
|
66
|
+
addItems: ({
|
|
67
|
+
items,
|
|
68
|
+
parentId,
|
|
69
|
+
index
|
|
70
|
+
}: AddItemsParameters<R>) => void;
|
|
61
71
|
buildPublicAPI: () => {
|
|
62
72
|
getItem: (itemId: TreeViewItemId) => R;
|
|
63
73
|
getItemDOMElement: (itemId: TreeViewItemId) => HTMLElement | null;
|
|
@@ -102,4 +112,21 @@ export declare class TreeViewItemsPlugin<R extends TreeViewValidItem<R>> {
|
|
|
102
112
|
* @param {TreeViewItemId} itemId The id of the item being clicked.
|
|
103
113
|
*/
|
|
104
114
|
handleItemClick: (event: React.MouseEvent, itemId: TreeViewItemId) => void;
|
|
115
|
+
}
|
|
116
|
+
export interface AddItemsParameters<R extends TreeViewValidItem<R>> {
|
|
117
|
+
/**
|
|
118
|
+
* The items to add to the tree.
|
|
119
|
+
*/
|
|
120
|
+
items: readonly R[];
|
|
121
|
+
/**
|
|
122
|
+
* The id of the item to add the items to.
|
|
123
|
+
* If `null` or not defined, the items are added at the root level.
|
|
124
|
+
* @default null
|
|
125
|
+
*/
|
|
126
|
+
parentId?: TreeViewItemId | null;
|
|
127
|
+
/**
|
|
128
|
+
* The position in the parent's children at which the items are inserted.
|
|
129
|
+
* If not defined, the items are appended after the existing children.
|
|
130
|
+
*/
|
|
131
|
+
index?: number;
|
|
105
132
|
}
|