@itwin/tree-widget-react 4.0.0-alpha.2 → 4.0.0-alpha.20
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 +281 -1
- package/README.md +190 -63
- package/lib/esm/tree-widget-react/TreeWidget.d.ts +7 -4
- package/lib/esm/tree-widget-react/TreeWidget.js +32 -12
- package/lib/esm/tree-widget-react/TreeWidget.js.map +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.d.ts +7 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js +22 -23
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js.map +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js +4 -3
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/ErrorState.js +4 -3
- package/lib/esm/tree-widget-react/components/tree-header/ErrorState.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SearchBox.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SearchBox.js +6 -6
- package/lib/esm/tree-widget-react/components/tree-header/SearchBox.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.css +3 -2
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.d.ts +4 -4
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.js +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.css +1 -0
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.d.ts +12 -5
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.js +13 -9
- 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 +3 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js +3 -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/CategoriesTreeButtons.d.ts +11 -7
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +64 -14
- 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 +8 -6
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js +4 -4
- 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 +41 -8
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +700 -125
- 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 +18 -7
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +124 -83
- 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 +70 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js +504 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.d.ts +41 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.js +50 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.d.ts +27 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js +136 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.d.ts +54 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js +291 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.d.ts +64 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js +94 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.d.ts +36 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js +219 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.d.ts +12 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js +19 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.d.ts +30 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js +47 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.d.ts +45 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js +569 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.d.ts +6 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.js +33 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.d.ts +24 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js +115 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.d.ts +44 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js +61 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.d.ts +50 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js +364 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.d.ts +19 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.js +32 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.d.ts +20 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js +53 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.d.ts +37 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js +177 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.d.ts +55 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js +53 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.d.ts +32 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js +168 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.d.ts +11 -23
- package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js +22 -76
- package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.d.ts +28 -4
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.js +73 -2
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.js +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.d.ts +186 -0
- package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.js +79 -0
- package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.d.ts +15 -7
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js +33 -22
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.js +2 -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 +45 -23
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js +110 -44
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.d.ts +2 -3
- package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.js +4 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.js +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.css +25 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.d.ts +27 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js +47 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js +4 -3
- 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/SkeletonTree.css +16 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.d.ts +7 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.js +19 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.css +11 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.d.ts +9 -12
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js +55 -38
- 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.css +2 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.d.ts +24 -8
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js +41 -25
- 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.d.ts +6 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js +13 -4
- 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 +6 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.js +7 -7
- 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/VisibilityTree.d.ts +5 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js +10 -6
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.d.ts +5 -3
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js +17 -15
- 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/AlwaysAndNeverDrawnElementInfo.d.ts +74 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js +207 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.d.ts +43 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js +47 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.d.ts +12 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.js +112 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{Rxjs.d.ts → internal/Rxjs.d.ts} +9 -2
- package/lib/esm/tree-widget-react/components/trees/common/{Rxjs.js → internal/Rxjs.js} +10 -2
- package/lib/esm/tree-widget-react/components/trees/common/internal/Rxjs.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{Tooltip.d.ts → internal/Tooltip.d.ts} +4 -8
- package/lib/esm/tree-widget-react/components/trees/common/internal/Tooltip.js +18 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Tooltip.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Types.d.ts +14 -0
- package/lib/esm/tree-widget-react/components/{tree-header/SearchBox.css → trees/common/internal/Types.js} +2 -4
- package/lib/esm/tree-widget-react/components/trees/common/internal/Types.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.d.ts +6 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.js +24 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchiesLocalization.d.ts → internal/UseHierarchiesLocalization.d.ts} +3 -2
- package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchiesLocalization.js → internal/UseHierarchiesLocalization.js} +6 -2
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseHierarchiesLocalization.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchyFiltering.d.ts → internal/UseHierarchyFiltering.d.ts} +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchyFiltering.js → internal/UseHierarchyFiltering.js} +5 -4
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseHierarchyFiltering.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.d.ts +17 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js +32 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseIModelChangeListener.d.ts → internal/UseIModelChangeListener.d.ts} +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseIModelChangeListener.js → internal/UseIModelChangeListener.js} +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelChangeListener.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.d.ts +70 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js +172 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.d.ts +20 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.js +60 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.d.ts +39 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js +160 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.d.ts +3 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.js +12 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.d.ts +68 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js +170 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.d.ts +20 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js +46 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.d.ts +91 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js +112 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.d.ts +236 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js +600 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.d.ts +2 -0
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.js +11 -0
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +7 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js +29 -20
- 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.d.ts +2 -6
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +5 -6
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js +36 -21
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +9 -2
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js +48 -36
- 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.d.ts +2 -6
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js +2 -2
- 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.d.ts +13 -4
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js +80 -74
- 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.d.ts +7 -10
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js +45 -36
- 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 +16 -5
- package/lib/esm/tree-widget-react/components/trees/index.js +16 -4
- 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 +3 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js +3 -2
- 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 +3 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +34 -24
- 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 +14 -7
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js +11 -7
- 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 +24 -20
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +193 -154
- 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 +60 -10
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +97 -238
- 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 +22 -25
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +280 -298
- 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/ModelsTreeNode.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.d.ts +41 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js +253 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.d.ts +27 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js +148 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.d.ts +76 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js +269 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.d.ts +53 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js +71 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js.map +1 -0
- package/lib/esm/tree-widget-react-internal.d.ts +12 -0
- package/lib/esm/tree-widget-react-internal.js +18 -0
- package/lib/esm/tree-widget-react-internal.js.map +1 -0
- package/lib/public/locales/en/TreeWidget.json +41 -54
- package/package.json +76 -79
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.d.ts +0 -28
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.js +0 -87
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.d.ts +0 -7
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.js +0 -66
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/Rxjs.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/Tooltip.js +0 -24
- package/lib/esm/tree-widget-react/components/trees/common/Tooltip.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.d.ts +0 -7
- package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.js +0 -21
- package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.d.ts +0 -11
- package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.js +0 -24
- package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchiesLocalization.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyFiltering.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseIModelChangeListener.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.d.ts +0 -20
- package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.js +0 -127
- package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.d.ts +0 -7
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.js +0 -12
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.d.ts +0 -7
- package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.js +0 -21
- package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.d.ts +0 -29
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js +0 -138
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.d.ts +0 -25
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js +0 -173
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.d.ts +0 -106
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js +0 -663
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.d.ts +0 -12
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.js +0 -48
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.js.map +0 -1
|
@@ -0,0 +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,MAAM,qBAAqB,CAAC;AACnD,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,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACpG,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,4BAA4B,EAAE,MAAM,mBAAmB,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IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;gBACzB,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACrH,OAAO,4BAA4B,CAAC;gBAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,cAAc,EAAE,KAAK,CAAC,aAAa;gBACnC,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,MAAM;KACpB,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, 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 { getClassesByView, releaseMainThreadOnItemsCount } from \"../../../common/internal/Utils.js\";\nimport { mergeVisibilityStatuses } from \"../../../common/internal/VisibilityUtils.js\";\nimport { CategoriesTreeNode } from \"../CategoriesTreeNode.js\";\nimport { CategoriesTreeVisibilityHelper } from \"./CategoriesTreeVisibilityHelper.js\";\nimport { createFilteredCategoriesTree } from \"./FilteredTree.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { GroupingHierarchyNode, HierarchyFilteringPath } 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 { FilteredTree } from \"../../../common/internal/visibility/BaseFilteredTree.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 { CategoriesTreeFilterTargets } from \"./FilteredTree.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<CategoriesTreeFilterTargets> {\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 changeFilterTargetsVisibilityStatus(targets: CategoriesTreeFilterTargets, 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 from(elements).pipe(\n releaseMainThreadOnItemsCount(50),\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 getFilterTargetsVisibilityStatus(targets: CategoriesTreeFilterTargets): 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 from(elements).pipe(\n releaseMainThreadOnItemsCount(50),\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 from(Id64.iterable(props.categoryIds)).pipe(\n mergeMap((categoryId) =>\n this.#props.idsCache.getCategoriesElementModels(categoryId, true).pipe(\n mergeMap((categoryModelsMap) => (categoryModelsMap.size > 0 ? categoryModelsMap.values() : of(undefined))),\n map((categoryModels) => ({ id: categoryId, models: categoryModels })),\n ),\n ),\n );\n }\n\n private getSubCategories(props: Parameters<BaseIdsCache[\"getSubCategories\"]>[0]): ReturnType<BaseIdsCache[\"getSubCategories\"]> {\n return from(Id64.iterable(props.categoryIds)).pipe(\n mergeMap((categoryId) =>\n this.#props.idsCache.getSubCategories(categoryId).pipe(\n mergeMap((categorySubCategoriesMap) => (categorySubCategoriesMap.size > 0 ? categorySubCategoriesMap.values() : of(undefined))),\n map((subCategories) => ({ id: categoryId, subCategories })),\n ),\n ),\n );\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 from(Id64.iterable(props.categoryIds)).pipe(\n mergeMap((categoryId) =>\n this.#props.idsCache.getCategoriesElementModels(categoryId).pipe(\n mergeMap((categoryModelsMap) => {\n const models = categoryModelsMap.get(categoryId);\n if (!models) {\n return of({ id: categoryId, subModels: undefined });\n }\n return from(models).pipe(\n mergeMap((modelId) => this.#props.idsCache.getCategoriesModeledElements(modelId, categoryId)),\n map((subModels) => ({ id: categoryId, subModels })),\n );\n }),\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 filteredPaths?: HierarchyFilteringPath[];\n hierarchyConfig: CategoriesTreeHierarchyConfiguration;\n}) {\n return new HierarchyVisibilityHandlerImpl<CategoriesTreeFilterTargets>({\n getFilteredTree: (): undefined | Promise<FilteredTree<CategoriesTreeFilterTargets>> => {\n if (!props.filteredPaths) {\n return undefined;\n }\n const { categoryClass, elementClass, modelClass } = getClassesByView(props.viewport.viewType === \"2d\" ? \"2d\" : \"3d\");\n return createFilteredCategoriesTree({\n idsCache: props.idsCache,\n filteringPaths: props.filteredPaths,\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: \"Test\",\n });\n}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseVisibilityHelper } from "../../../common/internal/visibility/BaseVisibilityHelper.js";
|
|
2
|
+
import type { Observable } from "rxjs";
|
|
3
|
+
import type { Id64Arg, Id64String } from "@itwin/core-bentley";
|
|
4
|
+
import type { ElementId, ModelId } from "../../../common/internal/Types.js";
|
|
5
|
+
import type { BaseVisibilityHelperProps } from "../../../common/internal/visibility/BaseVisibilityHelper.js";
|
|
6
|
+
import type { VisibilityStatus } from "../../../common/UseHierarchyVisibility.js";
|
|
7
|
+
import type { CategoriesTreeHierarchyConfiguration } from "../../CategoriesTreeDefinition.js";
|
|
8
|
+
import type { CategoriesTreeIdsCache } from "../CategoriesTreeIdsCache.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export type CategoriesTreeVisibilityHelperProps = BaseVisibilityHelperProps & {
|
|
11
|
+
idsCache: CategoriesTreeIdsCache;
|
|
12
|
+
hierarchyConfig: CategoriesTreeHierarchyConfiguration;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Visibility status helper for categories tree.
|
|
16
|
+
*
|
|
17
|
+
* It extends base visibility status helper and provides methods to get and change visibility status of definition containers and grouped elements.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare class CategoriesTreeVisibilityHelper extends BaseVisibilityHelper {
|
|
21
|
+
#private;
|
|
22
|
+
constructor(props: CategoriesTreeVisibilityHelperProps);
|
|
23
|
+
/**
|
|
24
|
+
* Gets visibility status of definition containers.
|
|
25
|
+
*
|
|
26
|
+
* Determines visibility status by checking visibility status of related categories.
|
|
27
|
+
*/
|
|
28
|
+
getDefinitionContainersVisibilityStatus(props: {
|
|
29
|
+
definitionContainerIds: Id64Arg;
|
|
30
|
+
}): Observable<VisibilityStatus>;
|
|
31
|
+
/** Gets grouped elements visibility status. */
|
|
32
|
+
getGroupedElementsVisibilityStatus(props: {
|
|
33
|
+
modelElementsMap: Map<ModelId, Set<ElementId>>;
|
|
34
|
+
categoryId: Id64String;
|
|
35
|
+
}): Observable<VisibilityStatus>;
|
|
36
|
+
/**
|
|
37
|
+
* Changes visibility status of definition containers.
|
|
38
|
+
*
|
|
39
|
+
* Does this by changing visibility status of related categories.
|
|
40
|
+
*/
|
|
41
|
+
changeDefinitionContainersVisibilityStatus(props: {
|
|
42
|
+
definitionContainerIds: Id64Arg;
|
|
43
|
+
on: boolean;
|
|
44
|
+
}): Observable<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Changes visibility status of sub-categories.
|
|
47
|
+
*
|
|
48
|
+
* Also, enables parent categories if `on` is true.
|
|
49
|
+
*/
|
|
50
|
+
changeSubCategoriesVisibilityStatus(props: {
|
|
51
|
+
categoryId: Id64String;
|
|
52
|
+
subCategoryIds: Id64Arg;
|
|
53
|
+
on: boolean;
|
|
54
|
+
}): Observable<void>;
|
|
55
|
+
/** Changes grouped elements visibility status. */
|
|
56
|
+
changeGroupedElementsVisibilityStatus(props: {
|
|
57
|
+
modelElementsMap: Map<ModelId, Set<ElementId>>;
|
|
58
|
+
categoryId: Id64String;
|
|
59
|
+
on: boolean;
|
|
60
|
+
}): Observable<void>;
|
|
61
|
+
/** Turns on visibility status of models (that are not yet turned on) that are related to categories. */
|
|
62
|
+
private enableCategoriesElementModelsVisibilityStatus;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=CategoriesTreeVisibilityHelper.d.ts.map
|
|
@@ -0,0 +1,94 @@
|
|
|
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 { concat, EMPTY, from, map, mergeMap, reduce } from "rxjs";
|
|
6
|
+
import { BaseVisibilityHelper } from "../../../common/internal/visibility/BaseVisibilityHelper.js";
|
|
7
|
+
import { enableCategoryDisplay, enableSubCategoryDisplay, mergeVisibilityStatuses } from "../../../common/internal/VisibilityUtils.js";
|
|
8
|
+
/**
|
|
9
|
+
* Visibility status helper for categories tree.
|
|
10
|
+
*
|
|
11
|
+
* It extends base visibility status helper and provides methods to get and change visibility status of definition containers and grouped elements.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export class CategoriesTreeVisibilityHelper extends BaseVisibilityHelper {
|
|
15
|
+
#props;
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.#props = props;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Gets visibility status of definition containers.
|
|
22
|
+
*
|
|
23
|
+
* Determines visibility status by checking visibility status of related categories.
|
|
24
|
+
*/
|
|
25
|
+
getDefinitionContainersVisibilityStatus(props) {
|
|
26
|
+
return this.#props.idsCache
|
|
27
|
+
.getAllContainedCategories({
|
|
28
|
+
definitionContainerIds: props.definitionContainerIds,
|
|
29
|
+
includeEmptyCategories: this.#props.hierarchyConfig.showEmptyCategories,
|
|
30
|
+
})
|
|
31
|
+
.pipe(mergeMap((categoryIds) => this.getCategoriesVisibilityStatus({
|
|
32
|
+
categoryIds,
|
|
33
|
+
modelId: undefined,
|
|
34
|
+
type: this.#props.viewport.viewType === "2d" ? "DrawingCategory" : "SpatialCategory",
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
/** Gets grouped elements visibility status. */
|
|
38
|
+
getGroupedElementsVisibilityStatus(props) {
|
|
39
|
+
const { modelElementsMap, categoryId } = props;
|
|
40
|
+
return from(modelElementsMap).pipe(mergeMap(([modelId, elementIds]) => this.getElementsVisibilityStatus({
|
|
41
|
+
elementIds,
|
|
42
|
+
modelId,
|
|
43
|
+
categoryId,
|
|
44
|
+
type: this.#props.viewport.viewType === "2d" ? "GeometricElement2d" : "GeometricElement3d",
|
|
45
|
+
})), mergeVisibilityStatuses);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Changes visibility status of definition containers.
|
|
49
|
+
*
|
|
50
|
+
* Does this by changing visibility status of related categories.
|
|
51
|
+
*/
|
|
52
|
+
changeDefinitionContainersVisibilityStatus(props) {
|
|
53
|
+
return this.#props.idsCache
|
|
54
|
+
.getAllContainedCategories({
|
|
55
|
+
definitionContainerIds: props.definitionContainerIds,
|
|
56
|
+
includeEmptyCategories: this.#props.hierarchyConfig.showEmptyCategories,
|
|
57
|
+
})
|
|
58
|
+
.pipe(mergeMap((categoryIds) => this.changeCategoriesVisibilityStatus({ categoryIds, modelId: undefined, on: props.on })));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Changes visibility status of sub-categories.
|
|
62
|
+
*
|
|
63
|
+
* Also, enables parent categories if `on` is true.
|
|
64
|
+
*/
|
|
65
|
+
changeSubCategoriesVisibilityStatus(props) {
|
|
66
|
+
return concat(
|
|
67
|
+
// 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) => enableSubCategoryDisplay(this.#props.viewport, subCategoryId, props.on))));
|
|
71
|
+
}
|
|
72
|
+
/** Changes grouped elements visibility status. */
|
|
73
|
+
changeGroupedElementsVisibilityStatus(props) {
|
|
74
|
+
return from(props.modelElementsMap).pipe(mergeMap(([modelId, elementIds]) => {
|
|
75
|
+
return this.changeElementsVisibilityStatus({ modelId, elementIds, categoryId: props.categoryId, on: props.on });
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
/** Turns on visibility status of models (that are not yet turned on) that are related to categories. */
|
|
79
|
+
enableCategoriesElementModelsVisibilityStatus(categoryIds) {
|
|
80
|
+
return this.#props.idsCache.getCategoriesElementModels(categoryIds, true).pipe(mergeMap((categoriesModelsMap) => categoriesModelsMap.values()), reduce((acc, modelIds) => {
|
|
81
|
+
modelIds.forEach((modelId) => {
|
|
82
|
+
if (!this.#props.viewport.viewsModel(modelId)) {
|
|
83
|
+
acc.add(modelId);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return acc;
|
|
87
|
+
}, new Set()), map((hiddenModels) => {
|
|
88
|
+
if (hiddenModels.size > 0) {
|
|
89
|
+
this.#props.viewport.changeModelDisplay({ modelIds: hiddenModels, display: true });
|
|
90
|
+
}
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=CategoriesTreeVisibilityHelper.js.map
|
|
@@ -0,0 +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,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAgBvI;;;;;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,CAA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C,mBAAmB,CAAC,MAAM,EAAE,CAAC,EAC/D,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;YACvB,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC3B,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, enableSubCategoryDisplay, 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) => enableSubCategoryDisplay(this.#props.viewport, subCategoryId, 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 mergeMap((categoriesModelsMap) => categoriesModelsMap.values()),\n reduce((acc, modelIds) => {\n modelIds.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"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Id64Set, Id64String } from "@itwin/core-bentley";
|
|
2
|
+
import type { HierarchyFilteringPath } from "@itwin/presentation-hierarchies";
|
|
3
|
+
import type { ECClassHierarchyInspector } from "@itwin/presentation-shared";
|
|
4
|
+
import type { ElementId } from "../../../common/internal/Types.js";
|
|
5
|
+
import type { FilteredTree } from "../../../common/internal/visibility/BaseFilteredTree.js";
|
|
6
|
+
import type { CategoriesTreeIdsCache } from "../CategoriesTreeIdsCache.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export interface CategoriesTreeFilterTargets {
|
|
9
|
+
categories?: Array<{
|
|
10
|
+
modelId: Id64String | undefined;
|
|
11
|
+
categoryIds: Id64Set;
|
|
12
|
+
}>;
|
|
13
|
+
elements?: Array<{
|
|
14
|
+
modelId: Id64String;
|
|
15
|
+
categoryId: Id64String;
|
|
16
|
+
elements: Map<ElementId, {
|
|
17
|
+
isFilterTarget: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
}>;
|
|
20
|
+
definitionContainerIds?: Id64Set;
|
|
21
|
+
modelIds?: Id64Set;
|
|
22
|
+
subCategories?: Array<{
|
|
23
|
+
categoryId: Id64String;
|
|
24
|
+
subCategoryIds: Id64Set;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare function createFilteredCategoriesTree(props: {
|
|
29
|
+
imodelAccess: ECClassHierarchyInspector;
|
|
30
|
+
filteringPaths: HierarchyFilteringPath[];
|
|
31
|
+
categoryClassName: string;
|
|
32
|
+
categoryElementClassName: string;
|
|
33
|
+
categoryModelClassName: string;
|
|
34
|
+
idsCache: CategoriesTreeIdsCache;
|
|
35
|
+
}): Promise<FilteredTree<CategoriesTreeFilterTargets>>;
|
|
36
|
+
//# sourceMappingURL=FilteredTree.d.ts.map
|
|
@@ -0,0 +1,219 @@
|
|
|
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_SubCategory } from "../../../common/internal/ClassNameDefinitions.js";
|
|
8
|
+
import { createFilteredTree, FilteredNodesHandler } from "../../../common/internal/visibility/BaseFilteredTree.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export async function createFilteredCategoriesTree(props) {
|
|
11
|
+
const { imodelAccess, filteringPaths, categoryClassName, categoryElementClassName, categoryModelClassName, idsCache } = props;
|
|
12
|
+
return createFilteredTree({
|
|
13
|
+
filteredNodesHandler: new CategoriesTreeFilteredNodesHandler({
|
|
14
|
+
idsCache,
|
|
15
|
+
imodelAccess,
|
|
16
|
+
categoryClassName,
|
|
17
|
+
categoryElementClassName,
|
|
18
|
+
categoryModelClassName,
|
|
19
|
+
}),
|
|
20
|
+
filteringPaths,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
class CategoriesTreeFilteredNodesHandler extends FilteredNodesHandler {
|
|
24
|
+
#props;
|
|
25
|
+
constructor(props) {
|
|
26
|
+
super();
|
|
27
|
+
this.#props = props;
|
|
28
|
+
}
|
|
29
|
+
async getProcessedFilteredNodes() {
|
|
30
|
+
const filteredTemporaryElements = new Map();
|
|
31
|
+
const result = {
|
|
32
|
+
filteredElements: new Map(),
|
|
33
|
+
};
|
|
34
|
+
this.filteredNodesArr.forEach((node) => {
|
|
35
|
+
if (node.type === "element") {
|
|
36
|
+
filteredTemporaryElements.set(node.id, node);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const filteredElementsModels = await firstValueFrom(this.#props.idsCache.getFilteredElementsModels([...filteredTemporaryElements.keys()]));
|
|
40
|
+
filteredTemporaryElements.forEach((element, id) => {
|
|
41
|
+
const modelId = filteredElementsModels.get(element.id);
|
|
42
|
+
assert(modelId !== undefined);
|
|
43
|
+
result.filteredElements.set(id, { ...element, modelId });
|
|
44
|
+
});
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
convertNodesToFilterTargets(filteredNodes, processedFilteredNodes) {
|
|
48
|
+
const filterTargets = {};
|
|
49
|
+
filteredNodes.forEach((filteredNode) => this.collectFilterTargets(filterTargets, filteredNode, processedFilteredNodes));
|
|
50
|
+
return this.convertInternalFilterTargets(filterTargets);
|
|
51
|
+
}
|
|
52
|
+
convertInternalFilterTargets(filterTargets) {
|
|
53
|
+
if (!filterTargets.categories &&
|
|
54
|
+
!filterTargets.definitionContainerIds &&
|
|
55
|
+
!filterTargets.elements &&
|
|
56
|
+
!filterTargets.modelIds &&
|
|
57
|
+
!filterTargets.subCategories) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
categories: filterTargets.categories
|
|
62
|
+
? [...filterTargets.categories.entries()].map(([modelId, categoryIds]) => {
|
|
63
|
+
return { modelId, categoryIds };
|
|
64
|
+
})
|
|
65
|
+
: undefined,
|
|
66
|
+
elements: filterTargets.elements
|
|
67
|
+
? [...filterTargets.elements.entries()].map(([modelCategoryKey, elements]) => {
|
|
68
|
+
const { modelId, categoryId } = this.parseModelCategoryKey(modelCategoryKey);
|
|
69
|
+
return { modelId, categoryId, elements };
|
|
70
|
+
})
|
|
71
|
+
: undefined,
|
|
72
|
+
definitionContainerIds: filterTargets.definitionContainerIds,
|
|
73
|
+
modelIds: filterTargets.modelIds,
|
|
74
|
+
subCategories: filterTargets.subCategories
|
|
75
|
+
? [...filterTargets.subCategories.entries()].map(([categoryId, subCategoryIds]) => {
|
|
76
|
+
return { categoryId, subCategoryIds };
|
|
77
|
+
})
|
|
78
|
+
: undefined,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
collectFilterTargets(changeTargets, node, processedFilteredNodes) {
|
|
82
|
+
const filteredNode = node.type !== "element" ? node : processedFilteredNodes.filteredElements.get(node.id);
|
|
83
|
+
assert(filteredNode !== undefined);
|
|
84
|
+
if (filteredNode.isFilterTarget) {
|
|
85
|
+
this.addTarget(changeTargets, filteredNode);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (filteredNode.type === "element") {
|
|
89
|
+
// need to add parent ids as filter target will be an element
|
|
90
|
+
this.addTarget(changeTargets, filteredNode);
|
|
91
|
+
}
|
|
92
|
+
if (!node.children) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
for (const child of node.children.values()) {
|
|
96
|
+
this.collectFilterTargets(changeTargets, child, processedFilteredNodes);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
addTarget(filterTargets, node) {
|
|
100
|
+
switch (node.type) {
|
|
101
|
+
case "definitionContainer":
|
|
102
|
+
(filterTargets.definitionContainerIds ??= new Set()).add(node.id);
|
|
103
|
+
return;
|
|
104
|
+
case "model":
|
|
105
|
+
(filterTargets.modelIds ??= new Set()).add(node.id);
|
|
106
|
+
return;
|
|
107
|
+
case "subCategory":
|
|
108
|
+
const subCategories = (filterTargets.subCategories ??= new Map()).get(node.categoryId);
|
|
109
|
+
if (subCategories) {
|
|
110
|
+
subCategories.add(node.id);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
filterTargets.subCategories.set(node.categoryId, new Set([node.id]));
|
|
114
|
+
return;
|
|
115
|
+
case "category":
|
|
116
|
+
const categories = (filterTargets.categories ??= new Map()).get(node.modelId);
|
|
117
|
+
if (!categories) {
|
|
118
|
+
categories.add(node.id);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
filterTargets.categories.set(node.modelId, new Set([node.id]));
|
|
122
|
+
return;
|
|
123
|
+
case "element":
|
|
124
|
+
const modelCategoryKey = this.createModelCategoryKey(node.modelId, node.categoryId);
|
|
125
|
+
const elements = (filterTargets.elements ??= new Map()).get(modelCategoryKey);
|
|
126
|
+
if (elements) {
|
|
127
|
+
elements.set(node.id, { isFilterTarget: node.isFilterTarget });
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
filterTargets.elements.set(modelCategoryKey, new Map([[node.id, { isFilterTarget: node.isFilterTarget }]]));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
createModelCategoryKey(modelId, categoryId) {
|
|
135
|
+
return `${modelId}-${categoryId}`;
|
|
136
|
+
}
|
|
137
|
+
parseModelCategoryKey(key) {
|
|
138
|
+
const [modelId, categoryId] = key.split("-");
|
|
139
|
+
return { modelId, categoryId };
|
|
140
|
+
}
|
|
141
|
+
createFilteredTreeNode({ type, id, isFilterTarget, parent, }) {
|
|
142
|
+
if (type === "definitionContainer") {
|
|
143
|
+
return {
|
|
144
|
+
id,
|
|
145
|
+
isFilterTarget,
|
|
146
|
+
type,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (type === "subCategory") {
|
|
150
|
+
assert("id" in parent);
|
|
151
|
+
return {
|
|
152
|
+
id,
|
|
153
|
+
isFilterTarget,
|
|
154
|
+
type,
|
|
155
|
+
categoryId: parent.id,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (type === "category") {
|
|
159
|
+
if ("type" in parent && parent.type === "model") {
|
|
160
|
+
return {
|
|
161
|
+
id,
|
|
162
|
+
isFilterTarget,
|
|
163
|
+
type,
|
|
164
|
+
modelId: parent.id,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
id,
|
|
169
|
+
isFilterTarget,
|
|
170
|
+
type,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
if (type === "model") {
|
|
174
|
+
assert("id" in parent);
|
|
175
|
+
return {
|
|
176
|
+
id,
|
|
177
|
+
isFilterTarget,
|
|
178
|
+
type,
|
|
179
|
+
categoryId: parent.type === "category" ? parent.id : undefined,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if ("type" in parent) {
|
|
183
|
+
if (parent.type === "category") {
|
|
184
|
+
return {
|
|
185
|
+
id,
|
|
186
|
+
isFilterTarget,
|
|
187
|
+
type,
|
|
188
|
+
categoryId: parent.id,
|
|
189
|
+
modelId: undefined,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
assert(parent.type === "element");
|
|
193
|
+
return {
|
|
194
|
+
id,
|
|
195
|
+
isFilterTarget,
|
|
196
|
+
type,
|
|
197
|
+
categoryId: parent.categoryId,
|
|
198
|
+
modelId: undefined,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
throw new Error("Invalid parent node type");
|
|
202
|
+
}
|
|
203
|
+
async getType(className) {
|
|
204
|
+
if (await this.#props.imodelAccess.classDerivesFrom(className, CLASS_NAME_SubCategory)) {
|
|
205
|
+
return "subCategory";
|
|
206
|
+
}
|
|
207
|
+
if (await this.#props.imodelAccess.classDerivesFrom(className, this.#props.categoryElementClassName)) {
|
|
208
|
+
return "element";
|
|
209
|
+
}
|
|
210
|
+
if (await this.#props.imodelAccess.classDerivesFrom(className, this.#props.categoryClassName)) {
|
|
211
|
+
return "category";
|
|
212
|
+
}
|
|
213
|
+
if (await this.#props.imodelAccess.classDerivesFrom(className, this.#props.categoryModelClassName)) {
|
|
214
|
+
return "model";
|
|
215
|
+
}
|
|
216
|
+
return "definitionContainer";
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=FilteredTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilteredTree.js","sourceRoot":"","sources":["../../../../../../../../src/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAkEnH,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,4BAA4B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C,gBAAgB,CAAC,SAAS,EAAE,sBAAsB,CAAC,EAAE,CAAC;YACvF,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,EAAE,CAAC;YACrG,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC9F,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,EAAE,CAAC;YACnG,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,OAAO,qBAAqB,CAAC;IAC/B,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_SubCategory } from \"../../../common/internal/ClassNameDefinitions.js\";\nimport { createFilteredTree, FilteredNodesHandler } from \"../../../common/internal/visibility/BaseFilteredTree.js\";\n\nimport type { Id64Set, Id64String } from \"@itwin/core-bentley\";\nimport type { HierarchyFilteringPath } from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector } from \"@itwin/presentation-shared\";\nimport type { CategoryId, ElementId, ModelId, SubCategoryId } from \"../../../common/internal/Types.js\";\nimport type {\n BaseFilteredTreeNode,\n FilteredTree,\n FilteredTreeNodeChildren,\n FilteredTreeRootNode,\n} from \"../../../common/internal/visibility/BaseFilteredTree.js\";\nimport type { CategoriesTreeIdsCache } from \"../CategoriesTreeIdsCache.js\";\n\n/** @internal */\nexport interface CategoriesTreeFilterTargets {\n categories?: Array<{ modelId: Id64String | undefined; categoryIds: Id64Set }>;\n elements?: Array<{ modelId: Id64String; categoryId: Id64String; elements: Map<ElementId, { isFilterTarget: boolean }> }>;\n definitionContainerIds?: Id64Set;\n modelIds?: Id64Set;\n subCategories?: Array<{ categoryId: Id64String; subCategoryIds: Id64Set }>;\n}\n\ninterface CategoryFilteredTreeNode extends BaseFilteredTreeNode<CategoryFilteredTreeNode> {\n type: \"category\";\n modelId?: Id64String;\n}\n\ninterface ModelFilteredTreeNode extends BaseFilteredTreeNode<ModelFilteredTreeNode> {\n type: \"model\";\n categoryId?: Id64String;\n}\ninterface SubCategoryFilteredTreeNode extends BaseFilteredTreeNode<SubCategoryFilteredTreeNode> {\n type: \"subCategory\";\n categoryId: Id64String;\n}\n\ninterface DefinitionContainerFilteredTreeNode extends BaseFilteredTreeNode<DefinitionContainerFilteredTreeNode> {\n type: \"definitionContainer\";\n}\n\ninterface ElementFilteredTreeNode extends BaseFilteredTreeNode<ElementFilteredTreeNode> {\n type: \"element\";\n categoryId: Id64String;\n modelId: Id64String;\n}\n\ntype FilteredTreeNode =\n | DefinitionContainerFilteredTreeNode\n | SubCategoryFilteredTreeNode\n | CategoryFilteredTreeNode\n | ElementFilteredTreeNode\n | ModelFilteredTreeNode;\n\ntype TemporaryElementFilteredNode = Omit<ElementFilteredTreeNode, \"modelId\" | \"children\"> & {\n modelId: string | undefined;\n children?: FilteredTreeNodeChildren<TemporaryElementFilteredNode>;\n};\n\ntype TemporaryFilteredTreeNode =\n | DefinitionContainerFilteredTreeNode\n | SubCategoryFilteredTreeNode\n | CategoryFilteredTreeNode\n | TemporaryElementFilteredNode\n | ModelFilteredTreeNode;\n\n/** @internal */\nexport async function createFilteredCategoriesTree(props: {\n imodelAccess: ECClassHierarchyInspector;\n filteringPaths: HierarchyFilteringPath[];\n categoryClassName: string;\n categoryElementClassName: string;\n categoryModelClassName: string;\n idsCache: CategoriesTreeIdsCache;\n}): Promise<FilteredTree<CategoriesTreeFilterTargets>> {\n const { imodelAccess, filteringPaths, categoryClassName, categoryElementClassName, categoryModelClassName, idsCache } = props;\n return createFilteredTree({\n filteredNodesHandler: new CategoriesTreeFilteredNodesHandler({\n idsCache,\n imodelAccess,\n categoryClassName,\n categoryElementClassName,\n categoryModelClassName,\n }),\n filteringPaths,\n });\n}\n\ninterface FilterTargetsInternal {\n elements?: Map<ModelCategoryKey, Map<ElementId, { isFilterTarget: boolean }>>;\n categories?: Map<ModelId | undefined, Set<CategoryId>>;\n definitionContainerIds?: Id64Set;\n modelIds?: Id64Set;\n subCategories?: Map<CategoryId, Set<SubCategoryId>>;\n}\n\ninterface CategoriesTreeFilteredNodesHandlerProps {\n idsCache: CategoriesTreeIdsCache;\n imodelAccess: ECClassHierarchyInspector;\n categoryClassName: string;\n categoryElementClassName: string;\n categoryModelClassName: string;\n}\n\ntype ModelCategoryKey = `${ModelId}-${CategoryId}`;\n\ninterface ProcessedFilteredNodes {\n filteredElements: Map<Id64String, Omit<ElementFilteredTreeNode, \"children\">>;\n}\n\nclass CategoriesTreeFilteredNodesHandler extends FilteredNodesHandler<ProcessedFilteredNodes, CategoriesTreeFilterTargets, TemporaryFilteredTreeNode> {\n readonly #props: CategoriesTreeFilteredNodesHandlerProps;\n constructor(props: CategoriesTreeFilteredNodesHandlerProps) {\n super();\n this.#props = props;\n }\n\n public async getProcessedFilteredNodes(): Promise<ProcessedFilteredNodes> {\n const filteredTemporaryElements = new Map<Id64String, Omit<TemporaryElementFilteredNode, \"children\">>();\n const result: ProcessedFilteredNodes = {\n filteredElements: new Map(),\n };\n this.filteredNodesArr.forEach((node) => {\n if (node.type === \"element\") {\n filteredTemporaryElements.set(node.id, node);\n }\n });\n\n const filteredElementsModels = await firstValueFrom(this.#props.idsCache.getFilteredElementsModels([...filteredTemporaryElements.keys()]));\n filteredTemporaryElements.forEach((element, id) => {\n const modelId = filteredElementsModels.get(element.id);\n assert(modelId !== undefined);\n result.filteredElements.set(id, { ...element, modelId });\n });\n return result;\n }\n\n public convertNodesToFilterTargets(\n filteredNodes: TemporaryFilteredTreeNode[],\n processedFilteredNodes: ProcessedFilteredNodes,\n ): CategoriesTreeFilterTargets | undefined {\n const filterTargets: FilterTargetsInternal = {};\n\n filteredNodes.forEach((filteredNode) => this.collectFilterTargets(filterTargets, filteredNode, processedFilteredNodes));\n\n return this.convertInternalFilterTargets(filterTargets);\n }\n\n private convertInternalFilterTargets(filterTargets: FilterTargetsInternal): CategoriesTreeFilterTargets | undefined {\n if (\n !filterTargets.categories &&\n !filterTargets.definitionContainerIds &&\n !filterTargets.elements &&\n !filterTargets.modelIds &&\n !filterTargets.subCategories\n ) {\n return undefined;\n }\n return {\n categories: filterTargets.categories\n ? [...filterTargets.categories.entries()].map(([modelId, categoryIds]) => {\n return { modelId, categoryIds };\n })\n : undefined,\n elements: filterTargets.elements\n ? [...filterTargets.elements.entries()].map(([modelCategoryKey, elements]) => {\n const { modelId, categoryId } = this.parseModelCategoryKey(modelCategoryKey);\n return { modelId, categoryId, elements };\n })\n : undefined,\n definitionContainerIds: filterTargets.definitionContainerIds,\n modelIds: filterTargets.modelIds,\n subCategories: filterTargets.subCategories\n ? [...filterTargets.subCategories.entries()].map(([categoryId, subCategoryIds]) => {\n return { categoryId, subCategoryIds };\n })\n : undefined,\n };\n }\n\n private collectFilterTargets(changeTargets: FilterTargetsInternal, node: TemporaryFilteredTreeNode, processedFilteredNodes: ProcessedFilteredNodes) {\n const filteredNode = node.type !== \"element\" ? node : processedFilteredNodes.filteredElements.get(node.id);\n assert(filteredNode !== undefined);\n if (filteredNode.isFilterTarget) {\n this.addTarget(changeTargets, filteredNode);\n return;\n }\n\n if (filteredNode.type === \"element\") {\n // need to add parent ids as filter target will be an element\n this.addTarget(changeTargets, filteredNode);\n }\n\n if (!node.children) {\n return;\n }\n\n for (const child of node.children.values()) {\n this.collectFilterTargets(changeTargets, child, processedFilteredNodes);\n }\n }\n\n private addTarget(filterTargets: FilterTargetsInternal, node: FilteredTreeNode) {\n switch (node.type) {\n case \"definitionContainer\":\n (filterTargets.definitionContainerIds ??= new Set()).add(node.id);\n return;\n case \"model\":\n (filterTargets.modelIds ??= new Set()).add(node.id);\n return;\n case \"subCategory\":\n const subCategories = (filterTargets.subCategories ??= new Map()).get(node.categoryId);\n if (subCategories) {\n subCategories.add(node.id);\n return;\n }\n filterTargets.subCategories.set(node.categoryId, new Set([node.id]));\n return;\n case \"category\":\n const categories = (filterTargets.categories ??= new Map()).get(node.modelId);\n if (!categories) {\n categories.add(node.id);\n return;\n }\n filterTargets.categories.set(node.modelId, new Set([node.id]));\n return;\n case \"element\":\n const modelCategoryKey = this.createModelCategoryKey(node.modelId, node.categoryId);\n const elements = (filterTargets.elements ??= new Map()).get(modelCategoryKey);\n if (elements) {\n elements.set(node.id, { isFilterTarget: node.isFilterTarget });\n } else {\n filterTargets.elements.set(modelCategoryKey, new Map([[node.id, { isFilterTarget: node.isFilterTarget }]]));\n }\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 createFilteredTreeNode({\n type,\n id,\n isFilterTarget,\n parent,\n }: {\n type: FilteredTreeNode[\"type\"];\n id: Id64String;\n isFilterTarget: boolean;\n parent: TemporaryFilteredTreeNode | FilteredTreeRootNode<TemporaryFilteredTreeNode>;\n }): TemporaryFilteredTreeNode {\n if (type === \"definitionContainer\") {\n return {\n id,\n isFilterTarget,\n type,\n };\n }\n if (type === \"subCategory\") {\n assert(\"id\" in parent);\n return {\n id,\n isFilterTarget,\n type,\n categoryId: parent.id,\n };\n }\n if (type === \"category\") {\n if (\"type\" in parent && parent.type === \"model\") {\n return {\n id,\n isFilterTarget,\n type,\n modelId: parent.id,\n };\n }\n return {\n id,\n isFilterTarget,\n type,\n };\n }\n if (type === \"model\") {\n assert(\"id\" in parent);\n return {\n id,\n isFilterTarget,\n type,\n categoryId: parent.type === \"category\" ? parent.id : undefined,\n };\n }\n\n if (\"type\" in parent) {\n if (parent.type === \"category\") {\n return {\n id,\n isFilterTarget,\n type,\n categoryId: parent.id,\n modelId: undefined,\n };\n }\n assert(parent.type === \"element\");\n return {\n id,\n isFilterTarget,\n type,\n categoryId: parent.categoryId,\n modelId: undefined,\n };\n }\n\n throw new Error(\"Invalid parent node type\");\n }\n\n public async getType(className: string): Promise<TemporaryFilteredTreeNode[\"type\"]> {\n if (await this.#props.imodelAccess.classDerivesFrom(className, CLASS_NAME_SubCategory)) {\n return \"subCategory\";\n }\n if (await this.#props.imodelAccess.classDerivesFrom(className, this.#props.categoryElementClassName)) {\n return \"element\";\n }\n if (await this.#props.imodelAccess.classDerivesFrom(className, this.#props.categoryClassName)) {\n return \"category\";\n }\n if (await this.#props.imodelAccess.classDerivesFrom(className, this.#props.categoryModelClassName)) {\n return \"model\";\n }\n return \"definitionContainer\";\n }\n}\n"]}
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js";
|
|
2
|
+
import type { VisibilityTreeRendererProps } from "../common/components/VisibilityTreeRenderer.js";
|
|
3
|
+
import type { UseClassificationsTreeProps } from "./UseClassificationsTree.js";
|
|
4
|
+
/** @alpha */
|
|
5
|
+
export type ClassificationsTreeProps = Pick<VisibilityTreeProps, "imodel" | "selectionStorage" | "selectionMode" | "emptyTreeContent"> & Pick<VisibilityTreeRendererProps, "getInlineActions" | "getMenuActions" | "getContextMenuActions" | "getDecorations" | "getEditingProps" | "treeLabel"> & UseClassificationsTreeProps & {
|
|
6
|
+
hierarchyLevelConfig?: {
|
|
7
|
+
sizeLimit?: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
/** @alpha */
|
|
11
|
+
export declare function ClassificationsTree({ imodel, selectionStorage, activeView, hierarchyConfig, hierarchyLevelConfig, selectionMode, emptyTreeContent, getDecorations, getInlineActions, getMenuActions, getContextMenuActions, getEditingProps, filter, treeLabel, }: ClassificationsTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ClassificationsTree.d.ts.map
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import { VisibilityTree } from "../common/components/VisibilityTree.js";
|
|
7
|
+
import { VisibilityTreeRenderer } from "../common/components/VisibilityTreeRenderer.js";
|
|
8
|
+
import { useClassificationsTree } from "./UseClassificationsTree.js";
|
|
9
|
+
/** @alpha */
|
|
10
|
+
export function ClassificationsTree({ imodel, selectionStorage, activeView, hierarchyConfig, hierarchyLevelConfig, selectionMode, emptyTreeContent, getDecorations, getInlineActions, getMenuActions, getContextMenuActions, getEditingProps, filter, treeLabel, }) {
|
|
11
|
+
const { classificationsTreeProps, rendererProps } = useClassificationsTree({
|
|
12
|
+
activeView,
|
|
13
|
+
hierarchyConfig,
|
|
14
|
+
emptyTreeContent,
|
|
15
|
+
filter,
|
|
16
|
+
});
|
|
17
|
+
return (_jsx(VisibilityTree, { ...classificationsTreeProps, imodel: imodel, selectionStorage: selectionStorage, hierarchyLevelSizeLimit: hierarchyLevelConfig?.sizeLimit, selectionMode: selectionMode ?? "none", treeRenderer: (treeProps) => (_jsx(VisibilityTreeRenderer, { ...treeProps, ...rendererProps, treeLabel: treeLabel, getEditingProps: getEditingProps, getInlineActions: getInlineActions, getMenuActions: getMenuActions, getContextMenuActions: getContextMenuActions, getDecorations: getDecorations ?? rendererProps.getDecorations })) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ClassificationsTree.js.map
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassificationsTree.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAerE,aAAa;AACb,MAAM,UAAU,mBAAmB,CAAC,EAClC,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,MAAM,EACN,SAAS,GACgB;IACzB,MAAM,EAAE,wBAAwB,EAAE,aAAa,EAAE,GAAG,sBAAsB,CAAC;QACzE,UAAU;QACV,eAAe;QACf,gBAAgB;QAChB,MAAM;KACP,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,cAAc,OACT,wBAAwB,EAC5B,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,uBAAuB,EAAE,oBAAoB,EAAE,SAAS,EACxD,aAAa,EAAE,aAAa,IAAI,MAAM,EACtC,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,CAC3B,KAAC,sBAAsB,OACjB,SAAS,KACT,aAAa,EACjB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,qBAAqB,EAAE,qBAAqB,EAC5C,cAAc,EAAE,cAAc,IAAI,aAAa,CAAC,cAAc,GAC9D,CACH,GACD,CACH,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 { VisibilityTree } from \"../common/components/VisibilityTree.js\";\nimport { VisibilityTreeRenderer } from \"../common/components/VisibilityTreeRenderer.js\";\nimport { useClassificationsTree } from \"./UseClassificationsTree.js\";\n\nimport type { VisibilityTreeProps } from \"../common/components/VisibilityTree.js\";\nimport type { VisibilityTreeRendererProps } from \"../common/components/VisibilityTreeRenderer.js\";\nimport type { UseClassificationsTreeProps } from \"./UseClassificationsTree.js\";\n\n/** @alpha */\nexport type ClassificationsTreeProps = Pick<VisibilityTreeProps, \"imodel\" | \"selectionStorage\" | \"selectionMode\" | \"emptyTreeContent\"> &\n Pick<VisibilityTreeRendererProps, \"getInlineActions\" | \"getMenuActions\" | \"getContextMenuActions\" | \"getDecorations\" | \"getEditingProps\" | \"treeLabel\"> &\n UseClassificationsTreeProps & {\n hierarchyLevelConfig?: {\n sizeLimit?: number;\n };\n };\n\n/** @alpha */\nexport function ClassificationsTree({\n imodel,\n selectionStorage,\n activeView,\n hierarchyConfig,\n hierarchyLevelConfig,\n selectionMode,\n emptyTreeContent,\n getDecorations,\n getInlineActions,\n getMenuActions,\n getContextMenuActions,\n getEditingProps,\n filter,\n treeLabel,\n}: ClassificationsTreeProps) {\n const { classificationsTreeProps, rendererProps } = useClassificationsTree({\n activeView,\n hierarchyConfig,\n emptyTreeContent,\n filter,\n });\n\n return (\n <VisibilityTree\n {...classificationsTreeProps}\n imodel={imodel}\n selectionStorage={selectionStorage}\n hierarchyLevelSizeLimit={hierarchyLevelConfig?.sizeLimit}\n selectionMode={selectionMode ?? \"none\"}\n treeRenderer={(treeProps) => (\n <VisibilityTreeRenderer\n {...treeProps}\n {...rendererProps}\n treeLabel={treeLabel}\n getEditingProps={getEditingProps}\n getInlineActions={getInlineActions}\n getMenuActions={getMenuActions}\n getContextMenuActions={getContextMenuActions}\n getDecorations={getDecorations ?? rendererProps.getDecorations}\n />\n )}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { IModelConnection } from "@itwin/core-frontend";
|
|
2
|
+
import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js";
|
|
3
|
+
import type { ClassificationsTreeProps } from "./ClassificationsTree.js";
|
|
4
|
+
/** @alpha */
|
|
5
|
+
interface ClassificationsTreeComponentProps extends Pick<ClassificationsTreeProps, "selectionStorage" | "hierarchyLevelConfig" | "selectionMode" | "filter" | "emptyTreeContent" | "getInlineActions" | "getMenuActions" | "getContextMenuActions" | "getDecorations" | "hierarchyConfig" | "getEditingProps" | "treeLabel"> {
|
|
6
|
+
/**
|
|
7
|
+
* Viewport used for visibility controls.
|
|
8
|
+
*
|
|
9
|
+
* When viewport is not provided, `IModelApp.viewManager.selectedView` will be used.
|
|
10
|
+
*/
|
|
11
|
+
viewport?: TreeWidgetViewport;
|
|
12
|
+
onPerformanceMeasured?: (featureId: string, duration: number) => void;
|
|
13
|
+
onFeatureUsed?: (feature: string) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A component that renders `ClassificationsTree` with active iModel and viewport.
|
|
17
|
+
* @alpha
|
|
18
|
+
*/
|
|
19
|
+
export declare const ClassificationsTreeComponent: {
|
|
20
|
+
(props: ClassificationsTreeComponentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
/**
|
|
22
|
+
* Id of the component. May be used when a creating a `TreeDefinition`.
|
|
23
|
+
* @alpha
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
getLabel(): string;
|
|
27
|
+
isSupportedByIModel(imodel: IModelConnection): Promise<boolean>;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=ClassificationsTreeComponent.d.ts.map
|