@itwin/tree-widget-react 0.5.0 → 0.6.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/TreeWidget.js +4 -2
- package/lib/cjs/TreeWidget.js.map +1 -1
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js +6 -6
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/cjs/components/rulesets/ClassificationSystems.json +122 -0
- package/lib/cjs/components/rulesets/IModelContent.json +407 -407
- package/lib/cjs/components/trees/Common.d.ts +21 -0
- package/lib/cjs/components/trees/Common.js +21 -0
- package/lib/cjs/components/trees/Common.js.map +1 -0
- package/lib/cjs/components/trees/VisibilityTreeBase.scss +53 -0
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.d.ts +67 -0
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.js +147 -0
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.js.map +1 -0
- package/lib/cjs/components/trees/VisibilityTreeRenderer.d.ts +43 -0
- package/lib/cjs/components/trees/VisibilityTreeRenderer.js +81 -0
- package/lib/cjs/components/trees/VisibilityTreeRenderer.js.map +1 -0
- package/lib/cjs/components/trees/category-tree/Categories.json +102 -0
- package/lib/cjs/components/trees/category-tree/CategoriesTree.d.ts +65 -0
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js +121 -0
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js.map +1 -0
- package/lib/{esm/components/trees → cjs/components/trees/category-tree}/CategoriesTree.scss +5 -0
- package/lib/cjs/components/trees/{CategoriesTree.d.ts → category-tree/CategoriesTreeComponent.d.ts} +2 -2
- package/lib/cjs/components/trees/{CategoriesTree.js → category-tree/CategoriesTreeComponent.js} +14 -13
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.d.ts +54 -0
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js +213 -0
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -0
- package/lib/cjs/components/trees/index.d.ts +10 -3
- package/lib/cjs/components/trees/index.js +13 -6
- package/lib/cjs/components/trees/index.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/Hierarchy.GroupedByClass.json +392 -0
- package/lib/cjs/components/trees/models-tree/Hierarchy.json +387 -0
- package/lib/cjs/components/trees/models-tree/ModelsTree.d.ts +82 -0
- package/lib/cjs/components/trees/models-tree/ModelsTree.js +144 -0
- package/lib/cjs/components/trees/models-tree/ModelsTree.js.map +1 -0
- package/lib/cjs/components/trees/{ModelsTree.scss → models-tree/ModelsTree.scss} +5 -1
- package/lib/{esm/components/trees/ModelsTree.d.ts → cjs/components/trees/models-tree/ModelsTreeComponent.d.ts} +2 -2
- package/lib/cjs/components/trees/{ModelsTree.js → models-tree/ModelsTreeComponent.js} +6 -5
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/models-tree/ModelsTreeSearch.json +239 -0
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.d.ts +100 -0
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js +477 -0
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -0
- package/lib/cjs/components/trees/models-tree/Utils.d.ts +10 -0
- package/lib/cjs/components/trees/models-tree/Utils.js +27 -0
- package/lib/cjs/components/trees/models-tree/Utils.js.map +1 -0
- package/lib/cjs/components/trees/{SpatialTree.d.ts → spatial-tree/SpatialTreeComponent.d.ts} +2 -2
- package/lib/cjs/components/trees/{SpatialTree.js → spatial-tree/SpatialTreeComponent.js} +2 -2
- package/lib/cjs/components/trees/spatial-tree/SpatialTreeComponent.js.map +1 -0
- package/lib/cjs/tree-widget-react.js +3 -3
- package/lib/cjs/tree-widget-react.js.map +1 -1
- package/lib/cjs/types.d.ts +3 -1
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/TreeWidget.js +4 -2
- package/lib/esm/TreeWidget.js.map +1 -1
- package/lib/esm/components/TreeWidgetUiItemsProvider.js +3 -3
- package/lib/esm/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/components/rulesets/ClassificationSystems.json +122 -0
- package/lib/esm/components/rulesets/IModelContent.json +407 -407
- package/lib/esm/components/trees/Common.d.ts +21 -0
- package/lib/esm/components/trees/Common.js +18 -0
- package/lib/esm/components/trees/Common.js.map +1 -0
- package/lib/esm/components/trees/VisibilityTreeBase.scss +53 -0
- package/lib/esm/components/trees/VisibilityTreeEventHandler.d.ts +67 -0
- package/lib/esm/components/trees/VisibilityTreeEventHandler.js +143 -0
- package/lib/esm/components/trees/VisibilityTreeEventHandler.js.map +1 -0
- package/lib/esm/components/trees/VisibilityTreeRenderer.d.ts +43 -0
- package/lib/esm/components/trees/VisibilityTreeRenderer.js +54 -0
- package/lib/esm/components/trees/VisibilityTreeRenderer.js.map +1 -0
- package/lib/esm/components/trees/category-tree/Categories.json +102 -0
- package/lib/esm/components/trees/category-tree/CategoriesTree.d.ts +65 -0
- package/lib/esm/components/trees/category-tree/CategoriesTree.js +96 -0
- package/lib/esm/components/trees/category-tree/CategoriesTree.js.map +1 -0
- package/lib/{cjs/components/trees → esm/components/trees/category-tree}/CategoriesTree.scss +5 -0
- package/lib/esm/components/trees/{CategoriesTree.d.ts → category-tree/CategoriesTreeComponent.d.ts} +2 -2
- package/lib/esm/components/trees/{CategoriesTree.js → category-tree/CategoriesTreeComponent.js} +8 -7
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.d.ts +54 -0
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js +188 -0
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -0
- package/lib/esm/components/trees/index.d.ts +10 -3
- package/lib/esm/components/trees/index.js +13 -6
- package/lib/esm/components/trees/index.js.map +1 -1
- package/lib/esm/components/trees/models-tree/Hierarchy.GroupedByClass.json +392 -0
- package/lib/esm/components/trees/models-tree/Hierarchy.json +387 -0
- package/lib/esm/components/trees/models-tree/ModelsTree.d.ts +82 -0
- package/lib/esm/components/trees/models-tree/ModelsTree.js +121 -0
- package/lib/esm/components/trees/models-tree/ModelsTree.js.map +1 -0
- package/lib/esm/components/trees/{ModelsTree.scss → models-tree/ModelsTree.scss} +5 -1
- package/lib/{cjs/components/trees/ModelsTree.d.ts → esm/components/trees/models-tree/ModelsTreeComponent.d.ts} +2 -2
- package/lib/esm/components/trees/{ModelsTree.js → models-tree/ModelsTreeComponent.js} +6 -5
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/models-tree/ModelsTreeSearch.json +239 -0
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.d.ts +100 -0
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js +472 -0
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -0
- package/lib/esm/components/trees/models-tree/Utils.d.ts +10 -0
- package/lib/esm/components/trees/models-tree/Utils.js +23 -0
- package/lib/esm/components/trees/models-tree/Utils.js.map +1 -0
- package/lib/esm/components/trees/{SpatialTree.d.ts → spatial-tree/SpatialTreeComponent.d.ts} +2 -2
- package/lib/esm/components/trees/{SpatialTree.js → spatial-tree/SpatialTreeComponent.js} +2 -2
- package/lib/esm/components/trees/spatial-tree/SpatialTreeComponent.js.map +1 -0
- package/lib/esm/tree-widget-react.js +3 -3
- package/lib/esm/tree-widget-react.js.map +1 -1
- package/lib/esm/types.d.ts +3 -1
- package/lib/esm/types.js.map +1 -1
- package/lib/public/locales/en/TreeWidget.json +38 -1
- package/package.json +54 -32
- package/lib/cjs/components/trees/CategoriesTree.js.map +0 -1
- package/lib/cjs/components/trees/ModelsTree.js.map +0 -1
- package/lib/cjs/components/trees/SpatialTree.js.map +0 -1
- package/lib/esm/components/trees/CategoriesTree.js.map +0 -1
- package/lib/esm/components/trees/ModelsTree.js.map +0 -1
- package/lib/esm/components/trees/SpatialTree.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpatialTreeComponent.js","sourceRoot":"","sources":["../../../../../src/components/trees/spatial-tree/SpatialTreeComponent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,KAAuB,EAAE,EAAE;IAC3B,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAE3C,OAAO,CACL,0CACG,MAAM;QACL,oBAAC,SAAS,QACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,oBAAC,sBAAsB,OAAK,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,CACjG,CAEb,CACJ,CAAC;AACJ,CAAC,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 { SpatialContainmentTree, useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React from \"react\";\nimport type { SpatialTreeProps } from \"../../../types\";\nimport { AutoSizer } from \"../../utils/AutoSizer\";\n\nexport const SpatialTreeComponent = (\n props: SpatialTreeProps) => {\n const iModel = useActiveIModelConnection();\n\n return (\n <>\n {iModel &&\n <AutoSizer>\n {({ width, height }) => <SpatialContainmentTree {...props} width={width} height={height} iModel={iModel} />}\n </AutoSizer>\n }\n </>\n );\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
5
|
export * from "./types";
|
|
6
6
|
export * from "./TreeWidget";
|
|
7
7
|
export * from "./components/TreeWidgetComponent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-widget-react.js","sourceRoot":"","sources":["../../src/tree-widget-react.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tree-widget-react.js","sourceRoot":"","sources":["../../src/tree-widget-react.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wCAAwC,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\nexport * from \"./types\";\nexport * from \"./TreeWidget\";\nexport * from \"./components/TreeWidgetComponent\";\nexport * from \"./components/header/TreeHeader\";\nexport * from \"./components/trees\";\nexport * from \"./components/TreeWidgetUiItemsProvider\";\n"]}
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { StagePanelLocation, StagePanelSection } from "@itwin/appui-abstract";
|
|
3
|
-
import type {
|
|
3
|
+
import type { SpatialContainmentTreeProps } from "@itwin/appui-react";
|
|
4
4
|
import type { SelectableContentDefinition } from "@itwin/components-react";
|
|
5
5
|
import type { IModelConnection } from "@itwin/core-frontend";
|
|
6
|
+
import type { CategoryTreeProps } from "./components/trees/category-tree/CategoriesTree";
|
|
7
|
+
import type { ModelsTreeProps } from "./components/trees/models-tree/ModelsTree";
|
|
6
8
|
export interface IModelContentTreeProps extends Omit<React.AllHTMLAttributes<HTMLDivElement>, "children"> {
|
|
7
9
|
iModel: IModelConnection;
|
|
8
10
|
}
|
package/lib/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAyCA,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 { SpatialContainmentTreeProps } from \"@itwin/appui-react\";\nimport type { SelectableContentDefinition } from \"@itwin/components-react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { CategoryTreeProps } from \"./components/trees/category-tree/CategoriesTree\";\nimport type { ModelsTreeProps } from \"./components/trees/models-tree/ModelsTree\";\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"]}
|
|
@@ -12,5 +12,42 @@
|
|
|
12
12
|
"models": "Models",
|
|
13
13
|
"categories": "Categories",
|
|
14
14
|
"containment": "Spatial Containment",
|
|
15
|
-
"treeview": "Tree View"
|
|
15
|
+
"treeview": "Tree View",
|
|
16
|
+
"categoriesTree": {
|
|
17
|
+
"noCategoryFound": "No category found.",
|
|
18
|
+
"noMatchingCategoryNames": "There are no category names matching your search."
|
|
19
|
+
},
|
|
20
|
+
"modelTree": {
|
|
21
|
+
"status": {
|
|
22
|
+
"visible": "Visible",
|
|
23
|
+
"hidden": "Hidden",
|
|
24
|
+
"disabled": "Disabled"
|
|
25
|
+
},
|
|
26
|
+
"tooltips": {
|
|
27
|
+
"subject": {
|
|
28
|
+
"nonSpatialView": "Active view is not spatial",
|
|
29
|
+
"atLeastOneModelVisible": "At least one model is visible",
|
|
30
|
+
"allModelsHidden": "All models are hidden"
|
|
31
|
+
},
|
|
32
|
+
"model": {
|
|
33
|
+
"nonSpatialView": "Active view is not spatial"
|
|
34
|
+
},
|
|
35
|
+
"category": {
|
|
36
|
+
"modelNotDisplayed": "Can't control category display if model is not displayed",
|
|
37
|
+
"displayedThroughPerModelOverride": "Per-model category override set to 'Show'",
|
|
38
|
+
"hiddenThroughPerModelOverride": "Per-model category override set to 'Hide'",
|
|
39
|
+
"displayedThroughCategorySelector": "Category display enabled through category selector",
|
|
40
|
+
"hiddenThroughCategorySelector": "Category display disabled through category selector"
|
|
41
|
+
},
|
|
42
|
+
"element": {
|
|
43
|
+
"modelNotDisplayed": "Can't control element display if model is not displayed",
|
|
44
|
+
"hiddenThroughNeverDrawnList": "Element(s) in \"never drawn\" list",
|
|
45
|
+
"displayedThroughAlwaysDrawnList": "Element(s) in \"always drawn\" list",
|
|
46
|
+
"hiddenDueToOtherElementsExclusivelyAlwaysDrawn": "Other elements in \"exclusively always drawn\" list",
|
|
47
|
+
"hiddenThroughCategory": "Category not displayed"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"noModelFound": "No model found.",
|
|
51
|
+
"noMatchingModelNames": "There are no model names matching your search."
|
|
52
|
+
}
|
|
16
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/tree-widget-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Tree Widget React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Bentley",
|
|
@@ -23,48 +23,70 @@
|
|
|
23
23
|
"classnames": "^2.3.1",
|
|
24
24
|
"i18next": "^10.2.2",
|
|
25
25
|
"react-redux": "^7.2.0",
|
|
26
|
-
"redux": "^4.0.3"
|
|
26
|
+
"redux": "^4.0.3",
|
|
27
|
+
"rxjs": "^6.6.2"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@itwin/appui-abstract": "^3.
|
|
30
|
-
"@itwin/appui-layout-react": "^3.
|
|
31
|
-
"@itwin/appui-react": "^3.
|
|
32
|
-
"@itwin/build-tools": "^3.
|
|
33
|
-
"@itwin/components-react": "^3.
|
|
34
|
-
"@itwin/core-bentley": "^3.
|
|
35
|
-
"@itwin/core-common": "^3.
|
|
36
|
-
"@itwin/core-frontend": "^3.
|
|
37
|
-
"@itwin/core-geometry": "^3.
|
|
38
|
-
"@itwin/core-i18n": "^3.
|
|
39
|
-
"@itwin/core-markup": "^3.
|
|
40
|
-
"@itwin/core-orbitgt": "^3.
|
|
41
|
-
"@itwin/core-quantity": "^3.
|
|
42
|
-
"@itwin/core-react": "^3.
|
|
43
|
-
"@itwin/eslint-plugin": "^3.
|
|
44
|
-
"@itwin/imodel-components-react": "^3.
|
|
45
|
-
"@itwin/presentation-common": "^3.
|
|
46
|
-
"@itwin/presentation-components": "^3.
|
|
47
|
-
"@itwin/presentation-frontend": "^3.
|
|
48
|
-
"@itwin/
|
|
30
|
+
"@itwin/appui-abstract": "^3.5.0",
|
|
31
|
+
"@itwin/appui-layout-react": "^3.5.0",
|
|
32
|
+
"@itwin/appui-react": "^3.5.0",
|
|
33
|
+
"@itwin/build-tools": "^3.5.0",
|
|
34
|
+
"@itwin/components-react": "^3.5.0",
|
|
35
|
+
"@itwin/core-bentley": "^3.5.0",
|
|
36
|
+
"@itwin/core-common": "^3.5.0",
|
|
37
|
+
"@itwin/core-frontend": "^3.5.0",
|
|
38
|
+
"@itwin/core-geometry": "^3.5.0",
|
|
39
|
+
"@itwin/core-i18n": "^3.5.0",
|
|
40
|
+
"@itwin/core-markup": "^3.5.0",
|
|
41
|
+
"@itwin/core-orbitgt": "^3.5.0",
|
|
42
|
+
"@itwin/core-quantity": "^3.5.0",
|
|
43
|
+
"@itwin/core-react": "^3.5.0",
|
|
44
|
+
"@itwin/eslint-plugin": "^3.5.0",
|
|
45
|
+
"@itwin/imodel-components-react": "^3.5.0",
|
|
46
|
+
"@itwin/presentation-common": "^3.5.0",
|
|
47
|
+
"@itwin/presentation-components": "^3.5.0",
|
|
48
|
+
"@itwin/presentation-frontend": "^3.5.0",
|
|
49
|
+
"@itwin/presentation-testing": "^3.5.0",
|
|
50
|
+
"@itwin/webgl-compatibility": "^3.5.0",
|
|
51
|
+
"@testing-library/react": "^12.0.0",
|
|
52
|
+
"@testing-library/react-hooks": "^7.0.2",
|
|
53
|
+
"@types/chai": "4.3.1",
|
|
54
|
+
"@types/chai-jest-snapshot": "^1.3.4",
|
|
55
|
+
"@types/deep-equal": "^1.0.1",
|
|
49
56
|
"@types/i18next": "^8.4.2",
|
|
57
|
+
"@types/jsdom-global": "^3.0.4",
|
|
58
|
+
"@types/mocha": "^8.2.2",
|
|
50
59
|
"@types/react": "^17.0.19",
|
|
51
60
|
"@types/react-dom": "^17.0.9",
|
|
52
61
|
"@types/react-redux": "^7.0.1",
|
|
62
|
+
"@types/sinon": "^9.0.0",
|
|
63
|
+
"@types/sinon-chai": "^3.2.0",
|
|
53
64
|
"@typescript-eslint/eslint-plugin": "^5.3.1",
|
|
65
|
+
"@typescript-eslint/parser": "^5.0.0",
|
|
66
|
+
"chai": "^4.2.0",
|
|
67
|
+
"chai-jest-snapshot": "^2.0.0",
|
|
54
68
|
"cpx2": "^3.0.0",
|
|
69
|
+
"deep-equal": "^1.0.0",
|
|
55
70
|
"eslint": "^7.11.0",
|
|
71
|
+
"jsdom": "^19.0.0",
|
|
72
|
+
"jsdom-global": "3.0.2",
|
|
73
|
+
"mocha": "^10.0.0",
|
|
56
74
|
"react": "^17.0.2",
|
|
57
75
|
"react-dom": "^17.0.2",
|
|
58
76
|
"rimraf": "^3.0.2",
|
|
59
|
-
"
|
|
77
|
+
"sinon": "^9.0.2",
|
|
78
|
+
"sinon-chai": "^3.2.0",
|
|
79
|
+
"typemoq": "^2.1.0",
|
|
80
|
+
"typescript": "~4.3.0",
|
|
81
|
+
"xmlhttprequest": "^1.8.0"
|
|
60
82
|
},
|
|
61
83
|
"peerDependencies": {
|
|
62
|
-
"@itwin/appui-abstract": "^3.
|
|
63
|
-
"@itwin/appui-react": "^3.
|
|
64
|
-
"@itwin/components-react": "^3.
|
|
65
|
-
"@itwin/core-frontend": "^3.
|
|
66
|
-
"@itwin/core-react": "^3.
|
|
67
|
-
"@itwin/presentation-components": "^3.
|
|
84
|
+
"@itwin/appui-abstract": "^3.5.0",
|
|
85
|
+
"@itwin/appui-react": "^3.5.0",
|
|
86
|
+
"@itwin/components-react": "^3.5.0",
|
|
87
|
+
"@itwin/core-frontend": "^3.5.0",
|
|
88
|
+
"@itwin/core-react": "^3.5.0",
|
|
89
|
+
"@itwin/presentation-components": "^3.5.0",
|
|
68
90
|
"react": "^17.0.2",
|
|
69
91
|
"react-dom": "^17.0.2"
|
|
70
92
|
},
|
|
@@ -85,13 +107,13 @@
|
|
|
85
107
|
"build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm",
|
|
86
108
|
"copy:assets": "npm run -s copy:public && npm run -s copy:cjs && npm run -s copy:esm",
|
|
87
109
|
"copy:public": "cpx \"./public/**/*\" ./lib/public",
|
|
88
|
-
"copy:cjs": "cpx \"./src/**/*.scss\" ./lib/cjs",
|
|
89
|
-
"copy:esm": "cpx \"./src/**/*.scss\" ./lib/esm",
|
|
110
|
+
"copy:cjs": "cpx \"./src/**/*.{scss,json}\" ./lib/cjs",
|
|
111
|
+
"copy:esm": "cpx \"./src/**/*.{scss,json}\" ./lib/esm",
|
|
90
112
|
"cover": "",
|
|
91
113
|
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
92
114
|
"lint:fix": "npm run lint -- --fix",
|
|
93
115
|
"pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./lib/public/locales/en-PSEUDO",
|
|
94
|
-
"test": "",
|
|
116
|
+
"test": "mocha \"./lib/cjs/test/**/*.test.js\"",
|
|
95
117
|
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
96
118
|
"rebuild": "npm run clean && npm run build"
|
|
97
119
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CategoriesTree.js","sourceRoot":"","sources":["../../../../src/components/trees/CategoriesTree.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAA2C;AAC3C,wD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AC,aAAa,CAAC,EAAE,CAAC,EAAE;gBACnC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aAClB;iBAAM;gBACL,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QACD,kBAAkB;QAClB,uCAAyB,CAAC,cAAc,CACtC,yBAAS,CAAC,WAAW,EACrB,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,CACL,CAAC;QACF,kBAAkB;QAClB,uCAAyB,CAAC,cAAc,CACtC,yBAAS,CAAC,WAAW,EACrB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,IAAI,CACL,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEzC,OAAO,CACL,8DACG,MAAM,IAAI,QAAQ;QACjB;YACE,8BAAC,gCAAmB,IAClB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACd;YACF,8BAAC,qBAAS,QACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACtB,8BAAC,0BAAY,OACP,KAAK,EACT,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,EACtD,eAAe,EAAE,eAAe,GAChC,CACH,CACS,CACX,CAEJ,CACJ,CAAC;AACJ,CAAC;AA9FD,0DA8FC","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 React, { useCallback } from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { CategoryTree, getCategories, toggleAllCategories, useActiveIModelConnection, useActiveViewport } from \"@itwin/appui-react\";\nimport { useTreeFilteringState } from \"../TreeFilteringState\";\nimport \"./CategoriesTree.scss\";\nimport { TreeHeaderComponent } from \"../header/TreeHeader\";\nimport { CategoryVisibilityHandler } from \"@itwin/appui-react\";\nimport type { CategoriesTreeProps } from \"../../types\";\nimport { AutoSizer } from \"../utils/AutoSizer\";\n\nexport function CategoriesTreeComponent(props: CategoriesTreeProps) {\n const iModel = useActiveIModelConnection();\n const viewport = useActiveViewport();\n\n const {\n searchOptions,\n filterString,\n activeMatchIndex,\n onFilterApplied,\n filteredProvider,\n } = useTreeFilteringState();\n\n const showAll = useCallback(async () => {\n if (!iModel) return;\n\n return toggleAllCategories(\n IModelApp.viewManager,\n iModel,\n true,\n undefined,\n true,\n filteredProvider\n );\n }, [iModel, filteredProvider]);\n\n const hideAll = useCallback(async () => {\n if (!iModel) return;\n return toggleAllCategories(\n IModelApp.viewManager,\n iModel,\n false,\n undefined,\n true,\n filteredProvider\n );\n }, [iModel, filteredProvider]);\n\n const invert = useCallback(async () => {\n if (!iModel || !viewport) return;\n\n const ids = await getCategories(iModel, viewport, filteredProvider);\n const enabled: string[] = [];\n const disabled: string[] = [];\n for (const id of ids) {\n if (viewport.view.viewsCategory(id)) {\n enabled.push(id);\n } else {\n disabled.push(id);\n }\n }\n // Disable enabled\n CategoryVisibilityHandler.enableCategory(\n IModelApp.viewManager,\n iModel,\n enabled,\n false,\n true\n );\n // Enable disabled\n CategoryVisibilityHandler.enableCategory(\n IModelApp.viewManager,\n iModel,\n disabled,\n true,\n true\n );\n }, [iModel, viewport, filteredProvider]);\n\n return (\n <>\n {iModel && viewport &&\n <>\n <TreeHeaderComponent\n searchOptions={searchOptions}\n showAll={showAll}\n hideAll={hideAll}\n invert={invert}\n />\n <AutoSizer>\n {({ width, height }) => (\n <CategoryTree\n {...props}\n iModel={iModel}\n width={width}\n height={height}\n filterInfo={{ filter: filterString, activeMatchIndex }}\n onFilterApplied={onFilterApplied}\n />\n )}\n </AutoSizer>\n </>\n }\n </>\n );\n}\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AAC,CAAC;SACpC;QACD,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,EAAE,CAAC;IAC9B,CAAC,EAAE,CAAC,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEpD,OAAO,CACL,8DACG,MAAM,IAAI,QAAQ;QACjB;YACE,8BAAC,gCAAmB,IAClB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,YAAY,GAC1B;YACF,8BAAC,qBAAS,QACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACtB,8BAAC,wBAAU,OACL,KAAK,EACT,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,QAAQ,EACpB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,EACtD,eAAe,EAAE,eAAe,GAChC,CACH,CACS,CACX,CAEJ,CACJ,CAAC;AACJ,CAAC,CAAC;AAjIW,QAAA,mBAAmB,uBAiI9B","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 React, { useCallback, useEffect, useState } from \"react\";\nimport type { Viewport } from \"@itwin/core-frontend\";\nimport { ModelsTree, useActiveIModelConnection, useActiveViewport } from \"@itwin/appui-react\";\nimport { useTreeFilteringState } from \"../TreeFilteringState\";\nimport \"./ModelsTree.scss\";\nimport type {\n GeometricModel3dProps,\n ModelQueryParams,\n} from \"@itwin/core-common\";\nimport { TreeHeaderComponent } from \"../header/TreeHeader\";\nimport type { ModelTreeProps } from \"../../types\";\nimport { AutoSizer } from \"../utils/AutoSizer\";\n\ninterface TreeViewModelInfo {\n id: string;\n isPlanProjection?: boolean;\n}\n\nexport const ModelsTreeComponent = (props: ModelTreeProps) => {\n const [is2dToggleActive, setIs2dToggleActive] = useState<boolean>(false);\n const [is3dToggleActive, setIs3dToggleActive] = useState<boolean>(false);\n const [icon2dToggle, setIcon2dToggle] = useState<string>(\"icon-visibility\");\n const [icon3dToggle, setIcon3dToggle] = useState<string>(\"icon-visibility\");\n\n const [available2dModels, setAvailable2dModels] = useState<string[]>([]);\n const [available3dModels, setAvailable3dModels] = useState<string[]>([]);\n const [availableModels, setAvailableModels] = useState<string[]>([]);\n\n const iModel = useActiveIModelConnection();\n const viewport = useActiveViewport();\n\n const { searchOptions, filterString, activeMatchIndex, onFilterApplied } =\n useTreeFilteringState();\n\n const queryModels = useCallback(async (\n vp: Viewport | undefined\n ): Promise<TreeViewModelInfo[]> => {\n if (vp === undefined) return [];\n\n const queryParams: ModelQueryParams = {\n from: \"BisCore.GeometricModel3d\",\n wantPrivate: false,\n };\n const modelProps = await iModel?.models.queryProps(queryParams) ?? [];\n return modelProps\n .map(({ id, isPlanProjection }: GeometricModel3dProps) => ({ id, isPlanProjection }))\n .filter(({ id }) => id) as TreeViewModelInfo[];\n }, [iModel]);\n\n useEffect(() => {\n queryModels(viewport)\n .then((modelInfos: TreeViewModelInfo[]) => {\n setAvailableModels(modelInfos.map(({ id }) => id));\n\n const { models2d, models3d } = modelInfos.reduce((acc, { id, isPlanProjection }) => {\n isPlanProjection ? acc.models2d.push(id) : acc.models3d.push(id);\n return acc;\n }, { models2d: [] as string[], models3d: [] as string[] });\n\n setAvailable2dModels(models2d);\n setAvailable3dModels(models3d);\n })\n .catch((_e) => {\n setAvailableModels([]);\n });\n }, [queryModels, viewport]);\n\n const invert = useCallback(async () => {\n if (availableModels.length === 0) return;\n const notViewedModels: string[] = [];\n const models: string[] = [];\n availableModels.forEach((id: string) => {\n if (viewport?.viewsModel(id)) models.push(id);\n else notViewedModels.push(id);\n });\n await viewport?.addViewedModels(notViewedModels);\n viewport?.changeModelDisplay(models, false);\n viewport?.invalidateScene();\n }, [viewport, availableModels]);\n\n const hideAll = useCallback(() => {\n viewport?.changeModelDisplay(availableModels, false);\n viewport?.invalidateScene();\n }, [viewport, availableModels]);\n\n const showAll = useCallback(async () => {\n await viewport?.addViewedModels(availableModels);\n viewport?.invalidateScene();\n }, [viewport, availableModels]);\n\n const viewToggle2D = useCallback(async () => {\n if (is2dToggleActive) {\n viewport?.changeModelDisplay(available2dModels, false);\n setIs2dToggleActive(false);\n setIcon2dToggle(\"icon-visibility-hide-2\");\n } else {\n await viewport?.addViewedModels(available2dModels);\n setIs2dToggleActive(true);\n setIcon2dToggle(\"icon-visibility\");\n }\n viewport?.invalidateScene();\n }, [is2dToggleActive, viewport, available2dModels]);\n\n const viewToggle3D = useCallback(async () => {\n if (is3dToggleActive) {\n viewport?.changeModelDisplay(available3dModels, false);\n setIs3dToggleActive(false);\n setIcon3dToggle(\"icon-visibility-hide-2\");\n } else {\n await viewport?.addViewedModels(available3dModels);\n setIs3dToggleActive(true);\n setIcon3dToggle(\"icon-visibility\");\n }\n viewport?.invalidateScene();\n }, [is3dToggleActive, viewport, available3dModels]);\n\n return (\n <>\n {iModel && viewport &&\n <>\n <TreeHeaderComponent\n searchOptions={searchOptions}\n showAll={showAll}\n hideAll={hideAll}\n invert={invert}\n toggle2D={viewToggle2D}\n toggle2DIcon={icon2dToggle}\n toggle3D={viewToggle3D}\n toggle3DIcon={icon3dToggle}\n />\n <AutoSizer>\n {({ width, height }) => (\n <ModelsTree\n {...props}\n iModel={iModel}\n activeView={viewport}\n width={width}\n height={height}\n filterInfo={{ filter: filterString, activeMatchIndex }}\n onFilterApplied={onFilterApplied}\n />\n )}\n </AutoSizer>\n </>\n }\n </>\n );\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialTree.js","sourceRoot":"","sources":["../../../../src/components/trees/SpatialTree.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,oDAAuF;AACvF,kDAA0B;AAE1B,kDAA+C;AAExC,MAAM,oBAAoB,GAAG,CAClC,KAAuB,EAAE,EAAE;IAC3B,MAAM,MAAM,GAAG,uCAAyB,EAAE,CAAC;IAE3C,OAAO,CACL,8DACG,MAAM;QACL,8BAAC,qBAAS,QACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,8BAAC,oCAAsB,OAAK,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,CACjG,CAEb,CACJ,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,oBAAoB,wBAa/B","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 { SpatialContainmentTree, useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React from \"react\";\nimport type { SpatialTreeProps } from \"../../types\";\nimport { AutoSizer } from \"../utils/AutoSizer\";\n\nexport const SpatialTreeComponent = (\n props: SpatialTreeProps) => {\n const iModel = useActiveIModelConnection();\n\n return (\n <>\n {iModel &&\n <AutoSizer>\n {({ width, height }) => <SpatialContainmentTree {...props} width={width} height={height} iModel={iModel} />}\n </AutoSizer>\n }\n </>\n );\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CategoriesTree.js","sourceRoot":"","sources":["../../../../src/components/trees/CategoriesTree.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,yBAAyB,EAAE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AAE,gBAAgB,CAAC,CAAC;QACpE,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE;YACpB,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE;gBACnC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aAClB;iBAAM;gBACL,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QACD,kBAAkB;QAClB,yBAAyB,CAAC,cAAc,CACtC,SAAS,CAAC,WAAW,EACrB,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,CACL,CAAC;QACF,kBAAkB;QAClB,yBAAyB,CAAC,cAAc,CACtC,SAAS,CAAC,WAAW,EACrB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,IAAI,CACL,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEzC,OAAO,CACL,0CACG,MAAM,IAAI,QAAQ;QACjB;YACE,oBAAC,mBAAmB,IAClB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACd;YACF,oBAAC,SAAS,QACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACtB,oBAAC,YAAY,OACP,KAAK,EACT,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,EACtD,eAAe,EAAE,eAAe,GAChC,CACH,CACS,CACX,CAEJ,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*--------------------------------------------------------------------------------------------*/\nimport React, { useCallback } from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { CategoryTree, getCategories, toggleAllCategories, useActiveIModelConnection, useActiveViewport } from \"@itwin/appui-react\";\nimport { useTreeFilteringState } from \"../TreeFilteringState\";\nimport \"./CategoriesTree.scss\";\nimport { TreeHeaderComponent } from \"../header/TreeHeader\";\nimport { CategoryVisibilityHandler } from \"@itwin/appui-react\";\nimport type { CategoriesTreeProps } from \"../../types\";\nimport { AutoSizer } from \"../utils/AutoSizer\";\n\nexport function CategoriesTreeComponent(props: CategoriesTreeProps) {\n const iModel = useActiveIModelConnection();\n const viewport = useActiveViewport();\n\n const {\n searchOptions,\n filterString,\n activeMatchIndex,\n onFilterApplied,\n filteredProvider,\n } = useTreeFilteringState();\n\n const showAll = useCallback(async () => {\n if (!iModel) return;\n\n return toggleAllCategories(\n IModelApp.viewManager,\n iModel,\n true,\n undefined,\n true,\n filteredProvider\n );\n }, [iModel, filteredProvider]);\n\n const hideAll = useCallback(async () => {\n if (!iModel) return;\n return toggleAllCategories(\n IModelApp.viewManager,\n iModel,\n false,\n undefined,\n true,\n filteredProvider\n );\n }, [iModel, filteredProvider]);\n\n const invert = useCallback(async () => {\n if (!iModel || !viewport) return;\n\n const ids = await getCategories(iModel, viewport, filteredProvider);\n const enabled: string[] = [];\n const disabled: string[] = [];\n for (const id of ids) {\n if (viewport.view.viewsCategory(id)) {\n enabled.push(id);\n } else {\n disabled.push(id);\n }\n }\n // Disable enabled\n CategoryVisibilityHandler.enableCategory(\n IModelApp.viewManager,\n iModel,\n enabled,\n false,\n true\n );\n // Enable disabled\n CategoryVisibilityHandler.enableCategory(\n IModelApp.viewManager,\n iModel,\n disabled,\n true,\n true\n );\n }, [iModel, viewport, filteredProvider]);\n\n return (\n <>\n {iModel && viewport &&\n <>\n <TreeHeaderComponent\n searchOptions={searchOptions}\n showAll={showAll}\n hideAll={hideAll}\n invert={invert}\n />\n <AutoSizer>\n {({ width, height }) => (\n <CategoryTree\n {...props}\n iModel={iModel}\n width={width}\n height={height}\n filterInfo={{ filter: filterString, activeMatchIndex }}\n onFilterApplied={onFilterApplied}\n />\n )}\n </AutoSizer>\n </>\n }\n </>\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModelsTree.js","sourceRoot":"","sources":["../../../../src/components/trees/ModelsTree.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,mBAAmB,CAAC;AAK3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACzE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACzE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,iBAAiB,CAAC,CAAC;IAC5E,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,iBAAiB,CAAC,CAAC;IAE5E,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IACzE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IACzE,MAAM,C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AAI,EAAE;QAC1C,IAAI,gBAAgB,EAAE;YACpB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,kBAAkB,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;YACvD,mBAAmB,CAAC,KAAK,CAAC,CAAC;YAC3B,eAAe,CAAC,wBAAwB,CAAC,CAAC;SAC3C;aAAM;YACL,MAAM,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,CAAC,iBAAiB,CAAC,CAAA,CAAC;YACnD,mBAAmB,CAAC,IAAI,CAAC,CAAC;YAC1B,eAAe,CAAC,iBAAiB,CAAC,CAAC;SACpC;QACD,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,EAAE,CAAC;IAC9B,CAAC,EAAE,CAAC,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEpD,OAAO,CACL,0CACG,MAAM,IAAI,QAAQ;QACjB;YACE,oBAAC,mBAAmB,IAClB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,YAAY,GAC1B;YACF,oBAAC,SAAS,QACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACtB,oBAAC,UAAU,OACL,KAAK,EACT,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,QAAQ,EACpB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,EACtD,eAAe,EAAE,eAAe,GAChC,CACH,CACS,CACX,CAEJ,CACJ,CAAC;AACJ,CAAC,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 React, { useCallback, useEffect, useState } from \"react\";\nimport type { Viewport } from \"@itwin/core-frontend\";\nimport { ModelsTree, useActiveIModelConnection, useActiveViewport } from \"@itwin/appui-react\";\nimport { useTreeFilteringState } from \"../TreeFilteringState\";\nimport \"./ModelsTree.scss\";\nimport type {\n GeometricModel3dProps,\n ModelQueryParams,\n} from \"@itwin/core-common\";\nimport { TreeHeaderComponent } from \"../header/TreeHeader\";\nimport type { ModelTreeProps } from \"../../types\";\nimport { AutoSizer } from \"../utils/AutoSizer\";\n\ninterface TreeViewModelInfo {\n id: string;\n isPlanProjection?: boolean;\n}\n\nexport const ModelsTreeComponent = (props: ModelTreeProps) => {\n const [is2dToggleActive, setIs2dToggleActive] = useState<boolean>(false);\n const [is3dToggleActive, setIs3dToggleActive] = useState<boolean>(false);\n const [icon2dToggle, setIcon2dToggle] = useState<string>(\"icon-visibility\");\n const [icon3dToggle, setIcon3dToggle] = useState<string>(\"icon-visibility\");\n\n const [available2dModels, setAvailable2dModels] = useState<string[]>([]);\n const [available3dModels, setAvailable3dModels] = useState<string[]>([]);\n const [availableModels, setAvailableModels] = useState<string[]>([]);\n\n const iModel = useActiveIModelConnection();\n const viewport = useActiveViewport();\n\n const { searchOptions, filterString, activeMatchIndex, onFilterApplied } =\n useTreeFilteringState();\n\n const queryModels = useCallback(async (\n vp: Viewport | undefined\n ): Promise<TreeViewModelInfo[]> => {\n if (vp === undefined) return [];\n\n const queryParams: ModelQueryParams = {\n from: \"BisCore.GeometricModel3d\",\n wantPrivate: false,\n };\n const modelProps = await iModel?.models.queryProps(queryParams) ?? [];\n return modelProps\n .map(({ id, isPlanProjection }: GeometricModel3dProps) => ({ id, isPlanProjection }))\n .filter(({ id }) => id) as TreeViewModelInfo[];\n }, [iModel]);\n\n useEffect(() => {\n queryModels(viewport)\n .then((modelInfos: TreeViewModelInfo[]) => {\n setAvailableModels(modelInfos.map(({ id }) => id));\n\n const { models2d, models3d } = modelInfos.reduce((acc, { id, isPlanProjection }) => {\n isPlanProjection ? acc.models2d.push(id) : acc.models3d.push(id);\n return acc;\n }, { models2d: [] as string[], models3d: [] as string[] });\n\n setAvailable2dModels(models2d);\n setAvailable3dModels(models3d);\n })\n .catch((_e) => {\n setAvailableModels([]);\n });\n }, [queryModels, viewport]);\n\n const invert = useCallback(async () => {\n if (availableModels.length === 0) return;\n const notViewedModels: string[] = [];\n const models: string[] = [];\n availableModels.forEach((id: string) => {\n if (viewport?.viewsModel(id)) models.push(id);\n else notViewedModels.push(id);\n });\n await viewport?.addViewedModels(notViewedModels);\n viewport?.changeModelDisplay(models, false);\n viewport?.invalidateScene();\n }, [viewport, availableModels]);\n\n const hideAll = useCallback(() => {\n viewport?.changeModelDisplay(availableModels, false);\n viewport?.invalidateScene();\n }, [viewport, availableModels]);\n\n const showAll = useCallback(async () => {\n await viewport?.addViewedModels(availableModels);\n viewport?.invalidateScene();\n }, [viewport, availableModels]);\n\n const viewToggle2D = useCallback(async () => {\n if (is2dToggleActive) {\n viewport?.changeModelDisplay(available2dModels, false);\n setIs2dToggleActive(false);\n setIcon2dToggle(\"icon-visibility-hide-2\");\n } else {\n await viewport?.addViewedModels(available2dModels);\n setIs2dToggleActive(true);\n setIcon2dToggle(\"icon-visibility\");\n }\n viewport?.invalidateScene();\n }, [is2dToggleActive, viewport, available2dModels]);\n\n const viewToggle3D = useCallback(async () => {\n if (is3dToggleActive) {\n viewport?.changeModelDisplay(available3dModels, false);\n setIs3dToggleActive(false);\n setIcon3dToggle(\"icon-visibility-hide-2\");\n } else {\n await viewport?.addViewedModels(available3dModels);\n setIs3dToggleActive(true);\n setIcon3dToggle(\"icon-visibility\");\n }\n viewport?.invalidateScene();\n }, [is3dToggleActive, viewport, available3dModels]);\n\n return (\n <>\n {iModel && viewport &&\n <>\n <TreeHeaderComponent\n searchOptions={searchOptions}\n showAll={showAll}\n hideAll={hideAll}\n invert={invert}\n toggle2D={viewToggle2D}\n toggle2DIcon={icon2dToggle}\n toggle3D={viewToggle3D}\n toggle3DIcon={icon3dToggle}\n />\n <AutoSizer>\n {({ width, height }) => (\n <ModelsTree\n {...props}\n iModel={iModel}\n activeView={viewport}\n width={width}\n height={height}\n filterInfo={{ filter: filterString, activeMatchIndex }}\n onFilterApplied={onFilterApplied}\n />\n )}\n </AutoSizer>\n </>\n }\n </>\n );\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialTree.js","sourceRoot":"","sources":["../../../../src/components/trees/SpatialTree.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,KAAuB,EAAE,EAAE;IAC3B,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAE3C,OAAO,CACL,0CACG,MAAM;QACL,oBAAC,SAAS,QACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,oBAAC,sBAAsB,OAAK,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,CACjG,CAEb,CACJ,CAAC;AACJ,CAAC,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 { SpatialContainmentTree, useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React from \"react\";\nimport type { SpatialTreeProps } from \"../../types\";\nimport { AutoSizer } from \"../utils/AutoSizer\";\n\nexport const SpatialTreeComponent = (\n props: SpatialTreeProps) => {\n const iModel = useActiveIModelConnection();\n\n return (\n <>\n {iModel &&\n <AutoSizer>\n {({ width, height }) => <SpatialContainmentTree {...props} width={width} height={height} iModel={iModel} />}\n </AutoSizer>\n }\n </>\n );\n};\n"]}
|