@mui/x-tree-view 8.0.0-beta.0 → 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 +171 -0
- package/RichTreeView/RichTreeView.js +17 -5
- package/RichTreeView/richTreeViewClasses.d.ts +2 -4
- package/RichTreeView/richTreeViewClasses.js +1 -1
- package/SimpleTreeView/SimpleTreeView.js +17 -5
- package/SimpleTreeView/simpleTreeViewClasses.d.ts +2 -4
- package/SimpleTreeView/simpleTreeViewClasses.js +1 -1
- package/TreeItem/TreeItem.d.ts +1 -1
- package/TreeItem/TreeItem.js +45 -49
- package/TreeItem/index.d.ts +2 -1
- package/TreeItem/index.js +13 -21
- package/TreeItem/treeItemClasses.d.ts +40 -18
- package/TreeItem/treeItemClasses.js +3 -1
- package/TreeItemLabelInput/TreeItemLabelInput.js +2 -2
- package/esm/RichTreeView/RichTreeView.js +17 -5
- package/esm/RichTreeView/richTreeViewClasses.d.ts +2 -4
- package/esm/RichTreeView/richTreeViewClasses.js +1 -1
- package/esm/SimpleTreeView/SimpleTreeView.js +17 -5
- package/esm/SimpleTreeView/simpleTreeViewClasses.d.ts +2 -4
- package/esm/SimpleTreeView/simpleTreeViewClasses.js +1 -1
- package/esm/TreeItem/TreeItem.d.ts +1 -1
- package/esm/TreeItem/TreeItem.js +45 -49
- package/esm/TreeItem/index.d.ts +2 -1
- package/esm/TreeItem/index.js +1 -1
- package/esm/TreeItem/treeItemClasses.d.ts +40 -18
- package/esm/TreeItem/treeItemClasses.js +3 -1
- package/esm/TreeItemLabelInput/TreeItemLabelInput.js +2 -2
- package/esm/hooks/useTreeItemUtils/useTreeItemUtils.js +8 -14
- package/esm/index.js +1 -1
- package/esm/internals/TreeViewProvider/TreeViewChildrenItemProvider.js +1 -1
- package/esm/internals/TreeViewProvider/TreeViewContext.d.ts +3 -1
- package/esm/internals/TreeViewProvider/TreeViewContext.js +8 -1
- package/esm/internals/TreeViewProvider/TreeViewProvider.d.ts +1 -1
- package/esm/internals/TreeViewProvider/TreeViewProvider.js +17 -5
- package/esm/internals/TreeViewProvider/TreeViewProvider.types.d.ts +3 -1
- package/esm/internals/TreeViewProvider/TreeViewStyleContext.d.ts +33 -0
- package/esm/internals/TreeViewProvider/TreeViewStyleContext.js +13 -0
- package/esm/internals/TreeViewProvider/index.d.ts +1 -1
- package/esm/internals/TreeViewProvider/index.js +1 -1
- package/esm/internals/index.d.ts +2 -1
- package/esm/internals/models/itemPlugin.d.ts +3 -3
- package/esm/internals/plugins/useTreeViewItemCustomization/index.d.ts +2 -0
- package/esm/internals/plugins/useTreeViewItemCustomization/index.js +1 -0
- package/esm/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.d.ts +3 -0
- package/esm/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.js +24 -0
- package/esm/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.types.d.ts +42 -0
- package/esm/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.types.js +1 -0
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.js +3 -8
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.js +1 -4
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +6 -6
- package/esm/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +13 -15
- package/esm/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.types.d.ts +0 -3
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.itemPlugin.js +9 -12
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +16 -11
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.selectors.d.ts +14 -20
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.selectors.js +5 -7
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.types.d.ts +5 -4
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.d.ts +0 -2
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.d.ts +2 -3
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.js +16 -21
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +43 -38
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.selectors.d.ts +331 -0
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.selectors.js +38 -1
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +5 -4
- package/esm/internals/utils/selectors.d.ts +1 -1
- package/esm/useTreeItem/useTreeItem.js +16 -17
- package/esm/useTreeItem/useTreeItem.types.d.ts +9 -4
- package/hooks/useTreeItemUtils/useTreeItemUtils.js +7 -13
- package/index.js +1 -1
- package/internals/TreeViewProvider/TreeViewChildrenItemProvider.js +2 -2
- package/internals/TreeViewProvider/TreeViewContext.d.ts +3 -1
- package/internals/TreeViewProvider/TreeViewContext.js +10 -2
- package/internals/TreeViewProvider/TreeViewProvider.d.ts +1 -1
- package/internals/TreeViewProvider/TreeViewProvider.js +17 -5
- package/internals/TreeViewProvider/TreeViewProvider.types.d.ts +3 -1
- package/internals/TreeViewProvider/TreeViewStyleContext.d.ts +33 -0
- package/internals/TreeViewProvider/TreeViewStyleContext.js +21 -0
- package/internals/TreeViewProvider/index.d.ts +1 -1
- package/internals/TreeViewProvider/index.js +2 -2
- package/internals/index.d.ts +2 -1
- package/internals/models/itemPlugin.d.ts +3 -3
- package/internals/plugins/useTreeViewItemCustomization/index.d.ts +2 -0
- package/internals/plugins/useTreeViewItemCustomization/index.js +12 -0
- package/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.d.ts +3 -0
- package/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.js +32 -0
- package/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.types.d.ts +42 -0
- package/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.types.js +5 -0
- package/internals/plugins/useTreeViewItems/useTreeViewItems.js +3 -8
- package/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.js +1 -4
- package/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +6 -6
- package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +12 -14
- package/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.types.d.ts +0 -3
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.itemPlugin.js +9 -12
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +16 -12
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.selectors.d.ts +14 -20
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.selectors.js +5 -7
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.types.d.ts +5 -4
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.d.ts +0 -2
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.d.ts +2 -3
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.js +15 -20
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +42 -37
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.selectors.d.ts +331 -0
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.selectors.js +39 -2
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +5 -4
- package/internals/utils/selectors.d.ts +1 -1
- package/modern/RichTreeView/RichTreeView.js +17 -5
- package/modern/RichTreeView/richTreeViewClasses.d.ts +2 -4
- package/modern/RichTreeView/richTreeViewClasses.js +1 -1
- package/modern/SimpleTreeView/SimpleTreeView.js +17 -5
- package/modern/SimpleTreeView/simpleTreeViewClasses.d.ts +2 -4
- package/modern/SimpleTreeView/simpleTreeViewClasses.js +1 -1
- package/modern/TreeItem/TreeItem.d.ts +1 -1
- package/modern/TreeItem/TreeItem.js +45 -49
- package/modern/TreeItem/index.d.ts +2 -1
- package/modern/TreeItem/index.js +1 -1
- package/modern/TreeItem/treeItemClasses.d.ts +40 -18
- package/modern/TreeItem/treeItemClasses.js +3 -1
- package/modern/TreeItemLabelInput/TreeItemLabelInput.js +2 -2
- package/modern/hooks/useTreeItemUtils/useTreeItemUtils.js +8 -14
- package/modern/index.js +1 -1
- package/modern/internals/TreeViewProvider/TreeViewChildrenItemProvider.js +1 -1
- package/modern/internals/TreeViewProvider/TreeViewContext.d.ts +3 -1
- package/modern/internals/TreeViewProvider/TreeViewContext.js +8 -1
- package/modern/internals/TreeViewProvider/TreeViewProvider.d.ts +1 -1
- package/modern/internals/TreeViewProvider/TreeViewProvider.js +17 -5
- package/modern/internals/TreeViewProvider/TreeViewProvider.types.d.ts +3 -1
- package/modern/internals/TreeViewProvider/TreeViewStyleContext.d.ts +33 -0
- package/modern/internals/TreeViewProvider/TreeViewStyleContext.js +13 -0
- package/modern/internals/TreeViewProvider/index.d.ts +1 -1
- package/modern/internals/TreeViewProvider/index.js +1 -1
- package/modern/internals/index.d.ts +2 -1
- package/modern/internals/models/itemPlugin.d.ts +3 -3
- package/modern/internals/plugins/useTreeViewItemCustomization/index.d.ts +2 -0
- package/modern/internals/plugins/useTreeViewItemCustomization/index.js +1 -0
- package/modern/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.d.ts +3 -0
- package/modern/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.js +24 -0
- package/modern/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.types.d.ts +42 -0
- package/modern/internals/plugins/useTreeViewItemCustomization/useTreeViewItemCustomization.types.js +1 -0
- package/modern/internals/plugins/useTreeViewItems/useTreeViewItems.js +3 -8
- package/modern/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.js +1 -4
- package/modern/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +6 -6
- package/modern/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js +13 -15
- package/modern/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.types.d.ts +0 -3
- package/modern/internals/plugins/useTreeViewLabel/useTreeViewLabel.itemPlugin.js +9 -12
- package/modern/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +16 -11
- package/modern/internals/plugins/useTreeViewLabel/useTreeViewLabel.selectors.d.ts +14 -20
- package/modern/internals/plugins/useTreeViewLabel/useTreeViewLabel.selectors.js +5 -7
- package/modern/internals/plugins/useTreeViewLabel/useTreeViewLabel.types.d.ts +5 -4
- package/modern/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.d.ts +0 -2
- package/modern/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.d.ts +2 -3
- package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.itemPlugin.js +16 -21
- package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +43 -38
- package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.selectors.d.ts +331 -0
- package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.selectors.js +38 -1
- package/modern/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +5 -4
- package/modern/internals/utils/selectors.d.ts +1 -1
- package/modern/useTreeItem/useTreeItem.js +16 -17
- package/modern/useTreeItem/useTreeItem.types.d.ts +9 -4
- package/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/useTreeItem/useTreeItem.js +16 -17
- package/useTreeItem/useTreeItem.types.d.ts +9 -4
- package/esm/internals/TreeViewProvider/useTreeViewContext.d.ts +0 -3
- package/esm/internals/TreeViewProvider/useTreeViewContext.js +0 -9
- package/internals/TreeViewProvider/useTreeViewContext.d.ts +0 -3
- package/internals/TreeViewProvider/useTreeViewContext.js +0 -17
- package/modern/internals/TreeViewProvider/useTreeViewContext.d.ts +0 -3
- package/modern/internals/TreeViewProvider/useTreeViewContext.js +0 -9
|
@@ -11,10 +11,20 @@ export declare const selectorIsItemSelected: ((state: any, itemId: string) => bo
|
|
|
11
11
|
resetResultsCount: () => void;
|
|
12
12
|
} & {
|
|
13
13
|
resultFunc: (resultFuncArgs_0: {
|
|
14
|
+
rawSelectedItems: string | string[] | null;
|
|
14
15
|
selectedItemsMap: Map<string, true>;
|
|
16
|
+
isEnabled: boolean;
|
|
17
|
+
isMultiSelectEnabled: boolean;
|
|
18
|
+
isCheckboxSelectionEnabled: boolean;
|
|
19
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
15
20
|
}, resultFuncArgs_1: string) => boolean;
|
|
16
21
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
22
|
+
rawSelectedItems: string | string[] | null;
|
|
17
23
|
selectedItemsMap: Map<string, true>;
|
|
24
|
+
isEnabled: boolean;
|
|
25
|
+
isMultiSelectEnabled: boolean;
|
|
26
|
+
isCheckboxSelectionEnabled: boolean;
|
|
27
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
18
28
|
}, resultFuncArgs_1: string) => boolean) & {
|
|
19
29
|
clearCache: () => void;
|
|
20
30
|
resultsCount: () => number;
|
|
@@ -29,4 +39,325 @@ export declare const selectorIsItemSelected: ((state: any, itemId: string) => bo
|
|
|
29
39
|
} & {
|
|
30
40
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
31
41
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Check if multi selection is enabled.
|
|
45
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
46
|
+
* @returns {boolean} `true` if multi selection is enabled, `false` otherwise.
|
|
47
|
+
*/
|
|
48
|
+
export declare const selectorIsMultiSelectEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
49
|
+
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
50
|
+
}) => boolean) & {
|
|
51
|
+
clearCache: () => void;
|
|
52
|
+
resultsCount: () => number;
|
|
53
|
+
resetResultsCount: () => void;
|
|
54
|
+
} & {
|
|
55
|
+
resultFunc: (resultFuncArgs_0: {
|
|
56
|
+
rawSelectedItems: string | string[] | null;
|
|
57
|
+
selectedItemsMap: Map<string, true>;
|
|
58
|
+
isEnabled: boolean;
|
|
59
|
+
isMultiSelectEnabled: boolean;
|
|
60
|
+
isCheckboxSelectionEnabled: boolean;
|
|
61
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
62
|
+
}) => boolean;
|
|
63
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
64
|
+
rawSelectedItems: string | string[] | null;
|
|
65
|
+
selectedItemsMap: Map<string, true>;
|
|
66
|
+
isEnabled: boolean;
|
|
67
|
+
isMultiSelectEnabled: boolean;
|
|
68
|
+
isCheckboxSelectionEnabled: boolean;
|
|
69
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
70
|
+
}) => boolean) & {
|
|
71
|
+
clearCache: () => void;
|
|
72
|
+
resultsCount: () => number;
|
|
73
|
+
resetResultsCount: () => void;
|
|
74
|
+
};
|
|
75
|
+
lastResult: () => boolean;
|
|
76
|
+
dependencies: [TreeViewRootSelector<UseTreeViewSelectionSignature>];
|
|
77
|
+
recomputations: () => number;
|
|
78
|
+
resetRecomputations: () => void;
|
|
79
|
+
dependencyRecomputations: () => number;
|
|
80
|
+
resetDependencyRecomputations: () => void;
|
|
81
|
+
} & {
|
|
82
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
83
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Check if selection is enabled.
|
|
87
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
88
|
+
* @returns {boolean} `true` if selection is enabled, `false` otherwise.
|
|
89
|
+
*/
|
|
90
|
+
export declare const selectorIsSelectionEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
91
|
+
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
92
|
+
}) => boolean) & {
|
|
93
|
+
clearCache: () => void;
|
|
94
|
+
resultsCount: () => number;
|
|
95
|
+
resetResultsCount: () => void;
|
|
96
|
+
} & {
|
|
97
|
+
resultFunc: (resultFuncArgs_0: {
|
|
98
|
+
rawSelectedItems: string | string[] | null;
|
|
99
|
+
selectedItemsMap: Map<string, true>;
|
|
100
|
+
isEnabled: boolean;
|
|
101
|
+
isMultiSelectEnabled: boolean;
|
|
102
|
+
isCheckboxSelectionEnabled: boolean;
|
|
103
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
104
|
+
}) => boolean;
|
|
105
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
106
|
+
rawSelectedItems: string | string[] | null;
|
|
107
|
+
selectedItemsMap: Map<string, true>;
|
|
108
|
+
isEnabled: boolean;
|
|
109
|
+
isMultiSelectEnabled: boolean;
|
|
110
|
+
isCheckboxSelectionEnabled: boolean;
|
|
111
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
112
|
+
}) => boolean) & {
|
|
113
|
+
clearCache: () => void;
|
|
114
|
+
resultsCount: () => number;
|
|
115
|
+
resetResultsCount: () => void;
|
|
116
|
+
};
|
|
117
|
+
lastResult: () => boolean;
|
|
118
|
+
dependencies: [TreeViewRootSelector<UseTreeViewSelectionSignature>];
|
|
119
|
+
recomputations: () => number;
|
|
120
|
+
resetRecomputations: () => void;
|
|
121
|
+
dependencyRecomputations: () => number;
|
|
122
|
+
resetDependencyRecomputations: () => void;
|
|
123
|
+
} & {
|
|
124
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
125
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Check if checkbox selection is enabled.
|
|
129
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
130
|
+
* @returns {boolean} `true` if checkbox selection is enabled, `false` otherwise.
|
|
131
|
+
*/
|
|
132
|
+
export declare const selectorIsCheckboxSelectionEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
133
|
+
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
134
|
+
}) => boolean) & {
|
|
135
|
+
clearCache: () => void;
|
|
136
|
+
resultsCount: () => number;
|
|
137
|
+
resetResultsCount: () => void;
|
|
138
|
+
} & {
|
|
139
|
+
resultFunc: (resultFuncArgs_0: {
|
|
140
|
+
rawSelectedItems: string | string[] | null;
|
|
141
|
+
selectedItemsMap: Map<string, true>;
|
|
142
|
+
isEnabled: boolean;
|
|
143
|
+
isMultiSelectEnabled: boolean;
|
|
144
|
+
isCheckboxSelectionEnabled: boolean;
|
|
145
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
146
|
+
}) => boolean;
|
|
147
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
148
|
+
rawSelectedItems: string | string[] | null;
|
|
149
|
+
selectedItemsMap: Map<string, true>;
|
|
150
|
+
isEnabled: boolean;
|
|
151
|
+
isMultiSelectEnabled: boolean;
|
|
152
|
+
isCheckboxSelectionEnabled: boolean;
|
|
153
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
154
|
+
}) => boolean) & {
|
|
155
|
+
clearCache: () => void;
|
|
156
|
+
resultsCount: () => number;
|
|
157
|
+
resetResultsCount: () => void;
|
|
158
|
+
};
|
|
159
|
+
lastResult: () => boolean;
|
|
160
|
+
dependencies: [TreeViewRootSelector<UseTreeViewSelectionSignature>];
|
|
161
|
+
recomputations: () => number;
|
|
162
|
+
resetRecomputations: () => void;
|
|
163
|
+
dependencyRecomputations: () => number;
|
|
164
|
+
resetDependencyRecomputations: () => void;
|
|
165
|
+
} & {
|
|
166
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
167
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Check if selection is enabled for an item (if selection is enabled and if the item is not disabled).
|
|
171
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
172
|
+
* @param {string} itemId The id of the item to check.
|
|
173
|
+
* @returns {boolean} `true` if selection is enabled for the item, `false` otherwise.
|
|
174
|
+
*/
|
|
175
|
+
export declare const selectorIsItemSelectionEnabled: ((state: any, itemId: string) => boolean) & {
|
|
176
|
+
clearCache: () => void;
|
|
177
|
+
resultsCount: () => number;
|
|
178
|
+
resetResultsCount: () => void;
|
|
179
|
+
} & {
|
|
180
|
+
resultFunc: (resultFuncArgs_0: boolean, resultFuncArgs_1: boolean) => boolean;
|
|
181
|
+
memoizedResultFunc: ((resultFuncArgs_0: boolean, resultFuncArgs_1: boolean) => boolean) & {
|
|
182
|
+
clearCache: () => void;
|
|
183
|
+
resultsCount: () => number;
|
|
184
|
+
resetResultsCount: () => void;
|
|
185
|
+
};
|
|
186
|
+
lastResult: () => boolean;
|
|
187
|
+
dependencies: [((state: any, itemId: string) => boolean) & {
|
|
188
|
+
clearCache: () => void;
|
|
189
|
+
resultsCount: () => number;
|
|
190
|
+
resetResultsCount: () => void;
|
|
191
|
+
} & {
|
|
192
|
+
resultFunc: (resultFuncArgs_0: {
|
|
193
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
194
|
+
}, resultFuncArgs_1: string) => boolean;
|
|
195
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
196
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
197
|
+
}, resultFuncArgs_1: string) => boolean) & {
|
|
198
|
+
clearCache: () => void;
|
|
199
|
+
resultsCount: () => number;
|
|
200
|
+
resetResultsCount: () => void;
|
|
201
|
+
};
|
|
202
|
+
lastResult: () => boolean;
|
|
203
|
+
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("../useTreeViewItems").UseTreeViewItemsState<import("../../..").TreeViewDefaultItemModelProperties> & Partial<{}> & {
|
|
204
|
+
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
205
|
+
}) => {
|
|
206
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
207
|
+
}) & {
|
|
208
|
+
clearCache: () => void;
|
|
209
|
+
resultsCount: () => number;
|
|
210
|
+
resetResultsCount: () => void;
|
|
211
|
+
} & {
|
|
212
|
+
resultFunc: (resultFuncArgs_0: {
|
|
213
|
+
disabledItemsFocusable: boolean;
|
|
214
|
+
itemModelLookup: {
|
|
215
|
+
[itemId: string]: import("../../..").TreeViewBaseItem<import("../../..").TreeViewDefaultItemModelProperties>;
|
|
216
|
+
};
|
|
217
|
+
itemMetaLookup: {
|
|
218
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
219
|
+
};
|
|
220
|
+
itemOrderedChildrenIdsLookup: {
|
|
221
|
+
[parentItemId: string]: string[];
|
|
222
|
+
};
|
|
223
|
+
itemChildrenIndexesLookup: {
|
|
224
|
+
[parentItemId: string]: {
|
|
225
|
+
[itemId: string]: number;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
loading: boolean;
|
|
229
|
+
error: Error | null;
|
|
230
|
+
}) => {
|
|
231
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
232
|
+
};
|
|
233
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
234
|
+
disabledItemsFocusable: boolean;
|
|
235
|
+
itemModelLookup: {
|
|
236
|
+
[itemId: string]: import("../../..").TreeViewBaseItem<import("../../..").TreeViewDefaultItemModelProperties>;
|
|
237
|
+
};
|
|
238
|
+
itemMetaLookup: {
|
|
239
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
240
|
+
};
|
|
241
|
+
itemOrderedChildrenIdsLookup: {
|
|
242
|
+
[parentItemId: string]: string[];
|
|
243
|
+
};
|
|
244
|
+
itemChildrenIndexesLookup: {
|
|
245
|
+
[parentItemId: string]: {
|
|
246
|
+
[itemId: string]: number;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
loading: boolean;
|
|
250
|
+
error: Error | null;
|
|
251
|
+
}) => {
|
|
252
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
253
|
+
}) & {
|
|
254
|
+
clearCache: () => void;
|
|
255
|
+
resultsCount: () => number;
|
|
256
|
+
resetResultsCount: () => void;
|
|
257
|
+
};
|
|
258
|
+
lastResult: () => {
|
|
259
|
+
[itemId: string]: import("../..").TreeViewItemMeta;
|
|
260
|
+
};
|
|
261
|
+
dependencies: [TreeViewRootSelector<import("../useTreeViewItems").UseTreeViewItemsSignature>];
|
|
262
|
+
recomputations: () => number;
|
|
263
|
+
resetRecomputations: () => void;
|
|
264
|
+
dependencyRecomputations: () => number;
|
|
265
|
+
resetDependencyRecomputations: () => void;
|
|
266
|
+
} & {
|
|
267
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
268
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
269
|
+
}, (_: any, itemId: string) => string];
|
|
270
|
+
recomputations: () => number;
|
|
271
|
+
resetRecomputations: () => void;
|
|
272
|
+
dependencyRecomputations: () => number;
|
|
273
|
+
resetDependencyRecomputations: () => void;
|
|
274
|
+
} & {
|
|
275
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
276
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
277
|
+
}, ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
278
|
+
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
279
|
+
}) => boolean) & {
|
|
280
|
+
clearCache: () => void;
|
|
281
|
+
resultsCount: () => number;
|
|
282
|
+
resetResultsCount: () => void;
|
|
283
|
+
} & {
|
|
284
|
+
resultFunc: (resultFuncArgs_0: {
|
|
285
|
+
rawSelectedItems: string | string[] | null;
|
|
286
|
+
selectedItemsMap: Map<string, true>;
|
|
287
|
+
isEnabled: boolean;
|
|
288
|
+
isMultiSelectEnabled: boolean;
|
|
289
|
+
isCheckboxSelectionEnabled: boolean;
|
|
290
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
291
|
+
}) => boolean;
|
|
292
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
293
|
+
rawSelectedItems: string | string[] | null;
|
|
294
|
+
selectedItemsMap: Map<string, true>;
|
|
295
|
+
isEnabled: boolean;
|
|
296
|
+
isMultiSelectEnabled: boolean;
|
|
297
|
+
isCheckboxSelectionEnabled: boolean;
|
|
298
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
299
|
+
}) => boolean) & {
|
|
300
|
+
clearCache: () => void;
|
|
301
|
+
resultsCount: () => number;
|
|
302
|
+
resetResultsCount: () => void;
|
|
303
|
+
};
|
|
304
|
+
lastResult: () => boolean;
|
|
305
|
+
dependencies: [TreeViewRootSelector<UseTreeViewSelectionSignature>];
|
|
306
|
+
recomputations: () => number;
|
|
307
|
+
resetRecomputations: () => void;
|
|
308
|
+
dependencyRecomputations: () => number;
|
|
309
|
+
resetDependencyRecomputations: () => void;
|
|
310
|
+
} & {
|
|
311
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
312
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
313
|
+
}];
|
|
314
|
+
recomputations: () => number;
|
|
315
|
+
resetRecomputations: () => void;
|
|
316
|
+
dependencyRecomputations: () => number;
|
|
317
|
+
resetDependencyRecomputations: () => void;
|
|
318
|
+
} & {
|
|
319
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
320
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* Get the selection propagation rules.
|
|
324
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
325
|
+
* @returns {TreeViewSelectionPropagation} The selection propagation rules.
|
|
326
|
+
*/
|
|
327
|
+
export declare const selectorSelectionPropagationRules: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
328
|
+
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
329
|
+
}) => import("../../..").TreeViewSelectionPropagation) & {
|
|
330
|
+
clearCache: () => void;
|
|
331
|
+
resultsCount: () => number;
|
|
332
|
+
resetResultsCount: () => void;
|
|
333
|
+
} & {
|
|
334
|
+
resultFunc: (resultFuncArgs_0: {
|
|
335
|
+
rawSelectedItems: string | string[] | null;
|
|
336
|
+
selectedItemsMap: Map<string, true>;
|
|
337
|
+
isEnabled: boolean;
|
|
338
|
+
isMultiSelectEnabled: boolean;
|
|
339
|
+
isCheckboxSelectionEnabled: boolean;
|
|
340
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
341
|
+
}) => import("../../..").TreeViewSelectionPropagation;
|
|
342
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
343
|
+
rawSelectedItems: string | string[] | null;
|
|
344
|
+
selectedItemsMap: Map<string, true>;
|
|
345
|
+
isEnabled: boolean;
|
|
346
|
+
isMultiSelectEnabled: boolean;
|
|
347
|
+
isCheckboxSelectionEnabled: boolean;
|
|
348
|
+
selectionPropagation: import("../../..").TreeViewSelectionPropagation;
|
|
349
|
+
}) => import("../../..").TreeViewSelectionPropagation) & {
|
|
350
|
+
clearCache: () => void;
|
|
351
|
+
resultsCount: () => number;
|
|
352
|
+
resetResultsCount: () => void;
|
|
353
|
+
};
|
|
354
|
+
lastResult: () => import("../../..").TreeViewSelectionPropagation;
|
|
355
|
+
dependencies: [TreeViewRootSelector<UseTreeViewSelectionSignature>];
|
|
356
|
+
recomputations: () => number;
|
|
357
|
+
resetRecomputations: () => void;
|
|
358
|
+
dependencyRecomputations: () => number;
|
|
359
|
+
resetDependencyRecomputations: () => void;
|
|
360
|
+
} & {
|
|
361
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
362
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
32
363
|
};
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.selectorIsItemSelected = void 0;
|
|
6
|
+
exports.selectorSelectionPropagationRules = exports.selectorIsSelectionEnabled = exports.selectorIsMultiSelectEnabled = exports.selectorIsItemSelectionEnabled = exports.selectorIsItemSelected = exports.selectorIsCheckboxSelectionEnabled = void 0;
|
|
7
7
|
var _selectors = require("../../utils/selectors");
|
|
8
|
+
var _useTreeViewItems = require("../useTreeViewItems/useTreeViewItems.selectors");
|
|
8
9
|
const selectorTreeViewSelectionState = state => state.selection;
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -12,4 +13,40 @@ const selectorTreeViewSelectionState = state => state.selection;
|
|
|
12
13
|
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
13
14
|
* @returns {boolean} `true` if the item is selected, `false` otherwise.
|
|
14
15
|
*/
|
|
15
|
-
const selectorIsItemSelected = exports.selectorIsItemSelected = (0, _selectors.createSelector)([selectorTreeViewSelectionState, (_, itemId) => itemId], (selectionState, itemId) => selectionState.selectedItemsMap.has(itemId));
|
|
16
|
+
const selectorIsItemSelected = exports.selectorIsItemSelected = (0, _selectors.createSelector)([selectorTreeViewSelectionState, (_, itemId) => itemId], (selectionState, itemId) => selectionState.selectedItemsMap.has(itemId));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Check if multi selection is enabled.
|
|
20
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
21
|
+
* @returns {boolean} `true` if multi selection is enabled, `false` otherwise.
|
|
22
|
+
*/
|
|
23
|
+
const selectorIsMultiSelectEnabled = exports.selectorIsMultiSelectEnabled = (0, _selectors.createSelector)([selectorTreeViewSelectionState], selectionState => selectionState.isEnabled && selectionState.isMultiSelectEnabled);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check if selection is enabled.
|
|
27
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
28
|
+
* @returns {boolean} `true` if selection is enabled, `false` otherwise.
|
|
29
|
+
*/
|
|
30
|
+
const selectorIsSelectionEnabled = exports.selectorIsSelectionEnabled = (0, _selectors.createSelector)([selectorTreeViewSelectionState], selectionState => selectionState.isEnabled);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Check if checkbox selection is enabled.
|
|
34
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
35
|
+
* @returns {boolean} `true` if checkbox selection is enabled, `false` otherwise.
|
|
36
|
+
*/
|
|
37
|
+
const selectorIsCheckboxSelectionEnabled = exports.selectorIsCheckboxSelectionEnabled = (0, _selectors.createSelector)([selectorTreeViewSelectionState], selectionState => selectionState.isCheckboxSelectionEnabled);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Check if selection is enabled for an item (if selection is enabled and if the item is not disabled).
|
|
41
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
42
|
+
* @param {string} itemId The id of the item to check.
|
|
43
|
+
* @returns {boolean} `true` if selection is enabled for the item, `false` otherwise.
|
|
44
|
+
*/
|
|
45
|
+
const selectorIsItemSelectionEnabled = exports.selectorIsItemSelectionEnabled = (0, _selectors.createSelector)([_useTreeViewItems.selectorIsItemDisabled, selectorIsSelectionEnabled], (isItemDisabled, isSelectionEnabled) => isSelectionEnabled && !isItemDisabled);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the selection propagation rules.
|
|
49
|
+
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
50
|
+
* @returns {TreeViewSelectionPropagation} The selection propagation rules.
|
|
51
|
+
*/
|
|
52
|
+
const selectorSelectionPropagationRules = exports.selectorSelectionPropagationRules = (0, _selectors.createSelector)([selectorTreeViewSelectionState], selectionState => selectionState.selectionPropagation);
|
|
@@ -115,18 +115,19 @@ export interface UseTreeViewSelectionParameters<Multiple extends boolean | undef
|
|
|
115
115
|
export type UseTreeViewSelectionDefaultizedParameters<Multiple extends boolean> = DefaultizedProps<UseTreeViewSelectionParameters<Multiple>, 'disableSelection' | 'defaultSelectedItems' | 'multiSelect' | 'checkboxSelection' | 'selectionPropagation'>;
|
|
116
116
|
export interface UseTreeViewSelectionState {
|
|
117
117
|
selection: {
|
|
118
|
+
rawSelectedItems: TreeViewSelectionValue<boolean>;
|
|
118
119
|
selectedItemsMap: Map<string, true>;
|
|
120
|
+
isEnabled: boolean;
|
|
121
|
+
isMultiSelectEnabled: boolean;
|
|
122
|
+
isCheckboxSelectionEnabled: boolean;
|
|
123
|
+
selectionPropagation: TreeViewSelectionPropagation;
|
|
119
124
|
};
|
|
120
125
|
}
|
|
121
|
-
interface UseTreeViewSelectionContextValue {
|
|
122
|
-
selection: Pick<UseTreeViewSelectionDefaultizedParameters<boolean>, 'multiSelect' | 'checkboxSelection' | 'disableSelection' | 'selectionPropagation'>;
|
|
123
|
-
}
|
|
124
126
|
export type UseTreeViewSelectionSignature = TreeViewPluginSignature<{
|
|
125
127
|
params: UseTreeViewSelectionParameters<any>;
|
|
126
128
|
defaultizedParams: UseTreeViewSelectionDefaultizedParameters<any>;
|
|
127
129
|
instance: UseTreeViewSelectionInstance;
|
|
128
130
|
publicAPI: UseTreeViewSelectionPublicAPI;
|
|
129
|
-
contextValue: UseTreeViewSelectionContextValue;
|
|
130
131
|
modelNames: 'selectedItems';
|
|
131
132
|
state: UseTreeViewSelectionState;
|
|
132
133
|
dependencies: [UseTreeViewItemsSignature, UseTreeViewExpansionSignature, UseTreeViewItemsSignature];
|
|
@@ -3,7 +3,7 @@ import { TreeViewAnyPluginSignature, TreeViewState } from "../models/index.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Type of a selector that take the whole tree view state as input and returns a value based on a required plugin.
|
|
5
5
|
*/
|
|
6
|
-
export type TreeViewRootSelector<TSignature extends TreeViewAnyPluginSignature> = <TSignatures extends [TSignature]>(state: TreeViewState<TSignatures>) => TSignature['state'][keyof TSignature['state']];
|
|
6
|
+
export type TreeViewRootSelector<TSignature extends TreeViewAnyPluginSignature, IsOptional extends boolean = false> = <TSignatures extends [TSignature]>(state: TreeViewState<TSignatures>) => IsOptional extends true ? TSignature['state'][keyof TSignature['state']] | undefined : TSignature['state'][keyof TSignature['state']];
|
|
7
7
|
/**
|
|
8
8
|
* Type of a selector that take the whole tree view state as input and returns a value based on an optional plugin.
|
|
9
9
|
*/
|
|
@@ -22,10 +22,21 @@ const useUtilityClasses = ownerState => {
|
|
|
22
22
|
const {
|
|
23
23
|
classes
|
|
24
24
|
} = ownerState;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
return React.useMemo(() => {
|
|
26
|
+
const slots = {
|
|
27
|
+
root: ['root'],
|
|
28
|
+
item: ['item'],
|
|
29
|
+
itemContent: ['itemContent'],
|
|
30
|
+
itemGroupTransition: ['itemGroupTransition'],
|
|
31
|
+
itemIconContainer: ['itemIconContainer'],
|
|
32
|
+
itemLabel: ['itemLabel'],
|
|
33
|
+
itemLabelInput: ['itemLabelInput'],
|
|
34
|
+
itemCheckbox: ['itemCheckbox']
|
|
35
|
+
// itemDragAndDropOverlay: ['itemDragAndDropOverlay'], => feature not available on this component
|
|
36
|
+
// itemErrorIcon: ['itemErrorIcon'], => feature not available on this component
|
|
37
|
+
};
|
|
38
|
+
return composeClasses(slots, getRichTreeViewUtilityClass, classes);
|
|
39
|
+
}, [classes]);
|
|
29
40
|
};
|
|
30
41
|
export const RichTreeViewRoot = styled('ul', {
|
|
31
42
|
name: 'MuiRichTreeView',
|
|
@@ -93,7 +104,8 @@ const RichTreeView = /*#__PURE__*/React.forwardRef(function RichTreeView(inProps
|
|
|
93
104
|
});
|
|
94
105
|
}
|
|
95
106
|
return /*#__PURE__*/_jsx(TreeViewProvider, {
|
|
96
|
-
|
|
107
|
+
contextValue: contextValue,
|
|
108
|
+
classes: classes,
|
|
97
109
|
children: /*#__PURE__*/_jsx(Root, _extends({}, rootProps, {
|
|
98
110
|
children: /*#__PURE__*/_jsx(RichTreeViewItems, {
|
|
99
111
|
slots: slots,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
root: string;
|
|
4
|
-
}
|
|
1
|
+
import { TreeViewClasses } from "../internals/TreeViewProvider/TreeViewStyleContext.js";
|
|
2
|
+
export interface RichTreeViewClasses extends Omit<TreeViewClasses, 'itemDragAndDropOverlay' | 'itemErrorIcon' | 'itemLoadingIcon'> {}
|
|
5
3
|
export type RichTreeViewClassKey = keyof RichTreeViewClasses;
|
|
6
4
|
export declare function getRichTreeViewUtilityClass(slot: string): string;
|
|
7
5
|
export declare const richTreeViewClasses: RichTreeViewClasses;
|
|
@@ -3,4 +3,4 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
3
3
|
export function getRichTreeViewUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiRichTreeView', slot);
|
|
5
5
|
}
|
|
6
|
-
export const richTreeViewClasses = generateUtilityClasses('MuiRichTreeView', ['root']);
|
|
6
|
+
export const richTreeViewClasses = generateUtilityClasses('MuiRichTreeView', ['root', 'item', 'itemContent', 'itemGroupTransition', 'itemIconContainer', 'itemLabel', 'itemCheckbox', 'itemLabelInput']);
|
|
@@ -17,10 +17,21 @@ const useUtilityClasses = ownerState => {
|
|
|
17
17
|
const {
|
|
18
18
|
classes
|
|
19
19
|
} = ownerState;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
return React.useMemo(() => {
|
|
21
|
+
const slots = {
|
|
22
|
+
root: ['root'],
|
|
23
|
+
item: ['item'],
|
|
24
|
+
itemContent: ['itemContent'],
|
|
25
|
+
itemGroupTransition: ['itemGroupTransition'],
|
|
26
|
+
itemIconContainer: ['itemIconContainer'],
|
|
27
|
+
itemLabel: ['itemLabel'],
|
|
28
|
+
// itemLabelInput: ['itemLabelInput'], => feature not available on this component
|
|
29
|
+
itemCheckbox: ['itemCheckbox']
|
|
30
|
+
// itemDragAndDropOverlay: ['itemDragAndDropOverlay'], => feature not available on this component
|
|
31
|
+
// itemErrorIcon: ['itemErrorIcon'], => feature not available on this component
|
|
32
|
+
};
|
|
33
|
+
return composeClasses(slots, getSimpleTreeViewUtilityClass, classes);
|
|
34
|
+
}, [classes]);
|
|
24
35
|
};
|
|
25
36
|
export const SimpleTreeViewRoot = styled('ul', {
|
|
26
37
|
name: 'MuiSimpleTreeView',
|
|
@@ -80,7 +91,8 @@ const SimpleTreeView = /*#__PURE__*/React.forwardRef(function SimpleTreeView(inP
|
|
|
80
91
|
ownerState
|
|
81
92
|
});
|
|
82
93
|
return /*#__PURE__*/_jsx(TreeViewProvider, {
|
|
83
|
-
|
|
94
|
+
contextValue: contextValue,
|
|
95
|
+
classes: classes,
|
|
84
96
|
children: /*#__PURE__*/_jsx(Root, _extends({}, rootProps))
|
|
85
97
|
});
|
|
86
98
|
});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
root: string;
|
|
4
|
-
}
|
|
1
|
+
import { TreeViewClasses } from "../internals/TreeViewProvider/TreeViewStyleContext.js";
|
|
2
|
+
export interface SimpleTreeViewClasses extends Omit<TreeViewClasses, 'itemDragAndDropOverlay' | 'itemLabelInput' | 'itemErrorIcon' | 'itemLoadingIcon'> {}
|
|
5
3
|
export type SimpleTreeViewClassKey = keyof SimpleTreeViewClasses;
|
|
6
4
|
export declare function getSimpleTreeViewUtilityClass(slot: string): string;
|
|
7
5
|
export declare const simpleTreeViewClasses: SimpleTreeViewClasses;
|
|
@@ -3,4 +3,4 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
3
3
|
export function getSimpleTreeViewUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiSimpleTreeView', slot);
|
|
5
5
|
}
|
|
6
|
-
export const simpleTreeViewClasses = generateUtilityClasses('MuiSimpleTreeView', ['root']);
|
|
6
|
+
export const simpleTreeViewClasses = generateUtilityClasses('MuiSimpleTreeView', ['root', 'item', 'itemContent', 'itemGroupTransition', 'itemIconContainer', 'itemLabel', 'itemCheckbox']);
|
|
@@ -15,7 +15,7 @@ export declare const TreeItemErrorContainer: import("@emotion/styled").StyledCom
|
|
|
15
15
|
export declare const TreeItemLoadingContainer: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").CircularProgressProps, keyof import("@mui/material").CircularProgressProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
16
16
|
export declare const TreeItemCheckbox: import("@emotion/styled").StyledComponent<Pick<Omit<CheckboxProps & {
|
|
17
17
|
visible?: boolean;
|
|
18
|
-
}, "ref"> & React.RefAttributes<HTMLButtonElement>, "hidden" | "visible" | "color" | "content" | "size" | "style" | "icon" | "translate" | "disabled" | "form" | "slot" | "title" | "action" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "readOnly" | "required" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "sx" | "classes" | "component" | "slots" | "slotProps" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "checkedIcon" | "inputProps" | "inputRef" | "indeterminate" | "indeterminateIcon" | keyof React.RefAttributes<HTMLButtonElement>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
18
|
+
}, "ref"> & React.RefAttributes<HTMLButtonElement>, "hidden" | "visible" | "color" | "content" | "size" | "style" | "icon" | "translate" | "disabled" | "form" | "slot" | "title" | "action" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "readOnly" | "required" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "sx" | "classes" | "component" | "slots" | "slotProps" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "checkedIcon" | "inputProps" | "inputRef" | "indeterminate" | "indeterminateIcon" | keyof React.RefAttributes<HTMLButtonElement>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
19
19
|
type TreeItemComponent = ((props: TreeItemProps & React.RefAttributes<HTMLLIElement>) => React.JSX.Element) & {
|
|
20
20
|
propTypes?: any;
|
|
21
21
|
};
|