@itwin/tree-widget-react 0.10.0 → 1.0.0-dev.1
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 +331 -0
- package/README.md +146 -29
- package/lib/cjs/TreeWidget.d.ts +0 -1
- package/lib/cjs/TreeWidget.js +1 -6
- package/lib/cjs/TreeWidget.js.map +1 -1
- package/lib/cjs/components/TreeFilteringState.d.ts +3 -1
- package/lib/cjs/components/TreeFilteringState.js +19 -40
- package/lib/cjs/components/TreeFilteringState.js.map +1 -1
- package/lib/cjs/components/TreeWidgetComponent.d.ts +29 -5
- package/lib/cjs/components/TreeWidgetComponent.js +85 -29
- package/lib/cjs/components/TreeWidgetComponent.js.map +1 -1
- package/lib/cjs/components/TreeWidgetComponent.scss +4 -24
- package/lib/cjs/components/TreeWidgetUiItemsProvider.d.ts +25 -2
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js +31 -46
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/cjs/components/tree-header/TreeHeader.d.ts +26 -0
- package/lib/cjs/components/tree-header/TreeHeader.js +43 -0
- package/lib/cjs/components/tree-header/TreeHeader.js.map +1 -0
- package/lib/cjs/components/tree-header/TreeHeader.scss +69 -0
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.d.ts +12 -6
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.js +10 -4
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/cjs/components/trees/Common.d.ts +2 -2
- package/lib/cjs/components/trees/Common.js +1 -1
- package/lib/cjs/components/trees/Common.js.map +1 -1
- package/lib/cjs/components/trees/VisibilityTreeBase.scss +66 -10
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.d.ts +13 -12
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.js +6 -17
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.js.map +1 -1
- package/lib/cjs/components/trees/VisibilityTreeRenderer.d.ts +38 -14
- package/lib/cjs/components/trees/VisibilityTreeRenderer.js +35 -41
- package/lib/cjs/components/trees/VisibilityTreeRenderer.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTree.d.ts +12 -11
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js +17 -41
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.d.ts +67 -6
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js +61 -72
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.d.ts +30 -8
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js +61 -34
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/cjs/components/trees/external-sources-tree/ExternalSources.json +230 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +27 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.js +61 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +20 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +39 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.d.ts +30 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.js +39 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +26 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTreeComponent.js +35 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/index.d.ts +5 -1
- package/lib/cjs/components/trees/index.js +10 -2
- package/lib/cjs/components/trees/index.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsTree.d.ts +26 -18
- package/lib/cjs/components/trees/models-tree/ModelsTree.js +22 -50
- package/lib/cjs/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.d.ts +70 -2
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js +68 -105
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.d.ts +40 -12
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js +65 -5
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/Utils.d.ts +12 -0
- package/lib/cjs/components/trees/models-tree/Utils.js +625 -1
- package/lib/cjs/components/trees/models-tree/Utils.js.map +1 -1
- package/lib/cjs/components/utils/AutoSizer.d.ts +6 -3
- package/lib/cjs/components/utils/AutoSizer.js +9 -29
- package/lib/cjs/components/utils/AutoSizer.js.map +1 -1
- package/lib/cjs/components/utils/IsPromiseLike.d.ts +4 -1
- package/lib/cjs/components/utils/IsPromiseLike.js +6 -3
- package/lib/cjs/components/utils/IsPromiseLike.js.map +1 -1
- package/lib/cjs/tree-widget-react.d.ts +0 -1
- package/lib/cjs/tree-widget-react.js +5 -2
- package/lib/cjs/tree-widget-react.js.map +1 -1
- package/lib/esm/TreeWidget.d.ts +0 -1
- package/lib/esm/TreeWidget.js +2 -7
- package/lib/esm/TreeWidget.js.map +1 -1
- package/lib/esm/components/TreeFilteringState.d.ts +3 -1
- package/lib/esm/components/TreeFilteringState.js +17 -19
- package/lib/esm/components/TreeFilteringState.js.map +1 -1
- package/lib/esm/components/TreeWidgetComponent.d.ts +29 -5
- package/lib/esm/components/TreeWidgetComponent.js +82 -7
- package/lib/esm/components/TreeWidgetComponent.js.map +1 -1
- package/lib/esm/components/TreeWidgetComponent.scss +4 -24
- package/lib/esm/components/TreeWidgetUiItemsProvider.d.ts +25 -2
- package/lib/esm/components/TreeWidgetUiItemsProvider.js +29 -41
- package/lib/esm/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/components/tree-header/TreeHeader.d.ts +26 -0
- package/lib/esm/components/tree-header/TreeHeader.js +36 -0
- package/lib/esm/components/tree-header/TreeHeader.js.map +1 -0
- package/lib/esm/components/tree-header/TreeHeader.scss +69 -0
- package/lib/esm/components/trees/CategoriesVisibilityUtils.d.ts +12 -6
- package/lib/esm/components/trees/CategoriesVisibilityUtils.js +10 -4
- package/lib/esm/components/trees/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/esm/components/trees/Common.d.ts +2 -2
- package/lib/esm/components/trees/Common.js +1 -1
- package/lib/esm/components/trees/Common.js.map +1 -1
- package/lib/esm/components/trees/VisibilityTreeBase.scss +66 -10
- package/lib/esm/components/trees/VisibilityTreeEventHandler.d.ts +13 -12
- package/lib/esm/components/trees/VisibilityTreeEventHandler.js +6 -17
- package/lib/esm/components/trees/VisibilityTreeEventHandler.js.map +1 -1
- package/lib/esm/components/trees/VisibilityTreeRenderer.d.ts +38 -14
- package/lib/esm/components/trees/VisibilityTreeRenderer.js +29 -19
- package/lib/esm/components/trees/VisibilityTreeRenderer.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTree.d.ts +12 -11
- package/lib/esm/components/trees/category-tree/CategoriesTree.js +16 -21
- package/lib/esm/components/trees/category-tree/CategoriesTree.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.d.ts +67 -6
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js +60 -52
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.d.ts +30 -8
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js +57 -14
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/esm/components/trees/external-sources-tree/ExternalSources.json +230 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +27 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.js +34 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +20 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +35 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.d.ts +30 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.js +32 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +26 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTreeComponent.js +31 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/index.d.ts +5 -1
- package/lib/esm/components/trees/index.js +5 -1
- package/lib/esm/components/trees/index.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsTree.d.ts +26 -18
- package/lib/esm/components/trees/models-tree/ModelsTree.js +23 -32
- package/lib/esm/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.d.ts +70 -2
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js +66 -84
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.d.ts +40 -12
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js +60 -5
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/esm/components/trees/models-tree/Utils.d.ts +12 -0
- package/lib/esm/components/trees/models-tree/Utils.js +622 -0
- package/lib/esm/components/trees/models-tree/Utils.js.map +1 -1
- package/lib/esm/components/utils/AutoSizer.d.ts +6 -3
- package/lib/esm/components/utils/AutoSizer.js +9 -10
- package/lib/esm/components/utils/AutoSizer.js.map +1 -1
- package/lib/esm/components/utils/IsPromiseLike.d.ts +4 -1
- package/lib/esm/components/utils/IsPromiseLike.js +4 -1
- package/lib/esm/components/utils/IsPromiseLike.js.map +1 -1
- package/lib/esm/tree-widget-react.d.ts +0 -1
- package/lib/esm/tree-widget-react.js +0 -1
- package/lib/esm/tree-widget-react.js.map +1 -1
- package/lib/public/locales/en/TreeWidget.json +13 -4
- package/package.json +44 -48
- package/lib/cjs/components/rulesets/ClassificationSystems.json +0 -122
- package/lib/cjs/components/search-bar/SearchBar.d.ts +0 -48
- package/lib/cjs/components/search-bar/SearchBar.js +0 -86
- package/lib/cjs/components/search-bar/SearchBar.js.map +0 -1
- package/lib/cjs/components/search-bar/SearchBar.scss +0 -118
- package/lib/cjs/components/search-bar/SearchBox.d.ts +0 -70
- package/lib/cjs/components/search-bar/SearchBox.js +0 -186
- package/lib/cjs/components/search-bar/SearchBox.js.map +0 -1
- package/lib/cjs/components/search-bar/SearchBox.scss +0 -70
- package/lib/cjs/components/trees/IModelContentTree.d.ts +0 -4
- package/lib/cjs/components/trees/IModelContentTree.js +0 -50
- package/lib/cjs/components/trees/IModelContentTree.js.map +0 -1
- package/lib/cjs/components/trees/models-tree/Hierarchy.GroupedByClass.json +0 -391
- package/lib/cjs/components/trees/models-tree/Hierarchy.json +0 -386
- package/lib/cjs/components/trees/models-tree/ModelsTreeSearch.json +0 -239
- package/lib/cjs/types.d.ts +0 -44
- package/lib/cjs/types.js +0 -11
- package/lib/cjs/types.js.map +0 -1
- package/lib/esm/components/rulesets/ClassificationSystems.json +0 -122
- package/lib/esm/components/search-bar/SearchBar.d.ts +0 -48
- package/lib/esm/components/search-bar/SearchBar.js +0 -60
- package/lib/esm/components/search-bar/SearchBar.js.map +0 -1
- package/lib/esm/components/search-bar/SearchBar.scss +0 -118
- package/lib/esm/components/search-bar/SearchBox.d.ts +0 -70
- package/lib/esm/components/search-bar/SearchBox.js +0 -160
- package/lib/esm/components/search-bar/SearchBox.js.map +0 -1
- package/lib/esm/components/search-bar/SearchBox.scss +0 -70
- package/lib/esm/components/trees/IModelContentTree.d.ts +0 -4
- package/lib/esm/components/trees/IModelContentTree.js +0 -24
- package/lib/esm/components/trees/IModelContentTree.js.map +0 -1
- package/lib/esm/components/trees/models-tree/Hierarchy.GroupedByClass.json +0 -391
- package/lib/esm/components/trees/models-tree/Hierarchy.json +0 -386
- package/lib/esm/components/trees/models-tree/ModelsTreeSearch.json +0 -239
- package/lib/esm/types.d.ts +0 -44
- package/lib/esm/types.js +0 -8
- package/lib/esm/types.js.map +0 -1
- /package/lib/cjs/components/{rulesets → trees/imodel-content-tree}/IModelContent.json +0 -0
- /package/lib/esm/components/{rulesets → trees/imodel-content-tree}/IModelContent.json +0 -0
|
@@ -14,16 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
.components-selectable-content {
|
|
16
16
|
flex: 1;
|
|
17
|
+
overflow: hidden;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
.components-selectable-content-header {
|
|
20
|
-
|
|
21
|
-
align-items: center;
|
|
22
|
-
margin-bottom: var(--iui-size-2xs);
|
|
23
|
-
|
|
24
|
-
.uicore-reactSelectTop {
|
|
25
|
-
flex: 1;
|
|
26
|
-
}
|
|
21
|
+
padding-bottom: var(--iui-size-2xs);
|
|
27
22
|
}
|
|
28
23
|
|
|
29
24
|
.components-selectable-content-wrapper {
|
|
@@ -32,25 +27,10 @@
|
|
|
32
27
|
flex-grow: 1;
|
|
33
28
|
height: 100%;
|
|
34
29
|
}
|
|
35
|
-
|
|
36
|
-
.visibility-tree-toolbar {
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: row;
|
|
39
|
-
align-items: center;
|
|
40
|
-
margin-bottom: var(--iui-size-2xs);
|
|
41
|
-
|
|
42
|
-
.tree-toolbar-searchbox {
|
|
43
|
-
margin-left: auto;
|
|
44
|
-
|
|
45
|
-
.components-filtering-input {
|
|
46
|
-
margin: 0;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
30
|
}
|
|
51
31
|
|
|
52
32
|
.tree-widget-select {
|
|
53
|
-
|
|
33
|
+
padding-bottom: var(--iui-size-2xs);
|
|
54
34
|
}
|
|
55
35
|
|
|
56
36
|
.tree-widget-tree-container {
|
|
@@ -60,5 +40,5 @@
|
|
|
60
40
|
}
|
|
61
41
|
|
|
62
42
|
.tree-widget-search-bar {
|
|
63
|
-
|
|
43
|
+
padding-bottom: var(--iui-size-2xs);
|
|
64
44
|
}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
-
import { StagePanelLocation, StagePanelSection
|
|
2
|
-
import {
|
|
1
|
+
import { StagePanelLocation, StagePanelSection } from "@itwin/appui-react";
|
|
2
|
+
import type { UiItemsProvider, Widget } from "@itwin/appui-react";
|
|
3
|
+
import type { TreeDefinition } from "./TreeWidgetComponent";
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for creating a [[TreeWidgetUiItemsProvider]].
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface TreeWidgetOptions {
|
|
9
|
+
/** The stage panel to place the widget in. Defaults to `StagePanelLocation.Right`. */
|
|
10
|
+
defaultPanelLocation?: StagePanelLocation;
|
|
11
|
+
/** The stage panel section to place the widget in. Defaults to `StagePanelSection.Start`. */
|
|
12
|
+
defaultPanelSection?: StagePanelSection;
|
|
13
|
+
/** Widget priority in the stage panel. */
|
|
14
|
+
defaultTreeWidgetPriority?: number;
|
|
15
|
+
/** Trees to show in the widget. Defaults to [[ModelsTreeComponent]] and [[CategoriesTreeComponent]]. */
|
|
16
|
+
trees?: TreeDefinition[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Id of the tree widget created by [[TreeWidgetUiItemsProvider]].
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
3
22
|
export declare const TreeWidgetId = "tree-widget-react:trees";
|
|
23
|
+
/**
|
|
24
|
+
* A [[UiItemsProvider]] implementation that provides a [[TreeWidgetComponent]] into a stage panel.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
4
27
|
export declare class TreeWidgetUiItemsProvider implements UiItemsProvider {
|
|
5
28
|
private _treeWidgetOptions?;
|
|
6
29
|
readonly id = "TreeWidgetUiItemsProvider";
|
|
@@ -1,65 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
/*---------------------------------------------------------------------------------------------
|
|
2
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
5
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/* eslint-disable react/display-name */
|
|
6
|
-
import React from "react";
|
|
7
6
|
import { StagePanelLocation, StagePanelSection, StageUsage } from "@itwin/appui-react";
|
|
7
|
+
import { SvgHierarchyTree } from "@itwin/itwinui-icons-react";
|
|
8
8
|
import { TreeWidget } from "../TreeWidget";
|
|
9
|
-
import { CategoriesTreeId, ModelsTreeId } from "../types";
|
|
10
9
|
import { CategoriesTreeComponent } from "./trees/category-tree/CategoriesTreeComponent";
|
|
11
|
-
import { ClassGroupingOption } from "./trees/Common";
|
|
12
10
|
import { ModelsTreeComponent } from "./trees/models-tree/ModelsTreeComponent";
|
|
13
11
|
import { TreeWidgetComponent } from "./TreeWidgetComponent";
|
|
12
|
+
/**
|
|
13
|
+
* Id of the tree widget created by [[TreeWidgetUiItemsProvider]].
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
14
16
|
export const TreeWidgetId = "tree-widget-react:trees";
|
|
17
|
+
/**
|
|
18
|
+
* A [[UiItemsProvider]] implementation that provides a [[TreeWidgetComponent]] into a stage panel.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
15
21
|
export class TreeWidgetUiItemsProvider {
|
|
16
22
|
constructor(_treeWidgetOptions) {
|
|
17
23
|
this._treeWidgetOptions = _treeWidgetOptions;
|
|
18
24
|
this.id = "TreeWidgetUiItemsProvider";
|
|
19
25
|
}
|
|
20
26
|
provideWidgets(_stageId, stageUsage, location, section) {
|
|
21
|
-
const widgets = [];
|
|
22
27
|
const preferredLocation = this._treeWidgetOptions?.defaultPanelLocation ?? StagePanelLocation.Right;
|
|
23
28
|
const preferredPanelSection = this._treeWidgetOptions?.defaultPanelSection ?? StagePanelSection.Start;
|
|
24
|
-
if (location
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
id: CategoriesTreeId,
|
|
41
|
-
render: () => (React.createElement(CategoriesTreeComponent, { ...this._treeWidgetOptions?.categoriesTreeProps })),
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (this._treeWidgetOptions?.additionalTrees) {
|
|
45
|
-
trees.push(...this._treeWidgetOptions.additionalTrees);
|
|
46
|
-
}
|
|
47
|
-
if (this._treeWidgetOptions?.defaultTreeId && trees.length !== 0) {
|
|
48
|
-
// Adding the defaultTree to first index
|
|
49
|
-
const { defaultTreeId } = this._treeWidgetOptions;
|
|
50
|
-
const extractedDefaultTree = trees.filter((tree) => tree.id === defaultTreeId)[0];
|
|
51
|
-
const index = trees.indexOf(extractedDefaultTree);
|
|
52
|
-
trees.unshift(trees.splice(index, 1)[0]);
|
|
53
|
-
}
|
|
54
|
-
widgets.push({
|
|
29
|
+
if (location !== preferredLocation || section !== preferredPanelSection || stageUsage !== StageUsage.General) {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
const trees = this._treeWidgetOptions?.trees ?? [
|
|
33
|
+
{
|
|
34
|
+
id: ModelsTreeComponent.id,
|
|
35
|
+
getLabel: ModelsTreeComponent.getLabel,
|
|
36
|
+
render: () => _jsx(ModelsTreeComponent, {}),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: CategoriesTreeComponent.id,
|
|
40
|
+
getLabel: CategoriesTreeComponent.getLabel,
|
|
41
|
+
render: () => _jsx(CategoriesTreeComponent, {}),
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
return [{
|
|
55
45
|
id: TreeWidgetId,
|
|
56
46
|
label: TreeWidget.translate("treeview"),
|
|
57
|
-
content:
|
|
58
|
-
icon:
|
|
47
|
+
content: _jsx(TreeWidgetComponent, { trees: trees }),
|
|
48
|
+
icon: _jsx(SvgHierarchyTree, {}),
|
|
59
49
|
priority: this._treeWidgetOptions?.defaultTreeWidgetPriority,
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return widgets;
|
|
50
|
+
}];
|
|
63
51
|
}
|
|
64
52
|
}
|
|
65
53
|
//# sourceMappingURL=TreeWidgetUiItemsProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../../../src/components/TreeWidgetUiItemsProvider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;
|
|
1
|
+
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../../../src/components/TreeWidgetUiItemsProvider.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AA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G;gBAC1B,QAAQ,EAAE,IAAI,CAAC,kBAAkB,EAAE,yBAAyB;aAC7D,CAAC,CAAC;IACL,CAAC;CACF","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 { StagePanelLocation, StagePanelSection, StageUsage } from \"@itwin/appui-react\";\nimport { SvgHierarchyTree } from \"@itwin/itwinui-icons-react\";\nimport { TreeWidget } from \"../TreeWidget\";\nimport { CategoriesTreeComponent } from \"./trees/category-tree/CategoriesTreeComponent\";\nimport { ModelsTreeComponent } from \"./trees/models-tree/ModelsTreeComponent\";\nimport { TreeWidgetComponent } from \"./TreeWidgetComponent\";\n\nimport type { UiItemsProvider, Widget } from \"@itwin/appui-react\";\nimport type { TreeDefinition } from \"./TreeWidgetComponent\";\n\n/**\n * Parameters for creating a [[TreeWidgetUiItemsProvider]].\n * @public\n */\nexport interface TreeWidgetOptions {\n /** The stage panel to place the widget in. Defaults to `StagePanelLocation.Right`. */\n defaultPanelLocation?: StagePanelLocation;\n /** The stage panel section to place the widget in. Defaults to `StagePanelSection.Start`. */\n defaultPanelSection?: StagePanelSection;\n /** Widget priority in the stage panel. */\n defaultTreeWidgetPriority?: number;\n /** Trees to show in the widget. Defaults to [[ModelsTreeComponent]] and [[CategoriesTreeComponent]]. */\n trees?: TreeDefinition[];\n}\n\n/**\n * Id of the tree widget created by [[TreeWidgetUiItemsProvider]].\n * @public\n */\nexport const TreeWidgetId = \"tree-widget-react:trees\";\n\n/**\n * A [[UiItemsProvider]] implementation that provides a [[TreeWidgetComponent]] into a stage panel.\n * @public\n */\nexport class TreeWidgetUiItemsProvider implements UiItemsProvider {\n public readonly id = \"TreeWidgetUiItemsProvider\";\n\n constructor(private _treeWidgetOptions?: TreeWidgetOptions) { }\n\n public provideWidgets(\n _stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ): ReadonlyArray<Widget> {\n const preferredLocation = this._treeWidgetOptions?.defaultPanelLocation ?? StagePanelLocation.Right;\n const preferredPanelSection = this._treeWidgetOptions?.defaultPanelSection ?? StagePanelSection.Start;\n\n if (location !== preferredLocation || section !== preferredPanelSection || stageUsage !== StageUsage.General) {\n return [];\n }\n\n const trees: TreeDefinition[] = this._treeWidgetOptions?.trees ?? [\n {\n id: ModelsTreeComponent.id,\n getLabel: ModelsTreeComponent.getLabel,\n render: () => <ModelsTreeComponent />,\n },\n {\n id: CategoriesTreeComponent.id,\n getLabel: CategoriesTreeComponent.getLabel,\n render: () => <CategoriesTreeComponent />,\n },\n ];\n\n return [{\n id: TreeWidgetId,\n label: TreeWidget.translate(\"treeview\"),\n content: <TreeWidgetComponent trees={trees} />,\n icon: <SvgHierarchyTree />,\n priority: this._treeWidgetOptions?.defaultTreeWidgetPriority,\n }];\n }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./TreeHeader.scss";
|
|
3
|
+
import type { Viewport } from "@itwin/core-frontend";
|
|
4
|
+
import type { CommonProps } from "@itwin/core-react";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export interface TreeHeaderButtonProps {
|
|
7
|
+
viewport: Viewport;
|
|
8
|
+
}
|
|
9
|
+
/** @internal */
|
|
10
|
+
export interface TreeHeaderProps extends CommonProps {
|
|
11
|
+
/** Filtering is cleared after everything's loaded */
|
|
12
|
+
onFilterStart: (newFilter: string) => void;
|
|
13
|
+
/** listens for onClick event for Clear (x) icon */
|
|
14
|
+
onFilterClear: () => void;
|
|
15
|
+
/** Total number of results/entries */
|
|
16
|
+
resultCount?: number;
|
|
17
|
+
/** Current selected result index */
|
|
18
|
+
selectedIndex?: number;
|
|
19
|
+
/** Callback to currently selected result/entry change */
|
|
20
|
+
onSelectedChanged: (index: number) => void;
|
|
21
|
+
/** Header buttons */
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare function TreeHeader(props: TreeHeaderProps): JSX.Element;
|
|
26
|
+
//# sourceMappingURL=TreeHeader.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import "./TreeHeader.scss";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import { Children, useState } from "react";
|
|
9
|
+
import { SvgCaretDownSmall, SvgCaretUpSmall, SvgMore } from "@itwin/itwinui-icons-react";
|
|
10
|
+
import { ButtonGroup, Divider, DropdownMenu, IconButton, SearchBox } from "@itwin/itwinui-react";
|
|
11
|
+
import { TreeWidget } from "../../TreeWidget";
|
|
12
|
+
/** @internal */
|
|
13
|
+
export function TreeHeader(props) {
|
|
14
|
+
const { onFilterStart, onFilterClear, resultCount, selectedIndex, onSelectedChanged, children, className } = props;
|
|
15
|
+
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
16
|
+
return (_jsxs("div", { className: classnames("tree-widget-tree-header", className), children: [_jsx(HeaderButtons, { contracted: isSearchOpen, children: children }), _jsxs(SearchBox, { expandable: true, onExpand: () => setIsSearchOpen(true), onCollapse: () => setIsSearchOpen(false), className: classnames("tree-widget-search-box", !isSearchOpen && "contracted"), children: [_jsx(SearchBox.CollapsedState, { children: _jsx(SearchBox.ExpandButton, { title: TreeWidget.translate("searchBox.searchForSomething"), "aria-label": TreeWidget.translate("searchBox.open"), size: "small" }) }), _jsxs(SearchBox.ExpandedState, { children: [_jsx(SearchBox.Input, { placeholder: TreeWidget.translate("searchBox.search"), onChange: (e) => e.currentTarget.value ? onFilterStart(e.currentTarget.value) : onFilterClear(), className: "search-input" }), _jsx(SearchResultStepper, { selectedIndex: selectedIndex, total: resultCount, onStep: onSelectedChanged }), _jsx(SearchBox.CollapseButton, { onClick: onFilterClear, size: "small", "aria-label": TreeWidget.translate("searchBox.close") })] })] })] }));
|
|
17
|
+
}
|
|
18
|
+
function HeaderButtons(props) {
|
|
19
|
+
const className = classnames("button-container", props.contracted && "contracted");
|
|
20
|
+
return (_jsx(ButtonGroup, { className: className, overflowButton: (overflowStart) => (_jsx(DropdownMenu, { menuItems: () => Children.toArray(props.children)
|
|
21
|
+
.slice(overflowStart === 0 ? overflowStart : overflowStart - 1)
|
|
22
|
+
.map((btn, index) => _jsx("li", { className: "dropdown-item", role: "menuitem", children: btn }, index)), className: "tree-header-button-dropdown-container", children: _jsx(IconButton, { styleType: "borderless", size: "small", children: _jsx(SvgMore, {}) }) })), children: props.children }));
|
|
23
|
+
}
|
|
24
|
+
function SearchResultStepper(props) {
|
|
25
|
+
const { selectedIndex = 1, total, onStep } = props;
|
|
26
|
+
if (!total)
|
|
27
|
+
return null;
|
|
28
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "searchbox-stepping-count", children: `${selectedIndex}/${total}` }), _jsx(Divider, { orientation: "vertical" }), _jsx(SearchBox.Button, { title: TreeWidget.translate("searchBox.previous"), size: "small", onClick: () => {
|
|
29
|
+
if (selectedIndex > 1)
|
|
30
|
+
onStep(selectedIndex - 1);
|
|
31
|
+
}, children: _jsx(SvgCaretUpSmall, {}) }), _jsx(SearchBox.Button, { title: TreeWidget.translate("searchBox.next"), size: "small", onClick: () => {
|
|
32
|
+
if (selectedIndex < total)
|
|
33
|
+
onStep(selectedIndex + 1);
|
|
34
|
+
}, children: _jsx(SvgCaretDownSmall, {}) })] }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=TreeHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeHeader.js","sourceRoot":"","sources":["../../../../src/components/tree-header/TreeHeader.tsx"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AC,OAAO,YAC7C,KAAC,OAAO,KAAG,GACA,GACA,CAChB,YAEA,KAAK,CAAC,QAAQ,GACH,CACf,CAAC;AACJ,CAAC;AAQD,SAAS,mBAAmB,CAAC,KAA+B;IAC1D,MAAM,EAAE,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACnD,IAAI,CAAC,KAAK;QACR,OAAO,IAAI,CAAC;IAEd,OAAO,CACL,8BACE,eAAM,SAAS,EAAC,0BAA0B,YAAE,GAAG,aAAa,IAAI,KAAK,EAAE,GAAQ,EAC/E,KAAC,OAAO,IAAC,WAAW,EAAC,UAAU,GAAG,EAClC,KAAC,SAAS,CAAC,MAAM,IACf,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,oBAAoB,CAAC,EACjD,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,aAAa,GAAG,CAAC;wBACnB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;gBAC9B,CAAC,YAED,KAAC,eAAe,KAAG,GACF,EACnB,KAAC,SAAS,CAAC,MAAM,IACf,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAC7C,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,aAAa,GAAG,KAAK;wBACvB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;gBAC9B,CAAC,YAED,KAAC,iBAAiB,KAAG,GACJ,IAClB,CACJ,CAAC;AACJ,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 \"./TreeHeader.scss\";\nimport classnames from \"classnames\";\nimport { Children, useState } from \"react\";\nimport { SvgCaretDownSmall, SvgCaretUpSmall, SvgMore } from \"@itwin/itwinui-icons-react\";\nimport { ButtonGroup, Divider, DropdownMenu, IconButton, SearchBox } from \"@itwin/itwinui-react\";\nimport { TreeWidget } from \"../../TreeWidget\";\n\nimport type { Viewport } from \"@itwin/core-frontend\";\nimport type { CommonProps } from \"@itwin/core-react\";\n\n/** @internal */\nexport interface TreeHeaderButtonProps {\n viewport: Viewport;\n}\n\n/** @internal */\nexport interface TreeHeaderProps extends CommonProps {\n /** Filtering is cleared after everything's loaded */\n onFilterStart: (newFilter: string) => void;\n /** listens for onClick event for Clear (x) icon */\n onFilterClear: () => void;\n /** Total number of results/entries */\n resultCount?: number;\n /** Current selected result index */\n selectedIndex?: number;\n /** Callback to currently selected result/entry change */\n onSelectedChanged: (index: number) => void;\n /** Header buttons */\n children?: React.ReactNode;\n}\n\n/** @internal */\nexport function TreeHeader(props: TreeHeaderProps) {\n const { onFilterStart, onFilterClear, resultCount, selectedIndex, onSelectedChanged, children, className } = props;\n const [isSearchOpen, setIsSearchOpen] = useState<boolean>(false);\n return (\n <div className={classnames(\"tree-widget-tree-header\", className)}>\n <HeaderButtons contracted={isSearchOpen}>\n {children}\n </HeaderButtons>\n <SearchBox\n expandable\n onExpand={() => setIsSearchOpen(true)}\n onCollapse={() => setIsSearchOpen(false)}\n className={classnames(\"tree-widget-search-box\", !isSearchOpen && \"contracted\")}\n >\n <SearchBox.CollapsedState>\n <SearchBox.ExpandButton\n title={TreeWidget.translate(\"searchBox.searchForSomething\")}\n aria-label={TreeWidget.translate(\"searchBox.open\")}\n size=\"small\"\n />\n </SearchBox.CollapsedState>\n <SearchBox.ExpandedState >\n <SearchBox.Input\n placeholder={TreeWidget.translate(\"searchBox.search\")}\n onChange={(e) => e.currentTarget.value ? onFilterStart(e.currentTarget.value) : onFilterClear()}\n className=\"search-input\"\n />\n <SearchResultStepper\n selectedIndex={selectedIndex}\n total={resultCount}\n onStep={onSelectedChanged}\n />\n <SearchBox.CollapseButton\n onClick={onFilterClear}\n size=\"small\"\n aria-label={TreeWidget.translate(\"searchBox.close\")}\n />\n </SearchBox.ExpandedState>\n </SearchBox>\n </div>\n );\n}\n\ninterface HeaderButtonsProps {\n contracted: boolean;\n children?: React.ReactNode;\n}\n\nfunction HeaderButtons(props: HeaderButtonsProps) {\n const className = classnames(\n \"button-container\",\n props.contracted && \"contracted\",\n );\n\n return (\n <ButtonGroup\n className={className}\n overflowButton={(overflowStart) => (\n <DropdownMenu\n menuItems={() =>\n Children.toArray(props.children)\n .slice(overflowStart === 0 ? overflowStart : overflowStart - 1)\n .map((btn, index) => <li key={index} className=\"dropdown-item\" role=\"menuitem\">{btn}</li>)\n }\n className=\"tree-header-button-dropdown-container\"\n >\n <IconButton styleType=\"borderless\" size=\"small\">\n <SvgMore />\n </IconButton>\n </DropdownMenu>\n )}\n >\n {props.children}\n </ButtonGroup>\n );\n}\n\ninterface SearchResultStepperProps {\n total?: number;\n onStep: (newIndex: number) => void;\n selectedIndex?: number;\n}\n\nfunction SearchResultStepper(props: SearchResultStepperProps) {\n const { selectedIndex = 1, total, onStep } = props;\n if (!total)\n return null;\n\n return (\n <>\n <span className=\"searchbox-stepping-count\">{`${selectedIndex}/${total}`}</span>\n <Divider orientation=\"vertical\" />\n <SearchBox.Button\n title={TreeWidget.translate(\"searchBox.previous\")}\n size=\"small\"\n onClick={() => {\n if (selectedIndex > 1)\n onStep(selectedIndex - 1);\n }}\n >\n <SvgCaretUpSmall />\n </SearchBox.Button>\n <SearchBox.Button\n title={TreeWidget.translate(\"searchBox.next\")}\n size=\"small\"\n onClick={() => {\n if (selectedIndex < total)\n onStep(selectedIndex + 1);\n }}\n >\n <SvgCaretDownSmall />\n </SearchBox.Button>\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
// Buttons dropdown container
|
|
7
|
+
.tree-header-button-dropdown-container {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: center;
|
|
11
|
+
margin-top: calc(var(--iui-size-2xs) + var(--iui-size-3xs));
|
|
12
|
+
|
|
13
|
+
.dropdown-item {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: var(--iui-size-xl);
|
|
16
|
+
|
|
17
|
+
> * {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
cursor: default;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.tree-widget-tree-header {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
height: var(--iui-size-xl);
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
|
|
35
|
+
.tree-widget-search-box {
|
|
36
|
+
height: calc(var(--iui-size-l) + var(--iui-size-3xs) * 3);
|
|
37
|
+
padding: 0;
|
|
38
|
+
width: calc(100% - var(--iui-size-xl));
|
|
39
|
+
|
|
40
|
+
&.contracted {
|
|
41
|
+
outline: none;
|
|
42
|
+
width: var(--iui-size-l);
|
|
43
|
+
|
|
44
|
+
&::before {
|
|
45
|
+
border: none;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.searchbox-stepping-count {
|
|
50
|
+
font-size: var(--iui-size-s);
|
|
51
|
+
color: var(--iui-color-text);
|
|
52
|
+
margin-right: var(--iui-size-2xs);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.search-input {
|
|
56
|
+
margin-right: var(--iui-size-xs);
|
|
57
|
+
padding: 0 var(--iui-size-xs);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.button-container {
|
|
62
|
+
height: 100%;
|
|
63
|
+
width: calc(100% - var(--iui-size-l));
|
|
64
|
+
|
|
65
|
+
&.contracted {
|
|
66
|
+
width: var(--iui-size-xl);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { IModelConnection, ViewManager, Viewport } from "@itwin/core-frontend";
|
|
2
|
-
import { CategoryInfo } from "./category-tree/CategoryVisibilityHandler";
|
|
1
|
+
import type { IModelConnection, ViewManager, Viewport } from "@itwin/core-frontend";
|
|
2
|
+
import type { CategoryInfo } from "./category-tree/CategoryVisibilityHandler";
|
|
3
3
|
/**
|
|
4
4
|
* Toggles visibility of categories to show or hide.
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
6
|
*/
|
|
7
7
|
export declare function toggleAllCategories(viewManager: ViewManager, imodel: IModelConnection, display: boolean, viewport?: Viewport, forAllViewports?: boolean): Promise<void>;
|
|
8
8
|
/**
|
|
9
9
|
* Gets ids of all categories from specified imodel and viewport.
|
|
10
|
-
* @
|
|
10
|
+
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export declare function getCategories(imodel: IModelConnection, viewport?: Viewport): Promise<string[]>;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Changes category display in the viewport.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
14
17
|
export declare function enableCategory(viewManager: ViewManager, imodel: IModelConnection, ids: string[], enabled: boolean, forAllViewports: boolean, enableAllSubCategories?: boolean): Promise<void>;
|
|
15
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Changes subcategory display in the viewport
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
16
22
|
export declare function enableSubCategory(viewManager: ViewManager, key: string, enabled: boolean, forAllViewports?: boolean): void;
|
|
17
23
|
/** @internal */
|
|
18
24
|
export declare function loadCategoriesFromViewport(iModel?: IModelConnection, vp?: Viewport): Promise<CategoryInfo[]>;
|
|
@@ -7,7 +7,7 @@ import { PerModelCategoryVisibility } from "@itwin/core-frontend";
|
|
|
7
7
|
const EMPTY_CATEGORIES_ARRAY = [];
|
|
8
8
|
/**
|
|
9
9
|
* Toggles visibility of categories to show or hide.
|
|
10
|
-
* @
|
|
10
|
+
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export async function toggleAllCategories(viewManager, imodel, display, viewport, forAllViewports) {
|
|
13
13
|
// istanbul ignore next
|
|
@@ -20,13 +20,16 @@ export async function toggleAllCategories(viewManager, imodel, display, viewport
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Gets ids of all categories from specified imodel and viewport.
|
|
23
|
-
* @
|
|
23
|
+
* @internal
|
|
24
24
|
*/
|
|
25
25
|
export async function getCategories(imodel, viewport) {
|
|
26
26
|
const categories = await loadCategoriesFromViewport(imodel, viewport);
|
|
27
27
|
return categories.map((category) => category.categoryId);
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Changes category display in the viewport.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
30
33
|
export async function enableCategory(viewManager, imodel, ids, enabled, forAllViewports, enableAllSubCategories = true) {
|
|
31
34
|
if (!viewManager.selectedView)
|
|
32
35
|
return;
|
|
@@ -61,7 +64,10 @@ export async function enableCategory(viewManager, imodel, ids, enabled, forAllVi
|
|
|
61
64
|
await updateViewport(viewManager.selectedView);
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Changes subcategory display in the viewport
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
65
71
|
export function enableSubCategory(viewManager, key, enabled, forAllViewports) {
|
|
66
72
|
if (!viewManager.selectedView)
|
|
67
73
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoriesVisibilityUtils.js","sourceRoot":"","sources":["../../../../src/components/trees/CategoriesVisibilityUtils.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB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AEtC,uBAAuB;IACvB,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,cAAc,CAAC,kBAAkB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC3H,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnF,UAAU,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,EAAE,cAAc,EAAE,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9H,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,UAAU,CAAC;AACpB,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 { QueryRowFormat } from \"@itwin/core-common\";\nimport { PerModelCategoryVisibility } from \"@itwin/core-frontend\";\n\nimport type { IModelConnection, ViewManager, Viewport } from \"@itwin/core-frontend\";\nimport type { CategoryInfo } from \"./category-tree/CategoryVisibilityHandler\";\n\nconst EMPTY_CATEGORIES_ARRAY: CategoryInfo[] = [];\n\n/**\n * Toggles visibility of categories to show or hide.\n * @internal\n */\nexport async function toggleAllCategories(viewManager: ViewManager, imodel: IModelConnection, display: boolean, viewport?: Viewport, forAllViewports?: boolean) {\n // istanbul ignore next\n const activeView = viewport ?? viewManager.getFirstOpenView();\n const ids = await getCategories(imodel, activeView);\n\n // istanbul ignore if\n if (ids.length === 0)\n return;\n\n await enableCategory(viewManager, imodel, ids, display, forAllViewports ?? false);\n}\n\n/**\n * Gets ids of all categories from specified imodel and viewport.\n * @internal\n */\nexport async function getCategories(imodel: IModelConnection, viewport?: Viewport) {\n const categories = await loadCategoriesFromViewport(imodel, viewport);\n return categories.map((category) => category.categoryId);\n}\n\n/**\n * Changes category display in the viewport.\n * @internal\n */\nexport async function enableCategory(viewManager: ViewManager, imodel: IModelConnection, ids: string[], enabled: boolean, forAllViewports: boolean, enableAllSubCategories = true) {\n if (!viewManager.selectedView)\n return;\n\n const updateViewport = async (vp: Viewport) => {\n // Only act on viewports that are both 3D or both 2D. Important if we have multiple viewports opened and we\n // are using 'allViewports' property\n if (viewManager.selectedView && viewManager.selectedView.view.is3d() === vp.view.is3d()) {\n vp.changeCategoryDisplay(ids, enabled, enableAllSubCategories);\n\n // remove category overrides per model\n const modelsContainingOverrides: string[] = [];\n for (const ovr of vp.perModelCategoryVisibility) {\n // istanbul ignore else\n if (ids.findIndex((id) => id === ovr.categoryId) !== -1)\n modelsContainingOverrides.push(ovr.modelId);\n }\n vp.perModelCategoryVisibility.setOverride(modelsContainingOverrides, ids, PerModelCategoryVisibility.Override.None);\n\n // changeCategoryDisplay only enables subcategories, it does not disabled them. So we must do that ourselves.\n if (false === enabled) {\n (await imodel.categories.getCategoryInfo(ids)).forEach((categoryInfo) => {\n categoryInfo.subCategories.forEach((value) => enableSubCategory(viewManager, value.id, false, forAllViewports));\n });\n }\n }\n };\n\n // This property let us act on all viewports or just on the selected one, configurable by the app\n if (forAllViewports) {\n for (const viewport of viewManager) {\n await updateViewport(viewport);\n }\n } else {\n await updateViewport(viewManager.selectedView);\n }\n}\n\n/**\n * Changes subcategory display in the viewport\n * @internal\n */\nexport function enableSubCategory(viewManager: ViewManager, key: string, enabled: boolean, forAllViewports?: boolean) {\n if (!viewManager.selectedView)\n return;\n\n const updateViewport = (vp: Viewport) => {\n // Only act on viewports that are both 3D or both 2D. Important if we have multiple viewports opened and we\n // are using 'allViewports' property\n if (viewManager.selectedView && viewManager.selectedView.view.is3d() === vp.view.is3d()) {\n vp.changeSubCategoryDisplay(key, enabled);\n }\n };\n\n // This property let us act on all viewports or just on the selected one, configurable by the app\n if (forAllViewports) {\n for (const viewport of viewManager) {\n updateViewport(viewport);\n }\n } else {\n updateViewport(viewManager.selectedView);\n }\n}\n\n/** @internal */\nexport async function loadCategoriesFromViewport(iModel?: IModelConnection, vp?: Viewport) {\n if (!vp)\n return EMPTY_CATEGORIES_ARRAY;\n\n // Query categories and add them to state\n const selectUsedSpatialCategoryIds = \"SELECT DISTINCT Category.Id as id from BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId from BisCore.SpatialCategory)\";\n const selectUsedDrawingCategoryIds = \"SELECT DISTINCT Category.Id as id from BisCore.GeometricElement2d WHERE Model.Id=? AND Category.Id IN (SELECT ECInstanceId from BisCore.DrawingCategory)\";\n const ecsql = vp.view.is3d() ? selectUsedSpatialCategoryIds : selectUsedDrawingCategoryIds;\n const ecsql2 = `SELECT ECInstanceId as id FROM ${vp.view.is3d() ? \"BisCore.SpatialCategory\" : \"BisCore.DrawingCategory\"} WHERE ECInstanceId IN (${ecsql})`;\n\n const categories: CategoryInfo[] = [];\n\n // istanbul ignore else\n if (iModel) {\n const rows = await iModel.createQueryReader(ecsql2, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }).toArray();\n (await iModel.categories.getCategoryInfo(rows.map((row) => row.id))).forEach((val) => {\n categories.push({ categoryId: val.id, subCategoryIds: val.subCategories.size ? [...val.subCategories.keys()] : undefined });\n });\n }\n return categories;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* An option of how class grouping should work in a component.
|
|
3
|
-
* @
|
|
3
|
+
* @public
|
|
4
4
|
*/
|
|
5
5
|
export declare enum ClassGroupingOption {
|
|
6
6
|
/** Class grouping is disabled */
|
|
@@ -12,7 +12,7 @@ export declare enum ClassGroupingOption {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Data structure that describes info used to filter visibility tree.
|
|
15
|
-
* @
|
|
15
|
+
* @public
|
|
16
16
|
*/
|
|
17
17
|
export interface VisibilityTreeFilterInfo {
|
|
18
18
|
filter: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../../src/components/trees/Common.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,iCAAiC;IACjC,yDAAE,CAAA;IACF,gCAAgC;IAChC,2DAAG,CAAA;IACH,4EAA4E;IAC5E,+EAAa,CAAA;AACf,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B","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\n/**\n * An option of how class grouping should work in a component.\n * @
|
|
1
|
+
{"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../../src/components/trees/Common.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,iCAAiC;IACjC,yDAAE,CAAA;IACF,gCAAgC;IAChC,2DAAG,CAAA;IACH,4EAA4E;IAC5E,+EAAa,CAAA;AACf,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B","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\n/**\n * An option of how class grouping should work in a component.\n * @public\n */\nexport enum ClassGroupingOption {\n /** Class grouping is disabled */\n No,\n /** Class grouping is enabled */\n Yes,\n /** Class grouping is enabled and grouping node shows grouped items count */\n YesWithCounts,\n}\n\n/**\n * Data structure that describes info used to filter visibility tree.\n * @public\n */\nexport interface VisibilityTreeFilterInfo {\n filter: string;\n activeMatchIndex?: number;\n}\n"]}
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
|
+
.tree-widget-tree-with-header {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
|
|
10
|
+
.tree-widget-tree-header {
|
|
11
|
+
height: var(--iui-size-xl);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.tree-widget-tree-content {
|
|
15
|
+
height: calc(100% - var(--iui-size-xl));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
6
19
|
.tree-widget-visibility-tree-base {
|
|
7
20
|
height: 100%;
|
|
8
21
|
width: 100%;
|
|
@@ -10,19 +23,63 @@
|
|
|
10
23
|
flex-direction: column;
|
|
11
24
|
position: relative;
|
|
12
25
|
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
26
|
+
.ReactWindow__VariableSizeList {
|
|
27
|
+
>div {
|
|
28
|
+
min-width: max-content !important; // to override inline class
|
|
16
29
|
}
|
|
17
30
|
}
|
|
31
|
+
.core-tree-node {
|
|
32
|
+
&.with-checkbox {
|
|
33
|
+
>.contents {
|
|
34
|
+
padding-left: calc(var(--iui-size-3xs) / 2);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
18
37
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
&.disable-expander {
|
|
39
|
+
>.contents {
|
|
40
|
+
>.core-tree-expansionToggle {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
23
45
|
|
|
24
|
-
|
|
25
|
-
|
|
46
|
+
&.is-selected {
|
|
47
|
+
>.contents {
|
|
48
|
+
>.visibility-tree-checkbox-container {
|
|
49
|
+
background-color: var(--iui-color-background-accent-muted)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.contents {
|
|
56
|
+
&:hover {
|
|
57
|
+
> .visibility-tree-checkbox-container {
|
|
58
|
+
background-color: var(--iui-color-background-hover);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
> .visibility-tree-checkbox-container {
|
|
63
|
+
height: var(--iui-size-l);
|
|
64
|
+
width: var(--iui-size-l);
|
|
65
|
+
position: sticky;
|
|
66
|
+
order: -1;
|
|
67
|
+
left: 0;
|
|
68
|
+
background-color: var(--iui-color-background);
|
|
69
|
+
z-index: 1;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
|
|
74
|
+
.visibility-tree-checkbox {
|
|
75
|
+
&:disabled {
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
26
83
|
}
|
|
27
84
|
}
|
|
28
85
|
|
|
@@ -51,5 +108,4 @@
|
|
|
51
108
|
font-weight: bold;
|
|
52
109
|
}
|
|
53
110
|
}
|
|
54
|
-
|
|
55
111
|
}
|