@itwin/tree-widget-react 4.0.0-alpha.24 → 4.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js +2 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.js +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.d.ts +4 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js +4 -1
- 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/CategoriesTreeButtons.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +36 -47
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.d.ts +2 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js +4 -1
- 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 +4 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +87 -38
- 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 +86 -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/UseCategoriesTree.d.ts +4 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +38 -23
- 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 +11 -21
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js +16 -168
- 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/CategoriesTreeNodeInternal.d.ts +65 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNodeInternal.js +22 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNodeInternal.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseSearchPaths.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseSearchPaths.js +4 -4
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseSearchPaths.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.d.ts +6 -12
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js +192 -127
- 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.d.ts +14 -5
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js +43 -24
- 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/SearchResultsTree.d.ts +3 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/SearchResultsTree.js +78 -17
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/SearchResultsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.d.ts +2 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js +4 -1
- 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.js +91 -114
- 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/ClassificationsTreeIcon.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.d.ts +32 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeNode.js +26 -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/UseClassificationsTree.d.ts +13 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js +62 -32
- 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 +12 -9
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js +42 -38
- 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 +15 -38
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js +59 -242
- 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/ClassificationsTreeNodeInternal.d.ts +29 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNodeInternal.js +19 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNodeInternal.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.d.ts +5 -9
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js +155 -84
- 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/ClassificationsTreeVisibilityHelper.js +20 -6
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.d.ts +6 -10
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.js +104 -63
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/SearchResultsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/SharedTreeContextProvider.d.ts +7 -0
- package/lib/esm/tree-widget-react/components/trees/common/SharedTreeContextProvider.js +14 -0
- package/lib/esm/tree-widget-react/components/trees/common/SharedTreeContextProvider.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.js +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.d.ts +4 -4
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.d.ts +4 -4
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js +7 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js +5 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/SharedTreeContextProviderInternal.d.ts +20 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/SharedTreeContextProviderInternal.js +44 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/SharedTreeContextProviderInternal.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Types.d.ts +4 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Types.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.d.ts +12 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js +2 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.d.ts +17 -6
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js +58 -29
- 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 +8 -14
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js +22 -26
- 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/{AlwaysAndNeverDrawnElementInfo.d.ts → caches/AlwaysAndNeverDrawnElementInfoCache.d.ts} +15 -21
- package/lib/esm/tree-widget-react/components/trees/common/internal/{AlwaysAndNeverDrawnElementInfo.js → caches/AlwaysAndNeverDrawnElementInfoCache.js} +40 -38
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.d.ts +68 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js +148 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/BaseIdsCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ElementChildrenCache.d.ts +30 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ElementChildrenCache.js +151 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ElementChildrenCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ElementModelCategoriesCache.d.ts +32 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ElementModelCategoriesCache.js +106 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ElementModelCategoriesCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/{ModelCategoryElementsCountCache.d.ts → caches/ModelCategoryElementsCountCache.d.ts} +9 -2
- package/lib/esm/tree-widget-react/components/trees/common/internal/{ModelCategoryElementsCountCache.js → caches/ModelCategoryElementsCountCache.js} +17 -21
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ModelCategoryElementsCountCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ModeledElementsCache.d.ts +27 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ModeledElementsCache.js +106 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/ModeledElementsCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/SubCategoriesCache.d.ts +23 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/SubCategoriesCache.js +56 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/caches/SubCategoriesCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.d.ts +6 -6
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js +27 -17
- 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/useTreeHooks/UseIdsCache.d.ts +7 -13
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js +36 -35
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.d.ts +18 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.js +14 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseSearchResultsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.d.ts +46 -70
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js +229 -361
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js +32 -19
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/index.d.ts +5 -1
- package/lib/esm/tree-widget-react/components/trees/index.js +5 -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 +4 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js +4 -1
- 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/ModelsTreeButtons.d.ts +7 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +36 -35
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js +3 -1
- 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 +3 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +70 -26
- 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.d.ts +5 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +26 -13
- 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 +11 -23
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +56 -189
- 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/ModelsTreeNodeInternal.d.ts +52 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNodeInternal.js +22 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNodeInternal.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseSearchPaths.d.ts +2 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseSearchPaths.js +8 -8
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseSearchPaths.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.d.ts +6 -12
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js +190 -114
- 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/ModelsTreeVisibilityHelper.d.ts +6 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js +20 -8
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/SearchResultsTree.d.ts +4 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/SearchResultsTree.js +73 -13
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/SearchResultsTree.js.map +1 -1
- package/lib/esm/tree-widget-react-internal.d.ts +1 -1
- package/lib/esm/tree-widget-react-internal.js +1 -1
- package/lib/esm/tree-widget-react-internal.js.map +1 -1
- package/package.json +77 -82
- 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/classifications-tree/internal/UseSearchPaths.d.ts +0 -20
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseSearchPaths.js +0 -53
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseSearchPaths.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.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
|
@@ -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,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,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,0BAA0B,CAAC;AAC9D,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAuB3E;;;;;GAKG;AACH,MAAM,OAAO,+BAA+B;IACjC,MAAM,CAAuC;IACtD,iBAAiB,CAAiC;IAClD,YAAY,CAA8C;IAC1D,aAAa,CAAwC;IACrD,UAAU,CAA0C;IACpD,YAAY,gBAAsD;QAChE,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,gBAAgB,EAAE,GAAG,EAAE,C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AAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACrH,OAAO,iCAAiC,CAAC;gBACvC,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,YAAY,EAAE,KAAK,CAAC,YAAY;gBAChC,iBAAiB,EAAE,aAAa;gBAChC,wBAAwB,EAAE,YAAY;gBACtC,sBAAsB,EAAE,UAAU;aACnC,CAAC,CAAC;QACL,CAAC;QACD,gCAAgC,EAAE,CAAC,IAAI,EAAE,EAAE;YACzC,OAAO,IAAI,+BAA+B,CAAC;gBACzC,8BAA8B,EAAE,IAAI;gBACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,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,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EA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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, mergeAll, mergeMap, of } from \"rxjs\";\nimport { assert, Guid } from \"@itwin/core-bentley\";\nimport { HierarchyNodeKey } from \"@itwin/presentation-hierarchies\";\nimport { createVisibilityStatus } from \"../../../common/internal/Tooltip.js\";\nimport { HierarchyVisibilityHandlerImpl } from \"../../../common/internal/useTreeHooks/UseCachedVisibility.js\";\nimport {\n fromWithRelease,\n getClassesByView,\n getIdsFromChildrenTree,\n getParentElementsIdsPath,\n setDifference,\n setIntersection,\n} from \"../../../common/internal/Utils.js\";\nimport { mergeVisibilityStatuses } from \"../../../common/internal/VisibilityUtils.js\";\nimport { CategoriesTreeNodeInternal } from \"../../internal/CategoriesTreeNodeInternal.js\";\nimport { CategoriesTreeVisibilityHelper } from \"./CategoriesTreeVisibilityHelper.js\";\nimport { createCategoriesSearchResultsTree } from \"./SearchResultsTree.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { Id64Set, Id64String } from \"@itwin/core-bentley\";\nimport type { ClassGroupingNodeKey, HierarchyNode, HierarchySearchPath, InstancesNodeKey } from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector } from \"@itwin/presentation-shared\";\nimport type { AlwaysAndNeverDrawnElementInfoCache } from \"../../../common/internal/caches/AlwaysAndNeverDrawnElementInfoCache.js\";\nimport type { CategoryId, ElementId, ModelId } from \"../../../common/internal/Types.js\";\nimport type { ChildrenTree } from \"../../../common/internal/Utils.js\";\nimport type { SearchResultsTree } from \"../../../common/internal/visibility/BaseSearchResultsTree.js\";\nimport type { 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: AlwaysAndNeverDrawnElementInfoCache;\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 constructor(constructorProps: CategoriesTreeVisibilityHandlerProps) {\n this.#props = constructorProps;\n this.#visibilityHelper = new CategoriesTreeVisibilityHelper({\n viewport: this.#props.viewport,\n idsCache: this.#props.idsCache,\n alwaysAndNeverDrawnElementInfo: this.#props.alwaysAndNeverDrawnElementInfo,\n baseIdsCache: constructorProps.idsCache,\n hierarchyConfig: constructorProps.hierarchyConfig,\n });\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 if (this.#props.viewport.viewType === \"other\") {\n return EMPTY;\n }\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 const searchTargetElements = new Array<Id64String>();\n const elementIdsSet = new Set<Id64String>();\n const modelCategoryElementMap = new Map<`${ModelId}-${CategoryId}`, Array<ElementId>>();\n // elements is an array that stores elements grouped by:\n // 1. Their path\n // 2. Their modelId and categoryId\n // When changing visibility of elements, visibility handler does not care about the path.\n // So we can first get all elements and group them only by modelId and categoryId.\n for (const { elements: elementsMap, categoryId, modelId } of elements) {\n const key: `${ModelId}-${CategoryId}` = `${modelId}-${categoryId}`;\n let mapEntry = modelCategoryElementMap.get(key);\n if (!mapEntry) {\n mapEntry = [];\n modelCategoryElementMap.set(key, mapEntry);\n }\n for (const [elementId, { isSearchTarget }] of elementsMap) {\n mapEntry.push(elementId);\n elementIdsSet.add(elementId);\n if (isSearchTarget) {\n searchTargetElements.push(elementId);\n }\n }\n }\n observables.push(\n // Get children for search targets, since non search targets don't have all the children present in the hierarchy.\n this.#props.idsCache.getChildElementsTree({ elementIds: searchTargetElements }).pipe(\n // Need to filter out and keep only those children ids that are not part of elements that are present in search paths.\n // Elements in search paths will have their visibility changed directly: they will be provided as elementIds to changeElementsVisibilityStatus.\n map((childrenTree) => ({\n childrenNotInSearchPaths: setDifference(getIdsFromChildrenTree({ tree: childrenTree, predicate: ({ depth }) => depth > 0 }), elementIdsSet),\n childrenTree,\n })),\n mergeMap(({ childrenNotInSearchPaths, childrenTree }) =>\n fromWithRelease({ source: modelCategoryElementMap.entries(), size: modelCategoryElementMap.size, releaseOnCount: 50 }).pipe(\n mergeMap(([key, elementsInSearchPathsGroupedByModelAndCategory]) => {\n const [modelId, categoryId] = key.split(\"-\");\n const childrenIds = new Set<Id64String>();\n // A shared children tree was created, need to get the children for each element in the group.\n for (const elementId of elementsInSearchPathsGroupedByModelAndCategory) {\n const elementChildrenTree: ChildrenTree | undefined = childrenTree.get(elementId)?.children;\n if (!elementChildrenTree) {\n continue;\n }\n for (const childId of getIdsFromChildrenTree({ tree: elementChildrenTree })) {\n childrenIds.add(childId);\n }\n }\n return this.#visibilityHelper.changeElementsVisibilityStatus({\n modelId,\n categoryId,\n elementIds: elementsInSearchPathsGroupedByModelAndCategory,\n // Pass only those children that are not part of search paths.\n children: setIntersection(childrenIds, childrenNotInSearchPaths),\n on,\n });\n }),\n ),\n ),\n ),\n );\n }\n\n return merge(...observables);\n });\n }\n\n public getVisibilityStatus(node: HierarchyNode): Observable<VisibilityStatus> {\n if (this.#props.viewport.viewType === \"other\") {\n return of(createVisibilityStatus(\"disabled\"));\n }\n\n if (CategoriesTreeNodeInternal.isElementClassGroupingNode(node)) {\n return this.#visibilityHelper.getGroupedElementsVisibilityStatus({\n categoryId: node.extendedData.categoryId,\n modelElementsMap: node.extendedData.modelElementsMap,\n parentKeys: node.parentKeys,\n childrenCount: node.extendedData.childrenCount,\n topMostParentElementId: node.extendedData.topMostParentElementId,\n });\n }\n\n if (CategoriesTreeNodeInternal.isDefinitionContainerNode(node)) {\n return this.#visibilityHelper.getDefinitionContainersVisibilityStatus({\n definitionContainerIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n if (CategoriesTreeNodeInternal.isModelNode(node)) {\n return this.#visibilityHelper.getModelsVisibilityStatus({\n modelIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n });\n }\n\n if (CategoriesTreeNodeInternal.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 });\n }\n\n if (CategoriesTreeNodeInternal.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(CategoriesTreeNodeInternal.isElementNode(node));\n const parentElementsIdsPath = getParentElementsIdsPath({\n parentInstanceKeys: node.parentKeys.filter((parentKey) => HierarchyNodeKey.isInstances(parentKey)).map((key) => key.instanceKeys),\n topMostParentElementId: node.extendedData.topMostParentElementId,\n });\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 parentElementsIdsPath,\n childrenCount: node.extendedData.childrenCount,\n categoryOfTopMostParentElement: node.extendedData.categoryOfTopMostParentElement,\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 (this.#props.viewport.viewType === \"other\") {\n return EMPTY;\n }\n if (CategoriesTreeNodeInternal.isElementClassGroupingNode(node)) {\n return this.#visibilityHelper.changeGroupedElementsVisibilityStatus({\n categoryId: node.extendedData.categoryId,\n modelElementsMap: node.extendedData.modelElementsMap,\n on,\n });\n }\n\n if (CategoriesTreeNodeInternal.isDefinitionContainerNode(node)) {\n return this.#visibilityHelper.changeDefinitionContainersVisibilityStatus({\n definitionContainerIds: node.key.instanceKeys.map((instanceKey) => instanceKey.id),\n on,\n });\n }\n\n if (CategoriesTreeNodeInternal.isModelNode(node)) {\n return this.#visibilityHelper.changeModelsVisibilityStatus({\n modelIds: node.key.instanceKeys.map(({ id }) => id),\n on,\n });\n }\n\n if (CategoriesTreeNodeInternal.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 (CategoriesTreeNodeInternal.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 assert(CategoriesTreeNodeInternal.isElementNode(node));\n\n const elementIds = node.key.instanceKeys.map(({ id }) => id);\n return this.#props.idsCache.getChildElementsTree({ elementIds }).pipe(\n map((childrenTree): Id64Set => {\n // Children tree contains provided elementIds, they are at the root of this tree.\n // We want to skip them and only get ids of children.\n return getIdsFromChildrenTree({ tree: childrenTree, predicate: ({ depth }) => depth > 0 });\n }),\n mergeMap((children) =>\n this.#visibilityHelper.changeElementsVisibilityStatus({\n elementIds,\n modelId: node.extendedData.modelId,\n children: children.size > 0 ? children : undefined,\n categoryId: node.extendedData.categoryId,\n on,\n }),\n ),\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(\n targets: CategoriesTreeSearchTargets,\n node: HierarchyNode & {\n key: ClassGroupingNodeKey | InstancesNodeKey;\n },\n ): Observable<VisibilityStatus> {\n if (this.#props.viewport.viewType === \"other\") {\n return of(createVisibilityStatus(\"disabled\"));\n }\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 }));\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 }),\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 const searchTargetElements = new Array<Id64String>();\n for (const { elements: elementsMap } of elements) {\n for (const [elementId, { isSearchTarget }] of elementsMap) {\n if (isSearchTarget) {\n searchTargetElements.push(elementId);\n }\n }\n }\n let childrenCountMapObs: Observable<Map<Id64String, number>>;\n if (CategoriesTreeNodeInternal.isElementClassGroupingNode(node)) {\n const groupingNodesSearchTargets: Map<Id64String, { childrenCount: number }> | undefined = node.extendedData?.searchTargets;\n const nestedSearchTargetElements = searchTargetElements.filter((searchTarget) => !groupingNodesSearchTargets?.has(searchTarget));\n // Only need to request children count for indirect children search targets.\n // Direct children search targets already have children count stored in grouping nodes extended data.\n childrenCountMapObs = this.#props.idsCache.getAllChildElementsCount({ elementIds: nestedSearchTargetElements }).pipe(\n map((elementCountMap) => {\n // Direct children search targets already have children count stored in grouping nodes extended data.\n for (const [key, value] of node.extendedData.searchTargets ?? []) {\n elementCountMap.set(key, value.childrenCount);\n }\n return elementCountMap;\n }),\n );\n } else {\n childrenCountMapObs = this.#props.idsCache.getAllChildElementsCount({ elementIds: searchTargetElements });\n }\n observables.push(\n childrenCountMapObs.pipe(\n mergeMap((elementsChildrenCountMap) =>\n fromWithRelease({ source: elements, releaseOnCount: 50 }).pipe(\n mergeMap(({ modelId, elements: elementsMap, categoryId, pathToElements, topMostParentElementId }) => {\n const parentElementsIdsPath = topMostParentElementId\n ? getParentElementsIdsPath({\n parentInstanceKeys: pathToElements.map((instanceKey) => [instanceKey]),\n topMostParentElementId,\n })\n : [];\n let totalSearchTargetsChildrenCount = 0;\n const nonSearchTargetIds = new Array<Id64String>();\n const searchTargetIds = new Array<Id64String>();\n for (const [elementId, { isSearchTarget }] of elementsMap) {\n if (!isSearchTarget) {\n nonSearchTargetIds.push(elementId);\n continue;\n }\n searchTargetIds.push(elementId);\n const childCount = elementsChildrenCountMap.get(elementId);\n if (childCount) {\n totalSearchTargetsChildrenCount += childCount;\n }\n }\n return merge(\n searchTargetIds.length > 0\n ? this.#visibilityHelper.getElementsVisibilityStatus({\n modelId,\n categoryId,\n elementIds: searchTargetIds,\n parentElementsIdsPath,\n childrenCount: totalSearchTargetsChildrenCount,\n // Search results tree is created on search paths. Since search paths contain only categories that are directly under models\n // or at the root, categoryId can be used here here.\n categoryOfTopMostParentElement: categoryId,\n })\n : EMPTY,\n // Set childrenCount to undefined for non search targets, as some of their child elements might be filtered out.\n // Since childrenCount is set to undefined, these elements won't check child always/never drawn child elements status.\n // Child always/never drawn elements will be in search paths, and their visibility status will be handled separately.\n nonSearchTargetIds.length > 0\n ? this.#visibilityHelper.getElementsVisibilityStatus({\n modelId,\n categoryId,\n elementIds: nonSearchTargetIds,\n parentElementsIdsPath,\n childrenCount: undefined,\n // Search results tree is created on search paths. Since search paths contain only categories that are directly under models\n // or at the root, categoryId can be used here here.\n categoryOfTopMostParentElement: categoryId,\n })\n : EMPTY,\n ).pipe(mergeVisibilityStatuses());\n }),\n ),\n ),\n ),\n );\n }\n\n return from(observables).pipe(mergeAll(), mergeVisibilityStatuses());\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"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { HierarchyNodeKey } from "@itwin/presentation-hierarchies";
|
|
1
2
|
import { BaseVisibilityHelper } from "../../../common/internal/visibility/BaseVisibilityHelper.js";
|
|
2
3
|
import type { Observable } from "rxjs";
|
|
3
4
|
import type { Id64Arg, Id64String } from "@itwin/core-bentley";
|
|
4
|
-
import type { ElementId, ModelId } from "../../../common/internal/Types.js";
|
|
5
|
+
import type { CategoryId, ElementId, ModelId } from "../../../common/internal/Types.js";
|
|
5
6
|
import type { BaseVisibilityHelperProps } from "../../../common/internal/visibility/BaseVisibilityHelper.js";
|
|
6
7
|
import type { VisibilityStatus } from "../../../common/UseHierarchyVisibility.js";
|
|
7
8
|
import type { CategoriesTreeHierarchyConfiguration } from "../../CategoriesTreeDefinition.js";
|
|
@@ -30,8 +31,14 @@ export declare class CategoriesTreeVisibilityHelper extends BaseVisibilityHelper
|
|
|
30
31
|
}): Observable<VisibilityStatus>;
|
|
31
32
|
/** Gets grouped elements visibility status. */
|
|
32
33
|
getGroupedElementsVisibilityStatus(props: {
|
|
33
|
-
modelElementsMap: Map<ModelId,
|
|
34
|
+
modelElementsMap: Map<ModelId, {
|
|
35
|
+
elementIds: Set<ElementId>;
|
|
36
|
+
categoryOfTopMostParentElement: CategoryId;
|
|
37
|
+
}>;
|
|
34
38
|
categoryId: Id64String;
|
|
39
|
+
parentKeys: HierarchyNodeKey[];
|
|
40
|
+
childrenCount: number;
|
|
41
|
+
topMostParentElementId?: ElementId;
|
|
35
42
|
}): Observable<VisibilityStatus>;
|
|
36
43
|
/**
|
|
37
44
|
* Changes visibility status of definition containers.
|
|
@@ -54,11 +61,13 @@ export declare class CategoriesTreeVisibilityHelper extends BaseVisibilityHelper
|
|
|
54
61
|
}): Observable<void>;
|
|
55
62
|
/** Changes grouped elements visibility status. */
|
|
56
63
|
changeGroupedElementsVisibilityStatus(props: {
|
|
57
|
-
modelElementsMap: Map<ModelId,
|
|
64
|
+
modelElementsMap: Map<ModelId, {
|
|
65
|
+
elementIds: Set<ElementId>;
|
|
66
|
+
}>;
|
|
58
67
|
categoryId: Id64String;
|
|
59
68
|
on: boolean;
|
|
60
69
|
}): Observable<void>;
|
|
61
|
-
/** Turns on
|
|
62
|
-
private
|
|
70
|
+
/** Turns on category and its' related models. Does not turn on other categories contained in those models.*/
|
|
71
|
+
private enableCategoryWithoutEnablingOtherCategories;
|
|
63
72
|
}
|
|
64
73
|
//# sourceMappingURL=CategoriesTreeVisibilityHelper.d.ts.map
|
|
@@ -2,9 +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, EMPTY, from, map, mergeMap,
|
|
5
|
+
import { concat, EMPTY, from, map, mergeAll, mergeMap, toArray } from "rxjs";
|
|
6
|
+
import { HierarchyNodeKey } from "@itwin/presentation-hierarchies";
|
|
7
|
+
import { getIdsFromChildrenTree, getParentElementsIdsPath } from "../../../common/internal/Utils.js";
|
|
6
8
|
import { BaseVisibilityHelper } from "../../../common/internal/visibility/BaseVisibilityHelper.js";
|
|
7
|
-
import {
|
|
9
|
+
import { mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js";
|
|
8
10
|
/**
|
|
9
11
|
* Visibility status helper for categories tree.
|
|
10
12
|
*
|
|
@@ -31,18 +33,24 @@ export class CategoriesTreeVisibilityHelper extends BaseVisibilityHelper {
|
|
|
31
33
|
.pipe(mergeMap((categoryIds) => this.getCategoriesVisibilityStatus({
|
|
32
34
|
categoryIds,
|
|
33
35
|
modelId: undefined,
|
|
34
|
-
type: this.#props.viewport.viewType === "2d" ? "DrawingCategory" : "SpatialCategory",
|
|
35
36
|
})));
|
|
36
37
|
}
|
|
37
38
|
/** Gets grouped elements visibility status. */
|
|
38
39
|
getGroupedElementsVisibilityStatus(props) {
|
|
39
|
-
const { modelElementsMap, categoryId } = props;
|
|
40
|
-
return from(modelElementsMap).pipe(mergeMap(([modelId, elementIds]) => this.getElementsVisibilityStatus({
|
|
40
|
+
const { modelElementsMap, categoryId, topMostParentElementId } = props;
|
|
41
|
+
return from(modelElementsMap).pipe(mergeMap(([modelId, { elementIds, categoryOfTopMostParentElement }]) => this.getElementsVisibilityStatus({
|
|
41
42
|
elementIds,
|
|
42
43
|
modelId,
|
|
43
44
|
categoryId,
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
parentElementsIdsPath: topMostParentElementId
|
|
46
|
+
? getParentElementsIdsPath({
|
|
47
|
+
parentInstanceKeys: props.parentKeys.filter((key) => HierarchyNodeKey.isInstances(key)).map((key) => key.instanceKeys),
|
|
48
|
+
topMostParentElementId,
|
|
49
|
+
})
|
|
50
|
+
: [],
|
|
51
|
+
childrenCount: props.childrenCount,
|
|
52
|
+
categoryOfTopMostParentElement,
|
|
53
|
+
})), mergeVisibilityStatuses());
|
|
46
54
|
}
|
|
47
55
|
/**
|
|
48
56
|
* Changes visibility status of definition containers.
|
|
@@ -65,27 +73,38 @@ export class CategoriesTreeVisibilityHelper extends BaseVisibilityHelper {
|
|
|
65
73
|
changeSubCategoriesVisibilityStatus(props) {
|
|
66
74
|
return concat(
|
|
67
75
|
// make sure parent category and models are enabled
|
|
68
|
-
props.on
|
|
69
|
-
? concat(from(enableCategoryDisplay(this.#props.viewport, props.categoryId, props.on, false)), this.enableCategoriesElementModelsVisibilityStatus(props.categoryId))
|
|
70
|
-
: EMPTY, from(props.subCategoryIds).pipe(map((subCategoryId) => this.#props.viewport.changeSubCategoryDisplay({ subCategoryId, display: props.on }))));
|
|
76
|
+
props.on ? this.enableCategoryWithoutEnablingOtherCategories(props.categoryId) : EMPTY, from(props.subCategoryIds).pipe(map((subCategoryId) => this.#props.viewport.changeSubCategoryDisplay({ subCategoryId, display: props.on }))));
|
|
71
77
|
}
|
|
72
78
|
/** Changes grouped elements visibility status. */
|
|
73
79
|
changeGroupedElementsVisibilityStatus(props) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
const elementIds = new Array();
|
|
81
|
+
for (const { elementIds: ids } of props.modelElementsMap.values()) {
|
|
82
|
+
for (const id of ids) {
|
|
83
|
+
elementIds.push(id);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return this.#props.idsCache.getChildElementsTree({ elementIds }).pipe(map((childrenTree) => getIdsFromChildrenTree({ tree: childrenTree, predicate: ({ depth }) => depth > 0 })), mergeMap((children) => from(props.modelElementsMap).pipe(mergeMap(([modelId, { elementIds: modelElementIds }]) => {
|
|
87
|
+
return this.changeElementsVisibilityStatus({ modelId, elementIds: modelElementIds, categoryId: props.categoryId, on: props.on, children });
|
|
88
|
+
}))));
|
|
77
89
|
}
|
|
78
|
-
/** Turns on
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
/** Turns on category and its' related models. Does not turn on other categories contained in those models.*/
|
|
91
|
+
enableCategoryWithoutEnablingOtherCategories(categoryId) {
|
|
92
|
+
this.#props.viewport.changeCategoryDisplay({ categoryIds: categoryId, display: true });
|
|
93
|
+
return this.#props.idsCache.getModels({ categoryId, includeSubModels: true }).pipe(mergeAll(), mergeMap((modelId) => {
|
|
94
|
+
this.#props.viewport.setPerModelCategoryOverride({ modelIds: modelId, categoryIds: categoryId, override: "none" });
|
|
95
|
+
return this.#props.viewport.viewsModel(modelId)
|
|
96
|
+
? EMPTY
|
|
97
|
+
: this.#props.idsCache.getCategories({ modelId }).pipe(map((allModelCategories) => {
|
|
98
|
+
// Add 'Hide' override to categories that were hidden before model is turned on
|
|
99
|
+
for (const modelCategoryId of allModelCategories) {
|
|
100
|
+
if (modelCategoryId !== categoryId) {
|
|
101
|
+
this.#props.viewport.setPerModelCategoryOverride({ modelIds: modelId, categoryIds: modelCategoryId, override: "hide" });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return modelId;
|
|
105
|
+
}));
|
|
106
|
+
}), toArray(), map((hiddenModels) => {
|
|
107
|
+
if (hiddenModels.length > 0) {
|
|
89
108
|
this.#props.viewport.changeModelDisplay({ modelIds: hiddenModels, display: true });
|
|
90
109
|
}
|
|
91
110
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoriesTreeVisibilityHelper.js","sourceRoot":"","sources":["../../../../../../../../src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAgB7G;;;;;GAKG;AACH,MAAM,OAAO,8BAA+B,SAAQ,oBAAoB;IACtE,MAAM,CAAsC;IAC5C,YAAY,KAA0C;QACpD,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,uCAAuC,CAAC,KAA0C;QACvF,OAAO,IAAI,CAAC,MAAM,CAAC,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AE,MAAM,EAAE,EAAE,EAAE;YACzB,MAAM,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC9C,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,IAAI,GAAG,EAAc,CAAC,EACzB,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;YACnB,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACrF,CAAC;QACH,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, EMPTY, from, map, mergeMap, reduce } from \"rxjs\";\nimport { BaseVisibilityHelper } from \"../../../common/internal/visibility/BaseVisibilityHelper.js\";\nimport { enableCategoryDisplay, mergeVisibilityStatuses } from \"../../../common/internal/VisibilityUtils.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { Id64Arg, Id64String } from \"@itwin/core-bentley\";\nimport type { ElementId, ModelId } from \"../../../common/internal/Types.js\";\nimport type { BaseVisibilityHelperProps } from \"../../../common/internal/visibility/BaseVisibilityHelper.js\";\nimport type { VisibilityStatus } from \"../../../common/UseHierarchyVisibility.js\";\nimport type { CategoriesTreeHierarchyConfiguration } from \"../../CategoriesTreeDefinition.js\";\nimport type { CategoriesTreeIdsCache } from \"../CategoriesTreeIdsCache.js\";\n\n/** @internal */\nexport type CategoriesTreeVisibilityHelperProps = BaseVisibilityHelperProps & {\n idsCache: CategoriesTreeIdsCache;\n hierarchyConfig: CategoriesTreeHierarchyConfiguration;\n};\n\n/**\n * Visibility status helper for categories tree.\n *\n * It extends base visibility status helper and provides methods to get and change visibility status of definition containers and grouped elements.\n * @internal\n */\nexport class CategoriesTreeVisibilityHelper extends BaseVisibilityHelper {\n #props: CategoriesTreeVisibilityHelperProps;\n constructor(props: CategoriesTreeVisibilityHelperProps) {\n super(props);\n this.#props = props;\n }\n\n /**\n * Gets visibility status of definition containers.\n *\n * Determines visibility status by checking visibility status of related categories.\n */\n public getDefinitionContainersVisibilityStatus(props: { definitionContainerIds: Id64Arg }): Observable<VisibilityStatus> {\n return this.#props.idsCache\n .getAllContainedCategories({\n definitionContainerIds: props.definitionContainerIds,\n includeEmptyCategories: this.#props.hierarchyConfig.showEmptyCategories,\n })\n .pipe(\n mergeMap((categoryIds) =>\n this.getCategoriesVisibilityStatus({\n categoryIds,\n modelId: undefined,\n type: this.#props.viewport.viewType === \"2d\" ? \"DrawingCategory\" : \"SpatialCategory\",\n }),\n ),\n );\n }\n\n /** Gets grouped elements visibility status. */\n public getGroupedElementsVisibilityStatus(props: { modelElementsMap: Map<ModelId, Set<ElementId>>; categoryId: Id64String }): Observable<VisibilityStatus> {\n const { modelElementsMap, categoryId } = props;\n return from(modelElementsMap).pipe(\n mergeMap(([modelId, elementIds]) =>\n this.getElementsVisibilityStatus({\n elementIds,\n modelId,\n categoryId,\n type: this.#props.viewport.viewType === \"2d\" ? \"GeometricElement2d\" : \"GeometricElement3d\",\n }),\n ),\n mergeVisibilityStatuses,\n );\n }\n\n /**\n * Changes visibility status of definition containers.\n *\n * Does this by changing visibility status of related categories.\n */\n public changeDefinitionContainersVisibilityStatus(props: { definitionContainerIds: Id64Arg; on: boolean }): Observable<void> {\n return this.#props.idsCache\n .getAllContainedCategories({\n definitionContainerIds: props.definitionContainerIds,\n includeEmptyCategories: this.#props.hierarchyConfig.showEmptyCategories,\n })\n .pipe(mergeMap((categoryIds) => this.changeCategoriesVisibilityStatus({ categoryIds, modelId: undefined, on: props.on })));\n }\n\n /**\n * Changes visibility status of sub-categories.\n *\n * Also, enables parent categories if `on` is true.\n */\n public changeSubCategoriesVisibilityStatus(props: { categoryId: Id64String; subCategoryIds: Id64Arg; on: boolean }): Observable<void> {\n return concat(\n // make sure parent category and models are enabled\n props.on\n ? concat(\n from(enableCategoryDisplay(this.#props.viewport, props.categoryId, props.on, false)),\n this.enableCategoriesElementModelsVisibilityStatus(props.categoryId),\n )\n : EMPTY,\n from(props.subCategoryIds).pipe(map((subCategoryId) => this.#props.viewport.changeSubCategoryDisplay({ subCategoryId, display: props.on }))),\n );\n }\n\n /** Changes grouped elements visibility status. */\n public changeGroupedElementsVisibilityStatus(props: {\n modelElementsMap: Map<ModelId, Set<ElementId>>;\n categoryId: Id64String;\n on: boolean;\n }): Observable<void> {\n return from(props.modelElementsMap).pipe(\n mergeMap(([modelId, elementIds]) => {\n return this.changeElementsVisibilityStatus({ modelId, elementIds, categoryId: props.categoryId, on: props.on });\n }),\n );\n }\n\n /** Turns on visibility status of models (that are not yet turned on) that are related to categories. */\n private enableCategoriesElementModelsVisibilityStatus(categoryIds: Id64Arg): Observable<void> {\n return this.#props.idsCache.getCategoriesElementModels(categoryIds, true).pipe(\n reduce((acc, { models }) => {\n models?.forEach((modelId) => {\n if (!this.#props.viewport.viewsModel(modelId)) {\n acc.add(modelId);\n }\n });\n return acc;\n }, new Set<Id64String>()),\n map((hiddenModels) => {\n if (hiddenModels.size > 0) {\n this.#props.viewport.changeModelDisplay({ modelIds: hiddenModels, display: true });\n }\n }),\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CategoriesTreeVisibilityHelper.js","sourceRoot":"","sources":["../../../../../../../../src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE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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, EMPTY, from, map, mergeAll, mergeMap, toArray } from \"rxjs\";\nimport { HierarchyNodeKey } from \"@itwin/presentation-hierarchies\";\nimport { getIdsFromChildrenTree, getParentElementsIdsPath } from \"../../../common/internal/Utils.js\";\nimport { BaseVisibilityHelper } from \"../../../common/internal/visibility/BaseVisibilityHelper.js\";\nimport { mergeVisibilityStatuses } from \"../../../common/internal/VisibilityUtils.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { Id64Arg, Id64String } from \"@itwin/core-bentley\";\nimport type { CategoryId, ElementId, ModelId } from \"../../../common/internal/Types.js\";\nimport type { BaseVisibilityHelperProps } from \"../../../common/internal/visibility/BaseVisibilityHelper.js\";\nimport type { VisibilityStatus } from \"../../../common/UseHierarchyVisibility.js\";\nimport type { CategoriesTreeHierarchyConfiguration } from \"../../CategoriesTreeDefinition.js\";\nimport type { CategoriesTreeIdsCache } from \"../CategoriesTreeIdsCache.js\";\n\n/** @internal */\nexport type CategoriesTreeVisibilityHelperProps = BaseVisibilityHelperProps & {\n idsCache: CategoriesTreeIdsCache;\n hierarchyConfig: CategoriesTreeHierarchyConfiguration;\n};\n\n/**\n * Visibility status helper for categories tree.\n *\n * It extends base visibility status helper and provides methods to get and change visibility status of definition containers and grouped elements.\n * @internal\n */\nexport class CategoriesTreeVisibilityHelper extends BaseVisibilityHelper {\n #props: CategoriesTreeVisibilityHelperProps;\n constructor(props: CategoriesTreeVisibilityHelperProps) {\n super(props);\n this.#props = props;\n }\n\n /**\n * Gets visibility status of definition containers.\n *\n * Determines visibility status by checking visibility status of related categories.\n */\n public getDefinitionContainersVisibilityStatus(props: { definitionContainerIds: Id64Arg }): Observable<VisibilityStatus> {\n return this.#props.idsCache\n .getAllContainedCategories({\n definitionContainerIds: props.definitionContainerIds,\n includeEmptyCategories: this.#props.hierarchyConfig.showEmptyCategories,\n })\n .pipe(\n mergeMap((categoryIds) =>\n this.getCategoriesVisibilityStatus({\n categoryIds,\n modelId: undefined,\n }),\n ),\n );\n }\n\n /** Gets grouped elements visibility status. */\n public getGroupedElementsVisibilityStatus(props: {\n modelElementsMap: Map<ModelId, { elementIds: Set<ElementId>; categoryOfTopMostParentElement: CategoryId }>;\n categoryId: Id64String;\n parentKeys: HierarchyNodeKey[];\n childrenCount: number;\n topMostParentElementId?: ElementId;\n }): Observable<VisibilityStatus> {\n const { modelElementsMap, categoryId, topMostParentElementId } = props;\n return from(modelElementsMap).pipe(\n mergeMap(([modelId, { elementIds, categoryOfTopMostParentElement }]) =>\n this.getElementsVisibilityStatus({\n elementIds,\n modelId,\n categoryId,\n parentElementsIdsPath: topMostParentElementId\n ? getParentElementsIdsPath({\n parentInstanceKeys: props.parentKeys.filter((key) => HierarchyNodeKey.isInstances(key)).map((key) => key.instanceKeys),\n topMostParentElementId,\n })\n : [],\n childrenCount: props.childrenCount,\n categoryOfTopMostParentElement,\n }),\n ),\n mergeVisibilityStatuses(),\n );\n }\n\n /**\n * Changes visibility status of definition containers.\n *\n * Does this by changing visibility status of related categories.\n */\n public changeDefinitionContainersVisibilityStatus(props: { definitionContainerIds: Id64Arg; on: boolean }): Observable<void> {\n return this.#props.idsCache\n .getAllContainedCategories({\n definitionContainerIds: props.definitionContainerIds,\n includeEmptyCategories: this.#props.hierarchyConfig.showEmptyCategories,\n })\n .pipe(mergeMap((categoryIds) => this.changeCategoriesVisibilityStatus({ categoryIds, modelId: undefined, on: props.on })));\n }\n\n /**\n * Changes visibility status of sub-categories.\n *\n * Also, enables parent categories if `on` is true.\n */\n public changeSubCategoriesVisibilityStatus(props: { categoryId: Id64String; subCategoryIds: Id64Arg; on: boolean }): Observable<void> {\n return concat(\n // make sure parent category and models are enabled\n props.on ? this.enableCategoryWithoutEnablingOtherCategories(props.categoryId) : EMPTY,\n from(props.subCategoryIds).pipe(map((subCategoryId) => this.#props.viewport.changeSubCategoryDisplay({ subCategoryId, display: props.on }))),\n );\n }\n\n /** Changes grouped elements visibility status. */\n public changeGroupedElementsVisibilityStatus(props: {\n modelElementsMap: Map<ModelId, { elementIds: Set<ElementId> }>;\n categoryId: Id64String;\n on: boolean;\n }): Observable<void> {\n const elementIds = new Array<ElementId>();\n for (const { elementIds: ids } of props.modelElementsMap.values()) {\n for (const id of ids) {\n elementIds.push(id);\n }\n }\n return this.#props.idsCache.getChildElementsTree({ elementIds }).pipe(\n map((childrenTree) => getIdsFromChildrenTree({ tree: childrenTree, predicate: ({ depth }) => depth > 0 })),\n mergeMap((children) =>\n from(props.modelElementsMap).pipe(\n mergeMap(([modelId, { elementIds: modelElementIds }]) => {\n return this.changeElementsVisibilityStatus({ modelId, elementIds: modelElementIds, categoryId: props.categoryId, on: props.on, children });\n }),\n ),\n ),\n );\n }\n\n /** Turns on category and its' related models. Does not turn on other categories contained in those models.*/\n private enableCategoryWithoutEnablingOtherCategories(categoryId: Id64String): Observable<void> {\n this.#props.viewport.changeCategoryDisplay({ categoryIds: categoryId, display: true });\n return this.#props.idsCache.getModels({ categoryId, includeSubModels: true }).pipe(\n mergeAll(),\n mergeMap((modelId) => {\n this.#props.viewport.setPerModelCategoryOverride({ modelIds: modelId, categoryIds: categoryId, override: \"none\" });\n return this.#props.viewport.viewsModel(modelId)\n ? EMPTY\n : this.#props.idsCache.getCategories({ modelId }).pipe(\n map((allModelCategories) => {\n // Add 'Hide' override to categories that were hidden before model is turned on\n for (const modelCategoryId of allModelCategories) {\n if (modelCategoryId !== categoryId) {\n this.#props.viewport.setPerModelCategoryOverride({ modelIds: modelId, categoryIds: modelCategoryId, override: \"hide\" });\n }\n }\n return modelId;\n }),\n );\n }),\n toArray(),\n map((hiddenModels) => {\n if (hiddenModels.length > 0) {\n this.#props.viewport.changeModelDisplay({ modelIds: hiddenModels, display: true });\n }\n }),\n );\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Id64Set, Id64String } from "@itwin/core-bentley";
|
|
2
2
|
import type { HierarchySearchPath } from "@itwin/presentation-hierarchies";
|
|
3
|
-
import type { ECClassHierarchyInspector } from "@itwin/presentation-shared";
|
|
3
|
+
import type { ECClassHierarchyInspector, InstanceKey } from "@itwin/presentation-shared";
|
|
4
4
|
import type { ElementId } from "../../../common/internal/Types.js";
|
|
5
5
|
import type { SearchResultsTree } from "../../../common/internal/visibility/BaseSearchResultsTree.js";
|
|
6
6
|
import type { CategoriesTreeIdsCache } from "../CategoriesTreeIdsCache.js";
|
|
@@ -11,11 +11,13 @@ export interface CategoriesTreeSearchTargets {
|
|
|
11
11
|
categoryIds: Id64Set;
|
|
12
12
|
}>;
|
|
13
13
|
elements?: Array<{
|
|
14
|
+
pathToElements: InstanceKey[];
|
|
14
15
|
modelId: Id64String;
|
|
15
16
|
categoryId: Id64String;
|
|
16
17
|
elements: Map<ElementId, {
|
|
17
18
|
isSearchTarget: boolean;
|
|
18
19
|
}>;
|
|
20
|
+
topMostParentElementId?: ElementId;
|
|
19
21
|
}>;
|
|
20
22
|
definitionContainerIds?: Id64Set;
|
|
21
23
|
modelIds?: Id64Set;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { firstValueFrom } from "rxjs";
|
|
6
6
|
import { assert } from "@itwin/core-bentley";
|
|
7
|
-
import { CLASS_NAME_SubCategory } from "../../../common/internal/ClassNameDefinitions.js";
|
|
7
|
+
import { CLASS_NAME_DefinitionContainer, CLASS_NAME_SubCategory } from "../../../common/internal/ClassNameDefinitions.js";
|
|
8
8
|
import { createSearchResultsTree, SearchResultsNodesHandler } from "../../../common/internal/visibility/BaseSearchResultsTree.js";
|
|
9
9
|
/** @internal */
|
|
10
10
|
export async function createCategoriesSearchResultsTree(props) {
|
|
@@ -31,17 +31,17 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
31
31
|
const result = {
|
|
32
32
|
searchResultsElements: new Map(),
|
|
33
33
|
};
|
|
34
|
-
this.searchResultsNodesArr
|
|
34
|
+
for (const node of this.searchResultsNodesArr) {
|
|
35
35
|
if (node.type === "element") {
|
|
36
36
|
searchResultsTemporaryElements.set(node.id, node);
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
const searchResultsElementsModels = await firstValueFrom(this.#props.idsCache.getFilteredElementsModels([...searchResultsTemporaryElements.keys()]));
|
|
40
|
-
|
|
40
|
+
for (const [id, element] of searchResultsTemporaryElements) {
|
|
41
41
|
const modelId = searchResultsElementsModels.get(element.id);
|
|
42
42
|
assert(modelId !== undefined);
|
|
43
43
|
result.searchResultsElements.set(id, { ...element, modelId });
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
45
|
return result;
|
|
46
46
|
}
|
|
47
47
|
convertNodesToSearchTargets(searchResultsNodes, processedSearchResultsNodes) {
|
|
@@ -49,6 +49,26 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
49
49
|
searchResultsNodes.forEach((searchResultsNode) => this.collectSearchTargets(searchTargets, searchResultsNode, processedSearchResultsNodes));
|
|
50
50
|
return this.convertInternalSearchTargets(searchTargets);
|
|
51
51
|
}
|
|
52
|
+
convertInternalSearchTargetElementsRecursively(searchTargetsInternalElements, currentPath) {
|
|
53
|
+
const result = [];
|
|
54
|
+
// Internal search target elements are stored in a tree structure, need to convert that to array structure.
|
|
55
|
+
for (const [identifierAsString, entry] of searchTargetsInternalElements) {
|
|
56
|
+
const identifier = this.convertSearchResultsNodeIdentifierStringToHierarchyNodeIdentifier(identifierAsString);
|
|
57
|
+
if (entry.modelCategoryElements) {
|
|
58
|
+
for (const [modelCategoryKey, elements] of entry.modelCategoryElements) {
|
|
59
|
+
const { modelId, categoryId } = this.parseModelCategoryKey(modelCategoryKey);
|
|
60
|
+
result.push({ pathToElements: [...currentPath, identifier], modelId, categoryId, elements, topMostParentElementId: entry.topMostParentElementId });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!entry.children) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
for (const childValue of this.convertInternalSearchTargetElementsRecursively(entry.children, [...currentPath, identifier])) {
|
|
67
|
+
result.push(childValue);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
52
72
|
convertInternalSearchTargets(searchTargets) {
|
|
53
73
|
if (!searchTargets.categories &&
|
|
54
74
|
!searchTargets.definitionContainerIds &&
|
|
@@ -63,12 +83,7 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
63
83
|
return { modelId, categoryIds };
|
|
64
84
|
})
|
|
65
85
|
: undefined,
|
|
66
|
-
elements: searchTargets.elements
|
|
67
|
-
? [...searchTargets.elements.entries()].map(([modelCategoryKey, elements]) => {
|
|
68
|
-
const { modelId, categoryId } = this.parseModelCategoryKey(modelCategoryKey);
|
|
69
|
-
return { modelId, categoryId, elements };
|
|
70
|
-
})
|
|
71
|
-
: undefined,
|
|
86
|
+
elements: searchTargets.elements ? this.convertInternalSearchTargetElementsRecursively(searchTargets.elements, []) : undefined,
|
|
72
87
|
definitionContainerIds: searchTargets.definitionContainerIds,
|
|
73
88
|
modelIds: searchTargets.modelIds,
|
|
74
89
|
subCategories: searchTargets.subCategories
|
|
@@ -121,13 +136,37 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
121
136
|
searchTargets.categories.set(node.modelId, new Set([node.id]));
|
|
122
137
|
return;
|
|
123
138
|
case "element":
|
|
139
|
+
// Internal search target elements need to have path saved in some way.
|
|
140
|
+
// For this, a tree structure is used, where keys are stringified identifiers of parent nodes depending on the hierarchy.
|
|
124
141
|
const modelCategoryKey = this.createModelCategoryKey(node.modelId, node.categoryId);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
searchTargets.elements ??= new Map();
|
|
143
|
+
let entry = searchTargets.elements;
|
|
144
|
+
let topMostParentElementId;
|
|
145
|
+
for (let i = 0; i < node.pathToNode.length; ++i) {
|
|
146
|
+
if (topMostParentElementId === undefined && node.pathToNode[i].type === "element") {
|
|
147
|
+
topMostParentElementId = node.pathToNode[i].id;
|
|
148
|
+
}
|
|
149
|
+
const identifierAsString = this.convertSearchResultsNodeIdentifierToString(node.pathToNode[i]);
|
|
150
|
+
let identifierEntry = entry.get(identifierAsString);
|
|
151
|
+
// create a new entry for parent node if it does not exist
|
|
152
|
+
if (!identifierEntry) {
|
|
153
|
+
identifierEntry = { topMostParentElementId };
|
|
154
|
+
entry.set(identifierAsString, identifierEntry);
|
|
155
|
+
}
|
|
156
|
+
// last entry in the path don't need to have children
|
|
157
|
+
if (i < node.pathToNode.length - 1) {
|
|
158
|
+
identifierEntry.children ??= new Map();
|
|
159
|
+
entry = identifierEntry.children;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const elements = (identifierEntry.modelCategoryElements ??= new Map()).get(modelCategoryKey);
|
|
163
|
+
// Add elements who share the same path to the modelCategoryElements map
|
|
164
|
+
if (elements) {
|
|
165
|
+
elements.set(node.id, { isSearchTarget: node.isSearchTarget });
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
identifierEntry.modelCategoryElements.set(modelCategoryKey, new Map([[node.id, { isSearchTarget: node.isSearchTarget }]]));
|
|
169
|
+
}
|
|
131
170
|
}
|
|
132
171
|
}
|
|
133
172
|
}
|
|
@@ -139,11 +178,13 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
139
178
|
return { modelId, categoryId };
|
|
140
179
|
}
|
|
141
180
|
createSearchResultsTreeNode({ type, id, isSearchTarget, parent, }) {
|
|
181
|
+
const pathToNode = "pathToNode" in parent ? [...parent.pathToNode, { type: parent.type, id: parent.id }] : [];
|
|
142
182
|
if (type === "definitionContainer") {
|
|
143
183
|
return {
|
|
144
184
|
id,
|
|
145
185
|
isSearchTarget,
|
|
146
186
|
type,
|
|
187
|
+
pathToNode,
|
|
147
188
|
};
|
|
148
189
|
}
|
|
149
190
|
if (type === "subCategory") {
|
|
@@ -153,6 +194,7 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
153
194
|
isSearchTarget,
|
|
154
195
|
type,
|
|
155
196
|
categoryId: parent.id,
|
|
197
|
+
pathToNode,
|
|
156
198
|
};
|
|
157
199
|
}
|
|
158
200
|
if (type === "category") {
|
|
@@ -162,12 +204,14 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
162
204
|
isSearchTarget,
|
|
163
205
|
type,
|
|
164
206
|
modelId: parent.id,
|
|
207
|
+
pathToNode,
|
|
165
208
|
};
|
|
166
209
|
}
|
|
167
210
|
return {
|
|
168
211
|
id,
|
|
169
212
|
isSearchTarget,
|
|
170
213
|
type,
|
|
214
|
+
pathToNode,
|
|
171
215
|
};
|
|
172
216
|
}
|
|
173
217
|
if (type === "model") {
|
|
@@ -177,6 +221,7 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
177
221
|
isSearchTarget,
|
|
178
222
|
type,
|
|
179
223
|
categoryId: parent.type === "category" ? parent.id : undefined,
|
|
224
|
+
pathToNode,
|
|
180
225
|
};
|
|
181
226
|
}
|
|
182
227
|
if ("type" in parent) {
|
|
@@ -187,6 +232,7 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
187
232
|
type,
|
|
188
233
|
categoryId: parent.id,
|
|
189
234
|
modelId: undefined,
|
|
235
|
+
pathToNode,
|
|
190
236
|
};
|
|
191
237
|
}
|
|
192
238
|
assert(parent.type === "element");
|
|
@@ -196,6 +242,7 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
196
242
|
type,
|
|
197
243
|
categoryId: parent.categoryId,
|
|
198
244
|
modelId: undefined,
|
|
245
|
+
pathToNode,
|
|
199
246
|
};
|
|
200
247
|
}
|
|
201
248
|
throw new Error("Invalid parent node type");
|
|
@@ -215,5 +262,19 @@ class CategoriesTreeSearchResultsNodesHandler extends SearchResultsNodesHandler
|
|
|
215
262
|
}
|
|
216
263
|
return "definitionContainer";
|
|
217
264
|
}
|
|
265
|
+
getClassName(type) {
|
|
266
|
+
switch (type) {
|
|
267
|
+
case "definitionContainer":
|
|
268
|
+
return CLASS_NAME_DefinitionContainer;
|
|
269
|
+
case "subCategory":
|
|
270
|
+
return CLASS_NAME_SubCategory;
|
|
271
|
+
case "category":
|
|
272
|
+
return this.#props.categoryClassName;
|
|
273
|
+
case "model":
|
|
274
|
+
return this.#props.categoryModelClassName;
|
|
275
|
+
default:
|
|
276
|
+
return this.#props.categoryElementClassName;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
218
279
|
}
|
|
219
280
|
//# sourceMappingURL=SearchResultsTree.js.map
|