@itwin/tree-widget-react 0.4.7 → 0.5.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/lib/cjs/components/TreeWidgetUiItemsProvider.js +14 -6
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/cjs/types.d.ts +4 -0
- package/lib/cjs/types.js +4 -0
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/components/TreeWidgetUiItemsProvider.js +14 -6
- package/lib/esm/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/types.d.ts +4 -0
- package/lib/esm/types.js +3 -1
- package/lib/esm/types.js.map +1 -1
- package/lib/public/locales/en/TreeWidget.json +1 -1
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ const CategoriesTree_1 = require("./trees/CategoriesTree");
|
|
|
13
13
|
const ModelsTree_1 = require("./trees/ModelsTree");
|
|
14
14
|
const SpatialTree_1 = require("./trees/SpatialTree");
|
|
15
15
|
const TreeWidget_1 = require("../TreeWidget");
|
|
16
|
+
const types_1 = require("../types");
|
|
16
17
|
exports.TreeWidgetId = "tree-widget-react:trees";
|
|
17
18
|
class TreeWidgetUiItemsProvider {
|
|
18
19
|
constructor(_treeWidgetOptions) {
|
|
@@ -22,7 +23,7 @@ class TreeWidgetUiItemsProvider {
|
|
|
22
23
|
provideWidgets(_stageId, stageUsage, location, section,
|
|
23
24
|
// eslint-disable-next-line deprecation/deprecation
|
|
24
25
|
zoneLocation) {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
26
27
|
const widgets = [];
|
|
27
28
|
const preferredLocation = (_b = (_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.defaultPanelLocation) !== null && _b !== void 0 ? _b : appui_abstract_2.StagePanelLocation.Right;
|
|
28
29
|
const preferredPanelSection = (_d = (_c = this._treeWidgetOptions) === null || _c === void 0 ? void 0 : _c.defaultPanelSection) !== null && _d !== void 0 ? _d : appui_abstract_1.StagePanelSection.Start;
|
|
@@ -34,8 +35,8 @@ class TreeWidgetUiItemsProvider {
|
|
|
34
35
|
const trees = [];
|
|
35
36
|
if (!((_f = (_e = this._treeWidgetOptions) === null || _e === void 0 ? void 0 : _e.hideTrees) === null || _f === void 0 ? void 0 : _f.modelsTree)) {
|
|
36
37
|
trees.push({
|
|
37
|
-
label: TreeWidget_1.TreeWidget.translate("
|
|
38
|
-
id:
|
|
38
|
+
label: TreeWidget_1.TreeWidget.translate("models"),
|
|
39
|
+
id: types_1.ModelsTreeId,
|
|
39
40
|
render: () => {
|
|
40
41
|
var _a, _b;
|
|
41
42
|
return (react_1.default.createElement(ModelsTree_1.ModelsTreeComponent, { enableElementsClassGrouping: ((_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.enableElementsClassGrouping)
|
|
@@ -47,7 +48,7 @@ class TreeWidgetUiItemsProvider {
|
|
|
47
48
|
if (!((_h = (_g = this._treeWidgetOptions) === null || _g === void 0 ? void 0 : _g.hideTrees) === null || _h === void 0 ? void 0 : _h.categoriesTree)) {
|
|
48
49
|
trees.push({
|
|
49
50
|
label: TreeWidget_1.TreeWidget.translate("categories"),
|
|
50
|
-
id:
|
|
51
|
+
id: types_1.CategoriesTreeId,
|
|
51
52
|
render: () => {
|
|
52
53
|
var _a;
|
|
53
54
|
return (react_1.default.createElement(CategoriesTree_1.CategoriesTreeComponent, { ...(_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.categoriesTreeProps }));
|
|
@@ -57,7 +58,7 @@ class TreeWidgetUiItemsProvider {
|
|
|
57
58
|
if (!((_k = (_j = this._treeWidgetOptions) === null || _j === void 0 ? void 0 : _j.hideTrees) === null || _k === void 0 ? void 0 : _k.spatialTree)) {
|
|
58
59
|
trees.push({
|
|
59
60
|
label: TreeWidget_1.TreeWidget.translate("containment"),
|
|
60
|
-
id:
|
|
61
|
+
id: types_1.SpatialContainmentTreeId,
|
|
61
62
|
render: () => {
|
|
62
63
|
var _a, _b;
|
|
63
64
|
return (react_1.default.createElement(SpatialTree_1.SpatialTreeComponent, { enableElementsClassGrouping: ((_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.enableElementsClassGrouping)
|
|
@@ -69,13 +70,20 @@ class TreeWidgetUiItemsProvider {
|
|
|
69
70
|
if ((_l = this._treeWidgetOptions) === null || _l === void 0 ? void 0 : _l.additionalTrees) {
|
|
70
71
|
trees.push(...this._treeWidgetOptions.additionalTrees);
|
|
71
72
|
}
|
|
73
|
+
if (((_m = this._treeWidgetOptions) === null || _m === void 0 ? void 0 : _m.defaultTreeId) && trees.length !== 0) {
|
|
74
|
+
// Adding the defaultTree to first index
|
|
75
|
+
const { defaultTreeId } = this._treeWidgetOptions;
|
|
76
|
+
const extractedDefaultTree = trees.filter((tree) => tree.id === defaultTreeId)[0];
|
|
77
|
+
const index = trees.indexOf(extractedDefaultTree);
|
|
78
|
+
trees.unshift(trees.splice(index, 1)[0]);
|
|
79
|
+
}
|
|
72
80
|
widgets.push({
|
|
73
81
|
id: exports.TreeWidgetId,
|
|
74
82
|
label: TreeWidget_1.TreeWidget.translate("treeview"),
|
|
75
83
|
getWidgetContent: () => react_1.default.createElement(TreeWidgetComponent_1.TreeWidgetComponent, { trees: trees }),
|
|
76
84
|
icon: "icon-hierarchy-tree",
|
|
77
85
|
restoreTransientState: () => true,
|
|
78
|
-
priority: (
|
|
86
|
+
priority: (_o = this._treeWidgetOptions) === null || _o === void 0 ? void 0 : _o.defaultTreeWidgetPriority,
|
|
79
87
|
});
|
|
80
88
|
}
|
|
81
89
|
return widgets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../../../src/components/TreeWidgetUiItemsProvider.tsx"],"names":[],"mappings":";;;;;;AASA,0DAE+B;AAC/B,0DAI+B;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["/*---------------------------------------------------------------------------------------------\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 UiItemsProvider,\n} from \"@itwin/appui-abstract\";\nimport {\n StagePanelSection,\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\";\nimport { CategoriesTreeId, ModelsTreeId, SpatialContainmentTreeId } 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 const preferredLocation = this._treeWidgetOptions?.defaultPanelLocation ?? StagePanelLocation.Right;\n const preferredPanelSection = this._treeWidgetOptions?.defaultPanelSection ?? StagePanelSection.Start;\n if (\n // eslint-disable-next-line deprecation/deprecation\n (!section && stageUsage === StageUsage.General && zoneLocation === AbstractZoneLocation.CenterRight) ||\n (stageUsage === StageUsage.General && location === preferredLocation && section === preferredPanelSection\n && UiFramework.uiVersion !== \"1\")\n ) {\n const trees: SelectableContentDefinition[] = [];\n\n if (!this._treeWidgetOptions?.hideTrees?.modelsTree) {\n trees.push({\n label: TreeWidget.translate(\"models\"),\n id: ModelsTreeId,\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: CategoriesTreeId,\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: SpatialContainmentTreeId,\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 if(this._treeWidgetOptions?.defaultTreeId && trees.length !== 0){\n // Adding the defaultTree to first index\n const { defaultTreeId } = this._treeWidgetOptions;\n const extractedDefaultTree = trees.filter((tree) => tree.id===defaultTreeId)[0];\n const index = trees.indexOf(extractedDefaultTree);\n trees.unshift(trees.splice(index, 1)[0]);\n }\n\n widgets.push({\n id: TreeWidgetId,\n label: TreeWidget.translate(\"treeview\"),\n getWidgetContent: () => <TreeWidgetComponent trees={trees} />,\n icon: \"icon-hierarchy-tree\",\n restoreTransientState: () => true,\n priority: this._treeWidgetOptions?.defaultTreeWidgetPriority,\n });\n }\n\n return widgets;\n }\n}\n"]}
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export interface IModelContentTreeProps extends Omit<React.AllHTMLAttributes<HTM
|
|
|
9
9
|
export declare type ModelTreeProps = Omit<ModelsTreeProps, "iModel" | "activeView" | "width" | "height" | "filterInfo" | "onFilterApplied">;
|
|
10
10
|
export declare type CategoriesTreeProps = Omit<CategoryTreeProps, "iModel" | "activeView" | "width" | "height" | "filterInfo" | "onFilterApplied">;
|
|
11
11
|
export declare type SpatialTreeProps = Omit<SpatialContainmentTreeProps, "iModel" | "width" | "height">;
|
|
12
|
+
export declare const ModelsTreeId = "models-tree";
|
|
13
|
+
export declare const CategoriesTreeId = "categories-tree";
|
|
14
|
+
export declare const SpatialContainmentTreeId = "spatial-containment-tree";
|
|
12
15
|
export interface TreeWidgetOptions {
|
|
13
16
|
defaultPanelLocation?: StagePanelLocation;
|
|
14
17
|
defaultPanelSection?: StagePanelSection;
|
|
@@ -18,6 +21,7 @@ export interface TreeWidgetOptions {
|
|
|
18
21
|
modelsTreeProps?: ModelTreeProps;
|
|
19
22
|
categoriesTreeProps?: CategoriesTreeProps;
|
|
20
23
|
spatialTreeProps?: SpatialTreeProps;
|
|
24
|
+
defaultTreeId?: string;
|
|
21
25
|
hideTrees?: {
|
|
22
26
|
modelsTree?: boolean;
|
|
23
27
|
categoriesTree?: boolean;
|
package/lib/cjs/types.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpatialContainmentTreeId = exports.CategoriesTreeId = exports.ModelsTreeId = void 0;
|
|
4
|
+
exports.ModelsTreeId = "models-tree";
|
|
5
|
+
exports.CategoriesTreeId = "categories-tree";
|
|
6
|
+
exports.SpatialContainmentTreeId = "spatial-containment-tree";
|
|
3
7
|
//# sourceMappingURL=types.js.map
|
package/lib/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","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*--------------------------------------------------------------------------------------------*/\nimport type { StagePanelLocation, StagePanelSection } from \"@itwin/appui-abstract\";\nimport type {\n CategoryTreeProps,\n ModelsTreeProps,\n SpatialContainmentTreeProps,\n} from \"@itwin/appui-react\";\nimport type { SelectableContentDefinition } from \"@itwin/components-react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\n\nexport interface IModelContentTreeProps\n extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"children\"> {\n iModel: IModelConnection;\n}\n\nexport type ModelTreeProps = Omit<\nModelsTreeProps,\n| \"iModel\"\n| \"activeView\"\n| \"width\"\n| \"height\"\n| \"filterInfo\"\n| \"onFilterApplied\"\n>;\n\nexport type CategoriesTreeProps = Omit<\nCategoryTreeProps,\n| \"iModel\"\n| \"activeView\"\n| \"width\"\n| \"height\"\n| \"filterInfo\"\n| \"onFilterApplied\"\n>;\n\nexport type SpatialTreeProps = Omit<\nSpatialContainmentTreeProps,\n\"iModel\" | \"width\" | \"height\"\n>;\n\nexport interface TreeWidgetOptions {\n defaultPanelLocation?: StagePanelLocation;\n defaultPanelSection?: StagePanelSection;\n defaultTreeWidgetPriority?: number;\n enableElementsClassGrouping?: boolean;\n additionalTrees?: SelectableContentDefinition[];\n modelsTreeProps?: ModelTreeProps;\n categoriesTreeProps?: CategoriesTreeProps;\n spatialTreeProps?: SpatialTreeProps;\n hideTrees?: {\n modelsTree?: boolean;\n categoriesTree?: boolean;\n spatialTree?: boolean;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AA2Ca,QAAA,YAAY,GAAG,aAAa,CAAC;AAE7B,QAAA,gBAAgB,GAAG,iBAAiB,CAAC;AAErC,QAAA,wBAAwB,GAAG,0BAA0B,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*--------------------------------------------------------------------------------------------*/\nimport type { StagePanelLocation, StagePanelSection } from \"@itwin/appui-abstract\";\nimport type {\n CategoryTreeProps,\n ModelsTreeProps,\n SpatialContainmentTreeProps,\n} from \"@itwin/appui-react\";\nimport type { SelectableContentDefinition } from \"@itwin/components-react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\n\nexport interface IModelContentTreeProps\n extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"children\"> {\n iModel: IModelConnection;\n}\n\nexport type ModelTreeProps = Omit<\nModelsTreeProps,\n| \"iModel\"\n| \"activeView\"\n| \"width\"\n| \"height\"\n| \"filterInfo\"\n| \"onFilterApplied\"\n>;\n\nexport type CategoriesTreeProps = Omit<\nCategoryTreeProps,\n| \"iModel\"\n| \"activeView\"\n| \"width\"\n| \"height\"\n| \"filterInfo\"\n| \"onFilterApplied\"\n>;\n\nexport type SpatialTreeProps = Omit<\nSpatialContainmentTreeProps,\n\"iModel\" | \"width\" | \"height\"\n>;\n\nexport const ModelsTreeId = \"models-tree\";\n\nexport const CategoriesTreeId = \"categories-tree\";\n\nexport const SpatialContainmentTreeId = \"spatial-containment-tree\";\n\nexport interface TreeWidgetOptions {\n defaultPanelLocation?: StagePanelLocation;\n defaultPanelSection?: StagePanelSection;\n defaultTreeWidgetPriority?: number;\n enableElementsClassGrouping?: boolean;\n additionalTrees?: SelectableContentDefinition[];\n modelsTreeProps?: ModelTreeProps;\n categoriesTreeProps?: CategoriesTreeProps;\n spatialTreeProps?: SpatialTreeProps;\n defaultTreeId?: string;\n hideTrees?: {\n modelsTree?: boolean;\n categoriesTree?: boolean;\n spatialTree?: boolean;\n };\n}\n"]}
|
|
@@ -7,6 +7,7 @@ import { CategoriesTreeComponent } from "./trees/CategoriesTree";
|
|
|
7
7
|
import { ModelsTreeComponent } from "./trees/ModelsTree";
|
|
8
8
|
import { SpatialTreeComponent } from "./trees/SpatialTree";
|
|
9
9
|
import { TreeWidget } from "../TreeWidget";
|
|
10
|
+
import { CategoriesTreeId, ModelsTreeId, SpatialContainmentTreeId } from "../types";
|
|
10
11
|
export const TreeWidgetId = "tree-widget-react:trees";
|
|
11
12
|
export class TreeWidgetUiItemsProvider {
|
|
12
13
|
constructor(_treeWidgetOptions) {
|
|
@@ -16,7 +17,7 @@ export class TreeWidgetUiItemsProvider {
|
|
|
16
17
|
provideWidgets(_stageId, stageUsage, location, section,
|
|
17
18
|
// eslint-disable-next-line deprecation/deprecation
|
|
18
19
|
zoneLocation) {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20
21
|
const widgets = [];
|
|
21
22
|
const preferredLocation = (_b = (_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.defaultPanelLocation) !== null && _b !== void 0 ? _b : StagePanelLocation.Right;
|
|
22
23
|
const preferredPanelSection = (_d = (_c = this._treeWidgetOptions) === null || _c === void 0 ? void 0 : _c.defaultPanelSection) !== null && _d !== void 0 ? _d : StagePanelSection.Start;
|
|
@@ -28,8 +29,8 @@ export class TreeWidgetUiItemsProvider {
|
|
|
28
29
|
const trees = [];
|
|
29
30
|
if (!((_f = (_e = this._treeWidgetOptions) === null || _e === void 0 ? void 0 : _e.hideTrees) === null || _f === void 0 ? void 0 : _f.modelsTree)) {
|
|
30
31
|
trees.push({
|
|
31
|
-
label: TreeWidget.translate("
|
|
32
|
-
id:
|
|
32
|
+
label: TreeWidget.translate("models"),
|
|
33
|
+
id: ModelsTreeId,
|
|
33
34
|
render: () => {
|
|
34
35
|
var _a, _b;
|
|
35
36
|
return (React.createElement(ModelsTreeComponent, { enableElementsClassGrouping: ((_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.enableElementsClassGrouping)
|
|
@@ -41,7 +42,7 @@ export class TreeWidgetUiItemsProvider {
|
|
|
41
42
|
if (!((_h = (_g = this._treeWidgetOptions) === null || _g === void 0 ? void 0 : _g.hideTrees) === null || _h === void 0 ? void 0 : _h.categoriesTree)) {
|
|
42
43
|
trees.push({
|
|
43
44
|
label: TreeWidget.translate("categories"),
|
|
44
|
-
id:
|
|
45
|
+
id: CategoriesTreeId,
|
|
45
46
|
render: () => {
|
|
46
47
|
var _a;
|
|
47
48
|
return (React.createElement(CategoriesTreeComponent, { ...(_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.categoriesTreeProps }));
|
|
@@ -51,7 +52,7 @@ export class TreeWidgetUiItemsProvider {
|
|
|
51
52
|
if (!((_k = (_j = this._treeWidgetOptions) === null || _j === void 0 ? void 0 : _j.hideTrees) === null || _k === void 0 ? void 0 : _k.spatialTree)) {
|
|
52
53
|
trees.push({
|
|
53
54
|
label: TreeWidget.translate("containment"),
|
|
54
|
-
id:
|
|
55
|
+
id: SpatialContainmentTreeId,
|
|
55
56
|
render: () => {
|
|
56
57
|
var _a, _b;
|
|
57
58
|
return (React.createElement(SpatialTreeComponent, { enableElementsClassGrouping: ((_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.enableElementsClassGrouping)
|
|
@@ -63,13 +64,20 @@ export class TreeWidgetUiItemsProvider {
|
|
|
63
64
|
if ((_l = this._treeWidgetOptions) === null || _l === void 0 ? void 0 : _l.additionalTrees) {
|
|
64
65
|
trees.push(...this._treeWidgetOptions.additionalTrees);
|
|
65
66
|
}
|
|
67
|
+
if (((_m = this._treeWidgetOptions) === null || _m === void 0 ? void 0 : _m.defaultTreeId) && trees.length !== 0) {
|
|
68
|
+
// Adding the defaultTree to first index
|
|
69
|
+
const { defaultTreeId } = this._treeWidgetOptions;
|
|
70
|
+
const extractedDefaultTree = trees.filter((tree) => tree.id === defaultTreeId)[0];
|
|
71
|
+
const index = trees.indexOf(extractedDefaultTree);
|
|
72
|
+
trees.unshift(trees.splice(index, 1)[0]);
|
|
73
|
+
}
|
|
66
74
|
widgets.push({
|
|
67
75
|
id: TreeWidgetId,
|
|
68
76
|
label: TreeWidget.translate("treeview"),
|
|
69
77
|
getWidgetContent: () => React.createElement(TreeWidgetComponent, { trees: trees }),
|
|
70
78
|
icon: "icon-hierarchy-tree",
|
|
71
79
|
restoreTransientState: () => true,
|
|
72
|
-
priority: (
|
|
80
|
+
priority: (_o = this._treeWidgetOptions) === null || _o === void 0 ? void 0 : _o.defaultTreeWidgetPriority,
|
|
73
81
|
});
|
|
74
82
|
}
|
|
75
83
|
return widgets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../../../src/components/TreeWidgetUiItemsProvider.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../../../src/components/TreeWidgetUiItemsProvider.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC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CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,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/* eslint-disable react/display-name */\nimport type {\n AbstractWidgetProps,\n UiItemsProvider,\n} from \"@itwin/appui-abstract\";\nimport {\n StagePanelSection,\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\";\nimport { CategoriesTreeId, ModelsTreeId, SpatialContainmentTreeId } 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 const preferredLocation = this._treeWidgetOptions?.defaultPanelLocation ?? StagePanelLocation.Right;\n const preferredPanelSection = this._treeWidgetOptions?.defaultPanelSection ?? StagePanelSection.Start;\n if (\n // eslint-disable-next-line deprecation/deprecation\n (!section && stageUsage === StageUsage.General && zoneLocation === AbstractZoneLocation.CenterRight) ||\n (stageUsage === StageUsage.General && location === preferredLocation && section === preferredPanelSection\n && UiFramework.uiVersion !== \"1\")\n ) {\n const trees: SelectableContentDefinition[] = [];\n\n if (!this._treeWidgetOptions?.hideTrees?.modelsTree) {\n trees.push({\n label: TreeWidget.translate(\"models\"),\n id: ModelsTreeId,\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: CategoriesTreeId,\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: SpatialContainmentTreeId,\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 if(this._treeWidgetOptions?.defaultTreeId && trees.length !== 0){\n // Adding the defaultTree to first index\n const { defaultTreeId } = this._treeWidgetOptions;\n const extractedDefaultTree = trees.filter((tree) => tree.id===defaultTreeId)[0];\n const index = trees.indexOf(extractedDefaultTree);\n trees.unshift(trees.splice(index, 1)[0]);\n }\n\n widgets.push({\n id: TreeWidgetId,\n label: TreeWidget.translate(\"treeview\"),\n getWidgetContent: () => <TreeWidgetComponent trees={trees} />,\n icon: \"icon-hierarchy-tree\",\n restoreTransientState: () => true,\n priority: this._treeWidgetOptions?.defaultTreeWidgetPriority,\n });\n }\n\n return widgets;\n }\n}\n"]}
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export interface IModelContentTreeProps extends Omit<React.AllHTMLAttributes<HTM
|
|
|
9
9
|
export declare type ModelTreeProps = Omit<ModelsTreeProps, "iModel" | "activeView" | "width" | "height" | "filterInfo" | "onFilterApplied">;
|
|
10
10
|
export declare type CategoriesTreeProps = Omit<CategoryTreeProps, "iModel" | "activeView" | "width" | "height" | "filterInfo" | "onFilterApplied">;
|
|
11
11
|
export declare type SpatialTreeProps = Omit<SpatialContainmentTreeProps, "iModel" | "width" | "height">;
|
|
12
|
+
export declare const ModelsTreeId = "models-tree";
|
|
13
|
+
export declare const CategoriesTreeId = "categories-tree";
|
|
14
|
+
export declare const SpatialContainmentTreeId = "spatial-containment-tree";
|
|
12
15
|
export interface TreeWidgetOptions {
|
|
13
16
|
defaultPanelLocation?: StagePanelLocation;
|
|
14
17
|
defaultPanelSection?: StagePanelSection;
|
|
@@ -18,6 +21,7 @@ export interface TreeWidgetOptions {
|
|
|
18
21
|
modelsTreeProps?: ModelTreeProps;
|
|
19
22
|
categoriesTreeProps?: CategoriesTreeProps;
|
|
20
23
|
spatialTreeProps?: SpatialTreeProps;
|
|
24
|
+
defaultTreeId?: string;
|
|
21
25
|
hideTrees?: {
|
|
22
26
|
modelsTree?: boolean;
|
|
23
27
|
categoriesTree?: boolean;
|
package/lib/esm/types.js
CHANGED
package/lib/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","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*--------------------------------------------------------------------------------------------*/\nimport type { StagePanelLocation, StagePanelSection } from \"@itwin/appui-abstract\";\nimport type {\n CategoryTreeProps,\n ModelsTreeProps,\n SpatialContainmentTreeProps,\n} from \"@itwin/appui-react\";\nimport type { SelectableContentDefinition } from \"@itwin/components-react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\n\nexport interface IModelContentTreeProps\n extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"children\"> {\n iModel: IModelConnection;\n}\n\nexport type ModelTreeProps = Omit<\nModelsTreeProps,\n| \"iModel\"\n| \"activeView\"\n| \"width\"\n| \"height\"\n| \"filterInfo\"\n| \"onFilterApplied\"\n>;\n\nexport type CategoriesTreeProps = Omit<\nCategoryTreeProps,\n| \"iModel\"\n| \"activeView\"\n| \"width\"\n| \"height\"\n| \"filterInfo\"\n| \"onFilterApplied\"\n>;\n\nexport type SpatialTreeProps = Omit<\nSpatialContainmentTreeProps,\n\"iModel\" | \"width\" | \"height\"\n>;\n\nexport interface TreeWidgetOptions {\n defaultPanelLocation?: StagePanelLocation;\n defaultPanelSection?: StagePanelSection;\n defaultTreeWidgetPriority?: number;\n enableElementsClassGrouping?: boolean;\n additionalTrees?: SelectableContentDefinition[];\n modelsTreeProps?: ModelTreeProps;\n categoriesTreeProps?: CategoriesTreeProps;\n spatialTreeProps?: SpatialTreeProps;\n hideTrees?: {\n modelsTree?: boolean;\n categoriesTree?: boolean;\n spatialTree?: boolean;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,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*--------------------------------------------------------------------------------------------*/\nimport type { StagePanelLocation, StagePanelSection } from \"@itwin/appui-abstract\";\nimport type {\n CategoryTreeProps,\n ModelsTreeProps,\n SpatialContainmentTreeProps,\n} from \"@itwin/appui-react\";\nimport type { SelectableContentDefinition } from \"@itwin/components-react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\n\nexport interface IModelContentTreeProps\n extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"children\"> {\n iModel: IModelConnection;\n}\n\nexport type ModelTreeProps = Omit<\nModelsTreeProps,\n| \"iModel\"\n| \"activeView\"\n| \"width\"\n| \"height\"\n| \"filterInfo\"\n| \"onFilterApplied\"\n>;\n\nexport type CategoriesTreeProps = Omit<\nCategoryTreeProps,\n| \"iModel\"\n| \"activeView\"\n| \"width\"\n| \"height\"\n| \"filterInfo\"\n| \"onFilterApplied\"\n>;\n\nexport type SpatialTreeProps = Omit<\nSpatialContainmentTreeProps,\n\"iModel\" | \"width\" | \"height\"\n>;\n\nexport const ModelsTreeId = \"models-tree\";\n\nexport const CategoriesTreeId = \"categories-tree\";\n\nexport const SpatialContainmentTreeId = \"spatial-containment-tree\";\n\nexport interface TreeWidgetOptions {\n defaultPanelLocation?: StagePanelLocation;\n defaultPanelSection?: StagePanelSection;\n defaultTreeWidgetPriority?: number;\n enableElementsClassGrouping?: boolean;\n additionalTrees?: SelectableContentDefinition[];\n modelsTreeProps?: ModelTreeProps;\n categoriesTreeProps?: CategoriesTreeProps;\n spatialTreeProps?: SpatialTreeProps;\n defaultTreeId?: string;\n hideTrees?: {\n modelsTree?: boolean;\n categoriesTree?: boolean;\n spatialTree?: boolean;\n };\n}\n"]}
|