@mui/x-tree-view-pro 8.0.0-beta.1 → 8.0.0-beta.2
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 +94 -0
- package/RichTreeViewPro/RichTreeViewPro.js +19 -7
- package/RichTreeViewPro/richTreeViewProClasses.d.ts +2 -4
- package/RichTreeViewPro/richTreeViewProClasses.js +1 -1
- package/esm/RichTreeViewPro/RichTreeViewPro.js +19 -7
- package/esm/RichTreeViewPro/richTreeViewProClasses.d.ts +2 -4
- package/esm/RichTreeViewPro/richTreeViewProClasses.js +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.js +1 -20
- package/esm/internals/utils/releaseInfo.js +1 -1
- package/index.js +1 -1
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.js +1 -20
- package/internals/utils/releaseInfo.js +1 -1
- package/modern/RichTreeViewPro/RichTreeViewPro.js +19 -7
- package/modern/RichTreeViewPro/richTreeViewProClasses.d.ts +2 -4
- package/modern/RichTreeViewPro/richTreeViewProClasses.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.js +1 -20
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/package.json +4 -4
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,100 @@
|
|
|
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.0.0-beta.2
|
|
9
|
+
|
|
10
|
+
_Mar 27, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🔍 Update the Data Grid quick filter to be collapsed when not in use
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
|
|
17
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
18
|
+
@lhilgert9.
|
|
19
|
+
Following are all team members who have contributed to this release:
|
|
20
|
+
@alexfauquette, @arminmeh, @flaviendelangle, @hasdfa, @JCQuintas, @KenanYusuf, @LukasTy, @MBilalShafi, @michelengelen, @mnajdova, @romgrk.
|
|
21
|
+
|
|
22
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
23
|
+
|
|
24
|
+
### Data Grid
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid@8.0.0-beta.2`
|
|
27
|
+
|
|
28
|
+
- [DataGrid] Fix error caused by trying to render rows that are not in the state anymore (#17057) @arminmeh
|
|
29
|
+
- [DataGrid] Refactor: remove more material (#16922) @romgrk
|
|
30
|
+
- [DataGrid] Update Quick Filter component to be expandable (#16862) @KenanYusuf
|
|
31
|
+
- [DataGrid] Fix crash when used with `@mui/styled-engine-sc` (#17154) @KenanYusuf
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-pro@8.0.0-beta.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid@8.0.0-beta.2`, plus:
|
|
36
|
+
|
|
37
|
+
- [DataGridPro] Data source: Allow expanding groups with unknown children (#17144) @MBilalShafi
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-data-grid-premium@8.0.0-beta.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
40
|
+
|
|
41
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-beta.2`.
|
|
42
|
+
|
|
43
|
+
### Date and Time Pickers
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-date-pickers@8.0.0-beta.2`
|
|
46
|
+
|
|
47
|
+
- [fields] Extract the props of each field slot into a standalone hook for easier re-use (#17114) @flaviendelangle
|
|
48
|
+
- [pickers] Fix visual regression in Date Range Calendar's day (#17148) @flaviendelangle
|
|
49
|
+
- [pickers] Remove all code duplication to apply default values to validation props (#17038) @flaviendelangle
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers-pro@8.0.0-beta.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
52
|
+
|
|
53
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-beta.2`.
|
|
54
|
+
|
|
55
|
+
### Charts
|
|
56
|
+
|
|
57
|
+
#### `@mui/x-charts@8.0.0-beta.2`
|
|
58
|
+
|
|
59
|
+
- [charts] Memoize axes and series with default (#17156) @alexfauquette
|
|
60
|
+
- [charts] Add pie benchmark (#17115) @JCQuintas
|
|
61
|
+
- [charts] Fix CSS vars support for dark theme (#17106) @alexfauquette
|
|
62
|
+
- [charts] Fix radar hover (#17134) @alexfauquette
|
|
63
|
+
- [charts] Move axis interaction to selectors (#17039) @alexfauquette
|
|
64
|
+
- [charts] Fix Pie benchmark (#17125) @JCQuintas
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-charts-pro@8.0.0-beta.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
67
|
+
|
|
68
|
+
Same changes as in `@mui/x-charts@8.0.0-beta.2`.
|
|
69
|
+
|
|
70
|
+
### Tree View
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-tree-view@8.0.0-beta.2`
|
|
73
|
+
|
|
74
|
+
Internal changes.
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-tree-view-pro@8.0.0-beta.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
77
|
+
|
|
78
|
+
Same changes as in `@mui/x-tree-view@8.0.0-beta.2`.
|
|
79
|
+
|
|
80
|
+
### `@mui/x-codemod@8.0.0-beta.1`
|
|
81
|
+
|
|
82
|
+
- [codemod] Add Data Grid codemods (#17121, #17124) @MBilalShafi
|
|
83
|
+
|
|
84
|
+
### Docs
|
|
85
|
+
|
|
86
|
+
- [docs] Fix example import for `ExportExcel` component (#17110) @KenanYusuf
|
|
87
|
+
|
|
88
|
+
### Core
|
|
89
|
+
|
|
90
|
+
- [code-infra] Remove `@mui/styles` dependency & patches (#17071) @mnajdova
|
|
91
|
+
- [code-infra] Add more tests to slow screenshot tests (#17075) @JCQuintas
|
|
92
|
+
- [code-infra] Fix pickers codecov (#17120) @JCQuintas
|
|
93
|
+
- [code-infra] Move `isDeepEqual` to @mui/x-internals (#17129) @JCQuintas
|
|
94
|
+
- [code-infra] Remove `test_regressions` step from React 18 pipeline (#17108) @LukasTy
|
|
95
|
+
- [code-infra] Update some data-grid tests for vitest (#17078, #17104, #17146) @JCQuintas
|
|
96
|
+
- [code-infra] Update some date-pickers tests for vitest (#17083) @JCQuintas
|
|
97
|
+
- [infra] Update `issue-status-label-handler.yml` @michelengelen
|
|
98
|
+
- [infra] Added reusable issue status label handler workflow (#17145) @michelengelen
|
|
99
|
+
- [infra] Switch to reusable 'stale issues/PRs' workflow (#17107) @michelengelen
|
|
100
|
+
- [telemetry] Improve request body size, update dependencies, and optimize SSR handling (#17008) @hasdfa
|
|
101
|
+
|
|
8
102
|
## 8.0.0-beta.1
|
|
9
103
|
|
|
10
104
|
_Mar 21, 2025_
|
|
@@ -25,10 +25,21 @@ const useUtilityClasses = ownerState => {
|
|
|
25
25
|
const {
|
|
26
26
|
classes
|
|
27
27
|
} = ownerState;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
return React.useMemo(() => {
|
|
29
|
+
const slots = {
|
|
30
|
+
root: ['root'],
|
|
31
|
+
item: ['item'],
|
|
32
|
+
itemContent: ['itemContent'],
|
|
33
|
+
itemGroupTransition: ['itemGroupTransition'],
|
|
34
|
+
itemIconContainer: ['itemIconContainer'],
|
|
35
|
+
itemLabel: ['itemLabel'],
|
|
36
|
+
itemLabelInput: ['itemLabelInput'],
|
|
37
|
+
itemCheckbox: ['itemCheckbox'],
|
|
38
|
+
itemDragAndDropOverlay: ['itemDragAndDropOverlay'],
|
|
39
|
+
itemErrorIcon: ['itemErrorIcon']
|
|
40
|
+
};
|
|
41
|
+
return (0, _composeClasses.default)(slots, _richTreeViewProClasses.getRichTreeViewProUtilityClass, classes);
|
|
42
|
+
}, [classes]);
|
|
32
43
|
};
|
|
33
44
|
const RichTreeViewProRoot = exports.RichTreeViewProRoot = (0, _zeroStyled.styled)('ul', {
|
|
34
45
|
name: 'MuiRichTreeViewPro',
|
|
@@ -86,7 +97,8 @@ const RichTreeViewPro = exports.RichTreeViewPro = /*#__PURE__*/React.forwardRef(
|
|
|
86
97
|
ownerState: props
|
|
87
98
|
});
|
|
88
99
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.TreeViewProvider, {
|
|
89
|
-
|
|
100
|
+
contextValue: contextValue,
|
|
101
|
+
classes: classes,
|
|
90
102
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, {
|
|
91
103
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.RichTreeViewItems, {
|
|
92
104
|
slots: slots,
|
|
@@ -140,8 +152,8 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
140
152
|
classes: _propTypes.default.object,
|
|
141
153
|
className: _propTypes.default.string,
|
|
142
154
|
dataSource: _propTypes.default.shape({
|
|
143
|
-
getChildrenCount: _propTypes.default.func,
|
|
144
|
-
getTreeItems: _propTypes.default.func
|
|
155
|
+
getChildrenCount: _propTypes.default.func.isRequired,
|
|
156
|
+
getTreeItems: _propTypes.default.func.isRequired
|
|
145
157
|
}),
|
|
146
158
|
dataSourceCache: _propTypes.default.shape({
|
|
147
159
|
clear: _propTypes.default.func.isRequired,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
root: string;
|
|
4
|
-
}
|
|
1
|
+
import { TreeViewClasses } from '@mui/x-tree-view/internals';
|
|
2
|
+
export interface RichTreeViewProClasses extends TreeViewClasses {}
|
|
5
3
|
export type RichTreeViewProClassKey = keyof RichTreeViewProClasses;
|
|
6
4
|
export declare function getRichTreeViewProUtilityClass(slot: string): string;
|
|
7
5
|
export declare const richTreeViewProClasses: RichTreeViewProClasses;
|
|
@@ -11,4 +11,4 @@ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generat
|
|
|
11
11
|
function getRichTreeViewProUtilityClass(slot) {
|
|
12
12
|
return (0, _generateUtilityClass.default)('MuiRichTreeViewPro', slot);
|
|
13
13
|
}
|
|
14
|
-
const richTreeViewProClasses = exports.richTreeViewProClasses = (0, _generateUtilityClasses.default)('MuiRichTreeViewPro', ['root']);
|
|
14
|
+
const richTreeViewProClasses = exports.richTreeViewProClasses = (0, _generateUtilityClasses.default)('MuiRichTreeViewPro', ['root', 'item', 'itemContent', 'itemGroupTransition', 'itemIconContainer', 'itemLabel', 'itemCheckbox', 'itemLabelInput', 'itemDragAndDropOverlay', 'itemErrorIcon', 'itemLoadingIcon']);
|
|
@@ -18,10 +18,21 @@ const useUtilityClasses = ownerState => {
|
|
|
18
18
|
const {
|
|
19
19
|
classes
|
|
20
20
|
} = ownerState;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
return React.useMemo(() => {
|
|
22
|
+
const slots = {
|
|
23
|
+
root: ['root'],
|
|
24
|
+
item: ['item'],
|
|
25
|
+
itemContent: ['itemContent'],
|
|
26
|
+
itemGroupTransition: ['itemGroupTransition'],
|
|
27
|
+
itemIconContainer: ['itemIconContainer'],
|
|
28
|
+
itemLabel: ['itemLabel'],
|
|
29
|
+
itemLabelInput: ['itemLabelInput'],
|
|
30
|
+
itemCheckbox: ['itemCheckbox'],
|
|
31
|
+
itemDragAndDropOverlay: ['itemDragAndDropOverlay'],
|
|
32
|
+
itemErrorIcon: ['itemErrorIcon']
|
|
33
|
+
};
|
|
34
|
+
return composeClasses(slots, getRichTreeViewProUtilityClass, classes);
|
|
35
|
+
}, [classes]);
|
|
25
36
|
};
|
|
26
37
|
export const RichTreeViewProRoot = styled('ul', {
|
|
27
38
|
name: 'MuiRichTreeViewPro',
|
|
@@ -79,7 +90,8 @@ const RichTreeViewPro = /*#__PURE__*/React.forwardRef(function RichTreeViewPro(i
|
|
|
79
90
|
ownerState: props
|
|
80
91
|
});
|
|
81
92
|
return /*#__PURE__*/_jsx(TreeViewProvider, {
|
|
82
|
-
|
|
93
|
+
contextValue: contextValue,
|
|
94
|
+
classes: classes,
|
|
83
95
|
children: /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
84
96
|
children: [/*#__PURE__*/_jsx(RichTreeViewItems, {
|
|
85
97
|
slots: slots,
|
|
@@ -133,8 +145,8 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
133
145
|
classes: PropTypes.object,
|
|
134
146
|
className: PropTypes.string,
|
|
135
147
|
dataSource: PropTypes.shape({
|
|
136
|
-
getChildrenCount: PropTypes.func,
|
|
137
|
-
getTreeItems: PropTypes.func
|
|
148
|
+
getChildrenCount: PropTypes.func.isRequired,
|
|
149
|
+
getTreeItems: PropTypes.func.isRequired
|
|
138
150
|
}),
|
|
139
151
|
dataSourceCache: PropTypes.shape({
|
|
140
152
|
clear: PropTypes.func.isRequired,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
root: string;
|
|
4
|
-
}
|
|
1
|
+
import { TreeViewClasses } from '@mui/x-tree-view/internals';
|
|
2
|
+
export interface RichTreeViewProClasses extends TreeViewClasses {}
|
|
5
3
|
export type RichTreeViewProClassKey = keyof RichTreeViewProClasses;
|
|
6
4
|
export declare function getRichTreeViewProUtilityClass(slot: string): string;
|
|
7
5
|
export declare const richTreeViewProClasses: RichTreeViewProClasses;
|
|
@@ -3,4 +3,4 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
3
3
|
export function getRichTreeViewProUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiRichTreeViewPro', slot);
|
|
5
5
|
}
|
|
6
|
-
export const richTreeViewProClasses = generateUtilityClasses('MuiRichTreeViewPro', ['root']);
|
|
6
|
+
export const richTreeViewProClasses = generateUtilityClasses('MuiRichTreeViewPro', ['root', 'item', 'itemContent', 'itemGroupTransition', 'itemIconContainer', 'itemLabel', 'itemCheckbox', 'itemLabelInput', 'itemDragAndDropOverlay', 'itemErrorIcon', 'itemLoadingIcon']);
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
|
-
import { warnOnce } from '@mui/x-internals/warning';
|
|
5
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
5
|
import { selectorItemMeta, selectorIsItemSelected, useInstanceEventHandler, selectorDataSourceState, selectorGetTreeItemError } from '@mui/x-tree-view/internals';
|
|
7
6
|
import { DataSourceCacheDefault } from '@mui/x-tree-view/utils';
|
|
@@ -26,7 +25,7 @@ export const useTreeViewLazyLoading = ({
|
|
|
26
25
|
params,
|
|
27
26
|
store
|
|
28
27
|
}) => {
|
|
29
|
-
const isLazyLoadingEnabled = params.dataSource
|
|
28
|
+
const isLazyLoadingEnabled = !!params.dataSource;
|
|
30
29
|
const firstRenderRef = React.useRef(true);
|
|
31
30
|
const nestedDataManager = useLazyRef(() => new NestedDataManager(instance)).current;
|
|
32
31
|
const cacheRef = useLazyRef(() => getCache(params.dataSourceCache));
|
|
@@ -258,24 +257,6 @@ export const useTreeViewLazyLoading = ({
|
|
|
258
257
|
publicAPI: {}
|
|
259
258
|
};
|
|
260
259
|
};
|
|
261
|
-
useTreeViewLazyLoading.getDefaultizedParams = ({
|
|
262
|
-
params,
|
|
263
|
-
experimentalFeatures
|
|
264
|
-
}) => {
|
|
265
|
-
const canUseFeature = experimentalFeatures?.lazyLoading;
|
|
266
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
267
|
-
if (params.dataSource && !canUseFeature) {
|
|
268
|
-
warnOnce(['MUI X: The label editing feature requires the `lazyLoading` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ lazyLoading: true}}` to the Rich Tree View Pro component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/lazy-loading/']);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
const defaultDataSource = params?.dataSource ?? {
|
|
272
|
-
getChildrenCount: () => 0,
|
|
273
|
-
getTreeItems: () => Promise.resolve([])
|
|
274
|
-
};
|
|
275
|
-
return _extends({}, params, {
|
|
276
|
-
dataSource: canUseFeature ? defaultDataSource : {}
|
|
277
|
-
});
|
|
278
|
-
};
|
|
279
260
|
useTreeViewLazyLoading.getInitialState = () => ({
|
|
280
261
|
lazyLoading: {
|
|
281
262
|
enabled: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ponyfillGlobal from '@mui/utils/ponyfillGlobal';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTc0MzExMjgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
package/index.js
CHANGED
|
@@ -9,7 +9,6 @@ exports.useTreeViewLazyLoading = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
|
|
12
|
-
var _warning = require("@mui/x-internals/warning");
|
|
13
12
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
14
13
|
var _internals = require("@mui/x-tree-view/internals");
|
|
15
14
|
var _utils = require("@mui/x-tree-view/utils");
|
|
@@ -34,7 +33,7 @@ const useTreeViewLazyLoading = ({
|
|
|
34
33
|
params,
|
|
35
34
|
store
|
|
36
35
|
}) => {
|
|
37
|
-
const isLazyLoadingEnabled = params.dataSource
|
|
36
|
+
const isLazyLoadingEnabled = !!params.dataSource;
|
|
38
37
|
const firstRenderRef = React.useRef(true);
|
|
39
38
|
const nestedDataManager = (0, _useLazyRef.default)(() => new _utils2.NestedDataManager(instance)).current;
|
|
40
39
|
const cacheRef = (0, _useLazyRef.default)(() => getCache(params.dataSourceCache));
|
|
@@ -267,24 +266,6 @@ const useTreeViewLazyLoading = ({
|
|
|
267
266
|
};
|
|
268
267
|
};
|
|
269
268
|
exports.useTreeViewLazyLoading = useTreeViewLazyLoading;
|
|
270
|
-
useTreeViewLazyLoading.getDefaultizedParams = ({
|
|
271
|
-
params,
|
|
272
|
-
experimentalFeatures
|
|
273
|
-
}) => {
|
|
274
|
-
const canUseFeature = experimentalFeatures?.lazyLoading;
|
|
275
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
276
|
-
if (params.dataSource && !canUseFeature) {
|
|
277
|
-
(0, _warning.warnOnce)(['MUI X: The label editing feature requires the `lazyLoading` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ lazyLoading: true}}` to the Rich Tree View Pro component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/lazy-loading/']);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
const defaultDataSource = params?.dataSource ?? {
|
|
281
|
-
getChildrenCount: () => 0,
|
|
282
|
-
getTreeItems: () => Promise.resolve([])
|
|
283
|
-
};
|
|
284
|
-
return (0, _extends2.default)({}, params, {
|
|
285
|
-
dataSource: canUseFeature ? defaultDataSource : {}
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
269
|
useTreeViewLazyLoading.getInitialState = () => ({
|
|
289
270
|
lazyLoading: {
|
|
290
271
|
enabled: false,
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getReleaseInfo = void 0;
|
|
8
8
|
var _ponyfillGlobal = _interopRequireDefault(require("@mui/utils/ponyfillGlobal"));
|
|
9
9
|
const getReleaseInfo = () => {
|
|
10
|
-
const releaseInfo = "
|
|
10
|
+
const releaseInfo = "MTc0MzExMjgwMDAwMA==";
|
|
11
11
|
if (process.env.NODE_ENV !== 'production') {
|
|
12
12
|
// A simple hack to set the value in the test environment (has no build step).
|
|
13
13
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -18,10 +18,21 @@ const useUtilityClasses = ownerState => {
|
|
|
18
18
|
const {
|
|
19
19
|
classes
|
|
20
20
|
} = ownerState;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
return React.useMemo(() => {
|
|
22
|
+
const slots = {
|
|
23
|
+
root: ['root'],
|
|
24
|
+
item: ['item'],
|
|
25
|
+
itemContent: ['itemContent'],
|
|
26
|
+
itemGroupTransition: ['itemGroupTransition'],
|
|
27
|
+
itemIconContainer: ['itemIconContainer'],
|
|
28
|
+
itemLabel: ['itemLabel'],
|
|
29
|
+
itemLabelInput: ['itemLabelInput'],
|
|
30
|
+
itemCheckbox: ['itemCheckbox'],
|
|
31
|
+
itemDragAndDropOverlay: ['itemDragAndDropOverlay'],
|
|
32
|
+
itemErrorIcon: ['itemErrorIcon']
|
|
33
|
+
};
|
|
34
|
+
return composeClasses(slots, getRichTreeViewProUtilityClass, classes);
|
|
35
|
+
}, [classes]);
|
|
25
36
|
};
|
|
26
37
|
export const RichTreeViewProRoot = styled('ul', {
|
|
27
38
|
name: 'MuiRichTreeViewPro',
|
|
@@ -79,7 +90,8 @@ const RichTreeViewPro = /*#__PURE__*/React.forwardRef(function RichTreeViewPro(i
|
|
|
79
90
|
ownerState: props
|
|
80
91
|
});
|
|
81
92
|
return /*#__PURE__*/_jsx(TreeViewProvider, {
|
|
82
|
-
|
|
93
|
+
contextValue: contextValue,
|
|
94
|
+
classes: classes,
|
|
83
95
|
children: /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
84
96
|
children: [/*#__PURE__*/_jsx(RichTreeViewItems, {
|
|
85
97
|
slots: slots,
|
|
@@ -133,8 +145,8 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
133
145
|
classes: PropTypes.object,
|
|
134
146
|
className: PropTypes.string,
|
|
135
147
|
dataSource: PropTypes.shape({
|
|
136
|
-
getChildrenCount: PropTypes.func,
|
|
137
|
-
getTreeItems: PropTypes.func
|
|
148
|
+
getChildrenCount: PropTypes.func.isRequired,
|
|
149
|
+
getTreeItems: PropTypes.func.isRequired
|
|
138
150
|
}),
|
|
139
151
|
dataSourceCache: PropTypes.shape({
|
|
140
152
|
clear: PropTypes.func.isRequired,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
root: string;
|
|
4
|
-
}
|
|
1
|
+
import { TreeViewClasses } from '@mui/x-tree-view/internals';
|
|
2
|
+
export interface RichTreeViewProClasses extends TreeViewClasses {}
|
|
5
3
|
export type RichTreeViewProClassKey = keyof RichTreeViewProClasses;
|
|
6
4
|
export declare function getRichTreeViewProUtilityClass(slot: string): string;
|
|
7
5
|
export declare const richTreeViewProClasses: RichTreeViewProClasses;
|
|
@@ -3,4 +3,4 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
3
3
|
export function getRichTreeViewProUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiRichTreeViewPro', slot);
|
|
5
5
|
}
|
|
6
|
-
export const richTreeViewProClasses = generateUtilityClasses('MuiRichTreeViewPro', ['root']);
|
|
6
|
+
export const richTreeViewProClasses = generateUtilityClasses('MuiRichTreeViewPro', ['root', 'item', 'itemContent', 'itemGroupTransition', 'itemIconContainer', 'itemLabel', 'itemCheckbox', 'itemLabelInput', 'itemDragAndDropOverlay', 'itemErrorIcon', 'itemLoadingIcon']);
|
package/modern/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
|
-
import { warnOnce } from '@mui/x-internals/warning';
|
|
5
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
5
|
import { selectorItemMeta, selectorIsItemSelected, useInstanceEventHandler, selectorDataSourceState, selectorGetTreeItemError } from '@mui/x-tree-view/internals';
|
|
7
6
|
import { DataSourceCacheDefault } from '@mui/x-tree-view/utils';
|
|
@@ -26,7 +25,7 @@ export const useTreeViewLazyLoading = ({
|
|
|
26
25
|
params,
|
|
27
26
|
store
|
|
28
27
|
}) => {
|
|
29
|
-
const isLazyLoadingEnabled = params.dataSource
|
|
28
|
+
const isLazyLoadingEnabled = !!params.dataSource;
|
|
30
29
|
const firstRenderRef = React.useRef(true);
|
|
31
30
|
const nestedDataManager = useLazyRef(() => new NestedDataManager(instance)).current;
|
|
32
31
|
const cacheRef = useLazyRef(() => getCache(params.dataSourceCache));
|
|
@@ -258,24 +257,6 @@ export const useTreeViewLazyLoading = ({
|
|
|
258
257
|
publicAPI: {}
|
|
259
258
|
};
|
|
260
259
|
};
|
|
261
|
-
useTreeViewLazyLoading.getDefaultizedParams = ({
|
|
262
|
-
params,
|
|
263
|
-
experimentalFeatures
|
|
264
|
-
}) => {
|
|
265
|
-
const canUseFeature = experimentalFeatures?.lazyLoading;
|
|
266
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
267
|
-
if (params.dataSource && !canUseFeature) {
|
|
268
|
-
warnOnce(['MUI X: The label editing feature requires the `lazyLoading` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ lazyLoading: true}}` to the Rich Tree View Pro component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/lazy-loading/']);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
const defaultDataSource = params?.dataSource ?? {
|
|
272
|
-
getChildrenCount: () => 0,
|
|
273
|
-
getTreeItems: () => Promise.resolve([])
|
|
274
|
-
};
|
|
275
|
-
return _extends({}, params, {
|
|
276
|
-
dataSource: canUseFeature ? defaultDataSource : {}
|
|
277
|
-
});
|
|
278
|
-
};
|
|
279
260
|
useTreeViewLazyLoading.getInitialState = () => ({
|
|
280
261
|
lazyLoading: {
|
|
281
262
|
enabled: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ponyfillGlobal from '@mui/utils/ponyfillGlobal';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTc0MzExMjgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-tree-view-pro",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.2",
|
|
4
4
|
"description": "The Pro plan edition of the Tree View components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"react-transition-group": "^4.4.5",
|
|
42
42
|
"reselect": "^5.1.1",
|
|
43
43
|
"use-sync-external-store": "^1.4.0",
|
|
44
|
-
"@mui/x-internals": "8.0.0-beta.
|
|
45
|
-
"@mui/x-
|
|
46
|
-
"@mui/x-
|
|
44
|
+
"@mui/x-internals": "8.0.0-beta.2",
|
|
45
|
+
"@mui/x-license": "8.0.0-beta.2",
|
|
46
|
+
"@mui/x-tree-view": "8.0.0-beta.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|