@mui/x-tree-view 8.1.0 → 8.3.0
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 +233 -7
- package/RichTreeView/RichTreeView.js +0 -6
- package/RichTreeView/RichTreeView.plugins.d.ts +1 -1
- package/RichTreeView/RichTreeView.types.d.ts +1 -7
- package/RichTreeView/index.d.ts +2 -2
- package/SimpleTreeView/SimpleTreeView.js +0 -6
- package/SimpleTreeView/SimpleTreeView.plugins.d.ts +1 -1
- package/SimpleTreeView/SimpleTreeView.types.d.ts +1 -7
- package/SimpleTreeView/index.d.ts +1 -1
- package/TreeItem/index.d.ts +2 -2
- package/TreeItemDragAndDropOverlay/index.d.ts +1 -1
- package/TreeItemIcon/index.d.ts +1 -1
- package/TreeItemLabelInput/index.d.ts +1 -1
- package/TreeItemProvider/index.d.ts +1 -1
- package/esm/RichTreeView/RichTreeView.js +0 -6
- package/esm/RichTreeView/RichTreeView.plugins.d.ts +1 -1
- package/esm/RichTreeView/RichTreeView.types.d.ts +1 -7
- package/esm/RichTreeView/index.d.ts +2 -2
- package/esm/SimpleTreeView/SimpleTreeView.js +0 -6
- package/esm/SimpleTreeView/SimpleTreeView.plugins.d.ts +1 -1
- package/esm/SimpleTreeView/SimpleTreeView.types.d.ts +1 -7
- package/esm/SimpleTreeView/index.d.ts +1 -1
- package/esm/TreeItem/index.d.ts +2 -2
- package/esm/TreeItemDragAndDropOverlay/index.d.ts +1 -1
- package/esm/TreeItemIcon/index.d.ts +1 -1
- package/esm/TreeItemLabelInput/index.d.ts +1 -1
- package/esm/TreeItemProvider/index.d.ts +1 -1
- package/esm/hooks/useTreeItemUtils/useTreeItemUtils.d.ts +6 -6
- package/esm/index.js +1 -1
- package/esm/internals/TreeViewItemDepthContext/TreeViewItemDepthContext.d.ts +1 -1
- package/esm/internals/TreeViewProvider/TreeViewProvider.types.d.ts +1 -1
- package/esm/internals/TreeViewProvider/index.d.ts +1 -1
- package/esm/internals/corePlugins/corePlugins.d.ts +1 -1
- package/esm/internals/corePlugins/index.d.ts +1 -1
- package/esm/internals/corePlugins/useTreeViewId/index.d.ts +1 -1
- package/esm/internals/corePlugins/useTreeViewId/useTreeViewId.selectors.d.ts +2 -2
- package/esm/internals/corePlugins/useTreeViewId/useTreeViewId.types.d.ts +2 -2
- package/esm/internals/corePlugins/useTreeViewInstanceEvents/index.d.ts +1 -1
- package/esm/internals/corePlugins/useTreeViewInstanceEvents/useTreeViewInstanceEvents.d.ts +1 -1
- package/esm/internals/corePlugins/useTreeViewOptionalPlugins/index.d.ts +1 -1
- package/esm/internals/index.d.ts +14 -14
- package/esm/internals/index.js +1 -1
- package/esm/internals/models/helpers.d.ts +1 -1
- package/esm/internals/models/itemPlugin.d.ts +3 -3
- package/esm/internals/models/plugin.d.ts +15 -24
- package/esm/internals/models/treeView.d.ts +3 -4
- package/esm/internals/plugins/useTreeViewExpansion/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +4 -3
- package/esm/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.d.ts +31 -31
- package/esm/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.types.d.ts +2 -2
- package/esm/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.utils.d.ts +2 -2
- package/esm/internals/plugins/useTreeViewFocus/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewFocus/useTreeViewFocus.selectors.d.ts +72 -72
- package/esm/internals/plugins/useTreeViewFocus/useTreeViewFocus.types.d.ts +4 -4
- package/esm/internals/plugins/useTreeViewItems/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.js +1 -1
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.d.ts +54 -54
- package/esm/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +2 -2
- package/esm/internals/plugins/useTreeViewJSXItems/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.types.d.ts +2 -2
- package/esm/internals/plugins/useTreeViewKeyboardNavigation/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewLabel/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +1 -1
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.selectors.d.ts +5 -5
- package/esm/internals/plugins/useTreeViewLabel/useTreeViewLabel.types.d.ts +2 -2
- package/esm/internals/plugins/useTreeViewLazyLoading/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.d.ts +56 -56
- package/esm/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.d.ts +2 -3
- package/esm/internals/plugins/useTreeViewSelection/index.d.ts +1 -1
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +4 -3
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.selectors.d.ts +71 -71
- package/esm/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +3 -3
- package/esm/internals/useTreeView/{extractPluginParamsFromProps.d.ts → useExtractPluginParamsFromProps.d.ts} +8 -9
- package/esm/internals/useTreeView/useExtractPluginParamsFromProps.js +51 -0
- package/esm/internals/useTreeView/useTreeView.js +3 -5
- package/esm/internals/useTreeView/useTreeView.types.d.ts +2 -3
- package/esm/internals/useTreeView/useTreeViewBuildContext.d.ts +4 -8
- package/esm/internals/useTreeView/useTreeViewBuildContext.js +8 -7
- package/esm/internals/utils/TreeViewStore.d.ts +1 -1
- package/esm/internals/utils/cleanupTracking/TimerBasedCleanupTracking.d.ts +1 -1
- package/esm/internals/utils/tree.d.ts +2 -2
- package/esm/internals/utils/tree.js +1 -1
- package/esm/themeAugmentation/components.js +1 -0
- package/esm/themeAugmentation/index.d.ts +3 -3
- package/esm/themeAugmentation/overrides.d.ts +0 -4
- package/esm/themeAugmentation/overrides.js +4 -0
- package/esm/themeAugmentation/props.d.ts +0 -2
- package/esm/themeAugmentation/props.js +2 -0
- package/esm/useTreeItem/index.d.ts +1 -1
- package/hooks/useTreeItemUtils/useTreeItemUtils.d.ts +6 -6
- package/index.js +1 -1
- package/internals/TreeViewItemDepthContext/TreeViewItemDepthContext.d.ts +1 -1
- package/internals/TreeViewProvider/TreeViewProvider.types.d.ts +1 -1
- package/internals/TreeViewProvider/index.d.ts +1 -1
- package/internals/corePlugins/corePlugins.d.ts +1 -1
- package/internals/corePlugins/index.d.ts +1 -1
- package/internals/corePlugins/useTreeViewId/index.d.ts +1 -1
- package/internals/corePlugins/useTreeViewId/useTreeViewId.selectors.d.ts +2 -2
- package/internals/corePlugins/useTreeViewId/useTreeViewId.types.d.ts +2 -2
- package/internals/corePlugins/useTreeViewInstanceEvents/index.d.ts +1 -1
- package/internals/corePlugins/useTreeViewInstanceEvents/useTreeViewInstanceEvents.d.ts +1 -1
- package/internals/corePlugins/useTreeViewOptionalPlugins/index.d.ts +1 -1
- package/internals/index.d.ts +14 -14
- package/internals/index.js +1 -1
- package/internals/models/helpers.d.ts +1 -1
- package/internals/models/itemPlugin.d.ts +3 -3
- package/internals/models/plugin.d.ts +15 -24
- package/internals/models/treeView.d.ts +3 -4
- package/internals/plugins/useTreeViewExpansion/index.d.ts +1 -1
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js +5 -4
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.d.ts +31 -31
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.types.d.ts +2 -2
- package/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.utils.d.ts +2 -2
- package/internals/plugins/useTreeViewFocus/index.d.ts +1 -1
- package/internals/plugins/useTreeViewFocus/useTreeViewFocus.selectors.d.ts +72 -72
- package/internals/plugins/useTreeViewFocus/useTreeViewFocus.types.d.ts +4 -4
- package/internals/plugins/useTreeViewItems/index.d.ts +1 -1
- package/internals/plugins/useTreeViewItems/useTreeViewItems.js +1 -1
- package/internals/plugins/useTreeViewItems/useTreeViewItems.selectors.d.ts +54 -54
- package/internals/plugins/useTreeViewItems/useTreeViewItems.types.d.ts +2 -2
- package/internals/plugins/useTreeViewJSXItems/index.d.ts +1 -1
- package/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.types.d.ts +2 -2
- package/internals/plugins/useTreeViewKeyboardNavigation/index.d.ts +1 -1
- package/internals/plugins/useTreeViewLabel/index.d.ts +1 -1
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.js +1 -1
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.selectors.d.ts +5 -5
- package/internals/plugins/useTreeViewLabel/useTreeViewLabel.types.d.ts +2 -2
- package/internals/plugins/useTreeViewLazyLoading/index.d.ts +1 -1
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.selectors.d.ts +56 -56
- package/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.d.ts +2 -3
- package/internals/plugins/useTreeViewSelection/index.d.ts +1 -1
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.js +5 -4
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.selectors.d.ts +71 -71
- package/internals/plugins/useTreeViewSelection/useTreeViewSelection.types.d.ts +3 -3
- package/internals/useTreeView/{extractPluginParamsFromProps.d.ts → useExtractPluginParamsFromProps.d.ts} +8 -9
- package/internals/useTreeView/useExtractPluginParamsFromProps.js +60 -0
- package/internals/useTreeView/useTreeView.js +3 -5
- package/internals/useTreeView/useTreeView.types.d.ts +2 -3
- package/internals/useTreeView/useTreeViewBuildContext.d.ts +4 -8
- package/internals/useTreeView/useTreeViewBuildContext.js +8 -7
- package/internals/utils/TreeViewStore.d.ts +1 -1
- package/internals/utils/cleanupTracking/TimerBasedCleanupTracking.d.ts +1 -1
- package/internals/utils/tree.d.ts +2 -2
- package/internals/utils/tree.js +1 -1
- package/package.json +4 -4
- package/themeAugmentation/components.js +5 -0
- package/themeAugmentation/index.d.ts +3 -3
- package/themeAugmentation/overrides.d.ts +0 -4
- package/themeAugmentation/overrides.js +5 -0
- package/themeAugmentation/props.d.ts +0 -2
- package/themeAugmentation/props.js +5 -0
- package/useTreeItem/index.d.ts +1 -1
- package/esm/internals/useTreeView/extractPluginParamsFromProps.js +0 -42
- package/esm/internals/useTreeView/useTreeViewPlugins.d.ts +0 -0
- package/esm/internals/useTreeView/useTreeViewPlugins.js +0 -0
- package/esm/internals/utils/models.d.ts +0 -7
- package/esm/internals/utils/models.js +0 -23
- package/internals/useTreeView/extractPluginParamsFromProps.js +0 -50
- package/internals/useTreeView/useTreeViewPlugins.d.ts +0 -0
- package/internals/useTreeView/useTreeViewPlugins.js +0 -1
- package/internals/utils/models.d.ts +0 -7
- package/internals/utils/models.js +0 -30
|
@@ -5,26 +5,26 @@ import { UseTreeViewSelectionSignature } from "./useTreeViewSelection.types.js";
|
|
|
5
5
|
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
6
6
|
* @returns {TreeViewSelectionValue<boolean>} The selected items.
|
|
7
7
|
*/
|
|
8
|
-
export declare const selectorSelectionModel: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
9
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
8
|
+
export declare const selectorSelectionModel: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
9
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
10
10
|
}) => string | string[] | null) & {
|
|
11
11
|
clearCache: () => void;
|
|
12
12
|
resultsCount: () => number;
|
|
13
13
|
resetResultsCount: () => void;
|
|
14
14
|
} & {
|
|
15
15
|
resultFunc: (resultFuncArgs_0: {
|
|
16
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
16
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
17
17
|
isEnabled: boolean;
|
|
18
18
|
isMultiSelectEnabled: boolean;
|
|
19
19
|
isCheckboxSelectionEnabled: boolean;
|
|
20
|
-
selectionPropagation: import("
|
|
20
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
21
21
|
}) => string | string[] | null;
|
|
22
22
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
23
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
23
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
24
24
|
isEnabled: boolean;
|
|
25
25
|
isMultiSelectEnabled: boolean;
|
|
26
26
|
isCheckboxSelectionEnabled: boolean;
|
|
27
|
-
selectionPropagation: import("
|
|
27
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
28
28
|
}) => string | string[] | null) & {
|
|
29
29
|
clearCache: () => void;
|
|
30
30
|
resultsCount: () => number;
|
|
@@ -45,8 +45,8 @@ export declare const selectorSelectionModel: ((state: import("../../corePlugins/
|
|
|
45
45
|
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
46
46
|
* @returns {TreeViewItemId[]} The selected items as an array.
|
|
47
47
|
*/
|
|
48
|
-
export declare const selectorSelectionModelArray: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
49
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
48
|
+
export declare const selectorSelectionModelArray: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
49
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
50
50
|
}) => string[]) & {
|
|
51
51
|
clearCache: () => void;
|
|
52
52
|
resultsCount: () => number;
|
|
@@ -59,26 +59,26 @@ export declare const selectorSelectionModelArray: ((state: import("../../corePlu
|
|
|
59
59
|
resetResultsCount: () => void;
|
|
60
60
|
};
|
|
61
61
|
lastResult: () => string[];
|
|
62
|
-
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
63
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
62
|
+
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
63
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
64
64
|
}) => string | string[] | null) & {
|
|
65
65
|
clearCache: () => void;
|
|
66
66
|
resultsCount: () => number;
|
|
67
67
|
resetResultsCount: () => void;
|
|
68
68
|
} & {
|
|
69
69
|
resultFunc: (resultFuncArgs_0: {
|
|
70
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
70
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
71
71
|
isEnabled: boolean;
|
|
72
72
|
isMultiSelectEnabled: boolean;
|
|
73
73
|
isCheckboxSelectionEnabled: boolean;
|
|
74
|
-
selectionPropagation: import("
|
|
74
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
75
75
|
}) => string | string[] | null;
|
|
76
76
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
77
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
77
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
78
78
|
isEnabled: boolean;
|
|
79
79
|
isMultiSelectEnabled: boolean;
|
|
80
80
|
isCheckboxSelectionEnabled: boolean;
|
|
81
|
-
selectionPropagation: import("
|
|
81
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
82
82
|
}) => string | string[] | null) & {
|
|
83
83
|
clearCache: () => void;
|
|
84
84
|
resultsCount: () => number;
|
|
@@ -119,8 +119,8 @@ export declare const selectorIsItemSelected: ((state: any, itemId: string) => bo
|
|
|
119
119
|
resetResultsCount: () => void;
|
|
120
120
|
};
|
|
121
121
|
lastResult: () => boolean;
|
|
122
|
-
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
123
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
122
|
+
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
123
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
124
124
|
}) => Map<string, true>) & {
|
|
125
125
|
clearCache: () => void;
|
|
126
126
|
resultsCount: () => number;
|
|
@@ -133,8 +133,8 @@ export declare const selectorIsItemSelected: ((state: any, itemId: string) => bo
|
|
|
133
133
|
resetResultsCount: () => void;
|
|
134
134
|
};
|
|
135
135
|
lastResult: () => Map<string, true>;
|
|
136
|
-
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
137
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
136
|
+
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
137
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
138
138
|
}) => string[]) & {
|
|
139
139
|
clearCache: () => void;
|
|
140
140
|
resultsCount: () => number;
|
|
@@ -147,26 +147,26 @@ export declare const selectorIsItemSelected: ((state: any, itemId: string) => bo
|
|
|
147
147
|
resetResultsCount: () => void;
|
|
148
148
|
};
|
|
149
149
|
lastResult: () => string[];
|
|
150
|
-
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
151
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
150
|
+
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
151
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
152
152
|
}) => string | string[] | null) & {
|
|
153
153
|
clearCache: () => void;
|
|
154
154
|
resultsCount: () => number;
|
|
155
155
|
resetResultsCount: () => void;
|
|
156
156
|
} & {
|
|
157
157
|
resultFunc: (resultFuncArgs_0: {
|
|
158
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
158
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
159
159
|
isEnabled: boolean;
|
|
160
160
|
isMultiSelectEnabled: boolean;
|
|
161
161
|
isCheckboxSelectionEnabled: boolean;
|
|
162
|
-
selectionPropagation: import("
|
|
162
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
163
163
|
}) => string | string[] | null;
|
|
164
164
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
165
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
165
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
166
166
|
isEnabled: boolean;
|
|
167
167
|
isMultiSelectEnabled: boolean;
|
|
168
168
|
isCheckboxSelectionEnabled: boolean;
|
|
169
|
-
selectionPropagation: import("
|
|
169
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
170
170
|
}) => string | string[] | null) & {
|
|
171
171
|
clearCache: () => void;
|
|
172
172
|
resultsCount: () => number;
|
|
@@ -211,26 +211,26 @@ export declare const selectorIsItemSelected: ((state: any, itemId: string) => bo
|
|
|
211
211
|
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
212
212
|
* @returns {boolean} `true` if multi selection is enabled, `false` otherwise.
|
|
213
213
|
*/
|
|
214
|
-
export declare const selectorIsMultiSelectEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
215
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
214
|
+
export declare const selectorIsMultiSelectEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
215
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
216
216
|
}) => boolean) & {
|
|
217
217
|
clearCache: () => void;
|
|
218
218
|
resultsCount: () => number;
|
|
219
219
|
resetResultsCount: () => void;
|
|
220
220
|
} & {
|
|
221
221
|
resultFunc: (resultFuncArgs_0: {
|
|
222
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
222
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
223
223
|
isEnabled: boolean;
|
|
224
224
|
isMultiSelectEnabled: boolean;
|
|
225
225
|
isCheckboxSelectionEnabled: boolean;
|
|
226
|
-
selectionPropagation: import("
|
|
226
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
227
227
|
}) => boolean;
|
|
228
228
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
229
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
229
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
230
230
|
isEnabled: boolean;
|
|
231
231
|
isMultiSelectEnabled: boolean;
|
|
232
232
|
isCheckboxSelectionEnabled: boolean;
|
|
233
|
-
selectionPropagation: import("
|
|
233
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
234
234
|
}) => boolean) & {
|
|
235
235
|
clearCache: () => void;
|
|
236
236
|
resultsCount: () => number;
|
|
@@ -251,26 +251,26 @@ export declare const selectorIsMultiSelectEnabled: ((state: import("../../corePl
|
|
|
251
251
|
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
252
252
|
* @returns {boolean} `true` if selection is enabled, `false` otherwise.
|
|
253
253
|
*/
|
|
254
|
-
export declare const selectorIsSelectionEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
255
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
254
|
+
export declare const selectorIsSelectionEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
255
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
256
256
|
}) => boolean) & {
|
|
257
257
|
clearCache: () => void;
|
|
258
258
|
resultsCount: () => number;
|
|
259
259
|
resetResultsCount: () => void;
|
|
260
260
|
} & {
|
|
261
261
|
resultFunc: (resultFuncArgs_0: {
|
|
262
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
262
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
263
263
|
isEnabled: boolean;
|
|
264
264
|
isMultiSelectEnabled: boolean;
|
|
265
265
|
isCheckboxSelectionEnabled: boolean;
|
|
266
|
-
selectionPropagation: import("
|
|
266
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
267
267
|
}) => boolean;
|
|
268
268
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
269
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
269
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
270
270
|
isEnabled: boolean;
|
|
271
271
|
isMultiSelectEnabled: boolean;
|
|
272
272
|
isCheckboxSelectionEnabled: boolean;
|
|
273
|
-
selectionPropagation: import("
|
|
273
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
274
274
|
}) => boolean) & {
|
|
275
275
|
clearCache: () => void;
|
|
276
276
|
resultsCount: () => number;
|
|
@@ -291,26 +291,26 @@ export declare const selectorIsSelectionEnabled: ((state: import("../../corePlug
|
|
|
291
291
|
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
292
292
|
* @returns {boolean} `true` if checkbox selection is enabled, `false` otherwise.
|
|
293
293
|
*/
|
|
294
|
-
export declare const selectorIsCheckboxSelectionEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
295
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
294
|
+
export declare const selectorIsCheckboxSelectionEnabled: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
295
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
296
296
|
}) => boolean) & {
|
|
297
297
|
clearCache: () => void;
|
|
298
298
|
resultsCount: () => number;
|
|
299
299
|
resetResultsCount: () => void;
|
|
300
300
|
} & {
|
|
301
301
|
resultFunc: (resultFuncArgs_0: {
|
|
302
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
302
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
303
303
|
isEnabled: boolean;
|
|
304
304
|
isMultiSelectEnabled: boolean;
|
|
305
305
|
isCheckboxSelectionEnabled: boolean;
|
|
306
|
-
selectionPropagation: import("
|
|
306
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
307
307
|
}) => boolean;
|
|
308
308
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
309
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
309
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
310
310
|
isEnabled: boolean;
|
|
311
311
|
isMultiSelectEnabled: boolean;
|
|
312
312
|
isCheckboxSelectionEnabled: boolean;
|
|
313
|
-
selectionPropagation: import("
|
|
313
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
314
314
|
}) => boolean) & {
|
|
315
315
|
clearCache: () => void;
|
|
316
316
|
resultsCount: () => number;
|
|
@@ -350,20 +350,20 @@ export declare const selectorIsItemSelectionEnabled: ((state: any, itemId: strin
|
|
|
350
350
|
resetResultsCount: () => void;
|
|
351
351
|
} & {
|
|
352
352
|
resultFunc: (resultFuncArgs_0: {
|
|
353
|
-
[itemId: string]: import("
|
|
353
|
+
[itemId: string]: import("../../index.js").TreeViewItemMeta;
|
|
354
354
|
}, resultFuncArgs_1: string) => boolean;
|
|
355
355
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
356
|
-
[itemId: string]: import("
|
|
356
|
+
[itemId: string]: import("../../index.js").TreeViewItemMeta;
|
|
357
357
|
}, resultFuncArgs_1: string) => boolean) & {
|
|
358
358
|
clearCache: () => void;
|
|
359
359
|
resultsCount: () => number;
|
|
360
360
|
resetResultsCount: () => void;
|
|
361
361
|
};
|
|
362
362
|
lastResult: () => boolean;
|
|
363
|
-
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("../useTreeViewItems").UseTreeViewItemsState<import("
|
|
364
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
363
|
+
dependencies: [((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("../useTreeViewItems/index.js").UseTreeViewItemsState<import("../../../index.js").TreeViewDefaultItemModelProperties> & Partial<{}> & {
|
|
364
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
365
365
|
}) => {
|
|
366
|
-
[itemId: string]: import("
|
|
366
|
+
[itemId: string]: import("../../index.js").TreeViewItemMeta;
|
|
367
367
|
}) & {
|
|
368
368
|
clearCache: () => void;
|
|
369
369
|
resultsCount: () => number;
|
|
@@ -372,10 +372,10 @@ export declare const selectorIsItemSelectionEnabled: ((state: any, itemId: strin
|
|
|
372
372
|
resultFunc: (resultFuncArgs_0: {
|
|
373
373
|
disabledItemsFocusable: boolean;
|
|
374
374
|
itemModelLookup: {
|
|
375
|
-
[itemId: string]: import("
|
|
375
|
+
[itemId: string]: import("../../../index.js").TreeViewBaseItem<import("../../../index.js").TreeViewDefaultItemModelProperties>;
|
|
376
376
|
};
|
|
377
377
|
itemMetaLookup: {
|
|
378
|
-
[itemId: string]: import("
|
|
378
|
+
[itemId: string]: import("../../index.js").TreeViewItemMeta;
|
|
379
379
|
};
|
|
380
380
|
itemOrderedChildrenIdsLookup: {
|
|
381
381
|
[parentItemId: string]: string[];
|
|
@@ -388,15 +388,15 @@ export declare const selectorIsItemSelectionEnabled: ((state: any, itemId: strin
|
|
|
388
388
|
loading: boolean;
|
|
389
389
|
error: Error | null;
|
|
390
390
|
}) => {
|
|
391
|
-
[itemId: string]: import("
|
|
391
|
+
[itemId: string]: import("../../index.js").TreeViewItemMeta;
|
|
392
392
|
};
|
|
393
393
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
394
394
|
disabledItemsFocusable: boolean;
|
|
395
395
|
itemModelLookup: {
|
|
396
|
-
[itemId: string]: import("
|
|
396
|
+
[itemId: string]: import("../../../index.js").TreeViewBaseItem<import("../../../index.js").TreeViewDefaultItemModelProperties>;
|
|
397
397
|
};
|
|
398
398
|
itemMetaLookup: {
|
|
399
|
-
[itemId: string]: import("
|
|
399
|
+
[itemId: string]: import("../../index.js").TreeViewItemMeta;
|
|
400
400
|
};
|
|
401
401
|
itemOrderedChildrenIdsLookup: {
|
|
402
402
|
[parentItemId: string]: string[];
|
|
@@ -409,16 +409,16 @@ export declare const selectorIsItemSelectionEnabled: ((state: any, itemId: strin
|
|
|
409
409
|
loading: boolean;
|
|
410
410
|
error: Error | null;
|
|
411
411
|
}) => {
|
|
412
|
-
[itemId: string]: import("
|
|
412
|
+
[itemId: string]: import("../../index.js").TreeViewItemMeta;
|
|
413
413
|
}) & {
|
|
414
414
|
clearCache: () => void;
|
|
415
415
|
resultsCount: () => number;
|
|
416
416
|
resetResultsCount: () => void;
|
|
417
417
|
};
|
|
418
418
|
lastResult: () => {
|
|
419
|
-
[itemId: string]: import("
|
|
419
|
+
[itemId: string]: import("../../index.js").TreeViewItemMeta;
|
|
420
420
|
};
|
|
421
|
-
dependencies: [TreeViewRootSelector<import("../useTreeViewItems").UseTreeViewItemsSignature>];
|
|
421
|
+
dependencies: [TreeViewRootSelector<import("../useTreeViewItems/index.js").UseTreeViewItemsSignature>];
|
|
422
422
|
recomputations: () => number;
|
|
423
423
|
resetRecomputations: () => void;
|
|
424
424
|
dependencyRecomputations: () => number;
|
|
@@ -434,26 +434,26 @@ export declare const selectorIsItemSelectionEnabled: ((state: any, itemId: strin
|
|
|
434
434
|
} & {
|
|
435
435
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
436
436
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
437
|
-
}, ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
438
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
437
|
+
}, ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
438
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
439
439
|
}) => boolean) & {
|
|
440
440
|
clearCache: () => void;
|
|
441
441
|
resultsCount: () => number;
|
|
442
442
|
resetResultsCount: () => void;
|
|
443
443
|
} & {
|
|
444
444
|
resultFunc: (resultFuncArgs_0: {
|
|
445
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
445
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
446
446
|
isEnabled: boolean;
|
|
447
447
|
isMultiSelectEnabled: boolean;
|
|
448
448
|
isCheckboxSelectionEnabled: boolean;
|
|
449
|
-
selectionPropagation: import("
|
|
449
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
450
450
|
}) => boolean;
|
|
451
451
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
452
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
452
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
453
453
|
isEnabled: boolean;
|
|
454
454
|
isMultiSelectEnabled: boolean;
|
|
455
455
|
isCheckboxSelectionEnabled: boolean;
|
|
456
|
-
selectionPropagation: import("
|
|
456
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
457
457
|
}) => boolean) & {
|
|
458
458
|
clearCache: () => void;
|
|
459
459
|
resultsCount: () => number;
|
|
@@ -482,32 +482,32 @@ export declare const selectorIsItemSelectionEnabled: ((state: any, itemId: strin
|
|
|
482
482
|
* @param {TreeViewState<[UseTreeViewSelectionSignature]>} state The state of the tree view.
|
|
483
483
|
* @returns {TreeViewSelectionPropagation} The selection propagation rules.
|
|
484
484
|
*/
|
|
485
|
-
export declare const selectorSelectionPropagationRules: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types").UseTreeViewIdState & import("./useTreeViewSelection.types").UseTreeViewSelectionState & Partial<{}> & {
|
|
486
|
-
cacheKey: import("../../models").TreeViewStateCacheKey;
|
|
487
|
-
}) => import("
|
|
485
|
+
export declare const selectorSelectionPropagationRules: ((state: import("../../corePlugins/useTreeViewId/useTreeViewId.types.js").UseTreeViewIdState & import("./useTreeViewSelection.types.js").UseTreeViewSelectionState & Partial<{}> & {
|
|
486
|
+
cacheKey: import("../../models/index.js").TreeViewStateCacheKey;
|
|
487
|
+
}) => import("../../../index.js").TreeViewSelectionPropagation) & {
|
|
488
488
|
clearCache: () => void;
|
|
489
489
|
resultsCount: () => number;
|
|
490
490
|
resetResultsCount: () => void;
|
|
491
491
|
} & {
|
|
492
492
|
resultFunc: (resultFuncArgs_0: {
|
|
493
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
493
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
494
494
|
isEnabled: boolean;
|
|
495
495
|
isMultiSelectEnabled: boolean;
|
|
496
496
|
isCheckboxSelectionEnabled: boolean;
|
|
497
|
-
selectionPropagation: import("
|
|
498
|
-
}) => import("
|
|
497
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
498
|
+
}) => import("../../../index.js").TreeViewSelectionPropagation;
|
|
499
499
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
500
|
-
selectedItems: import("./useTreeViewSelection.types").TreeViewSelectionValue<boolean>;
|
|
500
|
+
selectedItems: import("./useTreeViewSelection.types.js").TreeViewSelectionValue<boolean>;
|
|
501
501
|
isEnabled: boolean;
|
|
502
502
|
isMultiSelectEnabled: boolean;
|
|
503
503
|
isCheckboxSelectionEnabled: boolean;
|
|
504
|
-
selectionPropagation: import("
|
|
505
|
-
}) => import("
|
|
504
|
+
selectionPropagation: import("../../../index.js").TreeViewSelectionPropagation;
|
|
505
|
+
}) => import("../../../index.js").TreeViewSelectionPropagation) & {
|
|
506
506
|
clearCache: () => void;
|
|
507
507
|
resultsCount: () => number;
|
|
508
508
|
resetResultsCount: () => void;
|
|
509
509
|
};
|
|
510
|
-
lastResult: () => import("
|
|
510
|
+
lastResult: () => import("../../../index.js").TreeViewSelectionPropagation;
|
|
511
511
|
dependencies: [TreeViewRootSelector<UseTreeViewSelectionSignature>];
|
|
512
512
|
recomputations: () => number;
|
|
513
513
|
resetRecomputations: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
|
-
import type { TreeViewPluginSignature } from
|
|
3
|
+
import type { TreeViewPluginSignature } from "../../models/index.js";
|
|
4
4
|
import { UseTreeViewItemsSignature } from "../useTreeViewItems/index.js";
|
|
5
5
|
import { UseTreeViewExpansionSignature } from "../useTreeViewExpansion/index.js";
|
|
6
6
|
import { TreeViewSelectionPropagation, TreeViewCancellableEventHandler } from "../../../models/index.js";
|
|
@@ -112,7 +112,7 @@ export interface UseTreeViewSelectionParameters<Multiple extends boolean | undef
|
|
|
112
112
|
*/
|
|
113
113
|
onItemSelectionToggle?: (event: React.SyntheticEvent | null, itemId: string, isSelected: boolean) => void;
|
|
114
114
|
}
|
|
115
|
-
export type
|
|
115
|
+
export type UseTreeViewSelectionParametersWithDefaults<Multiple extends boolean> = DefaultizedProps<UseTreeViewSelectionParameters<Multiple>, 'disableSelection' | 'defaultSelectedItems' | 'multiSelect' | 'checkboxSelection' | 'selectionPropagation'>;
|
|
116
116
|
export interface UseTreeViewSelectionState {
|
|
117
117
|
selection: {
|
|
118
118
|
selectedItems: TreeViewSelectionValue<boolean>;
|
|
@@ -124,7 +124,7 @@ export interface UseTreeViewSelectionState {
|
|
|
124
124
|
}
|
|
125
125
|
export type UseTreeViewSelectionSignature = TreeViewPluginSignature<{
|
|
126
126
|
params: UseTreeViewSelectionParameters<any>;
|
|
127
|
-
|
|
127
|
+
paramsWithDefaults: UseTreeViewSelectionParametersWithDefaults<any>;
|
|
128
128
|
instance: UseTreeViewSelectionInstance;
|
|
129
129
|
publicAPI: UseTreeViewSelectionPublicAPI;
|
|
130
130
|
state: UseTreeViewSelectionState;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { ConvertSignaturesIntoPlugins, MergeSignaturesProperty, TreeViewAnyPluginSignature, TreeViewPluginSignature } from "../models/index.js";
|
|
2
2
|
import { UseTreeViewBaseProps } from "./useTreeView.types.js";
|
|
3
3
|
import { TreeViewCorePluginSignatures } from "../corePlugins/index.js";
|
|
4
|
+
export declare const useExtractPluginParamsFromProps: <TSignatures extends readonly TreeViewPluginSignature<any>[], TProps extends Partial<UseTreeViewBaseProps<TSignatures>>>({
|
|
5
|
+
props: {
|
|
6
|
+
apiRef,
|
|
7
|
+
...props
|
|
8
|
+
},
|
|
9
|
+
plugins
|
|
10
|
+
}: ExtractPluginParamsFromPropsParameters<TSignatures, TProps>) => ExtractPluginParamsFromPropsReturnValue<TSignatures, TProps>;
|
|
4
11
|
interface ExtractPluginParamsFromPropsParameters<TSignatures extends readonly TreeViewAnyPluginSignature[], TProps extends Partial<UseTreeViewBaseProps<TSignatures>>> {
|
|
5
12
|
plugins: ConvertSignaturesIntoPlugins<readonly [...TreeViewCorePluginSignatures, ...TSignatures]>;
|
|
6
13
|
props: TProps;
|
|
7
14
|
}
|
|
8
15
|
interface ExtractPluginParamsFromPropsReturnValue<TSignatures extends readonly TreeViewAnyPluginSignature[], TProps extends Partial<UseTreeViewBaseProps<TSignatures>>> extends UseTreeViewBaseProps<TSignatures> {
|
|
9
|
-
pluginParams: MergeSignaturesProperty<TSignatures, '
|
|
16
|
+
pluginParams: MergeSignaturesProperty<TSignatures, 'paramsWithDefaults'>;
|
|
10
17
|
forwardedProps: Omit<TProps, keyof MergeSignaturesProperty<TSignatures, 'params'>>;
|
|
11
18
|
}
|
|
12
|
-
export declare const extractPluginParamsFromProps: <TSignatures extends readonly TreeViewPluginSignature<any>[], TProps extends Partial<UseTreeViewBaseProps<TSignatures>>>({
|
|
13
|
-
props: {
|
|
14
|
-
apiRef,
|
|
15
|
-
experimentalFeatures: inExperimentalFeatures,
|
|
16
|
-
...props
|
|
17
|
-
},
|
|
18
|
-
plugins
|
|
19
|
-
}: ExtractPluginParamsFromPropsParameters<TSignatures, TProps>) => ExtractPluginParamsFromPropsReturnValue<TSignatures, TProps>;
|
|
20
19
|
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useExtractPluginParamsFromProps = void 0;
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
const _excluded = ["apiRef"];
|
|
12
|
+
const useExtractPluginParamsFromProps = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
props: {
|
|
15
|
+
apiRef
|
|
16
|
+
},
|
|
17
|
+
plugins
|
|
18
|
+
} = _ref,
|
|
19
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref.props, _excluded);
|
|
20
|
+
const paramsLookup = React.useMemo(() => {
|
|
21
|
+
const tempParamsLookup = {};
|
|
22
|
+
plugins.forEach(plugin => {
|
|
23
|
+
Object.assign(tempParamsLookup, plugin.params);
|
|
24
|
+
});
|
|
25
|
+
return tempParamsLookup;
|
|
26
|
+
}, [plugins]);
|
|
27
|
+
const {
|
|
28
|
+
forwardedProps,
|
|
29
|
+
pluginParams
|
|
30
|
+
} = React.useMemo(() => {
|
|
31
|
+
const tempPluginParams = {};
|
|
32
|
+
const tempForwardedProps = {};
|
|
33
|
+
Object.keys(props).forEach(propName => {
|
|
34
|
+
const prop = props[propName];
|
|
35
|
+
if (paramsLookup[propName]) {
|
|
36
|
+
tempPluginParams[propName] = prop;
|
|
37
|
+
} else {
|
|
38
|
+
tempForwardedProps[propName] = prop;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const pluginParamsWithDefaults = plugins.reduce((acc, plugin) => {
|
|
42
|
+
if (plugin.applyDefaultValuesToParams) {
|
|
43
|
+
return plugin.applyDefaultValuesToParams({
|
|
44
|
+
params: acc
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return acc;
|
|
48
|
+
}, tempPluginParams);
|
|
49
|
+
return {
|
|
50
|
+
forwardedProps: tempForwardedProps,
|
|
51
|
+
pluginParams: pluginParamsWithDefaults
|
|
52
|
+
};
|
|
53
|
+
}, [plugins, props, paramsLookup]);
|
|
54
|
+
return {
|
|
55
|
+
forwardedProps,
|
|
56
|
+
pluginParams,
|
|
57
|
+
apiRef
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
exports.useExtractPluginParamsFromProps = useExtractPluginParamsFromProps;
|
|
@@ -11,7 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
13
13
|
var _corePlugins = require("../corePlugins");
|
|
14
|
-
var
|
|
14
|
+
var _useExtractPluginParamsFromProps = require("./useExtractPluginParamsFromProps");
|
|
15
15
|
var _useTreeViewBuildContext = require("./useTreeViewBuildContext");
|
|
16
16
|
var _TreeViewStore = require("../utils/TreeViewStore");
|
|
17
17
|
function initializeInputApiRef(inputApiRef) {
|
|
@@ -47,9 +47,8 @@ const useTreeView = ({
|
|
|
47
47
|
const {
|
|
48
48
|
pluginParams,
|
|
49
49
|
forwardedProps,
|
|
50
|
-
apiRef
|
|
51
|
-
|
|
52
|
-
} = (0, _extractPluginParamsFromProps.extractPluginParamsFromProps)({
|
|
50
|
+
apiRef
|
|
51
|
+
} = (0, _useExtractPluginParamsFromProps.useExtractPluginParamsFromProps)({
|
|
53
52
|
plugins,
|
|
54
53
|
props
|
|
55
54
|
});
|
|
@@ -85,7 +84,6 @@ const useTreeView = ({
|
|
|
85
84
|
const pluginResponse = plugin({
|
|
86
85
|
instance,
|
|
87
86
|
params: pluginParams,
|
|
88
|
-
experimentalFeatures,
|
|
89
87
|
rootRef: innerRootRef,
|
|
90
88
|
plugins,
|
|
91
89
|
store: storeRef.current
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { EventHandlers } from '@mui/utils/types';
|
|
3
|
-
import type { TreeViewContextValue } from
|
|
4
|
-
import { TreeViewAnyPluginSignature, ConvertSignaturesIntoPlugins, TreeViewPublicAPI
|
|
3
|
+
import type { TreeViewContextValue } from "../TreeViewProvider/index.js";
|
|
4
|
+
import { TreeViewAnyPluginSignature, ConvertSignaturesIntoPlugins, TreeViewPublicAPI } from "../models/index.js";
|
|
5
5
|
export interface UseTreeViewParameters<TSignatures extends readonly TreeViewAnyPluginSignature[], TProps extends Partial<UseTreeViewBaseProps<TSignatures>>> {
|
|
6
6
|
plugins: ConvertSignaturesIntoPlugins<TSignatures>;
|
|
7
7
|
rootRef?: React.Ref<HTMLUListElement> | undefined;
|
|
@@ -9,7 +9,6 @@ export interface UseTreeViewParameters<TSignatures extends readonly TreeViewAnyP
|
|
|
9
9
|
}
|
|
10
10
|
export interface UseTreeViewBaseProps<TSignatures extends readonly TreeViewAnyPluginSignature[]> {
|
|
11
11
|
apiRef: React.RefObject<TreeViewPublicAPI<TSignatures> | undefined> | undefined;
|
|
12
|
-
experimentalFeatures: TreeViewExperimentalFeatures<TSignatures>;
|
|
13
12
|
}
|
|
14
13
|
export interface UseTreeViewRootSlotProps extends Pick<React.HTMLAttributes<HTMLUListElement>, 'onFocus' | 'onBlur' | 'onKeyDown' | 'id' | 'aria-multiselectable' | 'role' | 'tabIndex'> {
|
|
15
14
|
ref: React.Ref<HTMLUListElement>;
|
|
@@ -3,16 +3,12 @@ import { TreeViewContextValue } from "../TreeViewProvider/index.js";
|
|
|
3
3
|
import { ConvertSignaturesIntoPlugins, TreeViewAnyPluginSignature, TreeViewInstance, TreeViewPublicAPI } from "../models/index.js";
|
|
4
4
|
import { TreeViewCorePluginSignatures } from "../corePlugins/index.js";
|
|
5
5
|
import { TreeViewStore } from "../utils/TreeViewStore.js";
|
|
6
|
-
export declare const useTreeViewBuildContext: <TSignatures extends readonly TreeViewAnyPluginSignature[]>(
|
|
7
|
-
|
|
8
|
-
instance,
|
|
9
|
-
publicAPI,
|
|
10
|
-
store,
|
|
11
|
-
rootRef
|
|
12
|
-
}: {
|
|
6
|
+
export declare const useTreeViewBuildContext: <TSignatures extends readonly TreeViewAnyPluginSignature[]>(parameters: UseTreeViewBuildContextParameters<TSignatures>) => TreeViewContextValue<TSignatures>;
|
|
7
|
+
interface UseTreeViewBuildContextParameters<TSignatures extends readonly TreeViewAnyPluginSignature[]> {
|
|
13
8
|
plugins: ConvertSignaturesIntoPlugins<readonly [...TreeViewCorePluginSignatures, ...TSignatures]>;
|
|
14
9
|
instance: TreeViewInstance<TSignatures>;
|
|
15
10
|
publicAPI: TreeViewPublicAPI<TSignatures>;
|
|
16
11
|
store: TreeViewStore<TSignatures>;
|
|
17
12
|
rootRef: React.RefObject<HTMLUListElement | null>;
|
|
18
|
-
}
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useTreeViewBuildContext = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
const useTreeViewBuildContext =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const useTreeViewBuildContext = parameters => {
|
|
10
|
+
const {
|
|
11
|
+
plugins,
|
|
12
|
+
instance,
|
|
13
|
+
publicAPI,
|
|
14
|
+
store,
|
|
15
|
+
rootRef
|
|
16
|
+
} = parameters;
|
|
16
17
|
const runItemPlugins = React.useCallback(itemPluginProps => {
|
|
17
18
|
let finalRootRef = null;
|
|
18
19
|
let finalContentRef = null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TreeViewAnyPluginSignature, TreeViewState } from
|
|
1
|
+
import type { TreeViewAnyPluginSignature, TreeViewState } from "../models/index.js";
|
|
2
2
|
type Listener<T> = (value: T) => void;
|
|
3
3
|
export type StoreUpdater<TSignatures extends readonly TreeViewAnyPluginSignature[]> = (prevState: TreeViewState<TSignatures>) => TreeViewState<TSignatures>;
|
|
4
4
|
export declare class TreeViewStore<TSignatures extends readonly TreeViewAnyPluginSignature[]> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CleanupTracking, UnregisterToken, UnsubscribeFn } from "./CleanupTracking.js";
|
|
2
2
|
export declare class TimerBasedCleanupTracking implements CleanupTracking {
|
|
3
|
-
timeouts?: Map<number,
|
|
3
|
+
timeouts?: Map<number, number> | undefined;
|
|
4
4
|
cleanupTimeout: number;
|
|
5
5
|
constructor(timeout?: number);
|
|
6
6
|
register(object: any, unsubscribe: UnsubscribeFn, unregisterToken: UnregisterToken): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TreeViewState } from "../models/index.js";
|
|
2
|
-
import type { UseTreeViewExpansionSignature } from
|
|
3
|
-
import type { UseTreeViewItemsSignature } from
|
|
2
|
+
import type { UseTreeViewExpansionSignature } from "../plugins/useTreeViewExpansion/index.js";
|
|
3
|
+
import type { UseTreeViewItemsSignature } from "../plugins/useTreeViewItems/index.js";
|
|
4
4
|
export declare const getPreviousNavigableItem: (state: TreeViewState<[UseTreeViewItemsSignature, UseTreeViewExpansionSignature]>, itemId: string) => string | null;
|
|
5
5
|
export declare const getNextNavigableItem: (state: TreeViewState<[UseTreeViewItemsSignature, UseTreeViewExpansionSignature]>, itemId: string) => string | null;
|
|
6
6
|
export declare const getLastNavigableItem: (state: TreeViewState<[UseTreeViewExpansionSignature, UseTreeViewItemsSignature]>) => string;
|
package/internals/utils/tree.js
CHANGED
|
@@ -50,7 +50,7 @@ const getPreviousNavigableItem = (state, itemId) => {
|
|
|
50
50
|
let lastNavigableChild = getLastNavigableItemInArray(state, (0, _useTreeViewItems.selectorItemOrderedChildrenIds)(state, currentItemId));
|
|
51
51
|
while ((0, _useTreeViewExpansion.selectorIsItemExpanded)(state, currentItemId) && lastNavigableChild != null) {
|
|
52
52
|
currentItemId = lastNavigableChild;
|
|
53
|
-
lastNavigableChild = (
|
|
53
|
+
lastNavigableChild = getLastNavigableItemInArray(state, (0, _useTreeViewItems.selectorItemOrderedChildrenIds)(state, currentItemId));
|
|
54
54
|
}
|
|
55
55
|
return currentItemId;
|
|
56
56
|
};
|