@itwin/tree-widget-react 0.2.0 → 0.4.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/README.md +30 -1
- package/lib/cjs/components/IconButton.scss +2 -2
- package/lib/cjs/components/TreeWidgetComponent.d.ts +1 -0
- package/lib/cjs/components/TreeWidgetComponent.scss +1 -1
- package/lib/cjs/components/TreeWidgetUiItemsProvider.d.ts +7 -16
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js +45 -47
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/cjs/components/header/TreeHeader.d.ts +1 -0
- package/lib/cjs/components/header/TreeHeader.scss +1 -1
- package/lib/cjs/components/rulesets/IModelContent.json +435 -0
- package/lib/cjs/components/search-bar/Popup.scss +1 -1
- package/lib/cjs/components/search-bar/SearchBar.scss +1 -1
- package/lib/cjs/components/search-bar/SearchBox.scss +1 -1
- package/lib/cjs/components/trees/CategoriesTree.d.ts +3 -7
- package/lib/cjs/components/trees/CategoriesTree.js +21 -23
- package/lib/cjs/components/trees/CategoriesTree.js.map +1 -1
- package/lib/cjs/components/trees/CategoriesTree.scss +1 -1
- package/lib/cjs/components/trees/IModelContentTree.d.ts +4 -0
- package/lib/cjs/components/trees/{ClassificationsTree.js → IModelContentTree.js} +19 -12
- package/lib/cjs/components/trees/IModelContentTree.js.map +1 -0
- package/lib/cjs/components/trees/ModelsTree.d.ts +3 -8
- package/lib/cjs/components/trees/ModelsTree.js +8 -16
- package/lib/cjs/components/trees/ModelsTree.js.map +1 -1
- package/lib/cjs/components/trees/ModelsTree.scss +1 -1
- package/lib/cjs/components/trees/SpatialTree.d.ts +3 -2
- package/lib/cjs/components/trees/SpatialTree.js +11 -28
- package/lib/cjs/components/trees/SpatialTree.js.map +1 -1
- package/lib/cjs/components/trees/index.d.ts +1 -2
- package/lib/cjs/components/trees/index.js +5 -6
- package/lib/cjs/components/trees/index.js.map +1 -1
- package/lib/cjs/components/utils/AutoSizer.d.ts +10 -0
- package/lib/cjs/components/utils/AutoSizer.js +36 -0
- package/lib/cjs/components/utils/AutoSizer.js.map +1 -0
- package/lib/cjs/tree-widget-react.d.ts +1 -1
- package/lib/cjs/tree-widget-react.js +4 -4
- package/lib/cjs/tree-widget-react.js.map +1 -1
- package/lib/cjs/types.d.ts +23 -0
- package/lib/cjs/types.js +3 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/esm/components/IconButton.scss +2 -2
- package/lib/esm/components/TreeWidgetComponent.d.ts +1 -0
- package/lib/esm/components/TreeWidgetComponent.scss +1 -1
- package/lib/esm/components/TreeWidgetUiItemsProvider.d.ts +7 -16
- package/lib/esm/components/TreeWidgetUiItemsProvider.js +45 -47
- package/lib/esm/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/components/header/TreeHeader.d.ts +1 -0
- package/lib/esm/components/header/TreeHeader.scss +1 -1
- package/lib/esm/components/rulesets/IModelContent.json +435 -0
- package/lib/esm/components/search-bar/Popup.scss +1 -1
- package/lib/esm/components/search-bar/SearchBar.scss +1 -1
- package/lib/esm/components/search-bar/SearchBox.scss +1 -1
- package/lib/esm/components/trees/CategoriesTree.d.ts +3 -7
- package/lib/esm/components/trees/CategoriesTree.js +23 -25
- package/lib/esm/components/trees/CategoriesTree.js.map +1 -1
- package/lib/esm/components/trees/CategoriesTree.scss +1 -1
- package/lib/esm/components/trees/IModelContentTree.d.ts +4 -0
- package/lib/esm/components/trees/IModelContentTree.js +24 -0
- package/lib/esm/components/trees/IModelContentTree.js.map +1 -0
- package/lib/esm/components/trees/ModelsTree.d.ts +3 -8
- package/lib/esm/components/trees/ModelsTree.js +9 -17
- package/lib/esm/components/trees/ModelsTree.js.map +1 -1
- package/lib/esm/components/trees/ModelsTree.scss +1 -1
- package/lib/esm/components/trees/SpatialTree.d.ts +3 -2
- package/lib/esm/components/trees/SpatialTree.js +10 -11
- package/lib/esm/components/trees/SpatialTree.js.map +1 -1
- package/lib/esm/components/trees/index.d.ts +1 -2
- package/lib/esm/components/trees/index.js +4 -5
- package/lib/esm/components/trees/index.js.map +1 -1
- package/lib/esm/components/utils/AutoSizer.d.ts +10 -0
- package/lib/esm/components/utils/AutoSizer.js +13 -0
- package/lib/esm/components/utils/AutoSizer.js.map +1 -0
- package/lib/esm/tree-widget-react.d.ts +1 -1
- package/lib/esm/tree-widget-react.js +4 -4
- package/lib/esm/tree-widget-react.js.map +1 -1
- package/lib/esm/types.d.ts +23 -0
- package/lib/esm/types.js +2 -0
- package/lib/esm/types.js.map +1 -0
- package/package.json +1 -2
- package/lib/cjs/components/TreeWidgetControl.d.ts +0 -26
- package/lib/cjs/components/TreeWidgetControl.js +0 -66
- package/lib/cjs/components/TreeWidgetControl.js.map +0 -1
- package/lib/cjs/components/rulesets/ClassificationSystems.json +0 -122
- package/lib/cjs/components/trees/ClassificationsTree.d.ts +0 -6
- package/lib/cjs/components/trees/ClassificationsTree.js.map +0 -1
- package/lib/cjs/components/trees/TreeWithRuleset.d.ts +0 -35
- package/lib/cjs/components/trees/TreeWithRuleset.js +0 -110
- package/lib/cjs/components/trees/TreeWithRuleset.js.map +0 -1
- package/lib/cjs/components/trees/TreeWithRulesetTree.scss +0 -17
- package/lib/esm/components/TreeWidgetControl.d.ts +0 -26
- package/lib/esm/components/TreeWidgetControl.js +0 -59
- package/lib/esm/components/TreeWidgetControl.js.map +0 -1
- package/lib/esm/components/rulesets/ClassificationSystems.json +0 -122
- package/lib/esm/components/trees/ClassificationsTree.d.ts +0 -6
- package/lib/esm/components/trees/ClassificationsTree.js +0 -17
- package/lib/esm/components/trees/ClassificationsTree.js.map +0 -1
- package/lib/esm/components/trees/TreeWithRuleset.d.ts +0 -35
- package/lib/esm/components/trees/TreeWithRuleset.js +0 -85
- package/lib/esm/components/trees/TreeWithRuleset.js.map +0 -1
- package/lib/esm/components/trees/TreeWithRulesetTree.scss +0 -17
package/README.md
CHANGED
|
@@ -27,6 +27,35 @@ import { UiItemsManager } from "@itwin/appui-abstract";
|
|
|
27
27
|
import { TreeWidgetUiItemsProvider } from "@itwin/tree-widget-react";
|
|
28
28
|
...
|
|
29
29
|
UiItemsManager.register(
|
|
30
|
-
new TreeWidgetUiItemsProvider({ ...
|
|
30
|
+
new TreeWidgetUiItemsProvider({ ...TreeWidgetOptions })
|
|
31
31
|
);
|
|
32
32
|
```
|
|
33
|
+
|
|
34
|
+
### Additional trees avaialable
|
|
35
|
+
|
|
36
|
+
#### IModelContentTree
|
|
37
|
+
|
|
38
|
+
Component that displays a hierarchy with content of a given `IModelConnection`.
|
|
39
|
+
|
|
40
|
+
##### Resulting hierarchy
|
|
41
|
+
|
|
42
|
+
- Root Subject
|
|
43
|
+
- Child Subjects
|
|
44
|
+
- Target Model
|
|
45
|
+
- Spatial Categories of top-assemblies in the Model (if model is a GeometricModel3d)
|
|
46
|
+
- Top-assemblies in the model and category
|
|
47
|
+
- Child elements of the assembly
|
|
48
|
+
- Drawing Categories of top-assemblies in the Model (if model is a GeometricModel2d)
|
|
49
|
+
- Top-assemblies in the model and category
|
|
50
|
+
- Child elements of the assembly
|
|
51
|
+
- Top-assemblies in the Model (if model is neither GeometricModel3d nor GeometricModel2d)
|
|
52
|
+
- Child elements of the assembly
|
|
53
|
+
|
|
54
|
+
In addition, for every modeled element we show content of the model as children for the element's node.
|
|
55
|
+
|
|
56
|
+
More details about Subjects and Models can be found here:
|
|
57
|
+
|
|
58
|
+
- <https://www.imodeljs.org/bis/intro/information-hierarchy/>
|
|
59
|
+
- <https://www.imodeljs.org/bis/intro/organizing-models-and-elements/>
|
|
60
|
+
|
|
61
|
+
More details about the hierarchy can be found in the [presentation ruleset JSON file](./src/components/rulesets/IModelContent.json).
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "~@itwin/core-react/lib/
|
|
6
|
-
@import "~@itwin/appui-layout-react/lib/
|
|
5
|
+
@import "~@itwin/core-react/lib/cjs/core-react/index";
|
|
6
|
+
@import "~@itwin/appui-layout-react/lib/cjs/appui-layout-react/footer/_variables";
|
|
7
7
|
|
|
8
8
|
.tree-widget-icon-button {
|
|
9
9
|
display: inline-block;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "~@itwin/core-react/lib/
|
|
5
|
+
@import "~@itwin/core-react/lib/cjs/core-react/index";
|
|
6
6
|
|
|
7
7
|
.tree-widget-visibility-widget {
|
|
8
8
|
padding: $uicore-s;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import type { AbstractWidgetProps, StagePanelSection, UiItemsProvider } from "@itwin/appui-abstract";
|
|
2
|
-
import { StagePanelLocation } from "@itwin/appui-abstract";
|
|
3
|
-
import type {
|
|
2
|
+
import { AbstractZoneLocation, StagePanelLocation } from "@itwin/appui-abstract";
|
|
3
|
+
import type { TreeWidgetOptions } from "../types";
|
|
4
|
+
export declare const TreeWidgetId = "tree-widget-react:trees";
|
|
4
5
|
export declare class TreeWidgetUiItemsProvider implements UiItemsProvider {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private _allViewports?;
|
|
10
|
-
private _additionalTrees?;
|
|
11
|
-
private _modelsTreeProps?;
|
|
12
|
-
private _categoriesTreeProps?;
|
|
13
|
-
private _spatialTreeProps?;
|
|
14
|
-
private _modelsTreeReplacement?;
|
|
15
|
-
private _categoriesTreeReplacement?;
|
|
16
|
-
private _spatialTreeReplacement?;
|
|
17
|
-
constructor(props?: Partial<TreeWidgetControlOptions>);
|
|
18
|
-
provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, _section: StagePanelSection | undefined): ReadonlyArray<AbstractWidgetProps>;
|
|
6
|
+
private _treeWidgetOptions?;
|
|
7
|
+
readonly id = "TreeWidgetUiItemsProvider";
|
|
8
|
+
constructor(_treeWidgetOptions?: TreeWidgetOptions | undefined);
|
|
9
|
+
provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation): ReadonlyArray<AbstractWidgetProps>;
|
|
19
10
|
}
|
|
20
11
|
//# sourceMappingURL=TreeWidgetUiItemsProvider.d.ts.map
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TreeWidgetUiItemsProvider = void 0;
|
|
6
|
+
exports.TreeWidgetUiItemsProvider = exports.TreeWidgetId = void 0;
|
|
7
7
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
8
8
|
const appui_react_1 = require("@itwin/appui-react");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
@@ -12,64 +12,62 @@ const CategoriesTree_1 = require("./trees/CategoriesTree");
|
|
|
12
12
|
const ModelsTree_1 = require("./trees/ModelsTree");
|
|
13
13
|
const SpatialTree_1 = require("./trees/SpatialTree");
|
|
14
14
|
const TreeWidget_1 = require("../TreeWidget");
|
|
15
|
+
exports.TreeWidgetId = "tree-widget-react:trees";
|
|
15
16
|
class TreeWidgetUiItemsProvider {
|
|
16
|
-
constructor(
|
|
17
|
-
|
|
18
|
-
this.id = "
|
|
19
|
-
this._imodel = props === null || props === void 0 ? void 0 : props.iModelConnection;
|
|
20
|
-
this._activeView = props === null || props === void 0 ? void 0 : props.activeView;
|
|
21
|
-
this._enableElementsClassGrouping = props === null || props === void 0 ? void 0 : props.enableElementsClassGrouping;
|
|
22
|
-
this._allViewports = props === null || props === void 0 ? void 0 : props.allViewports;
|
|
23
|
-
this._additionalTrees = props === null || props === void 0 ? void 0 : props.additionalTrees;
|
|
24
|
-
this._modelsTreeProps = (_a = props === null || props === void 0 ? void 0 : props.additionalProps) === null || _a === void 0 ? void 0 : _a.modelsTree;
|
|
25
|
-
this._categoriesTreeProps = (_b = props === null || props === void 0 ? void 0 : props.additionalProps) === null || _b === void 0 ? void 0 : _b.categoriesTree;
|
|
26
|
-
this._spatialTreeProps = (_c = props === null || props === void 0 ? void 0 : props.additionalProps) === null || _c === void 0 ? void 0 : _c.spatialTree;
|
|
27
|
-
this._modelsTreeReplacement = (_d = props === null || props === void 0 ? void 0 : props.treeReplacements) === null || _d === void 0 ? void 0 : _d.modelsTree;
|
|
28
|
-
this._categoriesTreeReplacement = (_e = props === null || props === void 0 ? void 0 : props.treeReplacements) === null || _e === void 0 ? void 0 : _e.categoriesTree;
|
|
29
|
-
this._spatialTreeReplacement = (_f = props === null || props === void 0 ? void 0 : props.treeReplacements) === null || _f === void 0 ? void 0 : _f.spatialTree;
|
|
17
|
+
constructor(_treeWidgetOptions) {
|
|
18
|
+
this._treeWidgetOptions = _treeWidgetOptions;
|
|
19
|
+
this.id = "TreeWidgetUiItemsProvider";
|
|
30
20
|
}
|
|
31
|
-
provideWidgets(_stageId, stageUsage, location,
|
|
32
|
-
|
|
21
|
+
provideWidgets(_stageId, stageUsage, location, section,
|
|
22
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
23
|
+
zoneLocation) {
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
33
25
|
const widgets = [];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
? appui_react_1.ClassGroupingOption.Yes
|
|
42
|
-
: appui_react_1.ClassGroupingOption.No, ...this._spatialTreeProps }));
|
|
43
|
-
const trees = [
|
|
44
|
-
{
|
|
26
|
+
if (
|
|
27
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
28
|
+
(!section && stageUsage === appui_abstract_1.StageUsage.General && zoneLocation === appui_abstract_1.AbstractZoneLocation.CenterRight) ||
|
|
29
|
+
(stageUsage === appui_abstract_1.StageUsage.General && location === appui_abstract_1.StagePanelLocation.Right && appui_react_1.UiFramework.uiVersion !== "1")) {
|
|
30
|
+
const trees = [];
|
|
31
|
+
if (!((_b = (_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.hideTrees) === null || _b === void 0 ? void 0 : _b.modelsTree)) {
|
|
32
|
+
trees.push({
|
|
45
33
|
label: TreeWidget_1.TreeWidget.translate("modeltree"),
|
|
46
34
|
id: "model-tree",
|
|
47
|
-
render:
|
|
48
|
-
|
|
49
|
-
: ()
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
render: () => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
return (react_1.default.createElement(ModelsTree_1.ModelsTreeComponent, { enableElementsClassGrouping: ((_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.enableElementsClassGrouping)
|
|
38
|
+
? appui_react_1.ClassGroupingOption.YesWithCounts
|
|
39
|
+
: appui_react_1.ClassGroupingOption.No, ...(_b = this._treeWidgetOptions) === null || _b === void 0 ? void 0 : _b.modelsTreeProps }));
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (!((_d = (_c = this._treeWidgetOptions) === null || _c === void 0 ? void 0 : _c.hideTrees) === null || _d === void 0 ? void 0 : _d.categoriesTree)) {
|
|
44
|
+
trees.push({
|
|
52
45
|
label: TreeWidget_1.TreeWidget.translate("categories"),
|
|
53
46
|
id: "categories-tree",
|
|
54
|
-
render:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
render: () => {
|
|
48
|
+
var _a;
|
|
49
|
+
return (react_1.default.createElement(CategoriesTree_1.CategoriesTreeComponent, { ...(_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.categoriesTreeProps }));
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (!((_f = (_e = this._treeWidgetOptions) === null || _e === void 0 ? void 0 : _e.hideTrees) === null || _f === void 0 ? void 0 : _f.spatialTree)) {
|
|
54
|
+
trees.push({
|
|
59
55
|
label: TreeWidget_1.TreeWidget.translate("containment"),
|
|
60
56
|
id: "spatial-containment-tree",
|
|
61
|
-
render:
|
|
62
|
-
|
|
63
|
-
: ()
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
render: () => {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
return (react_1.default.createElement(SpatialTree_1.SpatialTreeComponent, { enableElementsClassGrouping: ((_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.enableElementsClassGrouping)
|
|
60
|
+
? appui_react_1.ClassGroupingOption.YesWithCounts
|
|
61
|
+
: appui_react_1.ClassGroupingOption.No, ...(_b = this._treeWidgetOptions) === null || _b === void 0 ? void 0 : _b.spatialTreeProps }));
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if ((_g = this._treeWidgetOptions) === null || _g === void 0 ? void 0 : _g.additionalTrees) {
|
|
66
|
+
trees.push(...this._treeWidgetOptions.additionalTrees);
|
|
68
67
|
}
|
|
69
68
|
widgets.push({
|
|
70
|
-
id:
|
|
69
|
+
id: exports.TreeWidgetId,
|
|
71
70
|
label: TreeWidget_1.TreeWidget.translate("treeview"),
|
|
72
|
-
// eslint-disable-next-line react/display-name
|
|
73
71
|
getWidgetContent: () => react_1.default.createElement(TreeWidgetComponent_1.TreeWidgetComponent, { trees: trees }),
|
|
74
72
|
});
|
|
75
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../../../src/components/TreeWidgetUiItemsProvider.tsx"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../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GAAG,EAAE,CAAC,8BAAC,yCAAmB,IAAC,KAAK,EAAE,KAAK,GAAI;aAC9D,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA9ED,8DA8EC","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/* eslint-disable react/display-name */\nimport type {\n AbstractWidgetProps,\n StagePanelSection,\n UiItemsProvider,\n} from \"@itwin/appui-abstract\";\nimport {\n AbstractZoneLocation,\n StagePanelLocation,\n StageUsage,\n} from \"@itwin/appui-abstract\";\nimport { ClassGroupingOption, UiFramework } from \"@itwin/appui-react\";\nimport React from \"react\";\nimport { TreeWidgetComponent } from \"./TreeWidgetComponent\";\nimport { CategoriesTreeComponent } from \"./trees/CategoriesTree\";\nimport { ModelsTreeComponent } from \"./trees/ModelsTree\";\nimport { SpatialTreeComponent } from \"./trees/SpatialTree\";\nimport type { SelectableContentDefinition } from \"@itwin/components-react\";\nimport { TreeWidget } from \"../TreeWidget\";\nimport type { TreeWidgetOptions } from \"../types\";\n\nexport const TreeWidgetId = \"tree-widget-react:trees\";\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 // eslint-disable-next-line deprecation/deprecation\n zoneLocation?: AbstractZoneLocation,\n ): ReadonlyArray<AbstractWidgetProps> {\n const widgets: AbstractWidgetProps[] = [];\n if (\n // eslint-disable-next-line deprecation/deprecation\n (!section && stageUsage === StageUsage.General && zoneLocation === AbstractZoneLocation.CenterRight) ||\n (stageUsage === StageUsage.General && location === StagePanelLocation.Right && UiFramework.uiVersion !== \"1\")\n ) {\n const trees: SelectableContentDefinition[] = [];\n\n if (!this._treeWidgetOptions?.hideTrees?.modelsTree) {\n trees.push({\n label: TreeWidget.translate(\"modeltree\"),\n id: \"model-tree\",\n render: () => (\n <ModelsTreeComponent\n enableElementsClassGrouping={\n this._treeWidgetOptions?.enableElementsClassGrouping\n ? ClassGroupingOption.YesWithCounts\n : ClassGroupingOption.No\n }\n {...this._treeWidgetOptions?.modelsTreeProps}\n />\n ),\n });\n }\n\n if (!this._treeWidgetOptions?.hideTrees?.categoriesTree) {\n trees.push({\n label: TreeWidget.translate(\"categories\"),\n id: \"categories-tree\",\n render: () => (\n <CategoriesTreeComponent {...this._treeWidgetOptions?.categoriesTreeProps} />\n ),\n });\n }\n\n if (!this._treeWidgetOptions?.hideTrees?.spatialTree) {\n trees.push({\n label: TreeWidget.translate(\"containment\"),\n id: \"spatial-containment-tree\",\n render: () => (\n <SpatialTreeComponent\n enableElementsClassGrouping={\n this._treeWidgetOptions?.enableElementsClassGrouping\n ? ClassGroupingOption.YesWithCounts\n : ClassGroupingOption.No\n }\n {...this._treeWidgetOptions?.spatialTreeProps}\n />\n ),\n });\n }\n\n if (this._treeWidgetOptions?.additionalTrees) {\n trees.push(...this._treeWidgetOptions.additionalTrees);\n }\n\n widgets.push({\n id: TreeWidgetId,\n label: TreeWidget.translate(\"treeview\"),\n getWidgetContent: () => <TreeWidgetComponent trees={trees} />,\n });\n }\n\n return widgets;\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "~@itwin/core-react/lib/
|
|
5
|
+
@import "~@itwin/core-react/lib/cjs/core-react/index";
|
|
6
6
|
|
|
7
7
|
.tree-widget-header-tree-search-bar {
|
|
8
8
|
margin-bottom: $uicore-s;
|