@mui/x-tree-view 9.10.1 → 9.12.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 +283 -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 +1 -0
- package/internals/MinimalTreeViewStore/MinimalTreeViewStore.d.ts +1 -0
- 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 +50 -10
- package/internals/plugins/selection/TreeViewSelectionPlugin.mjs +50 -10
- package/internals/plugins/selection/itemPlugin.js +3 -37
- package/internals/plugins/selection/itemPlugin.mjs +4 -38
- 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,288 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.12.0
|
|
4
|
+
|
|
5
|
+
_Aug 21, 2026_
|
|
6
|
+
|
|
7
|
+
We'd like to extend a big thank you to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
8
|
+
|
|
9
|
+
- 🧮 Support [Formulas](https://mui.com/x/react-data-grid/formulas/) on the Data Grid: cells in opted-in columns can hold spreadsheet-like formulas (`=SUM(RANGE(…))`, `=price * quantity`) evaluated by a built-in engine, with a formula editor and [Formula Bar](https://mui.com/x/react-data-grid/components/formula-bar/), autocomplete, reference highlighting, optional A1 notation, fill-handle reference adjustment, custom functions, and live formula Excel export
|
|
10
|
+
- ♿️ Improve the accessibility of Data Grid cells and picker day cells
|
|
11
|
+
- 🗓️ Enable multi-resource event creation and editing in the Scheduler
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
- 📚 Documentation improvements
|
|
14
|
+
|
|
15
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
16
|
+
@Anexus5919, @mustafajw07
|
|
17
|
+
|
|
18
|
+
The following team members contributed to this release:
|
|
19
|
+
@brijeshb42, @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @michelengelen, @noraleonte, @rita-codes, @romgrk, @silviuaavram
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@9.12.0`
|
|
24
|
+
|
|
25
|
+
- [DataGrid] Expose `apiRef` on `GridCallbackDetails` for selector access in callbacks (#22973) @michelengelen
|
|
26
|
+
- [DataGrid] Fix header height not updating when `headerFilters` or `columnGroupingModel` change (#23059) @MBilalShafi
|
|
27
|
+
- [DataGrid] Fix unhandled rejection when unmounting mid-autosize (#23319) @JCQuintas
|
|
28
|
+
- [DataGrid] Label the blank `singleSelect` filter option (#23294) @JCQuintas
|
|
29
|
+
- [DataGrid] Stop sending incomplete filter items to the data source (#23303) @JCQuintas
|
|
30
|
+
- [DataGrid] Support the `rowheader` attribute for grid cells (#23340) @silviuaavram
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-pro@9.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid@9.12.0`, plus:
|
|
35
|
+
|
|
36
|
+
- [DataGridPro] Honor `hasNextPage` in infinite lazy loading (#23048) @MBilalShafi
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-premium@9.12.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid-pro@9.12.0`, plus:
|
|
41
|
+
|
|
42
|
+
- [DataGridPremium] Formula support (#22807) @MBilalShafi
|
|
43
|
+
|
|
44
|
+
### Date and Time Pickers
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers@9.12.0`
|
|
47
|
+
|
|
48
|
+
- [fields] Keep the selected section on blank space clicks (#23318) @LukasTy
|
|
49
|
+
- [pickers] Associate the day cells with their week day column header (#23339) @LukasTy
|
|
50
|
+
- [pickers] Keep the `gridcell` role and the column index on filler cells (#23326) @Anexus5919
|
|
51
|
+
|
|
52
|
+
#### `@mui/x-date-pickers-pro@9.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
53
|
+
|
|
54
|
+
Same changes as in `@mui/x-date-pickers@9.12.0`, plus:
|
|
55
|
+
|
|
56
|
+
- [DateRangeCalendar] Round the range highlight at the month grid edges (#23297) @JCQuintas
|
|
57
|
+
- [DateRangePicker] Keep the range highlight opaque for disabled days (#23317) @JCQuintas
|
|
58
|
+
|
|
59
|
+
### Charts
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-charts@9.12.0`
|
|
62
|
+
|
|
63
|
+
- [charts] Add a demo for label on grid row (#23333) @noraleonte
|
|
64
|
+
- [charts] Fix React 18 `propTypes` warnings and stray-pointer test flakiness (#23384) @LukasTy
|
|
65
|
+
- [charts] Focus the clicked item for keyboard navigation (#23247) @JCQuintas
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts-pro@9.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
68
|
+
|
|
69
|
+
Same changes as in `@mui/x-charts@9.12.0`.
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-charts-premium@9.12.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-charts-pro@9.12.0`, plus:
|
|
74
|
+
|
|
75
|
+
- [charts-premium] Add `onItemClick` to the radial charts (#23253) @JCQuintas
|
|
76
|
+
|
|
77
|
+
### Tree View
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-tree-view@9.12.0`
|
|
80
|
+
|
|
81
|
+
Internal changes.
|
|
82
|
+
|
|
83
|
+
#### `@mui/x-tree-view-pro@9.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
84
|
+
|
|
85
|
+
Same changes as in `@mui/x-tree-view@9.12.0`.
|
|
86
|
+
|
|
87
|
+
### Scheduler
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-scheduler@9.0.0-beta.10`
|
|
90
|
+
|
|
91
|
+
- [scheduler] Add `onEventEditingStart` to let consumers open their own edit UI (#23361) @rita-codes
|
|
92
|
+
- [scheduler] Fix keyboard and focus issues around the "+N more" popover (#23312) @rita-codes
|
|
93
|
+
- [scheduler] Honor `viewConfig` hour limits in the compact day and week views (#23316) @rita-codes
|
|
94
|
+
- [scheduler] Share timeline event layout data (#23366) @flaviendelangle
|
|
95
|
+
- [scheduler] enable multi-resource event creation and editing (#23313) @mustafajw07
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-scheduler-premium@9.0.0-beta.10` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
98
|
+
|
|
99
|
+
Same changes as in `@mui/x-scheduler@9.0.0-beta.10`, plus:
|
|
100
|
+
|
|
101
|
+
- [scheduler-premium] Allow to control the min and max hour in the Event Timeline (#23212) @rita-codes
|
|
102
|
+
- [scheduler-premium] Dependencies - Create, select and delete via terminals (#23200) @rita-codes
|
|
103
|
+
|
|
104
|
+
### Codemod
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-codemod@9.12.0`
|
|
107
|
+
|
|
108
|
+
Internal changes.
|
|
109
|
+
|
|
110
|
+
### Docs
|
|
111
|
+
|
|
112
|
+
- [docs][charts] Document line mark size customization (#23370) @JCQuintas
|
|
113
|
+
- [docs] Add recipe for constraining the `make-child` drop action by item type (#22940) @michelengelen
|
|
114
|
+
- [docs] Redirect the renamed Event Timeline views page (#23324) @brijeshb42
|
|
115
|
+
- [docs] Remove unused `adapter-dependencies.json` (#23328) @LukasTy
|
|
116
|
+
|
|
117
|
+
### Core
|
|
118
|
+
|
|
119
|
+
- [code-infra] Add release skill (#23308) @brijeshb42
|
|
120
|
+
- [code-infra] Fix changelog categorization of docs and `DateRangeCalendar` tags (#23385) @JCQuintas
|
|
121
|
+
- [code-infra] Sync mui-release skill (#23330) @brijeshb42
|
|
122
|
+
|
|
123
|
+
### Miscellaneous
|
|
124
|
+
|
|
125
|
+
- [core] Declare the missing `react-dom` peer dependencies (#23381) @LukasTy
|
|
126
|
+
- [test] Fix act warnings in the data source filter tests (#23360) @JCQuintas
|
|
127
|
+
- [virtualizer] Add inverse-sticky layout (#23053) @romgrk
|
|
128
|
+
|
|
129
|
+
## 9.11.1
|
|
130
|
+
|
|
131
|
+
_Aug 6, 2026_
|
|
132
|
+
|
|
133
|
+
We'd like to extend a big thank you to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
134
|
+
|
|
135
|
+
- 🐛 Fix the empty `@mui/x-charts-vendor` package published in v9.11.0
|
|
136
|
+
|
|
137
|
+
The following team members contributed to this release:
|
|
138
|
+
@JCQuintas, @rita-codes
|
|
139
|
+
|
|
140
|
+
### Charts
|
|
141
|
+
|
|
142
|
+
#### `@mui/x-charts@9.11.1`
|
|
143
|
+
|
|
144
|
+
- [charts] Fix empty `@mui/x-charts-vendor` published package (#23310) @JCQuintas
|
|
145
|
+
|
|
146
|
+
#### `@mui/x-charts-pro@9.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
147
|
+
|
|
148
|
+
Same changes as in `@mui/x-charts@9.11.1`.
|
|
149
|
+
|
|
150
|
+
#### `@mui/x-charts-premium@9.11.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
151
|
+
|
|
152
|
+
Same changes as in `@mui/x-charts-pro@9.11.1`.
|
|
153
|
+
|
|
154
|
+
#### `@mui/x-charts-vendor@9.11.1`
|
|
155
|
+
|
|
156
|
+
- [charts] Fix empty `@mui/x-charts-vendor` published package (#23310) @JCQuintas
|
|
157
|
+
|
|
158
|
+
### Scheduler
|
|
159
|
+
|
|
160
|
+
#### `@mui/x-scheduler@9.0.0-beta.9`
|
|
161
|
+
|
|
162
|
+
- [scheduler] Show the range validation errors on the End date and End time fields (#23291) @rita-codes
|
|
163
|
+
|
|
164
|
+
#### `@mui/x-scheduler-premium@9.0.0-beta.9` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
165
|
+
|
|
166
|
+
Same changes as in `@mui/x-scheduler@9.0.0-beta.9`.
|
|
167
|
+
|
|
168
|
+
## 9.11.0
|
|
169
|
+
|
|
170
|
+
_Aug 6, 2026_
|
|
171
|
+
|
|
172
|
+
We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
173
|
+
|
|
174
|
+
- ✨ Add `addItems()` and `getItemSelection()` API methods to Tree View
|
|
175
|
+
|
|
176
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
177
|
+
@12joan, @Anexus5919, @kevincorizi-sbt, @mixelburg, @mustafajw07, @strazto
|
|
178
|
+
|
|
179
|
+
The following team members contributed to this release:
|
|
180
|
+
@flaviendelangle, @hasdfa, @JCQuintas, @LukasTy, @MBilalShafi, @michelengelen, @noraleonte, @rita-codes
|
|
181
|
+
|
|
182
|
+
### Data Grid
|
|
183
|
+
|
|
184
|
+
#### `@mui/x-data-grid@9.11.0`
|
|
185
|
+
|
|
186
|
+
- [DataGrid] Fix `updateRows` stripping class prototypes from rows in datasource mode (#22288) @mixelburg
|
|
187
|
+
- [DataGrid] Do not re-fetch data when an `Activity` becomes visible (#22603) @12joan
|
|
188
|
+
- [DataGrid] Fix toolbar button stealing focus when a sibling's disabled state changes (#23204) @MBilalShafi
|
|
189
|
+
|
|
190
|
+
#### `@mui/x-data-grid-pro@9.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
191
|
+
|
|
192
|
+
Same changes as in `@mui/x-data-grid@9.11.0`.
|
|
193
|
+
|
|
194
|
+
#### `@mui/x-data-grid-premium@9.11.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
195
|
+
|
|
196
|
+
Same changes as in `@mui/x-data-grid-pro@9.11.0`.
|
|
197
|
+
|
|
198
|
+
### Date and Time Pickers
|
|
199
|
+
|
|
200
|
+
#### `@mui/x-date-pickers@9.11.0`
|
|
201
|
+
|
|
202
|
+
- [pickers] Fix day shift when editing dates predating timezone standardization (#23296) @JCQuintas
|
|
203
|
+
|
|
204
|
+
#### `@mui/x-date-pickers-pro@9.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
205
|
+
|
|
206
|
+
Same changes as in `@mui/x-date-pickers@9.11.0`, plus:
|
|
207
|
+
|
|
208
|
+
- [DateRangePicker] Fix disabled filler cells showing the range highlight (#23293) @JCQuintas
|
|
209
|
+
|
|
210
|
+
### Charts
|
|
211
|
+
|
|
212
|
+
#### `@mui/x-charts@9.11.0`
|
|
213
|
+
|
|
214
|
+
- [charts] Activate the focused item with `Enter`/`Space` (#23218) @JCQuintas
|
|
215
|
+
- [charts] Extract the axis click payload builders (#23215) @JCQuintas
|
|
216
|
+
- [charts] Fix `GestureManager` event listener leak on chart unmount (#23283) @kevincorizi-sbt
|
|
217
|
+
- [charts] Fix `slotProps.legend.position` and `direction` in `RadarChart` (#23254) @JCQuintas
|
|
218
|
+
- [charts] Fix axis clicks being discarded on slight pointer movement (#23244) @noraleonte
|
|
219
|
+
- [charts] Fix image export of charts sized by their parent element (#23255) @JCQuintas
|
|
220
|
+
- [charts] Forward `experimentalFeatures` on `RadarChart` and `Heatmap` (#23216) @JCQuintas
|
|
221
|
+
- [charts] Hide focus indicator when the chart loses focus (#23213) @JCQuintas
|
|
222
|
+
|
|
223
|
+
#### `@mui/x-charts-pro@9.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
224
|
+
|
|
225
|
+
Same changes as in `@mui/x-charts@9.11.0`.
|
|
226
|
+
|
|
227
|
+
#### `@mui/x-charts-premium@9.11.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
228
|
+
|
|
229
|
+
Same changes as in `@mui/x-charts-pro@9.11.0`, plus:
|
|
230
|
+
|
|
231
|
+
- [charts-premium] Fix `RangeBar` type override (#23217) @JCQuintas
|
|
232
|
+
|
|
233
|
+
### Tree View
|
|
234
|
+
|
|
235
|
+
#### `@mui/x-tree-view@9.11.0`
|
|
236
|
+
|
|
237
|
+
- [tree view] Add `addItems()` API method (#23159) @JCQuintas
|
|
238
|
+
- [tree view] Add `getItemSelection` API method (#23257) @noraleonte
|
|
239
|
+
- [tree view] Ignore `keepExistingSelection` when `multiSelect` is `false` (#23242) @JCQuintas
|
|
240
|
+
- [tree view] Prevent duplicate ids in multi-select arrow navigation (#23006) @Anexus5919
|
|
241
|
+
|
|
242
|
+
#### `@mui/x-tree-view-pro@9.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
243
|
+
|
|
244
|
+
Same changes as in `@mui/x-tree-view@9.11.0`, plus:
|
|
245
|
+
|
|
246
|
+
- [tree view] Discard superseded lazy-loading responses (#23005) @Anexus5919
|
|
247
|
+
|
|
248
|
+
### Scheduler
|
|
249
|
+
|
|
250
|
+
#### `@mui/x-scheduler@9.0.0-beta.8`
|
|
251
|
+
|
|
252
|
+
- [scheduler] Add `localeText` prop to standalone views (#23210) @rita-codes
|
|
253
|
+
- [scheduler] Finetune touch experience for time grid events and introduce editing drawer (#22624) @noraleonte
|
|
254
|
+
- [scheduler] Introduce the edit dialog form context & lifecycle contract (#23284) @rita-codes
|
|
255
|
+
- [scheduler] Refactor edit dialog General tab into section components (#23206) @rita-codes
|
|
256
|
+
- [scheduler] Replace copied Base UI internals with `@base-ui/react/internals` imports (#21972) @flaviendelangle
|
|
257
|
+
- [scheduler] Hide resource picker when no resources are provided (#23290) @mustafajw07
|
|
258
|
+
- [scheduler] Support multi-resource occurrences in `EventTimeline` (#23240) @mustafajw07
|
|
259
|
+
|
|
260
|
+
#### `@mui/x-scheduler-premium@9.0.0-beta.8` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
261
|
+
|
|
262
|
+
Same changes as in `@mui/x-scheduler@9.0.0-beta.8`.
|
|
263
|
+
|
|
264
|
+
### Codemod
|
|
265
|
+
|
|
266
|
+
#### `@mui/x-codemod@9.11.0`
|
|
267
|
+
|
|
268
|
+
- [codemod] Remove unused `@babel/core` and `@babel/traverse` dependencies (#23245) @LukasTy
|
|
269
|
+
|
|
270
|
+
### Docs
|
|
271
|
+
|
|
272
|
+
- [docs] Add recipe for adding new rows from clipboard copy (#22913) @michelengelen
|
|
273
|
+
- [docs] Clarify the package versions in v8 upgrade guides (#22376) @strazto
|
|
274
|
+
- [docs] Replace README peer dependency lists with an npm install command (#23256) @LukasTy
|
|
275
|
+
|
|
276
|
+
### Core
|
|
277
|
+
|
|
278
|
+
- [code-infra] Align action pin version comments (#23238) @LukasTy
|
|
279
|
+
|
|
280
|
+
### Miscellaneous
|
|
281
|
+
|
|
282
|
+
- [chat] Drop the undeclared `@mui/icons-material` dependency (#23252) @LukasTy
|
|
283
|
+
- [chat] Sanitize image part URLs and share the URL allow-list with markdown (#23058) @hasdfa
|
|
284
|
+
- [test] Type the `PickersTextField` test stub instead of `as any` (#23194) @LukasTy
|
|
285
|
+
|
|
3
286
|
## 9.10.1
|
|
4
287
|
|
|
5
288
|
_Jul 23, 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
|
@@ -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,
|
|
@@ -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
|
}
|