@itwin/tree-widget-react 4.0.0-alpha.2 → 4.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +281 -1
- package/README.md +190 -63
- package/lib/esm/tree-widget-react/TreeWidget.d.ts +7 -4
- package/lib/esm/tree-widget-react/TreeWidget.js +32 -12
- package/lib/esm/tree-widget-react/TreeWidget.js.map +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.d.ts +7 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js +22 -23
- package/lib/esm/tree-widget-react/components/TreeWidgetComponentImpl.js.map +1 -1
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js +4 -3
- package/lib/esm/tree-widget-react/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/ErrorState.js +4 -3
- package/lib/esm/tree-widget-react/components/tree-header/ErrorState.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SearchBox.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SearchBox.js +6 -6
- package/lib/esm/tree-widget-react/components/tree-header/SearchBox.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.css +3 -2
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.d.ts +4 -4
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.js +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/SelectableTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.css +1 -0
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.d.ts +12 -5
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.js +13 -9
- package/lib/esm/tree-widget-react/components/tree-header/WidgetHeader.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js +3 -2
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.d.ts +11 -7
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js +64 -14
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeButtons.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.d.ts +8 -6
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js +4 -4
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.d.ts +41 -8
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js +700 -125
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.d.ts +18 -7
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js +124 -83
- package/lib/esm/tree-widget-react/components/trees/categories-tree/UseCategoriesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.d.ts +70 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js +504 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeIdsCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.d.ts +41 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.js +50 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/CategoriesTreeNode.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.d.ts +27 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js +136 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/UseFilteredPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.d.ts +54 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js +291 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.d.ts +64 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js +94 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.d.ts +36 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js +219 -0
- package/lib/esm/tree-widget-react/components/trees/categories-tree/internal/visibility/FilteredTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.d.ts +12 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js +19 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.d.ts +30 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js +47 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeComponent.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.d.ts +45 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js +569 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.d.ts +6 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.js +33 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.d.ts +24 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js +115 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.d.ts +44 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js +61 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.d.ts +50 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js +364 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeIdsCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.d.ts +19 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.js +32 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/ClassificationsTreeNode.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.d.ts +20 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js +53 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/UseFilteredPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.d.ts +37 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js +177 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.d.ts +55 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js +53 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHelper.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.d.ts +32 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js +168 -0
- package/lib/esm/tree-widget-react/components/trees/classifications-tree/internal/visibility/FilteredTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.d.ts +11 -23
- package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js +22 -76
- package/lib/esm/tree-widget-react/components/trees/common/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.d.ts +28 -4
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.js +73 -2
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContext.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.js +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/TreeErrors.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.d.ts +186 -0
- package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.js +79 -0
- package/lib/esm/tree-widget-react/components/trees/common/TreeWidgetViewport.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.d.ts +15 -7
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js +33 -22
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyVisibility.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.js +2 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseTelemetryContext.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/Utils.d.ts +45 -23
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js +110 -44
- package/lib/esm/tree-widget-react/components/trees/common/Utils.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.d.ts +2 -3
- package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.js +4 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/BaseTreeRenderer.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.js +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/Delayed.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.css +25 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.d.ts +27 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js +47 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.d.ts +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js +4 -3
- package/lib/esm/tree-widget-react/components/trees/common/components/ProgressOverlay.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.css +16 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.d.ts +7 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.js +19 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/SkeletonTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.css +11 -0
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.d.ts +9 -12
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js +55 -38
- package/lib/esm/tree-widget-react/components/trees/common/components/Tree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.css +2 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.d.ts +24 -8
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js +41 -25
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.d.ts +6 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js +13 -4
- package/lib/esm/tree-widget-react/components/trees/common/components/TreeRenderer.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.d.ts +6 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.js +7 -7
- package/lib/esm/tree-widget-react/components/trees/common/components/UseVisibilityButtonHandler.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.d.ts +5 -5
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js +10 -6
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.d.ts +5 -3
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js +17 -15
- package/lib/esm/tree-widget-react/components/trees/common/components/VisibilityTreeRenderer.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.d.ts +74 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js +207 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/AlwaysAndNeverDrawnElementInfo.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.d.ts +43 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js +47 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ClassNameDefinitions.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.d.ts +12 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.js +112 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/ModelCategoryElementsCountCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{Rxjs.d.ts → internal/Rxjs.d.ts} +9 -2
- package/lib/esm/tree-widget-react/components/trees/common/{Rxjs.js → internal/Rxjs.js} +10 -2
- package/lib/esm/tree-widget-react/components/trees/common/internal/Rxjs.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{Tooltip.d.ts → internal/Tooltip.d.ts} +4 -8
- package/lib/esm/tree-widget-react/components/trees/common/internal/Tooltip.js +18 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Tooltip.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Types.d.ts +14 -0
- package/lib/esm/tree-widget-react/components/{tree-header/SearchBox.css → trees/common/internal/Types.js} +2 -4
- package/lib/esm/tree-widget-react/components/trees/common/internal/Types.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.d.ts +6 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.js +24 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseActiveTreeWidgetViewport.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchiesLocalization.d.ts → internal/UseHierarchiesLocalization.d.ts} +3 -2
- package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchiesLocalization.js → internal/UseHierarchiesLocalization.js} +6 -2
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseHierarchiesLocalization.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchyFiltering.d.ts → internal/UseHierarchyFiltering.d.ts} +1 -1
- package/lib/esm/tree-widget-react/components/trees/common/{UseHierarchyFiltering.js → internal/UseHierarchyFiltering.js} +5 -4
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseHierarchyFiltering.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.d.ts +17 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js +32 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelAccess.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseIModelChangeListener.d.ts → internal/UseIModelChangeListener.d.ts} +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/{UseIModelChangeListener.js → internal/UseIModelChangeListener.js} +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/UseIModelChangeListener.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.d.ts +70 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js +172 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/Utils.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.d.ts +20 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.js +60 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityChangeEventListener.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.d.ts +39 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js +160 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/VisibilityUtils.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.d.ts +3 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.js +12 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useGuid.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.d.ts +68 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js +170 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseCachedVisibility.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.d.ts +20 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js +46 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/useTreeHooks/UseIdsCache.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.d.ts +91 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js +112 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseFilteredTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.d.ts +236 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js +600 -0
- package/lib/esm/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.d.ts +2 -0
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.js +11 -0
- package/lib/esm/tree-widget-react/components/trees/common/useGuid.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +7 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js +29 -20
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +2 -6
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +5 -6
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js +36 -21
- package/lib/esm/tree-widget-react/components/trees/external-sources-tree/ExternalSourcesTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.d.ts +9 -2
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js +48 -36
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +2 -6
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js +2 -2
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.d.ts +13 -4
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js +80 -74
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/IModelContentTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.d.ts +7 -10
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js +45 -36
- package/lib/esm/tree-widget-react/components/trees/imodel-content-tree/internal/IModelContentTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/index.d.ts +16 -5
- package/lib/esm/tree-widget-react/components/trees/index.js +16 -4
- package/lib/esm/tree-widget-react/components/trees/index.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js +3 -2
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.d.ts +3 -3
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js +34 -24
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeButtons.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.d.ts +14 -7
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js +11 -7
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.d.ts +24 -20
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js +193 -154
- package/lib/esm/tree-widget-react/components/trees/models-tree/ModelsTreeDefinition.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.d.ts +60 -10
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js +97 -238
- package/lib/esm/tree-widget-react/components/trees/models-tree/UseModelsTree.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.d.ts +22 -25
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js +280 -298
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeIdsCache.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.d.ts +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeNode.js.map +1 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.d.ts +41 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js +253 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/UseFilteredPaths.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.d.ts +27 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js +148 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/FilteredTree.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.d.ts +76 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js +269 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.js.map +1 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.d.ts +53 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js +71 -0
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.js.map +1 -0
- package/lib/esm/tree-widget-react-internal.d.ts +12 -0
- package/lib/esm/tree-widget-react-internal.js +18 -0
- package/lib/esm/tree-widget-react-internal.js.map +1 -0
- package/lib/public/locales/en/TreeWidget.json +41 -54
- package/package.json +76 -79
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.d.ts +0 -28
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.js +0 -87
- package/lib/esm/tree-widget-react/components/trees/categories-tree/CategoriesVisibilityHandler.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.d.ts +0 -7
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.js +0 -66
- package/lib/esm/tree-widget-react/components/trees/common/FocusedInstancesContextProvider.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/Rxjs.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/Tooltip.js +0 -24
- package/lib/esm/tree-widget-react/components/trees/common/Tooltip.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.d.ts +0 -7
- package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.js +0 -21
- package/lib/esm/tree-widget-react/components/trees/common/UseActiveViewport.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.d.ts +0 -11
- package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.js +0 -24
- package/lib/esm/tree-widget-react/components/trees/common/UseFiltering.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchiesLocalization.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseHierarchyFiltering.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseIModelChangeListener.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.d.ts +0 -20
- package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.js +0 -127
- package/lib/esm/tree-widget-react/components/trees/common/UseNodeHighlighting.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.d.ts +0 -7
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.js +0 -12
- package/lib/esm/tree-widget-react/components/trees/common/components/EmptyTreeContent.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.d.ts +0 -7
- package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.js +0 -21
- package/lib/esm/tree-widget-react/components/trees/models-tree/Utils.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.d.ts +0 -29
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js +0 -138
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/AlwaysAndNeverDrawnElementInfo.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.d.ts +0 -25
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js +0 -173
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/FilteredTree.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.d.ts +0 -106
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js +0 -663
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/ModelsTreeVisibilityHandler.js.map +0 -1
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.d.ts +0 -12
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.js +0 -48
- package/lib/esm/tree-widget-react/components/trees/models-tree/internal/VisibilityChangeEventListener.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassificationsTreeDefinition.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EACL,WAAW,EACX,cAAc,EACd,KAAK,EACL,KAAK,EACL,cAAc,EACd,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,aAAa,EACb,GAAG,EACH,KAAK,EACL,QAAQ,EACR,EAAE,EACF,MAAM,EACN,SAAS,EACT,OAAO,GACR,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,6BAA6B,EAAE,uCAAuC,EAAE,MAAM,iCAAiC,CAAC;AACzH,OAAO,EAAE,yCAAyC,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAClH,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,kBAAkB,EAClB,oCAAoC,EACpC,2BAA2B,EAC3B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,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WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;YACvB,KAAK,KAAK;gBACR,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,6BAA6B,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;gBAChF,MAAM;YACR,KAAK,KAAK;gBACR,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,6BAA6B,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;gBAChF,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,GAAG,CAAC,gBAAgB,EAAE,CAAC;AAChE,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 {\n bufferCount,\n defaultIfEmpty,\n defer,\n EMPTY,\n firstValueFrom,\n from,\n fromEvent,\n identity,\n lastValueFrom,\n map,\n merge,\n mergeMap,\n of,\n reduce,\n takeUntil,\n toArray,\n} from \"rxjs\";\nimport { Guid } from \"@itwin/core-bentley\";\nimport { createNodesQueryClauseFactory, createPredicateBasedHierarchyDefinition } from \"@itwin/presentation-hierarchies\";\nimport { createBisInstanceLabelSelectClauseFactory, ECSql, parseFullClassName } from \"@itwin/presentation-shared\";\nimport {\n CLASS_NAME_Classification,\n CLASS_NAME_ClassificationSystem,\n CLASS_NAME_ClassificationTable,\n CLASS_NAME_Element,\n CLASS_NAME_ElementHasClassifications,\n CLASS_NAME_GeometricElement,\n CLASS_NAME_GeometricElement2d,\n CLASS_NAME_GeometricElement3d,\n} from \"../common/internal/ClassNameDefinitions.js\";\nimport { getOptimalBatchSize, releaseMainThreadOnItemsCount } from \"../common/internal/Utils.js\";\nimport { FilterLimitExceededError } from \"../common/TreeErrors.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { GuidString, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport type {\n DefineHierarchyLevelProps,\n DefineInstanceNodeChildHierarchyLevelProps,\n DefineRootHierarchyLevelProps,\n GenericInstanceFilter,\n HierarchyDefinition,\n HierarchyLevelDefinition,\n HierarchyNodeIdentifiersPath,\n InstancesNodeKey,\n LimitingECSqlQueryExecutor,\n NodesQueryClauseFactory,\n} from \"@itwin/presentation-hierarchies\";\nimport type { ECClassHierarchyInspector, ECSchemaProvider, ECSqlQueryRow, IInstanceLabelSelectClauseFactory, InstanceKey } from \"@itwin/presentation-shared\";\nimport type { ElementId } from \"../common/internal/Types.js\";\nimport type { NormalizedHierarchyFilteringPath } from \"../common/Utils.js\";\nimport type { ClassificationId, ClassificationsTreeIdsCache, ClassificationTableId } from \"./internal/ClassificationsTreeIdsCache.js\";\n\nconst MAX_FILTERING_INSTANCE_KEY_COUNT = 100;\n\ninterface ClassificationsTreeDefinitionProps {\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector & LimitingECSqlQueryExecutor & { imodelKey: string };\n getIdsCache: (imodelKey: string) => ClassificationsTreeIdsCache;\n hierarchyConfig: ClassificationsTreeHierarchyConfiguration;\n}\n\n/** @alpha */\nexport interface ClassificationsTreeHierarchyConfiguration {\n /**\n * The classifications' hierarchy starts at the root `ClassificationSystem` element. This attribute identifiers that\n * root `ClassificationSystem`.\n */\n rootClassificationSystemCode: string;\n}\n\ninterface ClassificationsTreeInstanceKeyPathsBaseProps {\n imodelAccess: ECClassHierarchyInspector & LimitingECSqlQueryExecutor;\n limit?: number | \"unbounded\";\n idsCache: ClassificationsTreeIdsCache;\n hierarchyConfig: ClassificationsTreeHierarchyConfiguration;\n componentId?: GuidString;\n abortSignal?: AbortSignal;\n}\n\n/** @internal */\nexport interface ClassificationsTreeInstanceKeyPathsFromInstanceLabelProps extends ClassificationsTreeInstanceKeyPathsBaseProps {\n label: string;\n}\n\n/** @internal */\nexport interface ClassificationsTreeInstanceKeyPathsFromInstanceKeysProps extends ClassificationsTreeInstanceKeyPathsBaseProps {\n targetItems: Array<InstanceKey>;\n}\n\n/** @internal */\nexport class ClassificationsTreeDefinition implements HierarchyDefinition {\n #impl: HierarchyDefinition;\n #selectQueryFactory: NodesQueryClauseFactory;\n #nodeLabelSelectClauseFactory: IInstanceLabelSelectClauseFactory;\n #props: ClassificationsTreeDefinitionProps;\n static #componentName = \"ClassificationsTreeDefinition\";\n\n public constructor(props: ClassificationsTreeDefinitionProps) {\n this.#props = props;\n this.#nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: this.#props.imodelAccess });\n this.#selectQueryFactory = createNodesQueryClauseFactory({\n imodelAccess: props.imodelAccess,\n instanceLabelSelectClauseFactory: this.#nodeLabelSelectClauseFactory,\n });\n this.#impl = createPredicateBasedHierarchyDefinition({\n classHierarchyInspector: props.imodelAccess,\n hierarchy: {\n rootNodes: async (requestProps: DefineRootHierarchyLevelProps) => this.#createClassificationTablesQuery(requestProps),\n childNodes: [\n {\n parentInstancesNodePredicate: CLASS_NAME_ClassificationTable,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.#createClassificationTableChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_Classification,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.#createClassificationChildrenQuery(requestProps),\n },\n {\n parentInstancesNodePredicate: CLASS_NAME_GeometricElement,\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.#createGeometricElementChildrenQuery(requestProps),\n },\n ],\n },\n });\n }\n\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps) {\n return this.#impl.defineHierarchyLevel(props);\n }\n\n async #createClassificationTablesQuery(props: { instanceFilter?: GenericInstanceFilter }): Promise<HierarchyLevelDefinition> {\n const { instanceFilter } = props;\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_ClassificationTable, alias: \"this\" },\n });\n return [\n {\n fullClassName: CLASS_NAME_ClassificationTable,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: ECSql.createRawPropertyValueSelector(\"this\", \"ECClassId\") },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: CLASS_NAME_ClassificationTable,\n }),\n },\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM ${CLASS_NAME_Classification} classification\n WHERE classification.Model.Id = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n extendedData: {\n type: \"ClassificationTable\",\n },\n supportsFiltering: true,\n })}\n FROM\n ${instanceFilterClauses.from} this\n JOIN ${CLASS_NAME_ClassificationSystem} system ON system.ECInstanceId = this.Parent.Id\n ${instanceFilterClauses.joins}\n WHERE\n system.CodeValue = '${this.#props.hierarchyConfig.rootClassificationSystemCode}'\n AND NOT this.IsPrivate\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n },\n },\n ];\n }\n\n async #createClassificationTableChildrenQuery(props: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const { parentNodeInstanceIds: classificationTableIds, instanceFilter, parentNode } = props;\n const imodelKey = getParentNodeIModelKey(parentNode.key);\n if (!imodelKey) {\n return [];\n }\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_Classification, alias: \"this\" },\n });\n const classificationIds = await firstValueFrom(this.#props.getIdsCache(imodelKey).getDirectChildClassifications(classificationTableIds));\n return classificationIds.length\n ? [\n {\n fullClassName: CLASS_NAME_Classification,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: ECSql.createRawPropertyValueSelector(\"this\", \"ECClassId\") },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: CLASS_NAME_Classification,\n }),\n },\n hasChildren: {\n selector: createClassificationHasChildrenSelector(\"this\"),\n },\n extendedData: {\n type: \"Classification\",\n },\n supportsFiltering: true,\n })}\n FROM\n ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${classificationIds.join(\",\")})\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n },\n },\n ]\n : [];\n }\n\n async #createClassificationChildrenQuery(props: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const { parentNodeInstanceIds: parentClassificationIds, instanceFilter, parentNode } = props;\n const parentImodelKey = getParentNodeIModelKey(parentNode.key);\n if (!parentImodelKey) {\n return [];\n }\n const classificationIds = await firstValueFrom(this.#props.getIdsCache(parentImodelKey).getDirectChildClassifications(parentClassificationIds));\n return [\n // load child classifications\n ...(classificationIds.length\n ? [\n await (async () => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: CLASS_NAME_Classification, alias: \"this\" },\n });\n return {\n fullClassName: CLASS_NAME_Classification,\n query: {\n ecsql: `\n SELECT\n ${await this.#selectQueryFactory.createSelectClause({\n ecClassId: { selector: ECSql.createRawPropertyValueSelector(\"this\", \"ECClassId\") },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.#nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: CLASS_NAME_Classification,\n }),\n },\n hasChildren: {\n selector: createClassificationHasChildrenSelector(\"this\"),\n },\n extendedData: {\n type: \"Classification\",\n },\n supportsFiltering: true,\n })}\n FROM\n ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.ECInstanceId IN (${classificationIds.join(\",\")})\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n },\n };\n })(),\n ]\n : []),\n // load classification elements\n ...(await Promise.all(\n [CLASS_NAME_GeometricElement2d, CLASS_NAME_GeometricElement3d].map(async (elementClassName) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: elementClassName, alias: \"this\" },\n });\n return {\n fullClassName: elementClassName,\n query: {\n ecsql: `\n SELECT ${await this.#createElementSelectClause(elementClassName)}\n FROM ${instanceFilterClauses.from} this\n JOIN ${CLASS_NAME_ElementHasClassifications} ehc ON ehc.SourceECInstanceId = this.ECInstanceId\n ${instanceFilterClauses.joins}\n WHERE\n ehc.TargetECInstanceId IN (${parentClassificationIds.join(\",\")})\n AND this.Parent.Id IS NULL\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n },\n };\n }),\n )),\n ];\n }\n\n async #createGeometricElementChildrenQuery({\n parentNodeInstanceIds: parentElementIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n return Promise.all(\n [CLASS_NAME_GeometricElement2d, CLASS_NAME_GeometricElement3d].map(async (elementClassName) => {\n const instanceFilterClauses = await this.#selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: elementClassName, alias: \"this\" },\n });\n return {\n fullClassName: elementClassName,\n query: {\n ecsql: `\n SELECT ${await this.#createElementSelectClause(elementClassName)}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n WHERE\n this.Parent.Id IN (${parentElementIds.join(\",\")})\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n },\n };\n }),\n );\n }\n\n async #createElementSelectClause(elementFullClassName: string): Promise<string> {\n const { className: elementClassName } = parseFullClassName(elementFullClassName);\n return 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: elementFullClassName,\n }),\n },\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM ${CLASS_NAME_Element} ce\n WHERE ce.Parent.Id = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n extendedData: {\n type: elementClassName,\n modelId: { selector: \"IdToHex(this.Model.Id)\" },\n categoryId: { selector: \"IdToHex(this.Category.Id)\" },\n },\n supportsFiltering: true,\n });\n }\n\n public static async createInstanceKeyPaths(\n props: ClassificationsTreeInstanceKeyPathsFromInstanceLabelProps | ClassificationsTreeInstanceKeyPathsFromInstanceKeysProps,\n ): Promise<NormalizedHierarchyFilteringPath[]> {\n return lastValueFrom(\n defer(() => {\n const componentInfo = { componentId: props.componentId ?? Guid.createValue(), componentName: this.#componentName };\n if (\"label\" in props) {\n const labelsFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });\n return createInstanceKeyPathsFromInstanceLabelObs({ ...props, ...componentInfo, labelsFactory });\n }\n return createInstanceKeyPathsFromTargetItemsObs({ ...props, ...componentInfo });\n }).pipe(props.abortSignal ? takeUntil(fromEvent(props.abortSignal, \"abort\")) : identity, defaultIfEmpty([])),\n );\n }\n}\n\nfunction getParentNodeIModelKey(instanceKey: InstancesNodeKey): string | undefined {\n return instanceKey.instanceKeys[0]?.imodelKey;\n}\n\nfunction createClassificationHasChildrenSelector(classificationAlias: string) {\n return `\n COALESCE((\n SELECT 1\n FROM ${CLASS_NAME_Classification} classification\n WHERE classification.Parent.Id = ${classificationAlias}.ECInstanceId\n LIMIT 1\n ), (\n SELECT 1\n FROM ${CLASS_NAME_ElementHasClassifications} ehc\n WHERE ehc.TargetECInstanceId = ${classificationAlias}.ECInstanceId\n LIMIT 1\n ),\n 0\n )\n `;\n}\n\nfunction createInstanceKeyPathsFromInstanceLabelObs({\n label,\n ...props\n}: Omit<ClassificationsTreeInstanceKeyPathsFromInstanceLabelProps, \"componentId\" | \"componentName\" | \"abortSignal\"> & {\n labelsFactory: IInstanceLabelSelectClauseFactory;\n componentName: string;\n componentId: string;\n}): Observable<NormalizedHierarchyFilteringPath[]> {\n const adjustedLabel = label.replace(/[%_\\\\]/g, \"\\\\$&\");\n\n const CLASSIFICATION_TABLES_WITH_LABELS_CTE = \"ClassificationTablesWithLabels\";\n const CLASSIFICATIONS_WITH_LABELS_CTE = \"ClassificationsWithLabels\";\n const ELEMENTS_2D_WITH_LABELS_CTE = \"Elements2dWithLabels\";\n const ELEMENTS_3D_WITH_LABELS_CTE = \"Elements3dWithLabels\";\n return defer(async () => {\n const [classificationTableLabelSelectClause, classificationLabelSelectClause, element2dLabelSelectClause, element3dLabelSelectClause] = await Promise.all(\n [CLASS_NAME_ClassificationTable, CLASS_NAME_Classification, CLASS_NAME_GeometricElement2d, CLASS_NAME_GeometricElement3d].map(async (className) =>\n props.labelsFactory.createSelectClause({ classAlias: \"this\", className }),\n ),\n );\n const classificationIds = await firstValueFrom(props.idsCache.getAllClassifications());\n const ctes = [\n `\n ${CLASSIFICATION_TABLES_WITH_LABELS_CTE}(ClassName, ECInstanceId, DisplayLabel) AS (\n SELECT\n 'ct',\n this.ECInstanceId,\n ${classificationTableLabelSelectClause}\n FROM\n ${CLASS_NAME_ClassificationTable} this\n JOIN ${CLASS_NAME_ClassificationSystem} system ON system.ECInstanceId = this.Parent.Id\n WHERE\n system.CodeValue = '${props.hierarchyConfig.rootClassificationSystemCode}'\n AND NOT this.IsPrivate\n )\n `,\n ...(classificationIds.length > 0\n ? [\n `${CLASSIFICATIONS_WITH_LABELS_CTE}(ClassName, ECInstanceId, DisplayLabel) AS (\n SELECT\n 'c',\n this.ECInstanceId,\n ${classificationLabelSelectClause}\n FROM\n ${CLASS_NAME_Classification} this\n WHERE\n this.ECInstanceId IN (${classificationIds.join(\",\")})\n )`,\n `${ELEMENTS_2D_WITH_LABELS_CTE}(ClassName, ECInstanceId, DisplayLabel) AS (\n SELECT\n 'e2d',\n this.ECInstanceId,\n ${element2dLabelSelectClause}\n FROM\n ${CLASS_NAME_GeometricElement2d} this\n JOIN ${CLASS_NAME_ElementHasClassifications} ehc ON ehc.SourceECInstanceId = this.ECInstanceId\n WHERE\n ehc.TargetECInstanceId IN (${classificationIds.join(\",\")})\n AND this.Parent.Id IS NULL\n\n UNION ALL\n\n SELECT\n 'e2d',\n this.ECInstanceId,\n ${element2dLabelSelectClause}\n FROM\n ${CLASS_NAME_GeometricElement2d} this\n JOIN ${ELEMENTS_2D_WITH_LABELS_CTE} pe ON pe.ECInstanceId = this.Parent.Id\n )`,\n `${ELEMENTS_3D_WITH_LABELS_CTE}(ClassName, ECInstanceId, DisplayLabel) AS (\n SELECT\n 'e3d',\n this.ECInstanceId,\n ${element3dLabelSelectClause}\n FROM\n ${CLASS_NAME_GeometricElement3d} this\n JOIN ${CLASS_NAME_ElementHasClassifications} ehc ON ehc.SourceECInstanceId = this.ECInstanceId\n WHERE\n ehc.TargetECInstanceId IN (${classificationIds.join(\",\")})\n AND this.Parent.Id IS NULL\n\n UNION ALL\n\n SELECT\n 'e3d',\n this.ECInstanceId,\n ${element3dLabelSelectClause}\n FROM\n ${CLASS_NAME_GeometricElement3d} this\n JOIN ${ELEMENTS_3D_WITH_LABELS_CTE} pe ON pe.ECInstanceId = this.Parent.Id\n )`,\n ]\n : []),\n ];\n const ecsql = `\n SELECT * FROM (\n SELECT\n ct.ClassName AS ClassName,\n ct.ECInstanceId AS ECInstanceId\n FROM\n ${CLASSIFICATION_TABLES_WITH_LABELS_CTE} ct\n WHERE\n ct.DisplayLabel LIKE '%' || ? || '%' ESCAPE '\\\\'\n\n ${\n classificationIds.length > 0\n ? `\n UNION ALL\n\n SELECT\n c.ClassName AS ClassName,\n c.ECInstanceId AS ECInstanceId\n FROM\n ${CLASSIFICATIONS_WITH_LABELS_CTE} c\n WHERE\n c.DisplayLabel LIKE '%' || ? || '%' ESCAPE '\\\\'\n\n UNION ALL\n\n SELECT\n e2d.ClassName AS ClassName,\n e2d.ECInstanceId AS ECInstanceId\n FROM\n ${ELEMENTS_2D_WITH_LABELS_CTE} e2d\n WHERE\n e2d.DisplayLabel LIKE '%' || ? || '%' ESCAPE '\\\\'\n\n UNION ALL\n\n SELECT\n e3d.ClassName AS ClassName,\n e3d.ECInstanceId AS ECInstanceId\n FROM\n ${ELEMENTS_3D_WITH_LABELS_CTE} e3d\n WHERE\n e3d.DisplayLabel LIKE '%' || ? || '%' ESCAPE '\\\\'\n `\n : \"\"\n }\n )\n ${props.limit === undefined ? `LIMIT ${MAX_FILTERING_INSTANCE_KEY_COUNT + 1}` : props.limit !== \"unbounded\" ? `LIMIT ${props.limit}` : \"\"}\n `;\n const bindings = [\n { type: \"string\" as const, value: adjustedLabel },\n ...(classificationIds.length > 0\n ? [\n { type: \"string\" as const, value: adjustedLabel },\n { type: \"string\" as const, value: adjustedLabel },\n { type: \"string\" as const, value: adjustedLabel },\n ]\n : []),\n ];\n return { ctes, ecsql, bindings };\n }).pipe(\n mergeMap((queryProps) =>\n props.imodelAccess.createQueryReader(queryProps, { restartToken: `${props.componentName}/${props.componentId}/filter-by-label`, limit: props.limit }),\n ),\n map((row): InstanceKey => {\n let className: string;\n switch (row.ClassName) {\n case \"ct\":\n className = CLASS_NAME_ClassificationTable;\n break;\n case \"c\":\n className = CLASS_NAME_Classification;\n break;\n case \"e2d\":\n className = CLASS_NAME_GeometricElement2d;\n break;\n default:\n className = CLASS_NAME_GeometricElement3d;\n break;\n }\n return {\n className,\n id: row.ECInstanceId,\n };\n }),\n toArray(),\n mergeMap((targetKeys) => createInstanceKeyPathsFromTargetItemsObs({ ...props, targetItems: targetKeys })),\n );\n}\n\nfunction createInstanceKeyPathsFromTargetItemsObs({\n idsCache,\n imodelAccess,\n limit,\n componentId,\n targetItems,\n componentName,\n}: Omit<ClassificationsTreeInstanceKeyPathsFromInstanceKeysProps, \"abortSignal\" | \"componentId\"> & {\n componentId: GuidString;\n componentName: string;\n}): Observable<NormalizedHierarchyFilteringPath[]> {\n const actualLimit = limit ?? MAX_FILTERING_INSTANCE_KEY_COUNT;\n if (actualLimit !== \"unbounded\" && targetItems.length > actualLimit) {\n throw new FilterLimitExceededError(actualLimit);\n }\n return from(targetItems).pipe(\n releaseMainThreadOnItemsCount(2000),\n mergeMap(async (key): Promise<{ id: Id64String; type: number }> => {\n if (await imodelAccess.classDerivesFrom(key.className, CLASS_NAME_ClassificationTable)) {\n return { id: key.id, type: 0 };\n }\n\n if (await imodelAccess.classDerivesFrom(key.className, CLASS_NAME_Classification)) {\n return { id: key.id, type: 1 };\n }\n\n if (await imodelAccess.classDerivesFrom(key.className, CLASS_NAME_GeometricElement2d)) {\n return { id: key.id, type: 2 };\n }\n\n return { id: key.id, type: 3 };\n }, 2),\n\n reduce(\n (acc, { id, type }) => {\n switch (type) {\n case 0:\n acc.classificationTableIds.push(id);\n break;\n case 1:\n acc.classificationIds.push(id);\n break;\n case 2:\n acc.element2dIds.push(id);\n break;\n case 3:\n acc.element3dIds.push(id);\n break;\n }\n return acc;\n },\n {\n classificationTableIds: new Array<ClassificationTableId>(),\n classificationIds: new Array<ClassificationId>(),\n element2dIds: new Array<ElementId>(),\n element3dIds: new Array<ElementId>(),\n },\n ),\n mergeMap((ids) => {\n const elements2dLength = ids.element2dIds.length;\n const elements3dLength = ids.element3dIds.length;\n const getElementsPathsObs = (elementType: \"2d\" | \"3d\") =>\n from(elementType === \"2d\" ? ids.element2dIds : ids.element3dIds).pipe(\n bufferCount(getOptimalBatchSize({ totalSize: elementType === \"2d\" ? elements2dLength : elements3dLength, maximumBatchSize: 5000 })),\n releaseMainThreadOnItemsCount(1),\n mergeMap(\n (block, chunkIndex) =>\n createGeometricElementInstanceKeyPaths({ idsCache, imodelAccess, targetItems: block, type: elementType, chunkIndex, componentId, componentName }),\n 10,\n ),\n );\n\n return merge(\n from(ids.classificationTableIds).pipe(map((id) => ({ path: [{ id, className: CLASS_NAME_ClassificationTable }], options: { reveal: true } }))),\n idsCache.getClassificationsPathObs(ids.classificationIds).pipe(map((path) => ({ path, options: { reveal: true } }))),\n getElementsPathsObs(\"2d\"),\n getElementsPathsObs(\"3d\"),\n );\n }),\n toArray(),\n );\n}\n\nfunction createGeometricElementInstanceKeyPaths(props: {\n idsCache: ClassificationsTreeIdsCache;\n imodelAccess: ECClassHierarchyInspector & LimitingECSqlQueryExecutor;\n targetItems: Id64Array;\n type: \"2d\" | \"3d\";\n componentId: GuidString;\n componentName: string;\n chunkIndex: number;\n}): Observable<NormalizedHierarchyFilteringPath> {\n const { targetItems, imodelAccess, type, idsCache, componentId, componentName, chunkIndex } = props;\n if (targetItems.length === 0) {\n return EMPTY;\n }\n\n const separator = \";\";\n\n return defer(() => {\n const ctes = [\n `ElementsHierarchy(ECInstanceId, ParentId, Path) AS (\n SELECT\n e.ECInstanceId,\n e.Parent.Id,\n 'e${type}${separator}' || CAST(IdToHex([e].[ECInstanceId]) AS TEXT)\n FROM ${CLASS_NAME_Element} e\n WHERE e.ECInstanceId IN (${targetItems.join(\",\")})\n\n UNION ALL\n\n SELECT\n pe.ECInstanceId,\n pe.Parent.Id,\n 'e${type}${separator}' || CAST(IdToHex([pe].[ECInstanceId]) AS TEXT) || '${separator}' || ce.Path\n FROM ElementsHierarchy ce\n JOIN ${CLASS_NAME_Element} pe ON pe.ECInstanceId = ce.ParentId\n )`,\n ];\n const ecsql = `\n SELECT\n e.Path path,\n c.ECInstanceId classificationId\n FROM\n ${CLASS_NAME_Classification} c\n JOIN ${CLASS_NAME_ElementHasClassifications} ehc ON ehc.TargetECInstanceId = c.ECInstanceId\n JOIN ElementsHierarchy e ON ehc.SourceECInstanceId = e.ECInstanceId\n WHERE e.ParentId IS NULL\n `;\n\n return imodelAccess.createQueryReader(\n { ctes, ecsql },\n { rowFormat: \"ECSqlPropertyNames\", limit: \"unbounded\", restartToken: `${componentName}/${componentId}/elements${type}-filter-paths/${chunkIndex}` },\n );\n }).pipe(\n releaseMainThreadOnItemsCount(300),\n map((row) => parseQueryRow(row, separator)),\n mergeMap(({ path, parentClassificationId }) => {\n if (parentClassificationId) {\n return idsCache\n .getClassificationsPathObs(parentClassificationId)\n .pipe(map((parentClassificationPath) => ({ path: parentClassificationPath.concat(path), options: { reveal: true } })));\n }\n return of({ path, options: { reveal: true } });\n }),\n );\n}\n\nfunction parseQueryRow(row: ECSqlQueryRow, separator: string): { path: HierarchyNodeIdentifiersPath; parentClassificationId: Id64String | undefined } {\n const rowElements: string[] = row.path.split(separator);\n const path: HierarchyNodeIdentifiersPath = [];\n for (let i = 0; i < rowElements.length; i += 2) {\n switch (rowElements[i]) {\n case \"e2d\":\n path.push({ className: CLASS_NAME_GeometricElement2d, id: rowElements[i + 1] });\n break;\n case \"e3d\":\n path.push({ className: CLASS_NAME_GeometricElement3d, id: rowElements[i + 1] });\n break;\n }\n }\n\n return { path, parentClassificationId: row.classificationId };\n}\n"]}
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PresentationHierarchyNode } from "@itwin/presentation-hierarchies-react";
|
|
2
|
+
/** @beta */
|
|
3
|
+
export declare function ClassificationsTreeIcon({ node }: {
|
|
4
|
+
node: PresentationHierarchyNode;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element | undefined;
|
|
6
|
+
//# sourceMappingURL=ClassificationsTreeIcon.d.ts.map
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import { Icon } from "@stratakit/foundations";
|
|
7
|
+
import icon2d from "@stratakit/icons/2d.svg";
|
|
8
|
+
import icon3d from "@stratakit/icons/3d.svg";
|
|
9
|
+
import iconBisDefinitionsContainer from "@stratakit/icons/bis-definitions-container.svg";
|
|
10
|
+
import iconBisElement from "@stratakit/icons/bis-element.svg";
|
|
11
|
+
/** @beta */
|
|
12
|
+
export function ClassificationsTreeIcon({ node }) {
|
|
13
|
+
if (node.nodeData.extendedData?.type === undefined) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const getIcon = () => {
|
|
17
|
+
// FIXME: icons...
|
|
18
|
+
switch (node.nodeData.extendedData.type) {
|
|
19
|
+
case "ClassificationTable":
|
|
20
|
+
return iconBisDefinitionsContainer;
|
|
21
|
+
case "Classification":
|
|
22
|
+
return iconBisDefinitionsContainer;
|
|
23
|
+
case "GeometricElement3d":
|
|
24
|
+
return icon3d;
|
|
25
|
+
case "GeometricElement2d":
|
|
26
|
+
return icon2d;
|
|
27
|
+
default:
|
|
28
|
+
return iconBisElement;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return _jsx(Icon, { href: getIcon() });
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ClassificationsTreeIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassificationsTreeIcon.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/classifications-tree/ClassificationsTreeIcon.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,2BAA2B,MAAM,gDAAgD,CAAC;AACzF,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAI9D,YAAY;AACZ,MAAM,UAAU,uBAAuB,CAAC,EAAE,IAAI,EAAuC;IACnF,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;QACnD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,kBAAkB;QAClB,QAAQ,IAAI,CAAC,QAAQ,CAAC,YAAa,CAAC,IAAI,EAAE,CAAC;YACzC,KAAK,qBAAqB;gBACxB,OAAO,2BAA2B,CAAC;YACrC,KAAK,gBAAgB;gBACnB,OAAO,2BAA2B,CAAC;YACrC,KAAK,oBAAoB;gBACvB,OAAO,MAAM,CAAC;YAChB,KAAK,oBAAoB;gBACvB,OAAO,MAAM,CAAC;YAChB;gBACE,OAAO,cAAc,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,KAAC,IAAI,IAAC,IAAI,EAAE,OAAO,EAAE,GAAI,CAAC;AACnC,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 { Icon } from \"@stratakit/foundations\";\nimport icon2d from \"@stratakit/icons/2d.svg\";\nimport icon3d from \"@stratakit/icons/3d.svg\";\nimport iconBisDefinitionsContainer from \"@stratakit/icons/bis-definitions-container.svg\";\nimport iconBisElement from \"@stratakit/icons/bis-element.svg\";\n\nimport type { PresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\n\n/** @beta */\nexport function ClassificationsTreeIcon({ node }: { node: PresentationHierarchyNode }) {\n if (node.nodeData.extendedData?.type === undefined) {\n return undefined;\n }\n\n const getIcon = () => {\n // FIXME: icons...\n switch (node.nodeData.extendedData!.type) {\n case \"ClassificationTable\":\n return iconBisDefinitionsContainer;\n case \"Classification\":\n return iconBisDefinitionsContainer;\n case \"GeometricElement3d\":\n return icon3d;\n case \"GeometricElement2d\":\n return icon2d;\n default:\n return iconBisElement;\n }\n };\n\n return <Icon href={getIcon()} />;\n}\n"]}
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { VisibilityTreeProps } from "../common/components/VisibilityTree.js";
|
|
3
|
+
import type { VisibilityTreeRendererProps } from "../common/components/VisibilityTreeRenderer.js";
|
|
4
|
+
import type { TreeWidgetViewport } from "../common/TreeWidgetViewport.js";
|
|
5
|
+
import type { ClassificationsTreeHierarchyConfiguration } from "./ClassificationsTreeDefinition.js";
|
|
6
|
+
/** @alpha */
|
|
7
|
+
export interface UseClassificationsTreeProps {
|
|
8
|
+
activeView: TreeWidgetViewport;
|
|
9
|
+
hierarchyConfig: ClassificationsTreeHierarchyConfiguration;
|
|
10
|
+
emptyTreeContent?: ReactNode;
|
|
11
|
+
filter?: string;
|
|
12
|
+
}
|
|
13
|
+
/** @alpha */
|
|
14
|
+
interface UseClassificationsTreeResult {
|
|
15
|
+
classificationsTreeProps: Pick<VisibilityTreeProps, "treeName" | "getHierarchyDefinition" | "visibilityHandlerFactory" | "getFilteredPaths" | "emptyTreeContent" | "highlightText">;
|
|
16
|
+
rendererProps: Required<Pick<VisibilityTreeRendererProps, "getDecorations">>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Custom hook to create and manage state for the categories tree.
|
|
20
|
+
* @alpha
|
|
21
|
+
*/
|
|
22
|
+
export declare function useClassificationsTree({ activeView, emptyTreeContent, filter, ...rest }: UseClassificationsTreeProps): UseClassificationsTreeResult;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=UseClassificationsTree.d.ts.map
|
package/lib/esm/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import { useCallback, useEffect, useMemo } from "react";
|
|
7
|
+
import { createECSqlQueryExecutor } from "@itwin/presentation-core-interop";
|
|
8
|
+
import iconBisCategory3d from "@stratakit/icons/bis-category-3d.svg";
|
|
9
|
+
import { EmptyTreeContent, FilterUnknownError, NoFilterMatches, TooManyFilterMatches } from "../common/components/EmptyTree.js";
|
|
10
|
+
import { useGuid } from "../common/internal/useGuid.js";
|
|
11
|
+
import { useCachedVisibility } from "../common/internal/useTreeHooks/UseCachedVisibility.js";
|
|
12
|
+
import { useIdsCache } from "../common/internal/useTreeHooks/UseIdsCache.js";
|
|
13
|
+
import { ClassificationsTreeComponent } from "./ClassificationsTreeComponent.js";
|
|
14
|
+
import { ClassificationsTreeDefinition } from "./ClassificationsTreeDefinition.js";
|
|
15
|
+
import { ClassificationsTreeIcon } from "./ClassificationsTreeIcon.js";
|
|
16
|
+
import { ClassificationsTreeIdsCache } from "./internal/ClassificationsTreeIdsCache.js";
|
|
17
|
+
import { useFilteredPaths } from "./internal/UseFilteredPaths.js";
|
|
18
|
+
import { ClassificationsTreeVisibilityHandler } from "./internal/visibility/ClassificationsTreeVisibilityHandler.js";
|
|
19
|
+
import { createFilteredClassificationsTree } from "./internal/visibility/FilteredTree.js";
|
|
20
|
+
/**
|
|
21
|
+
* Custom hook to create and manage state for the categories tree.
|
|
22
|
+
* @alpha
|
|
23
|
+
*/
|
|
24
|
+
export function useClassificationsTree({ activeView, emptyTreeContent, filter, ...rest }) {
|
|
25
|
+
const hierarchyConfig = useMemo(() => ({ ...rest.hierarchyConfig }),
|
|
26
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
|
+
[...Object.values(rest.hierarchyConfig)]);
|
|
28
|
+
const componentId = useGuid();
|
|
29
|
+
const { getCache: getClassificationsTreeIdsCache } = useIdsCache({
|
|
30
|
+
imodel: activeView.iModel,
|
|
31
|
+
createCache,
|
|
32
|
+
cacheSpecificProps: useMemo(() => ({ hierarchyConfig }), [hierarchyConfig]),
|
|
33
|
+
componentId,
|
|
34
|
+
});
|
|
35
|
+
const { visibilityHandlerFactory, onFilteredPathsChanged } = useClassificationsCachedVisibility({
|
|
36
|
+
activeView,
|
|
37
|
+
getCache: getClassificationsTreeIdsCache,
|
|
38
|
+
componentId,
|
|
39
|
+
});
|
|
40
|
+
const getHierarchyDefinition = useCallback((props) => {
|
|
41
|
+
return new ClassificationsTreeDefinition({ ...props, getIdsCache: getClassificationsTreeIdsCache, hierarchyConfig });
|
|
42
|
+
}, [getClassificationsTreeIdsCache, hierarchyConfig]);
|
|
43
|
+
const { getPaths, filteringError } = useFilteredPaths({
|
|
44
|
+
hierarchyConfiguration: hierarchyConfig,
|
|
45
|
+
filter,
|
|
46
|
+
getClassificationsTreeIdsCache,
|
|
47
|
+
onFilteredPathsChanged,
|
|
48
|
+
componentId,
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
classificationsTreeProps: {
|
|
52
|
+
treeName: ClassificationsTreeComponent.id,
|
|
53
|
+
getHierarchyDefinition,
|
|
54
|
+
visibilityHandlerFactory,
|
|
55
|
+
getFilteredPaths: getPaths,
|
|
56
|
+
emptyTreeContent: useMemo(() => getEmptyTreeContentComponent(filter, filteringError, emptyTreeContent), [filter, filteringError, emptyTreeContent]),
|
|
57
|
+
highlightText: filter,
|
|
58
|
+
},
|
|
59
|
+
rendererProps: {
|
|
60
|
+
getDecorations: useCallback((node) => _jsx(ClassificationsTreeIcon, { node: node }), []),
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function createCache(props) {
|
|
65
|
+
return new ClassificationsTreeIdsCache(createECSqlQueryExecutor(props.imodel), props.specificProps.hierarchyConfig, props.componentId);
|
|
66
|
+
}
|
|
67
|
+
function getEmptyTreeContentComponent(filter, error, emptyTreeContent) {
|
|
68
|
+
if (error) {
|
|
69
|
+
if (error === "tooManyFilterMatches") {
|
|
70
|
+
return _jsx(TooManyFilterMatches, { base: "classificationsTree" });
|
|
71
|
+
}
|
|
72
|
+
return _jsx(FilterUnknownError, { base: "classificationsTree" });
|
|
73
|
+
}
|
|
74
|
+
if (filter) {
|
|
75
|
+
return _jsx(NoFilterMatches, { base: "classificationsTree" });
|
|
76
|
+
}
|
|
77
|
+
if (emptyTreeContent) {
|
|
78
|
+
return emptyTreeContent;
|
|
79
|
+
}
|
|
80
|
+
return _jsx(EmptyTreeContent, { icon: iconBisCategory3d });
|
|
81
|
+
}
|
|
82
|
+
function useClassificationsCachedVisibility(props) {
|
|
83
|
+
const { activeView, getCache, componentId } = props;
|
|
84
|
+
const { visibilityHandlerFactory, filteredPaths, onFilteredPathsChanged } = useCachedVisibility({
|
|
85
|
+
activeView,
|
|
86
|
+
getCache,
|
|
87
|
+
createFilteredTree,
|
|
88
|
+
createTreeSpecificVisibilityHandler,
|
|
89
|
+
componentId,
|
|
90
|
+
});
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
getCache().clearFilteredElementsData();
|
|
93
|
+
}, [filteredPaths, getCache]);
|
|
94
|
+
return {
|
|
95
|
+
visibilityHandlerFactory,
|
|
96
|
+
onFilteredPathsChanged,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
async function createFilteredTree(props) {
|
|
100
|
+
const { filteringPaths, getCache, imodelAccess } = props;
|
|
101
|
+
return createFilteredClassificationsTree({
|
|
102
|
+
idsCache: getCache(),
|
|
103
|
+
filteringPaths,
|
|
104
|
+
imodelAccess,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function createTreeSpecificVisibilityHandler(props) {
|
|
108
|
+
const { info, getCache, viewport } = props;
|
|
109
|
+
return new ClassificationsTreeVisibilityHandler({
|
|
110
|
+
alwaysAndNeverDrawnElementInfo: info,
|
|
111
|
+
idsCache: getCache(),
|
|
112
|
+
viewport,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=UseClassificationsTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UseClassificationsTree.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/classifications-tree/UseClassificationsTree.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,iBAAiB,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAChI,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oCAAoC,EAAE,MAAM,+DAA+D,CAAC;AACrH,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AA+B1F;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,IAAI,EAA+B;IACnH,MAAM,eAAe,GAAG,OAAO,CAC7B,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IACnC,uDAAuD;IACvD,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,e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C;IAE9B,OAAO;QACL,wBAAwB;QACxB,sBAAsB;KACvB,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,KAA2D;IAC3F,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACzD,OAAO,iCAAiC,CAAC;QACvC,QAAQ,EAAE,QAAQ,EAAE;QACpB,cAAc;QACd,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mCAAmC,CAAC,KAA4E;IACvH,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3C,OAAO,IAAI,oCAAoC,CAAC;QAC9C,8BAA8B,EAAE,IAAI;QACpC,QAAQ,EAAE,QAAQ,EAAE;QACpB,QAAQ;KACT,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { useCallback, useEffect, useMemo } from \"react\";\nimport { createECSqlQueryExecutor } from \"@itwin/presentation-core-interop\";\nimport iconBisCategory3d from \"@stratakit/icons/bis-category-3d.svg\";\nimport { EmptyTreeContent, FilterUnknownError, NoFilterMatches, TooManyFilterMatches } from \"../common/components/EmptyTree.js\";\nimport { useGuid } from \"../common/internal/useGuid.js\";\nimport { useCachedVisibility } from \"../common/internal/useTreeHooks/UseCachedVisibility.js\";\nimport { useIdsCache } from \"../common/internal/useTreeHooks/UseIdsCache.js\";\nimport { ClassificationsTreeComponent } from \"./ClassificationsTreeComponent.js\";\nimport { ClassificationsTreeDefinition } from \"./ClassificationsTreeDefinition.js\";\nimport { ClassificationsTreeIcon } from \"./ClassificationsTreeIcon.js\";\nimport { ClassificationsTreeIdsCache } from \"./internal/ClassificationsTreeIdsCache.js\";\nimport { useFilteredPaths } from \"./internal/UseFilteredPaths.js\";\nimport { ClassificationsTreeVisibilityHandler } from \"./internal/visibility/ClassificationsTreeVisibilityHandler.js\";\nimport { createFilteredClassificationsTree } from \"./internal/visibility/FilteredTree.js\";\n\nimport type { ReactNode } from \"react\";\nimport type { GuidString } from \"@itwin/core-bentley\";\nimport type { VisibilityTreeProps } from \"../common/components/VisibilityTree.js\";\nimport type { VisibilityTreeRendererProps } from \"../common/components/VisibilityTreeRenderer.js\";\nimport type { CreateFilteredTreeProps, CreateTreeSpecificVisibilityHandlerProps } from \"../common/internal/useTreeHooks/UseCachedVisibility.js\";\nimport type { CreateCacheProps } from \"../common/internal/useTreeHooks/UseIdsCache.js\";\nimport type { FilteredTree } from \"../common/internal/visibility/BaseFilteredTree.js\";\nimport type { TreeWidgetViewport } from \"../common/TreeWidgetViewport.js\";\nimport type { ClassificationsTreeHierarchyConfiguration } from \"./ClassificationsTreeDefinition.js\";\nimport type { ClassificationsTreeFilteringError } from \"./internal/UseFilteredPaths.js\";\nimport type { ClassificationsTreeFilterTargets } from \"./internal/visibility/FilteredTree.js\";\n\n/** @alpha */\nexport interface UseClassificationsTreeProps {\n activeView: TreeWidgetViewport;\n hierarchyConfig: ClassificationsTreeHierarchyConfiguration;\n emptyTreeContent?: ReactNode;\n filter?: string;\n}\n\n/** @alpha */\ninterface UseClassificationsTreeResult {\n classificationsTreeProps: Pick<\n VisibilityTreeProps,\n \"treeName\" | \"getHierarchyDefinition\" | \"visibilityHandlerFactory\" | \"getFilteredPaths\" | \"emptyTreeContent\" | \"highlightText\"\n >;\n rendererProps: Required<Pick<VisibilityTreeRendererProps, \"getDecorations\">>;\n}\n\n/**\n * Custom hook to create and manage state for the categories tree.\n * @alpha\n */\nexport function useClassificationsTree({ activeView, emptyTreeContent, filter, ...rest }: UseClassificationsTreeProps): UseClassificationsTreeResult {\n const hierarchyConfig = useMemo(\n () => ({ ...rest.hierarchyConfig }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [...Object.values(rest.hierarchyConfig)],\n );\n const componentId = useGuid();\n\n const { getCache: getClassificationsTreeIdsCache } = useIdsCache<ClassificationsTreeIdsCache, { hierarchyConfig: ClassificationsTreeHierarchyConfiguration }>(\n {\n imodel: activeView.iModel,\n createCache,\n cacheSpecificProps: useMemo(() => ({ hierarchyConfig }), [hierarchyConfig]),\n componentId,\n },\n );\n\n const { visibilityHandlerFactory, onFilteredPathsChanged } = useClassificationsCachedVisibility({\n activeView,\n getCache: getClassificationsTreeIdsCache,\n componentId,\n });\n\n const getHierarchyDefinition = useCallback<VisibilityTreeProps[\"getHierarchyDefinition\"]>(\n (props) => {\n return new ClassificationsTreeDefinition({ ...props, getIdsCache: getClassificationsTreeIdsCache, hierarchyConfig });\n },\n [getClassificationsTreeIdsCache, hierarchyConfig],\n );\n\n const { getPaths, filteringError } = useFilteredPaths({\n hierarchyConfiguration: hierarchyConfig,\n filter,\n getClassificationsTreeIdsCache,\n onFilteredPathsChanged,\n componentId,\n });\n\n return {\n classificationsTreeProps: {\n treeName: ClassificationsTreeComponent.id,\n getHierarchyDefinition,\n visibilityHandlerFactory,\n getFilteredPaths: getPaths,\n emptyTreeContent: useMemo(() => getEmptyTreeContentComponent(filter, filteringError, emptyTreeContent), [filter, filteringError, emptyTreeContent]),\n highlightText: filter,\n },\n rendererProps: {\n getDecorations: useCallback((node) => <ClassificationsTreeIcon node={node} />, []),\n },\n };\n}\n\nfunction createCache(props: CreateCacheProps<{ hierarchyConfig: ClassificationsTreeHierarchyConfiguration }>) {\n return new ClassificationsTreeIdsCache(createECSqlQueryExecutor(props.imodel), props.specificProps.hierarchyConfig, props.componentId);\n}\n\nfunction getEmptyTreeContentComponent(filter?: string, error?: ClassificationsTreeFilteringError, emptyTreeContent?: React.ReactNode) {\n if (error) {\n if (error === \"tooManyFilterMatches\") {\n return <TooManyFilterMatches base={\"classificationsTree\"} />;\n }\n return <FilterUnknownError base={\"classificationsTree\"} />;\n }\n if (filter) {\n return <NoFilterMatches base={\"classificationsTree\"} />;\n }\n if (emptyTreeContent) {\n return emptyTreeContent;\n }\n return <EmptyTreeContent icon={iconBisCategory3d} />;\n}\n\nfunction useClassificationsCachedVisibility(props: { activeView: TreeWidgetViewport; getCache: () => ClassificationsTreeIdsCache; componentId: GuidString }) {\n const { activeView, getCache, componentId } = props;\n const { visibilityHandlerFactory, filteredPaths, onFilteredPathsChanged } = useCachedVisibility<\n ClassificationsTreeIdsCache,\n ClassificationsTreeFilterTargets\n >({\n activeView,\n getCache,\n createFilteredTree,\n createTreeSpecificVisibilityHandler,\n componentId,\n });\n\n useEffect(() => {\n getCache().clearFilteredElementsData();\n }, [filteredPaths, getCache]);\n\n return {\n visibilityHandlerFactory,\n onFilteredPathsChanged,\n };\n}\n\nasync function createFilteredTree(props: CreateFilteredTreeProps<ClassificationsTreeIdsCache>): Promise<FilteredTree<ClassificationsTreeFilterTargets>> {\n const { filteringPaths, getCache, imodelAccess } = props;\n return createFilteredClassificationsTree({\n idsCache: getCache(),\n filteringPaths,\n imodelAccess,\n });\n}\n\nfunction createTreeSpecificVisibilityHandler(props: CreateTreeSpecificVisibilityHandlerProps<ClassificationsTreeIdsCache>) {\n const { info, getCache, viewport } = props;\n return new ClassificationsTreeVisibilityHandler({\n alwaysAndNeverDrawnElementInfo: info,\n idsCache: getCache(),\n viewport,\n });\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { HierarchyDefinition } from "@itwin/presentation-hierarchies";
|
|
2
|
+
import type { useIModelTree, useTree } from "@itwin/presentation-hierarchies-react";
|
|
3
|
+
import type { InstanceKey } from "@itwin/presentation-shared";
|
|
4
|
+
import type { FunctionProps } from "../common/Utils.js";
|
|
5
|
+
import type { ClassificationsTreeHierarchyConfiguration } from "./ClassificationsTreeDefinition.js";
|
|
6
|
+
/** @alpha */
|
|
7
|
+
interface UseClassificationsTreeDefinitionProps {
|
|
8
|
+
/**
|
|
9
|
+
* A list of iModels to create merged hierarchy for.
|
|
10
|
+
*
|
|
11
|
+
* **Warning:** These **must** all be different versions of the same iModel, ordered from the earliest to the
|
|
12
|
+
* latest version. Not obeying this rule may result in undefined behavior.
|
|
13
|
+
*/
|
|
14
|
+
imodels: Array<{
|
|
15
|
+
/**
|
|
16
|
+
* An object that provides access to iModel's data and metadata.
|
|
17
|
+
*/
|
|
18
|
+
imodelAccess: FunctionProps<typeof useIModelTree>["imodelAccess"];
|
|
19
|
+
}>;
|
|
20
|
+
hierarchyConfig: ClassificationsTreeHierarchyConfiguration;
|
|
21
|
+
/**
|
|
22
|
+
* Optional search parameters to filter tree nodes.
|
|
23
|
+
*/
|
|
24
|
+
search?: {
|
|
25
|
+
/**
|
|
26
|
+
* Text used to filter tree nodes by label.
|
|
27
|
+
*/
|
|
28
|
+
searchText: string;
|
|
29
|
+
} | {
|
|
30
|
+
/**
|
|
31
|
+
* List of instance keys to filter tree nodes by.
|
|
32
|
+
*/
|
|
33
|
+
targetItems: Array<InstanceKey>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** @alpha */
|
|
37
|
+
interface UseClassificationsTreeDefinitionResult {
|
|
38
|
+
definition: HierarchyDefinition;
|
|
39
|
+
getFilteredPaths?: FunctionProps<typeof useTree>["getFilteredPaths"];
|
|
40
|
+
}
|
|
41
|
+
/** @alpha */
|
|
42
|
+
export declare function useClassificationsTreeDefinition(props: UseClassificationsTreeDefinitionProps): UseClassificationsTreeDefinitionResult;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=UseClassificationsTreeDefinition.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { useMemo, useRef } from "react";
|
|
6
|
+
import { assert } from "@itwin/core-bentley";
|
|
7
|
+
import { ClassificationsTreeDefinition } from "./ClassificationsTreeDefinition.js";
|
|
8
|
+
import { ClassificationsTreeIdsCache } from "./internal/ClassificationsTreeIdsCache.js";
|
|
9
|
+
/** @alpha */
|
|
10
|
+
export function useClassificationsTreeDefinition(props) {
|
|
11
|
+
const { imodels, hierarchyConfig, search } = props;
|
|
12
|
+
const idsCaches = useRef(new Map());
|
|
13
|
+
const definition = useMemo(() => {
|
|
14
|
+
return new ClassificationsTreeDefinition({
|
|
15
|
+
imodelAccess: imodels[imodels.length - 1].imodelAccess,
|
|
16
|
+
getIdsCache: (imodelKey) => getOrCreateIdsCache({
|
|
17
|
+
imodelKey,
|
|
18
|
+
imodels,
|
|
19
|
+
idsCaches,
|
|
20
|
+
hierarchyConfig,
|
|
21
|
+
}),
|
|
22
|
+
hierarchyConfig,
|
|
23
|
+
});
|
|
24
|
+
}, [imodels, hierarchyConfig]);
|
|
25
|
+
const searchTerm = search ? ("searchText" in search ? search.searchText : search.targetItems) : undefined;
|
|
26
|
+
const getFilteredPaths = useMemo(() => {
|
|
27
|
+
if (!searchTerm) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
return async ({ abortSignal }) => {
|
|
31
|
+
const [first, ...rest] = await Promise.all(imodels.map(async ({ imodelAccess }) => ClassificationsTreeDefinition.createInstanceKeyPaths({
|
|
32
|
+
hierarchyConfig,
|
|
33
|
+
idsCache: getOrCreateIdsCache({
|
|
34
|
+
imodelKey: imodelAccess.imodelKey,
|
|
35
|
+
imodels,
|
|
36
|
+
idsCaches,
|
|
37
|
+
hierarchyConfig,
|
|
38
|
+
}),
|
|
39
|
+
imodelAccess,
|
|
40
|
+
abortSignal,
|
|
41
|
+
...(typeof searchTerm === "string" ? { label: searchTerm } : { targetItems: searchTerm }),
|
|
42
|
+
})));
|
|
43
|
+
return first.concat(...rest);
|
|
44
|
+
};
|
|
45
|
+
}, [imodels, hierarchyConfig, searchTerm]);
|
|
46
|
+
return {
|
|
47
|
+
definition,
|
|
48
|
+
getFilteredPaths,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function getOrCreateIdsCache({ imodelKey, imodels, hierarchyConfig, idsCaches, }) {
|
|
52
|
+
let idsCache = idsCaches.current.get(imodelKey);
|
|
53
|
+
if (!idsCache) {
|
|
54
|
+
const imodel = imodels.find((currImodel) => currImodel.imodelAccess.imodelKey === imodelKey);
|
|
55
|
+
assert(!!imodel);
|
|
56
|
+
idsCache = new ClassificationsTreeIdsCache(imodel.imodelAccess, hierarchyConfig);
|
|
57
|
+
idsCaches.current.set(imodelKey, idsCache);
|
|
58
|
+
}
|
|
59
|
+
return idsCache;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=UseClassificationsTreeDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UseClassificationsTreeDefinition.js","sourceRoot":"","sources":["../../../../../../src/tree-widget-react/components/trees/classifications-tree/UseClassificationsTreeDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAgDxF,aAAa;AACb,MAAM,UAAU,gCAAgC,CAAC,KAA4C;IAC3F,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEnD,MAAM,SAAS,GAAG,MAAM,CAA2C,IAAI,GAAG,EAAE,CAAC,CAAC;IAE9E,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,OAAO,IAAI,6BAA6B,CAAC;YACvC,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY;YACtD,WAAW,EAAE,CAAC,SAAiB,EAAE,EAAE,CACjC,mBAAmB,CAAC;gBAClB,SAAS;gB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ED,SAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,OAAO,EACP,eAAe,EACf,SAAS,GAQV;IACC,IAAI,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAChD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;QAC7F,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACjB,QAAQ,GAAG,IAAI,2BAA2B,CAAC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;QACjF,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,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 { useMemo, useRef } from \"react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { ClassificationsTreeDefinition } from \"./ClassificationsTreeDefinition.js\";\nimport { ClassificationsTreeIdsCache } from \"./internal/ClassificationsTreeIdsCache.js\";\n\nimport type { MutableRefObject } from \"react\";\nimport type { HierarchyDefinition } from \"@itwin/presentation-hierarchies\";\nimport type { useIModelTree, useTree } from \"@itwin/presentation-hierarchies-react\";\nimport type { InstanceKey } from \"@itwin/presentation-shared\";\nimport type { FunctionProps } from \"../common/Utils.js\";\nimport type { ClassificationsTreeHierarchyConfiguration } from \"./ClassificationsTreeDefinition.js\";\n\n/** @alpha */\ninterface UseClassificationsTreeDefinitionProps {\n /**\n * A list of iModels to create merged hierarchy for.\n *\n * **Warning:** These **must** all be different versions of the same iModel, ordered from the earliest to the\n * latest version. Not obeying this rule may result in undefined behavior.\n */\n imodels: Array<{\n /**\n * An object that provides access to iModel's data and metadata.\n */\n imodelAccess: FunctionProps<typeof useIModelTree>[\"imodelAccess\"];\n }>;\n hierarchyConfig: ClassificationsTreeHierarchyConfiguration;\n /**\n * Optional search parameters to filter tree nodes.\n */\n search?:\n | {\n /**\n * Text used to filter tree nodes by label.\n */\n searchText: string;\n }\n | {\n /**\n * List of instance keys to filter tree nodes by.\n */\n targetItems: Array<InstanceKey>;\n };\n}\n\n/** @alpha */\ninterface UseClassificationsTreeDefinitionResult {\n definition: HierarchyDefinition;\n getFilteredPaths?: FunctionProps<typeof useTree>[\"getFilteredPaths\"];\n}\n\n/** @alpha */\nexport function useClassificationsTreeDefinition(props: UseClassificationsTreeDefinitionProps): UseClassificationsTreeDefinitionResult {\n const { imodels, hierarchyConfig, search } = props;\n\n const idsCaches = useRef<Map<string, ClassificationsTreeIdsCache>>(new Map());\n\n const definition = useMemo(() => {\n return new ClassificationsTreeDefinition({\n imodelAccess: imodels[imodels.length - 1].imodelAccess,\n getIdsCache: (imodelKey: string) =>\n getOrCreateIdsCache({\n imodelKey,\n imodels,\n idsCaches,\n hierarchyConfig,\n }),\n hierarchyConfig,\n });\n }, [imodels, hierarchyConfig]);\n\n const searchTerm = search ? (\"searchText\" in search ? search.searchText : search.targetItems) : undefined;\n const getFilteredPaths = useMemo<FunctionProps<typeof useTree>[\"getFilteredPaths\"]>(() => {\n if (!searchTerm) {\n return undefined;\n }\n\n return async ({ abortSignal }) => {\n const [first, ...rest] = await Promise.all(\n imodels.map(async ({ imodelAccess }) =>\n ClassificationsTreeDefinition.createInstanceKeyPaths({\n hierarchyConfig,\n idsCache: getOrCreateIdsCache({\n imodelKey: imodelAccess.imodelKey,\n imodels,\n idsCaches,\n hierarchyConfig,\n }),\n imodelAccess,\n abortSignal,\n ...(typeof searchTerm === \"string\" ? { label: searchTerm } : { targetItems: searchTerm }),\n }),\n ),\n );\n\n return first.concat(...rest);\n };\n }, [imodels, hierarchyConfig, searchTerm]);\n\n return {\n definition,\n getFilteredPaths,\n };\n}\n\nfunction getOrCreateIdsCache({\n imodelKey,\n imodels,\n hierarchyConfig,\n idsCaches,\n}: {\n imodelKey: string;\n imodels: Array<{\n imodelAccess: FunctionProps<typeof useIModelTree>[\"imodelAccess\"];\n }>;\n hierarchyConfig: ClassificationsTreeHierarchyConfiguration;\n idsCaches: MutableRefObject<Map<string, ClassificationsTreeIdsCache>>;\n}) {\n let idsCache = idsCaches.current.get(imodelKey);\n if (!idsCache) {\n const imodel = imodels.find((currImodel) => currImodel.imodelAccess.imodelKey === imodelKey);\n assert(!!imodel);\n idsCache = new ClassificationsTreeIdsCache(imodel.imodelAccess, hierarchyConfig);\n idsCaches.current.set(imodelKey, idsCache);\n }\n return idsCache;\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Observable } from "rxjs";
|
|
2
|
+
import type { GuidString, Id64Arg, Id64Array, Id64Set, Id64String } from "@itwin/core-bentley";
|
|
3
|
+
import type { HierarchyNodeIdentifiersPath, LimitingECSqlQueryExecutor } from "@itwin/presentation-hierarchies";
|
|
4
|
+
import type { CategoryId, ElementId, ModelId } from "../../common/internal/Types.js";
|
|
5
|
+
import type { ClassificationsTreeHierarchyConfiguration } from "../ClassificationsTreeDefinition.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export type ClassificationId = Id64String;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export type ClassificationTableId = Id64String;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare class ClassificationsTreeIdsCache implements Disposable {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(queryExecutor: LimitingECSqlQueryExecutor, hierarchyConfig: ClassificationsTreeHierarchyConfiguration, componentId?: GuidString);
|
|
14
|
+
[Symbol.dispose](): void;
|
|
15
|
+
private queryElementModelCategories;
|
|
16
|
+
private getElementModelsCategories;
|
|
17
|
+
private queryModeledElements;
|
|
18
|
+
private getModelWithCategoryModeledElements;
|
|
19
|
+
getCategoriesModeledElements(modelId: Id64String, categoryIds: Id64Arg): Observable<Id64Array>;
|
|
20
|
+
getCategoriesElementModels(categoryIds: Id64Arg, includeSubModels?: boolean): Observable<Map<CategoryId, Set<ModelId>>>;
|
|
21
|
+
getModelCategoryIds(modelId: Id64String): Observable<{
|
|
22
|
+
drawing: Id64Array;
|
|
23
|
+
spatial: Id64Array;
|
|
24
|
+
}>;
|
|
25
|
+
getAllCategories(): Observable<{
|
|
26
|
+
drawing: Id64Set;
|
|
27
|
+
spatial: Id64Set;
|
|
28
|
+
}>;
|
|
29
|
+
hasSubModel(elementId: Id64String): Observable<boolean>;
|
|
30
|
+
getCategoryElementsCount(modelId: Id64String, categoryId: Id64String): Observable<number>;
|
|
31
|
+
private queryClassifications;
|
|
32
|
+
private getClassificationsInfo;
|
|
33
|
+
getAllContainedCategories(classificationOrTableIds: Id64Arg): Observable<{
|
|
34
|
+
drawing: Id64Array;
|
|
35
|
+
spatial: Id64Array;
|
|
36
|
+
}>;
|
|
37
|
+
getDirectChildClassifications(classificationOrTableIds: Id64Arg): Observable<ClassificationId[]>;
|
|
38
|
+
getClassificationsPathObs(classificationIds: Id64Arg): Observable<HierarchyNodeIdentifiersPath>;
|
|
39
|
+
getAllClassifications(): Observable<ClassificationId[]>;
|
|
40
|
+
private queryFilteredElementsData;
|
|
41
|
+
getFilteredElementsData({ element2dIds, element3dIds, }: {
|
|
42
|
+
element2dIds: Id64Arg;
|
|
43
|
+
element3dIds: Id64Arg;
|
|
44
|
+
}): Observable<Map<ElementId, {
|
|
45
|
+
categoryId: Id64String;
|
|
46
|
+
modelId: Id64String;
|
|
47
|
+
}>>;
|
|
48
|
+
clearFilteredElementsData(): void;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=ClassificationsTreeIdsCache.d.ts.map
|