@mui/x-tree-view-pro 9.0.0-alpha.4 → 9.0.0-rc.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 +262 -2
- package/RichTreeViewPro/RichTreeViewPro.js +11 -2
- package/RichTreeViewPro/RichTreeViewPro.mjs +11 -2
- package/RichTreeViewPro/useExtractRichTreeViewProParameters.d.mts +11 -11
- package/RichTreeViewPro/useExtractRichTreeViewProParameters.d.ts +11 -11
- package/RichTreeViewPro/useExtractRichTreeViewProParameters.js +4 -2
- package/RichTreeViewPro/useExtractRichTreeViewProParameters.mjs +4 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/RichTreeViewProStore/RichTreeViewProStore.d.mts +2 -1
- package/internals/RichTreeViewProStore/RichTreeViewProStore.d.ts +2 -1
- package/internals/RichTreeViewProStore/RichTreeViewProStore.js +4 -0
- package/internals/RichTreeViewProStore/RichTreeViewProStore.mjs +5 -1
- package/internals/RichTreeViewProStore/RichTreeViewProStore.types.d.mts +14 -1
- package/internals/RichTreeViewProStore/RichTreeViewProStore.types.d.ts +14 -1
- package/internals/plugins/lazyLoading/TreeViewLazyLoadingPlugin.d.mts +15 -3
- package/internals/plugins/lazyLoading/TreeViewLazyLoadingPlugin.d.ts +15 -3
- package/internals/plugins/lazyLoading/TreeViewLazyLoadingPlugin.js +56 -1
- package/internals/plugins/lazyLoading/TreeViewLazyLoadingPlugin.mjs +57 -2
- package/internals/plugins/lazyLoading/utils.d.mts +2 -2
- package/internals/plugins/lazyLoading/utils.d.ts +2 -2
- package/internals/plugins/lazyLoading/utils.mjs +3 -3
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,265 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.0.0-rc.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v9.0.0-beta.0..master -->
|
|
6
|
+
|
|
7
|
+
_Apr 7, 2026_
|
|
8
|
+
|
|
9
|
+
We'd like to extend a big thank you to the 18 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
12
|
+
@mixelburg, @sibananda485, @youjin-hong
|
|
13
|
+
|
|
14
|
+
The following team members contributed to this release:
|
|
15
|
+
@aemartos, @alexfauquette, @arminmeh, @brijeshb42, @flaviendelangle, @JCQuintas, @LukasTy, @mapache-salvaje, @MBilalShafi, @michelengelen, @noraleonte, @rita-codes, @romgrk, @siriwatknp, @ZeeshanTamboli
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### `@mui/x-data-grid@9.0.0-rc.0`
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Rename filter panel `Columns` label to singular `Column` (#21935) @youjin-hong
|
|
22
|
+
- [DataGrid] Export `GridColumnUnsortedIconProps` for custom column icon slots (#21658) @mixelburg
|
|
23
|
+
- [DataGrid] Remove `x-virtualizer`'s `virtualScroller` from public API (#21936) @romgrk
|
|
24
|
+
- [DataGrid][virtualizer] Scrolling without render gaps (#21616) @romgrk
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@9.0.0-rc.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@9.0.0-rc.0`, plus:
|
|
29
|
+
|
|
30
|
+
- [DataGridPro] Improve trigger for nested row reordering (#21642) @MBilalShafi
|
|
31
|
+
- [DataGridPro] Undeprecate `onRowsScrollEnd` prop (#21912) @MBilalShafi
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-premium@9.0.0-rc.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid-pro@9.0.0-rc.0`, plus:
|
|
36
|
+
|
|
37
|
+
- [DataGridPremium] Fix clipboard paste issue in portal (#21931) @sibananda485
|
|
38
|
+
|
|
39
|
+
### Date and Time Pickers
|
|
40
|
+
|
|
41
|
+
#### Breaking changes
|
|
42
|
+
|
|
43
|
+
- Accessible DOM structure is now the only default. [Read more](https://next.mui.com/x/migration/migration-pickers-v8/#accessible-dom-structure-is-now-the-default)
|
|
44
|
+
- The `PickerDay2` and `DateRangePickerDay2` components were propagated to stable while removing the previous defaults. [Read more](https://next.mui.com/x/migration/migration-pickers-v8/#day-slot)
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers@9.0.0-rc.0`
|
|
47
|
+
|
|
48
|
+
- [pickers] Remove `PickersDay` and `DateRangePickerDay` and promote their `2` versions as replacements (#21739) @michelengelen
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-date-pickers-pro@9.0.0-rc.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
51
|
+
|
|
52
|
+
Same changes as in `@mui/x-date-pickers@9.0.0-rc.0`.
|
|
53
|
+
|
|
54
|
+
### Charts
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-charts@9.0.0-rc.0.0`
|
|
57
|
+
|
|
58
|
+
- [charts] Make line visibility toggle start from the baseline (#21893) @alexfauquette
|
|
59
|
+
- [charts] Remove the container overflow (#21955) @alexfauquette
|
|
60
|
+
- [charts] Revert `theme.alpha` for non-channel token (#21965) @siriwatknp
|
|
61
|
+
|
|
62
|
+
#### `@mui/x-charts-pro@9.0.0-rc.0.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
63
|
+
|
|
64
|
+
Same changes as in `@mui/x-charts@9.0.0-rc.0.0`, plus:
|
|
65
|
+
|
|
66
|
+
- [charts-pro] Zoom slider touch improvements (#21832) @JCQuintas
|
|
67
|
+
- [charts-pro] Add `seriesIds` filter to zoom slider preview (#21933) @JCQuintas
|
|
68
|
+
- [charts-pro] Fix zoom slider preview with discard filter mode (#21883) @JCQuintas
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-charts-premium@9.0.0-rc.0.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
71
|
+
|
|
72
|
+
Same changes as in `@mui/x-charts-pro@9.0.0-rc.0.0`, plus:
|
|
73
|
+
|
|
74
|
+
- [charts-premium] Add series `valueFormatter` to candlestick chart (#21905) @JCQuintas
|
|
75
|
+
- [charts-premium] Add zoom slider preview support for candlestick charts (#21914) @JCQuintas
|
|
76
|
+
- [charts-premium] Allow color customization in `Candlestick` chart (#21838) @JCQuintas
|
|
77
|
+
- [charts-premium] Support hide/show for OHLC (candlestick) series (#21807) @Copilot
|
|
78
|
+
- [charts-premium] Add `dataset` support to `Candlestick` chart (#21872) @JCQuintas
|
|
79
|
+
- [charts-premium] Add candlestick page to sidebar navigation (#21834) @JCQuintas
|
|
80
|
+
|
|
81
|
+
### Tree View
|
|
82
|
+
|
|
83
|
+
#### `@mui/x-tree-view@9.0.0-rc.0`
|
|
84
|
+
|
|
85
|
+
Internal changes.
|
|
86
|
+
|
|
87
|
+
#### `@mui/x-tree-view-pro@9.0.0-rc.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
88
|
+
|
|
89
|
+
Same changes as in `@mui/x-tree-view@9.0.0-rc.0`, plus:
|
|
90
|
+
|
|
91
|
+
- [RichTreeViewPro] Allow to auto-expand lazy loaded items (#21759) @flaviendelangle
|
|
92
|
+
|
|
93
|
+
### Scheduler
|
|
94
|
+
|
|
95
|
+
#### `@mui/x-scheduler@9.0.0-alpha.0`
|
|
96
|
+
|
|
97
|
+
- [scheduler] Add locale files, adapt l10n scripts, and add localization table to docs (#21870) @rita-codes
|
|
98
|
+
- [scheduler] Add planned features to the docs (#21705) @rita-codes
|
|
99
|
+
- [scheduler] Add scheduler to docs introduction (#21845) @rita-codes
|
|
100
|
+
- [scheduler] Add wide docs to scheduler (#21860) @noraleonte
|
|
101
|
+
- [scheduler] All day event bugfixes (#21884) @noraleonte
|
|
102
|
+
- [scheduler] Autofocus title field (#21947) @noraleonte
|
|
103
|
+
- [scheduler] Change default event creation trigger to single click (#21979) @rita-codes
|
|
104
|
+
- [scheduler] Change order of the views on the view selector (#21904) @rita-codes
|
|
105
|
+
- [scheduler] Disabled border color for the repeat day picker in dark mode (#21987) @rita-codes
|
|
106
|
+
- [scheduler] Drop unused dependency (#21956) @flaviendelangle
|
|
107
|
+
- [scheduler] Fix all-day event shifting to previous day in negative UTC offsets (#21994) @rita-codes
|
|
108
|
+
- [scheduler] Fix dark theme localization demos (#21992) @noraleonte
|
|
109
|
+
- [scheduler] Fix licensing confusion in docs (#21939) @rita-codes
|
|
110
|
+
- [scheduler] Fix preferences menu width shift when toggling options + Improve preferences menu accessibility (#21902) @rita-codes
|
|
111
|
+
- [scheduler] Prepare for the alpha launch (#21859) @rita-codes
|
|
112
|
+
- [scheduler] Sync Base UI internals and apply good practices (#21946) @flaviendelangle
|
|
113
|
+
- [scheduler] Update close modal aria label translation (#21940) @rita-codes
|
|
114
|
+
- [scheduler] Add Spanish (es-ES) locale (#21900) @rita-codes
|
|
115
|
+
- [scheduler] Improve French (fr-FR) locale (#21941) @rita-codes
|
|
116
|
+
- [scheduler] Improve Romanian (ro-RO) locale (#21942) @rita-codes
|
|
117
|
+
|
|
118
|
+
#### `@mui/x-scheduler-premium@9.0.0-alpha.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
119
|
+
|
|
120
|
+
Same changes as in `@mui/x-scheduler@9.0.0-alpha.0`.
|
|
121
|
+
|
|
122
|
+
### Codemod
|
|
123
|
+
|
|
124
|
+
#### `@mui/x-codemod@9.0.0-rc.0`
|
|
125
|
+
|
|
126
|
+
Internal changes.
|
|
127
|
+
|
|
128
|
+
### Docs
|
|
129
|
+
|
|
130
|
+
- [docs] Fix JSDOM → jsdom casing (#21907) @JCQuintas
|
|
131
|
+
- [docs] Remove Joy UI references and dependency (#21937) @siriwatknp
|
|
132
|
+
- [docs] Remove none generated files (#21886) @alexfauquette
|
|
133
|
+
- [docs] Remove unused interactive demo code (#21945) @LukasTy
|
|
134
|
+
- [docs] Revise the Funnel doc (#21677) @mapache-salvaje
|
|
135
|
+
- [docs] Revise the Line chart docs (#21554) @mapache-salvaje
|
|
136
|
+
- [docs] Revise the Radar doc (#21674) @mapache-salvaje
|
|
137
|
+
- [docs] Revise the Sankey doc (#21678) @mapache-salvaje
|
|
138
|
+
- [docs] Revise the Scatter chart docs (#21564) @mapache-salvaje
|
|
139
|
+
|
|
140
|
+
### Core
|
|
141
|
+
|
|
142
|
+
- [docs-infra] Update to the latest monorepo (#21971) @brijeshb42
|
|
143
|
+
- [internal] Remove checks for `materialVersion >= 6` (#21975) @LukasTy
|
|
144
|
+
|
|
145
|
+
### Miscellaneous
|
|
146
|
+
|
|
147
|
+
- [core] Bump @mui/material to v9.0.0-beta.1 (#21858) @siriwatknp
|
|
148
|
+
- [core] Update browserslistrc (#21974) @siriwatknp
|
|
149
|
+
- [deps] Bump minimum core packages to 7.3.0 to adopt theme color manipulator (#21892) @siriwatknp
|
|
150
|
+
- [telemetry] Prefer upstream remote over origin for `projectId` (#21882) @aemartos
|
|
151
|
+
- [telemetry] Send `repoHash`, `[x]packageNameHash`, and `rootPathHash` alongside `projectId` (#21896) @aemartos
|
|
152
|
+
- [test] Exclude flaky `DataGrid` argos test (#21977) @MBilalShafi
|
|
153
|
+
- [test] Fix flaky `DataGrid` test (#22000) @arminmeh
|
|
154
|
+
- [test] Remove `componentsProp` test from `describeConformance` (#21897) @ZeeshanTamboli
|
|
155
|
+
- [x-license] Change `orderId` type from `number` to `string` (#21885) @aemartos
|
|
156
|
+
|
|
157
|
+
## 9.0.0-beta.0
|
|
158
|
+
|
|
159
|
+
<!-- generated comparing v9.0.0-alpha.4..master -->
|
|
160
|
+
|
|
161
|
+
_Mar 27, 2026_
|
|
162
|
+
|
|
163
|
+
We'd like to extend a big thank you to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
164
|
+
|
|
165
|
+
- 🔊 New Charts voiceover component for improved screen reader support
|
|
166
|
+
- ⌨️ Charts keyboard navigation improvements: axis tooltip now shows when navigating with the keyboard
|
|
167
|
+
- 📊 Charts axes now can be set to automatically resize to fit their content
|
|
168
|
+
- 📝 New `rowCheckbox` slot in Data Grid for easier checkbox column customization
|
|
169
|
+
- ⚡️ `fetchRows()` API in Data Grid Pro now defaults `start` and `end` based on scroll position with lazy loading
|
|
170
|
+
- 🐞 Bugfixes and internal improvements
|
|
171
|
+
|
|
172
|
+
The following team members contributed to this release:
|
|
173
|
+
@aemartos, @alexfauquette, @arminmeh, @cherniavskii, @Janpot, @JCQuintas, @mapache-salvaje, @michelengelen, @noraleonte, @rita-codes
|
|
174
|
+
|
|
175
|
+
### Data Grid
|
|
176
|
+
|
|
177
|
+
#### `@mui/x-data-grid@9.0.0-beta.0`
|
|
178
|
+
|
|
179
|
+
- [DataGrid] Add `rowCheckbox` slot for easier customization (#21797) @michelengelen
|
|
180
|
+
- [DataGrid] Prevent repeated `hasScrollbar` state updates (#21820) @arminmeh
|
|
181
|
+
|
|
182
|
+
#### `@mui/x-data-grid-pro@9.0.0-beta.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
183
|
+
|
|
184
|
+
Same changes as in `@mui/x-data-grid@9.0.0-beta.0`, plus:
|
|
185
|
+
|
|
186
|
+
- [DataGridPro] `fetchRows()` API's default `start` and `end` params based on scroll position with lazy loading (#21742) @arminmeh
|
|
187
|
+
|
|
188
|
+
#### `@mui/x-data-grid-premium@9.0.0-beta.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
189
|
+
|
|
190
|
+
Same changes as in `@mui/x-data-grid-pro@9.0.0-beta.0`.
|
|
191
|
+
|
|
192
|
+
### Date and Time Pickers
|
|
193
|
+
|
|
194
|
+
#### `@mui/x-date-pickers@9.0.0-beta.0`
|
|
195
|
+
|
|
196
|
+
Internal changes.
|
|
197
|
+
|
|
198
|
+
#### `@mui/x-date-pickers-pro@9.0.0-beta.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
199
|
+
|
|
200
|
+
Same changes as in `@mui/x-date-pickers@9.0.0-beta.0`.
|
|
201
|
+
|
|
202
|
+
### Charts
|
|
203
|
+
|
|
204
|
+
#### `@mui/x-charts@9.0.0-beta.0`
|
|
205
|
+
|
|
206
|
+
- [charts] Add `className` prop to Pro chart plot components (#21793) @JCQuintas
|
|
207
|
+
- [charts] Add experimental position-based pointer interaction for line series (#21809) @JCQuintas
|
|
208
|
+
- [charts] Add l10n to the bar accessibility (#21815) @alexfauquette
|
|
209
|
+
- [charts] Add localization for the basic charts (#21822) @alexfauquette
|
|
210
|
+
- [charts] Add voiceover component (#21344) @alexfauquette
|
|
211
|
+
- [charts] Allow axes to automatically resize to content (#21087) @JCQuintas
|
|
212
|
+
- [charts] Document multiple use-cases for references (#21768) @alexfauquette
|
|
213
|
+
- [charts] Remove compatibility layer for React vs native events (#21780) @JCQuintas
|
|
214
|
+
- [charts] Remove deprecated `barLabel` props (#21783) @alexfauquette
|
|
215
|
+
- [charts] Show axis tooltip when navigating with keyboard (#21689) @Copilot
|
|
216
|
+
|
|
217
|
+
#### `@mui/x-charts-pro@9.0.0-beta.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
218
|
+
|
|
219
|
+
Same changes as in `@mui/x-charts@9.0.0-beta.0`.
|
|
220
|
+
|
|
221
|
+
#### `@mui/x-charts-premium@9.0.0-beta.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
222
|
+
|
|
223
|
+
Same changes as in `@mui/x-charts-pro@9.0.0-beta.0`.
|
|
224
|
+
|
|
225
|
+
### Tree View
|
|
226
|
+
|
|
227
|
+
#### `@mui/x-tree-view@9.0.0-alpha.4`
|
|
228
|
+
|
|
229
|
+
Internal changes.
|
|
230
|
+
|
|
231
|
+
#### `@mui/x-tree-view-pro@9.0.0-alpha.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
232
|
+
|
|
233
|
+
Same changes as in `@mui/x-tree-view@9.0.0-alpha.4`.
|
|
234
|
+
|
|
235
|
+
### Codemod
|
|
236
|
+
|
|
237
|
+
#### `@mui/x-codemod@9.0.0-alpha.4`
|
|
238
|
+
|
|
239
|
+
Internal changes.
|
|
240
|
+
|
|
241
|
+
### Docs
|
|
242
|
+
|
|
243
|
+
- [docs] Document how to customize voiceover announcement (#21833) @alexfauquette
|
|
244
|
+
- [docs] Remove Discord mention from docs (#21855) @mapache-salvaje
|
|
245
|
+
- [docs] Remove stabilized experimental feature from demo (#21869) @JCQuintas
|
|
246
|
+
- [docs] Update telemetry guide to reflect pseudonymous data collection and license compliance (#21812) @aemartos
|
|
247
|
+
- [docs] Revise the Sparkline doc (#21614) @mapache-salvaje
|
|
248
|
+
- [docs] Revise the Gauge doc (#21673) @mapache-salvaje
|
|
249
|
+
- [docs] Revise the Heatmap doc (#21676) @mapache-salvaje
|
|
250
|
+
|
|
251
|
+
### Core
|
|
252
|
+
|
|
253
|
+
- [code-infra] Remove unused deps and unify es-toolkit via catalog (#21840) @Janpot
|
|
254
|
+
- [code-infra] Update @mui/internal-bundle-size-checker to canary.68 (#21836) @Janpot
|
|
255
|
+
- [code-infra] Update next (#21837) @Janpot
|
|
256
|
+
- [internal] Remove headless data grid packages (#21843) @cherniavskii
|
|
257
|
+
|
|
258
|
+
### Miscellaneous
|
|
259
|
+
|
|
260
|
+
- Add @romgrk to CODEOWNERS for `x-virtualizer` and `x-internals` (#21819) @Copilot
|
|
261
|
+
- [x-license] add 2022 plan version (#21814) @aemartos
|
|
262
|
+
|
|
3
263
|
## 9.0.0-alpha.4
|
|
4
264
|
|
|
5
265
|
_Mar 19, 2026_
|
|
@@ -59,7 +319,7 @@ Same changes as in `@mui/x-date-pickers@9.0.0-alpha.4`.
|
|
|
59
319
|
- [charts] Remove deprecated `useMouseTracker()` (#21787) @alexfauquette
|
|
60
320
|
- [charts] Remove deprecated classes (#21775) @alexfauquette
|
|
61
321
|
- [charts] Remove deprecated props from PieArcLabel animation (#21789) @alexfauquette
|
|
62
|
-
- [charts] Remove get
|
|
322
|
+
- [charts] Remove get\*UtilityClass from public exports (#21769) @JCQuintas
|
|
63
323
|
- [charts] Remove the deprecated `disableHover` property (#21785) @alexfauquette
|
|
64
324
|
- [charts] Remove the deprecated `message` prop (#21784) @alexfauquette
|
|
65
325
|
- [charts] Remove deprecated props about voronoi (#21796) @alexfauquette
|
|
@@ -207,7 +467,7 @@ Same changes as in `@mui/x-charts-pro@9.0.0-alpha.3`, plus:
|
|
|
207
467
|
- Remove deprecated CSS state classes from `treeItemClasses`: `expanded`, `selected`, `focused`, `disabled`, `editable`, `editing` (use `[data-expanded]`, `[data-selected]`, etc.)
|
|
208
468
|
- The `<RichTreeViewPro />` component has now virtualization enabled by default.
|
|
209
469
|
- The items used inside the `<RichTreeViewPro />` now have a default height of `32px`.
|
|
210
|
-
- The
|
|
470
|
+
- The items of the `<RichTreeViewPro />` are now rendered as a flat list instead of a nested tree.
|
|
211
471
|
|
|
212
472
|
#### `@mui/x-tree-view@9.0.0-alpha.3`
|
|
213
473
|
|
|
@@ -59,8 +59,8 @@ const RichTreeViewProRoot = exports.RichTreeViewProRoot = (0, _zeroStyled.styled
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
const packageInfo = {
|
|
62
|
-
releaseDate: "
|
|
63
|
-
version: "9.0.0-
|
|
62
|
+
releaseDate: "MTc3NTUyMDAwMDAwMA==",
|
|
63
|
+
version: "9.0.0-rc.0",
|
|
64
64
|
name: 'x-tree-view-pro'
|
|
65
65
|
};
|
|
66
66
|
|
|
@@ -369,6 +369,15 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
369
369
|
* @param {boolean} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
370
370
|
*/
|
|
371
371
|
onItemSelectionToggle: _propTypes.default.func,
|
|
372
|
+
/**
|
|
373
|
+
* Callback fired when the children of an item are loaded from the data source.
|
|
374
|
+
* Only relevant for lazy-loaded tree views.
|
|
375
|
+
* @param {object} parameters The parameters of the callback.
|
|
376
|
+
* @param {R[]} parameters.items The items that were loaded.
|
|
377
|
+
* @param {TreeViewItemId | null} parameters.parentId The id of the parent item whose children were loaded. `null` if the root items were loaded.
|
|
378
|
+
* @param {boolean} parameters.isCacheHit `true` if the items were loaded from the cache, `false` if they were fetched from the data source.
|
|
379
|
+
*/
|
|
380
|
+
onItemsLazyLoaded: _propTypes.default.func,
|
|
372
381
|
/**
|
|
373
382
|
* Callback fired when Tree Items are selected/deselected.
|
|
374
383
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
@@ -52,8 +52,8 @@ export const RichTreeViewProRoot = styled('ul', {
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
const packageInfo = {
|
|
55
|
-
releaseDate: "
|
|
56
|
-
version: "9.0.0-
|
|
55
|
+
releaseDate: "MTc3NTUyMDAwMDAwMA==",
|
|
56
|
+
version: "9.0.0-rc.0",
|
|
57
57
|
name: 'x-tree-view-pro'
|
|
58
58
|
};
|
|
59
59
|
|
|
@@ -362,6 +362,15 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
362
362
|
* @param {boolean} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
363
363
|
*/
|
|
364
364
|
onItemSelectionToggle: PropTypes.func,
|
|
365
|
+
/**
|
|
366
|
+
* Callback fired when the children of an item are loaded from the data source.
|
|
367
|
+
* Only relevant for lazy-loaded tree views.
|
|
368
|
+
* @param {object} parameters The parameters of the callback.
|
|
369
|
+
* @param {R[]} parameters.items The items that were loaded.
|
|
370
|
+
* @param {TreeViewItemId | null} parameters.parentId The id of the parent item whose children were loaded. `null` if the root items were loaded.
|
|
371
|
+
* @param {boolean} parameters.isCacheHit `true` if the items were loaded from the cache, `false` if they were fetched from the data source.
|
|
372
|
+
*/
|
|
373
|
+
onItemsLazyLoaded: PropTypes.func,
|
|
365
374
|
/**
|
|
366
375
|
* Callback fired when Tree Items are selected/deselected.
|
|
367
376
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
@@ -138,18 +138,18 @@ export declare function useExtractRichTreeViewProParameters<R extends TreeViewVa
|
|
|
138
138
|
onFocusCapture?: React.FocusEventHandler<HTMLUListElement> | undefined;
|
|
139
139
|
onBlur?: React.FocusEventHandler<HTMLUListElement> | undefined;
|
|
140
140
|
onBlurCapture?: React.FocusEventHandler<HTMLUListElement> | undefined;
|
|
141
|
-
onChange?: React.
|
|
142
|
-
onChangeCapture?: React.
|
|
141
|
+
onChange?: React.ChangeEventHandler<HTMLUListElement, Element> | undefined;
|
|
142
|
+
onChangeCapture?: React.ChangeEventHandler<HTMLUListElement, Element> | undefined;
|
|
143
143
|
onBeforeInput?: React.InputEventHandler<HTMLUListElement> | undefined;
|
|
144
|
-
onBeforeInputCapture?: React.
|
|
145
|
-
onInput?: React.
|
|
146
|
-
onInputCapture?: React.
|
|
147
|
-
onReset?: React.
|
|
148
|
-
onResetCapture?: React.
|
|
149
|
-
onSubmit?: React.
|
|
150
|
-
onSubmitCapture?: React.
|
|
151
|
-
onInvalid?: React.
|
|
152
|
-
onInvalidCapture?: React.
|
|
144
|
+
onBeforeInputCapture?: React.InputEventHandler<HTMLUListElement> | undefined;
|
|
145
|
+
onInput?: React.InputEventHandler<HTMLUListElement> | undefined;
|
|
146
|
+
onInputCapture?: React.InputEventHandler<HTMLUListElement> | undefined;
|
|
147
|
+
onReset?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
148
|
+
onResetCapture?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
149
|
+
onSubmit?: React.SubmitEventHandler<HTMLUListElement> | undefined;
|
|
150
|
+
onSubmitCapture?: React.SubmitEventHandler<HTMLUListElement> | undefined;
|
|
151
|
+
onInvalid?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
152
|
+
onInvalidCapture?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
153
153
|
onLoad?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
154
154
|
onLoadCapture?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
155
155
|
onError?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
@@ -138,18 +138,18 @@ export declare function useExtractRichTreeViewProParameters<R extends TreeViewVa
|
|
|
138
138
|
onFocusCapture?: React.FocusEventHandler<HTMLUListElement> | undefined;
|
|
139
139
|
onBlur?: React.FocusEventHandler<HTMLUListElement> | undefined;
|
|
140
140
|
onBlurCapture?: React.FocusEventHandler<HTMLUListElement> | undefined;
|
|
141
|
-
onChange?: React.
|
|
142
|
-
onChangeCapture?: React.
|
|
141
|
+
onChange?: React.ChangeEventHandler<HTMLUListElement, Element> | undefined;
|
|
142
|
+
onChangeCapture?: React.ChangeEventHandler<HTMLUListElement, Element> | undefined;
|
|
143
143
|
onBeforeInput?: React.InputEventHandler<HTMLUListElement> | undefined;
|
|
144
|
-
onBeforeInputCapture?: React.
|
|
145
|
-
onInput?: React.
|
|
146
|
-
onInputCapture?: React.
|
|
147
|
-
onReset?: React.
|
|
148
|
-
onResetCapture?: React.
|
|
149
|
-
onSubmit?: React.
|
|
150
|
-
onSubmitCapture?: React.
|
|
151
|
-
onInvalid?: React.
|
|
152
|
-
onInvalidCapture?: React.
|
|
144
|
+
onBeforeInputCapture?: React.InputEventHandler<HTMLUListElement> | undefined;
|
|
145
|
+
onInput?: React.InputEventHandler<HTMLUListElement> | undefined;
|
|
146
|
+
onInputCapture?: React.InputEventHandler<HTMLUListElement> | undefined;
|
|
147
|
+
onReset?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
148
|
+
onResetCapture?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
149
|
+
onSubmit?: React.SubmitEventHandler<HTMLUListElement> | undefined;
|
|
150
|
+
onSubmitCapture?: React.SubmitEventHandler<HTMLUListElement> | undefined;
|
|
151
|
+
onInvalid?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
152
|
+
onInvalidCapture?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
153
153
|
onLoad?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
154
154
|
onLoadCapture?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
155
155
|
onError?: React.ReactEventHandler<HTMLUListElement> | undefined;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.useExtractRichTreeViewProParameters = useExtractRichTreeViewProParameters;
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
const _excluded = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "itemHeight", "onItemLabelChange", "isItemEditable", "domStructure", "dataSource", "dataSourceCache", "itemsReordering", "isItemReorderable", "canMoveItemToNewPosition", "onItemPositionChange", "disableVirtualization"];
|
|
11
|
+
const _excluded = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "itemHeight", "onItemLabelChange", "isItemEditable", "domStructure", "dataSource", "dataSourceCache", "onItemsLazyLoaded", "itemsReordering", "isItemReorderable", "canMoveItemToNewPosition", "onItemPositionChange", "disableVirtualization"];
|
|
12
12
|
function useExtractRichTreeViewProParameters(props) {
|
|
13
13
|
const {
|
|
14
14
|
// Props for Provider
|
|
@@ -48,6 +48,7 @@ function useExtractRichTreeViewProParameters(props) {
|
|
|
48
48
|
// RichTreeViewProStore parameters
|
|
49
49
|
dataSource,
|
|
50
50
|
dataSourceCache,
|
|
51
|
+
onItemsLazyLoaded,
|
|
51
52
|
itemsReordering,
|
|
52
53
|
isItemReorderable,
|
|
53
54
|
canMoveItemToNewPosition,
|
|
@@ -91,6 +92,7 @@ function useExtractRichTreeViewProParameters(props) {
|
|
|
91
92
|
// RichTreeViewProStore parameters
|
|
92
93
|
dataSource,
|
|
93
94
|
dataSourceCache,
|
|
95
|
+
onItemsLazyLoaded,
|
|
94
96
|
itemsReordering,
|
|
95
97
|
isItemReorderable,
|
|
96
98
|
canMoveItemToNewPosition,
|
|
@@ -102,7 +104,7 @@ function useExtractRichTreeViewProParameters(props) {
|
|
|
102
104
|
// RichTreeViewStore parameters
|
|
103
105
|
onItemLabelChange, isItemEditable, domStructure,
|
|
104
106
|
// RichTreeViewProStore parameters
|
|
105
|
-
dataSource, dataSourceCache, itemsReordering, isItemReorderable, canMoveItemToNewPosition, onItemPositionChange, disableVirtualization]);
|
|
107
|
+
dataSource, dataSourceCache, onItemsLazyLoaded, itemsReordering, isItemReorderable, canMoveItemToNewPosition, onItemPositionChange, disableVirtualization]);
|
|
106
108
|
return {
|
|
107
109
|
apiRef,
|
|
108
110
|
slots,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
-
const _excluded = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "itemHeight", "onItemLabelChange", "isItemEditable", "domStructure", "dataSource", "dataSourceCache", "itemsReordering", "isItemReorderable", "canMoveItemToNewPosition", "onItemPositionChange", "disableVirtualization"];
|
|
2
|
+
const _excluded = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "itemHeight", "onItemLabelChange", "isItemEditable", "domStructure", "dataSource", "dataSourceCache", "onItemsLazyLoaded", "itemsReordering", "isItemReorderable", "canMoveItemToNewPosition", "onItemPositionChange", "disableVirtualization"];
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
export function useExtractRichTreeViewProParameters(props) {
|
|
5
5
|
const {
|
|
@@ -40,6 +40,7 @@ export function useExtractRichTreeViewProParameters(props) {
|
|
|
40
40
|
// RichTreeViewProStore parameters
|
|
41
41
|
dataSource,
|
|
42
42
|
dataSourceCache,
|
|
43
|
+
onItemsLazyLoaded,
|
|
43
44
|
itemsReordering,
|
|
44
45
|
isItemReorderable,
|
|
45
46
|
canMoveItemToNewPosition,
|
|
@@ -83,6 +84,7 @@ export function useExtractRichTreeViewProParameters(props) {
|
|
|
83
84
|
// RichTreeViewProStore parameters
|
|
84
85
|
dataSource,
|
|
85
86
|
dataSourceCache,
|
|
87
|
+
onItemsLazyLoaded,
|
|
86
88
|
itemsReordering,
|
|
87
89
|
isItemReorderable,
|
|
88
90
|
canMoveItemToNewPosition,
|
|
@@ -94,7 +96,7 @@ export function useExtractRichTreeViewProParameters(props) {
|
|
|
94
96
|
// RichTreeViewStore parameters
|
|
95
97
|
onItemLabelChange, isItemEditable, domStructure,
|
|
96
98
|
// RichTreeViewProStore parameters
|
|
97
|
-
dataSource, dataSourceCache, itemsReordering, isItemReorderable, canMoveItemToNewPosition, onItemPositionChange, disableVirtualization]);
|
|
99
|
+
dataSource, dataSourceCache, onItemsLazyLoaded, itemsReordering, isItemReorderable, canMoveItemToNewPosition, onItemPositionChange, disableVirtualization]);
|
|
98
100
|
return {
|
|
99
101
|
apiRef,
|
|
100
102
|
slots,
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -4,8 +4,9 @@ import { RichTreeViewProStoreParameters, RichTreeViewProState } from "./RichTree
|
|
|
4
4
|
import { TreeViewLazyLoadingPlugin } from "../plugins/lazyLoading/index.mjs";
|
|
5
5
|
import { TreeViewItemsReorderingPlugin } from "../plugins/itemsReordering/index.mjs";
|
|
6
6
|
export declare class RichTreeViewProStore<R extends TreeViewValidItem<R>, Multiple extends boolean | undefined> extends ExtendableRichTreeViewStore<R, Multiple, RichTreeViewProState<R, Multiple>, RichTreeViewProStoreParameters<R, Multiple>> {
|
|
7
|
-
lazyLoading: TreeViewLazyLoadingPlugin
|
|
7
|
+
lazyLoading: TreeViewLazyLoadingPlugin<R>;
|
|
8
8
|
itemsReordering: TreeViewItemsReorderingPlugin;
|
|
9
|
+
disposeEffect: () => () => void;
|
|
9
10
|
constructor(parameters: RichTreeViewProStoreParameters<R, Multiple>);
|
|
10
11
|
buildPublicAPI(): {
|
|
11
12
|
updateItemChildren: (itemId: import("@mui/x-tree-view").TreeViewItemId | null) => Promise<void>;
|
|
@@ -4,8 +4,9 @@ import { RichTreeViewProStoreParameters, RichTreeViewProState } from "./RichTree
|
|
|
4
4
|
import { TreeViewLazyLoadingPlugin } from "../plugins/lazyLoading/index.js";
|
|
5
5
|
import { TreeViewItemsReorderingPlugin } from "../plugins/itemsReordering/index.js";
|
|
6
6
|
export declare class RichTreeViewProStore<R extends TreeViewValidItem<R>, Multiple extends boolean | undefined> extends ExtendableRichTreeViewStore<R, Multiple, RichTreeViewProState<R, Multiple>, RichTreeViewProStoreParameters<R, Multiple>> {
|
|
7
|
-
lazyLoading: TreeViewLazyLoadingPlugin
|
|
7
|
+
lazyLoading: TreeViewLazyLoadingPlugin<R>;
|
|
8
8
|
itemsReordering: TreeViewItemsReorderingPlugin;
|
|
9
|
+
disposeEffect: () => () => void;
|
|
9
10
|
constructor(parameters: RichTreeViewProStoreParameters<R, Multiple>);
|
|
10
11
|
buildPublicAPI(): {
|
|
11
12
|
updateItemChildren: (itemId: import("@mui/x-tree-view").TreeViewItemId | null) => Promise<void>;
|
|
@@ -12,6 +12,10 @@ var _itemsReordering = require("../plugins/itemsReordering");
|
|
|
12
12
|
var _RichTreeViewProStore = require("./RichTreeViewProStore.utils");
|
|
13
13
|
class RichTreeViewProStore extends _internals.ExtendableRichTreeViewStore {
|
|
14
14
|
itemsReordering = new _itemsReordering.TreeViewItemsReorderingPlugin(this);
|
|
15
|
+
disposeEffect = () => {
|
|
16
|
+
this.lazyLoading.initEffect();
|
|
17
|
+
return this.timeoutManager.clearAll;
|
|
18
|
+
};
|
|
15
19
|
constructor(parameters) {
|
|
16
20
|
super(parameters, 'RichTreeViewPro', _RichTreeViewProStore.parametersToStateMapper);
|
|
17
21
|
this.lazyLoading = new _lazyLoading.TreeViewLazyLoadingPlugin(this);
|
|
@@ -4,7 +4,11 @@ import { TreeViewLazyLoadingPlugin } from "../plugins/lazyLoading/index.mjs";
|
|
|
4
4
|
import { TreeViewItemsReorderingPlugin } from "../plugins/itemsReordering/index.mjs";
|
|
5
5
|
import { parametersToStateMapper } from "./RichTreeViewProStore.utils.mjs";
|
|
6
6
|
export class RichTreeViewProStore extends ExtendableRichTreeViewStore {
|
|
7
|
-
itemsReordering =
|
|
7
|
+
itemsReordering = new TreeViewItemsReorderingPlugin(this);
|
|
8
|
+
disposeEffect = () => {
|
|
9
|
+
this.lazyLoading.initEffect();
|
|
10
|
+
return this.timeoutManager.clearAll;
|
|
11
|
+
};
|
|
8
12
|
constructor(parameters) {
|
|
9
13
|
super(parameters, 'RichTreeViewPro', parametersToStateMapper);
|
|
10
14
|
this.lazyLoading = new TreeViewLazyLoadingPlugin(this);
|
|
@@ -32,7 +32,7 @@ export interface RichTreeViewProStoreParameters<R extends TreeViewValidItem<R>,
|
|
|
32
32
|
/**
|
|
33
33
|
* The data source cache object.
|
|
34
34
|
*/
|
|
35
|
-
dataSourceCache?: DataSourceCache
|
|
35
|
+
dataSourceCache?: DataSourceCache<R>;
|
|
36
36
|
/**
|
|
37
37
|
* If `true`, the reordering of items is enabled.
|
|
38
38
|
* @default false
|
|
@@ -58,6 +58,19 @@ export interface RichTreeViewProStoreParameters<R extends TreeViewValidItem<R>,
|
|
|
58
58
|
oldPosition: TreeViewItemReorderPosition;
|
|
59
59
|
newPosition: TreeViewItemReorderPosition;
|
|
60
60
|
}) => boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Callback fired when the children of an item are loaded from the data source.
|
|
63
|
+
* Only relevant for lazy-loaded tree views.
|
|
64
|
+
* @param {object} parameters The parameters of the callback.
|
|
65
|
+
* @param {R[]} parameters.items The items that were loaded.
|
|
66
|
+
* @param {TreeViewItemId | null} parameters.parentId The id of the parent item whose children were loaded. `null` if the root items were loaded.
|
|
67
|
+
* @param {boolean} parameters.isCacheHit `true` if the items were loaded from the cache, `false` if they were fetched from the data source.
|
|
68
|
+
*/
|
|
69
|
+
onItemsLazyLoaded?: (parameters: {
|
|
70
|
+
items: R[];
|
|
71
|
+
parentId: TreeViewItemId | null;
|
|
72
|
+
isCacheHit: boolean;
|
|
73
|
+
}) => void;
|
|
61
74
|
/**
|
|
62
75
|
* Callback fired when a Tree Item is moved in the tree.
|
|
63
76
|
* @param {object} parameters The params describing the item re-ordering.
|
|
@@ -32,7 +32,7 @@ export interface RichTreeViewProStoreParameters<R extends TreeViewValidItem<R>,
|
|
|
32
32
|
/**
|
|
33
33
|
* The data source cache object.
|
|
34
34
|
*/
|
|
35
|
-
dataSourceCache?: DataSourceCache
|
|
35
|
+
dataSourceCache?: DataSourceCache<R>;
|
|
36
36
|
/**
|
|
37
37
|
* If `true`, the reordering of items is enabled.
|
|
38
38
|
* @default false
|
|
@@ -58,6 +58,19 @@ export interface RichTreeViewProStoreParameters<R extends TreeViewValidItem<R>,
|
|
|
58
58
|
oldPosition: TreeViewItemReorderPosition;
|
|
59
59
|
newPosition: TreeViewItemReorderPosition;
|
|
60
60
|
}) => boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Callback fired when the children of an item are loaded from the data source.
|
|
63
|
+
* Only relevant for lazy-loaded tree views.
|
|
64
|
+
* @param {object} parameters The parameters of the callback.
|
|
65
|
+
* @param {R[]} parameters.items The items that were loaded.
|
|
66
|
+
* @param {TreeViewItemId | null} parameters.parentId The id of the parent item whose children were loaded. `null` if the root items were loaded.
|
|
67
|
+
* @param {boolean} parameters.isCacheHit `true` if the items were loaded from the cache, `false` if they were fetched from the data source.
|
|
68
|
+
*/
|
|
69
|
+
onItemsLazyLoaded?: (parameters: {
|
|
70
|
+
items: R[];
|
|
71
|
+
parentId: TreeViewItemId | null;
|
|
72
|
+
isCacheHit: boolean;
|
|
73
|
+
}) => void;
|
|
61
74
|
/**
|
|
62
75
|
* Callback fired when a Tree Item is moved in the tree.
|
|
63
76
|
* @param {object} parameters The params describing the item re-ordering.
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import { TreeViewItemId } from '@mui/x-tree-view/models';
|
|
1
|
+
import { TreeViewItemId, TreeViewValidItem } from '@mui/x-tree-view/models';
|
|
2
2
|
import { RichTreeViewProStore } from "../../RichTreeViewProStore/RichTreeViewProStore.mjs";
|
|
3
3
|
export declare const TREE_VIEW_LAZY_LOADED_ITEMS_INITIAL_STATE: {
|
|
4
4
|
loading: {};
|
|
5
5
|
errors: {};
|
|
6
6
|
};
|
|
7
|
-
export declare class TreeViewLazyLoadingPlugin {
|
|
7
|
+
export declare class TreeViewLazyLoadingPlugin<R extends TreeViewValidItem<R>> {
|
|
8
8
|
private store;
|
|
9
9
|
private nestedDataManager;
|
|
10
10
|
private cache;
|
|
11
|
-
|
|
11
|
+
private isInsideOnItemsLazyLoaded;
|
|
12
|
+
private initStarted;
|
|
13
|
+
constructor(store: RichTreeViewProStore<R, any>);
|
|
14
|
+
/**
|
|
15
|
+
* Initialize lazy loading.
|
|
16
|
+
* Called from the store's disposeEffect (inside a useEffect) to avoid side effects during render.
|
|
17
|
+
* Uses a flag to ensure initialization only happens once (handles React 18 StrictMode double-firing effects).
|
|
18
|
+
*/
|
|
19
|
+
initEffect: () => void;
|
|
12
20
|
private init;
|
|
13
21
|
private handleBeforeItemToggleExpansion;
|
|
14
22
|
private setItemLoading;
|
|
15
23
|
private setItemError;
|
|
24
|
+
private callOnItemsLazyLoaded;
|
|
16
25
|
buildPublicAPI: () => {
|
|
17
26
|
updateItemChildren: (itemId: TreeViewItemId | null) => Promise<void>;
|
|
18
27
|
};
|
|
@@ -41,6 +50,9 @@ export declare class TreeViewLazyLoadingPlugin {
|
|
|
41
50
|
* @param {boolean} [parameters.forceRefresh] Whether to force a refresh of the children when the cache already contains some data.
|
|
42
51
|
* @returns {Promise<void>} The promise resolved when the items are fetched.
|
|
43
52
|
*/
|
|
53
|
+
private getItemId;
|
|
54
|
+
private getInlineChildren;
|
|
55
|
+
private processNestedItemChildren;
|
|
44
56
|
fetchItemChildren: ({
|
|
45
57
|
itemId,
|
|
46
58
|
forceRefresh
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import { TreeViewItemId } from '@mui/x-tree-view/models';
|
|
1
|
+
import { TreeViewItemId, TreeViewValidItem } from '@mui/x-tree-view/models';
|
|
2
2
|
import { RichTreeViewProStore } from "../../RichTreeViewProStore/RichTreeViewProStore.js";
|
|
3
3
|
export declare const TREE_VIEW_LAZY_LOADED_ITEMS_INITIAL_STATE: {
|
|
4
4
|
loading: {};
|
|
5
5
|
errors: {};
|
|
6
6
|
};
|
|
7
|
-
export declare class TreeViewLazyLoadingPlugin {
|
|
7
|
+
export declare class TreeViewLazyLoadingPlugin<R extends TreeViewValidItem<R>> {
|
|
8
8
|
private store;
|
|
9
9
|
private nestedDataManager;
|
|
10
10
|
private cache;
|
|
11
|
-
|
|
11
|
+
private isInsideOnItemsLazyLoaded;
|
|
12
|
+
private initStarted;
|
|
13
|
+
constructor(store: RichTreeViewProStore<R, any>);
|
|
14
|
+
/**
|
|
15
|
+
* Initialize lazy loading.
|
|
16
|
+
* Called from the store's disposeEffect (inside a useEffect) to avoid side effects during render.
|
|
17
|
+
* Uses a flag to ensure initialization only happens once (handles React 18 StrictMode double-firing effects).
|
|
18
|
+
*/
|
|
19
|
+
initEffect: () => void;
|
|
12
20
|
private init;
|
|
13
21
|
private handleBeforeItemToggleExpansion;
|
|
14
22
|
private setItemLoading;
|
|
15
23
|
private setItemError;
|
|
24
|
+
private callOnItemsLazyLoaded;
|
|
16
25
|
buildPublicAPI: () => {
|
|
17
26
|
updateItemChildren: (itemId: TreeViewItemId | null) => Promise<void>;
|
|
18
27
|
};
|
|
@@ -41,6 +50,9 @@ export declare class TreeViewLazyLoadingPlugin {
|
|
|
41
50
|
* @param {boolean} [parameters.forceRefresh] Whether to force a refresh of the children when the cache already contains some data.
|
|
42
51
|
* @returns {Promise<void>} The promise resolved when the items are fetched.
|
|
43
52
|
*/
|
|
53
|
+
private getItemId;
|
|
54
|
+
private getInlineChildren;
|
|
55
|
+
private processNestedItemChildren;
|
|
44
56
|
fetchItemChildren: ({
|
|
45
57
|
itemId,
|
|
46
58
|
forceRefresh
|
|
@@ -15,14 +15,28 @@ const TREE_VIEW_LAZY_LOADED_ITEMS_INITIAL_STATE = exports.TREE_VIEW_LAZY_LOADED_
|
|
|
15
15
|
};
|
|
16
16
|
class TreeViewLazyLoadingPlugin {
|
|
17
17
|
nestedDataManager = new _utils2.NestedDataManager(this);
|
|
18
|
+
isInsideOnItemsLazyLoaded = false;
|
|
19
|
+
initStarted = false;
|
|
18
20
|
constructor(store) {
|
|
19
21
|
this.store = store;
|
|
20
22
|
this.cache = store.parameters.dataSourceCache ?? new _utils.DataSourceCacheDefault({});
|
|
21
23
|
if (store.parameters.dataSource != null) {
|
|
22
|
-
this.init();
|
|
23
24
|
store.subscribeEvent('beforeItemToggleExpansion', this.handleBeforeItemToggleExpansion);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize lazy loading.
|
|
30
|
+
* Called from the store's disposeEffect (inside a useEffect) to avoid side effects during render.
|
|
31
|
+
* Uses a flag to ensure initialization only happens once (handles React 18 StrictMode double-firing effects).
|
|
32
|
+
*/
|
|
33
|
+
initEffect = () => {
|
|
34
|
+
if (this.store.parameters.dataSource == null || this.initStarted) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.initStarted = true;
|
|
38
|
+
this.init();
|
|
39
|
+
};
|
|
26
40
|
init = () => {
|
|
27
41
|
const store = this.store;
|
|
28
42
|
// eslint-disable-next-line consistent-this
|
|
@@ -115,6 +129,21 @@ class TreeViewLazyLoadingPlugin {
|
|
|
115
129
|
errors
|
|
116
130
|
}));
|
|
117
131
|
};
|
|
132
|
+
callOnItemsLazyLoaded(items, parentId, isCacheHit) {
|
|
133
|
+
if (this.isInsideOnItemsLazyLoaded) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
this.isInsideOnItemsLazyLoaded = true;
|
|
137
|
+
try {
|
|
138
|
+
this.store.parameters.onItemsLazyLoaded?.({
|
|
139
|
+
items,
|
|
140
|
+
parentId,
|
|
141
|
+
isCacheHit
|
|
142
|
+
});
|
|
143
|
+
} finally {
|
|
144
|
+
this.isInsideOnItemsLazyLoaded = false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
118
147
|
buildPublicAPI = () => {
|
|
119
148
|
return {
|
|
120
149
|
updateItemChildren: this.updateItemChildren
|
|
@@ -151,6 +180,27 @@ class TreeViewLazyLoadingPlugin {
|
|
|
151
180
|
* @param {boolean} [parameters.forceRefresh] Whether to force a refresh of the children when the cache already contains some data.
|
|
152
181
|
* @returns {Promise<void>} The promise resolved when the items are fetched.
|
|
153
182
|
*/
|
|
183
|
+
getItemId = item => this.store.parameters.getItemId ? this.store.parameters.getItemId(item) : item.id;
|
|
184
|
+
getInlineChildren = item => (this.store.parameters.getItemChildren ? this.store.parameters.getItemChildren(item) : item.children) ?? [];
|
|
185
|
+
processNestedItemChildren = items => {
|
|
186
|
+
const {
|
|
187
|
+
getChildrenCount
|
|
188
|
+
} = this.store.parameters.dataSource;
|
|
189
|
+
for (const item of items) {
|
|
190
|
+
const children = this.getInlineChildren(item);
|
|
191
|
+
if (children.length === 0) {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const itemId = this.getItemId(item);
|
|
195
|
+
this.cache.set(itemId, children);
|
|
196
|
+
this.store.items.setItemChildren({
|
|
197
|
+
items: children,
|
|
198
|
+
parentId: itemId,
|
|
199
|
+
getChildrenCount
|
|
200
|
+
});
|
|
201
|
+
this.processNestedItemChildren(children);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
154
204
|
fetchItemChildren = async ({
|
|
155
205
|
itemId,
|
|
156
206
|
forceRefresh
|
|
@@ -186,6 +236,7 @@ class TreeViewLazyLoadingPlugin {
|
|
|
186
236
|
getChildrenCount
|
|
187
237
|
});
|
|
188
238
|
this.setItemLoading(itemId, false);
|
|
239
|
+
this.callOnItemsLazyLoaded(cachedData, itemId, true);
|
|
189
240
|
return;
|
|
190
241
|
}
|
|
191
242
|
|
|
@@ -216,6 +267,10 @@ class TreeViewLazyLoadingPlugin {
|
|
|
216
267
|
parentId: itemId,
|
|
217
268
|
getChildrenCount
|
|
218
269
|
});
|
|
270
|
+
// pre-cache any inline nested children so expanding them requires no extra network call
|
|
271
|
+
this.processNestedItemChildren(response);
|
|
272
|
+
// notify the user that new items have been loaded
|
|
273
|
+
this.callOnItemsLazyLoaded(response, itemId, false);
|
|
219
274
|
} catch (error) {
|
|
220
275
|
const childrenFetchError = error;
|
|
221
276
|
// set the item error in the state
|
|
@@ -7,15 +7,29 @@ export const TREE_VIEW_LAZY_LOADED_ITEMS_INITIAL_STATE = {
|
|
|
7
7
|
errors: {}
|
|
8
8
|
};
|
|
9
9
|
export class TreeViewLazyLoadingPlugin {
|
|
10
|
-
nestedDataManager =
|
|
10
|
+
nestedDataManager = new NestedDataManager(this);
|
|
11
|
+
isInsideOnItemsLazyLoaded = false;
|
|
12
|
+
initStarted = false;
|
|
11
13
|
constructor(store) {
|
|
12
14
|
this.store = store;
|
|
13
15
|
this.cache = store.parameters.dataSourceCache ?? new DataSourceCacheDefault({});
|
|
14
16
|
if (store.parameters.dataSource != null) {
|
|
15
|
-
this.init();
|
|
16
17
|
store.subscribeEvent('beforeItemToggleExpansion', this.handleBeforeItemToggleExpansion);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Initialize lazy loading.
|
|
23
|
+
* Called from the store's disposeEffect (inside a useEffect) to avoid side effects during render.
|
|
24
|
+
* Uses a flag to ensure initialization only happens once (handles React 18 StrictMode double-firing effects).
|
|
25
|
+
*/
|
|
26
|
+
initEffect = () => {
|
|
27
|
+
if (this.store.parameters.dataSource == null || this.initStarted) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.initStarted = true;
|
|
31
|
+
this.init();
|
|
32
|
+
};
|
|
19
33
|
init = () => {
|
|
20
34
|
const store = this.store;
|
|
21
35
|
// eslint-disable-next-line consistent-this
|
|
@@ -108,6 +122,21 @@ export class TreeViewLazyLoadingPlugin {
|
|
|
108
122
|
errors
|
|
109
123
|
}));
|
|
110
124
|
};
|
|
125
|
+
callOnItemsLazyLoaded(items, parentId, isCacheHit) {
|
|
126
|
+
if (this.isInsideOnItemsLazyLoaded) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
this.isInsideOnItemsLazyLoaded = true;
|
|
130
|
+
try {
|
|
131
|
+
this.store.parameters.onItemsLazyLoaded?.({
|
|
132
|
+
items,
|
|
133
|
+
parentId,
|
|
134
|
+
isCacheHit
|
|
135
|
+
});
|
|
136
|
+
} finally {
|
|
137
|
+
this.isInsideOnItemsLazyLoaded = false;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
111
140
|
buildPublicAPI = () => {
|
|
112
141
|
return {
|
|
113
142
|
updateItemChildren: this.updateItemChildren
|
|
@@ -144,6 +173,27 @@ export class TreeViewLazyLoadingPlugin {
|
|
|
144
173
|
* @param {boolean} [parameters.forceRefresh] Whether to force a refresh of the children when the cache already contains some data.
|
|
145
174
|
* @returns {Promise<void>} The promise resolved when the items are fetched.
|
|
146
175
|
*/
|
|
176
|
+
getItemId = item => this.store.parameters.getItemId ? this.store.parameters.getItemId(item) : item.id;
|
|
177
|
+
getInlineChildren = item => (this.store.parameters.getItemChildren ? this.store.parameters.getItemChildren(item) : item.children) ?? [];
|
|
178
|
+
processNestedItemChildren = items => {
|
|
179
|
+
const {
|
|
180
|
+
getChildrenCount
|
|
181
|
+
} = this.store.parameters.dataSource;
|
|
182
|
+
for (const item of items) {
|
|
183
|
+
const children = this.getInlineChildren(item);
|
|
184
|
+
if (children.length === 0) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const itemId = this.getItemId(item);
|
|
188
|
+
this.cache.set(itemId, children);
|
|
189
|
+
this.store.items.setItemChildren({
|
|
190
|
+
items: children,
|
|
191
|
+
parentId: itemId,
|
|
192
|
+
getChildrenCount
|
|
193
|
+
});
|
|
194
|
+
this.processNestedItemChildren(children);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
147
197
|
fetchItemChildren = async ({
|
|
148
198
|
itemId,
|
|
149
199
|
forceRefresh
|
|
@@ -179,6 +229,7 @@ export class TreeViewLazyLoadingPlugin {
|
|
|
179
229
|
getChildrenCount
|
|
180
230
|
});
|
|
181
231
|
this.setItemLoading(itemId, false);
|
|
232
|
+
this.callOnItemsLazyLoaded(cachedData, itemId, true);
|
|
182
233
|
return;
|
|
183
234
|
}
|
|
184
235
|
|
|
@@ -209,6 +260,10 @@ export class TreeViewLazyLoadingPlugin {
|
|
|
209
260
|
parentId: itemId,
|
|
210
261
|
getChildrenCount
|
|
211
262
|
});
|
|
263
|
+
// pre-cache any inline nested children so expanding them requires no extra network call
|
|
264
|
+
this.processNestedItemChildren(response);
|
|
265
|
+
// notify the user that new items have been loaded
|
|
266
|
+
this.callOnItemsLazyLoaded(response, itemId, false);
|
|
212
267
|
} catch (error) {
|
|
213
268
|
const childrenFetchError = error;
|
|
214
269
|
// set the item error in the state
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TreeViewItemId } from '@mui/x-tree-view/models';
|
|
1
|
+
import { TreeViewItemId, TreeViewValidItem } from '@mui/x-tree-view/models';
|
|
2
2
|
import { TreeViewLazyLoadingPlugin } from "./TreeViewLazyLoadingPlugin.mjs";
|
|
3
3
|
export declare enum RequestStatus {
|
|
4
4
|
QUEUED = 0,
|
|
@@ -17,7 +17,7 @@ export declare class NestedDataManager {
|
|
|
17
17
|
private settledRequests;
|
|
18
18
|
private lazyLoadingPlugin;
|
|
19
19
|
private maxConcurrentRequests;
|
|
20
|
-
constructor(lazyLoadingPlugin: TreeViewLazyLoadingPlugin
|
|
20
|
+
constructor(lazyLoadingPlugin: TreeViewLazyLoadingPlugin<TreeViewValidItem<any>>, maxConcurrentRequests?: number);
|
|
21
21
|
private processQueue;
|
|
22
22
|
queue: (ids: TreeViewItemId[]) => Promise<void>;
|
|
23
23
|
setRequestSettled: (id: TreeViewItemId) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TreeViewItemId } from '@mui/x-tree-view/models';
|
|
1
|
+
import { TreeViewItemId, TreeViewValidItem } from '@mui/x-tree-view/models';
|
|
2
2
|
import { TreeViewLazyLoadingPlugin } from "./TreeViewLazyLoadingPlugin.js";
|
|
3
3
|
export declare enum RequestStatus {
|
|
4
4
|
QUEUED = 0,
|
|
@@ -17,7 +17,7 @@ export declare class NestedDataManager {
|
|
|
17
17
|
private settledRequests;
|
|
18
18
|
private lazyLoadingPlugin;
|
|
19
19
|
private maxConcurrentRequests;
|
|
20
|
-
constructor(lazyLoadingPlugin: TreeViewLazyLoadingPlugin
|
|
20
|
+
constructor(lazyLoadingPlugin: TreeViewLazyLoadingPlugin<TreeViewValidItem<any>>, maxConcurrentRequests?: number);
|
|
21
21
|
private processQueue;
|
|
22
22
|
queue: (ids: TreeViewItemId[]) => Promise<void>;
|
|
23
23
|
setRequestSettled: (id: TreeViewItemId) => Promise<void>;
|
|
@@ -13,9 +13,9 @@ export let RequestStatus = /*#__PURE__*/function (RequestStatus) {
|
|
|
13
13
|
* Uses `ParentId` to uniquely identify a request
|
|
14
14
|
*/
|
|
15
15
|
export class NestedDataManager {
|
|
16
|
-
pendingRequests =
|
|
17
|
-
queuedRequests =
|
|
18
|
-
settledRequests =
|
|
16
|
+
pendingRequests = new Set();
|
|
17
|
+
queuedRequests = new Set();
|
|
18
|
+
settledRequests = new Set();
|
|
19
19
|
constructor(lazyLoadingPlugin, maxConcurrentRequests = MAX_CONCURRENT_REQUESTS) {
|
|
20
20
|
this.lazyLoadingPlugin = lazyLoadingPlugin;
|
|
21
21
|
this.maxConcurrentRequests = maxConcurrentRequests;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-tree-view-pro",
|
|
3
|
-
"version": "9.0.0-
|
|
3
|
+
"version": "9.0.0-rc.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Pro plan edition of the MUI X Tree View components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -32,24 +32,24 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.28.6",
|
|
35
|
-
"@base-ui/utils": "^0.2.
|
|
36
|
-
"@mui/utils": "
|
|
35
|
+
"@base-ui/utils": "^0.2.6",
|
|
36
|
+
"@mui/utils": "9.0.0-beta.1",
|
|
37
37
|
"@types/react-transition-group": "^4.4.12",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
39
39
|
"prop-types": "^15.8.1",
|
|
40
40
|
"react-transition-group": "^4.4.5",
|
|
41
41
|
"reselect": "^5.1.1",
|
|
42
42
|
"use-sync-external-store": "^1.6.0",
|
|
43
|
-
"@mui/x-
|
|
44
|
-
"@mui/x-
|
|
45
|
-
"@mui/x-
|
|
46
|
-
"@mui/x-
|
|
43
|
+
"@mui/x-license": "9.0.0-rc.0",
|
|
44
|
+
"@mui/x-tree-view": "9.0.0-rc.0",
|
|
45
|
+
"@mui/x-internals": "9.0.0-rc.0",
|
|
46
|
+
"@mui/x-virtualizer": "1.0.0-rc.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|
|
50
50
|
"@emotion/styled": "^11.8.1",
|
|
51
|
-
"@mui/material": "^
|
|
52
|
-
"@mui/system": "^
|
|
51
|
+
"@mui/material": "^7.3.0 || ^9.0.0-beta.0 || ^9.0.0",
|
|
52
|
+
"@mui/system": "^7.3.0 || ^9.0.0-beta.1",
|
|
53
53
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
54
54
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
55
55
|
},
|