@itwin/tree-widget-react 0.4.3 → 0.4.6
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 +3 -1
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/cjs/components/header/TreeHeader.scss +1 -0
- package/lib/cjs/types.d.ts +1 -0
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/components/TreeWidgetUiItemsProvider.js +3 -1
- package/lib/esm/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/components/header/TreeHeader.scss +1 -0
- package/lib/esm/types.d.ts +1 -0
- package/lib/esm/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ class TreeWidgetUiItemsProvider {
|
|
|
22
22
|
provideWidgets(_stageId, stageUsage, location, section,
|
|
23
23
|
// eslint-disable-next-line deprecation/deprecation
|
|
24
24
|
zoneLocation) {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
26
26
|
const widgets = [];
|
|
27
27
|
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
28
|
const preferredPanelSection = (_d = (_c = this._treeWidgetOptions) === null || _c === void 0 ? void 0 : _c.defaultPanelSection) !== null && _d !== void 0 ? _d : appui_abstract_1.StagePanelSection.Start;
|
|
@@ -74,6 +74,8 @@ class TreeWidgetUiItemsProvider {
|
|
|
74
74
|
label: TreeWidget_1.TreeWidget.translate("treeview"),
|
|
75
75
|
getWidgetContent: () => react_1.default.createElement(TreeWidgetComponent_1.TreeWidgetComponent, { trees: trees }),
|
|
76
76
|
icon: "icon-hierarchy-tree",
|
|
77
|
+
restoreTransientState: () => true,
|
|
78
|
+
priority: (_m = this._treeWidgetOptions) === null || _m === void 0 ? void 0 : _m.defaultTreeWidgetPriority,
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
81
|
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;AAC/B,oDAAsE;AACtE,kDAA0B;AAC1B,+DAA4D;AAC5D,2DAAiE;AACjE,mDAAyD;AACzD,qDAA2D;AAE3D,8CAA2C;AAG9B,QAAA,YAAY,GAAG,yBAAyB,CAAC;AACtD,MAAa,yBAAyB;IAGpC,YAAoB,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAF1C,OAAE,GAAG,2BAA2B,CAAC;IAEa,CAAC;IAExD,cAAc,CACnB,QAAgB,EAChB,UAAkB,EAClB,QAA4B,EAC5B,OAA2B;IAC3B,mDAAmD;IACnD,YAAmC;;QAEnC,MAAM,OAAO,GAA0B,EAAE,CAAC;QAC1C,MAAM,iBAAiB,GAAG,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,oBAAoB,mCAAI,mCAAkB,CAAC,KAAK,CAAC;QACpG,MAAM,qBAAqB,GAAG,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,mBAAmB,mCAAI,kCAAiB,CAAC,KAAK,CAAC;QACtG;QACE,mDAAmD;QACnD,CAAC,CAAC,OAAO,IAAI,UAAU,KAAK,2BAAU,CAAC,OAAO,IAAI,YAAY,KAAK,qCAAoB,CAAC,WAAW,CAAC;YACpG,CAAC,UAAU,KAAK,2BAAU,CAAC,OAAO,IAAI,QAAQ,KAAK,iBAAiB,IAAI,OAAO,KAAK,qBAAqB;
|
|
1
|
+
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../../../src/components/TreeWidgetUiItemsProvider.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AC5C,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;aACxD;YAED,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,oBAAY;gBAChB,KAAK,EAAE,uBAAU,CAAC,SAAS,CAAC,UAAU,CAAC;gBACvC,gBAAgB,EAAE,GAAG,EAAE,CAAC,8BAAC,yCAAmB,IAAC,KAAK,EAAE,KAAK,GAAI;gBAC7D,IAAI,EAAE,qBAAqB;gBAC3B,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI;gBACjC,QAAQ,EAAE,MAAA,IAAI,CAAC,kBAAkB,0CAAE,yBAAyB;aAC7D,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AApFD,8DAoFC","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\";\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(\"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 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
|
@@ -12,6 +12,7 @@ export declare type SpatialTreeProps = Omit<SpatialContainmentTreeProps, "iModel
|
|
|
12
12
|
export interface TreeWidgetOptions {
|
|
13
13
|
defaultPanelLocation?: StagePanelLocation;
|
|
14
14
|
defaultPanelSection?: StagePanelSection;
|
|
15
|
+
defaultTreeWidgetPriority?: number;
|
|
15
16
|
enableElementsClassGrouping?: boolean;
|
|
16
17
|
additionalTrees?: SelectableContentDefinition[];
|
|
17
18
|
modelsTreeProps?: ModelTreeProps;
|
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 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":"","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"]}
|
|
@@ -16,7 +16,7 @@ export class TreeWidgetUiItemsProvider {
|
|
|
16
16
|
provideWidgets(_stageId, stageUsage, location, section,
|
|
17
17
|
// eslint-disable-next-line deprecation/deprecation
|
|
18
18
|
zoneLocation) {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
20
20
|
const widgets = [];
|
|
21
21
|
const preferredLocation = (_b = (_a = this._treeWidgetOptions) === null || _a === void 0 ? void 0 : _a.defaultPanelLocation) !== null && _b !== void 0 ? _b : StagePanelLocation.Right;
|
|
22
22
|
const preferredPanelSection = (_d = (_c = this._treeWidgetOptions) === null || _c === void 0 ? void 0 : _c.defaultPanelSection) !== null && _d !== void 0 ? _d : StagePanelSection.Start;
|
|
@@ -68,6 +68,8 @@ export class TreeWidgetUiItemsProvider {
|
|
|
68
68
|
label: TreeWidget.translate("treeview"),
|
|
69
69
|
getWidgetContent: () => React.createElement(TreeWidgetComponent, { trees: trees }),
|
|
70
70
|
icon: "icon-hierarchy-tree",
|
|
71
|
+
restoreTransientState: () => true,
|
|
72
|
+
priority: (_m = this._treeWidgetOptions) === null || _m === void 0 ? void 0 : _m.defaultTreeWidgetPriority,
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
75
|
return widgets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeWidgetUiItemsProvider.js","sourceRoot":"","sources":["../../../src/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AS,0CAAE,WAAW,CAAA,EAAE;gBACpD,KAAK,CAAC,IAAI,CAAC;oBACT,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC;oBAC1C,EAAE,EAAE,0BAA0B;oBAC9B,MAAM,EAAE,GAAG,EAAE;;wBAAC,OAAA,CACZ,oBAAC,oBAAoB,IACnB,2BAA2B,EACzB,CAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,2BAA2B;gCAClD,CAAC,CAAC,mBAAmB,CAAC,aAAa;gCACnC,CAAC,CAAC,mBAAmB,CAAC,EAAE,KAExB,MAAA,IAAI,CAAC,kBAAkB,0CAAE,gBAAgB,GAC7C,CACH,CAAA;qBAAA;iBACF,CAAC,CAAC;aACJ;YAED,IAAI,MAAA,IAAI,CAAC,kBAAkB,0CAAE,eAAe,EAAE;gBAC5C,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;aACxD;YAED,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,YAAY;gBAChB,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC;gBACvC,gBAAgB,EAAE,GAAG,EAAE,CAAC,oBAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,GAAI;gBAC7D,IAAI,EAAE,qBAAqB;gBAC3B,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI;gBACjC,QAAQ,EAAE,MAAA,IAAI,CAAC,kBAAkB,0CAAE,yBAAyB;aAC7D,CAAC,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\";\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(\"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 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
|
@@ -12,6 +12,7 @@ export declare type SpatialTreeProps = Omit<SpatialContainmentTreeProps, "iModel
|
|
|
12
12
|
export interface TreeWidgetOptions {
|
|
13
13
|
defaultPanelLocation?: StagePanelLocation;
|
|
14
14
|
defaultPanelSection?: StagePanelSection;
|
|
15
|
+
defaultTreeWidgetPriority?: number;
|
|
15
16
|
enableElementsClassGrouping?: boolean;
|
|
16
17
|
additionalTrees?: SelectableContentDefinition[];
|
|
17
18
|
modelsTreeProps?: ModelTreeProps;
|
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 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":"","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"]}
|