@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
|
@@ -5,41 +5,53 @@
|
|
|
5
5
|
import { IModel } from "@itwin/core-common";
|
|
6
6
|
import { createNodesQueryClauseFactory, createPredicateBasedHierarchyDefinition, NodeSelectClauseColumnNames, ProcessedHierarchyNode, } from "@itwin/presentation-hierarchies";
|
|
7
7
|
import { createBisInstanceLabelSelectClauseFactory } from "@itwin/presentation-shared";
|
|
8
|
-
import {
|
|
8
|
+
import { CLASS_NAME_DrawingCategory, CLASS_NAME_Element, CLASS_NAME_GeometricModel2d, CLASS_NAME_GeometricModel3d, CLASS_NAME_InformationPartitionElement, CLASS_NAME_ISubModeledElement, CLASS_NAME_Model, CLASS_NAME_SpatialCategory, CLASS_NAME_Subject, } from "../common/internal/ClassNameDefinitions.js";
|
|
9
|
+
import { createIdsSelector, getClassesByView, parseIdsSelectorResult } from "../common/internal/Utils.js";
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const defaultHierarchyConfiguration = {
|
|
12
|
+
hideRootSubject: false,
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
9
15
|
export class IModelContentTreeDefinition {
|
|
16
|
+
#impl;
|
|
17
|
+
#idsCache;
|
|
18
|
+
#hierarchyConfig;
|
|
19
|
+
#selectQueryFactory;
|
|
20
|
+
#nodeLabelSelectClauseFactory;
|
|
10
21
|
constructor(props) {
|
|
11
|
-
this
|
|
12
|
-
this
|
|
22
|
+
this.#idsCache = props.idsCache;
|
|
23
|
+
this.#hierarchyConfig = props.hierarchyConfig;
|
|
24
|
+
this.#impl = createPredicateBasedHierarchyDefinition({
|
|
13
25
|
classHierarchyInspector: props.imodelAccess,
|
|
14
26
|
hierarchy: {
|
|
15
|
-
rootNodes: async (requestProps) => this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: [IModel.rootSubjectId] }),
|
|
27
|
+
rootNodes: async (requestProps) => this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: this.#hierarchyConfig.hideRootSubject ? [IModel.rootSubjectId] : [] }),
|
|
16
28
|
childNodes: [
|
|
17
29
|
{
|
|
18
|
-
parentInstancesNodePredicate:
|
|
30
|
+
parentInstancesNodePredicate: CLASS_NAME_Subject,
|
|
19
31
|
definitions: async (requestProps) => this.createSubjectChildrenQuery(requestProps),
|
|
20
32
|
},
|
|
21
33
|
{
|
|
22
|
-
parentInstancesNodePredicate:
|
|
34
|
+
parentInstancesNodePredicate: CLASS_NAME_ISubModeledElement,
|
|
23
35
|
definitions: async (requestProps) => this.createISubModeledElementChildrenQuery(requestProps),
|
|
24
36
|
},
|
|
25
37
|
{
|
|
26
|
-
parentInstancesNodePredicate:
|
|
38
|
+
parentInstancesNodePredicate: CLASS_NAME_GeometricModel3d,
|
|
27
39
|
definitions: async (requestProps) => this.createGeometricModelChildrenQuery({ ...requestProps, viewType: "3d" }),
|
|
28
40
|
},
|
|
29
41
|
{
|
|
30
|
-
parentInstancesNodePredicate:
|
|
42
|
+
parentInstancesNodePredicate: CLASS_NAME_GeometricModel2d,
|
|
31
43
|
definitions: async (requestProps) => this.createGeometricModelChildrenQuery({ ...requestProps, viewType: "2d" }),
|
|
32
44
|
},
|
|
33
45
|
{
|
|
34
|
-
parentInstancesNodePredicate:
|
|
46
|
+
parentInstancesNodePredicate: CLASS_NAME_SpatialCategory,
|
|
35
47
|
definitions: async (requestProps) => this.createCategoryChildrenQuery({ ...requestProps, viewType: "3d" }),
|
|
36
48
|
},
|
|
37
49
|
{
|
|
38
|
-
parentInstancesNodePredicate:
|
|
50
|
+
parentInstancesNodePredicate: CLASS_NAME_DrawingCategory,
|
|
39
51
|
definitions: async (requestProps) => this.createCategoryChildrenQuery({ ...requestProps, viewType: "2d" }),
|
|
40
52
|
},
|
|
41
53
|
{
|
|
42
|
-
parentInstancesNodePredicate:
|
|
54
|
+
parentInstancesNodePredicate: CLASS_NAME_Model,
|
|
43
55
|
onlyIfNotHandled: true,
|
|
44
56
|
definitions: async (requestProps) => this.createModelChildrenQuery(requestProps),
|
|
45
57
|
},
|
|
@@ -56,17 +68,17 @@ export class IModelContentTreeDefinition {
|
|
|
56
68
|
definitions: async (requestProps) => this.createGroupInformationElementMemberElementsQuery(requestProps),
|
|
57
69
|
},
|
|
58
70
|
{
|
|
59
|
-
parentInstancesNodePredicate:
|
|
71
|
+
parentInstancesNodePredicate: CLASS_NAME_Element,
|
|
60
72
|
onlyIfNotHandled: true,
|
|
61
73
|
definitions: async (requestProps) => this.createElementChildrenQuery(requestProps),
|
|
62
74
|
},
|
|
63
75
|
],
|
|
64
76
|
},
|
|
65
77
|
});
|
|
66
|
-
this
|
|
67
|
-
this
|
|
78
|
+
this.#nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });
|
|
79
|
+
this.#selectQueryFactory = createNodesQueryClauseFactory({
|
|
68
80
|
imodelAccess: props.imodelAccess,
|
|
69
|
-
instanceLabelSelectClauseFactory: this
|
|
81
|
+
instanceLabelSelectClauseFactory: this.#nodeLabelSelectClauseFactory,
|
|
70
82
|
});
|
|
71
83
|
}
|
|
72
84
|
async postProcessNode(node) {
|
|
@@ -77,44 +89,44 @@ export class IModelContentTreeDefinition {
|
|
|
77
89
|
return node;
|
|
78
90
|
}
|
|
79
91
|
async defineHierarchyLevel(props) {
|
|
80
|
-
return this.
|
|
92
|
+
return this.#impl.defineHierarchyLevel(props);
|
|
81
93
|
}
|
|
82
|
-
async createSubjectChildrenQuery({ parentNodeInstanceIds:
|
|
94
|
+
async createSubjectChildrenQuery({ parentNodeInstanceIds: parentSubjectIds, instanceFilter, }) {
|
|
83
95
|
const [subjectFilterClauses, modelFilterClauses] = await Promise.all([
|
|
84
|
-
this.
|
|
96
|
+
this.#selectQueryFactory.createFilterClauses({
|
|
85
97
|
filter: instanceFilter,
|
|
86
|
-
contentClass: { fullName:
|
|
98
|
+
contentClass: { fullName: CLASS_NAME_Subject, alias: "this" },
|
|
87
99
|
}),
|
|
88
|
-
this.
|
|
100
|
+
this.#selectQueryFactory.createFilterClauses({
|
|
89
101
|
filter: instanceFilter,
|
|
90
|
-
contentClass: { fullName:
|
|
102
|
+
contentClass: { fullName: CLASS_NAME_Model, alias: "this" },
|
|
91
103
|
}),
|
|
92
104
|
]);
|
|
93
|
-
const [childSubjectIds, childModelIds] =
|
|
94
|
-
this.
|
|
95
|
-
|
|
96
|
-
]);
|
|
105
|
+
const [childSubjectIds, childModelIds] = parentSubjectIds.length
|
|
106
|
+
? await Promise.all([this.#idsCache.getChildSubjectIds(parentSubjectIds), this.#idsCache.getChildSubjectModelIds(parentSubjectIds)])
|
|
107
|
+
: [[IModel.rootSubjectId], []];
|
|
97
108
|
const defs = new Array();
|
|
98
109
|
childSubjectIds.length &&
|
|
99
110
|
defs.push({
|
|
100
|
-
fullClassName:
|
|
111
|
+
fullClassName: CLASS_NAME_Subject,
|
|
101
112
|
query: {
|
|
102
113
|
ecsql: `
|
|
103
114
|
SELECT
|
|
104
|
-
${await this.
|
|
115
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
105
116
|
ecClassId: { selector: "this.ECClassId" },
|
|
106
117
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
107
118
|
nodeLabel: {
|
|
108
|
-
selector: await this.
|
|
119
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
109
120
|
classAlias: "this",
|
|
110
|
-
className:
|
|
121
|
+
className: CLASS_NAME_Subject,
|
|
111
122
|
}),
|
|
112
123
|
},
|
|
113
124
|
hasChildren: { selector: `InVirtualSet(?, this.ECInstanceId)` },
|
|
114
125
|
grouping: { byLabel: { action: "merge", groupId: "subject" } },
|
|
115
126
|
extendedData: {
|
|
116
|
-
imageId:
|
|
127
|
+
imageId: { selector: `IIF(this.ECInstanceId = ${IModel.rootSubjectId}, 'icon-imodel-hollow-2', 'icon-folder')` },
|
|
117
128
|
},
|
|
129
|
+
autoExpand: { selector: `IIF(this.ECInstanceId = ${IModel.rootSubjectId}, true, false)` },
|
|
118
130
|
supportsFiltering: true,
|
|
119
131
|
})}
|
|
120
132
|
FROM ${subjectFilterClauses.from} this
|
|
@@ -124,26 +136,26 @@ export class IModelContentTreeDefinition {
|
|
|
124
136
|
${subjectFilterClauses.where ? `AND ${subjectFilterClauses.where}` : ""}
|
|
125
137
|
`,
|
|
126
138
|
bindings: [
|
|
127
|
-
{ type: "idset", value: await this.
|
|
139
|
+
{ type: "idset", value: await this.#idsCache.getParentSubjectIds() },
|
|
128
140
|
...childSubjectIds.map((id) => ({ type: "id", value: id })),
|
|
129
141
|
],
|
|
130
142
|
},
|
|
131
143
|
});
|
|
132
144
|
childModelIds.length &&
|
|
133
145
|
defs.push({
|
|
134
|
-
fullClassName:
|
|
146
|
+
fullClassName: CLASS_NAME_Model,
|
|
135
147
|
query: {
|
|
136
148
|
ecsql: `
|
|
137
149
|
SELECT model.ECInstanceId AS ECInstanceId, model.*
|
|
138
150
|
FROM (
|
|
139
151
|
SELECT
|
|
140
|
-
${await this.
|
|
152
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
141
153
|
ecClassId: { selector: "m.ECClassId" },
|
|
142
154
|
ecInstanceId: { selector: "m.ECInstanceId" },
|
|
143
155
|
nodeLabel: {
|
|
144
|
-
selector: await this.
|
|
156
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
145
157
|
classAlias: "partition",
|
|
146
|
-
className:
|
|
158
|
+
className: CLASS_NAME_InformationPartitionElement,
|
|
147
159
|
}),
|
|
148
160
|
},
|
|
149
161
|
hideNodeInHierarchy: {
|
|
@@ -162,8 +174,8 @@ export class IModelContentTreeDefinition {
|
|
|
162
174
|
},
|
|
163
175
|
supportsFiltering: true,
|
|
164
176
|
})}
|
|
165
|
-
FROM
|
|
166
|
-
JOIN
|
|
177
|
+
FROM ${CLASS_NAME_Model} m
|
|
178
|
+
JOIN ${CLASS_NAME_InformationPartitionElement} [partition] ON [partition].ECInstanceId = m.ModeledElement.Id
|
|
167
179
|
WHERE
|
|
168
180
|
m.ECInstanceId IN (${childModelIds.map(() => "?").join(",")})
|
|
169
181
|
) model
|
|
@@ -181,17 +193,17 @@ export class IModelContentTreeDefinition {
|
|
|
181
193
|
// hidden - the filter will get applied on the child hierarchy levels
|
|
182
194
|
return [
|
|
183
195
|
{
|
|
184
|
-
fullClassName:
|
|
196
|
+
fullClassName: CLASS_NAME_Model,
|
|
185
197
|
query: {
|
|
186
198
|
ecsql: `
|
|
187
199
|
SELECT
|
|
188
|
-
${await this.
|
|
200
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
189
201
|
ecClassId: { selector: "this.ECClassId" },
|
|
190
202
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
191
|
-
nodeLabel: "",
|
|
203
|
+
nodeLabel: "", // doesn't matter - the node is always hidden
|
|
192
204
|
hideNodeInHierarchy: true,
|
|
193
205
|
})}
|
|
194
|
-
FROM
|
|
206
|
+
FROM ${CLASS_NAME_Model} this
|
|
195
207
|
WHERE
|
|
196
208
|
this.ModeledElement.Id IN (${elementIds.map(() => "?").join(",")})
|
|
197
209
|
AND NOT this.IsPrivate
|
|
@@ -202,13 +214,13 @@ export class IModelContentTreeDefinition {
|
|
|
202
214
|
];
|
|
203
215
|
}
|
|
204
216
|
async createGeometricModelChildrenQuery({ parentNodeInstanceIds: modelIds, instanceFilter, viewType, }) {
|
|
205
|
-
const childCategoryIds = await this.
|
|
206
|
-
const { categoryClass } =
|
|
207
|
-
const categoryFilterClauses = await this.
|
|
217
|
+
const childCategoryIds = await this.#idsCache.getModelCategoryIds(modelIds);
|
|
218
|
+
const { categoryClass } = getClassesByView(viewType);
|
|
219
|
+
const categoryFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
208
220
|
filter: instanceFilter,
|
|
209
221
|
contentClass: { fullName: categoryClass, alias: "this" },
|
|
210
222
|
});
|
|
211
|
-
const informationContentElementFilterClauses = await this.
|
|
223
|
+
const informationContentElementFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
212
224
|
filter: instanceFilter,
|
|
213
225
|
contentClass: { fullName: "BisCore.InformationContentElement", alias: "this" },
|
|
214
226
|
});
|
|
@@ -219,11 +231,11 @@ export class IModelContentTreeDefinition {
|
|
|
219
231
|
query: {
|
|
220
232
|
ecsql: `
|
|
221
233
|
SELECT
|
|
222
|
-
${await this.
|
|
234
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
223
235
|
ecClassId: { selector: "this.ECClassId" },
|
|
224
236
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
225
237
|
nodeLabel: {
|
|
226
|
-
selector: await this.
|
|
238
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
227
239
|
classAlias: "this",
|
|
228
240
|
className: categoryClass,
|
|
229
241
|
}),
|
|
@@ -250,11 +262,11 @@ export class IModelContentTreeDefinition {
|
|
|
250
262
|
query: {
|
|
251
263
|
ecsql: `
|
|
252
264
|
SELECT
|
|
253
|
-
${await this.
|
|
265
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
254
266
|
ecClassId: { selector: "this.ECClassId" },
|
|
255
267
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
256
268
|
nodeLabel: {
|
|
257
|
-
selector: await this.
|
|
269
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
258
270
|
classAlias: "this",
|
|
259
271
|
className: "BisCore.InformationContentElement",
|
|
260
272
|
}),
|
|
@@ -284,9 +296,9 @@ export class IModelContentTreeDefinition {
|
|
|
284
296
|
if (modelIds.length === 0) {
|
|
285
297
|
return this.createElementChildrenQuery(props);
|
|
286
298
|
}
|
|
287
|
-
const { elementClass, modelClass } =
|
|
299
|
+
const { elementClass, modelClass } = getClassesByView(viewType);
|
|
288
300
|
return Promise.all(getElementsSelectProps({ modelClass, elementClass }).map(async ({ selectProps, whereClause }) => {
|
|
289
|
-
const instanceFilterClauses = await this.
|
|
301
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
290
302
|
filter: instanceFilter,
|
|
291
303
|
contentClass: { fullName: elementClass, alias: "this" },
|
|
292
304
|
});
|
|
@@ -295,11 +307,11 @@ export class IModelContentTreeDefinition {
|
|
|
295
307
|
query: {
|
|
296
308
|
ecsql: `
|
|
297
309
|
SELECT
|
|
298
|
-
${await this.
|
|
310
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
299
311
|
ecClassId: { selector: "this.ECClassId" },
|
|
300
312
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
301
313
|
nodeLabel: {
|
|
302
|
-
selector: await this.
|
|
314
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
303
315
|
classAlias: "this",
|
|
304
316
|
className: elementClass,
|
|
305
317
|
}),
|
|
@@ -329,7 +341,7 @@ export class IModelContentTreeDefinition {
|
|
|
329
341
|
}
|
|
330
342
|
async createModelChildrenQuery({ parentNodeInstanceIds: modelIds, instanceFilter, }) {
|
|
331
343
|
return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
|
|
332
|
-
const instanceFilterClauses = await this.
|
|
344
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
333
345
|
filter: instanceFilter,
|
|
334
346
|
contentClass: { fullName: classFullName, alias: "this" },
|
|
335
347
|
});
|
|
@@ -338,11 +350,11 @@ export class IModelContentTreeDefinition {
|
|
|
338
350
|
query: {
|
|
339
351
|
ecsql: `
|
|
340
352
|
SELECT
|
|
341
|
-
${await this.
|
|
353
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
342
354
|
ecClassId: { selector: "this.ECClassId" },
|
|
343
355
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
344
356
|
nodeLabel: {
|
|
345
|
-
selector: await this.
|
|
357
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
346
358
|
classAlias: "this",
|
|
347
359
|
className: classFullName,
|
|
348
360
|
}),
|
|
@@ -404,7 +416,7 @@ export class IModelContentTreeDefinition {
|
|
|
404
416
|
async createChildrenNodeChildrenQuery({ parentNode, instanceFilter }) {
|
|
405
417
|
const groupIds = parentNode.extendedData?.groupIds;
|
|
406
418
|
return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
|
|
407
|
-
const instanceFilterClauses = await this.
|
|
419
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
408
420
|
filter: instanceFilter,
|
|
409
421
|
contentClass: { fullName: classFullName, alias: "this" },
|
|
410
422
|
});
|
|
@@ -413,11 +425,11 @@ export class IModelContentTreeDefinition {
|
|
|
413
425
|
query: {
|
|
414
426
|
ecsql: `
|
|
415
427
|
SELECT
|
|
416
|
-
${await this.
|
|
428
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
417
429
|
ecClassId: { selector: "this.ECClassId" },
|
|
418
430
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
419
431
|
nodeLabel: {
|
|
420
|
-
selector: await this.
|
|
432
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
421
433
|
classAlias: "this",
|
|
422
434
|
className: classFullName,
|
|
423
435
|
}),
|
|
@@ -444,7 +456,7 @@ export class IModelContentTreeDefinition {
|
|
|
444
456
|
async createGroupInformationElementMemberElementsQuery({ parentNode, instanceFilter, }) {
|
|
445
457
|
const groupIds = parentNode.extendedData?.groupIds;
|
|
446
458
|
return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
|
|
447
|
-
const instanceFilterClauses = await this.
|
|
459
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
448
460
|
filter: instanceFilter,
|
|
449
461
|
contentClass: { fullName: classFullName, alias: "this" },
|
|
450
462
|
});
|
|
@@ -453,11 +465,11 @@ export class IModelContentTreeDefinition {
|
|
|
453
465
|
query: {
|
|
454
466
|
ecsql: `
|
|
455
467
|
SELECT
|
|
456
|
-
${await this.
|
|
468
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
457
469
|
ecClassId: { selector: "this.ECClassId" },
|
|
458
470
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
459
471
|
nodeLabel: {
|
|
460
|
-
selector: await this.
|
|
472
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
461
473
|
classAlias: "this",
|
|
462
474
|
className: classFullName,
|
|
463
475
|
}),
|
|
@@ -484,7 +496,7 @@ export class IModelContentTreeDefinition {
|
|
|
484
496
|
}
|
|
485
497
|
async createElementChildrenQuery({ parentNodeInstanceIds: elementIds, instanceFilter, }) {
|
|
486
498
|
return Promise.all(getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {
|
|
487
|
-
const instanceFilterClauses = await this.
|
|
499
|
+
const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({
|
|
488
500
|
filter: instanceFilter,
|
|
489
501
|
contentClass: { fullName: classFullName, alias: "this" },
|
|
490
502
|
});
|
|
@@ -493,11 +505,11 @@ export class IModelContentTreeDefinition {
|
|
|
493
505
|
query: {
|
|
494
506
|
ecsql: `
|
|
495
507
|
SELECT
|
|
496
|
-
${await this.
|
|
508
|
+
${await this.#selectQueryFactory.createSelectClause({
|
|
497
509
|
ecClassId: { selector: "this.ECClassId" },
|
|
498
510
|
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
499
511
|
nodeLabel: {
|
|
500
|
-
selector: await this.
|
|
512
|
+
selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({
|
|
501
513
|
classAlias: "this",
|
|
502
514
|
className: classFullName,
|
|
503
515
|
}),
|
|
@@ -523,15 +535,9 @@ export class IModelContentTreeDefinition {
|
|
|
523
535
|
}));
|
|
524
536
|
}
|
|
525
537
|
}
|
|
526
|
-
function getClassNameByViewType(view) {
|
|
527
|
-
if (view === "2d") {
|
|
528
|
-
return { categoryClass: "BisCore.DrawingCategory", elementClass: "BisCore.GeometricElement2d", modelClass: "BisCore.GeometricModel2d" };
|
|
529
|
-
}
|
|
530
|
-
return { categoryClass: "BisCore.SpatialCategory", elementClass: "BisCore.GeometricElement3d", modelClass: "BisCore.GeometricModel3d" };
|
|
531
|
-
}
|
|
532
538
|
function getElementsSelectProps(props) {
|
|
533
|
-
const modelClassFullName = props?.modelClass ??
|
|
534
|
-
const elementClassFullName = props?.elementClass ??
|
|
539
|
+
const modelClassFullName = props?.modelClass ?? CLASS_NAME_Model;
|
|
540
|
+
const elementClassFullName = props?.elementClass ?? CLASS_NAME_Element;
|
|
535
541
|
const result = [
|
|
536
542
|
{
|
|
537
543
|
classFullName: elementClassFullName,
|
|
@@ -565,7 +571,7 @@ function getElementsSelectProps(props) {
|
|
|
565
571
|
IFNULL((
|
|
566
572
|
SELECT 1
|
|
567
573
|
FROM (
|
|
568
|
-
SELECT Parent.Id ParentId FROM
|
|
574
|
+
SELECT Parent.Id ParentId FROM ${CLASS_NAME_Element}
|
|
569
575
|
UNION ALL
|
|
570
576
|
SELECT SourceECInstanceId ParentId FROM BisCore.ElementGroupsMembers
|
|
571
577
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelContentTreeDefinition.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,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EAAE,EAAE;YACf,WAAW,EAAE;gBACX,WAAW,EAAE;oBACX,QAAQ,EAAE;;;;;;;;;;;WAWT;iBACF;gBACD,iBAAiB,EAAE,KAAK;aACzB;SACF,CAAC,CAAC;KACJ;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IModel } from \"@itwin/core-common\";\nimport {\n createNodesQueryClauseFactory,\n createPredicateBasedHierarchyDefinition,\n NodeSelectClauseColumnNames,\n ProcessedHierarchyNode,\n} from \"@itwin/presentation-hierarchies\";\nimport { createBisInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport { createIdsSelector, parseIdsSelectorResult } from \"../common/Utils.js\";\n\nimport type {\n DefineGenericNodeChildHierarchyLevelProps,\n DefineHierarchyLevelProps,\n DefineInstanceNodeChildHierarchyLevelProps,\n HierarchyDefinition,\n HierarchyLevelDefinition,\n HierarchyNodesDefinition,\n NodesQueryClauseFactory,\n} from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector, ECSchemaProvider, ECSqlBinding, IInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport type { IModelContentTreeIdsCache } from \"./internal/IModelContentTreeIdsCache.js\";\n\ninterface IModelContentTreeDefinitionProps {\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector;\n idsCache: IModelContentTreeIdsCache;\n}\n\nexport class IModelContentTreeDefinition implements HierarchyDefinition {\n private _impl: HierarchyDefinition;\n private _idsCache: IModelContentTreeIdsCache;\n private _selectQueryFactory: NodesQueryClauseFactory;\n private _nodeLabelSelectClauseFactory: IInstanceLabelSelectClauseFactory;\n\n public constructor(props: IModelContentTreeDefinitionProps) {\n this._idsCache = props.idsCache;\n this._impl = createPredicateBasedHierarchyDefinition({\n classHierarchyInspector: props.imodelAccess,\n hierarchy: {\n rootNodes: async (requestProps) => this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: [IModel.rootSubjectId] }),\n childNodes: [\n {\n parentInstancesNodePredicate: \"BisCore.Subject\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createSubjectChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.ISubModeledElement\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createISubModeledElementChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GeometricModel3d\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GeometricModel2d\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.SpatialCategory\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.DrawingCategory\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: \"BisCore.Model\",\n onlyIfNotHandled: true,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createModelChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GroupInformationElement\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createGroupInformationElementChildElementsQuery(requestProps),\n },\n {\n parentGenericNodePredicate: async ({ id }) => id === \"ChildrenNode\",\n definitions: async (requestProps: DefineGenericNodeChildHierarchyLevelProps) => this.createChildrenNodeChildrenQuery(requestProps),\n },\n {\n parentGenericNodePredicate: async ({ id }) => id === \"MembersNode\",\n definitions: async (requestProps: DefineGenericNodeChildHierarchyLevelProps) => this.createGroupInformationElementMemberElementsQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.Element\",\n onlyIfNotHandled: true,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createElementChildrenQuery(requestProps),\n },\n ],\n },\n });\n this._nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });\n this._selectQueryFactory = createNodesQueryClauseFactory({\n imodelAccess: props.imodelAccess,\n instanceLabelSelectClauseFactory: this._nodeLabelSelectClauseFactory,\n });\n }\n\n public async postProcessNode(node: ProcessedHierarchyNode): Promise<ProcessedHierarchyNode> {\n if (ProcessedHierarchyNode.isGroupingNode(node)) {\n const label = node.children.length ? `${node.label} (${node.children.length})` : node.label;\n return { ...node, label, extendedData: { ...node.extendedData, imageId: \"icon-ec-class\" } };\n }\n return node;\n }\n\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps) {\n return this._impl.defineHierarchyLevel(props);\n }\n\n private async createSubjectChildrenQuery({\n parentNodeInstanceIds: subjectIds,\n instanceFilter,\n }: Pick<DefineInstanceNodeChildHierarchyLevelProps, \"parentNodeInstanceIds\" | \"instanceFilter\">): Promise<HierarchyLevelDefinition> {\n const [subjectFilterClauses, modelFilterClauses] = await Promise.all([\n this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.Subject\", alias: \"this\" },\n }),\n this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.Model\", alias: \"this\" },\n }),\n ]);\n const [childSubjectIds, childModelIds] = await Promise.all([\n this._idsCache.getChildSubjectIds(subjectIds),\n this._idsCache.getChildSubjectModelIds(subjectIds),\n ]);\n const defs = new Array<HierarchyNodesDefinition>();\n childSubjectIds.length &&\n defs.push({\n fullClassName: \"BisCore.Subject\",\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: \"BisCore.Subject\",\n }),\n },\n hasChildren: { selector: `InVirtualSet(?, this.ECInstanceId)` },\n grouping: { byLabel: { action: \"merge\", groupId: \"subject\" } },\n extendedData: {\n imageId: \"icon-folder\",\n },\n supportsFiltering: true,\n })}\n FROM ${subjectFilterClauses.from} this\n ${subjectFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${childSubjectIds.map(() => \"?\").join(\",\")})\n ${subjectFilterClauses.where ? `AND ${subjectFilterClauses.where}` : \"\"}\n `,\n bindings: [\n { type: \"idset\", value: await this._idsCache.getParentSubjectIds() },\n ...childSubjectIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n ],\n },\n });\n childModelIds.length &&\n defs.push({\n fullClassName: \"BisCore.Model\",\n query: {\n ecsql: `\n SELECT model.ECInstanceId AS ECInstanceId, model.*\n FROM (\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"m.ECClassId\" },\n ecInstanceId: { selector: \"m.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"partition\",\n className: \"BisCore.InformationPartitionElement\",\n }),\n },\n hideNodeInHierarchy: {\n selector: `\n CASE\n WHEN (\n json_extract([partition].JsonProperties, '$.PhysicalPartition.Model.Content') IS NOT NULL\n OR json_extract([partition].JsonProperties, '$.GraphicalPartition3d.Model.Content') IS NOT NULL\n ) THEN 1\n ELSE 0\n END\n `,\n },\n extendedData: {\n imageId: \"icon-model\",\n },\n supportsFiltering: true,\n })}\n FROM BisCore.Model m\n JOIN BisCore.InformationPartitionElement [partition] ON [partition].ECInstanceId = m.ModeledElement.Id\n WHERE\n m.ECInstanceId IN (${childModelIds.map(() => \"?\").join(\",\")})\n ) model\n JOIN ${modelFilterClauses.from} this ON this.ECInstanceId = model.ECInstanceId\n ${modelFilterClauses.joins}\n ${modelFilterClauses.where ? `WHERE (model.${NodeSelectClauseColumnNames.HideNodeInHierarchy} OR ${modelFilterClauses.where})` : \"\"}\n `,\n bindings: childModelIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n });\n return defs;\n }\n\n private async createISubModeledElementChildrenQuery({\n parentNodeInstanceIds: elementIds,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n // note: we do not apply hierarchy level filtering on this hierarchy level, because it's always\n // hidden - the filter will get applied on the child hierarchy levels\n return [\n {\n fullClassName: \"BisCore.Model\",\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: \"\", // doesn't matter - the node is always hidden\n hideNodeInHierarchy: true,\n })}\n FROM BisCore.Model this\n WHERE\n this.ModeledElement.Id IN (${elementIds.map(() => \"?\").join(\",\")})\n AND NOT this.IsPrivate\n `,\n bindings: [...elementIds.map((id): ECSqlBinding => ({ type: \"id\", value: id }))],\n },\n },\n ];\n }\n\n private async createGeometricModelChildrenQuery({\n parentNodeInstanceIds: modelIds,\n instanceFilter,\n viewType,\n }: DefineInstanceNodeChildHierarchyLevelProps & { viewType: \"2d\" | \"3d\" }): Promise<HierarchyLevelDefinition> {\n const childCategoryIds = await this._idsCache.getModelCategories(modelIds);\n\n const { categoryClass } = getClassNameByViewType(viewType);\n const categoryFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: categoryClass, alias: \"this\" },\n });\n const informationContentElementFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.InformationContentElement\", alias: \"this\" },\n });\n\n const defs = new Array<HierarchyNodesDefinition>();\n childCategoryIds.length &&\n defs.push({\n fullClassName: categoryClass,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: categoryClass,\n }),\n },\n grouping: { byLabel: { action: \"merge\", groupId: \"category\" } },\n extendedData: {\n imageId: \"icon-layers\",\n modelIds: { selector: createIdsSelector(modelIds) },\n },\n hasChildren: true,\n supportsFiltering: true,\n })}\n FROM ${categoryFilterClauses.from} this\n ${categoryFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${childCategoryIds.map(() => \"?\").join(\",\")})\n ${categoryFilterClauses.where ? `AND ${categoryFilterClauses.where}` : \"\"}\n `,\n bindings: childCategoryIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n });\n defs.push({\n fullClassName: \"BisCore.InformationContentElement\",\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: \"BisCore.InformationContentElement\",\n }),\n },\n hasChildren: true,\n grouping: {\n byClass: true,\n },\n supportsFiltering: true,\n })}\n FROM ${informationContentElementFilterClauses.from} this\n ${informationContentElementFilterClauses.joins}\n WHERE\n this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n ${informationContentElementFilterClauses.where ? `AND ${informationContentElementFilterClauses.where}` : \"\"}\n `,\n bindings: modelIds.map((id) => ({ type: \"id\", value: id })),\n },\n });\n return defs;\n }\n\n private async createCategoryChildrenQuery(props: DefineInstanceNodeChildHierarchyLevelProps & { viewType: \"2d\" | \"3d\" }): Promise<HierarchyLevelDefinition> {\n const { parentNodeInstanceIds: categoryIds, parentNode, instanceFilter, viewType } = props;\n const modelIds = parseIdsSelectorResult(parentNode.extendedData?.modelIds);\n\n // We only want to handle a category added as a child of `GeometricModel2d` or `GeometricModel3d`.\n // ModelIds is not empty only if parent node is a geometric model.\n if (modelIds.length === 0) {\n return this.createElementChildrenQuery(props);\n }\n\n const { elementClass, modelClass } = getClassNameByViewType(viewType);\n return Promise.all(\n getElementsSelectProps({ modelClass, elementClass }).map(async ({ selectProps, whereClause }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: elementClass, alias: \"this\" },\n });\n return {\n fullClassName: elementClass,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: elementClass,\n }),\n },\n grouping: {\n byClass: true,\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Category.Id IN (${categoryIds.map(() => \"?\").join(\",\")})\n AND this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n AND this.Parent.Id IS NULL\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: [...categoryIds.map((id) => ({ type: \"id\", value: id })), ...modelIds.map((id) => ({ type: \"id\", value: id }))] as ECSqlBinding[],\n },\n };\n }),\n );\n }\n\n private async createModelChildrenQuery({\n parentNodeInstanceIds: modelIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: {\n byClass: true,\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps?.hasChildren,\n supportsFiltering: selectProps?.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IS NULL\n AND this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: modelIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createGroupInformationElementChildElementsQuery({\n parentNodeInstanceIds: groupIds,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return [\n {\n node: {\n key: \"ChildrenNode\",\n label: \"Children\",\n extendedData: {\n groupIds,\n imageId: \"icon-hierarchy-tree\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n {\n node: {\n key: \"MembersNode\",\n label: \"Members\",\n extendedData: {\n groupIds,\n imageId: \"icon-group\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n ];\n }\n\n private async createChildrenNodeChildrenQuery({ parentNode, instanceFilter }: DefineGenericNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const groupIds: string[] = parentNode.extendedData?.groupIds;\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n grouping: { byClass: true },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IN (${groupIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createGroupInformationElementMemberElementsQuery({\n parentNode,\n instanceFilter,\n }: DefineGenericNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const groupIds: string[] = parentNode.extendedData?.groupIds;\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: { byClass: true },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.ElementGroupsMembers egm ON egm.TargetECInstanceId = this.ECInstanceId\n ${instanceFilterClauses.joins}\n WHERE\n egm.SourceECInstanceId IN (${groupIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createElementChildrenQuery({\n parentNodeInstanceIds: elementIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: { byClass: true },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.Element p ON p.ECInstanceId = this.Parent.Id\n ${instanceFilterClauses.joins}\n WHERE\n p.ECInstanceId IN (${elementIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: elementIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n}\n\nfunction getClassNameByViewType(view: \"2d\" | \"3d\") {\n if (view === \"2d\") {\n return { categoryClass: \"BisCore.DrawingCategory\", elementClass: \"BisCore.GeometricElement2d\", modelClass: \"BisCore.GeometricModel2d\" } as const;\n }\n return { categoryClass: \"BisCore.SpatialCategory\", elementClass: \"BisCore.GeometricElement3d\", modelClass: \"BisCore.GeometricModel3d\" } as const;\n}\n\nfunction getElementsSelectProps(props?: { modelClass?: string; elementClass?: \"BisCore.GeometricElement3d\" | \"BisCore.GeometricElement2d\" }) {\n const modelClassFullName = props?.modelClass ?? \"BisCore.Model\";\n const elementClassFullName = props?.elementClass ?? \"BisCore.Element\";\n const result = [\n {\n classFullName: elementClassFullName,\n whereClause: \"this.ECClassId IS NOT (BisCore.GroupInformationElement)\",\n selectProps: {\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM (\n SELECT Parent.Id ParentId FROM ${elementClassFullName}\n UNION ALL\n SELECT sm.ModeledElement.Id ParentId FROM ${modelClassFullName} sm WHERE EXISTS (SELECT 1 FROM ${elementClassFullName} WHERE Model.Id = sm.ECInstanceId)\n )\n WHERE ParentId = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n supportsFiltering: true,\n },\n },\n ];\n\n if (!props?.elementClass) {\n result.push({\n classFullName: \"BisCore.GroupInformationElement\",\n whereClause: \"\",\n selectProps: {\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM (\n SELECT Parent.Id ParentId FROM BisCore.Element\n UNION ALL\n SELECT SourceECInstanceId ParentId FROM BisCore.ElementGroupsMembers\n )\n WHERE ParentId = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n supportsFiltering: false,\n },\n });\n }\n\n return result;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IModelContentTreeDefinition.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,2BAA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;IACJ,CAAC;CACF;AAED,SAAS,sBAAsB,CAAC,KAA2G;IACzI,MAAM,kBAAkB,GAAG,KAAK,EAAE,UAAU,IAAI,gBAAgB,CAAC;IACjE,MAAM,oBAAoB,GAAG,KAAK,EAAE,YAAY,IAAI,kBAAkB,CAAC;IACvE,MAAM,MAAM,GAAG;QACb;YACE,aAAa,EAAE,oBAAoB;YACnC,WAAW,EAAE,yDAAyD;YACtE,WAAW,EAAE;gBACX,WAAW,EAAE;oBACX,QAAQ,EAAE;;;;+CAI2B,oBAAoB;;0DAET,kBAAkB,mCAAmC,oBAAoB;;;;;SAK1H;iBACA;gBACD,iBAAiB,EAAE,IAAI;aACxB;SACF;KACF,CAAC;IAEF,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC;YACV,aAAa,EAAE,iCAAiC;YAChD,WAAW,EAAE,EAAE;YACf,WAAW,EAAE;gBACX,WAAW,EAAE;oBACX,QAAQ,EAAE;;;;iDAI6B,kBAAkB;;;;;;;WAOxD;iBACF;gBACD,iBAAiB,EAAE,KAAK;aACzB;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IModel } from \"@itwin/core-common\";\nimport {\n createNodesQueryClauseFactory,\n createPredicateBasedHierarchyDefinition,\n NodeSelectClauseColumnNames,\n ProcessedHierarchyNode,\n} from \"@itwin/presentation-hierarchies\";\nimport { createBisInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport {\n CLASS_NAME_DrawingCategory,\n CLASS_NAME_Element,\n CLASS_NAME_GeometricModel2d,\n CLASS_NAME_GeometricModel3d,\n CLASS_NAME_InformationPartitionElement,\n CLASS_NAME_ISubModeledElement,\n CLASS_NAME_Model,\n CLASS_NAME_SpatialCategory,\n CLASS_NAME_Subject,\n} from \"../common/internal/ClassNameDefinitions.js\";\nimport { createIdsSelector, getClassesByView, parseIdsSelectorResult } from \"../common/internal/Utils.js\";\n\nimport type {\n DefineGenericNodeChildHierarchyLevelProps,\n DefineHierarchyLevelProps,\n DefineInstanceNodeChildHierarchyLevelProps,\n HierarchyDefinition,\n HierarchyLevelDefinition,\n HierarchyNodesDefinition,\n NodesQueryClauseFactory,\n} from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector, ECSchemaProvider, ECSqlBinding, IInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport type { IModelContentTreeIdsCache } from \"./internal/IModelContentTreeIdsCache.js\";\n\n/**\n * Defines hierarchy configuration supported by `IModelContentTree`.\n * @beta\n */\nexport interface IModelContentTreeHierarchyConfiguration {\n /** Should the root Subject node be hidden. Defaults to `false`. */\n hideRootSubject: boolean;\n}\n\n/** @internal */\nexport const defaultHierarchyConfiguration: IModelContentTreeHierarchyConfiguration = {\n hideRootSubject: false,\n};\n\ninterface IModelContentTreeDefinitionProps {\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector;\n idsCache: IModelContentTreeIdsCache;\n hierarchyConfig: IModelContentTreeHierarchyConfiguration;\n}\n\n/** @internal */\nexport class IModelContentTreeDefinition implements HierarchyDefinition {\n #impl: HierarchyDefinition;\n #idsCache: IModelContentTreeIdsCache;\n #hierarchyConfig: IModelContentTreeHierarchyConfiguration;\n #selectQueryFactory: NodesQueryClauseFactory;\n #nodeLabelSelectClauseFactory: IInstanceLabelSelectClauseFactory;\n\n public constructor(props: IModelContentTreeDefinitionProps) {\n this.#idsCache = props.idsCache;\n this.#hierarchyConfig = props.hierarchyConfig;\n this.#impl = createPredicateBasedHierarchyDefinition({\n classHierarchyInspector: props.imodelAccess,\n hierarchy: {\n rootNodes: async (requestProps) =>\n this.createSubjectChildrenQuery({ ...requestProps, parentNodeInstanceIds: this.#hierarchyConfig.hideRootSubject ? [IModel.rootSubjectId] : [] }),\n childNodes: [\n {\n parentInstancesNodePredicate: CLASS_NAME_Subject,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createSubjectChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_ISubModeledElement,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createISubModeledElementChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_GeometricModel3d,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_GeometricModel2d,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createGeometricModelChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_SpatialCategory,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"3d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_DrawingCategory,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) =>\n this.createCategoryChildrenQuery({ ...requestProps, viewType: \"2d\" }),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_Model,\n onlyIfNotHandled: true,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createModelChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: \"BisCore.GroupInformationElement\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createGroupInformationElementChildElementsQuery(requestProps),\n },\n {\n parentGenericNodePredicate: async ({ id }) => id === \"ChildrenNode\",\n definitions: async (requestProps: DefineGenericNodeChildHierarchyLevelProps) => this.createChildrenNodeChildrenQuery(requestProps),\n },\n {\n parentGenericNodePredicate: async ({ id }) => id === \"MembersNode\",\n definitions: async (requestProps: DefineGenericNodeChildHierarchyLevelProps) => this.createGroupInformationElementMemberElementsQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_Element,\n onlyIfNotHandled: true,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createElementChildrenQuery(requestProps),\n },\n ],\n },\n });\n this.#nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });\n this.#selectQueryFactory = createNodesQueryClauseFactory({\n imodelAccess: props.imodelAccess,\n instanceLabelSelectClauseFactory: this.#nodeLabelSelectClauseFactory,\n });\n }\n\n public async postProcessNode(node: ProcessedHierarchyNode): Promise<ProcessedHierarchyNode> {\n if (ProcessedHierarchyNode.isGroupingNode(node)) {\n const label = node.children.length ? `${node.label} (${node.children.length})` : node.label;\n return { ...node, label, extendedData: { ...node.extendedData, imageId: \"icon-ec-class\" } };\n }\n return node;\n }\n\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps) {\n return this.#impl.defineHierarchyLevel(props);\n }\n\n private async createSubjectChildrenQuery({\n parentNodeInstanceIds: parentSubjectIds,\n instanceFilter,\n }: Pick<DefineInstanceNodeChildHierarchyLevelProps, \"parentNodeInstanceIds\" | \"instanceFilter\">): Promise<HierarchyLevelDefinition> {\n const [subjectFilterClauses, modelFilterClauses] = await Promise.all([\n this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_Subject, alias: \"this\" },\n }),\n this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_Model, alias: \"this\" },\n }),\n ]);\n const [childSubjectIds, childModelIds] = parentSubjectIds.length\n ? await Promise.all([this.#idsCache.getChildSubjectIds(parentSubjectIds), this.#idsCache.getChildSubjectModelIds(parentSubjectIds)])\n : [[IModel.rootSubjectId], []];\n const defs = new Array<HierarchyNodesDefinition>();\n childSubjectIds.length &&\n defs.push({\n fullClassName: CLASS_NAME_Subject,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: CLASS_NAME_Subject,\n }),\n },\n hasChildren: { selector: `InVirtualSet(?, this.ECInstanceId)` },\n grouping: { byLabel: { action: \"merge\", groupId: \"subject\" } },\n extendedData: {\n imageId: { selector: `IIF(this.ECInstanceId = ${IModel.rootSubjectId}, 'icon-imodel-hollow-2', 'icon-folder')` },\n },\n autoExpand: { selector: `IIF(this.ECInstanceId = ${IModel.rootSubjectId}, true, false)` },\n supportsFiltering: true,\n })}\n FROM ${subjectFilterClauses.from} this\n ${subjectFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${childSubjectIds.map(() => \"?\").join(\",\")})\n ${subjectFilterClauses.where ? `AND ${subjectFilterClauses.where}` : \"\"}\n `,\n bindings: [\n { type: \"idset\", value: await this.#idsCache.getParentSubjectIds() },\n ...childSubjectIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n ],\n },\n });\n childModelIds.length &&\n defs.push({\n fullClassName: CLASS_NAME_Model,\n query: {\n ecsql: `\n SELECT model.ECInstanceId AS ECInstanceId, model.*\n FROM (\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"m.ECClassId\" },\n ecInstanceId: { selector: \"m.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"partition\",\n className: CLASS_NAME_InformationPartitionElement,\n }),\n },\n hideNodeInHierarchy: {\n selector: `\n CASE\n WHEN (\n json_extract([partition].JsonProperties, '$.PhysicalPartition.Model.Content') IS NOT NULL\n OR json_extract([partition].JsonProperties, '$.GraphicalPartition3d.Model.Content') IS NOT NULL\n ) THEN 1\n ELSE 0\n END\n `,\n },\n extendedData: {\n imageId: \"icon-model\",\n },\n supportsFiltering: true,\n })}\n FROM ${CLASS_NAME_Model} m\n JOIN ${CLASS_NAME_InformationPartitionElement} [partition] ON [partition].ECInstanceId = m.ModeledElement.Id\n WHERE\n m.ECInstanceId IN (${childModelIds.map(() => \"?\").join(\",\")})\n ) model\n JOIN ${modelFilterClauses.from} this ON this.ECInstanceId = model.ECInstanceId\n ${modelFilterClauses.joins}\n ${modelFilterClauses.where ? `WHERE (model.${NodeSelectClauseColumnNames.HideNodeInHierarchy} OR ${modelFilterClauses.where})` : \"\"}\n `,\n bindings: childModelIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n });\n return defs;\n }\n\n private async createISubModeledElementChildrenQuery({\n parentNodeInstanceIds: elementIds,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n // note: we do not apply hierarchy level filtering on this hierarchy level, because it's always\n // hidden - the filter will get applied on the child hierarchy levels\n return [\n {\n fullClassName: CLASS_NAME_Model,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: \"\", // doesn't matter - the node is always hidden\n hideNodeInHierarchy: true,\n })}\n FROM ${CLASS_NAME_Model} this\n WHERE\n this.ModeledElement.Id IN (${elementIds.map(() => \"?\").join(\",\")})\n AND NOT this.IsPrivate\n `,\n bindings: [...elementIds.map((id): ECSqlBinding => ({ type: \"id\", value: id }))],\n },\n },\n ];\n }\n\n private async createGeometricModelChildrenQuery({\n parentNodeInstanceIds: modelIds,\n instanceFilter,\n viewType,\n }: DefineInstanceNodeChildHierarchyLevelProps & { viewType: \"2d\" | \"3d\" }): Promise<HierarchyLevelDefinition> {\n const childCategoryIds = await this.#idsCache.getModelCategoryIds(modelIds);\n\n const { categoryClass } = getClassesByView(viewType);\n const categoryFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: categoryClass, alias: \"this\" },\n });\n const informationContentElementFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.InformationContentElement\", alias: \"this\" },\n });\n\n const defs = new Array<HierarchyNodesDefinition>();\n childCategoryIds.length &&\n defs.push({\n fullClassName: categoryClass,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: categoryClass,\n }),\n },\n grouping: { byLabel: { action: \"merge\", groupId: \"category\" } },\n extendedData: {\n imageId: \"icon-layers\",\n modelIds: { selector: createIdsSelector(modelIds) },\n },\n hasChildren: true,\n supportsFiltering: true,\n })}\n FROM ${categoryFilterClauses.from} this\n ${categoryFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${childCategoryIds.map(() => \"?\").join(\",\")})\n ${categoryFilterClauses.where ? `AND ${categoryFilterClauses.where}` : \"\"}\n `,\n bindings: childCategoryIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n });\n defs.push({\n fullClassName: \"BisCore.InformationContentElement\",\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: \"BisCore.InformationContentElement\",\n }),\n },\n hasChildren: true,\n grouping: {\n byClass: true,\n },\n supportsFiltering: true,\n })}\n FROM ${informationContentElementFilterClauses.from} this\n ${informationContentElementFilterClauses.joins}\n WHERE\n this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n ${informationContentElementFilterClauses.where ? `AND ${informationContentElementFilterClauses.where}` : \"\"}\n `,\n bindings: modelIds.map((id) => ({ type: \"id\", value: id })),\n },\n });\n return defs;\n }\n\n private async createCategoryChildrenQuery(props: DefineInstanceNodeChildHierarchyLevelProps & { viewType: \"2d\" | \"3d\" }): Promise<HierarchyLevelDefinition> {\n const { parentNodeInstanceIds: categoryIds, parentNode, instanceFilter, viewType } = props;\n const modelIds = parseIdsSelectorResult(parentNode.extendedData?.modelIds);\n\n // We only want to handle a category added as a child of `GeometricModel2d` or `GeometricModel3d`.\n // ModelIds is not empty only if parent node is a geometric model.\n if (modelIds.length === 0) {\n return this.createElementChildrenQuery(props);\n }\n\n const { elementClass, modelClass } = getClassesByView(viewType);\n return Promise.all(\n getElementsSelectProps({ modelClass, elementClass }).map(async ({ selectProps, whereClause }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: elementClass, alias: \"this\" },\n });\n return {\n fullClassName: elementClass,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: elementClass,\n }),\n },\n grouping: {\n byClass: true,\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Category.Id IN (${categoryIds.map(() => \"?\").join(\",\")})\n AND this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n AND this.Parent.Id IS NULL\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: [...categoryIds.map((id) => ({ type: \"id\", value: id })), ...modelIds.map((id) => ({ type: \"id\", value: id }))] as ECSqlBinding[],\n },\n };\n }),\n );\n }\n\n private async createModelChildrenQuery({\n parentNodeInstanceIds: modelIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: {\n byClass: true,\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps?.hasChildren,\n supportsFiltering: selectProps?.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IS NULL\n AND this.Model.Id IN (${modelIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: modelIds.map((id): ECSqlBinding => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createGroupInformationElementChildElementsQuery({\n parentNodeInstanceIds: groupIds,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return [\n {\n node: {\n key: \"ChildrenNode\",\n label: \"Children\",\n extendedData: {\n groupIds,\n imageId: \"icon-hierarchy-tree\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n {\n node: {\n key: \"MembersNode\",\n label: \"Members\",\n extendedData: {\n groupIds,\n imageId: \"icon-group\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n ];\n }\n\n private async createChildrenNodeChildrenQuery({ parentNode, instanceFilter }: DefineGenericNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const groupIds: string[] = parentNode.extendedData?.groupIds;\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n grouping: { byClass: true },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IN (${groupIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createGroupInformationElementMemberElementsQuery({\n parentNode,\n instanceFilter,\n }: DefineGenericNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const groupIds: string[] = parentNode.extendedData?.groupIds;\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: { byClass: true },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.ElementGroupsMembers egm ON egm.TargetECInstanceId = this.ECInstanceId\n ${instanceFilterClauses.joins}\n WHERE\n egm.SourceECInstanceId IN (${groupIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n\n private async createElementChildrenQuery({\n parentNodeInstanceIds: elementIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n getElementsSelectProps().map(async ({ classFullName, whereClause, selectProps }) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: classFullName, alias: \"this\" },\n });\n return {\n fullClassName: classFullName,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: classFullName,\n }),\n },\n grouping: { byClass: true },\n extendedData: {\n imageId: \"icon-item\",\n },\n hasChildren: selectProps.hasChildren,\n supportsFiltering: selectProps.supportsFiltering,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.Element p ON p.ECInstanceId = this.Parent.Id\n ${instanceFilterClauses.joins}\n WHERE\n p.ECInstanceId IN (${elementIds.map(() => \"?\").join(\",\")})\n ${whereClause ? `AND ${whereClause}` : \"\"}\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: elementIds.map((id) => ({ type: \"id\", value: id })),\n },\n };\n }),\n );\n }\n}\n\nfunction getElementsSelectProps(props?: { modelClass?: string; elementClass?: \"BisCore.GeometricElement3d\" | \"BisCore.GeometricElement2d\" }) {\n const modelClassFullName = props?.modelClass ?? CLASS_NAME_Model;\n const elementClassFullName = props?.elementClass ?? CLASS_NAME_Element;\n const result = [\n {\n classFullName: elementClassFullName,\n whereClause: \"this.ECClassId IS NOT (BisCore.GroupInformationElement)\",\n selectProps: {\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM (\n SELECT Parent.Id ParentId FROM ${elementClassFullName}\n UNION ALL\n SELECT sm.ModeledElement.Id ParentId FROM ${modelClassFullName} sm WHERE EXISTS (SELECT 1 FROM ${elementClassFullName} WHERE Model.Id = sm.ECInstanceId)\n )\n WHERE ParentId = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n supportsFiltering: true,\n },\n },\n ];\n\n if (!props?.elementClass) {\n result.push({\n classFullName: \"BisCore.GroupInformationElement\",\n whereClause: \"\",\n selectProps: {\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM (\n SELECT Parent.Id ParentId FROM ${CLASS_NAME_Element}\n UNION ALL\n SELECT SourceECInstanceId ParentId FROM BisCore.ElementGroupsMembers\n )\n WHERE ParentId = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n supportsFiltering: false,\n },\n });\n }\n\n return result;\n}\n"]}
|