@itwin/tree-widget-react 4.0.0-alpha.24 → 4.0.0-alpha.25
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/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.d.ts +2 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +12 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeNode.d.ts +84 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeNode.js +50 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeNode.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.d.ts +1 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js +20 -47
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.d.ts +34 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.js +28 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js +10 -15
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/index.d.ts +3 -0
- package/lib/esm/tree-widget-react/components/trees/index.js +3 -0
- package/lib/esm/tree-widget-react/components/trees/index.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.d.ts +2 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +14 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeNode.d.ts +63 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeNode.js +56 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeNode.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.d.ts +1 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js +18 -49
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js.map +1 -1
- package/lib/esm/tree-widget-react-internal.d.ts +0 -1
- package/lib/esm/tree-widget-react-internal.js +0 -1
- package/lib/esm/tree-widget-react-internal.js.map +1 -1
- package/package.json +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.d.ts +0 -41
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.js +0 -50
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.d.ts +0 -19
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.js +0 -32
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.d.ts +0 -37
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.js +0 -54
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.js.map +0 -1
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { concat, defer,
|
|
5
|
+
import { concat, defer, from, map, merge, mergeMap, of } from "rxjs";
|
|
6
6
|
import { assert, Guid, Id64 } from "@itwin/core-bentley";
|
|
7
|
-
import { HierarchyNode } from "@itwin/presentation-hierarchies";
|
|
8
|
-
import { createVisibilityStatus } from "../../../common/internal/Tooltip.js";
|
|
9
7
|
import { HierarchyVisibilityHandlerImpl } from "../../../common/internal/useTreeHooks/UseCachedVisibility.js";
|
|
10
8
|
import { fromWithRelease, getClassesByView } from "../../../common/internal/Utils.js";
|
|
11
9
|
import { mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js";
|
|
12
|
-
import { CategoriesTreeNode } from "
|
|
10
|
+
import { CategoriesTreeNode } from "../../CategoriesTreeNode.js";
|
|
13
11
|
import { CategoriesTreeVisibilityHelper } from "./CategoriesTreeVisibilityHelper.js";
|
|
14
12
|
import { createCategoriesSearchResultsTree } from "./SearchResultsTree.js";
|
|
15
13
|
/**
|
|
@@ -74,12 +72,11 @@ export class CategoriesTreeVisibilityHandler {
|
|
|
74
72
|
});
|
|
75
73
|
}
|
|
76
74
|
getVisibilityStatus(node) {
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return of(createVisibilityStatus("disabled"));
|
|
75
|
+
if (CategoriesTreeNode.isElementClassGroupingNode(node)) {
|
|
76
|
+
return this.#visibilityHelper.getGroupedElementsVisibilityStatus({
|
|
77
|
+
categoryId: node.extendedData.categoryId,
|
|
78
|
+
modelElementsMap: node.extendedData.modelElementsMap,
|
|
79
|
+
});
|
|
83
80
|
}
|
|
84
81
|
if (CategoriesTreeNode.isDefinitionContainerNode(node)) {
|
|
85
82
|
return this.#visibilityHelper.getDefinitionContainersVisibilityStatus({
|
|
@@ -95,45 +92,34 @@ export class CategoriesTreeVisibilityHandler {
|
|
|
95
92
|
if (CategoriesTreeNode.isCategoryNode(node)) {
|
|
96
93
|
return this.#visibilityHelper.getCategoriesVisibilityStatus({
|
|
97
94
|
categoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
98
|
-
modelId:
|
|
95
|
+
modelId: node.extendedData.isCategoryOfSubModel ? node.extendedData.modelIds[0] : undefined,
|
|
99
96
|
type: this.#categoryType,
|
|
100
97
|
});
|
|
101
98
|
}
|
|
102
|
-
const categoryId = CategoriesTreeNode.getCategoryId(node);
|
|
103
|
-
if (!categoryId) {
|
|
104
|
-
return of(createVisibilityStatus("disabled"));
|
|
105
|
-
}
|
|
106
99
|
if (CategoriesTreeNode.isSubCategoryNode(node)) {
|
|
107
100
|
return this.#visibilityHelper.getSubCategoriesVisibilityStatus({
|
|
108
|
-
categoryId,
|
|
101
|
+
categoryId: node.extendedData.categoryId,
|
|
109
102
|
subCategoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
110
103
|
});
|
|
111
104
|
}
|
|
112
|
-
|
|
113
|
-
if (!modelId) {
|
|
114
|
-
return of(createVisibilityStatus("disabled"));
|
|
115
|
-
}
|
|
105
|
+
assert(CategoriesTreeNode.isElementNode(node));
|
|
116
106
|
return this.#visibilityHelper.getElementsVisibilityStatus({
|
|
117
107
|
elementIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
118
|
-
modelId,
|
|
119
|
-
categoryId,
|
|
108
|
+
modelId: node.extendedData.modelId,
|
|
109
|
+
categoryId: node.extendedData.categoryId,
|
|
120
110
|
type: this.#elementType,
|
|
121
111
|
});
|
|
122
112
|
}
|
|
123
113
|
/** Changes visibility of the items represented by the tree node. */
|
|
124
114
|
changeVisibilityStatus(node, on) {
|
|
125
115
|
const changeObs = defer(() => {
|
|
126
|
-
if (
|
|
127
|
-
const nodeInfo = this.getGroupingNodeInfo(node);
|
|
116
|
+
if (CategoriesTreeNode.isElementClassGroupingNode(node)) {
|
|
128
117
|
return this.#visibilityHelper.changeGroupedElementsVisibilityStatus({
|
|
129
|
-
categoryId:
|
|
130
|
-
modelElementsMap:
|
|
118
|
+
categoryId: node.extendedData.categoryId,
|
|
119
|
+
modelElementsMap: node.extendedData.modelElementsMap,
|
|
131
120
|
on,
|
|
132
121
|
});
|
|
133
122
|
}
|
|
134
|
-
if (!HierarchyNode.isInstancesNode(node)) {
|
|
135
|
-
return EMPTY;
|
|
136
|
-
}
|
|
137
123
|
if (CategoriesTreeNode.isDefinitionContainerNode(node)) {
|
|
138
124
|
return this.#visibilityHelper.changeDefinitionContainersVisibilityStatus({
|
|
139
125
|
definitionContainerIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
@@ -149,29 +135,22 @@ export class CategoriesTreeVisibilityHandler {
|
|
|
149
135
|
if (CategoriesTreeNode.isCategoryNode(node)) {
|
|
150
136
|
return this.#visibilityHelper.changeCategoriesVisibilityStatus({
|
|
151
137
|
categoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
152
|
-
modelId:
|
|
138
|
+
modelId: node.extendedData.isCategoryOfSubModel ? node.extendedData.modelIds[0] : undefined,
|
|
153
139
|
on,
|
|
154
140
|
});
|
|
155
141
|
}
|
|
156
|
-
const categoryId = CategoriesTreeNode.getCategoryId(node);
|
|
157
|
-
if (!categoryId) {
|
|
158
|
-
return EMPTY;
|
|
159
|
-
}
|
|
160
142
|
if (CategoriesTreeNode.isSubCategoryNode(node)) {
|
|
161
143
|
return this.#visibilityHelper.changeSubCategoriesVisibilityStatus({
|
|
162
|
-
categoryId,
|
|
144
|
+
categoryId: node.extendedData.categoryId,
|
|
163
145
|
subCategoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
164
146
|
on,
|
|
165
147
|
});
|
|
166
148
|
}
|
|
167
|
-
|
|
168
|
-
if (!modelId) {
|
|
169
|
-
return EMPTY;
|
|
170
|
-
}
|
|
149
|
+
assert(CategoriesTreeNode.isElementNode(node));
|
|
171
150
|
return this.#visibilityHelper.changeElementsVisibilityStatus({
|
|
172
151
|
elementIds: node.key.instanceKeys.map(({ id }) => id),
|
|
173
|
-
modelId,
|
|
174
|
-
categoryId,
|
|
152
|
+
modelId: node.extendedData.modelId,
|
|
153
|
+
categoryId: node.extendedData.categoryId,
|
|
175
154
|
on,
|
|
176
155
|
});
|
|
177
156
|
});
|
|
@@ -248,12 +227,6 @@ export class CategoriesTreeVisibilityHandler {
|
|
|
248
227
|
return from(models).pipe(mergeMap((modelId) => this.#props.idsCache.getCategoriesModeledElements(modelId, id)), map((subModels) => ({ id, subModels })));
|
|
249
228
|
}));
|
|
250
229
|
}
|
|
251
|
-
getGroupingNodeInfo(node) {
|
|
252
|
-
const modelElementsMap = node.extendedData?.modelElementsMap;
|
|
253
|
-
const categoryId = node.extendedData?.categoryId;
|
|
254
|
-
assert(!!modelElementsMap && !!categoryId);
|
|
255
|
-
return { modelElementsMap, categoryId };
|
|
256
|
-
}
|
|
257
230
|
}
|
|
258
231
|
/**
|
|
259
232
|
* Creates categories tree visibility handler. Is used by integration and performance tests.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoriesTreeVisibilityHandler.js","sourceRoot":"","sources":["../../../../../../../../src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAA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BACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,eAAe,EAAE,KAAK,CAAC,eAAe;aACvC,CAAC,CAAC;QACL,CAAC;QACD,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;KAChC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { concat, defer, EMPTY, from, map, merge, mergeMap, of } from \"rxjs\";\nimport { assert, Guid, Id64 } from \"@itwin/core-bentley\";\nimport { HierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport { createVisibilityStatus } from \"../../../common/internal/Tooltip.js\";\nimport { HierarchyVisibilityHandlerImpl } from \"../../../common/internal/useTreeHooks/UseCachedVisibility.js\";\nimport { fromWithRelease, getClassesByView } from \"../../../common/internal/Utils.js\";\nimport { mergeVisibilityStatuses } from \"../../../common/internal/VisibilityUtils.js\";\nimport { CategoriesTreeNode } from \"../CategoriesTreeNode.js\";\nimport { CategoriesTreeVisibilityHelper } from \"./CategoriesTreeVisibilityHelper.js\";\nimport { createCategoriesSearchResultsTree } from \"./SearchResultsTree.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { GroupingHierarchyNode, HierarchySearchPath } from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector } from \"@itwin/presentation-shared\";\nimport type { AlwaysAndNeverDrawnElementInfo } from \"../../../common/internal/AlwaysAndNeverDrawnElementInfo.js\";\nimport type { ElementId, ModelId } from \"../../../common/internal/Types.js\";\nimport type { SearchResultsTree } from \"../../../common/internal/visibility/BaseSearchResultsTree.js\";\nimport type { BaseIdsCache, TreeSpecificVisibilityHandler } from \"../../../common/internal/visibility/BaseVisibilityHelper.js\";\nimport type { TreeWidgetViewport } from \"../../../common/TreeWidgetViewport.js\";\nimport type { VisibilityStatus } from \"../../../common/UseHierarchyVisibility.js\";\nimport type { CategoriesTreeHierarchyConfiguration } from \"../../CategoriesTreeDefinition.js\";\nimport type { CategoriesTreeIdsCache } from \"../CategoriesTreeIdsCache.js\";\nimport type { CategoriesTreeSearchTargets } from \"./SearchResultsTree.js\";\n\n/** @internal */\nexport interface CategoriesTreeVisibilityHandlerProps {\n idsCache: CategoriesTreeIdsCache;\n viewport: TreeWidgetViewport;\n alwaysAndNeverDrawnElementInfo: AlwaysAndNeverDrawnElementInfo;\n hierarchyConfig: CategoriesTreeHierarchyConfiguration;\n}\n\n/**\n * Handles visibility status of categories tree nodes.\n *\n * This handler knows how to get and change visibility status of nodes created by hierarchy definition.\n * @internal\n */\nexport class CategoriesTreeVisibilityHandler implements Disposable, TreeSpecificVisibilityHandler<CategoriesTreeSearchTargets> {\n readonly #props: CategoriesTreeVisibilityHandlerProps;\n #visibilityHelper: CategoriesTreeVisibilityHelper;\n #elementType: \"GeometricElement3d\" | \"GeometricElement2d\";\n #categoryType: \"DrawingCategory\" | \"SpatialCategory\";\n #modelType: \"GeometricModel3d\" | \"GeometricModel2d\";\n constructor(constructorProps: CategoriesTreeVisibilityHandlerProps) {\n this.#props = constructorProps;\n // Remove after https://github.com/iTwin/viewer-components-react/issues/1421.\n // We won't need to create a custom base ids cache.\n const baseIdsCache: BaseIdsCache = {\n getCategories: (props) => this.getCategories(props),\n getAllCategories: () => this.getAllCategories(),\n getElementsCount: (props) => this.getElementsCount(props),\n getModels: (props) => this.getModels(props),\n getSubCategories: (props) => this.getSubCategories(props),\n getSubModels: (props) => this.getSubModels(props),\n hasSubModel: (props) => this.#props.idsCache.hasSubModel(props),\n };\n this.#visibilityHelper = new CategoriesTreeVisibilityHelper({\n viewport: this.#props.viewport,\n idsCache: this.#props.idsCache,\n alwaysAndNeverDrawnElementInfo: this.#props.alwaysAndNeverDrawnElementInfo,\n baseIdsCache,\n hierarchyConfig: constructorProps.hierarchyConfig,\n });\n\n this.#elementType = this.#props.viewport.viewType === \"2d\" ? \"GeometricElement2d\" : \"GeometricElement3d\";\n this.#categoryType = this.#props.viewport.viewType === \"2d\" ? \"DrawingCategory\" : \"SpatialCategory\";\n this.#modelType = this.#props.viewport.viewType === \"2d\" ? \"GeometricModel2d\" : \"GeometricModel3d\";\n }\n\n public [Symbol.dispose]() {\n this.#visibilityHelper[Symbol.dispose]();\n }\n\n public changeSearchTargetsVisibilityStatus(targets: CategoriesTreeSearchTargets, on: boolean): Observable<void> {\n return defer(() => {\n const { definitionContainerIds, subCategories, modelIds, categories, elements } = targets;\n const observables = new Array<Observable<void>>();\n if (definitionContainerIds?.size) {\n observables.push(this.#visibilityHelper.changeDefinitionContainersVisibilityStatus({ definitionContainerIds, on }));\n }\n\n if (modelIds?.size) {\n observables.push(this.#visibilityHelper.changeModelsVisibilityStatus({ modelIds, on }));\n }\n\n if (categories?.length) {\n observables.push(\n from(categories).pipe(mergeMap(({ modelId, categoryIds }) => this.#visibilityHelper.changeCategoriesVisibilityStatus({ categoryIds, modelId, on }))),\n );\n }\n\n if (subCategories?.length) {\n observables.push(\n from(subCategories).pipe(\n mergeMap(({ categoryId, subCategoryIds }) => this.#visibilityHelper.changeSubCategoriesVisibilityStatus({ subCategoryIds, categoryId, on })),\n ),\n );\n }\n\n if (elements?.length) {\n observables.push(\n fromWithRelease({ source: elements, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, elements: elementsMap, categoryId }) =>\n this.#visibilityHelper.changeElementsVisibilityStatus({ modelId, categoryId, elementIds: [...elementsMap.keys()], on }),\n ),\n ),\n );\n }\n\n return merge(...observables);\n });\n }\n\n public getVisibilityStatus(node: HierarchyNode): Observable<VisibilityStatus> {\n if (HierarchyNode.isClassGroupingNode(node)) {\n const nodeInfo = this.getGroupingNodeInfo(node);\n return this.#visibilityHelper.getGroupedElementsVisibilityStatus({ categoryId: nodeInfo.categoryId, modelElementsMap: nodeInfo.modelElementsMap });\n }\n\n if (!HierarchyNode.isInstancesNode(node)) {\n return of(createVisibilityStatus(\"disabled\"));\n }\n\n if (CategoriesTreeNode.isDefinitionContainerNode(node)) {\n return this.#visibilityHelper.getDefinitionContainersVisibilityStatus({\n definitionContainerIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n if (CategoriesTreeNode.isModelNode(node)) {\n return this.#visibilityHelper.getModelsVisibilityStatus({\n modelIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n type: this.#modelType,\n });\n }\n\n if (CategoriesTreeNode.isCategoryNode(node)) {\n return this.#visibilityHelper.getCategoriesVisibilityStatus({\n categoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n modelId: CategoriesTreeNode.getModelId(node),\n type: this.#categoryType,\n });\n }\n\n const categoryId = CategoriesTreeNode.getCategoryId(node);\n if (!categoryId) {\n return of(createVisibilityStatus(\"disabled\"));\n }\n\n if (CategoriesTreeNode.isSubCategoryNode(node)) {\n return this.#visibilityHelper.getSubCategoriesVisibilityStatus({\n categoryId,\n subCategoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n const modelId = CategoriesTreeNode.getModelId(node);\n if (!modelId) {\n return of(createVisibilityStatus(\"disabled\"));\n }\n return this.#visibilityHelper.getElementsVisibilityStatus({\n elementIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n modelId,\n categoryId,\n type: this.#elementType,\n });\n }\n\n /** Changes visibility of the items represented by the tree node. */\n public changeVisibilityStatus(node: HierarchyNode, on: boolean): Observable<void> {\n const changeObs = defer(() => {\n if (HierarchyNode.isClassGroupingNode(node)) {\n const nodeInfo = this.getGroupingNodeInfo(node);\n return this.#visibilityHelper.changeGroupedElementsVisibilityStatus({\n categoryId: nodeInfo.categoryId,\n modelElementsMap: nodeInfo.modelElementsMap,\n on,\n });\n }\n\n if (!HierarchyNode.isInstancesNode(node)) {\n return EMPTY;\n }\n\n if (CategoriesTreeNode.isDefinitionContainerNode(node)) {\n return this.#visibilityHelper.changeDefinitionContainersVisibilityStatus({\n definitionContainerIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n if (CategoriesTreeNode.isModelNode(node)) {\n return this.#visibilityHelper.changeModelsVisibilityStatus({\n modelIds: node.key.instanceKeys.map(({ id }) => id),\n on,\n });\n }\n\n if (CategoriesTreeNode.isCategoryNode(node)) {\n return this.#visibilityHelper.changeCategoriesVisibilityStatus({\n categoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n modelId: CategoriesTreeNode.getModelId(node),\n on,\n });\n }\n\n const categoryId = CategoriesTreeNode.getCategoryId(node);\n if (!categoryId) {\n return EMPTY;\n }\n\n if (CategoriesTreeNode.isSubCategoryNode(node)) {\n return this.#visibilityHelper.changeSubCategoriesVisibilityStatus({\n categoryId,\n subCategoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n const modelId = CategoriesTreeNode.getModelId(node);\n if (!modelId) {\n return EMPTY;\n }\n\n return this.#visibilityHelper.changeElementsVisibilityStatus({\n elementIds: node.key.instanceKeys.map(({ id }) => id),\n modelId,\n categoryId,\n on,\n });\n });\n\n if (this.#props.viewport.isAlwaysDrawnExclusive) {\n return concat(this.#visibilityHelper.removeAlwaysDrawnExclusive(), changeObs);\n }\n return changeObs;\n }\n\n public getSearchTargetsVisibilityStatus(targets: CategoriesTreeSearchTargets): Observable<VisibilityStatus> {\n return defer(() => {\n const { definitionContainerIds, subCategories, modelIds, categories, elements } = targets;\n const observables = new Array<Observable<VisibilityStatus>>();\n if (definitionContainerIds?.size) {\n observables.push(this.#visibilityHelper.getDefinitionContainersVisibilityStatus({ definitionContainerIds }));\n }\n\n if (modelIds?.size) {\n observables.push(this.#visibilityHelper.getModelsVisibilityStatus({ modelIds, type: this.#modelType }));\n }\n\n if (categories?.length) {\n observables.push(\n from(categories).pipe(\n mergeMap(({ modelId, categoryIds }) =>\n this.#visibilityHelper.getCategoriesVisibilityStatus({\n categoryIds,\n modelId,\n type: this.#categoryType,\n }),\n ),\n ),\n );\n }\n\n if (subCategories?.length) {\n observables.push(\n from(subCategories).pipe(\n mergeMap(({ categoryId, subCategoryIds }) => this.#visibilityHelper.getSubCategoriesVisibilityStatus({ subCategoryIds, categoryId })),\n ),\n );\n }\n\n if (elements?.length) {\n observables.push(\n fromWithRelease({ source: elements, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, elements: elementsMap, categoryId }) =>\n this.#visibilityHelper.getElementsVisibilityStatus({ modelId, categoryId, elementIds: [...elementsMap.keys()], type: this.#elementType }),\n ),\n ),\n );\n }\n\n return merge(...observables);\n }).pipe(mergeVisibilityStatuses);\n }\n\n private getCategories(props: Parameters<BaseIdsCache[\"getCategories\"]>[0]): ReturnType<BaseIdsCache[\"getCategories\"]> {\n return from(Id64.iterable(props.modelIds)).pipe(\n mergeMap((modelId) =>\n this.#props.idsCache.getModelCategoryIds(modelId).pipe(\n map((categories) => ({\n id: modelId,\n ...(this.#props.viewport.viewType === \"2d\" ? { drawingCategories: categories } : { spatialCategories: categories }),\n })),\n ),\n ),\n );\n }\n\n private getAllCategories(): ReturnType<BaseIdsCache[\"getAllCategories\"]> {\n return this.#props.idsCache.getAllCategories().pipe(\n map((categories) => {\n if (this.#props.viewport.viewType === \"2d\") {\n return { drawingCategories: categories };\n }\n return { spatialCategories: categories };\n }),\n );\n }\n\n private getElementsCount(props: Parameters<BaseIdsCache[\"getElementsCount\"]>[0]): ReturnType<BaseIdsCache[\"getElementsCount\"]> {\n return this.#props.idsCache.getCategoryElementsCount(props.modelId, props.categoryId);\n }\n\n private getModels(props: Parameters<BaseIdsCache[\"getModels\"]>[0]): ReturnType<BaseIdsCache[\"getModels\"]> {\n return this.#props.idsCache.getCategoriesElementModels(props.categoryIds, true);\n }\n\n private getSubCategories(props: Parameters<BaseIdsCache[\"getSubCategories\"]>[0]): ReturnType<BaseIdsCache[\"getSubCategories\"]> {\n return this.#props.idsCache.getSubCategories(props.categoryId);\n }\n\n private getSubModels(props: Parameters<BaseIdsCache[\"getSubModels\"]>[0]): ReturnType<BaseIdsCache[\"getSubModels\"]> {\n if (\"modelIds\" in props) {\n return from(Id64.iterable(props.modelIds)).pipe(\n mergeMap((modelId) => {\n if (props.categoryId) {\n return this.#props.idsCache.getCategoriesModeledElements(modelId, props.categoryId).pipe(map((subModels) => ({ id: modelId, subModels })));\n }\n return this.#props.idsCache.getModelCategoryIds(modelId).pipe(\n mergeMap((categoryIds) => this.#props.idsCache.getCategoriesModeledElements(modelId, categoryIds)),\n map((subModels) => ({ id: modelId, subModels })),\n );\n }),\n );\n }\n\n if (props.modelId) {\n return from(Id64.iterable(props.categoryIds)).pipe(\n mergeMap((categoryId) =>\n this.#props.idsCache.getCategoriesModeledElements(props.modelId!, categoryId).pipe(map((subModels) => ({ id: categoryId, subModels }))),\n ),\n );\n }\n\n return this.#props.idsCache.getCategoriesElementModels(props.categoryIds).pipe(\n mergeMap(({ id, models }) => {\n if (!models) {\n return of({ id, subModels: undefined });\n }\n return from(models).pipe(\n mergeMap((modelId) => this.#props.idsCache.getCategoriesModeledElements(modelId, id)),\n map((subModels) => ({ id, subModels })),\n );\n }),\n );\n }\n\n private getGroupingNodeInfo(node: GroupingHierarchyNode) {\n const modelElementsMap: Map<ModelId, Set<ElementId>> = node.extendedData?.modelElementsMap;\n const categoryId = node.extendedData?.categoryId;\n assert(!!modelElementsMap && !!categoryId);\n\n return { modelElementsMap, categoryId };\n }\n}\n\n/**\n * Creates categories tree visibility handler. Is used by integration and performance tests.\n * @internal\n */\nexport function createCategoriesTreeVisibilityHandler(props: {\n viewport: TreeWidgetViewport;\n idsCache: CategoriesTreeIdsCache;\n imodelAccess: ECClassHierarchyInspector;\n searchPaths?: HierarchySearchPath[];\n hierarchyConfig: CategoriesTreeHierarchyConfiguration;\n}) {\n return new HierarchyVisibilityHandlerImpl<CategoriesTreeSearchTargets>({\n getSearchResultsTree: (): undefined | Promise<SearchResultsTree<CategoriesTreeSearchTargets>> => {\n if (!props.searchPaths) {\n return undefined;\n }\n const { categoryClass, elementClass, modelClass } = getClassesByView(props.viewport.viewType === \"2d\" ? \"2d\" : \"3d\");\n return createCategoriesSearchResultsTree({\n idsCache: props.idsCache,\n searchPaths: props.searchPaths,\n imodelAccess: props.imodelAccess,\n categoryClassName: categoryClass,\n categoryElementClassName: elementClass,\n categoryModelClassName: modelClass,\n });\n },\n getTreeSpecificVisibilityHandler: (info) => {\n return new CategoriesTreeVisibilityHandler({\n alwaysAndNeverDrawnElementInfo: info,\n idsCache: props.idsCache,\n viewport: props.viewport,\n hierarchyConfig: props.hierarchyConfig,\n });\n },\n viewport: props.viewport,\n componentId: Guid.createValue(),\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CategoriesTreeVisibilityHandler.js","sourceRoot":"","sources":["../../../../../../../../src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8DAA8D,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAsB3E;;;;;GAKG;AACH,MAAM,OAAO,+BAA+B;IACjC,MAAM,CAAuC;IACtD,iBAAiB,CAAiC;IAClD,YAAY,CAA8C;IAC1D,aAAa,CAAwC;IACrD,UAAU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eAAe,EAAE,KAAK,CAAC,eAAe;aACvC,CAAC,CAAC;QACL,CAAC;QACD,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;KAChC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { concat, defer, from, map, merge, mergeMap, of } from \"rxjs\";\nimport { assert, Guid, Id64 } from \"@itwin/core-bentley\";\nimport { HierarchyVisibilityHandlerImpl } from \"../../../common/internal/useTreeHooks/UseCachedVisibility.js\";\nimport { fromWithRelease, getClassesByView } from \"../../../common/internal/Utils.js\";\nimport { mergeVisibilityStatuses } from \"../../../common/internal/VisibilityUtils.js\";\nimport { CategoriesTreeNode } from \"../../CategoriesTreeNode.js\";\nimport { CategoriesTreeVisibilityHelper } from \"./CategoriesTreeVisibilityHelper.js\";\nimport { createCategoriesSearchResultsTree } from \"./SearchResultsTree.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { HierarchyNode, HierarchySearchPath } from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector } from \"@itwin/presentation-shared\";\nimport type { AlwaysAndNeverDrawnElementInfo } from \"../../../common/internal/AlwaysAndNeverDrawnElementInfo.js\";\nimport type { SearchResultsTree } from \"../../../common/internal/visibility/BaseSearchResultsTree.js\";\nimport type { BaseIdsCache, TreeSpecificVisibilityHandler } from \"../../../common/internal/visibility/BaseVisibilityHelper.js\";\nimport type { TreeWidgetViewport } from \"../../../common/TreeWidgetViewport.js\";\nimport type { VisibilityStatus } from \"../../../common/UseHierarchyVisibility.js\";\nimport type { CategoriesTreeHierarchyConfiguration } from \"../../CategoriesTreeDefinition.js\";\nimport type { CategoriesTreeIdsCache } from \"../CategoriesTreeIdsCache.js\";\nimport type { CategoriesTreeSearchTargets } from \"./SearchResultsTree.js\";\n\n/** @internal */\nexport interface CategoriesTreeVisibilityHandlerProps {\n idsCache: CategoriesTreeIdsCache;\n viewport: TreeWidgetViewport;\n alwaysAndNeverDrawnElementInfo: AlwaysAndNeverDrawnElementInfo;\n hierarchyConfig: CategoriesTreeHierarchyConfiguration;\n}\n\n/**\n * Handles visibility status of categories tree nodes.\n *\n * This handler knows how to get and change visibility status of nodes created by hierarchy definition.\n * @internal\n */\nexport class CategoriesTreeVisibilityHandler implements Disposable, TreeSpecificVisibilityHandler<CategoriesTreeSearchTargets> {\n readonly #props: CategoriesTreeVisibilityHandlerProps;\n #visibilityHelper: CategoriesTreeVisibilityHelper;\n #elementType: \"GeometricElement3d\" | \"GeometricElement2d\";\n #categoryType: \"DrawingCategory\" | \"SpatialCategory\";\n #modelType: \"GeometricModel3d\" | \"GeometricModel2d\";\n constructor(constructorProps: CategoriesTreeVisibilityHandlerProps) {\n this.#props = constructorProps;\n // Remove after https://github.com/iTwin/viewer-components-react/issues/1421.\n // We won't need to create a custom base ids cache.\n const baseIdsCache: BaseIdsCache = {\n getCategories: (props) => this.getCategories(props),\n getAllCategories: () => this.getAllCategories(),\n getElementsCount: (props) => this.getElementsCount(props),\n getModels: (props) => this.getModels(props),\n getSubCategories: (props) => this.getSubCategories(props),\n getSubModels: (props) => this.getSubModels(props),\n hasSubModel: (props) => this.#props.idsCache.hasSubModel(props),\n };\n this.#visibilityHelper = new CategoriesTreeVisibilityHelper({\n viewport: this.#props.viewport,\n idsCache: this.#props.idsCache,\n alwaysAndNeverDrawnElementInfo: this.#props.alwaysAndNeverDrawnElementInfo,\n baseIdsCache,\n hierarchyConfig: constructorProps.hierarchyConfig,\n });\n\n this.#elementType = this.#props.viewport.viewType === \"2d\" ? \"GeometricElement2d\" : \"GeometricElement3d\";\n this.#categoryType = this.#props.viewport.viewType === \"2d\" ? \"DrawingCategory\" : \"SpatialCategory\";\n this.#modelType = this.#props.viewport.viewType === \"2d\" ? \"GeometricModel2d\" : \"GeometricModel3d\";\n }\n\n public [Symbol.dispose]() {\n this.#visibilityHelper[Symbol.dispose]();\n }\n\n public changeSearchTargetsVisibilityStatus(targets: CategoriesTreeSearchTargets, on: boolean): Observable<void> {\n return defer(() => {\n const { definitionContainerIds, subCategories, modelIds, categories, elements } = targets;\n const observables = new Array<Observable<void>>();\n if (definitionContainerIds?.size) {\n observables.push(this.#visibilityHelper.changeDefinitionContainersVisibilityStatus({ definitionContainerIds, on }));\n }\n\n if (modelIds?.size) {\n observables.push(this.#visibilityHelper.changeModelsVisibilityStatus({ modelIds, on }));\n }\n\n if (categories?.length) {\n observables.push(\n from(categories).pipe(mergeMap(({ modelId, categoryIds }) => this.#visibilityHelper.changeCategoriesVisibilityStatus({ categoryIds, modelId, on }))),\n );\n }\n\n if (subCategories?.length) {\n observables.push(\n from(subCategories).pipe(\n mergeMap(({ categoryId, subCategoryIds }) => this.#visibilityHelper.changeSubCategoriesVisibilityStatus({ subCategoryIds, categoryId, on })),\n ),\n );\n }\n\n if (elements?.length) {\n observables.push(\n fromWithRelease({ source: elements, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, elements: elementsMap, categoryId }) =>\n this.#visibilityHelper.changeElementsVisibilityStatus({ modelId, categoryId, elementIds: [...elementsMap.keys()], on }),\n ),\n ),\n );\n }\n\n return merge(...observables);\n });\n }\n\n public getVisibilityStatus(node: HierarchyNode): Observable<VisibilityStatus> {\n if (CategoriesTreeNode.isElementClassGroupingNode(node)) {\n return this.#visibilityHelper.getGroupedElementsVisibilityStatus({\n categoryId: node.extendedData.categoryId,\n modelElementsMap: node.extendedData.modelElementsMap,\n });\n }\n\n if (CategoriesTreeNode.isDefinitionContainerNode(node)) {\n return this.#visibilityHelper.getDefinitionContainersVisibilityStatus({\n definitionContainerIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n if (CategoriesTreeNode.isModelNode(node)) {\n return this.#visibilityHelper.getModelsVisibilityStatus({\n modelIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n type: this.#modelType,\n });\n }\n\n if (CategoriesTreeNode.isCategoryNode(node)) {\n return this.#visibilityHelper.getCategoriesVisibilityStatus({\n categoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n modelId: node.extendedData.isCategoryOfSubModel ? node.extendedData.modelIds[0] : undefined,\n type: this.#categoryType,\n });\n }\n\n if (CategoriesTreeNode.isSubCategoryNode(node)) {\n return this.#visibilityHelper.getSubCategoriesVisibilityStatus({\n categoryId: node.extendedData.categoryId,\n subCategoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n assert(CategoriesTreeNode.isElementNode(node));\n return this.#visibilityHelper.getElementsVisibilityStatus({\n elementIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n modelId: node.extendedData.modelId,\n categoryId: node.extendedData.categoryId,\n type: this.#elementType,\n });\n }\n\n /** Changes visibility of the items represented by the tree node. */\n public changeVisibilityStatus(node: HierarchyNode, on: boolean): Observable<void> {\n const changeObs = defer(() => {\n if (CategoriesTreeNode.isElementClassGroupingNode(node)) {\n return this.#visibilityHelper.changeGroupedElementsVisibilityStatus({\n categoryId: node.extendedData.categoryId,\n modelElementsMap: node.extendedData.modelElementsMap,\n on,\n });\n }\n\n if (CategoriesTreeNode.isDefinitionContainerNode(node)) {\n return this.#visibilityHelper.changeDefinitionContainersVisibilityStatus({\n definitionContainerIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n if (CategoriesTreeNode.isModelNode(node)) {\n return this.#visibilityHelper.changeModelsVisibilityStatus({\n modelIds: node.key.instanceKeys.map(({ id }) => id),\n on,\n });\n }\n\n if (CategoriesTreeNode.isCategoryNode(node)) {\n return this.#visibilityHelper.changeCategoriesVisibilityStatus({\n categoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n modelId: node.extendedData.isCategoryOfSubModel ? node.extendedData.modelIds[0] : undefined,\n on,\n });\n }\n\n if (CategoriesTreeNode.isSubCategoryNode(node)) {\n return this.#visibilityHelper.changeSubCategoriesVisibilityStatus({\n categoryId: node.extendedData.categoryId,\n subCategoryIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n assert(CategoriesTreeNode.isElementNode(node));\n return this.#visibilityHelper.changeElementsVisibilityStatus({\n elementIds: node.key.instanceKeys.map(({ id }) => id),\n modelId: node.extendedData.modelId,\n categoryId: node.extendedData.categoryId,\n on,\n });\n });\n\n if (this.#props.viewport.isAlwaysDrawnExclusive) {\n return concat(this.#visibilityHelper.removeAlwaysDrawnExclusive(), changeObs);\n }\n return changeObs;\n }\n\n public getSearchTargetsVisibilityStatus(targets: CategoriesTreeSearchTargets): Observable<VisibilityStatus> {\n return defer(() => {\n const { definitionContainerIds, subCategories, modelIds, categories, elements } = targets;\n const observables = new Array<Observable<VisibilityStatus>>();\n if (definitionContainerIds?.size) {\n observables.push(this.#visibilityHelper.getDefinitionContainersVisibilityStatus({ definitionContainerIds }));\n }\n\n if (modelIds?.size) {\n observables.push(this.#visibilityHelper.getModelsVisibilityStatus({ modelIds, type: this.#modelType }));\n }\n\n if (categories?.length) {\n observables.push(\n from(categories).pipe(\n mergeMap(({ modelId, categoryIds }) =>\n this.#visibilityHelper.getCategoriesVisibilityStatus({\n categoryIds,\n modelId,\n type: this.#categoryType,\n }),\n ),\n ),\n );\n }\n\n if (subCategories?.length) {\n observables.push(\n from(subCategories).pipe(\n mergeMap(({ categoryId, subCategoryIds }) => this.#visibilityHelper.getSubCategoriesVisibilityStatus({ subCategoryIds, categoryId })),\n ),\n );\n }\n\n if (elements?.length) {\n observables.push(\n fromWithRelease({ source: elements, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, elements: elementsMap, categoryId }) =>\n this.#visibilityHelper.getElementsVisibilityStatus({ modelId, categoryId, elementIds: [...elementsMap.keys()], type: this.#elementType }),\n ),\n ),\n );\n }\n\n return merge(...observables);\n }).pipe(mergeVisibilityStatuses);\n }\n\n private getCategories(props: Parameters<BaseIdsCache[\"getCategories\"]>[0]): ReturnType<BaseIdsCache[\"getCategories\"]> {\n return from(Id64.iterable(props.modelIds)).pipe(\n mergeMap((modelId) =>\n this.#props.idsCache.getModelCategoryIds(modelId).pipe(\n map((categories) => ({\n id: modelId,\n ...(this.#props.viewport.viewType === \"2d\" ? { drawingCategories: categories } : { spatialCategories: categories }),\n })),\n ),\n ),\n );\n }\n\n private getAllCategories(): ReturnType<BaseIdsCache[\"getAllCategories\"]> {\n return this.#props.idsCache.getAllCategories().pipe(\n map((categories) => {\n if (this.#props.viewport.viewType === \"2d\") {\n return { drawingCategories: categories };\n }\n return { spatialCategories: categories };\n }),\n );\n }\n\n private getElementsCount(props: Parameters<BaseIdsCache[\"getElementsCount\"]>[0]): ReturnType<BaseIdsCache[\"getElementsCount\"]> {\n return this.#props.idsCache.getCategoryElementsCount(props.modelId, props.categoryId);\n }\n\n private getModels(props: Parameters<BaseIdsCache[\"getModels\"]>[0]): ReturnType<BaseIdsCache[\"getModels\"]> {\n return this.#props.idsCache.getCategoriesElementModels(props.categoryIds, true);\n }\n\n private getSubCategories(props: Parameters<BaseIdsCache[\"getSubCategories\"]>[0]): ReturnType<BaseIdsCache[\"getSubCategories\"]> {\n return this.#props.idsCache.getSubCategories(props.categoryId);\n }\n\n private getSubModels(props: Parameters<BaseIdsCache[\"getSubModels\"]>[0]): ReturnType<BaseIdsCache[\"getSubModels\"]> {\n if (\"modelIds\" in props) {\n return from(Id64.iterable(props.modelIds)).pipe(\n mergeMap((modelId) => {\n if (props.categoryId) {\n return this.#props.idsCache.getCategoriesModeledElements(modelId, props.categoryId).pipe(map((subModels) => ({ id: modelId, subModels })));\n }\n return this.#props.idsCache.getModelCategoryIds(modelId).pipe(\n mergeMap((categoryIds) => this.#props.idsCache.getCategoriesModeledElements(modelId, categoryIds)),\n map((subModels) => ({ id: modelId, subModels })),\n );\n }),\n );\n }\n\n if (props.modelId) {\n return from(Id64.iterable(props.categoryIds)).pipe(\n mergeMap((categoryId) =>\n this.#props.idsCache.getCategoriesModeledElements(props.modelId!, categoryId).pipe(map((subModels) => ({ id: categoryId, subModels }))),\n ),\n );\n }\n\n return this.#props.idsCache.getCategoriesElementModels(props.categoryIds).pipe(\n mergeMap(({ id, models }) => {\n if (!models) {\n return of({ id, subModels: undefined });\n }\n return from(models).pipe(\n mergeMap((modelId) => this.#props.idsCache.getCategoriesModeledElements(modelId, id)),\n map((subModels) => ({ id, subModels })),\n );\n }),\n );\n }\n}\n\n/**\n * Creates categories tree visibility handler. Is used by integration and performance tests.\n * @internal\n */\nexport function createCategoriesTreeVisibilityHandler(props: {\n viewport: TreeWidgetViewport;\n idsCache: CategoriesTreeIdsCache;\n imodelAccess: ECClassHierarchyInspector;\n searchPaths?: HierarchySearchPath[];\n hierarchyConfig: CategoriesTreeHierarchyConfiguration;\n}) {\n return new HierarchyVisibilityHandlerImpl<CategoriesTreeSearchTargets>({\n getSearchResultsTree: (): undefined | Promise<SearchResultsTree<CategoriesTreeSearchTargets>> => {\n if (!props.searchPaths) {\n return undefined;\n }\n const { categoryClass, elementClass, modelClass } = getClassesByView(props.viewport.viewType === \"2d\" ? \"2d\" : \"3d\");\n return createCategoriesSearchResultsTree({\n idsCache: props.idsCache,\n searchPaths: props.searchPaths,\n imodelAccess: props.imodelAccess,\n categoryClassName: categoryClass,\n categoryElementClassName: elementClass,\n categoryModelClassName: modelClass,\n });\n },\n getTreeSpecificVisibilityHandler: (info) => {\n return new CategoriesTreeVisibilityHandler({\n alwaysAndNeverDrawnElementInfo: info,\n idsCache: props.idsCache,\n viewport: props.viewport,\n hierarchyConfig: props.hierarchyConfig,\n });\n },\n viewport: props.viewport,\n componentId: Guid.createValue(),\n });\n}\n"]}
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Id64String } from "@itwin/core-bentley";
|
|
2
|
+
import type { HierarchyNode, InstancesNodeKey, NonGroupingHierarchyNode } from "@itwin/presentation-hierarchies";
|
|
3
|
+
/**
|
|
4
|
+
* Contains utility functions for working with Classifications Tree nodes.
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
7
|
+
export declare namespace ClassificationsTreeNode {
|
|
8
|
+
/** Checks if the given node represents a `ClassificationSystems.ClassificationTable` element. */
|
|
9
|
+
const isClassificationTableNode: (node: Pick<HierarchyNode, "extendedData">) => node is NonGroupingHierarchyNode & {
|
|
10
|
+
key: InstancesNodeKey;
|
|
11
|
+
};
|
|
12
|
+
/** Checks if the given node represents a `ClassificationSystems.Classification` element. */
|
|
13
|
+
const isClassificationNode: (node: Pick<HierarchyNode, "extendedData">) => node is NonGroupingHierarchyNode & {
|
|
14
|
+
key: InstancesNodeKey;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Checks if the given node represents a `BisCore.GeometricElement` element.
|
|
18
|
+
*
|
|
19
|
+
* If it does, the node's `extendedData` will contain the following properties:
|
|
20
|
+
* - `type`: either `GeometricElement2d` or `GeometricElement3d`
|
|
21
|
+
* - `modelId`: `Id64String` of the model containing the element
|
|
22
|
+
* - `categoryId`: `Id64String` of the category of the element
|
|
23
|
+
*/
|
|
24
|
+
const isGeometricElementNode: (node: Pick<HierarchyNode, "extendedData">) => node is Omit<NonGroupingHierarchyNode, "extendedData"> & {
|
|
25
|
+
key: InstancesNodeKey;
|
|
26
|
+
} & {
|
|
27
|
+
extendedData: {
|
|
28
|
+
type: "GeometricElement3d" | "GeometricElement2d";
|
|
29
|
+
modelId: Id64String;
|
|
30
|
+
categoryId: Id64String;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ClassificationsTreeNode.d.ts.map
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Contains utility functions for working with Classifications Tree nodes.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export var ClassificationsTreeNode;
|
|
10
|
+
(function (ClassificationsTreeNode) {
|
|
11
|
+
/** Checks if the given node represents a `ClassificationSystems.ClassificationTable` element. */
|
|
12
|
+
ClassificationsTreeNode.isClassificationTableNode = (node) => node.extendedData?.type === "ClassificationTable";
|
|
13
|
+
/** Checks if the given node represents a `ClassificationSystems.Classification` element. */
|
|
14
|
+
ClassificationsTreeNode.isClassificationNode = (node) => node.extendedData?.type === "Classification";
|
|
15
|
+
/**
|
|
16
|
+
* Checks if the given node represents a `BisCore.GeometricElement` element.
|
|
17
|
+
*
|
|
18
|
+
* If it does, the node's `extendedData` will contain the following properties:
|
|
19
|
+
* - `type`: either `GeometricElement2d` or `GeometricElement3d`
|
|
20
|
+
* - `modelId`: `Id64String` of the model containing the element
|
|
21
|
+
* - `categoryId`: `Id64String` of the category of the element
|
|
22
|
+
*/
|
|
23
|
+
ClassificationsTreeNode.isGeometricElementNode = (node) => {
|
|
24
|
+
const type = node.extendedData?.type;
|
|
25
|
+
return type === "GeometricElement3d" || type === "GeometricElement2d";
|
|
26
|
+
};
|
|
27
|
+
})(ClassificationsTreeNode || (ClassificationsTreeNode = {}));
|
|
28
|
+
//# sourceMappingURL=ClassificationsTreeNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassificationsTreeNode.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG;;;GAGG;AACH,MAAM,KAAW,uBAAuB,CA6BvC;AA7BD,WAAiB,uBAAuB;IACtC,iGAAiG;IACpF,iDAAyB,GAAG,CAAC,IAAyC,EAAgE,EAAE,CACnJ,IAAI,CAAC,YAAY,EAAE,IAAI,KAAK,qBAAqB,CAAC;IAEpD,4FAA4F;IAC/E,4CAAoB,GAAG,CAAC,IAAyC,EAAgE,EAAE,CAC9I,IAAI,CAAC,YAAY,EAAE,IAAI,KAAK,gBAAgB,CAAC;IAE/C;;;;;;;OAOG;IACU,8CAAsB,GAAG,CACpC,IAAyC,EAOzC,EAAE;QACF,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC;QACrC,OAAO,IAAI,KAAK,oBAAoB,IAAI,IAAI,KAAK,oBAAoB,CAAC;IACxE,CAAC,CAAC;AACJ,CAAC,EA7BgB,uBAAuB,KAAvB,uBAAuB,QA6BvC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type { HierarchyNode, InstancesNodeKey, NonGroupingHierarchyNode } from \"@itwin/presentation-hierarchies\";\n\n/**\n * Contains utility functions for working with Classifications Tree nodes.\n * @beta\n */\nexport namespace ClassificationsTreeNode {\n /** Checks if the given node represents a `ClassificationSystems.ClassificationTable` element. */\n export const isClassificationTableNode = (node: Pick<HierarchyNode, \"extendedData\">): node is NonGroupingHierarchyNode & { key: InstancesNodeKey } =>\n node.extendedData?.type === \"ClassificationTable\";\n\n /** Checks if the given node represents a `ClassificationSystems.Classification` element. */\n export const isClassificationNode = (node: Pick<HierarchyNode, \"extendedData\">): node is NonGroupingHierarchyNode & { key: InstancesNodeKey } =>\n node.extendedData?.type === \"Classification\";\n\n /**\n * Checks if the given node represents a `BisCore.GeometricElement` element.\n *\n * If it does, the node's `extendedData` will contain the following properties:\n * - `type`: either `GeometricElement2d` or `GeometricElement3d`\n * - `modelId`: `Id64String` of the model containing the element\n * - `categoryId`: `Id64String` of the category of the element\n */\n export const isGeometricElementNode = (\n node: Pick<HierarchyNode, \"extendedData\">,\n ): node is Omit<NonGroupingHierarchyNode, \"extendedData\"> & { key: InstancesNodeKey } & {\n extendedData: {\n type: \"GeometricElement3d\" | \"GeometricElement2d\";\n modelId: Id64String;\n categoryId: Id64String;\n };\n } => {\n const type = node.extendedData?.type;\n return type === \"GeometricElement3d\" || type === \"GeometricElement2d\";\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HierarchyNode } from "@itwin/presentation-hierarchies";
|
|
2
1
|
import type { Observable } from "rxjs";
|
|
2
|
+
import type { HierarchyNode } from "@itwin/presentation-hierarchies";
|
|
3
3
|
import type { AlwaysAndNeverDrawnElementInfo } from "../../../common/internal/AlwaysAndNeverDrawnElementInfo.js";
|
|
4
4
|
import type { TreeSpecificVisibilityHandler } from "../../../common/internal/visibility/BaseVisibilityHelper.js";
|
|
5
5
|
import type { TreeWidgetViewport } from "../../../common/TreeWidgetViewport.js";
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { concat, defer,
|
|
6
|
-
import { Id64 } from "@itwin/core-bentley";
|
|
7
|
-
import { HierarchyNode } from "@itwin/presentation-hierarchies";
|
|
5
|
+
import { concat, defer, from, map, merge, mergeMap, of, toArray } from "rxjs";
|
|
6
|
+
import { assert, Id64 } from "@itwin/core-bentley";
|
|
8
7
|
import { fromWithRelease } from "../../../common/internal/Utils.js";
|
|
9
8
|
import { mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js";
|
|
10
|
-
import { ClassificationsTreeNode } from "
|
|
9
|
+
import { ClassificationsTreeNode } from "../../ClassificationsTreeNode.js";
|
|
11
10
|
import { ClassificationsTreeVisibilityHelper } from "./ClassificationsTreeVisibilityHelper.js";
|
|
12
11
|
/**
|
|
13
12
|
* Handles visibility status of classifications tree nodes.
|
|
@@ -61,9 +60,6 @@ export class ClassificationsTreeVisibilityHandler {
|
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
62
|
getVisibilityStatus(node) {
|
|
64
|
-
if (!HierarchyNode.isInstancesNode(node)) {
|
|
65
|
-
return EMPTY;
|
|
66
|
-
}
|
|
67
63
|
if (ClassificationsTreeNode.isClassificationTableNode(node)) {
|
|
68
64
|
return this.#visibilityHelper.getClassificationTablesVisibilityStatus({
|
|
69
65
|
classificationTableIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
@@ -74,19 +70,17 @@ export class ClassificationsTreeVisibilityHandler {
|
|
|
74
70
|
classificationIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
75
71
|
});
|
|
76
72
|
}
|
|
73
|
+
assert(ClassificationsTreeNode.isGeometricElementNode(node));
|
|
77
74
|
return this.#visibilityHelper.getElementsVisibilityStatus({
|
|
78
75
|
elementIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
79
|
-
modelId:
|
|
80
|
-
categoryId:
|
|
81
|
-
type: node.extendedData
|
|
76
|
+
modelId: node.extendedData.modelId,
|
|
77
|
+
categoryId: node.extendedData.categoryId,
|
|
78
|
+
type: node.extendedData.type,
|
|
82
79
|
});
|
|
83
80
|
}
|
|
84
81
|
/** Changes visibility of the items represented by the tree node. */
|
|
85
82
|
changeVisibilityStatus(node, on) {
|
|
86
83
|
const changeObs = defer(() => {
|
|
87
|
-
if (!HierarchyNode.isInstancesNode(node)) {
|
|
88
|
-
return EMPTY;
|
|
89
|
-
}
|
|
90
84
|
if (ClassificationsTreeNode.isClassificationTableNode(node)) {
|
|
91
85
|
return this.#visibilityHelper.changeClassificationTablesVisibilityStatus({
|
|
92
86
|
classificationTableIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),
|
|
@@ -99,10 +93,11 @@ export class ClassificationsTreeVisibilityHandler {
|
|
|
99
93
|
on,
|
|
100
94
|
});
|
|
101
95
|
}
|
|
96
|
+
assert(ClassificationsTreeNode.isGeometricElementNode(node));
|
|
102
97
|
return this.#visibilityHelper.changeElementsVisibilityStatus({
|
|
103
98
|
elementIds: node.key.instanceKeys.map(({ id }) => id),
|
|
104
|
-
modelId:
|
|
105
|
-
categoryId:
|
|
99
|
+
modelId: node.extendedData.modelId,
|
|
100
|
+
categoryId: node.extendedData.categoryId,
|
|
106
101
|
on,
|
|
107
102
|
});
|
|
108
103
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassificationsTreeVisibilityHandler.js","sourceRoot":"","sources":["../../../../../../../../src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAiB/F;;;;;GAKG;AACH,MAAM,OAAO,oCAAoC;IACtC,MAAM,CAA4C;IAC3D,iBAAiB,CAAsC;IAEvD,YAAY,gBAA2D;QACrE,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC;QAC/B,6EAA6E;QAC7E,mDAAmD;QACnD,MAAM,YAAY,GAAiB;YACjC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;YACnD,gBAA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---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { concat, defer, EMPTY, from, map, merge, mergeMap, of, toArray } from \"rxjs\";\nimport { Id64 } from \"@itwin/core-bentley\";\nimport { HierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport { fromWithRelease } from \"../../../common/internal/Utils.js\";\nimport { mergeVisibilityStatuses } from \"../../../common/internal/VisibilityUtils.js\";\nimport { ClassificationsTreeNode } from \"../ClassificationsTreeNode.js\";\nimport { ClassificationsTreeVisibilityHelper } from \"./ClassificationsTreeVisibilityHelper.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { AlwaysAndNeverDrawnElementInfo } from \"../../../common/internal/AlwaysAndNeverDrawnElementInfo.js\";\nimport type { BaseIdsCache, TreeSpecificVisibilityHandler } from \"../../../common/internal/visibility/BaseVisibilityHelper.js\";\nimport type { TreeWidgetViewport } from \"../../../common/TreeWidgetViewport.js\";\nimport type { VisibilityStatus } from \"../../../common/UseHierarchyVisibility.js\";\nimport type { ClassificationsTreeIdsCache } from \"../ClassificationsTreeIdsCache.js\";\nimport type { ClassificationsTreeSearchTargets } from \"./SearchResultsTree.js\";\n\n/** @internal */\nexport interface ClassificationsTreeVisibilityHandlerProps {\n idsCache: ClassificationsTreeIdsCache;\n viewport: TreeWidgetViewport;\n alwaysAndNeverDrawnElementInfo: AlwaysAndNeverDrawnElementInfo;\n}\n\n/**\n * Handles visibility status of classifications tree nodes.\n *\n * This handler knows how to get and change visibility status of nodes created by hierarchy definition.\n * @internal\n */\nexport class ClassificationsTreeVisibilityHandler implements Disposable, TreeSpecificVisibilityHandler<ClassificationsTreeSearchTargets> {\n readonly #props: ClassificationsTreeVisibilityHandlerProps;\n #visibilityHelper: ClassificationsTreeVisibilityHelper;\n\n constructor(constructorProps: ClassificationsTreeVisibilityHandlerProps) {\n this.#props = constructorProps;\n // Remove after https://github.com/iTwin/viewer-components-react/issues/1421.\n // We won't need to create a custom base ids cache.\n const baseIdsCache: BaseIdsCache = {\n getCategories: (props) => this.getCategories(props),\n getAllCategories: () => this.getAllCategories(),\n getElementsCount: (props) => this.getElementsCount(props),\n getModels: (props) => this.getModels(props),\n getSubCategories: (props) => this.getSubCategories(props),\n getSubModels: (props) => this.getSubModels(props),\n hasSubModel: (props) => this.#props.idsCache.hasSubModel(props),\n };\n this.#visibilityHelper = new ClassificationsTreeVisibilityHelper({\n viewport: this.#props.viewport,\n idsCache: this.#props.idsCache,\n alwaysAndNeverDrawnElementInfo: this.#props.alwaysAndNeverDrawnElementInfo,\n baseIdsCache,\n });\n }\n\n public [Symbol.dispose]() {\n this.#visibilityHelper[Symbol.dispose]();\n }\n\n public changeSearchTargetsVisibilityStatus(targets: ClassificationsTreeSearchTargets, on: boolean): Observable<void> {\n return defer(() => {\n const { classificationIds, classificationTableIds, elements2d, elements3d } = targets;\n const observables = new Array<Observable<void>>();\n if (classificationTableIds?.size) {\n observables.push(this.#visibilityHelper.changeClassificationTablesVisibilityStatus({ classificationTableIds, on }));\n }\n\n if (classificationIds?.size) {\n observables.push(this.#visibilityHelper.changeClassificationsVisibilityStatus({ classificationIds, on }));\n }\n\n if (elements2d?.length) {\n observables.push(\n from(elements2d).pipe(\n mergeMap(({ modelId, categoryId, elements }) =>\n this.#visibilityHelper.changeElementsVisibilityStatus({ modelId, categoryId, elementIds: [...elements.keys()], on }),\n ),\n ),\n );\n }\n\n if (elements3d?.length) {\n observables.push(\n from(elements3d).pipe(\n mergeMap(({ modelId, categoryId, elements }) =>\n this.#visibilityHelper.changeElementsVisibilityStatus({ modelId, categoryId, elementIds: [...elements.keys()], on }),\n ),\n ),\n );\n }\n\n return merge(...observables);\n });\n }\n\n public getVisibilityStatus(node: HierarchyNode): Observable<VisibilityStatus> {\n if (!HierarchyNode.isInstancesNode(node)) {\n return EMPTY;\n }\n\n if (ClassificationsTreeNode.isClassificationTableNode(node)) {\n return this.#visibilityHelper.getClassificationTablesVisibilityStatus({\n classificationTableIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n if (ClassificationsTreeNode.isClassificationNode(node)) {\n return this.#visibilityHelper.getClassificationsVisibilityStatus({\n classificationIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n return this.#visibilityHelper.getElementsVisibilityStatus({\n elementIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n modelId: ClassificationsTreeNode.getModelId(node),\n categoryId: ClassificationsTreeNode.getCategoryId(node),\n type: node.extendedData?.type,\n });\n }\n\n /** Changes visibility of the items represented by the tree node. */\n public changeVisibilityStatus(node: HierarchyNode, on: boolean): Observable<void> {\n const changeObs = defer(() => {\n if (!HierarchyNode.isInstancesNode(node)) {\n return EMPTY;\n }\n\n if (ClassificationsTreeNode.isClassificationTableNode(node)) {\n return this.#visibilityHelper.changeClassificationTablesVisibilityStatus({\n classificationTableIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n if (ClassificationsTreeNode.isClassificationNode(node)) {\n return this.#visibilityHelper.changeClassificationsVisibilityStatus({\n classificationIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n return this.#visibilityHelper.changeElementsVisibilityStatus({\n elementIds: node.key.instanceKeys.map(({ id }) => id),\n modelId: ClassificationsTreeNode.getModelId(node),\n categoryId: ClassificationsTreeNode.getCategoryId(node),\n on,\n });\n });\n if (this.#props.viewport.isAlwaysDrawnExclusive) {\n return concat(this.#visibilityHelper.removeAlwaysDrawnExclusive(), changeObs);\n }\n return changeObs;\n }\n\n public getSearchTargetsVisibilityStatus(targets: ClassificationsTreeSearchTargets): Observable<VisibilityStatus> {\n return defer(() => {\n const { classificationIds, classificationTableIds, elements2d, elements3d } = targets;\n const observables = new Array<Observable<VisibilityStatus>>();\n if (classificationTableIds?.size) {\n observables.push(this.#visibilityHelper.getClassificationTablesVisibilityStatus({ classificationTableIds }));\n }\n\n if (classificationIds?.size) {\n observables.push(this.#visibilityHelper.getClassificationsVisibilityStatus({ classificationIds }));\n }\n if (elements2d?.length) {\n observables.push(\n fromWithRelease({ source: elements2d, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, categoryId, elements }) => {\n return fromWithRelease({ source: elements.keys(), size: elements.size, releaseOnCount: 1000 }).pipe(\n mergeMap((elementId) =>\n this.#visibilityHelper.getElementsVisibilityStatus({ modelId, categoryId, elementIds: elementId, type: \"GeometricElement2d\" }),\n ),\n );\n }),\n ),\n );\n }\n\n if (elements3d?.length) {\n observables.push(\n fromWithRelease({ source: elements3d, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, categoryId, elements }) => {\n return fromWithRelease({ source: elements.keys(), size: elements.size, releaseOnCount: 1000 }).pipe(\n mergeMap((elementId) =>\n this.#visibilityHelper.getElementsVisibilityStatus({ modelId, categoryId, elementIds: elementId, type: \"GeometricElement3d\" }),\n ),\n );\n }),\n ),\n );\n }\n\n return merge(...observables);\n }).pipe(mergeVisibilityStatuses);\n }\n\n private getCategories(props: Parameters<BaseIdsCache[\"getCategories\"]>[0]): ReturnType<BaseIdsCache[\"getCategories\"]> {\n return from(Id64.iterable(props.modelIds)).pipe(\n mergeMap((modelId) =>\n this.#props.idsCache\n .getModelCategoryIds(modelId)\n .pipe(map(({ spatial, drawing }) => ({ id: modelId, drawingCategories: drawing, spatialCategories: spatial }))),\n ),\n );\n }\n\n private getAllCategories(): ReturnType<BaseIdsCache[\"getAllCategories\"]> {\n return this.#props.idsCache.getAllCategories().pipe(\n map(({ drawing, spatial }) => {\n return { drawingCategories: drawing, spatialCategories: spatial };\n }),\n );\n }\n\n private getElementsCount(props: Parameters<BaseIdsCache[\"getElementsCount\"]>[0]): ReturnType<BaseIdsCache[\"getElementsCount\"]> {\n return this.#props.idsCache.getCategoryElementsCount(props.modelId, props.categoryId);\n }\n\n private getModels(props: Parameters<BaseIdsCache[\"getModels\"]>[0]): ReturnType<BaseIdsCache[\"getModels\"]> {\n return this.#props.idsCache.getCategoriesElementModels(props.categoryIds, true);\n }\n\n private getSubCategories(props: Parameters<BaseIdsCache[\"getSubCategories\"]>[0]): ReturnType<BaseIdsCache[\"getSubCategories\"]> {\n return this.#props.idsCache.getSubCategories(props.categoryId);\n }\n\n private getSubModels(props: Parameters<BaseIdsCache[\"getSubModels\"]>[0]): ReturnType<BaseIdsCache[\"getSubModels\"]> {\n if (\"modelIds\" in props) {\n return from(Id64.iterable(props.modelIds)).pipe(\n mergeMap((modelId) => {\n if (props.categoryId) {\n return this.#props.idsCache.getCategoriesModeledElements(modelId, props.categoryId).pipe(map((subModels) => ({ id: modelId, subModels })));\n }\n return from(this.#props.idsCache.getModelCategoryIds(modelId)).pipe(\n mergeMap(({ drawing, spatial }) => merge(drawing, spatial)),\n toArray(),\n mergeMap((categoryIds) => this.#props.idsCache.getCategoriesModeledElements(modelId, categoryIds)),\n map((subModels) => ({ id: modelId, subModels })),\n );\n }),\n );\n }\n\n if (props.modelId) {\n return from(Id64.iterable(props.categoryIds)).pipe(\n mergeMap((categoryId) =>\n this.#props.idsCache.getCategoriesModeledElements(props.modelId!, categoryId).pipe(map((subModels) => ({ id: categoryId, subModels }))),\n ),\n );\n }\n\n return this.#props.idsCache.getCategoriesElementModels(props.categoryIds).pipe(\n mergeMap(({ id, models }) => {\n if (!models) {\n return of({ id, subModels: undefined });\n }\n return from(models).pipe(\n mergeMap((modelId) => this.#props.idsCache.getCategoriesModeledElements(modelId, id)),\n map((subModels) => ({ id, subModels })),\n );\n }),\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ClassificationsTreeVisibilityHandler.js","sourceRoot":"","sources":["../../../../../../../../src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EA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CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC1B,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;YAC1C,CAAC;YACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CACtB,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,4BAA4B,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EACrF,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CACxC,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { concat, defer, from, map, merge, mergeMap, of, toArray } from \"rxjs\";\nimport { assert, Id64 } from \"@itwin/core-bentley\";\nimport { fromWithRelease } from \"../../../common/internal/Utils.js\";\nimport { mergeVisibilityStatuses } from \"../../../common/internal/VisibilityUtils.js\";\nimport { ClassificationsTreeNode } from \"../../ClassificationsTreeNode.js\";\nimport { ClassificationsTreeVisibilityHelper } from \"./ClassificationsTreeVisibilityHelper.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { HierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport type { AlwaysAndNeverDrawnElementInfo } from \"../../../common/internal/AlwaysAndNeverDrawnElementInfo.js\";\nimport type { BaseIdsCache, TreeSpecificVisibilityHandler } from \"../../../common/internal/visibility/BaseVisibilityHelper.js\";\nimport type { TreeWidgetViewport } from \"../../../common/TreeWidgetViewport.js\";\nimport type { VisibilityStatus } from \"../../../common/UseHierarchyVisibility.js\";\nimport type { ClassificationsTreeIdsCache } from \"../ClassificationsTreeIdsCache.js\";\nimport type { ClassificationsTreeSearchTargets } from \"./SearchResultsTree.js\";\n\n/** @internal */\nexport interface ClassificationsTreeVisibilityHandlerProps {\n idsCache: ClassificationsTreeIdsCache;\n viewport: TreeWidgetViewport;\n alwaysAndNeverDrawnElementInfo: AlwaysAndNeverDrawnElementInfo;\n}\n\n/**\n * Handles visibility status of classifications tree nodes.\n *\n * This handler knows how to get and change visibility status of nodes created by hierarchy definition.\n * @internal\n */\nexport class ClassificationsTreeVisibilityHandler implements Disposable, TreeSpecificVisibilityHandler<ClassificationsTreeSearchTargets> {\n readonly #props: ClassificationsTreeVisibilityHandlerProps;\n #visibilityHelper: ClassificationsTreeVisibilityHelper;\n\n constructor(constructorProps: ClassificationsTreeVisibilityHandlerProps) {\n this.#props = constructorProps;\n // Remove after https://github.com/iTwin/viewer-components-react/issues/1421.\n // We won't need to create a custom base ids cache.\n const baseIdsCache: BaseIdsCache = {\n getCategories: (props) => this.getCategories(props),\n getAllCategories: () => this.getAllCategories(),\n getElementsCount: (props) => this.getElementsCount(props),\n getModels: (props) => this.getModels(props),\n getSubCategories: (props) => this.getSubCategories(props),\n getSubModels: (props) => this.getSubModels(props),\n hasSubModel: (props) => this.#props.idsCache.hasSubModel(props),\n };\n this.#visibilityHelper = new ClassificationsTreeVisibilityHelper({\n viewport: this.#props.viewport,\n idsCache: this.#props.idsCache,\n alwaysAndNeverDrawnElementInfo: this.#props.alwaysAndNeverDrawnElementInfo,\n baseIdsCache,\n });\n }\n\n public [Symbol.dispose]() {\n this.#visibilityHelper[Symbol.dispose]();\n }\n\n public changeSearchTargetsVisibilityStatus(targets: ClassificationsTreeSearchTargets, on: boolean): Observable<void> {\n return defer(() => {\n const { classificationIds, classificationTableIds, elements2d, elements3d } = targets;\n const observables = new Array<Observable<void>>();\n if (classificationTableIds?.size) {\n observables.push(this.#visibilityHelper.changeClassificationTablesVisibilityStatus({ classificationTableIds, on }));\n }\n\n if (classificationIds?.size) {\n observables.push(this.#visibilityHelper.changeClassificationsVisibilityStatus({ classificationIds, on }));\n }\n\n if (elements2d?.length) {\n observables.push(\n from(elements2d).pipe(\n mergeMap(({ modelId, categoryId, elements }) =>\n this.#visibilityHelper.changeElementsVisibilityStatus({ modelId, categoryId, elementIds: [...elements.keys()], on }),\n ),\n ),\n );\n }\n\n if (elements3d?.length) {\n observables.push(\n from(elements3d).pipe(\n mergeMap(({ modelId, categoryId, elements }) =>\n this.#visibilityHelper.changeElementsVisibilityStatus({ modelId, categoryId, elementIds: [...elements.keys()], on }),\n ),\n ),\n );\n }\n\n return merge(...observables);\n });\n }\n\n public getVisibilityStatus(node: HierarchyNode): Observable<VisibilityStatus> {\n if (ClassificationsTreeNode.isClassificationTableNode(node)) {\n return this.#visibilityHelper.getClassificationTablesVisibilityStatus({\n classificationTableIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n if (ClassificationsTreeNode.isClassificationNode(node)) {\n return this.#visibilityHelper.getClassificationsVisibilityStatus({\n classificationIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n assert(ClassificationsTreeNode.isGeometricElementNode(node));\n return this.#visibilityHelper.getElementsVisibilityStatus({\n elementIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n modelId: node.extendedData.modelId,\n categoryId: node.extendedData.categoryId,\n type: node.extendedData.type,\n });\n }\n\n /** Changes visibility of the items represented by the tree node. */\n public changeVisibilityStatus(node: HierarchyNode, on: boolean): Observable<void> {\n const changeObs = defer(() => {\n if (ClassificationsTreeNode.isClassificationTableNode(node)) {\n return this.#visibilityHelper.changeClassificationTablesVisibilityStatus({\n classificationTableIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n if (ClassificationsTreeNode.isClassificationNode(node)) {\n return this.#visibilityHelper.changeClassificationsVisibilityStatus({\n classificationIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n assert(ClassificationsTreeNode.isGeometricElementNode(node));\n return this.#visibilityHelper.changeElementsVisibilityStatus({\n elementIds: node.key.instanceKeys.map(({ id }) => id),\n modelId: node.extendedData.modelId,\n categoryId: node.extendedData.categoryId,\n on,\n });\n });\n if (this.#props.viewport.isAlwaysDrawnExclusive) {\n return concat(this.#visibilityHelper.removeAlwaysDrawnExclusive(), changeObs);\n }\n return changeObs;\n }\n\n public getSearchTargetsVisibilityStatus(targets: ClassificationsTreeSearchTargets): Observable<VisibilityStatus> {\n return defer(() => {\n const { classificationIds, classificationTableIds, elements2d, elements3d } = targets;\n const observables = new Array<Observable<VisibilityStatus>>();\n if (classificationTableIds?.size) {\n observables.push(this.#visibilityHelper.getClassificationTablesVisibilityStatus({ classificationTableIds }));\n }\n\n if (classificationIds?.size) {\n observables.push(this.#visibilityHelper.getClassificationsVisibilityStatus({ classificationIds }));\n }\n if (elements2d?.length) {\n observables.push(\n fromWithRelease({ source: elements2d, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, categoryId, elements }) => {\n return fromWithRelease({ source: elements.keys(), size: elements.size, releaseOnCount: 1000 }).pipe(\n mergeMap((elementId) =>\n this.#visibilityHelper.getElementsVisibilityStatus({ modelId, categoryId, elementIds: elementId, type: \"GeometricElement2d\" }),\n ),\n );\n }),\n ),\n );\n }\n\n if (elements3d?.length) {\n observables.push(\n fromWithRelease({ source: elements3d, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, categoryId, elements }) => {\n return fromWithRelease({ source: elements.keys(), size: elements.size, releaseOnCount: 1000 }).pipe(\n mergeMap((elementId) =>\n this.#visibilityHelper.getElementsVisibilityStatus({ modelId, categoryId, elementIds: elementId, type: \"GeometricElement3d\" }),\n ),\n );\n }),\n ),\n );\n }\n\n return merge(...observables);\n }).pipe(mergeVisibilityStatuses);\n }\n\n private getCategories(props: Parameters<BaseIdsCache[\"getCategories\"]>[0]): ReturnType<BaseIdsCache[\"getCategories\"]> {\n return from(Id64.iterable(props.modelIds)).pipe(\n mergeMap((modelId) =>\n this.#props.idsCache\n .getModelCategoryIds(modelId)\n .pipe(map(({ spatial, drawing }) => ({ id: modelId, drawingCategories: drawing, spatialCategories: spatial }))),\n ),\n );\n }\n\n private getAllCategories(): ReturnType<BaseIdsCache[\"getAllCategories\"]> {\n return this.#props.idsCache.getAllCategories().pipe(\n map(({ drawing, spatial }) => {\n return { drawingCategories: drawing, spatialCategories: spatial };\n }),\n );\n }\n\n private getElementsCount(props: Parameters<BaseIdsCache[\"getElementsCount\"]>[0]): ReturnType<BaseIdsCache[\"getElementsCount\"]> {\n return this.#props.idsCache.getCategoryElementsCount(props.modelId, props.categoryId);\n }\n\n private getModels(props: Parameters<BaseIdsCache[\"getModels\"]>[0]): ReturnType<BaseIdsCache[\"getModels\"]> {\n return this.#props.idsCache.getCategoriesElementModels(props.categoryIds, true);\n }\n\n private getSubCategories(props: Parameters<BaseIdsCache[\"getSubCategories\"]>[0]): ReturnType<BaseIdsCache[\"getSubCategories\"]> {\n return this.#props.idsCache.getSubCategories(props.categoryId);\n }\n\n private getSubModels(props: Parameters<BaseIdsCache[\"getSubModels\"]>[0]): ReturnType<BaseIdsCache[\"getSubModels\"]> {\n if (\"modelIds\" in props) {\n return from(Id64.iterable(props.modelIds)).pipe(\n mergeMap((modelId) => {\n if (props.categoryId) {\n return this.#props.idsCache.getCategoriesModeledElements(modelId, props.categoryId).pipe(map((subModels) => ({ id: modelId, subModels })));\n }\n return from(this.#props.idsCache.getModelCategoryIds(modelId)).pipe(\n mergeMap(({ drawing, spatial }) => merge(drawing, spatial)),\n toArray(),\n mergeMap((categoryIds) => this.#props.idsCache.getCategoriesModeledElements(modelId, categoryIds)),\n map((subModels) => ({ id: modelId, subModels })),\n );\n }),\n );\n }\n\n if (props.modelId) {\n return from(Id64.iterable(props.categoryIds)).pipe(\n mergeMap((categoryId) =>\n this.#props.idsCache.getCategoriesModeledElements(props.modelId!, categoryId).pipe(map((subModels) => ({ id: categoryId, subModels }))),\n ),\n );\n }\n\n return this.#props.idsCache.getCategoriesElementModels(props.categoryIds).pipe(\n mergeMap(({ id, models }) => {\n if (!models) {\n return of({ id, subModels: undefined });\n }\n return from(models).pipe(\n mergeMap((modelId) => this.#props.idsCache.getCategoriesModeledElements(modelId, id)),\n map((subModels) => ({ id, subModels })),\n );\n }),\n );\n }\n}\n"]}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
export { ModelsTreeComponent } from "./models-tree/ModelsTreeComponent.js";
|
|
2
2
|
export { useModelsTree, ModelsTreeIcon } from "./models-tree/UseModelsTree.js";
|
|
3
3
|
export { useModelsTreeButtonProps } from "./models-tree/ModelsTreeButtons.js";
|
|
4
|
+
export { ModelsTreeNode } from "./models-tree/ModelsTreeNode.js";
|
|
4
5
|
export { CategoriesTreeComponent } from "./categories-tree/CategoriesTreeComponent.js";
|
|
5
6
|
export { useCategoriesTree, CategoriesTreeIcon } from "./categories-tree/UseCategoriesTree.js";
|
|
6
7
|
export { useCategoriesTreeButtonProps } from "./categories-tree/CategoriesTreeButtons.js";
|
|
8
|
+
export { CategoriesTreeNode } from "./categories-tree/CategoriesTreeNode.js";
|
|
7
9
|
export { ClassificationsTreeComponent } from "./classifications-tree/ClassificationsTreeComponent.js";
|
|
8
10
|
export { ClassificationsTreeIcon } from "./classifications-tree/ClassificationsTreeIcon.js";
|
|
9
11
|
export { useClassificationsTree } from "./classifications-tree/UseClassificationsTree.js";
|
|
10
12
|
export { useClassificationsTreeDefinition } from "./classifications-tree/UseClassificationsTreeDefinition.js";
|
|
13
|
+
export { ClassificationsTreeNode } from "./classifications-tree/ClassificationsTreeNode.js";
|
|
11
14
|
export { IModelContentTreeComponent } from "./imodel-content-tree/IModelContentTreeComponent.js";
|
|
12
15
|
export { IModelContentTreeIcon } from "./imodel-content-tree/IModelContentTree.js";
|
|
13
16
|
export { ExternalSourcesTreeComponent } from "./external-sources-tree/ExternalSourcesTreeComponent.js";
|
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
export { ModelsTreeComponent } from "./models-tree/ModelsTreeComponent.js";
|
|
6
6
|
export { useModelsTree, ModelsTreeIcon } from "./models-tree/UseModelsTree.js";
|
|
7
7
|
export { useModelsTreeButtonProps } from "./models-tree/ModelsTreeButtons.js";
|
|
8
|
+
export { ModelsTreeNode } from "./models-tree/ModelsTreeNode.js";
|
|
8
9
|
export { CategoriesTreeComponent } from "./categories-tree/CategoriesTreeComponent.js";
|
|
9
10
|
export { useCategoriesTree, CategoriesTreeIcon } from "./categories-tree/UseCategoriesTree.js";
|
|
10
11
|
export { useCategoriesTreeButtonProps } from "./categories-tree/CategoriesTreeButtons.js";
|
|
12
|
+
export { CategoriesTreeNode } from "./categories-tree/CategoriesTreeNode.js";
|
|
11
13
|
export { ClassificationsTreeComponent } from "./classifications-tree/ClassificationsTreeComponent.js";
|
|
12
14
|
export { ClassificationsTreeIcon } from "./classifications-tree/ClassificationsTreeIcon.js";
|
|
13
15
|
export { useClassificationsTree } from "./classifications-tree/UseClassificationsTree.js";
|
|
14
16
|
export { useClassificationsTreeDefinition } from "./classifications-tree/UseClassificationsTreeDefinition.js";
|
|
17
|
+
export { ClassificationsTreeNode } from "./classifications-tree/ClassificationsTreeNode.js";
|
|
15
18
|
export { IModelContentTreeComponent } from "./imodel-content-tree/IModelContentTreeComponent.js";
|
|
16
19
|
export { IModelContentTreeIcon } from "./imodel-content-tree/IModelContentTree.js";
|
|
17
20
|
export { ExternalSourcesTreeComponent } from "./external-sources-tree/ExternalSourcesTreeComponent.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/tree-widget-react/components/trees/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version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MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAIlE,iFAAiF;AACjF,8HAA8H;AAC9H,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAA4B,MAAM,uCAAuC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nexport { ModelsTreeComponent } from \"./models-tree/ModelsTreeComponent.js\";\nexport { useModelsTree, ModelsTreeIcon } from \"./models-tree/UseModelsTree.js\";\nexport { useModelsTreeButtonProps } from \"./models-tree/ModelsTreeButtons.js\";\nexport { ModelsTreeNode } from \"./models-tree/ModelsTreeNode.js\";\n\nexport { CategoriesTreeComponent } from \"./categories-tree/CategoriesTreeComponent.js\";\nexport { useCategoriesTree, CategoriesTreeIcon } from \"./categories-tree/UseCategoriesTree.js\";\nexport { useCategoriesTreeButtonProps } from \"./categories-tree/CategoriesTreeButtons.js\";\nexport { CategoriesTreeNode } from \"./categories-tree/CategoriesTreeNode.js\";\n\nexport { ClassificationsTreeComponent } from \"./classifications-tree/ClassificationsTreeComponent.js\";\nexport { ClassificationsTreeIcon } from \"./classifications-tree/ClassificationsTreeIcon.js\";\nexport { useClassificationsTree } from \"./classifications-tree/UseClassificationsTree.js\";\nexport { useClassificationsTreeDefinition } from \"./classifications-tree/UseClassificationsTreeDefinition.js\";\nexport { ClassificationsTreeNode } from \"./classifications-tree/ClassificationsTreeNode.js\";\n\nexport { IModelContentTreeComponent } from \"./imodel-content-tree/IModelContentTreeComponent.js\";\nexport { IModelContentTreeIcon } from \"./imodel-content-tree/IModelContentTree.js\";\n\nexport { ExternalSourcesTreeComponent } from \"./external-sources-tree/ExternalSourcesTreeComponent.js\";\nexport { ExternalSourcesTreeIcon } from \"./external-sources-tree/ExternalSourcesTree.js\";\n\nexport { BaseTreeRendererProps } from \"./common/components/BaseTreeRenderer.js\";\nexport { FocusedInstancesContextProvider, useFocusedInstancesContext } from \"./common/FocusedInstancesContext.js\";\n\nexport { Tree } from \"./common/components/Tree.js\";\nexport { TreeWidgetViewport, createTreeWidgetViewport } from \"./common/TreeWidgetViewport.js\";\nexport { VisibilityTree } from \"./common/components/VisibilityTree.js\";\nexport { VisibilityAction } from \"./common/components/TreeNodeVisibilityButton.js\";\nexport { TreeRenderer } from \"./common/components/TreeRenderer.js\";\nexport { VisibilityTreeRenderer } from \"./common/components/VisibilityTreeRenderer.js\";\nexport { SkeletonTree } from \"./common/components/SkeletonTree.js\";\nexport { HierarchyVisibilityHandler, VisibilityStatus } from \"./common/UseHierarchyVisibility.js\";\nexport { TelemetryContextProvider } from \"./common/UseTelemetryContext.js\";\nexport { SearchLimitExceededError } from \"./common/TreeErrors.js\";\n\nexport { ModelsTreeVisibilityHandlerOverrides } from \"./models-tree/internal/visibility/ModelsTreeVisibilityHandler.js\";\n\n// reexport actions from presentation-hierarchies-react to keep naming consistent\n// reexport TreeActionBase to allow consumers defining custom actions without @itwin/presentation-hierarchies-react dependency\nexport { RenameAction, FilterAction, TreeActionBase, TreeActionBaseAttributes } from \"@itwin/presentation-hierarchies-react\";\n"]}
|