@itwin/tree-widget-react 2.3.0 → 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 +10 -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/ModelsTree.js +2 -3
- package/lib/cjs/components/trees/models-tree/ModelsTree.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/ModelsVisibilityHandler.d.ts +1 -0
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js +13 -3
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.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/ModelsTree.js +2 -3
- package/lib/esm/components/trees/models-tree/ModelsTree.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/ModelsVisibilityHandler.d.ts +1 -0
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js +13 -3
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.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,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterableTree = 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 react_1 = require("react");
|
|
10
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
11
|
+
const presentation_core_interop_1 = require("@itwin/presentation-core-interop");
|
|
12
|
+
const presentation_hierarchies_1 = require("@itwin/presentation-hierarchies");
|
|
13
|
+
const presentation_hierarchies_react_1 = require("@itwin/presentation-hierarchies-react");
|
|
14
|
+
const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
15
|
+
const TreeWidget_1 = require("../../../../../TreeWidget");
|
|
16
|
+
const UseHierarchiesLocalization_1 = require("../UseHierarchiesLocalization");
|
|
17
|
+
const UseHierarchyFiltering_1 = require("../UseHierarchyFiltering");
|
|
18
|
+
const Delayed_1 = require("./Delayed");
|
|
19
|
+
const ProgressOverlay_1 = require("./ProgressOverlay");
|
|
20
|
+
/** @internal */
|
|
21
|
+
function FilterableTree({ imodel, getSchemaContext, hierarchyLevelSizeLimit, ...props }) {
|
|
22
|
+
const [imodelAccess, setIModelAccess] = (0, react_1.useState)();
|
|
23
|
+
const defaultHierarchyLevelSizeLimit = hierarchyLevelSizeLimit ?? 1000;
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
const schemas = getSchemaContext(imodel);
|
|
26
|
+
const schemaProvider = (0, presentation_core_interop_1.createECSchemaProvider)(schemas);
|
|
27
|
+
setIModelAccess({
|
|
28
|
+
...schemaProvider,
|
|
29
|
+
...(0, presentation_shared_1.createCachingECClassHierarchyInspector)({ schemaProvider }),
|
|
30
|
+
...(0, presentation_hierarchies_1.createLimitingECSqlQueryExecutor)((0, presentation_core_interop_1.createECSqlQueryExecutor)(imodel), 1000),
|
|
31
|
+
});
|
|
32
|
+
}, [imodel, getSchemaContext]);
|
|
33
|
+
if (!imodelAccess) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return (0, jsx_runtime_1.jsx)(FilterableTreeRenderer, { ...props, imodel: imodel, imodelAccess: imodelAccess, defaultHierarchyLevelSizeLimit: defaultHierarchyLevelSizeLimit });
|
|
37
|
+
}
|
|
38
|
+
exports.FilterableTree = FilterableTree;
|
|
39
|
+
/** @internal */
|
|
40
|
+
function FilterableTreeRenderer({ imodel, imodelAccess, height, width, treeName, getIcon, getSublabel, noDataMessage, defaultHierarchyLevelSizeLimit, getHierarchyDefinition, selectionMode, onPerformanceMeasured, }) {
|
|
41
|
+
const localizedStrings = (0, UseHierarchiesLocalization_1.useHierarchiesLocalization)();
|
|
42
|
+
const { rootNodes, isLoading, reloadTree: _reloadTree, setFormatter: _setFormatter, ...treeProps } = (0, presentation_hierarchies_react_1.useUnifiedSelectionTree)({
|
|
43
|
+
imodelKey: imodel.key,
|
|
44
|
+
sourceName: treeName,
|
|
45
|
+
imodelAccess,
|
|
46
|
+
getHierarchyDefinition,
|
|
47
|
+
onPerformanceMeasured,
|
|
48
|
+
localizedStrings,
|
|
49
|
+
});
|
|
50
|
+
const { filteringDialog, onFilterClick } = (0, UseHierarchyFiltering_1.useHierarchyLevelFiltering)({
|
|
51
|
+
imodel,
|
|
52
|
+
getHierarchyLevelDetails: treeProps.getHierarchyLevelDetails,
|
|
53
|
+
defaultHierarchyLevelSizeLimit,
|
|
54
|
+
});
|
|
55
|
+
const renderContent = () => {
|
|
56
|
+
if (rootNodes === undefined) {
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.Flex, { alignItems: "center", justifyContent: "center", flexDirection: "column", style: { width, height }, children: (0, jsx_runtime_1.jsx)(Delayed_1.Delayed, { show: true, children: (0, jsx_runtime_1.jsx)(itwinui_react_1.ProgressRadial, { size: "large" }) }) }));
|
|
58
|
+
}
|
|
59
|
+
if ((rootNodes.length === 0 && !isLoading) || (rootNodes.length === 1 && !(0, presentation_hierarchies_react_1.isPresentationHierarchyNode)(rootNodes[0]) && rootNodes[0].type === "Unknown")) {
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.Flex, { alignItems: "center", justifyContent: "center", flexDirection: "column", style: { width, height }, children: noDataMessage ? noDataMessage : (0, jsx_runtime_1.jsx)(itwinui_react_1.Text, { children: TreeWidget_1.TreeWidget.translate("stateless.dataIsNotAvailable") }) }));
|
|
61
|
+
}
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.Flex.Item, { alignSelf: "flex-start", style: { width: "100%", overflow: "auto" }, children: (0, jsx_runtime_1.jsx)(presentation_hierarchies_react_1.TreeRenderer, { rootNodes: rootNodes, ...treeProps, onFilterClick: onFilterClick, getIcon: getIcon, getSublabel: getSublabel, selectionMode: selectionMode, localizedStrings: localizedStrings }) }));
|
|
63
|
+
};
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: "relative", height, overflow: "hidden" }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { overflow: "auto", height: "100%" }, children: [renderContent(), filteringDialog] }), (0, jsx_runtime_1.jsx)(Delayed_1.Delayed, { show: isLoading && !!rootNodes, children: (0, jsx_runtime_1.jsx)(ProgressOverlay_1.ProgressOverlay, {}) })] }));
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=FilterableTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterableTree.js","sourceRoot":"","sources":["../../../../../../../src/components/trees/stateless/common/components/FilterableTree.tsx"],"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 { useEffect, useState } from \"react\";\nimport { Flex, ProgressRadial, Text } from \"@itwin/itwinui-react\";\nimport { createECSchemaProvider, createECSqlQueryExecutor } from \"@itwin/presentation-core-interop\";\nimport { createLimitingECSqlQueryExecutor } from \"@itwin/presentation-hierarchies\";\nimport { isPresentationHierarchyNode, TreeRenderer, useUnifiedSelectionTree } from \"@itwin/presentation-hierarchies-react\";\nimport { createCachingECClassHierarchyInspector } from \"@itwin/presentation-shared\";\nimport { TreeWidget } from \"../../../../../TreeWidget\";\nimport { useHierarchiesLocalization } from \"../UseHierarchiesLocalization\";\nimport { useHierarchyLevelFiltering } from \"../UseHierarchyFiltering\";\nimport { Delayed } from \"./Delayed\";\nimport { ProgressOverlay } from \"./ProgressOverlay\";\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { SchemaContext } from \"@itwin/ecschema-metadata\";\nimport type { PresentationHierarchyNode, useSelectionHandler, useTree } from \"@itwin/presentation-hierarchies-react\";\n\ninterface FilterableTreeOwnProps {\n imodel: IModelConnection;\n getSchemaContext: (imodel: IModelConnection) => SchemaContext;\n height: number;\n width: number;\n treeName: string;\n hierarchyLevelSizeLimit?: number;\n getIcon?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n getSublabel?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n density?: \"default\" | \"enlarged\";\n noDataMessage?: ReactNode;\n}\n\ntype UseTreeProps = Parameters<typeof useTree>[0];\ntype UseSelectionHandlerProps = Parameters<typeof useSelectionHandler>[0];\ntype IModelAccess = UseTreeProps[\"imodelAccess\"];\n\ntype FilterableTreeProps = FilterableTreeOwnProps &\n Pick<UseTreeProps, \"getFilteredPaths\" | \"getHierarchyDefinition\" | \"onPerformanceMeasured\"> &\n Pick<Partial<UseSelectionHandlerProps>, \"selectionMode\">;\n\n/** @internal */\nexport function FilterableTree({ imodel, getSchemaContext, hierarchyLevelSizeLimit, ...props }: FilterableTreeProps) {\n const [imodelAccess, setIModelAccess] = useState<IModelAccess>();\n const defaultHierarchyLevelSizeLimit = hierarchyLevelSizeLimit ?? 1000;\n\n useEffect(() => {\n const schemas = getSchemaContext(imodel);\n const schemaProvider = createECSchemaProvider(schemas);\n setIModelAccess({\n ...schemaProvider,\n ...createCachingECClassHierarchyInspector({ schemaProvider }),\n ...createLimitingECSqlQueryExecutor(createECSqlQueryExecutor(imodel), 1000),\n });\n }, [imodel, getSchemaContext]);\n\n if (!imodelAccess) {\n return null;\n }\n\n return <FilterableTreeRenderer {...props} imodel={imodel} imodelAccess={imodelAccess} defaultHierarchyLevelSizeLimit={defaultHierarchyLevelSizeLimit} />;\n}\n\n/** @internal */\nfunction FilterableTreeRenderer({\n imodel,\n imodelAccess,\n height,\n width,\n treeName,\n getIcon,\n getSublabel,\n noDataMessage,\n defaultHierarchyLevelSizeLimit,\n getHierarchyDefinition,\n selectionMode,\n onPerformanceMeasured,\n}: Omit<FilterableTreeProps, \"getSchemaContext\"> & { imodelAccess: IModelAccess; defaultHierarchyLevelSizeLimit: number }) {\n const localizedStrings = useHierarchiesLocalization();\n const {\n rootNodes,\n isLoading,\n reloadTree: _reloadTree,\n setFormatter: _setFormatter,\n ...treeProps\n } = useUnifiedSelectionTree({\n imodelKey: imodel.key,\n sourceName: treeName,\n imodelAccess,\n getHierarchyDefinition,\n onPerformanceMeasured,\n localizedStrings,\n });\n\n const { filteringDialog, onFilterClick } = useHierarchyLevelFiltering({\n imodel,\n getHierarchyLevelDetails: treeProps.getHierarchyLevelDetails,\n defaultHierarchyLevelSizeLimit,\n });\n\n const renderContent = () => {\n if (rootNodes === undefined) {\n return (\n <Flex alignItems=\"center\" justifyContent=\"center\" flexDirection=\"column\" style={{ width, height }}>\n <Delayed show={true}>\n <ProgressRadial size=\"large\" />\n </Delayed>\n </Flex>\n );\n }\n\n if ((rootNodes.length === 0 && !isLoading) || (rootNodes.length === 1 && !isPresentationHierarchyNode(rootNodes[0]) && rootNodes[0].type === \"Unknown\")) {\n return (\n <Flex alignItems=\"center\" justifyContent=\"center\" flexDirection=\"column\" style={{ width, height }}>\n {noDataMessage ? noDataMessage : <Text>{TreeWidget.translate(\"stateless.dataIsNotAvailable\")}</Text>}\n </Flex>\n );\n }\n\n return (\n <Flex.Item alignSelf=\"flex-start\" style={{ width: \"100%\", overflow: \"auto\" }}>\n <TreeRenderer\n rootNodes={rootNodes}\n {...treeProps}\n onFilterClick={onFilterClick}\n getIcon={getIcon}\n getSublabel={getSublabel}\n selectionMode={selectionMode}\n localizedStrings={localizedStrings}\n />\n </Flex.Item>\n );\n };\n\n return (\n <div style={{ position: \"relative\", height, overflow: \"hidden\" }}>\n <div style={{ overflow: \"auto\", height: \"100%\" }}>\n {renderContent()}\n {filteringDialog}\n </div>\n <Delayed show={isLoading && !!rootNodes}>\n <ProgressOverlay />\n </Delayed>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProgressOverlay = 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
|
+
require("./ProgressOverlay.scss");
|
|
10
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
11
|
+
/** @internal */
|
|
12
|
+
function ProgressOverlay() {
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "tw-progress-overlay-container", children: [(0, jsx_runtime_1.jsx)(itwinui_react_1.ProgressLinear, { indeterminate: true }), (0, jsx_runtime_1.jsx)("div", { className: "tw-progress-overlay-backdrop" })] }));
|
|
14
|
+
}
|
|
15
|
+
exports.ProgressOverlay = ProgressOverlay;
|
|
16
|
+
//# sourceMappingURL=ProgressOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressOverlay.js","sourceRoot":"","sources":["../../../../../../../src/components/trees/stateless/common/components/ProgressOverlay.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,kCAAgC;AAChC,wDAAsD;AAEtD,gBAAgB;AAChB,SAAgB,eAAe;IAC7B,OAAO,CACL,iCAAK,SAAS,EAAC,+BAA+B,aAC5C,uBAAC,8BAAc,IAAC,aAAa,SAAG,EAChC,gCAAK,SAAS,EAAC,8BAA8B,GAAG,IAC5C,CACP,CAAC;AACJ,CAAC;AAPD,0CAOC","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 \"./ProgressOverlay.scss\";\nimport { ProgressLinear } from \"@itwin/itwinui-react\";\n\n/** @internal */\nexport function ProgressOverlay() {\n return (\n <div className=\"tw-progress-overlay-container\">\n <ProgressLinear indeterminate />\n <div className=\"tw-progress-overlay-backdrop\" />\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
|
|
6
|
+
.tw-progress-overlay-container {
|
|
7
|
+
position: absolute;
|
|
8
|
+
left: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
z-index: 1;
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
|
|
15
|
+
.tw-progress-overlay-backdrop {
|
|
16
|
+
opacity: 0.5;
|
|
17
|
+
background-color: var(--iui-color-background-backdrop);
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useSelectionHandler } from "@itwin/presentation-hierarchies-react";
|
|
2
|
+
import { useHierarchyVisibility } from "../UseHierarchyVisibility";
|
|
3
|
+
import type { ReactElement, ReactNode } from "react";
|
|
4
|
+
import type { IModelConnection } from "@itwin/core-frontend";
|
|
5
|
+
import type { SchemaContext } from "@itwin/ecschema-metadata";
|
|
6
|
+
import type { PresentationHierarchyNode, useTree } from "@itwin/presentation-hierarchies-react";
|
|
7
|
+
interface VisibilityTreeOwnProps {
|
|
8
|
+
imodel: IModelConnection;
|
|
9
|
+
getSchemaContext: (imodel: IModelConnection) => SchemaContext;
|
|
10
|
+
height: number;
|
|
11
|
+
width: number;
|
|
12
|
+
treeName: string;
|
|
13
|
+
hierarchyLevelSizeLimit?: number;
|
|
14
|
+
getIcon?: (node: PresentationHierarchyNode) => ReactElement | undefined;
|
|
15
|
+
getSublabel?: (node: PresentationHierarchyNode) => ReactElement | undefined;
|
|
16
|
+
density?: "default" | "enlarged";
|
|
17
|
+
noDataMessage?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
type UseTreeProps = Parameters<typeof useTree>[0];
|
|
20
|
+
type UseHierarchyVisibilityProps = Parameters<typeof useHierarchyVisibility>[0];
|
|
21
|
+
type UseSelectionHandlerProps = Parameters<typeof useSelectionHandler>[0];
|
|
22
|
+
type VisibilityTreeProps = VisibilityTreeOwnProps & Pick<UseTreeProps, "getFilteredPaths" | "getHierarchyDefinition" | "onPerformanceMeasured"> & UseHierarchyVisibilityProps & Pick<Partial<UseSelectionHandlerProps>, "selectionMode">;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare function VisibilityTree({ imodel, getSchemaContext, hierarchyLevelSizeLimit, ...props }: VisibilityTreeProps): JSX.Element | null;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=VisibilityTree.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VisibilityTree = 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 react_1 = require("react");
|
|
10
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
11
|
+
const presentation_core_interop_1 = require("@itwin/presentation-core-interop");
|
|
12
|
+
const presentation_hierarchies_1 = require("@itwin/presentation-hierarchies");
|
|
13
|
+
const presentation_hierarchies_react_1 = require("@itwin/presentation-hierarchies-react");
|
|
14
|
+
const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
15
|
+
const TreeWidget_1 = require("../../../../../TreeWidget");
|
|
16
|
+
const UseHierarchiesLocalization_1 = require("../UseHierarchiesLocalization");
|
|
17
|
+
const UseHierarchyFiltering_1 = require("../UseHierarchyFiltering");
|
|
18
|
+
const UseHierarchyVisibility_1 = require("../UseHierarchyVisibility");
|
|
19
|
+
const UseMultiCheckboxHandler_1 = require("../UseMultiCheckboxHandler");
|
|
20
|
+
const Delayed_1 = require("./Delayed");
|
|
21
|
+
const ProgressOverlay_1 = require("./ProgressOverlay");
|
|
22
|
+
const VisibilityTreeRenderer_1 = require("./VisibilityTreeRenderer");
|
|
23
|
+
/** @internal */
|
|
24
|
+
function VisibilityTree({ imodel, getSchemaContext, hierarchyLevelSizeLimit, ...props }) {
|
|
25
|
+
const [imodelAccess, setImodelAccess] = (0, react_1.useState)();
|
|
26
|
+
const defaultHierarchyLevelSizeLimit = hierarchyLevelSizeLimit ?? 1000;
|
|
27
|
+
(0, react_1.useEffect)(() => {
|
|
28
|
+
const schemaProvider = (0, presentation_core_interop_1.createECSchemaProvider)(getSchemaContext(imodel));
|
|
29
|
+
setImodelAccess({
|
|
30
|
+
...(0, presentation_hierarchies_1.createLimitingECSqlQueryExecutor)((0, presentation_core_interop_1.createECSqlQueryExecutor)(imodel), defaultHierarchyLevelSizeLimit),
|
|
31
|
+
...schemaProvider,
|
|
32
|
+
...(0, presentation_shared_1.createCachingECClassHierarchyInspector)({ schemaProvider }),
|
|
33
|
+
});
|
|
34
|
+
}, [imodel, getSchemaContext, defaultHierarchyLevelSizeLimit]);
|
|
35
|
+
if (!imodelAccess) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(VisibilityTreeImpl, { ...props, imodel: imodel, imodelAccess: imodelAccess, defaultHierarchyLevelSizeLimit: defaultHierarchyLevelSizeLimit });
|
|
39
|
+
}
|
|
40
|
+
exports.VisibilityTree = VisibilityTree;
|
|
41
|
+
function VisibilityTreeImpl({ height, width, imodel, imodelAccess, getHierarchyDefinition, getFilteredPaths, visibilityHandlerFactory, defaultHierarchyLevelSizeLimit, noDataMessage, treeName, getIcon, getSublabel, density, selectionMode, onPerformanceMeasured, }) {
|
|
42
|
+
const localizedStrings = (0, UseHierarchiesLocalization_1.useHierarchiesLocalization)();
|
|
43
|
+
const { rootNodes, isLoading, reloadTree: _reloadTree, selectNodes, setFormatter: _setFormatter, ...treeProps } = (0, presentation_hierarchies_react_1.useUnifiedSelectionTree)({
|
|
44
|
+
imodelAccess,
|
|
45
|
+
getHierarchyDefinition,
|
|
46
|
+
getFilteredPaths,
|
|
47
|
+
imodelKey: imodel.key,
|
|
48
|
+
sourceName: treeName,
|
|
49
|
+
onPerformanceMeasured,
|
|
50
|
+
localizedStrings,
|
|
51
|
+
});
|
|
52
|
+
const { onNodeClick, onNodeKeyDown } = (0, presentation_hierarchies_react_1.useSelectionHandler)({ rootNodes, selectNodes, selectionMode: selectionMode ?? "single" });
|
|
53
|
+
const { getCheckboxStatus, onCheckboxClicked: onClick } = (0, UseHierarchyVisibility_1.useHierarchyVisibility)({ visibilityHandlerFactory });
|
|
54
|
+
const { onCheckboxClicked } = (0, UseMultiCheckboxHandler_1.useMultiCheckboxHandler)({ rootNodes, isNodeSelected: treeProps.isNodeSelected, onClick });
|
|
55
|
+
const { filteringDialog, onFilterClick } = (0, UseHierarchyFiltering_1.useHierarchyLevelFiltering)({
|
|
56
|
+
imodel,
|
|
57
|
+
getHierarchyLevelDetails: treeProps.getHierarchyLevelDetails,
|
|
58
|
+
defaultHierarchyLevelSizeLimit,
|
|
59
|
+
});
|
|
60
|
+
if (rootNodes === undefined) {
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.Flex, { alignItems: "center", justifyContent: "center", flexDirection: "column", style: { width, height }, children: (0, jsx_runtime_1.jsx)(Delayed_1.Delayed, { show: true, children: (0, jsx_runtime_1.jsx)(itwinui_react_1.ProgressRadial, { size: "large" }) }) }));
|
|
62
|
+
}
|
|
63
|
+
if (rootNodes.length === 0 && !isLoading) {
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.Flex, { alignItems: "center", justifyContent: "center", flexDirection: "column", style: { width, height }, children: noDataMessage ? noDataMessage : (0, jsx_runtime_1.jsx)(itwinui_react_1.Text, { children: TreeWidget_1.TreeWidget.translate("stateless.dataIsNotAvailable") }) }));
|
|
65
|
+
}
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: "relative", height, overflow: "hidden" }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { overflow: "auto", height: "100%" }, children: [(0, jsx_runtime_1.jsx)(presentation_hierarchies_react_1.LocalizationContextProvider, { localizedStrings: localizedStrings, children: (0, jsx_runtime_1.jsx)(VisibilityTreeRenderer_1.VisibilityTreeRenderer, { rootNodes: rootNodes, ...treeProps, onNodeClick: onNodeClick, onNodeKeyDown: onNodeKeyDown, getCheckboxStatus: getCheckboxStatus, onCheckboxClicked: onCheckboxClicked, onFilterClick: onFilterClick, getIcon: getIcon, getSublabel: getSublabel, size: density === "enlarged" ? "default" : "small" }) }), filteringDialog] }), (0, jsx_runtime_1.jsx)(Delayed_1.Delayed, { show: isLoading, children: (0, jsx_runtime_1.jsx)(ProgressOverlay_1.ProgressOverlay, {}) })] }));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=VisibilityTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibilityTree.js","sourceRoot":"","sources":["../../../../../../../src/components/trees/stateless/common/components/VisibilityTree.tsx"],"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 { useEffect, useState } from \"react\";\nimport { Flex, ProgressRadial, Text } from \"@itwin/itwinui-react\";\nimport { createECSchemaProvider, createECSqlQueryExecutor } from \"@itwin/presentation-core-interop\";\nimport { createLimitingECSqlQueryExecutor } from \"@itwin/presentation-hierarchies\";\nimport { LocalizationContextProvider, useSelectionHandler, useUnifiedSelectionTree } from \"@itwin/presentation-hierarchies-react\";\nimport { createCachingECClassHierarchyInspector } from \"@itwin/presentation-shared\";\nimport { TreeWidget } from \"../../../../../TreeWidget\";\nimport { useHierarchiesLocalization } from \"../UseHierarchiesLocalization\";\nimport { useHierarchyLevelFiltering } from \"../UseHierarchyFiltering\";\nimport { useHierarchyVisibility } from \"../UseHierarchyVisibility\";\nimport { useMultiCheckboxHandler } from \"../UseMultiCheckboxHandler\";\nimport { Delayed } from \"./Delayed\";\nimport { ProgressOverlay } from \"./ProgressOverlay\";\nimport { VisibilityTreeRenderer } from \"./VisibilityTreeRenderer\";\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { SchemaContext } from \"@itwin/ecschema-metadata\";\nimport type { PresentationHierarchyNode, useTree } from \"@itwin/presentation-hierarchies-react\";\n\ninterface VisibilityTreeOwnProps {\n imodel: IModelConnection;\n getSchemaContext: (imodel: IModelConnection) => SchemaContext;\n height: number;\n width: number;\n treeName: string;\n hierarchyLevelSizeLimit?: number;\n getIcon?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n getSublabel?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n density?: \"default\" | \"enlarged\";\n noDataMessage?: ReactNode;\n}\n\ntype UseTreeProps = Parameters<typeof useTree>[0];\ntype UseHierarchyVisibilityProps = Parameters<typeof useHierarchyVisibility>[0];\ntype IModelAccess = UseTreeProps[\"imodelAccess\"];\ntype UseSelectionHandlerProps = Parameters<typeof useSelectionHandler>[0];\n\ntype VisibilityTreeProps = VisibilityTreeOwnProps &\n Pick<UseTreeProps, \"getFilteredPaths\" | \"getHierarchyDefinition\" | \"onPerformanceMeasured\"> &\n UseHierarchyVisibilityProps &\n Pick<Partial<UseSelectionHandlerProps>, \"selectionMode\">;\n\n/** @internal */\nexport function VisibilityTree({ imodel, getSchemaContext, hierarchyLevelSizeLimit, ...props }: VisibilityTreeProps) {\n const [imodelAccess, setImodelAccess] = useState<IModelAccess>();\n const defaultHierarchyLevelSizeLimit = hierarchyLevelSizeLimit ?? 1000;\n\n useEffect(() => {\n const schemaProvider = createECSchemaProvider(getSchemaContext(imodel));\n setImodelAccess({\n ...createLimitingECSqlQueryExecutor(createECSqlQueryExecutor(imodel), defaultHierarchyLevelSizeLimit),\n ...schemaProvider,\n ...createCachingECClassHierarchyInspector({ schemaProvider }),\n });\n }, [imodel, getSchemaContext, defaultHierarchyLevelSizeLimit]);\n\n if (!imodelAccess) {\n return null;\n }\n\n return <VisibilityTreeImpl {...props} imodel={imodel} imodelAccess={imodelAccess} defaultHierarchyLevelSizeLimit={defaultHierarchyLevelSizeLimit} />;\n}\n\nfunction VisibilityTreeImpl({\n height,\n width,\n imodel,\n imodelAccess,\n getHierarchyDefinition,\n getFilteredPaths,\n visibilityHandlerFactory,\n defaultHierarchyLevelSizeLimit,\n noDataMessage,\n treeName,\n getIcon,\n getSublabel,\n density,\n selectionMode,\n onPerformanceMeasured,\n}: Omit<VisibilityTreeProps, \"getSchemaContext\" | \"hierarchyLevelSizeLimit\"> & { imodelAccess: IModelAccess; defaultHierarchyLevelSizeLimit: number }) {\n const localizedStrings = useHierarchiesLocalization();\n const {\n rootNodes,\n isLoading,\n reloadTree: _reloadTree,\n selectNodes,\n setFormatter: _setFormatter,\n ...treeProps\n } = useUnifiedSelectionTree({\n imodelAccess,\n getHierarchyDefinition,\n getFilteredPaths,\n imodelKey: imodel.key,\n sourceName: treeName,\n onPerformanceMeasured,\n localizedStrings,\n });\n const { onNodeClick, onNodeKeyDown } = useSelectionHandler({ rootNodes, selectNodes, selectionMode: selectionMode ?? \"single\" });\n const { getCheckboxStatus, onCheckboxClicked: onClick } = useHierarchyVisibility({ visibilityHandlerFactory });\n const { onCheckboxClicked } = useMultiCheckboxHandler({ rootNodes, isNodeSelected: treeProps.isNodeSelected, onClick });\n const { filteringDialog, onFilterClick } = useHierarchyLevelFiltering({\n imodel,\n getHierarchyLevelDetails: treeProps.getHierarchyLevelDetails,\n defaultHierarchyLevelSizeLimit,\n });\n\n if (rootNodes === undefined) {\n return (\n <Flex alignItems=\"center\" justifyContent=\"center\" flexDirection=\"column\" style={{ width, height }}>\n <Delayed show={true}>\n <ProgressRadial size=\"large\" />\n </Delayed>\n </Flex>\n );\n }\n\n if (rootNodes.length === 0 && !isLoading) {\n return (\n <Flex alignItems=\"center\" justifyContent=\"center\" flexDirection=\"column\" style={{ width, height }}>\n {noDataMessage ? noDataMessage : <Text>{TreeWidget.translate(\"stateless.dataIsNotAvailable\")}</Text>}\n </Flex>\n );\n }\n\n return (\n <div style={{ position: \"relative\", height, overflow: \"hidden\" }}>\n <div style={{ overflow: \"auto\", height: \"100%\" }}>\n <LocalizationContextProvider localizedStrings={localizedStrings}>\n <VisibilityTreeRenderer\n rootNodes={rootNodes}\n {...treeProps}\n onNodeClick={onNodeClick}\n onNodeKeyDown={onNodeKeyDown}\n getCheckboxStatus={getCheckboxStatus}\n onCheckboxClicked={onCheckboxClicked}\n onFilterClick={onFilterClick}\n getIcon={getIcon}\n getSublabel={getSublabel}\n size={density === \"enlarged\" ? \"default\" : \"small\"}\n />\n </LocalizationContextProvider>\n {filteringDialog}\n </div>\n <Delayed show={isLoading}>\n <ProgressOverlay />\n </Delayed>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PresentationHierarchyNode, RenderedTreeNode } from "@itwin/presentation-hierarchies-react";
|
|
3
|
+
import type { VisibilityStatus } from "../../../VisibilityTreeEventHandler";
|
|
4
|
+
interface VisibilityTreeNodeCheckboxProps {
|
|
5
|
+
node: RenderedTreeNode;
|
|
6
|
+
onCheckboxClicked: (node: PresentationHierarchyNode, checked: boolean) => void;
|
|
7
|
+
getCheckboxStatus: (node: PresentationHierarchyNode) => VisibilityStatus;
|
|
8
|
+
}
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare function VisibilityTreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxStatus }: VisibilityTreeNodeCheckboxProps): JSX.Element | null;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=VisibilityTreeNodeCheckbox.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VisibilityTreeNodeCheckbox = 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_react_1 = require("@itwin/itwinui-react");
|
|
10
|
+
const presentation_hierarchies_react_1 = require("@itwin/presentation-hierarchies-react");
|
|
11
|
+
/** @internal */
|
|
12
|
+
function VisibilityTreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxStatus }) {
|
|
13
|
+
if ("type" in node || !(0, presentation_hierarchies_react_1.isPresentationHierarchyNode)(node)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const checkboxStatus = getCheckboxStatus(node);
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.Checkbox, { className: "tw-visibility-tree-node-checkbox", variant: "eyeball", checked: checkboxStatus.state === "visible", onClick: (e) => {
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
}, onChange: (e) => {
|
|
20
|
+
onCheckboxClicked(node, e.currentTarget.checked);
|
|
21
|
+
}, indeterminate: checkboxStatus.state === "partial", disabled: checkboxStatus.isDisabled, title: checkboxStatus.tooltip }));
|
|
22
|
+
}
|
|
23
|
+
exports.VisibilityTreeNodeCheckbox = VisibilityTreeNodeCheckbox;
|
|
24
|
+
//# sourceMappingURL=VisibilityTreeNodeCheckbox.js.map
|
package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeNodeCheckbox.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibilityTreeNodeCheckbox.js","sourceRoot":"","sources":["../../../../../../../src/components/trees/stateless/common/components/VisibilityTreeNodeCheckbox.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,wDAAgD;AAChD,0FAAoF;AAWpF,gBAAgB;AAChB,SAAgB,0BAA0B,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,EAAmC;IACxH,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,IAAA,4DAA2B,EAAC,IAAI,CAAC,EAAE;QACxD,OAAO,IAAI,CAAC;KACb;IAED,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CACL,uBAAC,wBAAQ,IACP,SAAS,EAAC,kCAAkC,EAC5C,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,cAAc,CAAC,KAAK,KAAK,SAAS,EAC3C,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC,EACD,aAAa,EAAE,cAAc,CAAC,KAAK,KAAK,SAAS,EACjD,QAAQ,EAAE,cAAc,CAAC,UAAU,EACnC,KAAK,EAAE,cAAc,CAAC,OAAO,GAC7B,CACH,CAAC;AACJ,CAAC;AAtBD,gEAsBC","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 { Checkbox } from \"@itwin/itwinui-react\";\nimport { isPresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\n\nimport type { PresentationHierarchyNode, RenderedTreeNode } from \"@itwin/presentation-hierarchies-react\";\nimport type { VisibilityStatus } from \"../../../VisibilityTreeEventHandler\";\n\ninterface VisibilityTreeNodeCheckboxProps {\n node: RenderedTreeNode;\n onCheckboxClicked: (node: PresentationHierarchyNode, checked: boolean) => void;\n getCheckboxStatus: (node: PresentationHierarchyNode) => VisibilityStatus;\n}\n\n/** @internal */\nexport function VisibilityTreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxStatus }: VisibilityTreeNodeCheckboxProps) {\n if (\"type\" in node || !isPresentationHierarchyNode(node)) {\n return null;\n }\n\n const checkboxStatus = getCheckboxStatus(node);\n return (\n <Checkbox\n className=\"tw-visibility-tree-node-checkbox\"\n variant=\"eyeball\"\n checked={checkboxStatus.state === \"visible\"}\n onClick={(e) => {\n e.stopPropagation();\n }}\n onChange={(e) => {\n onCheckboxClicked(node, e.currentTarget.checked);\n }}\n indeterminate={checkboxStatus.state === \"partial\"}\n disabled={checkboxStatus.isDisabled}\n title={checkboxStatus.tooltip}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TreeNodeRenderer } from "@itwin/presentation-hierarchies-react";
|
|
2
|
+
import { VisibilityTreeNodeCheckbox } from "./VisibilityTreeNodeCheckbox";
|
|
3
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
4
|
+
type VisibilityTreeNodeCheckboxProps = ComponentPropsWithoutRef<typeof VisibilityTreeNodeCheckbox>;
|
|
5
|
+
type TreeNodeRendererProps = ComponentPropsWithoutRef<typeof TreeNodeRenderer>;
|
|
6
|
+
type VisibilityTreeNodeRendererProps = TreeNodeRendererProps & Pick<VisibilityTreeNodeCheckboxProps, "onCheckboxClicked" | "getCheckboxStatus">;
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare function VisibilityTreeNodeRenderer({ onCheckboxClicked, getCheckboxStatus, ...restProps }: VisibilityTreeNodeRendererProps): JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=VisibilityTreeNodeRenderer.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.VisibilityTreeNodeRenderer = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
/*---------------------------------------------------------------------------------------------
|
|
9
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
10
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
11
|
+
*--------------------------------------------------------------------------------------------*/
|
|
12
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
13
|
+
const presentation_hierarchies_react_1 = require("@itwin/presentation-hierarchies-react");
|
|
14
|
+
const VisibilityTreeNodeCheckbox_1 = require("./VisibilityTreeNodeCheckbox");
|
|
15
|
+
/** @internal */
|
|
16
|
+
function VisibilityTreeNodeRenderer({ onCheckboxClicked, getCheckboxStatus, ...restProps }) {
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(presentation_hierarchies_react_1.TreeNodeRenderer, { ...restProps, className: (0, classnames_1.default)("tw-visibility-tree-node", restProps.isSelected && "selected"), actionButtonsClassName: "tw-visibility-tree-node-action-buttons", checkbox: (0, jsx_runtime_1.jsx)(VisibilityTreeNodeCheckbox_1.VisibilityTreeNodeCheckbox, { node: restProps.node, onCheckboxClicked: onCheckboxClicked, getCheckboxStatus: getCheckboxStatus }) }));
|
|
18
|
+
}
|
|
19
|
+
exports.VisibilityTreeNodeRenderer = VisibilityTreeNodeRenderer;
|
|
20
|
+
//# sourceMappingURL=VisibilityTreeNodeRenderer.js.map
|
package/lib/cjs/components/trees/stateless/common/components/VisibilityTreeNodeRenderer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibilityTreeNodeRenderer.js","sourceRoot":"","sources":["../../../../../../../src/components/trees/stateless/common/components/VisibilityTreeNodeRenderer.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;gGAGgG;AAEhG,4DAA4B;AAC5B,0FAAyE;AACzE,6EAA0E;AAS1E,gBAAgB;AAChB,SAAgB,0BAA0B,CAAC,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAAG,SAAS,EAAmC;IAChI,OAAO,CACL,uBAAC,iDAAgB,OACX,SAAS,EACb,SAAS,EAAE,IAAA,oBAAE,EAAC,yBAAyB,EAAE,SAAS,CAAC,UAAU,IAAI,UAAU,CAAC,EAC5E,sBAAsB,EAAC,wCAAwC,EAC/D,QAAQ,EAAE,uBAAC,uDAA0B,IAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,GAAI,GAC1I,CACH,CAAC;AACJ,CAAC;AATD,gEASC","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 cx from \"classnames\";\nimport { TreeNodeRenderer } from \"@itwin/presentation-hierarchies-react\";\nimport { VisibilityTreeNodeCheckbox } from \"./VisibilityTreeNodeCheckbox\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\n\ntype VisibilityTreeNodeCheckboxProps = ComponentPropsWithoutRef<typeof VisibilityTreeNodeCheckbox>;\ntype TreeNodeRendererProps = ComponentPropsWithoutRef<typeof TreeNodeRenderer>;\n\ntype VisibilityTreeNodeRendererProps = TreeNodeRendererProps & Pick<VisibilityTreeNodeCheckboxProps, \"onCheckboxClicked\" | \"getCheckboxStatus\">;\n\n/** @internal */\nexport function VisibilityTreeNodeRenderer({ onCheckboxClicked, getCheckboxStatus, ...restProps }: VisibilityTreeNodeRendererProps) {\n return (\n <TreeNodeRenderer\n {...restProps}\n className={cx(\"tw-visibility-tree-node\", restProps.isSelected && \"selected\")}\n actionButtonsClassName=\"tw-visibility-tree-node-action-buttons\"\n checkbox={<VisibilityTreeNodeCheckbox node={restProps.node} onCheckboxClicked={onCheckboxClicked} getCheckboxStatus={getCheckboxStatus} />}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./VisibilityTreeRenderer.scss";
|
|
2
|
+
import { Tree } from "@itwin/itwinui-react";
|
|
3
|
+
import { VisibilityTreeNodeRenderer } from "./VisibilityTreeNodeRenderer";
|
|
4
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
5
|
+
import type { PresentationTreeNode, RenderedTreeNode } from "@itwin/presentation-hierarchies-react";
|
|
6
|
+
interface VisibilityTreeRendererOwnProps {
|
|
7
|
+
rootNodes: PresentationTreeNode[];
|
|
8
|
+
isNodeSelected: (nodeId: string) => boolean;
|
|
9
|
+
}
|
|
10
|
+
type VisibilityTreeRendererProps = Pick<VisibilityTreeNodeRendererProps, "expandNode" | "onNodeClick" | "onNodeKeyDown" | "onFilterClick" | "getIcon" | "getSublabel" | "getCheckboxStatus" | "onCheckboxClicked" | "getHierarchyLevelDetails"> & Omit<TreeProps<RenderedTreeNode>, "data" | "nodeRenderer" | "getNode"> & VisibilityTreeRendererOwnProps;
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare function VisibilityTreeRenderer({ rootNodes, expandNode, onNodeClick, onNodeKeyDown, isNodeSelected, onFilterClick, getIcon, getSublabel, getCheckboxStatus, onCheckboxClicked, getHierarchyLevelDetails, ...props }: VisibilityTreeRendererProps): JSX.Element;
|
|
13
|
+
type TreeProps<T> = ComponentPropsWithoutRef<typeof Tree<T>>;
|
|
14
|
+
type VisibilityTreeNodeRendererProps = ComponentPropsWithoutRef<typeof VisibilityTreeNodeRenderer>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=VisibilityTreeRenderer.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VisibilityTreeRenderer = 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
|
+
require("./VisibilityTreeRenderer.scss");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
12
|
+
const presentation_hierarchies_react_1 = require("@itwin/presentation-hierarchies-react");
|
|
13
|
+
const VisibilityTreeNodeRenderer_1 = require("./VisibilityTreeNodeRenderer");
|
|
14
|
+
/** @internal */
|
|
15
|
+
function VisibilityTreeRenderer({ rootNodes, expandNode, onNodeClick, onNodeKeyDown, isNodeSelected, onFilterClick, getIcon, getSublabel, getCheckboxStatus, onCheckboxClicked, getHierarchyLevelDetails, ...props }) {
|
|
16
|
+
const nodeRenderer = (0, react_1.useCallback)((nodeProps) => {
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(VisibilityTreeNodeRenderer_1.VisibilityTreeNodeRenderer, { ...nodeProps, expandNode: expandNode, onNodeClick: onNodeClick, onNodeKeyDown: onNodeKeyDown, getIcon: getIcon, getSublabel: getSublabel, getCheckboxStatus: getCheckboxStatus, onCheckboxClicked: onCheckboxClicked, onFilterClick: onFilterClick, getHierarchyLevelDetails: getHierarchyLevelDetails }));
|
|
18
|
+
}, [expandNode, onNodeClick, onNodeKeyDown, getHierarchyLevelDetails, getIcon, getSublabel, getCheckboxStatus, onCheckboxClicked, onFilterClick]);
|
|
19
|
+
const getNode = (0, react_1.useCallback)((node) => (0, presentation_hierarchies_react_1.createRenderedTreeNodeData)(node, isNodeSelected), [isNodeSelected]);
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.Tree, { ...props, className: "tw-visibility-tree-renderer", data: rootNodes, nodeRenderer: nodeRenderer, getNode: getNode, enableVirtualization: true }));
|
|
21
|
+
}
|
|
22
|
+
exports.VisibilityTreeRenderer = VisibilityTreeRenderer;
|
|
23
|
+
//# sourceMappingURL=VisibilityTreeRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibilityTreeRenderer.js","sourceRoot":"","sources":["../../../../../../../src/components/trees/stateless/common/components/VisibilityTreeRenderer.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,yCAAuC;AACvC,iCAAoC;AACpC,wDAA4C;AAC5C,0FAAmF;AACnF,6EAA0E;AAyB1E,gBAAgB;AAChB,SAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,GAAG,KAAK,EACoB;IAC5B,MAAM,YAAY,GAAG,IAAA,mBAAW,EAC9B,CAAC,SAAS,EAAE,EAAE;QACZ,OAAO,CACL,uBAAC,uDAA0B,OACrB,SAAS,EACb,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,wBAAwB,EAAE,wBAAwB,GAClD,CACH,CAAC;IACJ,CAAC,EACD,CAAC,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,wBAAwB,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAC9I,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAyC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,2DAA0B,EAAC,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAElJ,OAAO,CACL,uBAAC,oBAAI,OACC,KAAK,EACT,SAAS,EAAC,6BAA6B,EACvC,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,IAAI,GAC1B,CACH,CAAC;AACJ,CAAC;AA9CD,wDA8CC","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 \"./VisibilityTreeRenderer.scss\";\nimport { useCallback } from \"react\";\nimport { Tree } from \"@itwin/itwinui-react\";\nimport { createRenderedTreeNodeData } from \"@itwin/presentation-hierarchies-react\";\nimport { VisibilityTreeNodeRenderer } from \"./VisibilityTreeNodeRenderer\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { PresentationTreeNode, RenderedTreeNode } from \"@itwin/presentation-hierarchies-react\";\n\ninterface VisibilityTreeRendererOwnProps {\n rootNodes: PresentationTreeNode[];\n isNodeSelected: (nodeId: string) => boolean;\n}\n\ntype VisibilityTreeRendererProps = Pick<\n VisibilityTreeNodeRendererProps,\n | \"expandNode\"\n | \"onNodeClick\"\n | \"onNodeKeyDown\"\n | \"onFilterClick\"\n | \"getIcon\"\n | \"getSublabel\"\n | \"getCheckboxStatus\"\n | \"onCheckboxClicked\"\n | \"getHierarchyLevelDetails\"\n> &\n Omit<TreeProps<RenderedTreeNode>, \"data\" | \"nodeRenderer\" | \"getNode\"> &\n VisibilityTreeRendererOwnProps;\n\n/** @internal */\nexport function VisibilityTreeRenderer({\n rootNodes,\n expandNode,\n onNodeClick,\n onNodeKeyDown,\n isNodeSelected,\n onFilterClick,\n getIcon,\n getSublabel,\n getCheckboxStatus,\n onCheckboxClicked,\n getHierarchyLevelDetails,\n ...props\n}: VisibilityTreeRendererProps) {\n const nodeRenderer = useCallback<TreeProps<RenderedTreeNode>[\"nodeRenderer\"]>(\n (nodeProps) => {\n return (\n <VisibilityTreeNodeRenderer\n {...nodeProps}\n expandNode={expandNode}\n onNodeClick={onNodeClick}\n onNodeKeyDown={onNodeKeyDown}\n getIcon={getIcon}\n getSublabel={getSublabel}\n getCheckboxStatus={getCheckboxStatus}\n onCheckboxClicked={onCheckboxClicked}\n onFilterClick={onFilterClick}\n getHierarchyLevelDetails={getHierarchyLevelDetails}\n />\n );\n },\n [expandNode, onNodeClick, onNodeKeyDown, getHierarchyLevelDetails, getIcon, getSublabel, getCheckboxStatus, onCheckboxClicked, onFilterClick],\n );\n\n const getNode = useCallback<TreeProps<RenderedTreeNode>[\"getNode\"]>((node) => createRenderedTreeNodeData(node, isNodeSelected), [isNodeSelected]);\n\n return (\n <Tree<RenderedTreeNode>\n {...props}\n className=\"tw-visibility-tree-renderer\"\n data={rootNodes}\n nodeRenderer={nodeRenderer}\n getNode={getNode}\n enableVirtualization={true}\n />\n );\n}\n\ntype TreeProps<T> = ComponentPropsWithoutRef<typeof Tree<T>>;\ntype VisibilityTreeNodeRendererProps = ComponentPropsWithoutRef<typeof VisibilityTreeNodeRenderer>;\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
|
|
6
|
+
.tw-visibility-tree-renderer {
|
|
7
|
+
width: fit-content;
|
|
8
|
+
min-width: 100%;
|
|
9
|
+
|
|
10
|
+
div:has(> .tw-visibility-tree-node-checkbox) {
|
|
11
|
+
position: sticky;
|
|
12
|
+
left: 0;
|
|
13
|
+
z-index: 1;
|
|
14
|
+
background-color: var(--iui-color-background);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tw-visibility-tree-node-action-buttons {
|
|
18
|
+
position: sticky;
|
|
19
|
+
right: 0;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
background-color: var(--iui-color-background);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
div:has(> .tw-visibility-tree-node-action-buttons) {
|
|
25
|
+
overflow: visible;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tw-visibility-tree-node:not(.selected) {
|
|
29
|
+
div:has(> .tw-visibility-tree-node-checkbox),
|
|
30
|
+
.tw-visibility-tree-node-action-buttons {
|
|
31
|
+
background-color: var(--iui-color-background-hover);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tw-visibility-tree-node.selected {
|
|
36
|
+
div:has(> .tw-visibility-tree-node-checkbox),
|
|
37
|
+
.tw-visibility-tree-node-action-buttons {
|
|
38
|
+
background-color: var(--iui-color-background-accent-muted);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -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
|