@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
package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js
CHANGED
|
@@ -2,338 +2,350 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import {
|
|
6
|
-
import { assert } from "@itwin/core-bentley";
|
|
5
|
+
import { defer, filter, forkJoin, from, map, mergeAll, mergeMap, of, reduce, shareReplay, toArray } from "rxjs";
|
|
6
|
+
import { assert, Guid, Id64 } from "@itwin/core-bentley";
|
|
7
7
|
import { IModel } from "@itwin/core-common";
|
|
8
|
-
import {
|
|
8
|
+
import { CLASS_NAME_GeometricModel3d, CLASS_NAME_InformationPartitionElement, CLASS_NAME_Model, CLASS_NAME_SpatialCategory, CLASS_NAME_Subject, } from "../../common/internal/ClassNameDefinitions.js";
|
|
9
|
+
import { ModelCategoryElementsCountCache } from "../../common/internal/ModelCategoryElementsCountCache.js";
|
|
10
|
+
import { pushToMap } from "../../common/internal/Utils.js";
|
|
9
11
|
/** @internal */
|
|
10
12
|
export class ModelsTreeIdsCache {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
#categoryElementCounts;
|
|
14
|
+
#subjectInfos;
|
|
15
|
+
#parentSubjectIds; // the list should contain a subject id if its node should be shown as having children
|
|
16
|
+
#modelInfos;
|
|
17
|
+
#modelWithCategoryModeledElements;
|
|
18
|
+
#modelKeyPaths;
|
|
19
|
+
#subjectKeyPaths;
|
|
20
|
+
#categoryKeyPaths;
|
|
21
|
+
#queryExecutor;
|
|
22
|
+
#hierarchyConfig;
|
|
23
|
+
#componentId;
|
|
24
|
+
#componentName;
|
|
25
|
+
constructor(queryExecutor, hierarchyConfig, componentId) {
|
|
26
|
+
this.#queryExecutor = queryExecutor;
|
|
27
|
+
this.#hierarchyConfig = hierarchyConfig;
|
|
28
|
+
this.#componentId = componentId ?? Guid.createValue();
|
|
29
|
+
this.#componentName = "ModelsTreeIdsCache";
|
|
30
|
+
this.#categoryElementCounts = new ModelCategoryElementsCountCache(this.#queryExecutor, [this.#hierarchyConfig.elementClassSpecification], this.#componentId);
|
|
31
|
+
this.#modelKeyPaths = new Map();
|
|
32
|
+
this.#subjectKeyPaths = new Map();
|
|
33
|
+
this.#categoryKeyPaths = new Map();
|
|
18
34
|
}
|
|
19
35
|
[Symbol.dispose]() {
|
|
20
|
-
this
|
|
36
|
+
this.#categoryElementCounts[Symbol.dispose]();
|
|
21
37
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
38
|
+
querySubjects() {
|
|
39
|
+
return defer(() => {
|
|
40
|
+
const subjectsQuery = `
|
|
41
|
+
SELECT
|
|
42
|
+
s.ECInstanceId id,
|
|
43
|
+
s.Parent.Id parentId,
|
|
44
|
+
(
|
|
45
|
+
SELECT m.ECInstanceId
|
|
46
|
+
FROM ${CLASS_NAME_GeometricModel3d} m
|
|
47
|
+
WHERE m.ECInstanceId = HexToId(json_extract(s.JsonProperties, '$.Subject.Model.TargetPartition'))
|
|
48
|
+
AND NOT m.IsPrivate
|
|
49
|
+
AND EXISTS (SELECT 1 FROM ${this.#hierarchyConfig.elementClassSpecification} WHERE Model.Id = m.ECInstanceId)
|
|
50
|
+
) targetPartitionId,
|
|
51
|
+
CASE
|
|
52
|
+
WHEN (
|
|
53
|
+
json_extract(s.JsonProperties, '$.Subject.Job.Bridge') IS NOT NULL
|
|
54
|
+
OR json_extract(s.JsonProperties, '$.Subject.Model.Type') = 'Hierarchy'
|
|
55
|
+
) THEN 1
|
|
56
|
+
ELSE 0
|
|
57
|
+
END hideInHierarchy
|
|
58
|
+
FROM bis.Subject s
|
|
59
|
+
`;
|
|
60
|
+
return this.#queryExecutor.createQueryReader({ ecsql: subjectsQuery }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/subjects` });
|
|
61
|
+
}).pipe(map((row) => {
|
|
62
|
+
return { id: row.id, parentId: row.parentId, targetPartitionId: row.targetPartitionId, hideInHierarchy: !!row.hideInHierarchy };
|
|
63
|
+
}));
|
|
46
64
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
65
|
+
queryModels() {
|
|
66
|
+
return defer(() => {
|
|
67
|
+
const modelsQuery = `
|
|
68
|
+
SELECT p.ECInstanceId id, p.Parent.Id parentId
|
|
69
|
+
FROM ${CLASS_NAME_InformationPartitionElement} p
|
|
70
|
+
INNER JOIN ${CLASS_NAME_GeometricModel3d} m ON m.ModeledElement.Id = p.ECInstanceId
|
|
71
|
+
WHERE
|
|
72
|
+
NOT m.IsPrivate
|
|
73
|
+
${this.#hierarchyConfig.showEmptyModels ? "" : `AND EXISTS (SELECT 1 FROM ${this.#hierarchyConfig.elementClassSpecification} WHERE Model.Id = m.ECInstanceId)`}
|
|
74
|
+
`;
|
|
75
|
+
return this.#queryExecutor.createQueryReader({ ecsql: modelsQuery }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/models` });
|
|
76
|
+
}).pipe(map((row) => {
|
|
77
|
+
return { id: row.id, parentId: row.parentId };
|
|
78
|
+
}));
|
|
59
79
|
}
|
|
60
|
-
|
|
61
|
-
this
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const result = new Map();
|
|
81
|
-
for await (const model of this.queryModels()) {
|
|
82
|
-
pushToMap(result, model.id, model.parentId);
|
|
80
|
+
getSubjectInfos() {
|
|
81
|
+
this.#subjectInfos ??= forkJoin({
|
|
82
|
+
subjectInfos: this.querySubjects().pipe(reduce((acc, subject) => {
|
|
83
|
+
const subjectInfo = {
|
|
84
|
+
parentSubjectId: subject.parentId,
|
|
85
|
+
hideInHierarchy: subject.hideInHierarchy,
|
|
86
|
+
childSubjectIds: new Set(),
|
|
87
|
+
childModelIds: new Set(),
|
|
88
|
+
};
|
|
89
|
+
if (subject.targetPartitionId) {
|
|
90
|
+
subjectInfo.childModelIds.add(subject.targetPartitionId);
|
|
91
|
+
}
|
|
92
|
+
acc.set(subject.id, subjectInfo);
|
|
93
|
+
return acc;
|
|
94
|
+
}, new Map()), map((subjectInfos) => {
|
|
95
|
+
for (const [subjectId, { parentSubjectId: parentSubjectId }] of subjectInfos.entries()) {
|
|
96
|
+
if (parentSubjectId) {
|
|
97
|
+
const parentSubjectInfo = subjectInfos.get(parentSubjectId);
|
|
98
|
+
assert(!!parentSubjectInfo);
|
|
99
|
+
parentSubjectInfo.childSubjectIds.add(subjectId);
|
|
83
100
|
}
|
|
84
|
-
return result;
|
|
85
|
-
})(),
|
|
86
|
-
]);
|
|
87
|
-
for (const [subjectId, { parentSubject: parentSubjectId }] of subjectInfos.entries()) {
|
|
88
|
-
if (parentSubjectId) {
|
|
89
|
-
const parentSubjectInfo = subjectInfos.get(parentSubjectId);
|
|
90
|
-
assert(!!parentSubjectInfo);
|
|
91
|
-
parentSubjectInfo.childSubjects.add(subjectId);
|
|
92
101
|
}
|
|
93
|
-
|
|
102
|
+
return subjectInfos;
|
|
103
|
+
})),
|
|
104
|
+
targetPartitionSubjects: this.queryModels().pipe(reduce((acc, model) => {
|
|
105
|
+
pushToMap(acc, model.id, model.parentId);
|
|
106
|
+
return acc;
|
|
107
|
+
}, new Map())),
|
|
108
|
+
}).pipe(map(({ subjectInfos, targetPartitionSubjects }) => {
|
|
94
109
|
for (const [partitionId, subjectIds] of targetPartitionSubjects) {
|
|
95
110
|
subjectIds.forEach((subjectId) => {
|
|
96
111
|
const subjectInfo = subjectInfos.get(subjectId);
|
|
97
112
|
assert(!!subjectInfo);
|
|
98
|
-
subjectInfo.
|
|
113
|
+
subjectInfo.childModelIds.add(partitionId);
|
|
99
114
|
});
|
|
100
115
|
}
|
|
101
116
|
return subjectInfos;
|
|
102
|
-
})();
|
|
103
|
-
return this
|
|
117
|
+
}), shareReplay());
|
|
118
|
+
return this.#subjectInfos;
|
|
104
119
|
}
|
|
105
120
|
/** Returns ECInstanceIDs of Subjects that either have direct Model or at least one child Subject with a Model. */
|
|
106
|
-
|
|
107
|
-
this
|
|
108
|
-
const subjectInfos = await this.getSubjectInfos();
|
|
121
|
+
getParentSubjectIds() {
|
|
122
|
+
this.#parentSubjectIds ??= this.getSubjectInfos().pipe(map((subjectInfos) => {
|
|
109
123
|
const parentSubjectIds = new Set();
|
|
110
124
|
subjectInfos.forEach((subjectInfo, subjectId) => {
|
|
111
|
-
if (subjectInfo.
|
|
125
|
+
if (subjectInfo.childModelIds.size > 0) {
|
|
112
126
|
parentSubjectIds.add(subjectId);
|
|
113
|
-
let currParentId = subjectInfo.
|
|
127
|
+
let currParentId = subjectInfo.parentSubjectId;
|
|
114
128
|
while (currParentId) {
|
|
115
129
|
parentSubjectIds.add(currParentId);
|
|
116
|
-
currParentId = subjectInfos.get(currParentId)?.
|
|
130
|
+
currParentId = subjectInfos.get(currParentId)?.parentSubjectId;
|
|
117
131
|
}
|
|
118
132
|
}
|
|
119
133
|
});
|
|
120
134
|
return [...parentSubjectIds];
|
|
121
|
-
})();
|
|
122
|
-
return this
|
|
135
|
+
}), shareReplay());
|
|
136
|
+
return this.#parentSubjectIds;
|
|
123
137
|
}
|
|
124
138
|
/**
|
|
125
139
|
* Returns child subjects of the specified parent subjects as they're displayed in the hierarchy - taking into
|
|
126
140
|
* account `hideInHierarchy` flag.
|
|
127
141
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
getChildSubjectIds(parentSubjectIds) {
|
|
143
|
+
return this.getSubjectInfos().pipe(map((subjectInfos) => {
|
|
144
|
+
const childSubjectIds = new Array();
|
|
145
|
+
for (const subjectId of Id64.iterable(parentSubjectIds)) {
|
|
146
|
+
forEachChildSubject(subjectInfos, subjectId, (childSubjectId, childSubjectInfo) => {
|
|
147
|
+
if (!childSubjectInfo.hideInHierarchy) {
|
|
148
|
+
childSubjectIds.push(childSubjectId);
|
|
149
|
+
return "break";
|
|
150
|
+
}
|
|
151
|
+
return "continue";
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return childSubjectIds;
|
|
155
|
+
}));
|
|
141
156
|
}
|
|
142
157
|
/** Returns ECInstanceIDs of all Models under specific parent Subjects, including their child Subjects, etc. */
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
getSubjectModelIds(subjectIds) {
|
|
159
|
+
return this.getSubjectInfos().pipe(mergeMap((subjectInfos) => {
|
|
160
|
+
const result = new Array();
|
|
161
|
+
const childSubjects = new Array();
|
|
162
|
+
for (const subjectId of Id64.iterable(subjectIds)) {
|
|
163
|
+
const subjectInfo = subjectInfos.get(subjectId);
|
|
164
|
+
if (!subjectInfo) {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
result.push(...subjectInfo.childModelIds);
|
|
168
|
+
childSubjects.push(...subjectInfo.childSubjectIds);
|
|
151
169
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
continue;
|
|
170
|
+
if (childSubjects.length === 0) {
|
|
171
|
+
return of(result);
|
|
155
172
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
173
|
+
return this.getSubjectModelIds(childSubjects).pipe(map((modelsOfChildSubjects) => {
|
|
174
|
+
result.push(...modelsOfChildSubjects);
|
|
175
|
+
return result;
|
|
176
|
+
}));
|
|
177
|
+
}));
|
|
160
178
|
}
|
|
161
179
|
/** Returns ECInstanceIDs of Models under specific parent Subjects as they are displayed in the hierarchy. */
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
180
|
+
getChildSubjectModelIds(parentSubjectIds) {
|
|
181
|
+
return this.getSubjectInfos().pipe(map((subjectInfos) => {
|
|
182
|
+
const hiddenSubjectIds = new Array();
|
|
183
|
+
for (const subjectId of Id64.iterable(parentSubjectIds)) {
|
|
184
|
+
forEachChildSubject(subjectInfos, subjectId, (childSubjectId, childSubjectInfo) => {
|
|
185
|
+
if (childSubjectInfo.hideInHierarchy) {
|
|
186
|
+
hiddenSubjectIds.push(childSubjectId);
|
|
187
|
+
return "continue";
|
|
188
|
+
}
|
|
189
|
+
return "break";
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
const modelIds = new Array();
|
|
193
|
+
[...parentSubjectIds, ...hiddenSubjectIds].forEach((subjectId) => {
|
|
194
|
+
const subjectInfo = subjectInfos.get(subjectId);
|
|
195
|
+
subjectInfo && modelIds.push(...subjectInfo.childModelIds);
|
|
172
196
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
[...parentSubjectIds, ...hiddenSubjectIds].forEach((subjectId) => {
|
|
176
|
-
const subjectInfo = subjectInfos.get(subjectId);
|
|
177
|
-
subjectInfo && modelIds.push(...subjectInfo.childModels);
|
|
178
|
-
});
|
|
179
|
-
return modelIds;
|
|
197
|
+
return modelIds;
|
|
198
|
+
}));
|
|
180
199
|
}
|
|
181
|
-
|
|
182
|
-
let entry = this.
|
|
200
|
+
createSubjectInstanceKeysPath(targetSubjectId) {
|
|
201
|
+
let entry = this.#subjectKeyPaths.get(targetSubjectId);
|
|
183
202
|
if (!entry) {
|
|
184
|
-
entry = (
|
|
185
|
-
const subjectInfos = await this.getSubjectInfos();
|
|
203
|
+
entry = this.getSubjectInfos().pipe(map((subjectInfos) => {
|
|
186
204
|
const result = new Array();
|
|
187
205
|
let currParentId = targetSubjectId;
|
|
188
|
-
while (currParentId
|
|
206
|
+
while (currParentId) {
|
|
207
|
+
if (this.#hierarchyConfig.hideRootSubject && currParentId === IModel.rootSubjectId) {
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
189
210
|
const parentInfo = subjectInfos.get(currParentId);
|
|
190
211
|
if (!parentInfo?.hideInHierarchy) {
|
|
191
|
-
result.push({ className:
|
|
212
|
+
result.push({ className: CLASS_NAME_Subject, id: currParentId });
|
|
192
213
|
}
|
|
193
|
-
currParentId = parentInfo?.
|
|
214
|
+
currParentId = parentInfo?.parentSubjectId;
|
|
194
215
|
}
|
|
195
216
|
return result.reverse();
|
|
196
|
-
})();
|
|
197
|
-
this.
|
|
217
|
+
}), shareReplay());
|
|
218
|
+
this.#subjectKeyPaths.set(targetSubjectId, entry);
|
|
198
219
|
}
|
|
199
220
|
return entry;
|
|
200
221
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
222
|
+
queryModelCategories() {
|
|
223
|
+
return defer(() => {
|
|
224
|
+
const query = `
|
|
225
|
+
SELECT
|
|
226
|
+
this.Model.Id modelId,
|
|
227
|
+
this.Category.Id categoryId,
|
|
228
|
+
m.IsPrivate isModelPrivate,
|
|
229
|
+
MAX(IIF(this.Parent.Id IS NULL, 1, 0)) isRootElementCategory
|
|
230
|
+
FROM ${CLASS_NAME_Model} m
|
|
231
|
+
JOIN ${this.#hierarchyConfig.elementClassSpecification} this ON m.ECInstanceId = this.Model.Id
|
|
232
|
+
GROUP BY modelId, categoryId, isModelPrivate
|
|
233
|
+
`;
|
|
234
|
+
return this.#queryExecutor.createQueryReader({ ecsql: query }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/model-categories` });
|
|
235
|
+
}).pipe(map((row) => {
|
|
236
|
+
return { modelId: row.modelId, categoryId: row.categoryId, isModelPrivate: !!row.isModelPrivate, isRootElementCategory: !!row.isRootElementCategory };
|
|
237
|
+
}));
|
|
210
238
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
239
|
+
queryModeledElements() {
|
|
240
|
+
return defer(() => {
|
|
241
|
+
const query = `
|
|
242
|
+
SELECT
|
|
243
|
+
pe.ECInstanceId modeledElementId,
|
|
244
|
+
pe.Category.Id categoryId,
|
|
245
|
+
pe.Model.Id modelId
|
|
246
|
+
FROM ${CLASS_NAME_Model} m
|
|
247
|
+
JOIN ${this.#hierarchyConfig.elementClassSpecification} pe ON pe.ECInstanceId = m.ModeledElement.Id
|
|
248
|
+
WHERE
|
|
249
|
+
m.IsPrivate = false
|
|
250
|
+
AND m.ECInstanceId IN (SELECT Model.Id FROM ${this.#hierarchyConfig.elementClassSpecification})
|
|
217
251
|
`;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
252
|
+
return this.#queryExecutor.createQueryReader({ ecsql: query }, { rowFormat: "ECSqlPropertyNames", limit: "unbounded", restartToken: `${this.#componentName}/${this.#componentId}/modeled-elements` });
|
|
253
|
+
}).pipe(map((row) => {
|
|
254
|
+
return { modelId: row.modelId, categoryId: row.categoryId, modeledElementId: row.modeledElementId };
|
|
255
|
+
}));
|
|
221
256
|
}
|
|
222
|
-
|
|
223
|
-
this
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return modelInfos;
|
|
250
|
-
})();
|
|
251
|
-
return this._modelInfos;
|
|
257
|
+
getModelWithCategoryModeledElements() {
|
|
258
|
+
this.#modelWithCategoryModeledElements ??= this.queryModeledElements().pipe(reduce((acc, { modelId, categoryId, modeledElementId }) => {
|
|
259
|
+
const key = `${modelId}-${categoryId}`;
|
|
260
|
+
const entry = acc.get(key);
|
|
261
|
+
if (entry === undefined) {
|
|
262
|
+
acc.set(key, new Set([modeledElementId]));
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
entry.add(modeledElementId);
|
|
266
|
+
}
|
|
267
|
+
return acc;
|
|
268
|
+
}, new Map()), shareReplay());
|
|
269
|
+
return this.#modelWithCategoryModeledElements;
|
|
270
|
+
}
|
|
271
|
+
getModelInfos() {
|
|
272
|
+
this.#modelInfos ??= this.queryModelCategories().pipe(reduce((acc, { modelId, categoryId, isModelPrivate, isRootElementCategory }) => {
|
|
273
|
+
const entry = acc.get(modelId);
|
|
274
|
+
if (entry) {
|
|
275
|
+
entry.categories.set(categoryId, { isRootElementCategory });
|
|
276
|
+
entry.isModelPrivate = isModelPrivate;
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
acc.set(modelId, { categories: new Map([[categoryId, { isRootElementCategory }]]), isModelPrivate });
|
|
280
|
+
}
|
|
281
|
+
return acc;
|
|
282
|
+
}, new Map()), shareReplay());
|
|
283
|
+
return this.#modelInfos;
|
|
252
284
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
285
|
+
getAllCategories() {
|
|
286
|
+
return this.getModelInfos().pipe(mergeMap((modelInfos) => modelInfos.values()), mergeMap(({ categories }) => categories.keys()), reduce((acc, categoryId) => {
|
|
287
|
+
acc.add(categoryId);
|
|
288
|
+
return acc;
|
|
289
|
+
}, new Set()));
|
|
257
290
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return modelInfos.get(modelId)?.elementCount ?? 0;
|
|
291
|
+
getModelCategoryIds(modelId) {
|
|
292
|
+
return this.getModelInfos().pipe(mergeMap((modelInfos) => modelInfos.get(modelId)?.categories.keys() ?? []), toArray());
|
|
261
293
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
294
|
+
hasSubModel(elementId) {
|
|
295
|
+
return this.getModelInfos().pipe(map((modelInfos) => {
|
|
296
|
+
const modeledElementInfo = modelInfos.get(elementId);
|
|
297
|
+
if (!modeledElementInfo) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
return !modeledElementInfo.isModelPrivate;
|
|
301
|
+
}));
|
|
302
|
+
}
|
|
303
|
+
getCategoriesModeledElements(modelId, categoryIds) {
|
|
304
|
+
return this.getModelWithCategoryModeledElements().pipe(mergeMap((modelWithCategoryModeledElements) => from(Id64.iterable(categoryIds)).pipe(reduce((acc, categoryId) => {
|
|
305
|
+
const entry = modelWithCategoryModeledElements.get(`${modelId}-${categoryId}`);
|
|
306
|
+
if (entry !== undefined) {
|
|
307
|
+
acc.push(...entry);
|
|
308
|
+
}
|
|
309
|
+
return acc;
|
|
310
|
+
}, new Array()))));
|
|
311
|
+
}
|
|
312
|
+
getCategoriesElementModels(categoryIds) {
|
|
313
|
+
return this.getModelInfos().pipe(mergeMap((modelInfos) => from(Id64.iterable(categoryIds)).pipe(reduce((acc, categoryId) => {
|
|
314
|
+
const entry = new Array();
|
|
315
|
+
for (const [modelId, { categories }] of modelInfos.entries()) {
|
|
316
|
+
if (categories.has(categoryId)) {
|
|
317
|
+
entry.push(modelId);
|
|
273
318
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
return entry;
|
|
319
|
+
}
|
|
320
|
+
acc.set(categoryId, entry);
|
|
321
|
+
return acc;
|
|
322
|
+
}, new Map()))));
|
|
279
323
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
SELECT ECInstanceId, Model.Id, Category.Id
|
|
286
|
-
FROM ${this._hierarchyConfig.elementClassSpecification}
|
|
287
|
-
WHERE
|
|
288
|
-
Parent.Id IS NULL
|
|
289
|
-
AND (
|
|
290
|
-
${input.map(({ modelId, categoryId }) => `Model.Id = ${modelId} AND Category.Id = ${categoryId}`).join(" OR ")}
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
UNION ALL
|
|
294
|
-
|
|
295
|
-
SELECT c.ECInstanceId, p.modelId, p.categoryId
|
|
296
|
-
FROM ${this._hierarchyConfig.elementClassSpecification} c
|
|
297
|
-
JOIN CategoryElements p ON c.Parent.Id = p.id
|
|
298
|
-
)
|
|
299
|
-
`,
|
|
300
|
-
],
|
|
301
|
-
ecsql: `
|
|
302
|
-
SELECT modelId, categoryId, COUNT(id) elementsCount
|
|
303
|
-
FROM CategoryElements
|
|
304
|
-
GROUP BY modelId, categoryId
|
|
305
|
-
`,
|
|
306
|
-
}, { rowFormat: "ECSqlPropertyNames", limit: "unbounded" });
|
|
307
|
-
const result = new Array();
|
|
308
|
-
for await (const row of reader) {
|
|
309
|
-
result.push({ modelId: row.modelId, categoryId: row.categoryId, elementsCount: row.elementsCount });
|
|
324
|
+
createModelInstanceKeyPaths(modelId) {
|
|
325
|
+
let entry = this.#modelKeyPaths.get(modelId);
|
|
326
|
+
if (!entry) {
|
|
327
|
+
entry = this.getSubjectInfos().pipe(mergeMap((subjectInfos) => subjectInfos.entries()), filter(([_, subjectInfo]) => subjectInfo.childModelIds.has(modelId)), mergeMap(([modelSubjectId]) => this.createSubjectInstanceKeysPath(modelSubjectId).pipe(map((path) => [...path, { className: CLASS_NAME_GeometricModel3d, id: modelId }]))), toArray(), shareReplay());
|
|
328
|
+
this.#modelKeyPaths.set(modelId, entry);
|
|
310
329
|
}
|
|
311
|
-
return
|
|
330
|
+
return entry;
|
|
312
331
|
}
|
|
313
|
-
|
|
314
|
-
return this.
|
|
332
|
+
getCategoryElementsCount(modelId, categoryId) {
|
|
333
|
+
return this.#categoryElementCounts.getCategoryElementsCount(modelId, categoryId);
|
|
315
334
|
}
|
|
316
|
-
|
|
317
|
-
let entry = this.
|
|
335
|
+
createCategoryInstanceKeyPaths(categoryId) {
|
|
336
|
+
let entry = this.#categoryKeyPaths.get(categoryId);
|
|
318
337
|
if (!entry) {
|
|
319
|
-
entry = (
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (modelInfo.categories.has(categoryId)) {
|
|
324
|
-
result.add(modelId);
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
const categoryPaths = new Array();
|
|
328
|
-
for (const categoryModelId of [...result]) {
|
|
329
|
-
const modelPaths = await this.createModelInstanceKeyPaths(categoryModelId);
|
|
330
|
-
for (const modelPath of modelPaths) {
|
|
331
|
-
categoryPaths.push([...modelPath, { className: "BisCore.SpatialCategory", id: categoryId }]);
|
|
332
|
-
}
|
|
338
|
+
entry = this.getModelInfos().pipe(mergeMap((modelInfos) => modelInfos.entries()), reduce((acc, [modelId, modelInfo]) => {
|
|
339
|
+
const categoryEntry = modelInfo.categories.get(categoryId);
|
|
340
|
+
if (categoryEntry?.isRootElementCategory) {
|
|
341
|
+
acc.add(modelId);
|
|
333
342
|
}
|
|
334
|
-
return
|
|
335
|
-
})()
|
|
336
|
-
|
|
343
|
+
return acc;
|
|
344
|
+
}, new Set()), mergeMap((categoryModels) => from(categoryModels)), mergeMap((categoryModelId) => this.createModelInstanceKeyPaths(categoryModelId)), mergeAll(), reduce((acc, modelPath) => {
|
|
345
|
+
acc.push([...modelPath, { className: CLASS_NAME_SpatialCategory, id: categoryId }]);
|
|
346
|
+
return acc;
|
|
347
|
+
}, new Array()), shareReplay());
|
|
348
|
+
this.#categoryKeyPaths.set(categoryId, entry);
|
|
337
349
|
}
|
|
338
350
|
return entry;
|
|
339
351
|
}
|
|
@@ -341,7 +353,7 @@ export class ModelsTreeIdsCache {
|
|
|
341
353
|
function forEachChildSubject(subjectInfos, parentSubject, cb) {
|
|
342
354
|
const parentSubjectInfo = typeof parentSubject === "string" ? subjectInfos.get(parentSubject) : parentSubject;
|
|
343
355
|
parentSubjectInfo &&
|
|
344
|
-
parentSubjectInfo.
|
|
356
|
+
parentSubjectInfo.childSubjectIds.forEach((childSubjectId) => {
|
|
345
357
|
const childSubjectInfo = subjectInfos.get(childSubjectId);
|
|
346
358
|
if (cb(childSubjectId, childSubjectInfo) === "break") {
|
|
347
359
|
return;
|
|
@@ -349,34 +361,4 @@ function forEachChildSubject(subjectInfos, parentSubject, cb) {
|
|
|
349
361
|
forEachChildSubject(subjectInfos, childSubjectInfo, cb);
|
|
350
362
|
});
|
|
351
363
|
}
|
|
352
|
-
class ModelCategoryElementsCountCache {
|
|
353
|
-
constructor(_loader) {
|
|
354
|
-
this._loader = _loader;
|
|
355
|
-
this._cache = new Map();
|
|
356
|
-
this._requestsStream = new Subject();
|
|
357
|
-
this._subscription = this._requestsStream
|
|
358
|
-
.pipe(bufferTime(20), filter((requests) => requests.length > 0), mergeMap(async (requests) => this._loader(requests)), mergeAll())
|
|
359
|
-
.subscribe({
|
|
360
|
-
next: ({ modelId, categoryId, elementsCount }) => {
|
|
361
|
-
const subject = this._cache.get(`${modelId}${categoryId}`);
|
|
362
|
-
assert(!!subject);
|
|
363
|
-
subject.next(elementsCount);
|
|
364
|
-
},
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
[Symbol.dispose]() {
|
|
368
|
-
this._subscription.unsubscribe();
|
|
369
|
-
}
|
|
370
|
-
async getCategoryElementsCount(modelId, categoryId) {
|
|
371
|
-
const cacheKey = `${modelId}${categoryId}`;
|
|
372
|
-
let result = this._cache.get(cacheKey);
|
|
373
|
-
if (result !== undefined) {
|
|
374
|
-
return firstValueFrom(result);
|
|
375
|
-
}
|
|
376
|
-
result = new ReplaySubject(1);
|
|
377
|
-
this._cache.set(cacheKey, result);
|
|
378
|
-
this._requestsStream.next({ modelId, categoryId });
|
|
379
|
-
return firstValueFrom(result);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
364
|
//# sourceMappingURL=ModelsTreeIdsCache.js.map
|