@mui/x-tree-view-pro 8.10.0 → 8.10.1
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 +96 -0
- package/RichTreeViewPro/RichTreeViewPro.js +1 -1
- package/esm/RichTreeViewPro/RichTreeViewPro.js +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.js +16 -6
- package/esm/internals/plugins/useTreeViewLazyLoading/utils.js +55 -57
- package/index.js +1 -1
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.js +15 -5
- package/internals/plugins/useTreeViewLazyLoading/utils.js +55 -57
- package/package.json +16 -17
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,102 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.10.1
|
|
9
|
+
|
|
10
|
+
_Aug 15, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 📊 Y-axes can now be grouped by category when using `band` and `point` scales.
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
The following are all team members who have contributed to this release:
|
|
18
|
+
@alexfauquette, @bernardobelchior, @Janpot, @JCQuintas, @mnajdova, @oliviertassinari, @prakhargupta1, @romgrk
|
|
19
|
+
|
|
20
|
+
### Data Grid
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid@8.10.1`
|
|
23
|
+
|
|
24
|
+
- [DataGrid] Fix scroll jumping (#19156) @romgrk
|
|
25
|
+
- [DataGrid] Fix scroll restoration (#19182) @romgrk
|
|
26
|
+
- [DataGrid] Fix "no row with id" error (#19193) @romgrk
|
|
27
|
+
|
|
28
|
+
#### `@mui/x-data-grid-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
29
|
+
|
|
30
|
+
Same changes as in `@mui/x-data-grid@8.10.1`.
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-premium@8.10.1` [](https://mui.com/r/x-premium-svg-link "Premium plan")
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid-pro@8.10.1`.
|
|
35
|
+
|
|
36
|
+
### Date and Time Pickers
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-date-pickers@8.10.0`
|
|
39
|
+
|
|
40
|
+
Internal changes.
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers-pro@8.10.0` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-date-pickers@8.10.0`.
|
|
45
|
+
|
|
46
|
+
### Charts
|
|
47
|
+
|
|
48
|
+
- Axes can now be grouped by category when using `band` and `point` scales
|
|
49
|
+
|
|
50
|
+
<img width="643" height="455" alt="Bar chart with y-axis grouped per categories" src="https://github.com/user-attachments/assets/59044afe-bcc5-4152-8bf1-225db0635025" />
|
|
51
|
+
|
|
52
|
+
#### `@mui/x-charts@8.10.1`
|
|
53
|
+
|
|
54
|
+
- [charts] Allow y-axis to be grouped (#19081) @JCQuintas
|
|
55
|
+
- [charts] Fix default axis highlight for axes without data attribute (#18985) @alexfauquette
|
|
56
|
+
- [charts] Fix tooltip mark unexpected wrapping in mobile (#19122) @bernardobelchior
|
|
57
|
+
- [charts] Prevent overflow on charts tooltip (#19123) @bernardobelchior
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-charts-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
60
|
+
|
|
61
|
+
Same changes as in `@mui/x-charts@8.10.1`.
|
|
62
|
+
|
|
63
|
+
### Tree View
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-tree-view@8.10.1`
|
|
66
|
+
|
|
67
|
+
Internal changes.
|
|
68
|
+
|
|
69
|
+
#### `@mui/x-tree-view-pro@8.10.1` [](https://mui.com/r/x-pro-svg-link "Pro plan")
|
|
70
|
+
|
|
71
|
+
Same changes as in `@mui/x-tree-view@8.10.1`.
|
|
72
|
+
|
|
73
|
+
### Codemod
|
|
74
|
+
|
|
75
|
+
#### `@mui/x-codemod@8.10.1`
|
|
76
|
+
|
|
77
|
+
Internal changes.
|
|
78
|
+
|
|
79
|
+
### Docs
|
|
80
|
+
|
|
81
|
+
- [docs] Add all planned charts on the overview page (#19077) @prakhargupta1
|
|
82
|
+
- [docs] Add future charts components link in the sidebar (#19140) @prakhargupta1
|
|
83
|
+
- [docs] Fix Heatmap docs duplicate text (#19138) @JCQuintas
|
|
84
|
+
- [docs] Remove preview from Toolbar & Funnel (#19131) @mnajdova
|
|
85
|
+
- [docs] Reproduce npm sparkline (#19089) @alexfauquette
|
|
86
|
+
|
|
87
|
+
### Core
|
|
88
|
+
|
|
89
|
+
- [core] Fix licensing model name (#19025) @oliviertassinari
|
|
90
|
+
- [core] Fix usage of `:catalog` for `@babel/runtime` (#19028) @oliviertassinari
|
|
91
|
+
- [core] Refactor virtualizer API (#18995) @romgrk
|
|
92
|
+
|
|
93
|
+
### Miscellaneous
|
|
94
|
+
|
|
95
|
+
- [code-infra] Remove namespaces (#19071) @Janpot
|
|
96
|
+
- [code-infra] Fix `fs-extra` removal from `formattedTSDemos` script (#19132) @bernardobelchior
|
|
97
|
+
- [code-infra] Remove unused code and dependency (#19139) @bernardobelchior
|
|
98
|
+
- [code-infra] Replace `fs-extra` with `node:fs` where possible (#19127) @bernardobelchior
|
|
99
|
+
- [internal] Edit, keep `lockFileMaintenance` simple @oliviertassinari
|
|
100
|
+
- [internal] Fix writing style action name @oliviertassinari
|
|
101
|
+
- [internal] Make it clear that `lockFileMaintenance` is enabled @oliviertassinari
|
|
102
|
+
- [support-infra] Remove default issue label (#19104) @oliviertassinari
|
|
103
|
+
|
|
8
104
|
## 8.10.0
|
|
9
105
|
|
|
10
106
|
_Aug 8, 2025_
|
package/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
6
6
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
7
|
-
import { selectorItemMeta, selectorIsItemSelected, useInstanceEventHandler, selectorDataSourceState, selectorGetTreeItemError } from '@mui/x-tree-view/internals';
|
|
7
|
+
import { selectorItemMeta, selectorIsItemSelected, useInstanceEventHandler, selectorDataSourceState, selectorGetTreeItemError, selectorExpandedItems } from '@mui/x-tree-view/internals';
|
|
8
8
|
import { DataSourceCacheDefault } from '@mui/x-tree-view/utils';
|
|
9
9
|
import { NestedDataManager } from "./utils.js";
|
|
10
10
|
const INITIAL_STATE = {
|
|
@@ -99,19 +99,23 @@ export const useTreeViewLazyLoading = ({
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
nestedDataManager.clear();
|
|
102
|
-
|
|
102
|
+
// handle loading here
|
|
103
|
+
instance.setTreeViewLoading(true);
|
|
103
104
|
// reset the state if we are refetching the first visible items
|
|
104
105
|
if (selectorDataSourceState(store.value) !== INITIAL_STATE) {
|
|
105
106
|
resetDataSourceState();
|
|
106
107
|
}
|
|
107
108
|
// handle caching here
|
|
108
109
|
const cachedData = cacheRef.current.get('root');
|
|
109
|
-
if (cachedData !== undefined) {
|
|
110
|
+
if (cachedData !== undefined && cachedData !== -1) {
|
|
111
|
+
instance.addItems({
|
|
112
|
+
items: cachedData,
|
|
113
|
+
depth: 0,
|
|
114
|
+
getChildrenCount
|
|
115
|
+
});
|
|
116
|
+
instance.setTreeViewLoading(false);
|
|
110
117
|
return;
|
|
111
118
|
}
|
|
112
|
-
|
|
113
|
-
// handle loading here
|
|
114
|
-
instance.setTreeViewLoading(true);
|
|
115
119
|
try {
|
|
116
120
|
const getTreeItemsResponse = await getTreeItems();
|
|
117
121
|
|
|
@@ -206,6 +210,8 @@ export const useTreeViewLazyLoading = ({
|
|
|
206
210
|
if (!isLazyLoadingEnabled || !eventParameters.shouldBeExpanded) {
|
|
207
211
|
return;
|
|
208
212
|
}
|
|
213
|
+
// prevent the default expansion behavior
|
|
214
|
+
|
|
209
215
|
eventParameters.isExpansionPrevented = true;
|
|
210
216
|
await instance.fetchItems([eventParameters.itemId]);
|
|
211
217
|
const fetchErrors = Boolean(selectorGetTreeItemError(store.value, eventParameters.itemId));
|
|
@@ -241,6 +247,10 @@ export const useTreeViewLazyLoading = ({
|
|
|
241
247
|
getChildrenCount
|
|
242
248
|
});
|
|
243
249
|
} else {
|
|
250
|
+
const expandedItems = selectorExpandedItems(store.value);
|
|
251
|
+
if (expandedItems.length > 0) {
|
|
252
|
+
instance.resetItemExpansion();
|
|
253
|
+
}
|
|
244
254
|
instance.fetchItems();
|
|
245
255
|
}
|
|
246
256
|
firstRenderRef.current = false;
|
|
@@ -21,65 +21,63 @@ export let RequestStatus = /*#__PURE__*/function (RequestStatus) {
|
|
|
21
21
|
* Uses `ParentId` to uniquely identify a request
|
|
22
22
|
*/
|
|
23
23
|
export class NestedDataManager {
|
|
24
|
+
pendingRequests = (() => new Set())();
|
|
25
|
+
queuedRequests = (() => new Set())();
|
|
26
|
+
settledRequests = (() => new Set())();
|
|
24
27
|
constructor(instance, maxConcurrentRequests = MAX_CONCURRENT_REQUESTS) {
|
|
25
|
-
this.pendingRequests = new Set();
|
|
26
|
-
this.queuedRequests = new Set();
|
|
27
|
-
this.settledRequests = new Set();
|
|
28
|
-
this.instance = void 0;
|
|
29
|
-
this.maxConcurrentRequests = void 0;
|
|
30
|
-
this.processQueue = async () => {
|
|
31
|
-
if (this.queuedRequests.size === 0 || this.pendingRequests.size >= this.maxConcurrentRequests) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const loopLength = Math.min(this.maxConcurrentRequests - this.pendingRequests.size, this.queuedRequests.size);
|
|
35
|
-
if (loopLength === 0) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const fetchQueue = Array.from(this.queuedRequests);
|
|
39
|
-
const fetchPromises = [];
|
|
40
|
-
for (let i = 0; i < loopLength; i += 1) {
|
|
41
|
-
const id = fetchQueue[i];
|
|
42
|
-
this.queuedRequests.delete(id);
|
|
43
|
-
this.pendingRequests.add(id);
|
|
44
|
-
fetchPromises.push(this.instance.fetchItemChildren(id));
|
|
45
|
-
}
|
|
46
|
-
await Promise.all(fetchPromises);
|
|
47
|
-
};
|
|
48
|
-
this.queue = async ids => {
|
|
49
|
-
const loadingIds = {};
|
|
50
|
-
ids.forEach(id => {
|
|
51
|
-
this.queuedRequests.add(id);
|
|
52
|
-
loadingIds[id] = true;
|
|
53
|
-
});
|
|
54
|
-
await this.processQueue();
|
|
55
|
-
};
|
|
56
|
-
this.setRequestSettled = async id => {
|
|
57
|
-
this.pendingRequests.delete(id);
|
|
58
|
-
this.settledRequests.add(id);
|
|
59
|
-
await this.processQueue();
|
|
60
|
-
};
|
|
61
|
-
this.clear = () => {
|
|
62
|
-
this.queuedRequests.clear();
|
|
63
|
-
Array.from(this.pendingRequests).forEach(id => this.clearPendingRequest(id));
|
|
64
|
-
};
|
|
65
|
-
this.clearPendingRequest = async id => {
|
|
66
|
-
this.pendingRequests.delete(id);
|
|
67
|
-
await this.processQueue();
|
|
68
|
-
};
|
|
69
|
-
this.getRequestStatus = id => {
|
|
70
|
-
if (this.pendingRequests.has(id)) {
|
|
71
|
-
return RequestStatus.PENDING;
|
|
72
|
-
}
|
|
73
|
-
if (this.queuedRequests.has(id)) {
|
|
74
|
-
return RequestStatus.QUEUED;
|
|
75
|
-
}
|
|
76
|
-
if (this.settledRequests.has(id)) {
|
|
77
|
-
return RequestStatus.SETTLED;
|
|
78
|
-
}
|
|
79
|
-
return RequestStatus.UNKNOWN;
|
|
80
|
-
};
|
|
81
|
-
this.getActiveRequestsCount = () => this.pendingRequests.size + this.queuedRequests.size;
|
|
82
28
|
this.instance = instance;
|
|
83
29
|
this.maxConcurrentRequests = maxConcurrentRequests;
|
|
84
30
|
}
|
|
31
|
+
processQueue = async () => {
|
|
32
|
+
if (this.queuedRequests.size === 0 || this.pendingRequests.size >= this.maxConcurrentRequests) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const loopLength = Math.min(this.maxConcurrentRequests - this.pendingRequests.size, this.queuedRequests.size);
|
|
36
|
+
if (loopLength === 0) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const fetchQueue = Array.from(this.queuedRequests);
|
|
40
|
+
const fetchPromises = [];
|
|
41
|
+
for (let i = 0; i < loopLength; i += 1) {
|
|
42
|
+
const id = fetchQueue[i];
|
|
43
|
+
this.queuedRequests.delete(id);
|
|
44
|
+
this.pendingRequests.add(id);
|
|
45
|
+
fetchPromises.push(this.instance.fetchItemChildren(id));
|
|
46
|
+
}
|
|
47
|
+
await Promise.all(fetchPromises);
|
|
48
|
+
};
|
|
49
|
+
queue = async ids => {
|
|
50
|
+
const loadingIds = {};
|
|
51
|
+
ids.forEach(id => {
|
|
52
|
+
this.queuedRequests.add(id);
|
|
53
|
+
loadingIds[id] = true;
|
|
54
|
+
});
|
|
55
|
+
await this.processQueue();
|
|
56
|
+
};
|
|
57
|
+
setRequestSettled = async id => {
|
|
58
|
+
this.pendingRequests.delete(id);
|
|
59
|
+
this.settledRequests.add(id);
|
|
60
|
+
await this.processQueue();
|
|
61
|
+
};
|
|
62
|
+
clear = () => {
|
|
63
|
+
this.queuedRequests.clear();
|
|
64
|
+
Array.from(this.pendingRequests).forEach(id => this.clearPendingRequest(id));
|
|
65
|
+
};
|
|
66
|
+
clearPendingRequest = async id => {
|
|
67
|
+
this.pendingRequests.delete(id);
|
|
68
|
+
await this.processQueue();
|
|
69
|
+
};
|
|
70
|
+
getRequestStatus = id => {
|
|
71
|
+
if (this.pendingRequests.has(id)) {
|
|
72
|
+
return RequestStatus.PENDING;
|
|
73
|
+
}
|
|
74
|
+
if (this.queuedRequests.has(id)) {
|
|
75
|
+
return RequestStatus.QUEUED;
|
|
76
|
+
}
|
|
77
|
+
if (this.settledRequests.has(id)) {
|
|
78
|
+
return RequestStatus.SETTLED;
|
|
79
|
+
}
|
|
80
|
+
return RequestStatus.UNKNOWN;
|
|
81
|
+
};
|
|
82
|
+
getActiveRequestsCount = () => this.pendingRequests.size + this.queuedRequests.size;
|
|
85
83
|
}
|
package/index.js
CHANGED
|
@@ -106,19 +106,23 @@ const useTreeViewLazyLoading = ({
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
nestedDataManager.clear();
|
|
109
|
-
|
|
109
|
+
// handle loading here
|
|
110
|
+
instance.setTreeViewLoading(true);
|
|
110
111
|
// reset the state if we are refetching the first visible items
|
|
111
112
|
if ((0, _internals.selectorDataSourceState)(store.value) !== INITIAL_STATE) {
|
|
112
113
|
resetDataSourceState();
|
|
113
114
|
}
|
|
114
115
|
// handle caching here
|
|
115
116
|
const cachedData = cacheRef.current.get('root');
|
|
116
|
-
if (cachedData !== undefined) {
|
|
117
|
+
if (cachedData !== undefined && cachedData !== -1) {
|
|
118
|
+
instance.addItems({
|
|
119
|
+
items: cachedData,
|
|
120
|
+
depth: 0,
|
|
121
|
+
getChildrenCount
|
|
122
|
+
});
|
|
123
|
+
instance.setTreeViewLoading(false);
|
|
117
124
|
return;
|
|
118
125
|
}
|
|
119
|
-
|
|
120
|
-
// handle loading here
|
|
121
|
-
instance.setTreeViewLoading(true);
|
|
122
126
|
try {
|
|
123
127
|
const getTreeItemsResponse = await getTreeItems();
|
|
124
128
|
|
|
@@ -213,6 +217,8 @@ const useTreeViewLazyLoading = ({
|
|
|
213
217
|
if (!isLazyLoadingEnabled || !eventParameters.shouldBeExpanded) {
|
|
214
218
|
return;
|
|
215
219
|
}
|
|
220
|
+
// prevent the default expansion behavior
|
|
221
|
+
|
|
216
222
|
eventParameters.isExpansionPrevented = true;
|
|
217
223
|
await instance.fetchItems([eventParameters.itemId]);
|
|
218
224
|
const fetchErrors = Boolean((0, _internals.selectorGetTreeItemError)(store.value, eventParameters.itemId));
|
|
@@ -248,6 +254,10 @@ const useTreeViewLazyLoading = ({
|
|
|
248
254
|
getChildrenCount
|
|
249
255
|
});
|
|
250
256
|
} else {
|
|
257
|
+
const expandedItems = (0, _internals.selectorExpandedItems)(store.value);
|
|
258
|
+
if (expandedItems.length > 0) {
|
|
259
|
+
instance.resetItemExpansion();
|
|
260
|
+
}
|
|
251
261
|
instance.fetchItems();
|
|
252
262
|
}
|
|
253
263
|
firstRenderRef.current = false;
|
|
@@ -24,66 +24,64 @@ let RequestStatus = exports.RequestStatus = /*#__PURE__*/function (RequestStatus
|
|
|
24
24
|
* Uses `ParentId` to uniquely identify a request
|
|
25
25
|
*/
|
|
26
26
|
class NestedDataManager {
|
|
27
|
+
pendingRequests = new Set();
|
|
28
|
+
queuedRequests = new Set();
|
|
29
|
+
settledRequests = new Set();
|
|
27
30
|
constructor(instance, maxConcurrentRequests = MAX_CONCURRENT_REQUESTS) {
|
|
28
|
-
this.pendingRequests = new Set();
|
|
29
|
-
this.queuedRequests = new Set();
|
|
30
|
-
this.settledRequests = new Set();
|
|
31
|
-
this.instance = void 0;
|
|
32
|
-
this.maxConcurrentRequests = void 0;
|
|
33
|
-
this.processQueue = async () => {
|
|
34
|
-
if (this.queuedRequests.size === 0 || this.pendingRequests.size >= this.maxConcurrentRequests) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const loopLength = Math.min(this.maxConcurrentRequests - this.pendingRequests.size, this.queuedRequests.size);
|
|
38
|
-
if (loopLength === 0) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const fetchQueue = Array.from(this.queuedRequests);
|
|
42
|
-
const fetchPromises = [];
|
|
43
|
-
for (let i = 0; i < loopLength; i += 1) {
|
|
44
|
-
const id = fetchQueue[i];
|
|
45
|
-
this.queuedRequests.delete(id);
|
|
46
|
-
this.pendingRequests.add(id);
|
|
47
|
-
fetchPromises.push(this.instance.fetchItemChildren(id));
|
|
48
|
-
}
|
|
49
|
-
await Promise.all(fetchPromises);
|
|
50
|
-
};
|
|
51
|
-
this.queue = async ids => {
|
|
52
|
-
const loadingIds = {};
|
|
53
|
-
ids.forEach(id => {
|
|
54
|
-
this.queuedRequests.add(id);
|
|
55
|
-
loadingIds[id] = true;
|
|
56
|
-
});
|
|
57
|
-
await this.processQueue();
|
|
58
|
-
};
|
|
59
|
-
this.setRequestSettled = async id => {
|
|
60
|
-
this.pendingRequests.delete(id);
|
|
61
|
-
this.settledRequests.add(id);
|
|
62
|
-
await this.processQueue();
|
|
63
|
-
};
|
|
64
|
-
this.clear = () => {
|
|
65
|
-
this.queuedRequests.clear();
|
|
66
|
-
Array.from(this.pendingRequests).forEach(id => this.clearPendingRequest(id));
|
|
67
|
-
};
|
|
68
|
-
this.clearPendingRequest = async id => {
|
|
69
|
-
this.pendingRequests.delete(id);
|
|
70
|
-
await this.processQueue();
|
|
71
|
-
};
|
|
72
|
-
this.getRequestStatus = id => {
|
|
73
|
-
if (this.pendingRequests.has(id)) {
|
|
74
|
-
return RequestStatus.PENDING;
|
|
75
|
-
}
|
|
76
|
-
if (this.queuedRequests.has(id)) {
|
|
77
|
-
return RequestStatus.QUEUED;
|
|
78
|
-
}
|
|
79
|
-
if (this.settledRequests.has(id)) {
|
|
80
|
-
return RequestStatus.SETTLED;
|
|
81
|
-
}
|
|
82
|
-
return RequestStatus.UNKNOWN;
|
|
83
|
-
};
|
|
84
|
-
this.getActiveRequestsCount = () => this.pendingRequests.size + this.queuedRequests.size;
|
|
85
31
|
this.instance = instance;
|
|
86
32
|
this.maxConcurrentRequests = maxConcurrentRequests;
|
|
87
33
|
}
|
|
34
|
+
processQueue = async () => {
|
|
35
|
+
if (this.queuedRequests.size === 0 || this.pendingRequests.size >= this.maxConcurrentRequests) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const loopLength = Math.min(this.maxConcurrentRequests - this.pendingRequests.size, this.queuedRequests.size);
|
|
39
|
+
if (loopLength === 0) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const fetchQueue = Array.from(this.queuedRequests);
|
|
43
|
+
const fetchPromises = [];
|
|
44
|
+
for (let i = 0; i < loopLength; i += 1) {
|
|
45
|
+
const id = fetchQueue[i];
|
|
46
|
+
this.queuedRequests.delete(id);
|
|
47
|
+
this.pendingRequests.add(id);
|
|
48
|
+
fetchPromises.push(this.instance.fetchItemChildren(id));
|
|
49
|
+
}
|
|
50
|
+
await Promise.all(fetchPromises);
|
|
51
|
+
};
|
|
52
|
+
queue = async ids => {
|
|
53
|
+
const loadingIds = {};
|
|
54
|
+
ids.forEach(id => {
|
|
55
|
+
this.queuedRequests.add(id);
|
|
56
|
+
loadingIds[id] = true;
|
|
57
|
+
});
|
|
58
|
+
await this.processQueue();
|
|
59
|
+
};
|
|
60
|
+
setRequestSettled = async id => {
|
|
61
|
+
this.pendingRequests.delete(id);
|
|
62
|
+
this.settledRequests.add(id);
|
|
63
|
+
await this.processQueue();
|
|
64
|
+
};
|
|
65
|
+
clear = () => {
|
|
66
|
+
this.queuedRequests.clear();
|
|
67
|
+
Array.from(this.pendingRequests).forEach(id => this.clearPendingRequest(id));
|
|
68
|
+
};
|
|
69
|
+
clearPendingRequest = async id => {
|
|
70
|
+
this.pendingRequests.delete(id);
|
|
71
|
+
await this.processQueue();
|
|
72
|
+
};
|
|
73
|
+
getRequestStatus = id => {
|
|
74
|
+
if (this.pendingRequests.has(id)) {
|
|
75
|
+
return RequestStatus.PENDING;
|
|
76
|
+
}
|
|
77
|
+
if (this.queuedRequests.has(id)) {
|
|
78
|
+
return RequestStatus.QUEUED;
|
|
79
|
+
}
|
|
80
|
+
if (this.settledRequests.has(id)) {
|
|
81
|
+
return RequestStatus.SETTLED;
|
|
82
|
+
}
|
|
83
|
+
return RequestStatus.UNKNOWN;
|
|
84
|
+
};
|
|
85
|
+
getActiveRequestsCount = () => this.pendingRequests.size + this.queuedRequests.size;
|
|
88
86
|
}
|
|
89
87
|
exports.NestedDataManager = NestedDataManager;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-tree-view-pro",
|
|
3
|
-
"version": "8.10.
|
|
3
|
+
"version": "8.10.1",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Pro plan edition of the MUI X Tree View components.",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "^7.28.2",
|
|
36
|
-
"@mui/utils": "^7.
|
|
36
|
+
"@mui/utils": "^7.3.1",
|
|
37
37
|
"@types/react-transition-group": "^4.4.12",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
39
39
|
"prop-types": "^15.8.1",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"reselect": "^5.1.1",
|
|
42
42
|
"use-sync-external-store": "^1.5.0",
|
|
43
43
|
"@mui/x-internals": "8.10.0",
|
|
44
|
-
"@mui/x-
|
|
45
|
-
"@mui/x-
|
|
44
|
+
"@mui/x-license": "8.10.1",
|
|
45
|
+
"@mui/x-tree-view": "8.10.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@emotion/react": "^11.9.0",
|
|
@@ -63,31 +63,30 @@
|
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=14.0.0"
|
|
65
65
|
},
|
|
66
|
-
"
|
|
66
|
+
"type": "commonjs",
|
|
67
|
+
"types": "./index.d.ts",
|
|
67
68
|
"exports": {
|
|
68
69
|
"./package.json": "./package.json",
|
|
69
70
|
".": {
|
|
70
|
-
"require": {
|
|
71
|
-
"types": "./index.d.ts",
|
|
72
|
-
"default": "./index.js"
|
|
73
|
-
},
|
|
74
71
|
"import": {
|
|
75
72
|
"types": "./esm/index.d.ts",
|
|
76
73
|
"default": "./esm/index.js"
|
|
74
|
+
},
|
|
75
|
+
"require": {
|
|
76
|
+
"types": "./index.d.ts",
|
|
77
|
+
"default": "./index.js"
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
"./*": {
|
|
80
|
-
"require": {
|
|
81
|
-
"types": "./*/index.d.ts",
|
|
82
|
-
"default": "./*/index.js"
|
|
83
|
-
},
|
|
84
81
|
"import": {
|
|
85
82
|
"types": "./esm/*/index.d.ts",
|
|
86
83
|
"default": "./esm/*/index.js"
|
|
84
|
+
},
|
|
85
|
+
"require": {
|
|
86
|
+
"types": "./*/index.d.ts",
|
|
87
|
+
"default": "./*/index.js"
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
|
-
"./esm": null
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
"types": "./index.d.ts"
|
|
90
|
+
"./esm": null
|
|
91
|
+
}
|
|
93
92
|
}
|