@mui/x-tree-view 8.12.0 → 8.13.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 +207 -0
- package/RichTreeView/RichTreeView.js +5 -5
- package/RichTreeView/RichTreeView.types.d.ts +2 -3
- package/RichTreeView/index.d.ts +1 -1
- package/SimpleTreeView/SimpleTreeView.types.d.ts +2 -3
- package/SimpleTreeView/index.d.ts +1 -1
- package/esm/RichTreeView/RichTreeView.js +5 -5
- package/esm/RichTreeView/RichTreeView.types.d.ts +2 -3
- package/esm/RichTreeView/index.d.ts +1 -1
- package/esm/SimpleTreeView/SimpleTreeView.types.d.ts +2 -3
- package/esm/SimpleTreeView/index.d.ts +1 -1
- package/esm/hooks/useApplyPropagationToSelectedItemsOnMount.js +2 -2
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +2 -2
- package/esm/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +4 -4
- package/esm/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +1 -1
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.js +79 -158
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.d.ts +0 -8
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.js +0 -8
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +12 -26
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.utils.d.ts +36 -2
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.utils.js +115 -1
- package/esm/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +6 -6
- package/esm/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +1 -1
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +2 -2
- package/esm/internals/plugins/useTreeViewLazyLoading/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.d.ts +6 -2
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.js +7 -2
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.d.ts +8 -9
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.js +12 -3
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +2 -2
- package/esm/internals/useTreeView/useTreeView.js +2 -2
- package/esm/useTreeItem/useTreeItem.js +3 -3
- package/hooks/useApplyPropagationToSelectedItemsOnMount.js +2 -3
- package/index.js +1 -1
- package/internals/index.d.ts +2 -2
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +8 -8
- package/internals/plugins/useTreeViewFocus/useTreeViewFocus.js +4 -4
- package/internals/plugins/useTreeViewItems/useTreeViewItems.js +80 -159
- package/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.d.ts +0 -8
- package/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.js +0 -8
- package/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +12 -26
- package/internals/plugins/useTreeViewItems/useTreeViewItems.utils.d.ts +36 -2
- package/internals/plugins/useTreeViewItems/useTreeViewItems.utils.js +119 -2
- package/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js +8 -8
- package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +2 -3
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +2 -2
- package/internals/plugins/useTreeViewLazyLoading/index.d.ts +1 -1
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.d.ts +6 -2
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.js +7 -2
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.d.ts +8 -9
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.js +12 -3
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +2 -2
- package/internals/useTreeView/useTreeView.js +2 -2
- package/package.json +3 -3
- package/useTreeItem/useTreeItem.js +3 -3
- package/esm/internals/hooks/useLazyRef.d.ts +0 -1
- package/esm/internals/hooks/useLazyRef.js +0 -1
- package/esm/internals/hooks/useOnMount.d.ts +0 -1
- package/esm/internals/hooks/useOnMount.js +0 -1
- package/esm/internals/hooks/useTimeout.d.ts +0 -1
- package/esm/internals/hooks/useTimeout.js +0 -1
- package/internals/hooks/useLazyRef.d.ts +0 -1
- package/internals/hooks/useLazyRef.js +0 -13
- package/internals/hooks/useOnMount.d.ts +0 -1
- package/internals/hooks/useOnMount.js +0 -13
- package/internals/hooks/useTimeout.d.ts +0 -1
- package/internals/hooks/useTimeout.js +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,213 @@
|
|
|
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.13.1
|
|
9
|
+
|
|
10
|
+
_Oct 1, 2025_
|
|
11
|
+
|
|
12
|
+
- 🐛 Fix `@mui/x-charts-pro` failure on import due to missing `@mui/x-internals` release
|
|
13
|
+
|
|
14
|
+
### Data Grid
|
|
15
|
+
|
|
16
|
+
#### `@mui/x-data-grid@8.13.1`
|
|
17
|
+
|
|
18
|
+
Internal changes.
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid-pro@8.13.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
21
|
+
|
|
22
|
+
Same changes as in `@mui/x-data-grid@8.13.1`.
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-data-grid-premium@8.13.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
25
|
+
|
|
26
|
+
Same changes as in `@mui/x-data-grid-pro@8.13.1`.
|
|
27
|
+
|
|
28
|
+
### Date and Time Pickers
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-date-pickers@8.12.0`
|
|
31
|
+
|
|
32
|
+
Internal changes.
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-date-pickers-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-date-pickers@8.12.0`.
|
|
37
|
+
|
|
38
|
+
### Charts
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-charts@8.13.1`
|
|
41
|
+
|
|
42
|
+
Internal changes.
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-charts-pro@8.13.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-charts@8.13.1`, plus:
|
|
47
|
+
|
|
48
|
+
- [charts-pro] Fix `@mui/x-charts-pro` failure on import due to missing `@mui/x-internals` release @bernardobelchior
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-charts-premium@8.13.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
51
|
+
|
|
52
|
+
Same changes as in `@mui/x-charts-pro@8.13.1`.
|
|
53
|
+
|
|
54
|
+
### Tree View
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-tree-view@8.13.1`
|
|
57
|
+
|
|
58
|
+
Internal changes.
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-tree-view-pro@8.13.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
61
|
+
|
|
62
|
+
Same changes as in `@mui/x-tree-view@8.13.1`.
|
|
63
|
+
|
|
64
|
+
### Codemod
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-codemod@8.12.0`
|
|
67
|
+
|
|
68
|
+
Internal changes.
|
|
69
|
+
|
|
70
|
+
## 8.13.0
|
|
71
|
+
|
|
72
|
+
_Oct 1, 2025_
|
|
73
|
+
|
|
74
|
+
We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
75
|
+
|
|
76
|
+
- 📊 The chart zoom now supports the `tapAndDrag` gesture. Zoom in/out by tapping twice and dragging vertically.
|
|
77
|
+
- 🔎 Charts now allow [fine-grained control for zoom interactions](https://mui.com/x/react-charts/zoom-and-pan/#zoom-interactions-configuration).
|
|
78
|
+
```jsx
|
|
79
|
+
<BarChartPro
|
|
80
|
+
zoomInteractionConfig={{
|
|
81
|
+
// Only zoom when Control key is pressed
|
|
82
|
+
zoom: [{ type: 'wheel', keys: ['Control'] }],
|
|
83
|
+
// Only pan when Shift key is pressed
|
|
84
|
+
pan: [{ type: 'drag', keys: ['Shift'] }],
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
```
|
|
88
|
+
- ➡️ Data Grid grouping rows now persist their expansion state when the rows are updated.
|
|
89
|
+
- 📜 Updated Data Grid vertical scrollbar to include pinned rows and aggregation sections.
|
|
90
|
+
- 📌 Improved the appearance of [pinned columns](https://mui.com/x/react-data-grid/column-pinning/#pinned-columns-appearance) and [pinned rows](https://mui.com/x/react-data-grid/row-pinning/#pinned-rows-appearance) sections in the Data Grid.
|
|
91
|
+
- 🚀 Tree View now fetches the children of expanded items on mount when using lazy loading.
|
|
92
|
+
- 🐞 Bugfixes
|
|
93
|
+
- 📚 Documentation improvements
|
|
94
|
+
|
|
95
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
96
|
+
@sai6855
|
|
97
|
+
|
|
98
|
+
The following are all team members who have contributed to this release:
|
|
99
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @hasdfa, @Janpot, @JCQuintas, @KenanYusuf, @mapache-salvaje, @MBilalShafi, @mnajdova, @rita-codes, @siriwatknp
|
|
100
|
+
|
|
101
|
+
### Data Grid
|
|
102
|
+
|
|
103
|
+
#### `@mui/x-data-grid@8.13.0`
|
|
104
|
+
|
|
105
|
+
- [DataGrid] Add scroll shadows and fix scrollbar overlap (#16476) @KenanYusuf
|
|
106
|
+
- [DataGrid] Fix row spanning stale state issue (#19733) @MBilalShafi
|
|
107
|
+
- [DataGrid] Fix toolbar `slotProps` not being applied (#19769) @sai6855
|
|
108
|
+
- [DataGrid] Skip calling `fetchRows()` when strategy is not initialized (#19728) @MBilalShafi
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-data-grid-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-data-grid@8.13.0`, plus:
|
|
113
|
+
|
|
114
|
+
- [DataGridPro] Retain expansion state on rows update (#19697) @MBilalShafi
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-data-grid-premium@8.13.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
117
|
+
|
|
118
|
+
Same changes as in `@mui/x-data-grid-pro@8.13.0`, plus:
|
|
119
|
+
|
|
120
|
+
- [DataGridPremium] Add `metadata.referenceId` to AI assistant prompt resolver (#19695) @hasdfa
|
|
121
|
+
- [DataGridPremium] Fix aggregation value retrieval (#19724) @arminmeh
|
|
122
|
+
- [DataGridPremium] Get correct active chart id while rebuilding data (#19720) @arminmeh
|
|
123
|
+
|
|
124
|
+
### Date and Time Pickers
|
|
125
|
+
|
|
126
|
+
#### `@mui/x-date-pickers@8.12.0`
|
|
127
|
+
|
|
128
|
+
Internal changes.
|
|
129
|
+
|
|
130
|
+
#### `@mui/x-date-pickers-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
131
|
+
|
|
132
|
+
Same changes as in `@mui/x-date-pickers@8.12.0`.
|
|
133
|
+
|
|
134
|
+
### Charts
|
|
135
|
+
|
|
136
|
+
#### `@mui/x-charts@8.13.0`
|
|
137
|
+
|
|
138
|
+
- [charts] Add `tapAndDrag` zoom gesture (#19727) @JCQuintas
|
|
139
|
+
- [charts] Add arc focus indicator that follows the arc form (#19696) @mnajdova
|
|
140
|
+
- [charts] Fix outline color (#19752) @alexfauquette
|
|
141
|
+
- [charts] Improve tooltip doc (#19731) @JCQuintas
|
|
142
|
+
- [charts] Make axis highlight reflect the keyboard interaction (#19631) @alexfauquette
|
|
143
|
+
- [charts] Prevent horizontal scroll on keyboard navigation (#19704) @alexfauquette
|
|
144
|
+
- [charts] Simplify gestures by removing bindings (#19767) @JCQuintas
|
|
145
|
+
|
|
146
|
+
#### `@mui/x-charts-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
147
|
+
|
|
148
|
+
Same changes as in `@mui/x-charts@8.13.0`, plus:
|
|
149
|
+
|
|
150
|
+
- [charts-pro] Allow zoom interactions to be configured (#18646) @JCQuintas
|
|
151
|
+
- [charts-pro] Fix zoom preview having wrong domain in some cases (#19723) @bernardobelchior
|
|
152
|
+
|
|
153
|
+
#### `@mui/x-charts-premium@8.13.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
154
|
+
|
|
155
|
+
Same changes as in `@mui/x-charts-pro@8.13.0`.
|
|
156
|
+
|
|
157
|
+
### Tree View
|
|
158
|
+
|
|
159
|
+
#### `@mui/x-tree-view@8.13.0`
|
|
160
|
+
|
|
161
|
+
- [tree view] Export the `apiRef` type of each Tree View component (#19543) @flaviendelangle
|
|
162
|
+
- [tree view] Fix indeterminate checkbox state (#19544) @flaviendelangle
|
|
163
|
+
- [tree view] Improve the lazy loading initial expansion (#19284) @flaviendelangle
|
|
164
|
+
- [tree view] Use Base UI utils whenever possible (#19502) @flaviendelangle
|
|
165
|
+
|
|
166
|
+
#### `@mui/x-tree-view-pro@8.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
167
|
+
|
|
168
|
+
Same changes as in `@mui/x-tree-view@8.13.0`.
|
|
169
|
+
|
|
170
|
+
### Codemod
|
|
171
|
+
|
|
172
|
+
#### `@mui/x-codemod@8.12.0`
|
|
173
|
+
|
|
174
|
+
Internal changes.
|
|
175
|
+
|
|
176
|
+
### Docs
|
|
177
|
+
|
|
178
|
+
- [docs] Add a recipe to customize editing component with Autocomplete (#19651) @siriwatknp
|
|
179
|
+
- [docs] Refine the electricity scatter tooltip (#19689) @alexfauquette
|
|
180
|
+
- [docs] Revise the Axis doc (#19052) @mapache-salvaje
|
|
181
|
+
- [docs] Remove reference to nonexistent `FocusedMark` API page (#19773) @bernardobelchior
|
|
182
|
+
|
|
183
|
+
### Core
|
|
184
|
+
|
|
185
|
+
- [code-infra] Change charts codspeed integration to use walltime (#19729) @JCQuintas
|
|
186
|
+
- [code-infra] Port stylelint from core repo (#19633) @Janpot
|
|
187
|
+
- [code-infra] Stabilize fake timers in regression tests (#19719) @Janpot
|
|
188
|
+
- [code-infra] Stabilize size for bundles with `releaseInfo` (#19674) @Janpot
|
|
189
|
+
- [code-infra] Fix `pnpm-lock.yaml` broken lockfile (#19755) @bernardobelchior
|
|
190
|
+
|
|
191
|
+
## 8.12.1
|
|
192
|
+
|
|
193
|
+
_Sep 25, 2025_
|
|
194
|
+
|
|
195
|
+
Release highlight ✨:
|
|
196
|
+
|
|
197
|
+
- 🐞 Hotfix for Grid-Charts integration issue with aggregated values
|
|
198
|
+
|
|
199
|
+
### Data Grid
|
|
200
|
+
|
|
201
|
+
#### `@mui/x-data-grid@8.12.1`
|
|
202
|
+
|
|
203
|
+
Internal changes.
|
|
204
|
+
|
|
205
|
+
#### `@mui/x-data-grid-pro@8.12.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
206
|
+
|
|
207
|
+
Same changes as in `@mui/x-data-grid@8.12.1`.
|
|
208
|
+
|
|
209
|
+
#### `@mui/x-data-grid-premium@8.12.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
210
|
+
|
|
211
|
+
Same changes as in `@mui/x-data-grid-pro@8.12.1`, plus:
|
|
212
|
+
|
|
213
|
+
- [DataGridPremium] Collect aggregated values properly for the charts integration context (#19714) @arminmeh
|
|
214
|
+
|
|
8
215
|
## 8.12.0
|
|
9
216
|
|
|
10
217
|
_Sep 25, 2025_
|
|
@@ -23,7 +23,7 @@ var _useTreeView = require("../internals/useTreeView");
|
|
|
23
23
|
var _TreeViewProvider = require("../internals/TreeViewProvider");
|
|
24
24
|
var _RichTreeView2 = require("./RichTreeView.plugins");
|
|
25
25
|
var _RichTreeViewItems = require("../internals/components/RichTreeViewItems");
|
|
26
|
-
var
|
|
26
|
+
var _useTreeViewLazyLoading = require("../internals/plugins/useTreeViewLazyLoading");
|
|
27
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
28
|
const _excluded = ["slots", "slotProps"];
|
|
29
29
|
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiRichTreeView');
|
|
@@ -90,8 +90,8 @@ const RichTreeView = exports.RichTreeView = /*#__PURE__*/React.forwardRef(functi
|
|
|
90
90
|
rootRef: ref,
|
|
91
91
|
props: other
|
|
92
92
|
});
|
|
93
|
-
const isLoading = (0, _store.useStore)(contextValue.store,
|
|
94
|
-
const
|
|
93
|
+
const isLoading = (0, _store.useStore)(contextValue.store, _useTreeViewLazyLoading.lazyLoadingSelectors.isItemLoading, null);
|
|
94
|
+
const error = (0, _store.useStore)(contextValue.store, _useTreeViewLazyLoading.lazyLoadingSelectors.itemError, null);
|
|
95
95
|
const classes = useUtilityClasses(props);
|
|
96
96
|
const Root = slots?.root ?? RichTreeViewRoot;
|
|
97
97
|
const rootProps = (0, _useSlotProps.default)({
|
|
@@ -106,10 +106,10 @@ const RichTreeView = exports.RichTreeView = /*#__PURE__*/React.forwardRef(functi
|
|
|
106
106
|
children: "Loading..."
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
109
|
+
if (error) {
|
|
110
110
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
111
111
|
severity: "error",
|
|
112
|
-
children:
|
|
112
|
+
children: error.message
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TreeViewProvider.TreeViewProvider, {
|
|
@@ -17,7 +17,7 @@ export interface RichTreeViewSlots extends TreeViewSlots, RichTreeViewItemsSlots
|
|
|
17
17
|
export interface RichTreeViewSlotProps<R extends {}, Multiple extends boolean | undefined> extends TreeViewSlotProps, RichTreeViewItemsSlotProps {
|
|
18
18
|
root?: SlotComponentProps<'ul', {}, RichTreeViewProps<R, Multiple>>;
|
|
19
19
|
}
|
|
20
|
-
type RichTreeViewApiRef = React.RefObject<Partial<TreeViewPublicAPI<RichTreeViewPluginSignatures>> | undefined>;
|
|
20
|
+
export type RichTreeViewApiRef = React.RefObject<Partial<TreeViewPublicAPI<RichTreeViewPluginSignatures>> | undefined>;
|
|
21
21
|
export interface RichTreeViewPropsBase extends React.HTMLAttributes<HTMLUListElement> {
|
|
22
22
|
className?: string;
|
|
23
23
|
/**
|
|
@@ -44,5 +44,4 @@ export interface RichTreeViewProps<R extends {}, Multiple extends boolean | unde
|
|
|
44
44
|
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
45
45
|
*/
|
|
46
46
|
apiRef?: RichTreeViewApiRef;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
47
|
+
}
|
package/RichTreeView/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./RichTreeView.js";
|
|
2
2
|
export * from "./richTreeViewClasses.js";
|
|
3
|
-
export type { RichTreeViewProps, RichTreeViewPropsBase, RichTreeViewSlots, RichTreeViewSlotProps } from "./RichTreeView.types.js";
|
|
3
|
+
export type { RichTreeViewProps, RichTreeViewPropsBase, RichTreeViewSlots, RichTreeViewSlotProps, RichTreeViewApiRef } from "./RichTreeView.types.js";
|
|
4
4
|
export { RICH_TREE_VIEW_PLUGINS } from "./RichTreeView.plugins.js";
|
|
5
5
|
export type { RichTreeViewPluginParameters } from "./RichTreeView.plugins.js";
|
|
@@ -16,7 +16,7 @@ export interface SimpleTreeViewSlots extends TreeViewSlots {
|
|
|
16
16
|
export interface SimpleTreeViewSlotProps extends TreeViewSlotProps {
|
|
17
17
|
root?: SlotComponentProps<'ul', {}, {}>;
|
|
18
18
|
}
|
|
19
|
-
type SimpleTreeViewApiRef = React.RefObject<Partial<TreeViewPublicAPI<SimpleTreeViewPluginSignatures>> | undefined>;
|
|
19
|
+
export type SimpleTreeViewApiRef = React.RefObject<Partial<TreeViewPublicAPI<SimpleTreeViewPluginSignatures>> | undefined>;
|
|
20
20
|
export interface SimpleTreeViewProps<Multiple extends boolean | undefined> extends SimpleTreeViewPluginParameters<Multiple>, React.HTMLAttributes<HTMLUListElement> {
|
|
21
21
|
/**
|
|
22
22
|
* The content of the component.
|
|
@@ -43,5 +43,4 @@ export interface SimpleTreeViewProps<Multiple extends boolean | undefined> exten
|
|
|
43
43
|
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
44
44
|
*/
|
|
45
45
|
apiRef?: SimpleTreeViewApiRef;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
46
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./SimpleTreeView.js";
|
|
2
2
|
export * from "./simpleTreeViewClasses.js";
|
|
3
|
-
export type { SimpleTreeViewProps, SimpleTreeViewSlots, SimpleTreeViewSlotProps } from "./SimpleTreeView.types.js";
|
|
3
|
+
export type { SimpleTreeViewProps, SimpleTreeViewSlots, SimpleTreeViewSlotProps, SimpleTreeViewApiRef } from "./SimpleTreeView.types.js";
|
|
@@ -17,7 +17,7 @@ import { useTreeView } from "../internals/useTreeView/index.js";
|
|
|
17
17
|
import { TreeViewProvider } from "../internals/TreeViewProvider/index.js";
|
|
18
18
|
import { RICH_TREE_VIEW_PLUGINS } from "./RichTreeView.plugins.js";
|
|
19
19
|
import { RichTreeViewItems } from "../internals/components/RichTreeViewItems.js";
|
|
20
|
-
import {
|
|
20
|
+
import { lazyLoadingSelectors } from "../internals/plugins/useTreeViewLazyLoading/index.js";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
const useThemeProps = createUseThemeProps('MuiRichTreeView');
|
|
23
23
|
const useUtilityClasses = ownerState => {
|
|
@@ -83,8 +83,8 @@ const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps
|
|
|
83
83
|
rootRef: ref,
|
|
84
84
|
props: other
|
|
85
85
|
});
|
|
86
|
-
const isLoading = useStore(contextValue.store,
|
|
87
|
-
const
|
|
86
|
+
const isLoading = useStore(contextValue.store, lazyLoadingSelectors.isItemLoading, null);
|
|
87
|
+
const error = useStore(contextValue.store, lazyLoadingSelectors.itemError, null);
|
|
88
88
|
const classes = useUtilityClasses(props);
|
|
89
89
|
const Root = slots?.root ?? RichTreeViewRoot;
|
|
90
90
|
const rootProps = useSlotProps({
|
|
@@ -99,10 +99,10 @@ const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps
|
|
|
99
99
|
children: "Loading..."
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
if (
|
|
102
|
+
if (error) {
|
|
103
103
|
return /*#__PURE__*/_jsx(Alert, {
|
|
104
104
|
severity: "error",
|
|
105
|
-
children:
|
|
105
|
+
children: error.message
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
return /*#__PURE__*/_jsx(TreeViewProvider, {
|
|
@@ -17,7 +17,7 @@ export interface RichTreeViewSlots extends TreeViewSlots, RichTreeViewItemsSlots
|
|
|
17
17
|
export interface RichTreeViewSlotProps<R extends {}, Multiple extends boolean | undefined> extends TreeViewSlotProps, RichTreeViewItemsSlotProps {
|
|
18
18
|
root?: SlotComponentProps<'ul', {}, RichTreeViewProps<R, Multiple>>;
|
|
19
19
|
}
|
|
20
|
-
type RichTreeViewApiRef = React.RefObject<Partial<TreeViewPublicAPI<RichTreeViewPluginSignatures>> | undefined>;
|
|
20
|
+
export type RichTreeViewApiRef = React.RefObject<Partial<TreeViewPublicAPI<RichTreeViewPluginSignatures>> | undefined>;
|
|
21
21
|
export interface RichTreeViewPropsBase extends React.HTMLAttributes<HTMLUListElement> {
|
|
22
22
|
className?: string;
|
|
23
23
|
/**
|
|
@@ -44,5 +44,4 @@ export interface RichTreeViewProps<R extends {}, Multiple extends boolean | unde
|
|
|
44
44
|
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
45
45
|
*/
|
|
46
46
|
apiRef?: RichTreeViewApiRef;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
47
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./RichTreeView.js";
|
|
2
2
|
export * from "./richTreeViewClasses.js";
|
|
3
|
-
export type { RichTreeViewProps, RichTreeViewPropsBase, RichTreeViewSlots, RichTreeViewSlotProps } from "./RichTreeView.types.js";
|
|
3
|
+
export type { RichTreeViewProps, RichTreeViewPropsBase, RichTreeViewSlots, RichTreeViewSlotProps, RichTreeViewApiRef } from "./RichTreeView.types.js";
|
|
4
4
|
export { RICH_TREE_VIEW_PLUGINS } from "./RichTreeView.plugins.js";
|
|
5
5
|
export type { RichTreeViewPluginParameters } from "./RichTreeView.plugins.js";
|
|
@@ -16,7 +16,7 @@ export interface SimpleTreeViewSlots extends TreeViewSlots {
|
|
|
16
16
|
export interface SimpleTreeViewSlotProps extends TreeViewSlotProps {
|
|
17
17
|
root?: SlotComponentProps<'ul', {}, {}>;
|
|
18
18
|
}
|
|
19
|
-
type SimpleTreeViewApiRef = React.RefObject<Partial<TreeViewPublicAPI<SimpleTreeViewPluginSignatures>> | undefined>;
|
|
19
|
+
export type SimpleTreeViewApiRef = React.RefObject<Partial<TreeViewPublicAPI<SimpleTreeViewPluginSignatures>> | undefined>;
|
|
20
20
|
export interface SimpleTreeViewProps<Multiple extends boolean | undefined> extends SimpleTreeViewPluginParameters<Multiple>, React.HTMLAttributes<HTMLUListElement> {
|
|
21
21
|
/**
|
|
22
22
|
* The content of the component.
|
|
@@ -43,5 +43,4 @@ export interface SimpleTreeViewProps<Multiple extends boolean | undefined> exten
|
|
|
43
43
|
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
44
44
|
*/
|
|
45
45
|
apiRef?: SimpleTreeViewApiRef;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
46
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./SimpleTreeView.js";
|
|
2
2
|
export * from "./simpleTreeViewClasses.js";
|
|
3
|
-
export type { SimpleTreeViewProps, SimpleTreeViewSlots, SimpleTreeViewSlotProps } from "./SimpleTreeView.types.js";
|
|
3
|
+
export type { SimpleTreeViewProps, SimpleTreeViewSlots, SimpleTreeViewSlotProps, SimpleTreeViewApiRef } from "./SimpleTreeView.types.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useRefWithInit } from '@base-ui-components/utils/useRefWithInit';
|
|
2
2
|
import { getLookupFromArray } from "../internals/plugins/useTreeViewSelection/useTreeViewSelection.utils.js";
|
|
3
3
|
const defaultGetItemId = item => item.id;
|
|
4
4
|
const defaultGetItemChildren = item => item.children;
|
|
@@ -52,7 +52,7 @@ export function useApplyPropagationToSelectedItemsOnMount(parameters) {
|
|
|
52
52
|
selectedItems,
|
|
53
53
|
selectionPropagation
|
|
54
54
|
} = parameters;
|
|
55
|
-
return
|
|
55
|
+
return useRefWithInit(() => {
|
|
56
56
|
const lookup = getLookupFromArray(selectedItems);
|
|
57
57
|
function walk(items, isParentSelected) {
|
|
58
58
|
for (const item of items) {
|
package/esm/index.js
CHANGED
package/esm/internals/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { TreeViewProvider, useTreeViewContext } from "./TreeViewProvider/index.j
|
|
|
3
3
|
export { RichTreeViewItems } from "./components/RichTreeViewItems.js";
|
|
4
4
|
export type { RichTreeViewItemsSlots, RichTreeViewItemsSlotProps } from "./components/RichTreeViewItems.js";
|
|
5
5
|
export { unstable_resetCleanupTracking, useInstanceEventHandler } from "./hooks/useInstanceEventHandler.js";
|
|
6
|
-
export type { TreeViewPlugin, TreeViewPluginSignature, ConvertPluginsIntoSignatures, MergeSignaturesProperty, TreeViewPublicAPI, TreeViewState, TreeViewItemMeta, TreeViewInstance, TreeViewItemPlugin, TreeViewUsedStore } from "./models/index.js";
|
|
6
|
+
export type { TreeViewPlugin, TreeViewPluginSignature, ConvertPluginsIntoSignatures, MergeSignaturesProperty, TreeViewPublicAPI, TreeViewState, TreeViewItemMeta, TreeViewInstance, TreeViewItemPlugin, TreeViewUsedStore, TreeViewUsedInstance, TreeViewUsedParamsWithDefaults } from "./models/index.js";
|
|
7
7
|
export type { TreeViewCorePluginParameters } from "./corePlugins/index.js";
|
|
8
8
|
export { useTreeViewExpansion, expansionSelectors } from "./plugins/useTreeViewExpansion/index.js";
|
|
9
9
|
export type { UseTreeViewExpansionSignature, UseTreeViewExpansionParameters } from "./plugins/useTreeViewExpansion/index.js";
|
|
@@ -17,7 +17,7 @@ export { useTreeViewItems, buildSiblingIndexes, itemsSelectors, TREE_VIEW_ROOT_P
|
|
|
17
17
|
export type { UseTreeViewItemsSignature, UseTreeViewItemsParameters, UseTreeViewItemsState } from "./plugins/useTreeViewItems/index.js";
|
|
18
18
|
export { useTreeViewLabel, labelSelectors } from "./plugins/useTreeViewLabel/index.js";
|
|
19
19
|
export type { UseTreeViewLabelSignature, UseTreeViewLabelParameters } from "./plugins/useTreeViewLabel/index.js";
|
|
20
|
-
export type { UseTreeViewLazyLoadingSignature, UseTreeViewLazyLoadingParameters, UseTreeViewLazyLoadingInstance } from "./plugins/useTreeViewLazyLoading/index.js";
|
|
20
|
+
export type { UseTreeViewLazyLoadingSignature, UseTreeViewLazyLoadingParameters, UseTreeViewLazyLoadingInstance, DataSource } from "./plugins/useTreeViewLazyLoading/index.js";
|
|
21
21
|
export { lazyLoadingSelectors } from "./plugins/useTreeViewLazyLoading/index.js";
|
|
22
22
|
export { useTreeViewJSXItems } from "./plugins/useTreeViewJSXItems/index.js";
|
|
23
23
|
export type { UseTreeViewJSXItemsSignature, UseTreeViewJSXItemsParameters } from "./plugins/useTreeViewJSXItems/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { useAssertModelConsistency } from '@mui/x-internals/useAssertModelConsistency';
|
|
3
|
-
import useEventCallback from '@
|
|
4
|
-
import
|
|
3
|
+
import { useEventCallback } from '@base-ui-components/utils/useEventCallback';
|
|
4
|
+
import { useIsoLayoutEffect } from '@base-ui-components/utils/useIsoLayoutEffect';
|
|
5
5
|
import { expansionSelectors } from "./useTreeViewExpansion.selectors.js";
|
|
6
6
|
import { getExpansionTrigger } from "./useTreeViewExpansion.utils.js";
|
|
7
7
|
import { itemsSelectors } from "../useTreeViewItems/useTreeViewItems.selectors.js";
|
|
@@ -17,7 +17,7 @@ export const useTreeViewExpansion = ({
|
|
|
17
17
|
controlled: params.expandedItems,
|
|
18
18
|
defaultValue: params.defaultExpandedItems
|
|
19
19
|
});
|
|
20
|
-
|
|
20
|
+
useIsoLayoutEffect(() => {
|
|
21
21
|
const newExpansionTrigger = getExpansionTrigger({
|
|
22
22
|
isItemEditable: params.isItemEditable,
|
|
23
23
|
expansionTrigger: params.expansionTrigger
|
|
@@ -107,7 +107,7 @@ export const useTreeViewExpansion = ({
|
|
|
107
107
|
/**
|
|
108
108
|
* Update the controlled model when the `expandedItems` prop changes.
|
|
109
109
|
*/
|
|
110
|
-
|
|
110
|
+
useIsoLayoutEffect(() => {
|
|
111
111
|
const expandedItems = params.expandedItems;
|
|
112
112
|
if (expandedItems !== undefined) {
|
|
113
113
|
store.set('expansion', _extends({}, store.state.expansion, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import useEventCallback from '@
|
|
2
|
+
import { useEventCallback } from '@base-ui-components/utils/useEventCallback';
|
|
3
3
|
import { useStoreEffect } from '@mui/x-internals/store';
|
|
4
4
|
import { focusSelectors } from "./useTreeViewFocus.selectors.js";
|
|
5
5
|
import { expansionSelectors } from "../useTreeViewExpansion/useTreeViewExpansion.selectors.js";
|