@mui/x-tree-view 8.0.0-alpha.1 → 8.0.0-alpha.4
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 +604 -7
- package/README.md +1 -1
- package/RichTreeView/RichTreeView.types.d.ts +2 -2
- package/SimpleTreeView/SimpleTreeView.types.d.ts +2 -2
- package/TreeItem/TreeItem.types.d.ts +1 -1
- package/TreeItemDragAndDropOverlay/TreeItemDragAndDropOverlay.js +1 -1
- package/TreeItemIcon/TreeItemIcon.types.d.ts +1 -1
- package/TreeItemProvider/TreeItemProvider.d.ts +2 -4
- package/TreeItemProvider/TreeItemProvider.js +13 -11
- package/hooks/useTreeItemUtils/useTreeItemUtils.d.ts +4 -4
- package/hooks/useTreeViewApiRef.d.ts +1 -0
- package/index.js +1 -1
- package/internals/components/RichTreeViewItems.d.ts +1 -1
- package/internals/models/itemPlugin.d.ts +1 -1
- package/internals/models/plugin.d.ts +1 -1
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.d.ts +30 -10
- package/internals/plugins/useTreeViewIcons/useTreeViewIcons.types.d.ts +1 -1
- package/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.d.ts +252 -84
- package/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +26 -8
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.js +13 -16
- package/internals/useTreeView/useTreeView.types.d.ts +1 -1
- package/modern/TreeItemDragAndDropOverlay/TreeItemDragAndDropOverlay.js +1 -1
- package/modern/TreeItemProvider/TreeItemProvider.js +13 -11
- package/modern/index.js +1 -1
- package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.js +13 -16
- package/node/TreeItemDragAndDropOverlay/TreeItemDragAndDropOverlay.js +2 -2
- package/node/TreeItemProvider/TreeItemProvider.js +13 -10
- package/node/index.js +1 -1
- package/node/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.js +13 -16
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Theme } from '@mui/material/styles';
|
|
3
|
-
import { SlotComponentProps } from '@mui/utils';
|
|
4
|
-
import { SxProps } from '@mui/system';
|
|
3
|
+
import { SlotComponentProps } from '@mui/utils/types';
|
|
4
|
+
import { SxProps } from '@mui/system/styleFunctionSx';
|
|
5
5
|
import { SimpleTreeViewClasses } from './simpleTreeViewClasses';
|
|
6
6
|
import { SimpleTreeViewPluginParameters, SimpleTreeViewPluginSlotProps, SimpleTreeViewPluginSlots, SimpleTreeViewPluginSignatures } from './SimpleTreeView.plugins';
|
|
7
7
|
import { TreeViewExperimentalFeatures, TreeViewPublicAPI } from '../internals/models';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
3
3
|
import { TransitionProps } from '@mui/material/transitions';
|
|
4
|
-
import { SlotComponentProps } from '@mui/utils';
|
|
4
|
+
import { SlotComponentProps } from '@mui/utils/types';
|
|
5
5
|
import { UseTreeItemParameters, UseTreeItemStatus } from '../useTreeItem';
|
|
6
6
|
import { TreeItemClasses } from './treeItemClasses';
|
|
7
7
|
import { TreeItemIconSlotProps, TreeItemIconSlots } from '../TreeItemIcon';
|
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { alpha } from '@mui/material/styles';
|
|
7
|
-
import { shouldForwardProp } from '@mui/system';
|
|
7
|
+
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
8
8
|
import { styled } from "../internals/zero-styled/index.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
const TreeItemDragAndDropOverlayRoot = styled('div', {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { TreeItemProviderProps } from './TreeItemProvider.types';
|
|
2
|
-
|
|
3
|
-
* @ignore - internal component.
|
|
4
|
-
*/
|
|
5
|
-
declare function TreeItemProvider(props: TreeItemProviderProps): import("react").ReactNode;
|
|
3
|
+
declare function TreeItemProvider(props: TreeItemProviderProps): React.JSX.Element;
|
|
6
4
|
declare namespace TreeItemProvider {
|
|
7
5
|
var propTypes: any;
|
|
8
6
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
1
4
|
import PropTypes from 'prop-types';
|
|
2
5
|
import { useTreeViewContext } from "../internals/TreeViewProvider/index.js";
|
|
3
6
|
import { generateTreeItemIdAttribute } from "../internals/corePlugins/useTreeViewId/useTreeViewId.utils.js";
|
|
4
7
|
import { useSelector } from "../internals/hooks/useSelector.js";
|
|
5
8
|
import { selectorTreeViewId } from "../internals/corePlugins/useTreeViewId/useTreeViewId.selectors.js";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @ignore - internal component.
|
|
9
|
-
*/
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
function TreeItemProvider(props) {
|
|
11
11
|
const {
|
|
12
12
|
children,
|
|
@@ -24,14 +24,16 @@ function TreeItemProvider(props) {
|
|
|
24
24
|
treeId,
|
|
25
25
|
id
|
|
26
26
|
});
|
|
27
|
-
return
|
|
28
|
-
children
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
28
|
+
children: wrapItem({
|
|
29
|
+
children,
|
|
30
|
+
itemId,
|
|
31
|
+
instance,
|
|
32
|
+
idAttribute
|
|
33
|
+
})
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
|
-
TreeItemProvider.propTypes = {
|
|
36
|
+
process.env.NODE_ENV !== "production" ? TreeItemProvider.propTypes = {
|
|
35
37
|
// ----------------------------- Warning --------------------------------
|
|
36
38
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
37
39
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -39,5 +41,5 @@ TreeItemProvider.propTypes = {
|
|
|
39
41
|
children: PropTypes.node,
|
|
40
42
|
id: PropTypes.string,
|
|
41
43
|
itemId: PropTypes.string.isRequired
|
|
42
|
-
};
|
|
44
|
+
} : void 0;
|
|
43
45
|
export { TreeItemProvider };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { UseTreeViewSelectionSignature } from '../../internals/plugins/useTreeViewSelection';
|
|
3
|
-
import { UseTreeViewExpansionSignature } from '../../internals/plugins/useTreeViewExpansion';
|
|
4
|
-
import { UseTreeViewItemsSignature } from '../../internals/plugins/useTreeViewItems';
|
|
5
|
-
import { UseTreeViewFocusSignature } from '../../internals/plugins/useTreeViewFocus';
|
|
2
|
+
import type { UseTreeViewSelectionSignature } from '../../internals/plugins/useTreeViewSelection';
|
|
3
|
+
import type { UseTreeViewExpansionSignature } from '../../internals/plugins/useTreeViewExpansion';
|
|
4
|
+
import type { UseTreeViewItemsSignature } from '../../internals/plugins/useTreeViewItems';
|
|
5
|
+
import type { UseTreeViewFocusSignature } from '../../internals/plugins/useTreeViewFocus';
|
|
6
6
|
import { UseTreeViewLabelSignature } from '../../internals/plugins/useTreeViewLabel';
|
|
7
7
|
import type { UseTreeItemStatus } from '../../useTreeItem';
|
|
8
8
|
import { TreeViewPublicAPI } from '../../internals/models';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SlotComponentProps } from '@mui/utils';
|
|
2
|
+
import { SlotComponentProps } from '@mui/utils/types';
|
|
3
3
|
import { TreeItem, TreeItemProps } from '../../TreeItem';
|
|
4
4
|
import { TreeViewItemId } from '../../models';
|
|
5
5
|
export declare function RichTreeViewItems(props: RichTreeViewItemsProps): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { EventHandlers } from '@mui/utils';
|
|
2
|
+
import { EventHandlers } from '@mui/utils/types';
|
|
3
3
|
import type { UseTreeItemContentSlotOwnProps, UseTreeItemDragAndDropOverlaySlotOwnProps, UseTreeItemLabelInputSlotOwnProps, UseTreeItemRootSlotOwnProps, UseTreeItemCheckboxSlotOwnProps, UseTreeItemStatus } from '../../useTreeItem';
|
|
4
4
|
import type { UseTreeItemInteractions } from '../../hooks/useTreeItemUtils/useTreeItemUtils';
|
|
5
5
|
import type { TreeItemProps } from '../../TreeItem/TreeItem.types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { EventHandlers } from '@mui/utils';
|
|
2
|
+
import { EventHandlers } from '@mui/utils/types';
|
|
3
3
|
import { TreeViewExperimentalFeatures, TreeViewInstance, TreeViewModel } from './treeView';
|
|
4
4
|
import type { MergeSignaturesProperty, OptionalIfEmpty } from './helpers';
|
|
5
5
|
import { TreeViewEventLookupElement } from './events';
|
|
@@ -52,8 +52,12 @@ export declare const selectorIsItemExpandable: ((state: any, itemId: string | nu
|
|
|
52
52
|
resultsCount: () => number;
|
|
53
53
|
resetResultsCount: () => void;
|
|
54
54
|
} & {
|
|
55
|
-
resultFunc: (resultFuncArgs_0:
|
|
56
|
-
|
|
55
|
+
resultFunc: (resultFuncArgs_0: {
|
|
56
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
57
|
+
}, resultFuncArgs_1: string | null) => import("../..").TreeViewItemMeta | null;
|
|
58
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
59
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
60
|
+
}, resultFuncArgs_1: string | null) => import("../..").TreeViewItemMeta | null) & {
|
|
57
61
|
clearCache: () => void;
|
|
58
62
|
resultsCount: () => number;
|
|
59
63
|
resetResultsCount: () => void;
|
|
@@ -61,15 +65,21 @@ export declare const selectorIsItemExpandable: ((state: any, itemId: string | nu
|
|
|
61
65
|
lastResult: () => import("../..").TreeViewItemMeta | null;
|
|
62
66
|
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("../useTreeViewItems").UseTreeViewItemsState<import("../../..").TreeViewDefaultItemModelProperties> & Partial<{}> & {
|
|
63
67
|
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
64
|
-
}) =>
|
|
68
|
+
}) => {
|
|
69
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
70
|
+
}) & {
|
|
65
71
|
clearCache: () => void;
|
|
66
72
|
resultsCount: () => number;
|
|
67
73
|
resetResultsCount: () => void;
|
|
68
74
|
} & {
|
|
69
75
|
resultFunc: (resultFuncArgs_0: {
|
|
70
76
|
disabledItemsFocusable: boolean;
|
|
71
|
-
itemModelLookup:
|
|
72
|
-
|
|
77
|
+
itemModelLookup: {
|
|
78
|
+
[itemId: string]: import("../../..").TreeViewBaseItem<import("../../..").TreeViewDefaultItemModelProperties>;
|
|
79
|
+
};
|
|
80
|
+
itemMetaLookup: {
|
|
81
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
82
|
+
};
|
|
73
83
|
itemOrderedChildrenIdsLookup: {
|
|
74
84
|
[parentItemId: string]: string[];
|
|
75
85
|
};
|
|
@@ -78,11 +88,17 @@ export declare const selectorIsItemExpandable: ((state: any, itemId: string | nu
|
|
|
78
88
|
[itemId: string]: number;
|
|
79
89
|
};
|
|
80
90
|
};
|
|
81
|
-
}) =>
|
|
91
|
+
}) => {
|
|
92
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
93
|
+
};
|
|
82
94
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
83
95
|
disabledItemsFocusable: boolean;
|
|
84
|
-
itemModelLookup:
|
|
85
|
-
|
|
96
|
+
itemModelLookup: {
|
|
97
|
+
[itemId: string]: import("../../..").TreeViewBaseItem<import("../../..").TreeViewDefaultItemModelProperties>;
|
|
98
|
+
};
|
|
99
|
+
itemMetaLookup: {
|
|
100
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
101
|
+
};
|
|
86
102
|
itemOrderedChildrenIdsLookup: {
|
|
87
103
|
[parentItemId: string]: string[];
|
|
88
104
|
};
|
|
@@ -91,12 +107,16 @@ export declare const selectorIsItemExpandable: ((state: any, itemId: string | nu
|
|
|
91
107
|
[itemId: string]: number;
|
|
92
108
|
};
|
|
93
109
|
};
|
|
94
|
-
}) =>
|
|
110
|
+
}) => {
|
|
111
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
112
|
+
}) & {
|
|
95
113
|
clearCache: () => void;
|
|
96
114
|
resultsCount: () => number;
|
|
97
115
|
resetResultsCount: () => void;
|
|
98
116
|
};
|
|
99
|
-
lastResult: () =>
|
|
117
|
+
lastResult: () => {
|
|
118
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
119
|
+
};
|
|
100
120
|
dependencies: [TreeViewRootSelector<import("../useTreeViewItems").UseTreeViewItemsSignature>];
|
|
101
121
|
recomputations: () => number;
|
|
102
122
|
resetRecomputations: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SlotComponentProps } from '@mui/utils';
|
|
2
|
+
import { SlotComponentProps } from '@mui/utils/types';
|
|
3
3
|
import { TreeViewPluginSignature } from '../../models';
|
|
4
4
|
import { UseTreeViewItemsSignature } from '../useTreeViewItems';
|
|
5
5
|
import { UseTreeViewSelectionSignature } from '../useTreeViewSelection';
|