@itwin/tree-widget-react 2.3.1 → 3.0.0-dev.0
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 +2 -2
- package/lib/cjs/TreeWidget.d.ts +2 -3
- package/lib/cjs/TreeWidget.js.map +1 -1
- package/lib/cjs/components/tree-header/TreeHeader.js +11 -3
- package/lib/cjs/components/tree-header/TreeHeader.js.map +1 -1
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.d.ts +1 -1
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTree.d.ts +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTreeButtons.d.ts +28 -0
- package/lib/cjs/components/trees/category-tree/CategoriesTreeButtons.js +38 -0
- package/lib/cjs/components/trees/category-tree/CategoriesTreeButtons.js.map +1 -0
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.d.ts +2 -17
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js +7 -26
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.d.ts +1 -8
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/cjs/components/trees/index.d.ts +3 -0
- package/lib/cjs/components/trees/index.js +1 -0
- package/lib/cjs/components/trees/index.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsTreeButtons.d.ts +33 -0
- package/lib/cjs/components/trees/models-tree/ModelsTreeButtons.js +86 -0
- package/lib/cjs/components/trees/models-tree/ModelsTreeButtons.js.map +1 -0
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.d.ts +2 -24
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js +24 -76
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/Utils.d.ts +2 -2
- package/lib/cjs/components/trees/models-tree/Utils.js.map +1 -1
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTree.d.ts +20 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTree.js +61 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTree.js.map +1 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTreeComponent.d.ts +16 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTreeComponent.js +43 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTreeDefinition.d.ts +23 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTreeDefinition.js +180 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesTreeDefinition.js.map +1 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesVisibilityHandler.d.ts +36 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesVisibilityHandler.js +94 -0
- package/lib/cjs/components/trees/stateless/categories-tree/CategoriesVisibilityHandler.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/FocusedInstancesContext.d.ts +13 -0
- package/lib/cjs/components/trees/stateless/common/FocusedInstancesContext.js +16 -0
- package/lib/cjs/components/trees/stateless/common/FocusedInstancesContext.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/FocusedInstancesContextProvider.d.ts +8 -0
- package/lib/cjs/components/trees/stateless/common/FocusedInstancesContextProvider.js +47 -0
- package/lib/cjs/components/trees/stateless/common/FocusedInstancesContextProvider.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchiesLocalization.d.ts +8 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchiesLocalization.js +33 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchiesLocalization.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchyFiltering.d.ts +16 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchyFiltering.js +139 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchyFiltering.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchyVisibility.d.ts +21 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchyVisibility.js +82 -0
- package/lib/cjs/components/trees/stateless/common/UseHierarchyVisibility.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/UseMultiCheckboxHandler.d.ts +13 -0
- package/lib/cjs/components/trees/stateless/common/UseMultiCheckboxHandler.js +34 -0
- package/lib/cjs/components/trees/stateless/common/UseMultiCheckboxHandler.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/Utils.d.ts +3 -0
- package/lib/cjs/components/trees/stateless/common/Utils.js +23 -0
- package/lib/cjs/components/trees/stateless/common/Utils.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/components/Delayed.d.ts +6 -0
- package/lib/cjs/components/trees/stateless/common/components/Delayed.js +31 -0
- package/lib/cjs/components/trees/stateless/common/components/Delayed.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/components/FilterableTree.d.ts +23 -0
- package/lib/cjs/components/trees/stateless/common/components/FilterableTree.js +66 -0
- package/lib/cjs/components/trees/stateless/common/components/FilterableTree.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/components/ProgressOverlay.d.ts +5 -0
- package/lib/cjs/components/trees/stateless/common/components/ProgressOverlay.js +16 -0
- package/lib/cjs/components/trees/stateless/common/components/ProgressOverlay.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/components/ProgressOverlay.scss +21 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTree.d.ts +26 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTree.js +68 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTree.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeNodeCheckbox.d.ts +12 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeNodeCheckbox.js +24 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeNodeCheckbox.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeNodeRenderer.d.ts +10 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeNodeRenderer.js +20 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeNodeRenderer.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeRenderer.d.ts +16 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeRenderer.js +23 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeRenderer.js.map +1 -0
- package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeRenderer.scss +41 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTree.d.ts +13 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTree.js +40 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTree.js.map +1 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.d.ts +14 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.js +25 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +20 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.js +244 -0
- package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.js.map +1 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTree.d.ts +13 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTree.js +48 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTree.js.map +1 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.d.ts +14 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.js +25 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeDefinition.d.ts +25 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeDefinition.js +639 -0
- package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeDefinition.js.map +1 -0
- package/lib/cjs/components/trees/stateless/index.d.ts +5 -0
- package/lib/cjs/components/trees/stateless/index.js +16 -0
- package/lib/cjs/components/trees/stateless/index.js.map +1 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTree.d.ts +16 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTree.js +77 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTree.js.map +1 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTreeComponent.d.ts +17 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTreeComponent.js +55 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTreeDefinition.d.ts +35 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTreeDefinition.js +856 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsTreeDefinition.js.map +1 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsVisibilityHandler.d.ts +48 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsVisibilityHandler.js +470 -0
- package/lib/cjs/components/trees/stateless/models-tree/ModelsVisibilityHandler.js.map +1 -0
- package/lib/esm/TreeWidget.d.ts +2 -3
- package/lib/esm/TreeWidget.js.map +1 -1
- package/lib/esm/components/tree-header/TreeHeader.js +11 -3
- package/lib/esm/components/tree-header/TreeHeader.js.map +1 -1
- package/lib/esm/components/trees/CategoriesVisibilityUtils.d.ts +1 -1
- package/lib/esm/components/trees/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTree.d.ts +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTree.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTreeButtons.d.ts +28 -0
- package/lib/esm/components/trees/category-tree/CategoriesTreeButtons.js +32 -0
- package/lib/esm/components/trees/category-tree/CategoriesTreeButtons.js.map +1 -0
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.d.ts +2 -17
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js +2 -21
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.d.ts +1 -8
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/esm/components/trees/index.d.ts +3 -0
- package/lib/esm/components/trees/index.js +1 -0
- package/lib/esm/components/trees/index.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsTreeButtons.d.ts +33 -0
- package/lib/esm/components/trees/models-tree/ModelsTreeButtons.js +77 -0
- package/lib/esm/components/trees/models-tree/ModelsTreeButtons.js.map +1 -0
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.d.ts +2 -24
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js +20 -72
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/models-tree/Utils.d.ts +2 -2
- package/lib/esm/components/trees/models-tree/Utils.js.map +1 -1
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTree.d.ts +20 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTree.js +57 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTree.js.map +1 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTreeComponent.d.ts +16 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTreeComponent.js +39 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTreeDefinition.d.ts +23 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTreeDefinition.js +176 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesTreeDefinition.js.map +1 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesVisibilityHandler.d.ts +36 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesVisibilityHandler.js +90 -0
- package/lib/esm/components/trees/stateless/categories-tree/CategoriesVisibilityHandler.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/FocusedInstancesContext.d.ts +13 -0
- package/lib/esm/components/trees/stateless/common/FocusedInstancesContext.js +12 -0
- package/lib/esm/components/trees/stateless/common/FocusedInstancesContext.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/FocusedInstancesContextProvider.d.ts +8 -0
- package/lib/esm/components/trees/stateless/common/FocusedInstancesContextProvider.js +43 -0
- package/lib/esm/components/trees/stateless/common/FocusedInstancesContextProvider.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchiesLocalization.d.ts +8 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchiesLocalization.js +29 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchiesLocalization.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchyFiltering.d.ts +16 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchyFiltering.js +135 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchyFiltering.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchyVisibility.d.ts +21 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchyVisibility.js +78 -0
- package/lib/esm/components/trees/stateless/common/UseHierarchyVisibility.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/UseMultiCheckboxHandler.d.ts +13 -0
- package/lib/esm/components/trees/stateless/common/UseMultiCheckboxHandler.js +30 -0
- package/lib/esm/components/trees/stateless/common/UseMultiCheckboxHandler.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/Utils.d.ts +3 -0
- package/lib/esm/components/trees/stateless/common/Utils.js +19 -0
- package/lib/esm/components/trees/stateless/common/Utils.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/components/Delayed.d.ts +6 -0
- package/lib/esm/components/trees/stateless/common/components/Delayed.js +27 -0
- package/lib/esm/components/trees/stateless/common/components/Delayed.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/components/FilterableTree.d.ts +23 -0
- package/lib/esm/components/trees/stateless/common/components/FilterableTree.js +62 -0
- package/lib/esm/components/trees/stateless/common/components/FilterableTree.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/components/ProgressOverlay.d.ts +5 -0
- package/lib/esm/components/trees/stateless/common/components/ProgressOverlay.js +12 -0
- package/lib/esm/components/trees/stateless/common/components/ProgressOverlay.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/components/ProgressOverlay.scss +21 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTree.d.ts +26 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTree.js +64 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTree.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeNodeCheckbox.d.ts +12 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeNodeCheckbox.js +20 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeNodeCheckbox.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeNodeRenderer.d.ts +10 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeNodeRenderer.js +13 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeNodeRenderer.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeRenderer.d.ts +16 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeRenderer.js +19 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeRenderer.js.map +1 -0
- package/lib/esm/components/trees/stateless/common/components/VisibilityTreeRenderer.scss +41 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTree.d.ts +13 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTree.js +36 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTree.js.map +1 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.d.ts +14 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.js +21 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.d.ts +20 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.js +240 -0
- package/lib/esm/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.js.map +1 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTree.d.ts +13 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTree.js +44 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTree.js.map +1 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.d.ts +14 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.js +21 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTreeDefinition.d.ts +25 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTreeDefinition.js +635 -0
- package/lib/esm/components/trees/stateless/imodel-content-tree/IModelContentTreeDefinition.js.map +1 -0
- package/lib/esm/components/trees/stateless/index.d.ts +5 -0
- package/lib/esm/components/trees/stateless/index.js +9 -0
- package/lib/esm/components/trees/stateless/index.js.map +1 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTree.d.ts +16 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTree.js +73 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTree.js.map +1 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTreeComponent.d.ts +17 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTreeComponent.js +51 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTreeDefinition.d.ts +35 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTreeDefinition.js +852 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsTreeDefinition.js.map +1 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsVisibilityHandler.d.ts +48 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsVisibilityHandler.js +466 -0
- package/lib/esm/components/trees/stateless/models-tree/ModelsVisibilityHandler.js.map +1 -0
- package/lib/public/locales/en/TreeWidget.json +21 -0
- package/package.json +7 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FilterableTree } from "../common/components/FilterableTree";
|
|
3
|
+
import type { HierarchyLevelConfig } from "../../common/Types";
|
|
4
|
+
interface StatelessExternalSourcesTreeOwnProps {
|
|
5
|
+
hierarchyLevelConfig?: Omit<HierarchyLevelConfig, "isFilteringEnabled">;
|
|
6
|
+
onPerformanceMeasured?: (featureId: string, duration: number) => void;
|
|
7
|
+
}
|
|
8
|
+
type FilterableTreeProps = Parameters<typeof FilterableTree>[0];
|
|
9
|
+
type StatelessExternalSourcesTreeProps = StatelessExternalSourcesTreeOwnProps & Pick<FilterableTreeProps, "imodel" | "getSchemaContext" | "height" | "width" | "density" | "selectionMode">;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare function StatelessExternalSourcesTree({ onPerformanceMeasured, ...props }: StatelessExternalSourcesTreeProps): JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ExternalSourcesTree.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatelessExternalSourcesTree = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/*---------------------------------------------------------------------------------------------
|
|
6
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
7
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
|
+
*--------------------------------------------------------------------------------------------*/
|
|
9
|
+
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
10
|
+
const FilterableTree_1 = require("../common/components/FilterableTree");
|
|
11
|
+
const ExternalSourcesTreeDefinition_1 = require("./ExternalSourcesTreeDefinition");
|
|
12
|
+
const StatelessExternalSourcesTreeId = "external-sources-tree-v2";
|
|
13
|
+
/** @internal */
|
|
14
|
+
function StatelessExternalSourcesTree({ onPerformanceMeasured, ...props }) {
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(FilterableTree_1.FilterableTree, { ...props, treeName: "StatelessExternalSourcesTree", getHierarchyDefinition: getDefinitionsProvider, getIcon: getIcon, selectionMode: props.selectionMode ?? "none", onPerformanceMeasured: (action, duration) => {
|
|
16
|
+
onPerformanceMeasured?.(`${StatelessExternalSourcesTreeId}-${action}`, duration);
|
|
17
|
+
} }));
|
|
18
|
+
}
|
|
19
|
+
exports.StatelessExternalSourcesTree = StatelessExternalSourcesTree;
|
|
20
|
+
;
|
|
21
|
+
function getDefinitionsProvider(props) {
|
|
22
|
+
return new ExternalSourcesTreeDefinition_1.ExternalSourcesTreeDefinition(props);
|
|
23
|
+
}
|
|
24
|
+
function getIcon(node) {
|
|
25
|
+
if (node.extendedData?.imageId === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
switch (node.extendedData.imageId) {
|
|
29
|
+
case "icon-item":
|
|
30
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgItem, {});
|
|
31
|
+
case "icon-ec-class":
|
|
32
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgItem, {});
|
|
33
|
+
case "icon-document":
|
|
34
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgDocument, {});
|
|
35
|
+
case "icon-ec-schema":
|
|
36
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgDetails, {});
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=ExternalSourcesTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalSourcesTree.js","sourceRoot":"","sources":["../../../../../../src/components/trees/stateless/external-sources-tree/ExternalSourcesTree.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,oEAA8E;AAC9E,wEAAqE;AACrE,mFAAgF;AAgBhF,MAAM,8BAA8B,GAAG,0BAA0B,CAAC;AAElE,gBAAgB;AAChB,SAAgB,4BAA4B,CAAC,EAAE,qBAAqB,EAAE,GAAG,KAAK,EAAqC;IACjH,OAAO,CACL,uBAAC,+BAAc,OACT,KAAK,EACT,QAAQ,EAAC,8BAA8B,EACvC,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,MAAM,EAC5C,qBAAqB,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;YAC1C,qBAAqB,EAAE,CAAC,GAAG,8BAA8B,IAAI,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC;QACnF,CAAC,GACD,CACH,CAAC;AACJ,CAAC;AAbD,oEAaC;AAAA,CAAC;AAEF,SAAS,sBAAsB,CAAC,KAA6D;IAC3F,OAAO,IAAI,6DAA6B,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,OAAO,CAAC,IAA+B;IAC9C,IAAI,IAAI,CAAC,YAAY,EAAE,OAAO,KAAK,SAAS,EAAE;QAC5C,OAAO,SAAS,CAAC;KAClB;IAED,QAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;QACjC,KAAK,WAAW;YACd,OAAO,uBAAC,6BAAO,KAAG,CAAC;QACrB,KAAK,eAAe;YAClB,OAAO,uBAAC,6BAAO,KAAG,CAAC;QACrB,KAAK,eAAe;YAClB,OAAO,uBAAC,iCAAW,KAAG,CAAC;QACzB,KAAK,gBAAgB;YACnB,OAAO,uBAAC,gCAAU,KAAG,CAAC;KACzB;IAED,OAAO,SAAS,CAAC;AACnB,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 { SvgDetails, SvgDocument, SvgItem } from \"@itwin/itwinui-icons-react\";\nimport { FilterableTree } from \"../common/components/FilterableTree\";\nimport { ExternalSourcesTreeDefinition } from \"./ExternalSourcesTreeDefinition\";\n\nimport type { ReactElement } from \"react\";\nimport type { PresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\nimport type { HierarchyLevelConfig } from \"../../common/Types\";\n\ninterface StatelessExternalSourcesTreeOwnProps {\n hierarchyLevelConfig?: Omit<HierarchyLevelConfig, \"isFilteringEnabled\">;\n onPerformanceMeasured?: (featureId: string, duration: number) => void;\n}\n\ntype FilterableTreeProps = Parameters<typeof FilterableTree>[0];\ntype GetHierarchyDefinitionsProviderCallback = FilterableTreeProps[\"getHierarchyDefinition\"];\ntype StatelessExternalSourcesTreeProps = StatelessExternalSourcesTreeOwnProps &\n Pick<FilterableTreeProps, \"imodel\" | \"getSchemaContext\" | \"height\" | \"width\" | \"density\" | \"selectionMode\">;\n\nconst StatelessExternalSourcesTreeId = \"external-sources-tree-v2\";\n\n/** @internal */\nexport function StatelessExternalSourcesTree({ onPerformanceMeasured, ...props }: StatelessExternalSourcesTreeProps) {\n return (\n <FilterableTree\n {...props}\n treeName=\"StatelessExternalSourcesTree\"\n getHierarchyDefinition={getDefinitionsProvider}\n getIcon={getIcon}\n selectionMode={props.selectionMode ?? \"none\"}\n onPerformanceMeasured={(action, duration) => {\n onPerformanceMeasured?.(`${StatelessExternalSourcesTreeId}-${action}`, duration);\n }}\n />\n );\n};\n\nfunction getDefinitionsProvider(props: Parameters<GetHierarchyDefinitionsProviderCallback>[0]) {\n return new ExternalSourcesTreeDefinition(props);\n}\n\nfunction getIcon(node: PresentationHierarchyNode): ReactElement | undefined {\n if (node.extendedData?.imageId === undefined) {\n return undefined;\n }\n\n switch (node.extendedData.imageId) {\n case \"icon-item\":\n return <SvgItem />;\n case \"icon-ec-class\":\n return <SvgItem />;\n case \"icon-document\":\n return <SvgDocument />;\n case \"icon-ec-schema\":\n return <SvgDetails />;\n }\n\n return undefined;\n}\n"]}
|
package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StatelessExternalSourcesTree } from "./ExternalSourcesTree";
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
import type { SelectionStorage } from "@itwin/presentation-hierarchies-react";
|
|
4
|
+
type StatelessExternalSourcesTreeProps = ComponentPropsWithoutRef<typeof StatelessExternalSourcesTree>;
|
|
5
|
+
interface StatelessExternalSourcesTreeComponentProps extends Pick<StatelessExternalSourcesTreeProps, "getSchemaContext" | "density" | "hierarchyLevelConfig" | "selectionMode" | "onPerformanceMeasured"> {
|
|
6
|
+
selectionStorage: SelectionStorage;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A component that renders [[StatelessExternalSourcesTree]].
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export declare const StatelessExternalSourcesTreeComponent: (props: StatelessExternalSourcesTreeComponentProps) => JSX.Element | null;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=ExternalSourcesTreeComponent.d.ts.map
|
package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatelessExternalSourcesTreeComponent = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/*---------------------------------------------------------------------------------------------
|
|
6
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
7
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
|
+
*--------------------------------------------------------------------------------------------*/
|
|
9
|
+
const appui_react_1 = require("@itwin/appui-react");
|
|
10
|
+
const presentation_hierarchies_react_1 = require("@itwin/presentation-hierarchies-react");
|
|
11
|
+
const AutoSizer_1 = require("../../../utils/AutoSizer");
|
|
12
|
+
const ExternalSourcesTree_1 = require("./ExternalSourcesTree");
|
|
13
|
+
/**
|
|
14
|
+
* A component that renders [[StatelessExternalSourcesTree]].
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
const StatelessExternalSourcesTreeComponent = (props) => {
|
|
18
|
+
const imodel = (0, appui_react_1.useActiveIModelConnection)();
|
|
19
|
+
if (!imodel) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(presentation_hierarchies_react_1.UnifiedSelectionProvider, { storage: props.selectionStorage, children: (0, jsx_runtime_1.jsx)(AutoSizer_1.AutoSizer, { children: ({ width, height }) => (0, jsx_runtime_1.jsx)(ExternalSourcesTree_1.StatelessExternalSourcesTree, { ...props, imodel: imodel, width: width, height: height }) }) }));
|
|
23
|
+
};
|
|
24
|
+
exports.StatelessExternalSourcesTreeComponent = StatelessExternalSourcesTreeComponent;
|
|
25
|
+
//# sourceMappingURL=ExternalSourcesTreeComponent.js.map
|
package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalSourcesTreeComponent.js","sourceRoot":"","sources":["../../../../../../src/components/trees/stateless/external-sources-tree/ExternalSourcesTreeComponent.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,oDAA+D;AAC/D,0FAAiF;AACjF,wDAAqD;AACrD,+DAAqE;AAWrE;;;GAGG;AACI,MAAM,qCAAqC,GAAG,CAAC,KAAiD,EAAE,EAAE;IACzG,MAAM,MAAM,GAAG,IAAA,uCAAyB,GAAE,CAAC;IAE3C,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,uBAAC,yDAAwB,IAAC,OAAO,EAAE,KAAK,CAAC,gBAAgB,YACvD,uBAAC,qBAAS,cAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,uBAAC,kDAA4B,OAAK,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAI,GAAa,GAChH,CAC5B,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,qCAAqC,yCAYhD","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 { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { UnifiedSelectionProvider } from \"@itwin/presentation-hierarchies-react\";\nimport { AutoSizer } from \"../../../utils/AutoSizer\";\nimport { StatelessExternalSourcesTree } from \"./ExternalSourcesTree\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { SelectionStorage } from \"@itwin/presentation-hierarchies-react\";\n\ntype StatelessExternalSourcesTreeProps = ComponentPropsWithoutRef<typeof StatelessExternalSourcesTree>;\ninterface StatelessExternalSourcesTreeComponentProps\n extends Pick<StatelessExternalSourcesTreeProps, \"getSchemaContext\" | \"density\" | \"hierarchyLevelConfig\" | \"selectionMode\" | \"onPerformanceMeasured\"> {\n selectionStorage: SelectionStorage;\n}\n\n/**\n * A component that renders [[StatelessExternalSourcesTree]].\n * @beta\n */\nexport const StatelessExternalSourcesTreeComponent = (props: StatelessExternalSourcesTreeComponentProps) => {\n const imodel = useActiveIModelConnection();\n\n if (!imodel) {\n return null;\n }\n\n return (\n <UnifiedSelectionProvider storage={props.selectionStorage}>\n <AutoSizer>{({ width, height }) => <StatelessExternalSourcesTree {...props} imodel={imodel} width={width} height={height} />}</AutoSizer>\n </UnifiedSelectionProvider>\n );\n};\n"]}
|
package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ECClassHierarchyInspector, ECSchemaProvider } from "@itwin/presentation-shared";
|
|
2
|
+
import type { DefineHierarchyLevelProps, HierarchyDefinition, HierarchyLevelDefinition, ProcessedHierarchyNode } from "@itwin/presentation-hierarchies";
|
|
3
|
+
interface ExternalSourcesTreeDefinitionProps {
|
|
4
|
+
imodelAccess: ECSchemaProvider & ECClassHierarchyInspector;
|
|
5
|
+
}
|
|
6
|
+
export declare class ExternalSourcesTreeDefinition implements HierarchyDefinition {
|
|
7
|
+
private _impl;
|
|
8
|
+
private _selectQueryFactory;
|
|
9
|
+
private _nodeLabelSelectClauseFactory;
|
|
10
|
+
constructor(props: ExternalSourcesTreeDefinitionProps);
|
|
11
|
+
postProcessNode(node: ProcessedHierarchyNode): Promise<ProcessedHierarchyNode>;
|
|
12
|
+
defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition>;
|
|
13
|
+
private createRootHierarchyLevelDefinition;
|
|
14
|
+
private createExternalSourcesGroupChildrenQuery;
|
|
15
|
+
private createExternalSourceChildrenQuery;
|
|
16
|
+
private createElementsNodeChildrenQuery;
|
|
17
|
+
private createCompositeLabelSelectClause;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=ExternalSourcesTreeDefinition.d.ts.map
|
package/lib/cjs/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ExternalSourcesTreeDefinition = void 0;
|
|
8
|
+
const presentation_hierarchies_1 = require("@itwin/presentation-hierarchies");
|
|
9
|
+
const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
10
|
+
class ExternalSourcesTreeDefinition {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
this._impl = (0, presentation_hierarchies_1.createClassBasedHierarchyDefinition)({
|
|
13
|
+
classHierarchyInspector: props.imodelAccess,
|
|
14
|
+
hierarchy: {
|
|
15
|
+
rootNodes: async (requestProps) => this.createRootHierarchyLevelDefinition(requestProps),
|
|
16
|
+
childNodes: [
|
|
17
|
+
{
|
|
18
|
+
parentNodeClassName: "BisCore.ExternalSourceGroup",
|
|
19
|
+
definitions: async (requestProps) => this.createExternalSourcesGroupChildrenQuery(requestProps),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
parentNodeClassName: "BisCore.ExternalSource",
|
|
23
|
+
definitions: async (requestProps) => this.createExternalSourceChildrenQuery(requestProps),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
customParentNodeKey: "ElementsNode",
|
|
27
|
+
definitions: async (requestProps) => this.createElementsNodeChildrenQuery(requestProps),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
this._selectQueryFactory = (0, presentation_hierarchies_1.createNodesQueryClauseFactory)({ imodelAccess: props.imodelAccess });
|
|
33
|
+
this._nodeLabelSelectClauseFactory = (0, presentation_shared_1.createBisInstanceLabelSelectClauseFactory)({ classHierarchyInspector: props.imodelAccess });
|
|
34
|
+
}
|
|
35
|
+
async postProcessNode(node) {
|
|
36
|
+
if (presentation_hierarchies_1.HierarchyNode.isClassGroupingNode(node)) {
|
|
37
|
+
// `imageId` is assigned to instance nodes at query time, but grouping ones need to be handled during post-processing
|
|
38
|
+
return { ...node, extendedData: { ...node.extendedData, imageId: "icon-ec-class" } };
|
|
39
|
+
}
|
|
40
|
+
return node;
|
|
41
|
+
}
|
|
42
|
+
async defineHierarchyLevel(props) {
|
|
43
|
+
return this._impl.defineHierarchyLevel(props);
|
|
44
|
+
}
|
|
45
|
+
async createRootHierarchyLevelDefinition(props) {
|
|
46
|
+
const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
|
|
47
|
+
filter: props.instanceFilter,
|
|
48
|
+
contentClass: { fullName: "BisCore.ExternalSource", alias: "this" },
|
|
49
|
+
});
|
|
50
|
+
return [
|
|
51
|
+
{
|
|
52
|
+
fullClassName: "BisCore.ExternalSource",
|
|
53
|
+
query: {
|
|
54
|
+
ecsql: `
|
|
55
|
+
SELECT
|
|
56
|
+
${await this._selectQueryFactory.createSelectClause({
|
|
57
|
+
ecClassId: { selector: presentation_shared_1.ECSql.createRawPropertyValueSelector("this", "ECClassId") },
|
|
58
|
+
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
59
|
+
nodeLabel: {
|
|
60
|
+
selector: await this.createCompositeLabelSelectClause({ externalSourceAlias: "this", repositoryLinkAlias: "rl" }),
|
|
61
|
+
},
|
|
62
|
+
extendedData: {
|
|
63
|
+
imageId: "icon-document",
|
|
64
|
+
},
|
|
65
|
+
autoExpand: true,
|
|
66
|
+
supportsFiltering: true,
|
|
67
|
+
})}
|
|
68
|
+
FROM ${instanceFilterClauses.from} this
|
|
69
|
+
${instanceFilterClauses.joins}
|
|
70
|
+
JOIN BisCore.SynchronizationConfigSpecifiesRootSources scsrs ON scsrs.TargetECInstanceId = this.ECInstanceId
|
|
71
|
+
JOIN BisCore.RepositoryLink rl ON rl.ECInstanceId = this.Repository.Id
|
|
72
|
+
${instanceFilterClauses.where ? `WHERE ${instanceFilterClauses.where}` : ""}
|
|
73
|
+
`,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
async createExternalSourcesGroupChildrenQuery({ parentNodeInstanceIds: groupIds, instanceFilter, }) {
|
|
79
|
+
const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
|
|
80
|
+
filter: instanceFilter,
|
|
81
|
+
contentClass: { fullName: "BisCore.ExternalSource", alias: "this" },
|
|
82
|
+
});
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
85
|
+
fullClassName: "BisCore.ExternalSource",
|
|
86
|
+
query: {
|
|
87
|
+
ecsql: `
|
|
88
|
+
SELECT
|
|
89
|
+
${await this._selectQueryFactory.createSelectClause({
|
|
90
|
+
ecClassId: { selector: "this.ECClassId" },
|
|
91
|
+
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
92
|
+
nodeLabel: {
|
|
93
|
+
selector: await this.createCompositeLabelSelectClause({ externalSourceAlias: "this", repositoryLinkAlias: "rl" }),
|
|
94
|
+
},
|
|
95
|
+
hasChildren: {
|
|
96
|
+
selector: `
|
|
97
|
+
IFNULL((
|
|
98
|
+
SELECT 1
|
|
99
|
+
FROM BisCore.ExternalSourceAttachment esa
|
|
100
|
+
WHERE esa.Attaches.Id = this.ECInstanceId
|
|
101
|
+
LIMIT 1
|
|
102
|
+
), 0)
|
|
103
|
+
`,
|
|
104
|
+
},
|
|
105
|
+
extendedData: {
|
|
106
|
+
imageId: "icon-document",
|
|
107
|
+
},
|
|
108
|
+
supportsFiltering: true,
|
|
109
|
+
})}
|
|
110
|
+
FROM ${instanceFilterClauses.from} this
|
|
111
|
+
JOIN BisCore.ExternalSourceGroupGroupsSources esggs ON esggs.TargetECInstanceId = this.ECInstanceId
|
|
112
|
+
JOIN BisCore.RepositoryLink rl ON rl.ECInstanceId = this.Repository.Id
|
|
113
|
+
${instanceFilterClauses.joins}
|
|
114
|
+
WHERE
|
|
115
|
+
esggs.SourceECInstanceId IN (${groupIds.map(() => "?").join(",")})
|
|
116
|
+
${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : ""}
|
|
117
|
+
`,
|
|
118
|
+
bindings: groupIds.map((id) => ({ type: "id", value: id })),
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
async createExternalSourceChildrenQuery({ parentNodeInstanceIds: sourceIds, instanceFilter, }) {
|
|
124
|
+
const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
|
|
125
|
+
filter: instanceFilter,
|
|
126
|
+
contentClass: { fullName: "BisCore.ExternalSource", alias: "this" },
|
|
127
|
+
});
|
|
128
|
+
return [
|
|
129
|
+
{
|
|
130
|
+
fullClassName: "BisCore.ExternalSource",
|
|
131
|
+
query: {
|
|
132
|
+
ecsql: `
|
|
133
|
+
SELECT
|
|
134
|
+
${await this._selectQueryFactory.createSelectClause({
|
|
135
|
+
ecClassId: { selector: "this.ECClassId" },
|
|
136
|
+
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
137
|
+
nodeLabel: {
|
|
138
|
+
selector: await this.createCompositeLabelSelectClause({ externalSourceAlias: "this", repositoryLinkAlias: "rl" }),
|
|
139
|
+
},
|
|
140
|
+
hasChildren: {
|
|
141
|
+
selector: `
|
|
142
|
+
IFNULL((
|
|
143
|
+
SELECT 1
|
|
144
|
+
FROM BisCore.ExternalSourceAttachment esa
|
|
145
|
+
WHERE esa.Attaches.Id = this.ECInstanceId
|
|
146
|
+
LIMIT 1
|
|
147
|
+
), 0)
|
|
148
|
+
`,
|
|
149
|
+
},
|
|
150
|
+
extendedData: {
|
|
151
|
+
imageId: "icon-document",
|
|
152
|
+
},
|
|
153
|
+
supportsFiltering: true,
|
|
154
|
+
})}
|
|
155
|
+
FROM ${instanceFilterClauses.from} this
|
|
156
|
+
JOIN BisCore.ExternalSourceAttachment esa ON esa.Attaches.Id = this.ECInstanceId
|
|
157
|
+
JOIN BisCore.RepositoryLink rl ON rl.ECInstanceId = this.Repository.Id
|
|
158
|
+
${instanceFilterClauses.joins}
|
|
159
|
+
WHERE
|
|
160
|
+
esa.Parent.Id IN (${sourceIds.map(() => "?").join(",")})
|
|
161
|
+
${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : ""}
|
|
162
|
+
`,
|
|
163
|
+
bindings: sourceIds.map((id) => ({ type: "id", value: id })),
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
node: {
|
|
168
|
+
key: "ElementsNode",
|
|
169
|
+
label: "Elements",
|
|
170
|
+
extendedData: {
|
|
171
|
+
sourceIds,
|
|
172
|
+
imageId: "icon-ec-schema",
|
|
173
|
+
},
|
|
174
|
+
supportsFiltering: true,
|
|
175
|
+
processingParams: {
|
|
176
|
+
hideIfNoChildren: true,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
async createElementsNodeChildrenQuery({ parentNode, instanceFilter }) {
|
|
183
|
+
const sourceIds = parentNode.extendedData?.sourceIds;
|
|
184
|
+
const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({
|
|
185
|
+
filter: instanceFilter,
|
|
186
|
+
contentClass: { fullName: "BisCore.GeometricElement", alias: "this" },
|
|
187
|
+
});
|
|
188
|
+
return [
|
|
189
|
+
{
|
|
190
|
+
fullClassName: "BisCore.GeometricElement",
|
|
191
|
+
query: {
|
|
192
|
+
ecsql: `
|
|
193
|
+
SELECT
|
|
194
|
+
${await this._selectQueryFactory.createSelectClause({
|
|
195
|
+
ecClassId: { selector: "this.ECClassId" },
|
|
196
|
+
ecInstanceId: { selector: "this.ECInstanceId" },
|
|
197
|
+
nodeLabel: {
|
|
198
|
+
selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
|
|
199
|
+
classAlias: "this",
|
|
200
|
+
className: "BisCore.GeometricElement",
|
|
201
|
+
}),
|
|
202
|
+
},
|
|
203
|
+
extendedData: {
|
|
204
|
+
imageId: "icon-item",
|
|
205
|
+
},
|
|
206
|
+
grouping: { byClass: true },
|
|
207
|
+
supportsFiltering: true,
|
|
208
|
+
hasChildren: false,
|
|
209
|
+
})}
|
|
210
|
+
FROM ${instanceFilterClauses.from} this
|
|
211
|
+
JOIN BisCore.ExternalSourceAspect esa ON esa.Element.Id = this.ECInstanceId
|
|
212
|
+
${instanceFilterClauses.joins}
|
|
213
|
+
WHERE
|
|
214
|
+
esa.Source.Id = (${sourceIds.map(() => "?").join(",")})
|
|
215
|
+
${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : ""}
|
|
216
|
+
`,
|
|
217
|
+
bindings: sourceIds.map((id) => ({ type: "id", value: id })),
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
];
|
|
221
|
+
}
|
|
222
|
+
async createCompositeLabelSelectClause({ externalSourceAlias, repositoryLinkAlias }) {
|
|
223
|
+
return presentation_shared_1.ECSql.createConcatenatedValueStringSelector([
|
|
224
|
+
{
|
|
225
|
+
selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
|
|
226
|
+
classAlias: repositoryLinkAlias,
|
|
227
|
+
className: "BisCore.RepositoryLink",
|
|
228
|
+
}),
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: "String",
|
|
232
|
+
value: " - ",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
selector: await this._nodeLabelSelectClauseFactory.createSelectClause({
|
|
236
|
+
classAlias: externalSourceAlias,
|
|
237
|
+
className: "BisCore.ExternalSource",
|
|
238
|
+
}),
|
|
239
|
+
},
|
|
240
|
+
]);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
exports.ExternalSourcesTreeDefinition = ExternalSourcesTreeDefinition;
|
|
244
|
+
//# sourceMappingURL=ExternalSourcesTreeDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalSourcesTreeDefinition.js","sourceRoot":"","sources":["../../../../../../src/components/trees/stateless/external-sources-tree/ExternalSourcesTreeDefinition.ts"],"names":[],"mappings":"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","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 { createClassBasedHierarchyDefinition, createNodesQueryClauseFactory, HierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport { createBisInstanceLabelSelectClauseFactory, ECSql } from \"@itwin/presentation-shared\";\n\nimport type { ECClassHierarchyInspector, ECSchemaProvider, IInstanceLabelSelectClauseFactory } from \"@itwin/presentation-shared\";\nimport type {\n DefineCustomNodeChildHierarchyLevelProps,\n DefineHierarchyLevelProps,\n DefineInstanceNodeChildHierarchyLevelProps,\n DefineRootHierarchyLevelProps,\n HierarchyDefinition,\n HierarchyLevelDefinition,\n NodesQueryClauseFactory,\n ProcessedHierarchyNode,\n} from \"@itwin/presentation-hierarchies\";\n\ninterface ExternalSourcesTreeDefinitionProps {\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector;\n}\n\nexport class ExternalSourcesTreeDefinition implements HierarchyDefinition {\n private _impl: HierarchyDefinition;\n private _selectQueryFactory: NodesQueryClauseFactory;\n private _nodeLabelSelectClauseFactory: IInstanceLabelSelectClauseFactory;\n\n public constructor(props: ExternalSourcesTreeDefinitionProps) {\n this._impl = createClassBasedHierarchyDefinition({\n classHierarchyInspector: props.imodelAccess,\n hierarchy: {\n rootNodes: async (requestProps) => this.createRootHierarchyLevelDefinition(requestProps),\n childNodes: [\n {\n parentNodeClassName: \"BisCore.ExternalSourceGroup\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createExternalSourcesGroupChildrenQuery(requestProps),\n },\n {\n parentNodeClassName: \"BisCore.ExternalSource\",\n definitions: async (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => this.createExternalSourceChildrenQuery(requestProps),\n },\n {\n customParentNodeKey: \"ElementsNode\",\n definitions: async (requestProps: DefineCustomNodeChildHierarchyLevelProps) => this.createElementsNodeChildrenQuery(requestProps),\n },\n ],\n },\n });\n this._selectQueryFactory = createNodesQueryClauseFactory({ imodelAccess: props.imodelAccess });\n this._nodeLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory({ classHierarchyInspector: props.imodelAccess });\n }\n\n public async postProcessNode(node: ProcessedHierarchyNode): Promise<ProcessedHierarchyNode> {\n if (HierarchyNode.isClassGroupingNode(node)) {\n // `imageId` is assigned to instance nodes at query time, but grouping ones need to be handled during post-processing\n return { ...node, extendedData: { ...node.extendedData, imageId: \"icon-ec-class\" } };\n }\n return node;\n }\n\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps) {\n return this._impl.defineHierarchyLevel(props);\n }\n\n private async createRootHierarchyLevelDefinition(props: DefineRootHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: props.instanceFilter,\n contentClass: { fullName: \"BisCore.ExternalSource\", alias: \"this\" },\n });\n return [\n {\n fullClassName: \"BisCore.ExternalSource\",\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.createCompositeLabelSelectClause({ externalSourceAlias: \"this\", repositoryLinkAlias: \"rl\" }),\n },\n extendedData: {\n imageId: \"icon-document\",\n },\n autoExpand: true,\n supportsFiltering: true,\n })}\n FROM ${instanceFilterClauses.from} this\n ${instanceFilterClauses.joins}\n JOIN BisCore.SynchronizationConfigSpecifiesRootSources scsrs ON scsrs.TargetECInstanceId = this.ECInstanceId\n JOIN BisCore.RepositoryLink rl ON rl.ECInstanceId = this.Repository.Id\n ${instanceFilterClauses.where ? `WHERE ${instanceFilterClauses.where}` : \"\"}\n `,\n },\n },\n ];\n }\n\n private async createExternalSourcesGroupChildrenQuery({\n parentNodeInstanceIds: groupIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.ExternalSource\", alias: \"this\" },\n });\n return [\n {\n fullClassName: \"BisCore.ExternalSource\",\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.createCompositeLabelSelectClause({ externalSourceAlias: \"this\", repositoryLinkAlias: \"rl\" }),\n },\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM BisCore.ExternalSourceAttachment esa\n WHERE esa.Attaches.Id = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n extendedData: {\n imageId: \"icon-document\",\n },\n supportsFiltering: true,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.ExternalSourceGroupGroupsSources esggs ON esggs.TargetECInstanceId = this.ECInstanceId\n JOIN BisCore.RepositoryLink rl ON rl.ECInstanceId = this.Repository.Id\n ${instanceFilterClauses.joins}\n WHERE\n esggs.SourceECInstanceId IN (${groupIds.map(() => \"?\").join(\",\")})\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: groupIds.map((id) => ({ type: \"id\", value: id })),\n },\n },\n ];\n }\n\n private async createExternalSourceChildrenQuery({\n parentNodeInstanceIds: sourceIds,\n instanceFilter,\n }: DefineInstanceNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.ExternalSource\", alias: \"this\" },\n });\n return [\n {\n fullClassName: \"BisCore.ExternalSource\",\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this.createCompositeLabelSelectClause({ externalSourceAlias: \"this\", repositoryLinkAlias: \"rl\" }),\n },\n hasChildren: {\n selector: `\n IFNULL((\n SELECT 1\n FROM BisCore.ExternalSourceAttachment esa\n WHERE esa.Attaches.Id = this.ECInstanceId\n LIMIT 1\n ), 0)\n `,\n },\n extendedData: {\n imageId: \"icon-document\",\n },\n supportsFiltering: true,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.ExternalSourceAttachment esa ON esa.Attaches.Id = this.ECInstanceId\n JOIN BisCore.RepositoryLink rl ON rl.ECInstanceId = this.Repository.Id\n ${instanceFilterClauses.joins}\n WHERE\n esa.Parent.Id IN (${sourceIds.map(() => \"?\").join(\",\")})\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: sourceIds.map((id) => ({ type: \"id\", value: id })),\n },\n },\n {\n node: {\n key: \"ElementsNode\",\n label: \"Elements\",\n extendedData: {\n sourceIds,\n imageId: \"icon-ec-schema\",\n },\n supportsFiltering: true,\n processingParams: {\n hideIfNoChildren: true,\n },\n },\n },\n ];\n }\n\n private async createElementsNodeChildrenQuery({ parentNode, instanceFilter }: DefineCustomNodeChildHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const sourceIds: string[] = parentNode.extendedData?.sourceIds;\n const instanceFilterClauses = await this._selectQueryFactory.createFilterClauses({\n filter: instanceFilter,\n contentClass: { fullName: \"BisCore.GeometricElement\", alias: \"this\" },\n });\n return [\n {\n fullClassName: \"BisCore.GeometricElement\",\n query: {\n ecsql: `\n SELECT\n ${await this._selectQueryFactory.createSelectClause({\n ecClassId: { selector: \"this.ECClassId\" },\n ecInstanceId: { selector: \"this.ECInstanceId\" },\n nodeLabel: {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: \"this\",\n className: \"BisCore.GeometricElement\",\n }),\n },\n extendedData: {\n imageId: \"icon-item\",\n },\n grouping: { byClass: true },\n supportsFiltering: true,\n hasChildren: false,\n })}\n FROM ${instanceFilterClauses.from} this\n JOIN BisCore.ExternalSourceAspect esa ON esa.Element.Id = this.ECInstanceId\n ${instanceFilterClauses.joins}\n WHERE\n esa.Source.Id = (${sourceIds.map(() => \"?\").join(\",\")})\n ${instanceFilterClauses.where ? `AND ${instanceFilterClauses.where}` : \"\"}\n `,\n bindings: sourceIds.map((id) => ({ type: \"id\", value: id })),\n },\n },\n ];\n }\n\n private async createCompositeLabelSelectClause({ externalSourceAlias, repositoryLinkAlias }: { externalSourceAlias: string; repositoryLinkAlias: string }) {\n return ECSql.createConcatenatedValueStringSelector([\n {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: repositoryLinkAlias,\n className: \"BisCore.RepositoryLink\",\n }),\n },\n {\n type: \"String\",\n value: \" - \",\n },\n {\n selector: await this._nodeLabelSelectClauseFactory.createSelectClause({\n classAlias: externalSourceAlias,\n className: \"BisCore.ExternalSource\",\n }),\n },\n ]);\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FilterableTree } from "../common/components/FilterableTree";
|
|
3
|
+
import type { HierarchyLevelConfig } from "../../common/Types";
|
|
4
|
+
interface StatelessIModelContentTreeOwnProps {
|
|
5
|
+
hierarchyLevelConfig?: Omit<HierarchyLevelConfig, "isFilteringEnabled">;
|
|
6
|
+
onPerformanceMeasured?: (featureId: string, duration: number) => void;
|
|
7
|
+
}
|
|
8
|
+
type FilterableTreeProps = Parameters<typeof FilterableTree>[0];
|
|
9
|
+
type StatelessIModelContentTreeProps = StatelessIModelContentTreeOwnProps & Pick<FilterableTreeProps, "imodel" | "getSchemaContext" | "height" | "width" | "density" | "selectionMode">;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare function StatelessIModelContentTree({ onPerformanceMeasured, ...props }: StatelessIModelContentTreeProps): JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=IModelContentTree.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatelessIModelContentTree = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/*---------------------------------------------------------------------------------------------
|
|
6
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
7
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
|
+
*--------------------------------------------------------------------------------------------*/
|
|
9
|
+
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
10
|
+
const FilterableTree_1 = require("../common/components/FilterableTree");
|
|
11
|
+
const IModelContentTreeDefinition_1 = require("./IModelContentTreeDefinition");
|
|
12
|
+
const StatelessIModelContentTreeId = "imodel-content-tree-v2";
|
|
13
|
+
/** @internal */
|
|
14
|
+
function StatelessIModelContentTree({ onPerformanceMeasured, ...props }) {
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(FilterableTree_1.FilterableTree, { ...props, treeName: "StatelessIModelContentTree", getHierarchyDefinition: getDefinitionsProvider, getIcon: getIcon, selectionMode: props.selectionMode ?? "none", onPerformanceMeasured: (action, duration) => {
|
|
16
|
+
onPerformanceMeasured?.(`${StatelessIModelContentTreeId}-${action}`, duration);
|
|
17
|
+
} }));
|
|
18
|
+
}
|
|
19
|
+
exports.StatelessIModelContentTree = StatelessIModelContentTree;
|
|
20
|
+
;
|
|
21
|
+
function getDefinitionsProvider(props) {
|
|
22
|
+
return new IModelContentTreeDefinition_1.IModelContentTreeDefinition(props);
|
|
23
|
+
}
|
|
24
|
+
function getIcon(node) {
|
|
25
|
+
if (node.extendedData?.imageId === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
switch (node.extendedData.imageId) {
|
|
29
|
+
case "icon-layers":
|
|
30
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgLayers, {});
|
|
31
|
+
case "icon-item":
|
|
32
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgItem, {});
|
|
33
|
+
case "icon-ec-class":
|
|
34
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgItem, {});
|
|
35
|
+
case "icon-imodel-hollow-2":
|
|
36
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgImodelHollow, {});
|
|
37
|
+
case "icon-folder":
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgFolder, {});
|
|
39
|
+
case "icon-model":
|
|
40
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgModel, {});
|
|
41
|
+
case "icon-hierarchy-tree":
|
|
42
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgHierarchyTree, {});
|
|
43
|
+
case "icon-group":
|
|
44
|
+
return (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgGroup, {});
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=IModelContentTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IModelContentTree.js","sourceRoot":"","sources":["../../../../../../src/components/trees/stateless/imodel-content-tree/IModelContentTree.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,oEAAkI;AAClI,wEAAqE;AACrE,+EAA4E;AAgB5E,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AAE9D,gBAAgB;AAChB,SAAgB,0BAA0B,CAAC,EAAE,qBAAqB,EAAE,GAAG,KAAK,EAAmC;IAC7G,OAAO,CACL,uBAAC,+BAAc,OACT,KAAK,EACT,QAAQ,EAAC,4BAA4B,EACrC,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,MAAM,EAC5C,qBAAqB,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;YAC1C,qBAAqB,EAAE,CAAC,GAAG,4BAA4B,IAAI,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC;QACjF,CAAC,GACD,CACH,CAAC;AACJ,CAAC;AAbD,gEAaC;AAAA,CAAC;AAEF,SAAS,sBAAsB,CAAC,KAA6D;IAC3F,OAAO,IAAI,yDAA2B,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,OAAO,CAAC,IAA+B;IAC9C,IAAI,IAAI,CAAC,YAAY,EAAE,OAAO,KAAK,SAAS,EAAE;QAC5C,OAAO,SAAS,CAAC;KAClB;IAED,QAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;QACjC,KAAK,aAAa;YAChB,OAAO,uBAAC,+BAAS,KAAG,CAAC;QACvB,KAAK,WAAW;YACd,OAAO,uBAAC,6BAAO,KAAG,CAAC;QACrB,KAAK,eAAe;YAClB,OAAO,uBAAC,6BAAO,KAAG,CAAC;QACrB,KAAK,sBAAsB;YACzB,OAAO,uBAAC,qCAAe,KAAG,CAAC;QAC7B,KAAK,aAAa;YAChB,OAAO,uBAAC,+BAAS,KAAG,CAAC;QACvB,KAAK,YAAY;YACf,OAAO,uBAAC,8BAAQ,KAAG,CAAC;QACtB,KAAK,qBAAqB;YACxB,OAAO,uBAAC,sCAAgB,KAAG,CAAC;QAC9B,KAAK,YAAY;YACf,OAAO,uBAAC,8BAAQ,KAAG,CAAC;KACvB;IAED,OAAO,SAAS,CAAC;AACnB,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 { SvgFolder, SvgGroup, SvgHierarchyTree, SvgImodelHollow, SvgItem, SvgLayers, SvgModel } from \"@itwin/itwinui-icons-react\";\nimport { FilterableTree } from \"../common/components/FilterableTree\";\nimport { IModelContentTreeDefinition } from \"./IModelContentTreeDefinition\";\n\nimport type { ReactElement } from \"react\";\nimport type { PresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\nimport type { HierarchyLevelConfig } from \"../../common/Types\";\n\ninterface StatelessIModelContentTreeOwnProps {\n hierarchyLevelConfig?: Omit<HierarchyLevelConfig, \"isFilteringEnabled\">;\n onPerformanceMeasured?: (featureId: string, duration: number) => void;\n}\n\ntype FilterableTreeProps = Parameters<typeof FilterableTree>[0];\ntype GetHierarchyDefinitionsProviderCallback = FilterableTreeProps[\"getHierarchyDefinition\"];\ntype StatelessIModelContentTreeProps = StatelessIModelContentTreeOwnProps &\n Pick<FilterableTreeProps, \"imodel\" | \"getSchemaContext\" | \"height\" | \"width\" | \"density\" | \"selectionMode\">;\n\nconst StatelessIModelContentTreeId = \"imodel-content-tree-v2\";\n\n/** @internal */\nexport function StatelessIModelContentTree({ onPerformanceMeasured, ...props }: StatelessIModelContentTreeProps) {\n return (\n <FilterableTree\n {...props}\n treeName=\"StatelessIModelContentTree\"\n getHierarchyDefinition={getDefinitionsProvider}\n getIcon={getIcon}\n selectionMode={props.selectionMode ?? \"none\"}\n onPerformanceMeasured={(action, duration) => {\n onPerformanceMeasured?.(`${StatelessIModelContentTreeId}-${action}`, duration);\n }}\n />\n );\n};\n\nfunction getDefinitionsProvider(props: Parameters<GetHierarchyDefinitionsProviderCallback>[0]) {\n return new IModelContentTreeDefinition(props);\n}\n\nfunction getIcon(node: PresentationHierarchyNode): ReactElement | undefined {\n if (node.extendedData?.imageId === undefined) {\n return undefined;\n }\n\n switch (node.extendedData.imageId) {\n case \"icon-layers\":\n return <SvgLayers />;\n case \"icon-item\":\n return <SvgItem />;\n case \"icon-ec-class\":\n return <SvgItem />;\n case \"icon-imodel-hollow-2\":\n return <SvgImodelHollow />;\n case \"icon-folder\":\n return <SvgFolder />;\n case \"icon-model\":\n return <SvgModel />;\n case \"icon-hierarchy-tree\":\n return <SvgHierarchyTree />;\n case \"icon-group\":\n return <SvgGroup />;\n }\n\n return undefined;\n}\n"]}
|
package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StatelessIModelContentTree } from "./IModelContentTree";
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
import type { SelectionStorage } from "@itwin/presentation-hierarchies-react";
|
|
4
|
+
type StatelessIModelContentTreeProps = ComponentPropsWithoutRef<typeof StatelessIModelContentTree>;
|
|
5
|
+
interface StatelessIModelContentTreeComponentProps extends Pick<StatelessIModelContentTreeProps, "getSchemaContext" | "density" | "hierarchyLevelConfig" | "selectionMode" | "onPerformanceMeasured"> {
|
|
6
|
+
selectionStorage: SelectionStorage;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A component that renders [[StatelessIModelContentTree]].
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export declare const StatelessIModelContentTreeComponent: (props: StatelessIModelContentTreeComponentProps) => JSX.Element | null;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=IModelContentTreeComponent.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatelessIModelContentTreeComponent = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/*---------------------------------------------------------------------------------------------
|
|
6
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
7
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
|
+
*--------------------------------------------------------------------------------------------*/
|
|
9
|
+
const appui_react_1 = require("@itwin/appui-react");
|
|
10
|
+
const presentation_hierarchies_react_1 = require("@itwin/presentation-hierarchies-react");
|
|
11
|
+
const AutoSizer_1 = require("../../../utils/AutoSizer");
|
|
12
|
+
const IModelContentTree_1 = require("./IModelContentTree");
|
|
13
|
+
/**
|
|
14
|
+
* A component that renders [[StatelessIModelContentTree]].
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
const StatelessIModelContentTreeComponent = (props) => {
|
|
18
|
+
const imodel = (0, appui_react_1.useActiveIModelConnection)();
|
|
19
|
+
if (!imodel) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(presentation_hierarchies_react_1.UnifiedSelectionProvider, { storage: props.selectionStorage, children: (0, jsx_runtime_1.jsx)(AutoSizer_1.AutoSizer, { children: ({ width, height }) => (0, jsx_runtime_1.jsx)(IModelContentTree_1.StatelessIModelContentTree, { ...props, imodel: imodel, width: width, height: height }) }) }));
|
|
23
|
+
};
|
|
24
|
+
exports.StatelessIModelContentTreeComponent = StatelessIModelContentTreeComponent;
|
|
25
|
+
//# sourceMappingURL=IModelContentTreeComponent.js.map
|
package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IModelContentTreeComponent.js","sourceRoot":"","sources":["../../../../../../src/components/trees/stateless/imodel-content-tree/IModelContentTreeComponent.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,oDAA+D;AAC/D,0FAAiF;AACjF,wDAAqD;AACrD,2DAAiE;AAWjE;;;GAGG;AACI,MAAM,mCAAmC,GAAG,CAAC,KAA+C,EAAE,EAAE;IACrG,MAAM,MAAM,GAAG,IAAA,uCAAyB,GAAE,CAAC;IAE3C,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,uBAAC,yDAAwB,IAAC,OAAO,EAAE,KAAK,CAAC,gBAAgB,YACvD,uBAAC,qBAAS,cAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,uBAAC,8CAA0B,OAAK,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAI,GAAa,GAC9G,CAC5B,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,mCAAmC,uCAY9C","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 { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { UnifiedSelectionProvider } from \"@itwin/presentation-hierarchies-react\";\nimport { AutoSizer } from \"../../../utils/AutoSizer\";\nimport { StatelessIModelContentTree } from \"./IModelContentTree\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { SelectionStorage } from \"@itwin/presentation-hierarchies-react\";\n\ntype StatelessIModelContentTreeProps = ComponentPropsWithoutRef<typeof StatelessIModelContentTree>;\ninterface StatelessIModelContentTreeComponentProps\n extends Pick<StatelessIModelContentTreeProps, \"getSchemaContext\" | \"density\" | \"hierarchyLevelConfig\" | \"selectionMode\" | \"onPerformanceMeasured\"> {\n selectionStorage: SelectionStorage;\n}\n\n/**\n * A component that renders [[StatelessIModelContentTree]].\n * @beta\n */\nexport const StatelessIModelContentTreeComponent = (props: StatelessIModelContentTreeComponentProps) => {\n const imodel = useActiveIModelConnection();\n\n if (!imodel) {\n return null;\n }\n\n return (\n <UnifiedSelectionProvider storage={props.selectionStorage}>\n <AutoSizer>{({ width, height }) => <StatelessIModelContentTree {...props} imodel={imodel} width={width} height={height} />}</AutoSizer>\n </UnifiedSelectionProvider>\n );\n};\n"]}
|
package/lib/cjs/components/trees/stateless/imodel-content-tree/IModelContentTreeDefinition.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ECClassHierarchyInspector, ECSchemaProvider } from "@itwin/presentation-shared";
|
|
2
|
+
import type { DefineHierarchyLevelProps, HierarchyDefinition, HierarchyLevelDefinition, ProcessedHierarchyNode } from "@itwin/presentation-hierarchies";
|
|
3
|
+
interface IModelContentTreeDefinitionProps {
|
|
4
|
+
imodelAccess: ECSchemaProvider & ECClassHierarchyInspector;
|
|
5
|
+
}
|
|
6
|
+
export declare class IModelContentTreeDefinition implements HierarchyDefinition {
|
|
7
|
+
private _impl;
|
|
8
|
+
private _selectQueryFactory;
|
|
9
|
+
private _nodeLabelSelectClauseFactory;
|
|
10
|
+
constructor(props: IModelContentTreeDefinitionProps);
|
|
11
|
+
postProcessNode(node: ProcessedHierarchyNode): Promise<ProcessedHierarchyNode>;
|
|
12
|
+
defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition>;
|
|
13
|
+
private createRootHierarchyLevelDefinition;
|
|
14
|
+
private createSubjectChildrenQuery;
|
|
15
|
+
private createISubModeledElementChildrenQuery;
|
|
16
|
+
private createGeometricModelChildrenQuery;
|
|
17
|
+
private createCategoryChildrenQuery;
|
|
18
|
+
private createModelChildrenQuery;
|
|
19
|
+
private createGroupInformationElementChildElementsQuery;
|
|
20
|
+
private createChildrenNodeChildrenQuery;
|
|
21
|
+
private createGroupInformationElementMemberElementsQuery;
|
|
22
|
+
private createElementChildrenQuery;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=IModelContentTreeDefinition.d.ts.map
|