@itwin/tree-widget-react 4.0.0-alpha.22 → 4.0.0-alpha.23
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/TreeWidgetComponentImpl.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js +3 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +11 -11
- 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/UseCategoriesTree.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +25 -25
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js +23 -39
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/{UseFilteredPaths.d.ts → UseSearchPaths.d.ts} +8 -8
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/{UseFilteredPaths.js → UseSearchPaths.js} +21 -21
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseSearchPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.d.ts +7 -7
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js +11 -11
- 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/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/{FilteredTree.d.ts → SearchResultsTree.d.ts} +8 -8
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/{FilteredTree.js → SearchResultsTree.js} +62 -62
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/SearchResultsTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js +7 -7
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js +25 -25
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.d.ts +4 -4
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.d.ts +4 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js +36 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseSearchPaths.d.ts +20 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/{UseFilteredPaths.js → UseSearchPaths.js} +19 -19
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseSearchPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.d.ts +4 -4
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js +8 -8
- 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/classifications-tree/internal/visibility/{FilteredTree.d.ts → SearchResultsTree.d.ts} +9 -9
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.js +168 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.js +3 -3
- package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/Utils.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js +17 -17
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.css +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.d.ts +6 -6
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js +11 -11
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.d.ts +21 -5
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js +24 -8
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.d.ts +1 -6
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js +4 -11
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.d.ts +18 -18
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js +32 -32
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.d.ts +91 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.js +112 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.d.ts +6 -10
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js +27 -15
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/index.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/index.js +1 -1
- package/lib/esm/tree-widget-react/components/trees/index.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js +3 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js +5 -5
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +12 -12
- 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/UseModelsTree.d.ts +29 -29
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +26 -26
- 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/ModelsTreeIdsCache.d.ts +4 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +36 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseSearchPaths.d.ts +41 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/{UseFilteredPaths.js → UseSearchPaths.js} +47 -47
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseSearchPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.d.ts +7 -7
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js +11 -11
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/{FilteredTree.d.ts → SearchResultsTree.d.ts} +8 -8
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/{FilteredTree.js → SearchResultsTree.js} +43 -43
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/SearchResultsTree.js.map +1 -0
- package/lib/public/locales/en/TreeWidget.json +13 -13
- package/package.json +7 -7
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.d.ts +0 -20
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js +0 -168
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.d.ts +0 -91
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js +0 -112
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.d.ts +0 -41
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js.map +0 -1
|
@@ -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,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAClF,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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C,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, EMPTY, from, map, merge, mergeMap, of, toArray } from \"rxjs\";\nimport { Id64 } from \"@itwin/core-bentley\";\nimport { HierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport { releaseMainThreadOnItemsCount } 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 { ClassificationsTreeFilterTargets } from \"./FilteredTree.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<ClassificationsTreeFilterTargets> {\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 changeFilterTargetsVisibilityStatus(targets: ClassificationsTreeFilterTargets, 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 getFilterTargetsVisibilityStatus(targets: ClassificationsTreeFilterTargets): 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 from(elements2d).pipe(\n releaseMainThreadOnItemsCount(50),\n mergeMap(({ modelId, categoryId, elements }) => {\n return from(elements.keys()).pipe(\n releaseMainThreadOnItemsCount(1000),\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 from(elements3d).pipe(\n releaseMainThreadOnItemsCount(50),\n mergeMap(({ modelId, categoryId, elements }) => {\n return from(elements.keys()).pipe(\n releaseMainThreadOnItemsCount(1000),\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 from(Id64.iterable(props.categoryIds)).pipe(map((categoryId) => ({ id: categoryId, subCategories: undefined })));\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,KA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AAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CACxI,CACF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAC5E,QAAQ,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, 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,32 +1,32 @@
|
|
|
1
1
|
import type { Id64Set, Id64String } from "@itwin/core-bentley";
|
|
2
|
-
import type {
|
|
2
|
+
import type { HierarchySearchPath } from "@itwin/presentation-hierarchies";
|
|
3
3
|
import type { ECClassHierarchyInspector } from "@itwin/presentation-shared";
|
|
4
4
|
import type { ElementId } from "../../../common/internal/Types.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { SearchResultsTree } from "../../../common/internal/visibility/BaseSearchResultsTree.js";
|
|
6
6
|
import type { ClassificationsTreeIdsCache } from "../ClassificationsTreeIdsCache.js";
|
|
7
7
|
/** @internal */
|
|
8
|
-
export interface
|
|
8
|
+
export interface ClassificationsTreeSearchTargets {
|
|
9
9
|
elements2d?: Array<{
|
|
10
10
|
modelId: Id64String;
|
|
11
11
|
categoryId: Id64String;
|
|
12
12
|
elements: Map<ElementId, {
|
|
13
|
-
|
|
13
|
+
isSearchTarget: boolean;
|
|
14
14
|
}>;
|
|
15
15
|
}>;
|
|
16
16
|
elements3d?: Array<{
|
|
17
17
|
modelId: Id64String;
|
|
18
18
|
categoryId: Id64String;
|
|
19
19
|
elements: Map<ElementId, {
|
|
20
|
-
|
|
20
|
+
isSearchTarget: boolean;
|
|
21
21
|
}>;
|
|
22
22
|
}>;
|
|
23
23
|
classificationTableIds?: Id64Set;
|
|
24
24
|
classificationIds?: Id64Set;
|
|
25
25
|
}
|
|
26
26
|
/** @internal */
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function createClassificationsSearchResultsTree(props: {
|
|
28
28
|
imodelAccess: ECClassHierarchyInspector;
|
|
29
|
-
|
|
29
|
+
searchPaths: HierarchySearchPath[];
|
|
30
30
|
idsCache: ClassificationsTreeIdsCache;
|
|
31
|
-
}): Promise<
|
|
32
|
-
//# sourceMappingURL=
|
|
31
|
+
}): Promise<SearchResultsTree<ClassificationsTreeSearchTargets>>;
|
|
32
|
+
//# sourceMappingURL=SearchResultsTree.d.ts.map
|
|
@@ -0,0 +1,168 @@
|
|
|
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
|
+
import { firstValueFrom } from "rxjs";
|
|
6
|
+
import { assert } from "@itwin/core-bentley";
|
|
7
|
+
import { CLASS_NAME_Classification, CLASS_NAME_ClassificationTable, CLASS_NAME_GeometricElement2d } from "../../../common/internal/ClassNameDefinitions.js";
|
|
8
|
+
import { createSearchResultsTree, SearchResultsNodesHandler } from "../../../common/internal/visibility/BaseSearchResultsTree.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export async function createClassificationsSearchResultsTree(props) {
|
|
11
|
+
const { imodelAccess, searchPaths, idsCache } = props;
|
|
12
|
+
return createSearchResultsTree({
|
|
13
|
+
searchResultsNodesHandler: new ClassificationsTreeSearchResultsNodesHandler({ idsCache, imodelAccess }),
|
|
14
|
+
searchPaths,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
class ClassificationsTreeSearchResultsNodesHandler extends SearchResultsNodesHandler {
|
|
18
|
+
#props;
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super();
|
|
21
|
+
this.#props = props;
|
|
22
|
+
}
|
|
23
|
+
async getProcessedSearchResultsNodes() {
|
|
24
|
+
const searchResultsTemporary2dElements = new Map();
|
|
25
|
+
const searchResultsTemporary3dElements = new Map();
|
|
26
|
+
const result = {
|
|
27
|
+
searchResults2dElements: new Map(),
|
|
28
|
+
searchResults3dElements: new Map(),
|
|
29
|
+
};
|
|
30
|
+
for (const node of this.searchResultsNodesArr) {
|
|
31
|
+
if (node.type === "element2d") {
|
|
32
|
+
searchResultsTemporary2dElements.set(node.id, node);
|
|
33
|
+
}
|
|
34
|
+
else if (node.type === "element3d") {
|
|
35
|
+
searchResultsTemporary3dElements.set(node.id, node);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const searchResultsElementsModels = await firstValueFrom(this.#props.idsCache.getFilteredElementsData({
|
|
39
|
+
element2dIds: [...searchResultsTemporary2dElements.keys()],
|
|
40
|
+
element3dIds: [...searchResultsTemporary3dElements.keys()],
|
|
41
|
+
}));
|
|
42
|
+
searchResultsTemporary2dElements.forEach((element, id) => {
|
|
43
|
+
const entry = searchResultsElementsModels.get(element.id);
|
|
44
|
+
assert(entry !== undefined);
|
|
45
|
+
result.searchResults2dElements.set(id, { ...element, modelId: entry.modelId, categoryId: entry.categoryId });
|
|
46
|
+
});
|
|
47
|
+
searchResultsTemporary3dElements.forEach((element, id) => {
|
|
48
|
+
const entry = searchResultsElementsModels.get(element.id);
|
|
49
|
+
assert(entry !== undefined);
|
|
50
|
+
result.searchResults3dElements.set(id, { ...element, modelId: entry.modelId, categoryId: entry.categoryId });
|
|
51
|
+
});
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
convertNodesToSearchTargets(searchResultsNodes, processedSearchResultsNodes) {
|
|
55
|
+
const searchTargets = {};
|
|
56
|
+
searchResultsNodes.forEach((searchResultsNode) => this.collectSearchTargets(searchTargets, searchResultsNode, processedSearchResultsNodes));
|
|
57
|
+
return this.convertInternalSearchTargets(searchTargets);
|
|
58
|
+
}
|
|
59
|
+
convertInternalSearchTargets(searchTargets) {
|
|
60
|
+
if (!searchTargets.classificationIds && !searchTargets.classificationIds && !searchTargets.elements2d && !searchTargets.elements3d) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
classificationIds: searchTargets.classificationIds,
|
|
65
|
+
classificationTableIds: searchTargets.classificationIds,
|
|
66
|
+
elements2d: searchTargets.elements2d
|
|
67
|
+
? [...searchTargets.elements2d?.entries()].map(([modelCategoryKey, elements]) => {
|
|
68
|
+
const { modelId, categoryId } = this.parseModelCategoryKey(modelCategoryKey);
|
|
69
|
+
return { modelId, categoryId, elements };
|
|
70
|
+
})
|
|
71
|
+
: undefined,
|
|
72
|
+
elements3d: searchTargets.elements3d
|
|
73
|
+
? [...searchTargets.elements3d?.entries()].map(([modelCategoryKey, elements]) => {
|
|
74
|
+
const { modelId, categoryId } = this.parseModelCategoryKey(modelCategoryKey);
|
|
75
|
+
return { modelId, categoryId, elements };
|
|
76
|
+
})
|
|
77
|
+
: undefined,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
collectSearchTargets(searchTargets, node, processedSearchResultsNodes) {
|
|
81
|
+
const searchResultsNode = node.type === "element2d"
|
|
82
|
+
? processedSearchResultsNodes.searchResults2dElements.get(node.id)
|
|
83
|
+
: node.type === "element3d"
|
|
84
|
+
? processedSearchResultsNodes.searchResults3dElements.get(node.id)
|
|
85
|
+
: node;
|
|
86
|
+
assert(searchResultsNode !== undefined);
|
|
87
|
+
if (searchResultsNode.isSearchTarget) {
|
|
88
|
+
this.addTarget(searchTargets, searchResultsNode);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (searchResultsNode.type === "element2d" || searchResultsNode.type === "element3d") {
|
|
92
|
+
// need to add parent ids as search target will be an element
|
|
93
|
+
this.addTarget(searchTargets, searchResultsNode);
|
|
94
|
+
}
|
|
95
|
+
if (!node.children) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
for (const child of node.children.values()) {
|
|
99
|
+
this.collectSearchTargets(searchTargets, child, processedSearchResultsNodes);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
addTarget(searchTargets, node) {
|
|
103
|
+
switch (node.type) {
|
|
104
|
+
case "classificationTable":
|
|
105
|
+
(searchTargets.classificationTableIds ??= new Set()).add(node.id);
|
|
106
|
+
return;
|
|
107
|
+
case "classification":
|
|
108
|
+
(searchTargets.classificationIds ??= new Set()).add(node.id);
|
|
109
|
+
return;
|
|
110
|
+
case "element2d":
|
|
111
|
+
const element2dKey = this.createModelCategoryKey(node.modelId, node.categoryId);
|
|
112
|
+
const elements2d = (searchTargets.elements2d ??= new Map()).get(element2dKey);
|
|
113
|
+
if (elements2d) {
|
|
114
|
+
elements2d.set(node.id, { isSearchTarget: node.isSearchTarget });
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
searchTargets.elements2d.set(element2dKey, new Map([[node.id, { isSearchTarget: node.isSearchTarget }]]));
|
|
118
|
+
}
|
|
119
|
+
return;
|
|
120
|
+
case "element3d":
|
|
121
|
+
const element3dKey = this.createModelCategoryKey(node.modelId, node.categoryId);
|
|
122
|
+
const elements3d = (searchTargets.elements3d ??= new Map()).get(element3dKey);
|
|
123
|
+
if (elements3d) {
|
|
124
|
+
elements3d.set(node.id, { isSearchTarget: node.isSearchTarget });
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
searchTargets.elements3d.set(element3dKey, new Map([[node.id, { isSearchTarget: node.isSearchTarget }]]));
|
|
128
|
+
}
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
createModelCategoryKey(modelId, categoryId) {
|
|
133
|
+
return `${modelId}-${categoryId}`;
|
|
134
|
+
}
|
|
135
|
+
parseModelCategoryKey(key) {
|
|
136
|
+
const [modelId, categoryId] = key.split("-");
|
|
137
|
+
return { modelId, categoryId };
|
|
138
|
+
}
|
|
139
|
+
createSearchResultsTreeNode({ type, id, isSearchTarget, }) {
|
|
140
|
+
if (type === "element2d" || type === "element3d") {
|
|
141
|
+
return {
|
|
142
|
+
id,
|
|
143
|
+
isSearchTarget,
|
|
144
|
+
type,
|
|
145
|
+
modelId: undefined,
|
|
146
|
+
categoryId: undefined,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
id,
|
|
151
|
+
isSearchTarget,
|
|
152
|
+
type,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async getType(className) {
|
|
156
|
+
if (await this.#props.imodelAccess.classDerivesFrom(className, CLASS_NAME_ClassificationTable)) {
|
|
157
|
+
return "classificationTable";
|
|
158
|
+
}
|
|
159
|
+
if (await this.#props.imodelAccess.classDerivesFrom(className, CLASS_NAME_Classification)) {
|
|
160
|
+
return "classification";
|
|
161
|
+
}
|
|
162
|
+
if (await this.#props.imodelAccess.classDerivesFrom(className, CLASS_NAME_GeometricElement2d)) {
|
|
163
|
+
return "element2d";
|
|
164
|
+
}
|
|
165
|
+
return "element3d";
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=SearchResultsTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchResultsTree.js","sourceRoot":"","sources":["../../../../../../../../src/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAC5J,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,8DAA8D,CAAC;AA6DlI,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAAC,KAI5D;IACC,MAAM,EAAE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AAU,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACjC,CAAC;IAEM,2BAA2B,CAAC,EACjC,IAAI,EACJ,EAAE,EACF,cAAc,GAKf;QACC,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;YACjD,OAAO;gBACL,EAAE;gBACF,cAAc;gBACd,IAAI;gBACJ,OAAO,EAAE,SAAS;gBAClB,UAAU,EAAE,SAAS;aACtB,CAAC;QACJ,CAAC;QACD,OAAO;YACL,EAAE;YACF,cAAc;YACd,IAAI;SACL,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,SAAiB;QACpC,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAAE,CAAC;YAC/F,OAAO,qBAAqB,CAAC;QAC/B,CAAC;QACD,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,SAAS,EAAE,yBAAyB,CAAC,EAAE,CAAC;YAC1F,OAAO,gBAAgB,CAAC;QAC1B,CAAC;QACD,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,SAAS,EAAE,6BAA6B,CAAC,EAAE,CAAC;YAC9F,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,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 { firstValueFrom } from \"rxjs\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { CLASS_NAME_Classification, CLASS_NAME_ClassificationTable, CLASS_NAME_GeometricElement2d } from \"../../../common/internal/ClassNameDefinitions.js\";\nimport { createSearchResultsTree, SearchResultsNodesHandler } from \"../../../common/internal/visibility/BaseSearchResultsTree.js\";\n\nimport type { Id64Set, Id64String } from \"@itwin/core-bentley\";\nimport type { HierarchySearchPath } from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector } from \"@itwin/presentation-shared\";\nimport type { CategoryId, ElementId, ModelId } from \"../../../common/internal/Types.js\";\nimport type { BaseSearchResultsTreeNode, SearchResultsTree, SearchResultsTreeNodeChildren } from \"../../../common/internal/visibility/BaseSearchResultsTree.js\";\nimport type { ClassificationsTreeIdsCache } from \"../ClassificationsTreeIdsCache.js\";\n\ninterface ClassificationTableSearchResultsTreeNode extends BaseSearchResultsTreeNode<ClassificationTableSearchResultsTreeNode> {\n type: \"classificationTable\";\n}\n\ninterface ClassificationSearchResultsTreeNode extends BaseSearchResultsTreeNode<ClassificationSearchResultsTreeNode> {\n type: \"classification\";\n}\n\ninterface Element2dSearchResultsTreeNode extends BaseSearchResultsTreeNode<Element2dSearchResultsTreeNode> {\n type: \"element2d\";\n categoryId: Id64String;\n modelId: Id64String;\n}\n\ninterface Element3dSearchResultsTreeNode extends BaseSearchResultsTreeNode<Element3dSearchResultsTreeNode> {\n type: \"element3d\";\n categoryId: Id64String;\n modelId: Id64String;\n}\n\ntype SearchResultsTreeNode =\n | ClassificationTableSearchResultsTreeNode\n | ClassificationSearchResultsTreeNode\n | Element2dSearchResultsTreeNode\n | Element3dSearchResultsTreeNode;\n\ntype TemporaryElement2dSearchResultsNode = Omit<Element2dSearchResultsTreeNode, \"modelId\" | \"categoryId\" | \"children\"> & {\n modelId: string | undefined;\n categoryId: string | undefined;\n children?: SearchResultsTreeNodeChildren<TemporaryElement2dSearchResultsNode>;\n};\n\ntype TemporaryElement3dSearchResultsNode = Omit<Element3dSearchResultsTreeNode, \"modelId\" | \"categoryId\" | \"children\"> & {\n modelId: string | undefined;\n categoryId: string | undefined;\n children?: SearchResultsTreeNodeChildren<TemporaryElement3dSearchResultsNode>;\n};\n\ntype TemporarySearchResultsTreeNode =\n | ClassificationTableSearchResultsTreeNode\n | ClassificationSearchResultsTreeNode\n | TemporaryElement2dSearchResultsNode\n | TemporaryElement3dSearchResultsNode;\n\n/** @internal */\nexport interface ClassificationsTreeSearchTargets {\n elements2d?: Array<{ modelId: Id64String; categoryId: Id64String; elements: Map<ElementId, { isSearchTarget: boolean }> }>;\n elements3d?: Array<{ modelId: Id64String; categoryId: Id64String; elements: Map<ElementId, { isSearchTarget: boolean }> }>;\n classificationTableIds?: Id64Set;\n classificationIds?: Id64Set;\n}\n\n/** @internal */\nexport async function createClassificationsSearchResultsTree(props: {\n imodelAccess: ECClassHierarchyInspector;\n searchPaths: HierarchySearchPath[];\n idsCache: ClassificationsTreeIdsCache;\n}): Promise<SearchResultsTree<ClassificationsTreeSearchTargets>> {\n const { imodelAccess, searchPaths, idsCache } = props;\n return createSearchResultsTree({\n searchResultsNodesHandler: new ClassificationsTreeSearchResultsNodesHandler({ idsCache, imodelAccess }),\n searchPaths,\n });\n}\n\ninterface SearchTargetsInternal {\n elements2d?: Map<ModelCategoryKey, Map<ElementId, { isSearchTarget: boolean }>>;\n elements3d?: Map<ModelCategoryKey, Map<ElementId, { isSearchTarget: boolean }>>;\n classificationTableIds?: Id64Set;\n classificationIds?: Id64Set;\n}\n\ninterface ClassificationsTreeSearchResultsNodesHandlerProps {\n idsCache: ClassificationsTreeIdsCache;\n imodelAccess: ECClassHierarchyInspector;\n}\n\ntype ModelCategoryKey = `${ModelId}-${CategoryId}`;\n\ninterface ProcessedSearchResultsNodes {\n searchResults2dElements: Map<Id64String, Omit<Element2dSearchResultsTreeNode, \"children\">>;\n searchResults3dElements: Map<Id64String, Omit<Element3dSearchResultsTreeNode, \"children\">>;\n}\n\nclass ClassificationsTreeSearchResultsNodesHandler extends SearchResultsNodesHandler<\n ProcessedSearchResultsNodes,\n ClassificationsTreeSearchTargets,\n TemporarySearchResultsTreeNode\n> {\n readonly #props: ClassificationsTreeSearchResultsNodesHandlerProps;\n constructor(props: ClassificationsTreeSearchResultsNodesHandlerProps) {\n super();\n this.#props = props;\n }\n\n public async getProcessedSearchResultsNodes(): Promise<ProcessedSearchResultsNodes> {\n const searchResultsTemporary2dElements = new Map<Id64String, Omit<TemporaryElement2dSearchResultsNode, \"children\">>();\n const searchResultsTemporary3dElements = new Map<Id64String, Omit<TemporaryElement3dSearchResultsNode, \"children\">>();\n const result: ProcessedSearchResultsNodes = {\n searchResults2dElements: new Map(),\n searchResults3dElements: new Map(),\n };\n for (const node of this.searchResultsNodesArr) {\n if (node.type === \"element2d\") {\n searchResultsTemporary2dElements.set(node.id, node);\n } else if (node.type === \"element3d\") {\n searchResultsTemporary3dElements.set(node.id, node);\n }\n }\n\n const searchResultsElementsModels = await firstValueFrom(\n this.#props.idsCache.getFilteredElementsData({\n element2dIds: [...searchResultsTemporary2dElements.keys()],\n element3dIds: [...searchResultsTemporary3dElements.keys()],\n }),\n );\n searchResultsTemporary2dElements.forEach((element, id) => {\n const entry = searchResultsElementsModels.get(element.id);\n assert(entry !== undefined);\n result.searchResults2dElements.set(id, { ...element, modelId: entry.modelId, categoryId: entry.categoryId });\n });\n searchResultsTemporary3dElements.forEach((element, id) => {\n const entry = searchResultsElementsModels.get(element.id);\n assert(entry !== undefined);\n result.searchResults3dElements.set(id, { ...element, modelId: entry.modelId, categoryId: entry.categoryId });\n });\n return result;\n }\n\n public convertNodesToSearchTargets(\n searchResultsNodes: TemporarySearchResultsTreeNode[],\n processedSearchResultsNodes: ProcessedSearchResultsNodes,\n ): ClassificationsTreeSearchTargets | undefined {\n const searchTargets: SearchTargetsInternal = {};\n\n searchResultsNodes.forEach((searchResultsNode) => this.collectSearchTargets(searchTargets, searchResultsNode, processedSearchResultsNodes));\n\n return this.convertInternalSearchTargets(searchTargets);\n }\n\n private convertInternalSearchTargets(searchTargets: SearchTargetsInternal): ClassificationsTreeSearchTargets | undefined {\n if (!searchTargets.classificationIds && !searchTargets.classificationIds && !searchTargets.elements2d && !searchTargets.elements3d) {\n return undefined;\n }\n\n return {\n classificationIds: searchTargets.classificationIds,\n classificationTableIds: searchTargets.classificationIds,\n elements2d: searchTargets.elements2d\n ? [...searchTargets.elements2d?.entries()].map(([modelCategoryKey, elements]) => {\n const { modelId, categoryId } = this.parseModelCategoryKey(modelCategoryKey);\n return { modelId, categoryId, elements };\n })\n : undefined,\n elements3d: searchTargets.elements3d\n ? [...searchTargets.elements3d?.entries()].map(([modelCategoryKey, elements]) => {\n const { modelId, categoryId } = this.parseModelCategoryKey(modelCategoryKey);\n return { modelId, categoryId, elements };\n })\n : undefined,\n };\n }\n\n private collectSearchTargets(\n searchTargets: SearchTargetsInternal,\n node: TemporarySearchResultsTreeNode,\n processedSearchResultsNodes: ProcessedSearchResultsNodes,\n ) {\n const searchResultsNode =\n node.type === \"element2d\"\n ? processedSearchResultsNodes.searchResults2dElements.get(node.id)\n : node.type === \"element3d\"\n ? processedSearchResultsNodes.searchResults3dElements.get(node.id)\n : node;\n assert(searchResultsNode !== undefined);\n if (searchResultsNode.isSearchTarget) {\n this.addTarget(searchTargets, searchResultsNode);\n return;\n }\n\n if (searchResultsNode.type === \"element2d\" || searchResultsNode.type === \"element3d\") {\n // need to add parent ids as search target will be an element\n this.addTarget(searchTargets, searchResultsNode);\n }\n\n if (!node.children) {\n return;\n }\n\n for (const child of node.children.values()) {\n this.collectSearchTargets(searchTargets, child, processedSearchResultsNodes);\n }\n }\n\n private addTarget(searchTargets: SearchTargetsInternal, node: SearchResultsTreeNode) {\n switch (node.type) {\n case \"classificationTable\":\n (searchTargets.classificationTableIds ??= new Set()).add(node.id);\n return;\n case \"classification\":\n (searchTargets.classificationIds ??= new Set()).add(node.id);\n return;\n case \"element2d\":\n const element2dKey = this.createModelCategoryKey(node.modelId, node.categoryId);\n const elements2d = (searchTargets.elements2d ??= new Map()).get(element2dKey);\n if (elements2d) {\n elements2d.set(node.id, { isSearchTarget: node.isSearchTarget });\n } else {\n searchTargets.elements2d.set(element2dKey, new Map([[node.id, { isSearchTarget: node.isSearchTarget }]]));\n }\n return;\n case \"element3d\":\n const element3dKey = this.createModelCategoryKey(node.modelId, node.categoryId);\n const elements3d = (searchTargets.elements3d ??= new Map()).get(element3dKey);\n if (elements3d) {\n elements3d.set(node.id, { isSearchTarget: node.isSearchTarget });\n } else {\n searchTargets.elements3d.set(element3dKey, new Map([[node.id, { isSearchTarget: node.isSearchTarget }]]));\n }\n return;\n }\n }\n\n private createModelCategoryKey(modelId: Id64String, categoryId: Id64String): ModelCategoryKey {\n return `${modelId}-${categoryId}`;\n }\n\n private parseModelCategoryKey(key: ModelCategoryKey): { modelId: Id64String; categoryId: Id64String } {\n const [modelId, categoryId] = key.split(\"-\");\n return { modelId, categoryId };\n }\n\n public createSearchResultsTreeNode({\n type,\n id,\n isSearchTarget,\n }: {\n type: SearchResultsTreeNode[\"type\"];\n id: Id64String;\n isSearchTarget: boolean;\n }): TemporarySearchResultsTreeNode {\n if (type === \"element2d\" || type === \"element3d\") {\n return {\n id,\n isSearchTarget,\n type,\n modelId: undefined,\n categoryId: undefined,\n };\n }\n return {\n id,\n isSearchTarget,\n type,\n };\n }\n\n public async getType(className: string): Promise<TemporarySearchResultsTreeNode[\"type\"]> {\n if (await this.#props.imodelAccess.classDerivesFrom(className, CLASS_NAME_ClassificationTable)) {\n return \"classificationTable\";\n }\n if (await this.#props.imodelAccess.classDerivesFrom(className, CLASS_NAME_Classification)) {\n return \"classification\";\n }\n if (await this.#props.imodelAccess.classDerivesFrom(className, CLASS_NAME_GeometricElement2d)) {\n return \"element2d\";\n }\n return \"element3d\";\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Error that is thrown when too many matches are found while
|
|
2
|
+
* Error that is thrown when too many matches are found while searching the tree.
|
|
3
3
|
* @beta
|
|
4
4
|
*/
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class SearchLimitExceededError extends Error {
|
|
6
6
|
readonly limit: number;
|
|
7
7
|
constructor(limit: number);
|
|
8
8
|
}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Error that is thrown when too many matches are found while
|
|
6
|
+
* Error that is thrown when too many matches are found while searching the tree.
|
|
7
7
|
* @beta
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class SearchLimitExceededError extends Error {
|
|
10
10
|
limit;
|
|
11
11
|
constructor(limit) {
|
|
12
|
-
super("Too many
|
|
12
|
+
super("Too many search matches");
|
|
13
13
|
this.limit = limit;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeErrors.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/TreeErrors.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACd;IAAnC,YAAmC,KAAa;QAC9C,KAAK,CAAC,yBAAyB,CAAC,CAAC;QADA,UAAK,GAAL,KAAK,CAAQ;IAEhD,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\n/**\n * Error that is thrown when too many matches are found while
|
|
1
|
+
{"version":3,"file":"TreeErrors.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/TreeErrors.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACd;IAAnC,YAAmC,KAAa;QAC9C,KAAK,CAAC,yBAAyB,CAAC,CAAC;QADA,UAAK,GAAL,KAAK,CAAQ;IAEhD,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\n/**\n * Error that is thrown when too many matches are found while searching the tree.\n * @beta\n */\nexport class SearchLimitExceededError extends Error {\n public constructor(public readonly limit: number) {\n super(\"Too many search matches\");\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
|
-
type TrackedFeatures = "visibility-change" | "hierarchy-level-filtering" | "
|
|
2
|
+
type TrackedFeatures = "visibility-change" | "hierarchy-level-filtering" | "search" | "hierarchy-level-size-limit-hit" | "zoom-to-node" | "error-timeout" | "error-unknown";
|
|
3
3
|
interface TelemetryContext {
|
|
4
4
|
onPerformanceMeasured: (featureId: string, duration: number) => void;
|
|
5
5
|
onFeatureUsed: (props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseTelemetryContext.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/UseTelemetryContext.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAkBhD,MAAM,gBAAgB,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAYhF,YAAY;AACZ,MAAM,UAAU,wBAAwB,CAAC,EACvC,QAAQ,EACR,qBAAqB,EACrB,aAAa,EACb,mBAAmB,GAC8B;IACjD,MAAM,wBAAwB,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAClE,MAAM,gBAAgB,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;IAElD,MAAM,YAAY,GAAG,OAAO,CAAmB,GAAG,EAAE;QAClD,OAAO;YACL,qBAAqB,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,wBAAwB,CAAC,OAAO,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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 { createContext, useCallback, useContext, useMemo } from \"react\";\nimport { useLatest } from \"./internal/Utils.js\";\n\nimport type { PropsWithChildren } from \"react\";\n\ntype TrackedFeatures =\n | \"visibility-change\"\n | \"hierarchy-level-filtering\"\n | \"
|
|
1
|
+
{"version":3,"file":"UseTelemetryContext.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/UseTelemetryContext.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAkBhD,MAAM,gBAAgB,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAYhF,YAAY;AACZ,MAAM,UAAU,wBAAwB,CAAC,EACvC,QAAQ,EACR,qBAAqB,EACrB,aAAa,EACb,mBAAmB,GAC8B;IACjD,MAAM,wBAAwB,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAClE,MAAM,gBAAgB,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;IAElD,MAAM,YAAY,GAAG,OAAO,CAAmB,GAAG,EAAE;QAClD,OAAO;YACL,qBAAqB,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,wBAAwB,CAAC,OAAO,EAAE,CAAC,GAAG,mBAAmB,IAAI,SAAS,EAAE,EAAE,QAAQ,CAAC;YACnI,aAAa,EAAE,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,EAAE;gBAClD,IAAI,iBAAiB,KAAK,KAAK,EAAE,CAAC;oBAChC,gBAAgB,CAAC,OAAO,EAAE,CAAC,OAAO,mBAAmB,EAAE,CAAC,CAAC;gBAC3D,CAAC;gBACD,IAAI,SAAS,EAAE,CAAC;oBACd,gBAAgB,CAAC,OAAO,EAAE,CAAC,GAAG,mBAAmB,IAAI,SAAS,EAAE,CAAC,CAAC;gBACpE,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,mBAAmB,EAAE,wBAAwB,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEtE,OAAO,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAAG,QAAQ,GAA6B,CAAC;AAChG,CAAC;AAED,MAAM,mBAAmB,GAAqB;IAC5C,qBAAqB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC/B,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;CACxB,CAAC;AAEF,gBAAgB;AAChB,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,gBAAgB,CAAC,IAAI,mBAAmB,CAAC;AAC7D,CAAC;AAOD,gBAAgB;AAChB,MAAM,UAAU,kBAAkB,CAA2C,EAAE,MAAM,EAAE,SAAS,EAAoC;IAClI,MAAM,EAAE,aAAa,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAChD,OAAO,WAAW,CAChB,CAAC,GAAG,IAAI,EAAE,EAAE;QACV,aAAa,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAClB,CAAC,EACD,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CACnC,CAAC;AACJ,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 { createContext, useCallback, useContext, useMemo } from \"react\";\nimport { useLatest } from \"./internal/Utils.js\";\n\nimport type { PropsWithChildren } from \"react\";\n\ntype TrackedFeatures =\n | \"visibility-change\"\n | \"hierarchy-level-filtering\"\n | \"search\"\n | \"hierarchy-level-size-limit-hit\"\n | \"zoom-to-node\"\n | \"error-timeout\"\n | \"error-unknown\";\n\ninterface TelemetryContext {\n onPerformanceMeasured: (featureId: string, duration: number) => void;\n onFeatureUsed: (props: { featureId?: TrackedFeatures; reportInteraction: boolean }) => void;\n}\n\nconst telemetryContext = createContext<TelemetryContext | undefined>(undefined);\n\n/** @beta */\nexport interface TelemetryContextProviderProps {\n /** Callback that is invoked when performance of tracked feature is measured. */\n onPerformanceMeasured?: (featureId: string, duration: number) => void;\n /** Callback that is invoked when a tracked feature is used. */\n onFeatureUsed?: (featureId: string) => void;\n /** Unique identifier that is appended to feature id to help track which component used that feature. */\n componentIdentifier: string;\n}\n\n/** @beta */\nexport function TelemetryContextProvider({\n children,\n onPerformanceMeasured,\n onFeatureUsed,\n componentIdentifier,\n}: PropsWithChildren<TelemetryContextProviderProps>) {\n const onPerformanceMeasuredRef = useLatest(onPerformanceMeasured);\n const onFeatureUsedRef = useLatest(onFeatureUsed);\n\n const contextValue = useMemo<TelemetryContext>(() => {\n return {\n onPerformanceMeasured: (featureId, duration) => onPerformanceMeasuredRef.current?.(`${componentIdentifier}-${featureId}`, duration),\n onFeatureUsed: ({ featureId, reportInteraction }) => {\n if (reportInteraction !== false) {\n onFeatureUsedRef.current?.(`use-${componentIdentifier}`);\n }\n if (featureId) {\n onFeatureUsedRef.current?.(`${componentIdentifier}-${featureId}`);\n }\n },\n };\n }, [componentIdentifier, onPerformanceMeasuredRef, onFeatureUsedRef]);\n\n return <telemetryContext.Provider value={contextValue}>{children}</telemetryContext.Provider>;\n}\n\nconst defaultContextValue: TelemetryContext = {\n onPerformanceMeasured: () => {},\n onFeatureUsed: () => {},\n};\n\n/** @internal */\nexport function useTelemetryContext() {\n return useContext(telemetryContext) ?? defaultContextValue;\n}\n\ninterface UseReportingActionProps<TAction> {\n action: TAction;\n featureId?: TrackedFeatures;\n}\n\n/** @internal */\nexport function useReportingAction<TAction extends (...args: any[]) => void>({ action, featureId }: UseReportingActionProps<TAction>) {\n const { onFeatureUsed } = useTelemetryContext();\n return useCallback<(...args: Parameters<TAction>) => void>(\n (...args) => {\n onFeatureUsed({ featureId, reportInteraction: true });\n action(...args);\n },\n [action, featureId, onFeatureUsed],\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HierarchySearchPath } from "@itwin/presentation-hierarchies";
|
|
2
2
|
import type { GuidString, Id64Array } from "@itwin/core-bentley";
|
|
3
3
|
import type { HierarchyNodeIdentifiersPath } from "@itwin/presentation-hierarchies";
|
|
4
4
|
import type { TreeWidgetViewport } from "./TreeWidgetViewport.js";
|
|
@@ -43,7 +43,7 @@ export declare function toggleModels(models: string[], enable: boolean, viewport
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function areAllModelsVisible(models: string[], viewport: TreeWidgetViewport): boolean;
|
|
45
45
|
/** @public */
|
|
46
|
-
export type
|
|
46
|
+
export type NormalizedHierarchySearchPath = ReturnType<(typeof HierarchySearchPath)["normalize"]>;
|
|
47
47
|
/** @internal */
|
|
48
|
-
export declare function
|
|
48
|
+
export declare function joinHierarchySearchPaths(subTreePaths: HierarchyNodeIdentifiersPath[], searchPaths: NormalizedHierarchySearchPath[]): NormalizedHierarchySearchPath[];
|
|
49
49
|
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
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 {
|
|
5
|
+
import { HierarchyNodeIdentifier, HierarchySearchPath } from "@itwin/presentation-hierarchies";
|
|
6
6
|
import { showAllCategories } from "./CategoriesVisibilityUtils.js";
|
|
7
7
|
import { enableCategoryDisplay, loadCategoriesFromViewport } from "./internal/VisibilityUtils.js";
|
|
8
8
|
/**
|
|
@@ -75,37 +75,37 @@ export function areAllModelsVisible(models, viewport) {
|
|
|
75
75
|
return models.length !== 0 ? models.every((id) => viewport.viewsModel(id)) : false;
|
|
76
76
|
}
|
|
77
77
|
/** @internal */
|
|
78
|
-
export function
|
|
78
|
+
export function joinHierarchySearchPaths(subTreePaths, searchPaths) {
|
|
79
79
|
const result = new Array();
|
|
80
|
-
const
|
|
80
|
+
const searchPathsToIncludeIndexes = new Set();
|
|
81
81
|
subTreePaths.forEach((subTreePath) => {
|
|
82
82
|
let options;
|
|
83
83
|
let addSubTreePathToResult = false;
|
|
84
|
-
for (let i = 0; i <
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
84
|
+
for (let i = 0; i < searchPaths.length; ++i) {
|
|
85
|
+
const searchPath = searchPaths[i];
|
|
86
|
+
if (searchPath.path.length === 0) {
|
|
87
87
|
continue;
|
|
88
88
|
}
|
|
89
89
|
for (let j = 0; j < subTreePath.length; ++j) {
|
|
90
90
|
const identifier = subTreePath[j];
|
|
91
|
-
if (
|
|
91
|
+
if (searchPath.path.length <= j || !HierarchyNodeIdentifier.equal(searchPath.path[j], identifier)) {
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
//
|
|
95
|
-
if (
|
|
94
|
+
// search paths that are shorter or equal than subTree paths length don't need to be added to the result
|
|
95
|
+
if (searchPath.path.length === j + 1) {
|
|
96
96
|
addSubTreePathToResult = true;
|
|
97
|
-
// If
|
|
97
|
+
// If search path has reveal set to true, it means that we should expand only to the targeted search node
|
|
98
98
|
// This is done by setting depthInPath
|
|
99
99
|
options =
|
|
100
|
-
|
|
101
|
-
?
|
|
102
|
-
: { reveal: { depthInPath:
|
|
100
|
+
searchPath.options?.reveal !== true
|
|
101
|
+
? HierarchySearchPath.mergeOptions(options, searchPath.options)
|
|
102
|
+
: { reveal: { depthInPath: searchPath.path.length - 1 } };
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
|
-
//
|
|
105
|
+
// search paths that are longer than subTree paths need to be added to the result
|
|
106
106
|
if (subTreePath.length === j + 1) {
|
|
107
107
|
addSubTreePathToResult = true;
|
|
108
|
-
|
|
108
|
+
searchPathsToIncludeIndexes.add(i);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -116,8 +116,8 @@ export function joinHierarchyFilteringPaths(subTreePaths, filteringPaths) {
|
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
-
for (const index of
|
|
120
|
-
result.push(
|
|
119
|
+
for (const index of searchPathsToIncludeIndexes) {
|
|
120
|
+
result.push(searchPaths[index]);
|
|
121
121
|
}
|
|
122
122
|
return result;
|
|
123
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/Utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/common/Utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAMlG;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAK9C;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAgB,EAAE,QAA4B;IAC1E,QAAQ,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,KAO7B;IACC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,KAAK,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,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;gBAClC,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC;oBAClG,MAAM;gBACR,CAAC;gBAED,wGAAwG;gBACxG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;oBACrC,sBAAsB,GAAG,IAAI,CAAC;oBAC9B,yGAAyG;oBACzG,sCAAsC;oBACtC,OAAO;wBACL,UAAU,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;4BACjC,CAAC,CAAC,mBAAmB,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;4BAC/D,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC;oBAC9D,MAAM;gBACR,CAAC;gBAED,iFAAiF;gBACjF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjC,sBAAsB,GAAG,IAAI,CAAC;oBAC9B,2BAA2B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,sBAAsB,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,WAAW;gBACjB,OAAO;aACR,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IACH,KAAK,MAAM,KAAK,IAAI,2BAA2B,EAAE,CAAC;QAChD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,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 { HierarchyNodeIdentifier, HierarchySearchPath } from \"@itwin/presentation-hierarchies\";\nimport { showAllCategories } from \"./CategoriesVisibilityUtils.js\";\nimport { enableCategoryDisplay, loadCategoriesFromViewport } from \"./internal/VisibilityUtils.js\";\n\nimport type { GuidString, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport type { HierarchyNodeIdentifiersPath, HierarchySearchPathOptions } from \"@itwin/presentation-hierarchies\";\nimport type { TreeWidgetViewport } from \"./TreeWidgetViewport.js\";\n\n/**\n * This is a logging namespace for public log messages that may be interesting to consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE = \"TreeWidget\";\n\n/** @beta */\nexport type FunctionProps<THook extends (props: any) => any> = Parameters<THook>[0];\n\n/**\n * Disables display of all given models.\n * @public\n */\nexport function hideAllModels(models: string[], viewport: TreeWidgetViewport) {\n viewport.changeModelDisplay({ modelIds: models, display: false });\n}\n\n/**\n * Enables display of all given models. Also enables display of all categories and clears always and\n * never drawn lists in the viewport.\n * @public\n */\nexport async function showAll(props: {\n /** ID's of models to enable */\n models: Id64Array;\n /** ID's of categories to enable, if set to undefined, all categories will be enabled */\n categories?: Id64Array;\n viewport: TreeWidgetViewport;\n componentId?: GuidString;\n}) {\n const { models, categories, viewport, componentId } = props;\n viewport.changeModelDisplay({ modelIds: models, display: true });\n viewport.clearNeverDrawn();\n viewport.clearAlwaysDrawn();\n if (categories) {\n await showAllCategories(categories, viewport);\n } else {\n const categoryInfos = await loadCategoriesFromViewport(viewport, componentId);\n if (categoryInfos.length === 0) {\n return;\n }\n const ids = categoryInfos.map((categoryInfo) => categoryInfo.categoryId);\n await enableCategoryDisplay(viewport, ids, true);\n }\n}\n\n/**\n * Inverts display of all given models.\n * @public\n */\nexport function invertAllModels(models: Id64Array, viewport: TreeWidgetViewport) {\n const notViewedModels = new Array<Id64String>();\n const viewedModels = new Array<Id64String>();\n models.forEach((modelId) => {\n if (viewport.viewsModel(modelId)) {\n viewedModels.push(modelId);\n } else {\n notViewedModels.push(modelId);\n }\n });\n viewport.changeModelDisplay({ modelIds: notViewedModels, display: true });\n viewport.changeModelDisplay({ modelIds: viewedModels, display: false });\n}\n\n/**\n * Based on the value of `enable` argument, either enables or disables display of given models.\n * @public\n */\nexport function toggleModels(models: string[], enable: boolean, viewport: TreeWidgetViewport) {\n if (!models) {\n return;\n }\n viewport.changeModelDisplay({ modelIds: models, display: enable });\n}\n\n/**\n * Checks if all given models are displayed in given viewport.\n * @public\n */\nexport function areAllModelsVisible(models: string[], viewport: TreeWidgetViewport) {\n return models.length !== 0 ? models.every((id) => viewport.viewsModel(id)) : false;\n}\n\n/** @public */\nexport type NormalizedHierarchySearchPath = ReturnType<(typeof HierarchySearchPath)[\"normalize\"]>;\n\n/** @internal */\nexport function joinHierarchySearchPaths(\n subTreePaths: HierarchyNodeIdentifiersPath[],\n searchPaths: NormalizedHierarchySearchPath[],\n): NormalizedHierarchySearchPath[] {\n const result = new Array<NormalizedHierarchySearchPath>();\n const searchPathsToIncludeIndexes = new Set<number>();\n\n subTreePaths.forEach((subTreePath) => {\n let options: HierarchySearchPathOptions | undefined;\n let addSubTreePathToResult = false;\n\n for (let i = 0; i < searchPaths.length; ++i) {\n const searchPath = searchPaths[i];\n if (searchPath.path.length === 0) {\n continue;\n }\n\n for (let j = 0; j < subTreePath.length; ++j) {\n const identifier = subTreePath[j];\n if (searchPath.path.length <= j || !HierarchyNodeIdentifier.equal(searchPath.path[j], identifier)) {\n break;\n }\n\n // search paths that are shorter or equal than subTree paths length don't need to be added to the result\n if (searchPath.path.length === j + 1) {\n addSubTreePathToResult = true;\n // If search path has reveal set to true, it means that we should expand only to the targeted search node\n // This is done by setting depthInPath\n options =\n searchPath.options?.reveal !== true\n ? HierarchySearchPath.mergeOptions(options, searchPath.options)\n : { reveal: { depthInPath: searchPath.path.length - 1 } };\n break;\n }\n\n // search paths that are longer than subTree paths need to be added to the result\n if (subTreePath.length === j + 1) {\n addSubTreePathToResult = true;\n searchPathsToIncludeIndexes.add(i);\n }\n }\n }\n\n if (addSubTreePathToResult) {\n result.push({\n path: subTreePath,\n options,\n });\n }\n });\n for (const index of searchPathsToIncludeIndexes) {\n result.push(searchPaths[index]);\n }\n return result;\n}\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
|
-
.tw-
|
|
6
|
+
.tw-search-empty-tree-container {
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
gap: var(--iui-size-s);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import "./EmptyTree.css";
|
|
2
|
-
interface
|
|
2
|
+
interface SearchEmptyTreeProps {
|
|
3
3
|
base: string;
|
|
4
4
|
}
|
|
5
5
|
/** @internal */
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function TooManySearchMatches({ base }: SearchEmptyTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
/** @internal */
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function NoSearchMatches({ base }: SearchEmptyTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
/** @internal */
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function SearchUnknownError({ base }: SearchEmptyTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
/** @internal */
|
|
12
|
-
export declare function TooManyInstancesFocused({ base }:
|
|
12
|
+
export declare function TooManyInstancesFocused({ base }: SearchEmptyTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
/** @internal */
|
|
14
|
-
export declare function UnknownInstanceFocusError({ base }:
|
|
14
|
+
export declare function UnknownInstanceFocusError({ base }: SearchEmptyTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
interface SubTreeErrorProps {
|
|
16
16
|
base: string;
|
|
17
17
|
error: string;
|