@itwin/tree-widget-react 1.2.2 → 2.0.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/CHANGELOG.md +26 -2
- package/README.md +1 -1
- package/lib/cjs/TreeWidget.d.ts +0 -1
- package/lib/cjs/TreeWidget.js +9 -10
- package/lib/cjs/TreeWidget.js.map +1 -1
- package/lib/cjs/components/SelectableTree.d.ts +9 -1
- package/lib/cjs/components/SelectableTree.js +28 -17
- package/lib/cjs/components/SelectableTree.js.map +1 -1
- package/lib/cjs/components/SelectableTree.scss +0 -16
- package/lib/cjs/components/TreeFilteringState.js +3 -3
- package/lib/cjs/components/TreeFilteringState.js.map +1 -1
- package/lib/cjs/components/TreeSelector.d.ts +28 -0
- package/lib/cjs/components/TreeSelector.js +27 -0
- package/lib/cjs/components/TreeSelector.js.map +1 -0
- package/lib/cjs/components/TreeSelector.scss +27 -0
- package/lib/cjs/components/TreeWidgetUiItemsProvider.d.ts +9 -1
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js +21 -14
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/cjs/components/TreeWidgetUiItemsProvider.scss +1 -1
- package/lib/cjs/components/tree-header/TreeHeader.d.ts +3 -0
- package/lib/cjs/components/tree-header/TreeHeader.js +20 -15
- package/lib/cjs/components/tree-header/TreeHeader.js.map +1 -1
- package/lib/cjs/components/tree-header/TreeHeader.scss +29 -1
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.js +13 -8
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/cjs/components/trees/VisibilityTreeBase.scss +1 -1
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.d.ts +1 -1
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.js +18 -10
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.js.map +1 -1
- package/lib/cjs/components/trees/VisibilityTreeRenderer.d.ts +20 -4
- package/lib/cjs/components/trees/VisibilityTreeRenderer.js +28 -10
- package/lib/cjs/components/trees/VisibilityTreeRenderer.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTree.d.ts +7 -2
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js +47 -30
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js +27 -18
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.d.ts +2 -2
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js +18 -13
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/cjs/components/trees/common/ContextMenu.js +4 -4
- package/lib/cjs/components/trees/common/ContextMenu.js.map +1 -1
- package/lib/cjs/components/trees/common/TreeNodeRenderer.d.ts +1 -1
- package/lib/cjs/components/trees/common/TreeNodeRenderer.js +4 -4
- package/lib/cjs/components/trees/common/TreeNodeRenderer.js.map +1 -1
- package/lib/cjs/components/trees/common/TreeRenderer.d.ts +15 -1
- package/lib/cjs/components/trees/common/TreeRenderer.js +17 -7
- package/lib/cjs/components/trees/common/TreeRenderer.js.map +1 -1
- package/lib/cjs/components/trees/common/TreeRenderer.scss +39 -2
- package/lib/cjs/components/trees/common/Types.d.ts +8 -0
- package/lib/cjs/components/trees/common/Types.js +3 -3
- package/lib/cjs/components/trees/common/Types.js.map +1 -1
- package/lib/cjs/components/trees/common/UseVisibilityTreeState.d.ts +36 -0
- package/lib/cjs/components/trees/common/UseVisibilityTreeState.js +47 -0
- package/lib/cjs/components/trees/common/UseVisibilityTreeState.js.map +1 -0
- package/lib/cjs/components/trees/common/Utils.js +7 -5
- package/lib/cjs/components/trees/common/Utils.js.map +1 -1
- package/lib/cjs/components/trees/external-sources-tree/ExternalSources.json +1 -3
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +9 -3
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.js +19 -7
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +4 -4
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.d.ts +9 -3
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.js +16 -12
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTreeComponent.js +6 -5
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/index.js +3 -3
- package/lib/cjs/components/trees/index.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsTree.d.ts +7 -2
- package/lib/cjs/components/trees/models-tree/ModelsTree.js +76 -62
- package/lib/cjs/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js +27 -29
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsTreeEventHandler.d.ts +9 -0
- package/lib/cjs/components/trees/models-tree/ModelsTreeEventHandler.js +31 -0
- package/lib/cjs/components/trees/models-tree/ModelsTreeEventHandler.js.map +1 -0
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js +125 -66
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/Utils.d.ts +4 -0
- package/lib/cjs/components/trees/models-tree/Utils.js +52 -58
- package/lib/cjs/components/trees/models-tree/Utils.js.map +1 -1
- package/lib/cjs/components/utils/AutoSizer.js +7 -5
- package/lib/cjs/components/utils/AutoSizer.js.map +1 -1
- package/lib/cjs/components/utils/IsPromiseLike.js +4 -4
- package/lib/cjs/components/utils/IsPromiseLike.js.map +1 -1
- package/lib/cjs/components/utils/UseTreeTransientState.js +3 -3
- package/lib/cjs/components/utils/UseTreeTransientState.js.map +1 -1
- package/lib/cjs/tree-widget-react.js +3 -3
- package/lib/cjs/tree-widget-react.js.map +1 -1
- package/lib/esm/TreeWidget.d.ts +0 -1
- package/lib/esm/TreeWidget.js +9 -10
- package/lib/esm/TreeWidget.js.map +1 -1
- package/lib/esm/components/SelectableTree.d.ts +9 -1
- package/lib/esm/components/SelectableTree.js +28 -17
- package/lib/esm/components/SelectableTree.js.map +1 -1
- package/lib/esm/components/SelectableTree.scss +0 -16
- package/lib/esm/components/TreeFilteringState.js +3 -3
- package/lib/esm/components/TreeFilteringState.js.map +1 -1
- package/lib/esm/components/TreeSelector.d.ts +28 -0
- package/lib/esm/components/TreeSelector.js +23 -0
- package/lib/esm/components/TreeSelector.js.map +1 -0
- package/lib/esm/components/TreeSelector.scss +27 -0
- package/lib/esm/components/TreeWidgetUiItemsProvider.d.ts +9 -1
- package/lib/esm/components/TreeWidgetUiItemsProvider.js +19 -13
- package/lib/esm/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/components/TreeWidgetUiItemsProvider.scss +1 -1
- package/lib/esm/components/tree-header/TreeHeader.d.ts +3 -0
- package/lib/esm/components/tree-header/TreeHeader.js +20 -15
- package/lib/esm/components/tree-header/TreeHeader.js.map +1 -1
- package/lib/esm/components/tree-header/TreeHeader.scss +29 -1
- package/lib/esm/components/trees/CategoriesVisibilityUtils.js +13 -8
- package/lib/esm/components/trees/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/esm/components/trees/VisibilityTreeBase.scss +1 -1
- package/lib/esm/components/trees/VisibilityTreeEventHandler.d.ts +1 -1
- package/lib/esm/components/trees/VisibilityTreeEventHandler.js +18 -10
- package/lib/esm/components/trees/VisibilityTreeEventHandler.js.map +1 -1
- package/lib/esm/components/trees/VisibilityTreeRenderer.d.ts +20 -4
- package/lib/esm/components/trees/VisibilityTreeRenderer.js +27 -10
- package/lib/esm/components/trees/VisibilityTreeRenderer.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTree.d.ts +7 -2
- package/lib/esm/components/trees/category-tree/CategoriesTree.js +51 -34
- package/lib/esm/components/trees/category-tree/CategoriesTree.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js +24 -18
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.d.ts +2 -2
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js +18 -13
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/esm/components/trees/common/ContextMenu.js +4 -4
- package/lib/esm/components/trees/common/ContextMenu.js.map +1 -1
- package/lib/esm/components/trees/common/TreeNodeRenderer.d.ts +1 -1
- package/lib/esm/components/trees/common/TreeNodeRenderer.js +4 -4
- package/lib/esm/components/trees/common/TreeNodeRenderer.js.map +1 -1
- package/lib/esm/components/trees/common/TreeRenderer.d.ts +15 -1
- package/lib/esm/components/trees/common/TreeRenderer.js +15 -6
- package/lib/esm/components/trees/common/TreeRenderer.js.map +1 -1
- package/lib/esm/components/trees/common/TreeRenderer.scss +39 -2
- package/lib/esm/components/trees/common/Types.d.ts +8 -0
- package/lib/esm/components/trees/common/Types.js +3 -3
- package/lib/esm/components/trees/common/Types.js.map +1 -1
- package/lib/esm/components/trees/common/UseVisibilityTreeState.d.ts +36 -0
- package/lib/esm/components/trees/common/UseVisibilityTreeState.js +43 -0
- package/lib/esm/components/trees/common/UseVisibilityTreeState.js.map +1 -0
- package/lib/esm/components/trees/common/Utils.js +7 -5
- package/lib/esm/components/trees/common/Utils.js.map +1 -1
- package/lib/esm/components/trees/external-sources-tree/ExternalSources.json +1 -3
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +9 -3
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.js +22 -10
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +4 -4
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.d.ts +9 -3
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.js +19 -15
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTreeComponent.js +6 -5
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/index.js +3 -3
- package/lib/esm/components/trees/index.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsTree.d.ts +7 -2
- package/lib/esm/components/trees/models-tree/ModelsTree.js +80 -66
- package/lib/esm/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js +25 -30
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsTreeEventHandler.d.ts +9 -0
- package/lib/esm/components/trees/models-tree/ModelsTreeEventHandler.js +27 -0
- package/lib/esm/components/trees/models-tree/ModelsTreeEventHandler.js.map +1 -0
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js +125 -66
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/esm/components/trees/models-tree/Utils.d.ts +4 -0
- package/lib/esm/components/trees/models-tree/Utils.js +50 -57
- package/lib/esm/components/trees/models-tree/Utils.js.map +1 -1
- package/lib/esm/components/utils/AutoSizer.js +7 -5
- package/lib/esm/components/utils/AutoSizer.js.map +1 -1
- package/lib/esm/components/utils/IsPromiseLike.js +4 -4
- package/lib/esm/components/utils/IsPromiseLike.js.map +1 -1
- package/lib/esm/components/utils/UseTreeTransientState.js +3 -3
- package/lib/esm/components/utils/UseTreeTransientState.js.map +1 -1
- package/lib/esm/tree-widget-react.js +3 -3
- package/lib/esm/tree-widget-react.js.map +1 -1
- package/lib/public/locales/en/TreeWidget.json +1 -0
- package/package.json +47 -46
- package/lib/cjs/e2e-tests/TreeWidget.test.d.ts +0 -2
- package/lib/cjs/e2e-tests/TreeWidget.test.js +0 -51
- package/lib/cjs/e2e-tests/TreeWidget.test.js.map +0 -1
- package/lib/cjs/e2e-tests/utils.d.ts +0 -9
- package/lib/cjs/e2e-tests/utils.js +0 -51
- package/lib/cjs/e2e-tests/utils.js.map +0 -1
- package/lib/esm/e2e-tests/TreeWidget.test.d.ts +0 -2
- package/lib/esm/e2e-tests/TreeWidget.test.js +0 -46
- package/lib/esm/e2e-tests/TreeWidget.test.js.map +0 -1
- package/lib/esm/e2e-tests/utils.d.ts +0 -9
- package/lib/esm/e2e-tests/utils.js +0 -40
- package/lib/esm/e2e-tests/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../src/components/trees/models-tree/Utils.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAOrD,gBAAgB;AAChB,MAAM,OAAO,0BAA0B;IAErC,YAAoB,UAAsC;QAAtC,eAAU,GAAV,UAAU,CAA4B;QADlD,SAAI,GAAG,IAAI,KAAK,EAAc,CAAC;IAEvC,CAAC;IAEO,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9D,KAAK,CAAA,CAAE,aAAa;QACzB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE;YAC1B,MAAM,EAAE,CAAC;SACV;QAED,IAAI,MAAM,CAAC;QACX,OAAO,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE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I,CAAC;AAC9B,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 { NodeKey } from \"@itwin/presentation-common\";\n\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type { ChildNodeSpecification, Node, Ruleset, SingleSchemaClassSpecification } from \"@itwin/presentation-common\";\nimport type { DelayLoadedTreeNodeItem } from \"@itwin/components-react\";\nimport type { ModelsTreeHierarchyConfiguration } from \"./ModelsTree\";\n\n/** @internal */\nexport class CachingElementIdsContainer {\n private _ids = new Array<Id64String>();\n constructor(private _generator: AsyncGenerator<Id64String>) {\n }\n\n private async next() { return (await this._generator.next()).value; }\n\n public async* getElementIds() {\n for (const id of this._ids) {\n yield id;\n }\n\n let nextId;\n while (nextId = await this.next()) {\n this._ids.push(nextId);\n yield nextId;\n }\n }\n}\n\n/** @internal */\nexport type CreateRulesetProps = Omit<ModelsTreeHierarchyConfiguration, \"enableElementsClassGrouping\"> & {\n enableElementsClassGrouping?: boolean;\n};\n\n/** @internal */\nexport function createRuleset(props: CreateRulesetProps): Ruleset {\n const context: SpecificationsContext = {\n elementClassSpecification: props.elementClassSpecification ?? { schemaName: \"BisCore\", className: \"GeometricElement3d\" },\n groupElements: !!props.enableElementsClassGrouping,\n showEmptyModels: !!props.showEmptyModels,\n };\n\n return {\n id: \"tree-widget-react/ModelsTree\",\n requiredSchemas: [\n {\n name: \"BisCore\",\n },\n ],\n rules: [\n {\n ruleType: \"RootNodes\",\n autoExpand: true,\n specifications: [\n createRootSubjectSpecification(),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: \"\\\"icon-imodel-hollow-2\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n createRelatedHierarchySubjectSpecification(),\n createRelatedNonHierarchySubjectSpecification(),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: \"\\\"icon-folder\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n createNonContentModelsSpecification(context),\n createContentModelsSpecification(context),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: \"\\\"icon-model\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"ISubModeledElement\", \"BisCore\")`,\n specifications: [\n createElementModelSpecification(context),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: \"\\\"icon-model\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricModel3d\", \"BisCore\")`,\n specifications: [\n createModelCategoriesSpecification(context),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isCategory: \"true\",\n modelId: \"ParentNode.InstanceId\",\n icon: \"\\\"icon-layers\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"SpatialCategory\", \"BisCore\")`,\n specifications: [\n createCategoryElementsSpecification(context),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n modelId: \"this.Model.Id\",\n categoryId: \"this.Category.Id\",\n icon: \"\\\"icon-item\\\"\",\n groupIcon: \"\\\"icon-ec-class\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricElement3d\", \"BisCore\")`,\n specifications: [\n createEementElementsSpecification(context),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n modelId: \"this.Model.Id\",\n categoryId: \"this.Category.Id\",\n icon: \"\\\"icon-item\\\"\",\n groupIcon: \"\\\"icon-ec-class\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"SpatialCategory\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n {\n ruleType: \"Content\",\n condition: `ContentDisplayType = \"AssemblyElementsRequest\"`,\n specifications: [\n {\n specType: \"SelectedNodeInstances\",\n },\n {\n specType: \"ContentRelatedInstances\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ElementOwnsChildElements\",\n },\n direction: \"Forward\",\n count: \"*\",\n },\n ],\n },\n ],\n },\n ],\n };\n}\n\n/** @internal */\nexport type CreateSearchRulesetProps = Omit<ModelsTreeHierarchyConfiguration, \"enableElementsClassGrouping\">;\n\n/** @internal */\nexport function createSearchRuleset(props: CreateSearchRulesetProps): Ruleset {\n const context: SpecificationsContext = {\n elementClassSpecification: props.elementClassSpecification ?? { schemaName: \"BisCore\", className: \"GeometricElement3d\" },\n groupElements: false,\n showEmptyModels: !!props.showEmptyModels,\n };\n\n return {\n id: \"tree-widget-react/ModelsTreeSearch\",\n rules: [\n {\n ruleType: \"RootNodes\",\n specifications: [\n createRootSubjectSpecification(),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: \"\\\"icon-imodel-hollow-2\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n createRelatedHierarchySubjectSpecification(),\n {\n ...createRelatedNonHierarchySubjectSpecification(),\n hideExpression: `NOT ThisNode.HasChildren ANDALSO NOT ThisNode.ChildrenArtifacts.AnyMatches(x => x.isContentModel)`,\n hideIfNoChildren: undefined,\n },\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: \"\\\"icon-folder\\\"\",\n },\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n {\n ...createNonContentModelsSpecification(context),\n hasChildren: \"Unknown\",\n },\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: \"\\\"icon-model\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n {\n ...createContentModelsSpecification(context),\n hasChildren: \"Unknown\",\n },\n ],\n customizationRules: [\n {\n ruleType: \"NodeArtifacts\",\n items: {\n isContentModel: \"true\",\n },\n },\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: \"\\\"icon-model\\\"\",\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricModel3d\", \"BisCore\")`,\n specifications: [\n createModelSubModelsSpecification(context),\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: \"\\\"icon-model\\\"\",\n },\n },\n ],\n },\n ],\n };\n}\n\ninterface SpecificationsContext {\n elementClassSpecification: SingleSchemaClassSpecification;\n groupElements: boolean;\n showEmptyModels: boolean;\n}\n\nfunction createRootSubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: [\n {\n schemaName: \"BisCore\",\n classNames: [\n \"Subject\",\n ],\n },\n ],\n instanceFilter: `this.Parent = NULL`,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createRelatedHierarchySubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"SubjectOwnsSubjects\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n },\n ],\n instanceFilter: `json_extract(this.JsonProperties, \"$.Subject.Job.Bridge\") <> NULL OR ifnull(json_extract(this.JsonProperties, \"$.Subject.Model.Type\"), \"\") = \"Hierarchy\"`,\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createRelatedNonHierarchySubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"SubjectOwnsSubjects\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n },\n ],\n instanceFilter: `json_extract(this.JsonProperties, \"$.Subject.Job.Bridge\") = NULL AND ifnull(json_extract(this.JsonProperties, \"$.Subject.Model.Type\"), \"\") <> \"Hierarchy\"`,\n hideIfNoChildren: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createNonContentModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const partitionFilter = `parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)`;\n const modelHasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n\n const hasNoContent = `json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") = NULL AND json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") = NULL`;\n const instanceFilter = `(${partitionFilter}) AND NOT this.IsPrivate AND ${hasNoContent}${showEmptyModels ? \"\" : ` AND ${modelHasElements}`}`;\n\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: {\n schemaName: \"BisCore\",\n classNames: [\n \"GeometricModel3d\",\n ],\n arePolymorphic: true,\n },\n relatedInstances: [\n {\n relationshipPath: {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"InformationPartitionElement\",\n },\n },\n alias: \"partition\",\n isRequired: true,\n },\n ],\n instanceFilter,\n hasChildren: showEmptyModels ? \"Unknown\" : \"Always\",\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createContentModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const partitionFilter = `parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)`;\n const modelHasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n\n const hasContent = `json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") <> NULL OR json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") <> NULL`;\n const instanceFilter = `(${partitionFilter}) AND NOT this.IsPrivate AND (${hasContent})${showEmptyModels ? \"\" : ` AND ${modelHasElements}`}`;\n\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: {\n schemaName: \"BisCore\",\n classNames: [\"GeometricModel3d\"],\n arePolymorphic: true,\n },\n relatedInstances: [\n {\n relationshipPath: {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"InformationPartitionElement\",\n },\n },\n alias: \"partition\",\n isRequired: true,\n },\n ],\n instanceFilter,\n hasChildren: showEmptyModels ? \"Unknown\" : \"Always\",\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createElementModelSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const hasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n const instanceFilter = `NOT this.IsPrivate${showEmptyModels ? \"\" : ` AND ${hasElements}`}`;\n\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Backward\",\n },\n ],\n instanceFilter,\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createModelCategoriesSpecification({ elementClassSpecification }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelContainsElements\",\n },\n direction: \"Forward\",\n targetClass: elementClassSpecification,\n },\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"GeometricElement3dIsInCategory\",\n },\n direction: \"Forward\",\n },\n ],\n ],\n instanceFilter: `NOT this.IsPrivate`,\n suppressSimilarAncestorsCheck: true,\n hideIfNoChildren: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createCategoryElementsSpecification({ elementClassSpecification, groupElements }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"GeometricElement3dIsInCategory\",\n },\n direction: \"Backward\",\n targetClass: elementClassSpecification,\n },\n ],\n instanceFilter: `this.Model.Id = parent.parent.ECInstanceId ANDALSO this.Parent = NULL`,\n groupByClass: groupElements,\n groupByLabel: false,\n };\n}\n\nfunction createEementElementsSpecification({ elementClassSpecification, groupElements }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ElementOwnsChildElements\",\n },\n direction: \"Forward\",\n targetClass: elementClassSpecification,\n },\n ],\n groupByClass: groupElements,\n groupByLabel: false,\n };\n}\n\nfunction createModelSubModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const hasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n const instanceFilter = `NOT this.IsPrivate${showEmptyModels ? \"\" : ` AND ${hasElements}`}`;\n\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelOwnsSubModel\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"GeometricModel3d\",\n },\n },\n ],\n instanceFilter,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\n/** @internal */\nexport function addModelsTreeNodeItemIcons(item: Partial<DelayLoadedTreeNodeItem>, node: Partial<Node>) {\n item.icon = node.key && NodeKey.isClassGroupingNodeKey(node.key)\n ? node.extendedData?.groupIcon\n : node.extendedData?.icon;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../src/components/trees/models-tree/Utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAQrD,gBAAgB;AAChB,MAAM,OAAO,0BAA0B;IAErC,YAAoB,UAAsC;QAAtC,eAAU,GAAV,UAAU,CAA4B;QADlD,SAAI,GAAG,IAAI,KAAK,EAAc,CAAC;IACsB,CAAC;IAEtD,KAAK,CAAC,IAAI;QAChB,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;IAC9C,CAAC;IAEM,KAAK,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GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC;AAC5H,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,MAAwB;IACxE,MAAM,WAAW,GAAqB;QACpC,IAAI,EAAE,0BAA0B;QAChC,KAAK,EAAE;;;;;;;OAOJ;QACH,WAAW,EAAE,KAAK;KACnB,CAAC;IAEF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC/D,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAyB,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAgB,CAAC;AAC/I,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 type { GeometricModel3dProps, ModelQueryParams } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { NodeKey } from \"@itwin/presentation-common\";\n\nimport type { ModelInfo } from \"./ModelsTreeComponent\";\n\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type { ChildNodeSpecification, Node, Ruleset, SingleSchemaClassSpecification } from \"@itwin/presentation-common\";\nimport type { DelayLoadedTreeNodeItem } from \"@itwin/components-react\";\nimport type { ModelsTreeHierarchyConfiguration } from \"./ModelsTree\";\n/** @internal */\nexport class CachingElementIdsContainer {\n private _ids = new Array<Id64String>();\n constructor(private _generator: AsyncGenerator<Id64String>) {}\n\n private async next() {\n return (await this._generator.next()).value;\n }\n\n public async *getElementIds() {\n for (const id of this._ids) {\n yield id;\n }\n\n let nextId;\n while ((nextId = await this.next())) {\n this._ids.push(nextId);\n yield nextId;\n }\n }\n}\n\n/** @internal */\nexport type CreateRulesetProps = Omit<ModelsTreeHierarchyConfiguration, \"enableElementsClassGrouping\"> & {\n enableElementsClassGrouping?: boolean;\n};\n\n/** @internal */\nexport function createRuleset(props: CreateRulesetProps): Ruleset {\n const context: SpecificationsContext = {\n elementClassSpecification: props.elementClassSpecification ?? { schemaName: \"BisCore\", className: \"GeometricElement3d\" },\n groupElements: !!props.enableElementsClassGrouping,\n showEmptyModels: !!props.showEmptyModels,\n };\n\n return {\n id: \"tree-widget-react/ModelsTree\",\n requiredSchemas: [\n {\n name: \"BisCore\",\n },\n ],\n rules: [\n {\n ruleType: \"RootNodes\",\n autoExpand: true,\n specifications: [createRootSubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-imodel-hollow-2\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [createRelatedHierarchySubjectSpecification(), createRelatedNonHierarchySubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-folder\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [createNonContentModelsSpecification(context), createContentModelsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"ISubModeledElement\", \"BisCore\")`,\n specifications: [createElementModelSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricModel3d\", \"BisCore\")`,\n specifications: [createModelCategoriesSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isCategory: \"true\",\n modelId: \"ParentNode.InstanceId\",\n icon: '\"icon-layers\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"SpatialCategory\", \"BisCore\")`,\n specifications: [createCategoryElementsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n modelId: \"this.Model.Id\",\n categoryId: \"this.Category.Id\",\n icon: '\"icon-item\"',\n groupIcon: '\"icon-ec-class\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricElement3d\", \"BisCore\")`,\n specifications: [createEementElementsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n modelId: \"this.Model.Id\",\n categoryId: \"this.Category.Id\",\n icon: '\"icon-item\"',\n groupIcon: '\"icon-ec-class\"',\n },\n },\n ],\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"SpatialCategory\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n {\n ruleType: \"Content\",\n condition: `ContentDisplayType = \"AssemblyElementsRequest\"`,\n specifications: [\n {\n specType: \"SelectedNodeInstances\",\n },\n {\n specType: \"ContentRelatedInstances\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ElementOwnsChildElements\",\n },\n direction: \"Forward\",\n count: \"*\",\n },\n ],\n },\n ],\n },\n ],\n };\n}\n\n/** @internal */\nexport type CreateSearchRulesetProps = Omit<ModelsTreeHierarchyConfiguration, \"enableElementsClassGrouping\">;\n\n/** @internal */\nexport function createSearchRuleset(props: CreateSearchRulesetProps): Ruleset {\n const context: SpecificationsContext = {\n elementClassSpecification: props.elementClassSpecification ?? { schemaName: \"BisCore\", className: \"GeometricElement3d\" },\n groupElements: false,\n showEmptyModels: !!props.showEmptyModels,\n };\n\n return {\n id: \"tree-widget-react/ModelsTreeSearch\",\n rules: [\n {\n ruleType: \"RootNodes\",\n specifications: [createRootSubjectSpecification()],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-imodel-hollow-2\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n createRelatedHierarchySubjectSpecification(),\n {\n ...createRelatedNonHierarchySubjectSpecification(),\n hideExpression: `NOT ThisNode.HasChildren ANDALSO NOT ThisNode.ChildrenArtifacts.AnyMatches(x => x.isContentModel)`,\n hideIfNoChildren: undefined,\n },\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isSubject: \"true\",\n icon: '\"icon-folder\"',\n },\n },\n {\n ruleType: \"Grouping\",\n class: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n groups: [\n {\n specType: \"SameLabelInstance\",\n applicationStage: \"PostProcess\",\n },\n ],\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n {\n ...createNonContentModelsSpecification(context),\n hasChildren: \"Unknown\",\n },\n ],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"Subject\", \"BisCore\")`,\n specifications: [\n {\n ...createContentModelsSpecification(context),\n hasChildren: \"Unknown\",\n },\n ],\n customizationRules: [\n {\n ruleType: \"NodeArtifacts\",\n items: {\n isContentModel: \"true\",\n },\n },\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n {\n ruleType: \"ChildNodes\",\n condition: `ParentNode.IsOfClass(\"GeometricModel3d\", \"BisCore\")`,\n specifications: [createModelSubModelsSpecification(context)],\n customizationRules: [\n {\n ruleType: \"ExtendedData\",\n items: {\n isModel: \"true\",\n icon: '\"icon-model\"',\n },\n },\n ],\n },\n ],\n };\n}\n\ninterface SpecificationsContext {\n elementClassSpecification: SingleSchemaClassSpecification;\n groupElements: boolean;\n showEmptyModels: boolean;\n}\n\nfunction createRootSubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: [\n {\n schemaName: \"BisCore\",\n classNames: [\"Subject\"],\n },\n ],\n instanceFilter: `this.Parent = NULL`,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createRelatedHierarchySubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"SubjectOwnsSubjects\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n },\n ],\n instanceFilter: `json_extract(this.JsonProperties, \"$.Subject.Job.Bridge\") <> NULL OR ifnull(json_extract(this.JsonProperties, \"$.Subject.Model.Type\"), \"\") = \"Hierarchy\"`,\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createRelatedNonHierarchySubjectSpecification(): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"SubjectOwnsSubjects\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"Subject\",\n },\n },\n ],\n instanceFilter: `json_extract(this.JsonProperties, \"$.Subject.Job.Bridge\") = NULL AND ifnull(json_extract(this.JsonProperties, \"$.Subject.Model.Type\"), \"\") <> \"Hierarchy\"`,\n hideIfNoChildren: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createNonContentModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const partitionFilter = `parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)`;\n const modelHasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n\n const hasNoContent = `json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") = NULL AND json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") = NULL`;\n const instanceFilter = `(${partitionFilter}) AND NOT this.IsPrivate AND ${hasNoContent}${showEmptyModels ? \"\" : ` AND ${modelHasElements}`}`;\n\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: {\n schemaName: \"BisCore\",\n classNames: [\"GeometricModel3d\"],\n arePolymorphic: true,\n },\n relatedInstances: [\n {\n relationshipPath: {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"InformationPartitionElement\",\n },\n },\n alias: \"partition\",\n isRequired: true,\n },\n ],\n instanceFilter,\n hasChildren: showEmptyModels ? \"Unknown\" : \"Always\",\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createContentModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const partitionFilter = `parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)`;\n const modelHasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n\n const hasContent = `json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") <> NULL OR json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") <> NULL`;\n const instanceFilter = `(${partitionFilter}) AND NOT this.IsPrivate AND (${hasContent})${showEmptyModels ? \"\" : ` AND ${modelHasElements}`}`;\n\n return {\n specType: \"InstanceNodesOfSpecificClasses\",\n classes: {\n schemaName: \"BisCore\",\n classNames: [\"GeometricModel3d\"],\n arePolymorphic: true,\n },\n relatedInstances: [\n {\n relationshipPath: {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"InformationPartitionElement\",\n },\n },\n alias: \"partition\",\n isRequired: true,\n },\n ],\n instanceFilter,\n hasChildren: showEmptyModels ? \"Unknown\" : \"Always\",\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createElementModelSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const hasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n const instanceFilter = `NOT this.IsPrivate${showEmptyModels ? \"\" : ` AND ${hasElements}`}`;\n\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelModelsElement\",\n },\n direction: \"Backward\",\n },\n ],\n instanceFilter,\n hideNodesInHierarchy: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createModelCategoriesSpecification({ elementClassSpecification }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelContainsElements\",\n },\n direction: \"Forward\",\n targetClass: elementClassSpecification,\n },\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"GeometricElement3dIsInCategory\",\n },\n direction: \"Forward\",\n },\n ],\n ],\n instanceFilter: `NOT this.IsPrivate`,\n suppressSimilarAncestorsCheck: true,\n hideIfNoChildren: true,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\nfunction createCategoryElementsSpecification({ elementClassSpecification, groupElements }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"GeometricElement3dIsInCategory\",\n },\n direction: \"Backward\",\n targetClass: elementClassSpecification,\n },\n ],\n instanceFilter: `this.Model.Id = parent.parent.ECInstanceId ANDALSO this.Parent = NULL`,\n groupByClass: groupElements,\n groupByLabel: false,\n };\n}\n\nfunction createEementElementsSpecification({ elementClassSpecification, groupElements }: SpecificationsContext): ChildNodeSpecification {\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ElementOwnsChildElements\",\n },\n direction: \"Forward\",\n targetClass: elementClassSpecification,\n },\n ],\n groupByClass: groupElements,\n groupByLabel: false,\n };\n}\n\nfunction createModelSubModelsSpecification({ elementClassSpecification, showEmptyModels }: SpecificationsContext): ChildNodeSpecification {\n const hasElements = `this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"${elementClassSpecification.schemaName}:${elementClassSpecification.className}\")`;\n const instanceFilter = `NOT this.IsPrivate${showEmptyModels ? \"\" : ` AND ${hasElements}`}`;\n\n return {\n specType: \"RelatedInstanceNodes\",\n relationshipPaths: [\n {\n relationship: {\n schemaName: \"BisCore\",\n className: \"ModelOwnsSubModel\",\n },\n direction: \"Forward\",\n targetClass: {\n schemaName: \"BisCore\",\n className: \"GeometricModel3d\",\n },\n },\n ],\n instanceFilter,\n groupByClass: false,\n groupByLabel: false,\n };\n}\n\n/** @internal */\nexport function addModelsTreeNodeItemIcons(item: Partial<DelayLoadedTreeNodeItem>, node: Partial<Node>) {\n item.icon = node.key && NodeKey.isClassGroupingNodeKey(node.key) ? node.extendedData?.groupIcon : node.extendedData?.icon;\n}\n\n/** @internal */\nexport async function queryModelsForHeaderActions(iModel: IModelConnection) {\n const queryParams: ModelQueryParams = {\n from: \"BisCore.GeometricModel3d\",\n where: `\n EXISTS (\n SELECT 1\n FROM BisCore.Element e\n WHERE e.ECClassId IS (BisCore.GeometricElement3d, BisCore.InformationPartitionElement)\n AND e.ECInstanceId = GeometricModel3d.ModeledElement.Id\n )\n `,\n wantPrivate: false,\n };\n\n const modelProps = await iModel.models.queryProps(queryParams);\n return modelProps.map(({ id, isPlanProjection }: GeometricModel3dProps) => ({ id, isPlanProjection })).filter(({ id }) => id) as ModelInfo[];\n}\n"]}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
import { useCallback, useState } from "react";
|
|
7
7
|
import { ResizableContainerObserver } from "@itwin/core-react";
|
|
8
8
|
// istanbul ignore next
|
|
9
9
|
/** @internal */
|
|
10
10
|
export function AutoSizer(props) {
|
|
11
11
|
const [{ height, width }, setSize] = useState({ height: 0, width: 0 });
|
|
12
|
-
const handleResize = useCallback((w, h) => {
|
|
13
|
-
|
|
12
|
+
const handleResize = useCallback((w, h) => {
|
|
13
|
+
setSize({ height: h, width: w });
|
|
14
|
+
}, []);
|
|
15
|
+
return _jsx(ResizableContainerObserver, { onResize: handleResize, children: props.children({ height, width }) });
|
|
14
16
|
}
|
|
15
17
|
//# sourceMappingURL=AutoSizer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoSizer.js","sourceRoot":"","sources":["../../../../src/components/utils/AutoSizer.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"AutoSizer.js","sourceRoot":"","sources":["../../../../src/components/utils/AutoSizer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAa/D,uBAAuB;AACvB,gBAAgB;AAChB,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAO,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7E,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;QACxD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACnC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,KAAC,0BAA0B,IAAC,QAAQ,EAAE,YAAY,YAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAA8B,CAAC;AAC9H,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 { useCallback, useState } from \"react\";\nimport { ResizableContainerObserver } from \"@itwin/core-react\";\n\n/** @internal */\nexport interface Size {\n width: number;\n height: number;\n}\n\n/** @internal */\nexport interface AutoSizerProps {\n children: (size: Size) => React.ReactNode;\n}\n\n// istanbul ignore next\n/** @internal */\nexport function AutoSizer(props: AutoSizerProps) {\n const [{ height, width }, setSize] = useState<Size>({ height: 0, width: 0 });\n const handleResize = useCallback((w: number, h: number) => {\n setSize({ height: h, width: w });\n }, []);\n\n return <ResizableContainerObserver onResize={handleResize}>{props.children({ height, width })}</ResizableContainerObserver>;\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
|
/**
|
|
6
6
|
* Checks if the specified argument is a promise
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export function isPromiseLike(obj) {
|
|
10
|
-
return !!(obj &&
|
|
10
|
+
return !!(obj && typeof obj === "object" && typeof obj.then === "function");
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=IsPromiseLike.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsPromiseLike.js","sourceRoot":"","sources":["../../../../src/components/utils/IsPromiseLike.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"IsPromiseLike.js","sourceRoot":"","sources":["../../../../src/components/utils/IsPromiseLike.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAQ,GAAW,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;AACvF,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\n/**\n * Checks if the specified argument is a promise\n * @internal\n */\nexport function isPromiseLike(obj: unknown): obj is PromiseLike<unknown> {\n return !!(obj && typeof obj === \"object\" && typeof (obj as any).then === \"function\");\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
|
import { useTransientState } from "@itwin/appui-react";
|
|
6
6
|
import { useControlledTreeLayoutStorage } from "@itwin/components-react";
|
|
7
7
|
// istanbul ignore file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseTreeTransientState.js","sourceRoot":"","sources":["../../../../src/components/utils/UseTreeTransientState.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"UseTreeTransientState.js","sourceRoot":"","sources":["../../../../src/components/utils/UseTreeTransientState.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAEzE,uBAAuB;AAEvB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,8BAA8B,EAAK,CAAC;IACtE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,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 { useTransientState } from \"@itwin/appui-react\";\nimport { useControlledTreeLayoutStorage } from \"@itwin/components-react\";\n\n// istanbul ignore file\n\n/**\n * Allows to persist tree scroll position when tree is used in `@itwin/appui-react` Widgets.\n * Returned `ref` should be passed to container element containing tree component.\n *\n * Example:\n * ```typescript\n * function ModelsTreeWidget() {\n * const ref = useTreeTransientState<HTMLDivElement>();\n * return <div ref={ref}>\n * <ModelsTree />\n * </div>\n * }\n * ```\n *\n * @public\n */\nexport function useTreeTransientState<T extends Element>() {\n const { ref, persist, restore } = useControlledTreeLayoutStorage<T>();\n useTransientState(persist, restore);\n return ref;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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 "./TreeWidget";
|
|
6
6
|
export * from "./components/SelectableTree";
|
|
7
7
|
export * from "./components/trees";
|
|
@@ -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;;;gGAGgG;AAEhG,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,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 \"./TreeWidget\";\nexport * from \"./components/SelectableTree\";\nexport * from \"./components/trees\";\nexport * from \"./components/TreeWidgetUiItemsProvider\";\nexport * from \"./components/utils/UseTreeTransientState\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/tree-widget-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Tree Widget React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Bentley",
|
|
@@ -47,55 +47,53 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@itwin/appui-abstract": "^4.0.0",
|
|
50
|
-
"@itwin/appui-react": "^4.
|
|
51
|
-
"@itwin/components-react": "^4.
|
|
50
|
+
"@itwin/appui-react": "^4.10.0",
|
|
51
|
+
"@itwin/components-react": "^4.10.0",
|
|
52
52
|
"@itwin/core-frontend": "^4.0.0",
|
|
53
|
-
"@itwin/core-react": "^4.
|
|
54
|
-
"@itwin/presentation-components": "^
|
|
55
|
-
"react": "^17.0.0",
|
|
56
|
-
"react-dom": "^17.0.0"
|
|
53
|
+
"@itwin/core-react": "^4.10.0",
|
|
54
|
+
"@itwin/presentation-components": "^5.0.0",
|
|
55
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
56
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@bentley/icons-generic": "^1.0.34",
|
|
60
|
-
"@itwin/itwinui-icons-react": "^2.
|
|
60
|
+
"@itwin/itwinui-icons-react": "^2.8.0",
|
|
61
61
|
"@itwin/itwinui-illustrations-react": "^2.1.0",
|
|
62
|
-
"@itwin/itwinui-react": "^
|
|
62
|
+
"@itwin/itwinui-react": "^3.5.0",
|
|
63
63
|
"classnames": "^2.3.1",
|
|
64
64
|
"i18next": "^10.2.2",
|
|
65
65
|
"react-error-boundary": "^4.0.10",
|
|
66
66
|
"rxjs": "^7.8.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@itwin/appui-abstract": "^4.
|
|
70
|
-
"@itwin/appui-
|
|
71
|
-
"@itwin/
|
|
72
|
-
"@itwin/
|
|
73
|
-
"@itwin/
|
|
74
|
-
"@itwin/core-
|
|
75
|
-
"@itwin/core-
|
|
76
|
-
"@itwin/core-
|
|
77
|
-
"@itwin/core-
|
|
78
|
-
"@itwin/core-
|
|
79
|
-
"@itwin/core-
|
|
80
|
-
"@itwin/core-
|
|
81
|
-
"@itwin/core-
|
|
82
|
-
"@itwin/core-
|
|
83
|
-
"@itwin/core-
|
|
84
|
-
"@itwin/
|
|
85
|
-
"@itwin/ecschema-metadata": "^4.1.2",
|
|
69
|
+
"@itwin/appui-abstract": "^4.4.0",
|
|
70
|
+
"@itwin/appui-react": "^4.10.0",
|
|
71
|
+
"@itwin/build-tools": "^4.4.0",
|
|
72
|
+
"@itwin/components-react": "^4.10.0",
|
|
73
|
+
"@itwin/core-backend": "^4.4.0",
|
|
74
|
+
"@itwin/core-bentley": "^4.4.0",
|
|
75
|
+
"@itwin/core-common": "^4.4.0",
|
|
76
|
+
"@itwin/core-frontend": "^4.4.0",
|
|
77
|
+
"@itwin/core-geometry": "^4.4.0",
|
|
78
|
+
"@itwin/core-i18n": "^4.4.0",
|
|
79
|
+
"@itwin/core-markup": "^4.4.0",
|
|
80
|
+
"@itwin/core-orbitgt": "^4.4.0",
|
|
81
|
+
"@itwin/core-quantity": "^4.4.0",
|
|
82
|
+
"@itwin/core-react": "^4.10.0",
|
|
83
|
+
"@itwin/core-telemetry": "^4.4.0",
|
|
84
|
+
"@itwin/ecschema-metadata": "^4.4.0",
|
|
86
85
|
"@itwin/eslint-plugin": "^4.0.0-dev.38",
|
|
87
|
-
"@itwin/imodel-components-react": "^4.
|
|
88
|
-
"@itwin/presentation-backend": "^4.
|
|
89
|
-
"@itwin/presentation-common": "^4.
|
|
90
|
-
"@itwin/presentation-components": "^
|
|
91
|
-
"@itwin/presentation-frontend": "^4.
|
|
92
|
-
"@itwin/presentation-testing": "^
|
|
93
|
-
"@itwin/webgl-compatibility": "^4.
|
|
94
|
-
"@playwright/test": "^1.
|
|
95
|
-
"@testing-library/dom": "^
|
|
96
|
-
"@testing-library/react": "^
|
|
97
|
-
"@testing-library/
|
|
98
|
-
"@testing-library/user-event": "14.4.3",
|
|
86
|
+
"@itwin/imodel-components-react": "^4.10.0",
|
|
87
|
+
"@itwin/presentation-backend": "^4.4.0",
|
|
88
|
+
"@itwin/presentation-common": "^4.4.0",
|
|
89
|
+
"@itwin/presentation-components": "^5.0.0",
|
|
90
|
+
"@itwin/presentation-frontend": "^4.4.0",
|
|
91
|
+
"@itwin/presentation-testing": "^5.0.0",
|
|
92
|
+
"@itwin/webgl-compatibility": "^4.4.0",
|
|
93
|
+
"@playwright/test": "^1.41.2",
|
|
94
|
+
"@testing-library/dom": "^9.3.3",
|
|
95
|
+
"@testing-library/react": "^14.1.2",
|
|
96
|
+
"@testing-library/user-event": "^14.5.2",
|
|
99
97
|
"@types/chai": "4.3.5",
|
|
100
98
|
"@types/chai-jest-snapshot": "^1.3.4",
|
|
101
99
|
"@types/chai-subset": "1.3.3",
|
|
@@ -104,8 +102,8 @@
|
|
|
104
102
|
"@types/jsdom": "^21.1.6",
|
|
105
103
|
"@types/mocha": "^10.0.6",
|
|
106
104
|
"@types/node": "^18.18.10",
|
|
107
|
-
"@types/react": "^
|
|
108
|
-
"@types/react-dom": "^
|
|
105
|
+
"@types/react": "^18.0.34",
|
|
106
|
+
"@types/react-dom": "^18.0.11",
|
|
109
107
|
"@types/sinon": "^17.0.2",
|
|
110
108
|
"@types/sinon-chai": "^3.2.12",
|
|
111
109
|
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
|
@@ -118,18 +116,20 @@
|
|
|
118
116
|
"deep-equal": "^1.0.0",
|
|
119
117
|
"dotenv": "^16.3.1",
|
|
120
118
|
"eslint": "^8.41.0",
|
|
119
|
+
"eslint-config-prettier": "^9.1.0",
|
|
121
120
|
"eslint-plugin-import": "^2.29.0",
|
|
122
121
|
"eslint-plugin-react": "^7.33.2",
|
|
123
122
|
"eslint-plugin-unused-imports": "^2.0.0",
|
|
124
|
-
"global-jsdom": "
|
|
123
|
+
"global-jsdom": "^9.2.0",
|
|
125
124
|
"ignore-styles": "^5.0.1",
|
|
126
|
-
"jsdom": "^
|
|
125
|
+
"jsdom": "^23.1.0",
|
|
127
126
|
"mocha": "^10.2.0",
|
|
128
127
|
"nyc": "15.1.0",
|
|
128
|
+
"postcss": "^8.4.32",
|
|
129
129
|
"raf": "^3.4.0",
|
|
130
|
-
"react": "^
|
|
131
|
-
"react-dom": "^
|
|
132
|
-
"react-redux": "^7.2.
|
|
130
|
+
"react": "^18.0.0",
|
|
131
|
+
"react-dom": "^18.0.0",
|
|
132
|
+
"react-redux": "^7.2.9",
|
|
133
133
|
"redux": "^4.1.0",
|
|
134
134
|
"rimraf": "^3.0.2",
|
|
135
135
|
"sinon": "^17.0.1",
|
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"stylelint-config-standard-scss": "^11.1.0",
|
|
140
140
|
"typemoq": "^2.1.0",
|
|
141
141
|
"typescript": "~5.0.0",
|
|
142
|
-
"xmlhttprequest": "^1.8.0"
|
|
142
|
+
"xmlhttprequest": "^1.8.0",
|
|
143
|
+
"sanitize-filename": "^1.6.3"
|
|
143
144
|
},
|
|
144
145
|
"eslintConfig": {
|
|
145
146
|
"extends": [
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const assert_1 = __importDefault(require("assert"));
|
|
11
|
-
const test_1 = require("@playwright/test");
|
|
12
|
-
const utils_1 = require("./utils");
|
|
13
|
-
let treeWidget;
|
|
14
|
-
test_1.test.beforeEach(async ({ page, baseURL }) => {
|
|
15
|
-
(0, assert_1.default)(baseURL);
|
|
16
|
-
await page.goto(baseURL, { waitUntil: "networkidle" });
|
|
17
|
-
await page.evaluate(async () => document.fonts.ready);
|
|
18
|
-
// expand panel size to ~300px
|
|
19
|
-
await (0, utils_1.expandStagePanel)(page, "right", 100);
|
|
20
|
-
treeWidget = (0, utils_1.locateWidget)(page, "tree");
|
|
21
|
-
await treeWidget.waitFor();
|
|
22
|
-
});
|
|
23
|
-
test_1.test.describe("should match image snapshot", () => {
|
|
24
|
-
(0, test_1.test)("initial tree", async ({ page }) => {
|
|
25
|
-
// wait for element to be visible in the tree
|
|
26
|
-
await (0, utils_1.locateNode)(treeWidget, "ProcessPhysicalModel").getByRole("checkbox", { name: "Visible", exact: true }).waitFor();
|
|
27
|
-
await (0, utils_1.takeScreenshot)(page, treeWidget);
|
|
28
|
-
});
|
|
29
|
-
(0, test_1.test)("expanded tree node", async ({ page }) => {
|
|
30
|
-
const node = (0, utils_1.locateNode)(treeWidget, "ProcessPhysicalModel");
|
|
31
|
-
await node.getByTestId("tree-node-expansion-toggle").click();
|
|
32
|
-
// wait for node at the bottom to be visible/loaded
|
|
33
|
-
await (0, utils_1.locateNode)(treeWidget, "Tag-Category").waitFor();
|
|
34
|
-
await (0, utils_1.takeScreenshot)(page, treeWidget);
|
|
35
|
-
});
|
|
36
|
-
(0, test_1.test)("selected node", async ({ page }) => {
|
|
37
|
-
const node = (0, utils_1.locateNode)(treeWidget, "BayTown");
|
|
38
|
-
await node.click();
|
|
39
|
-
// wait for node to become selected
|
|
40
|
-
await (0, test_1.expect)(node).toHaveClass(/is-selected/);
|
|
41
|
-
await (0, utils_1.takeScreenshot)(page, treeWidget);
|
|
42
|
-
});
|
|
43
|
-
(0, test_1.test)("search", async ({ page }) => {
|
|
44
|
-
await treeWidget.getByText("BayTown").waitFor();
|
|
45
|
-
await treeWidget.getByTitle("Search for something").click();
|
|
46
|
-
await treeWidget.getByPlaceholder("Search...").fill("Model");
|
|
47
|
-
await treeWidget.locator(".components-activehighlight").waitFor();
|
|
48
|
-
await (0, utils_1.takeScreenshot)(page, treeWidget);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=TreeWidget.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeWidget.test.js","sourceRoot":"","sources":["../../../src/e2e-tests/TreeWidget.test.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;AAGhG,oDAA4B;AAC5B,2CAAgD;AAChD,mCAAqF;AAErF,IAAI,UAAmB,CAAC;AACxB,WAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1C,IAAA,gBAAM,EAAC,OAAO,CAAC,CAAC;IAChB,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;IACvD,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtD,8BAA8B;IAC9B,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IAC3C,UAAU,GAAG,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C9C,MAAM,IAAA,sBAAc,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,IAAA,WAAI,EAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAChC,MAAM,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;QAChD,MAAM,UAAU,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,KAAK,EAAE,CAAC;QAC5D,MAAM,UAAU,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,UAAU,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,OAAO,EAAE,CAAC;QAClE,MAAM,IAAA,sBAAc,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AAEL,CAAC,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 type { Locator } from \"@playwright/test\";\nimport assert from \"assert\";\nimport { expect, test } from \"@playwright/test\";\nimport { expandStagePanel, locateNode, locateWidget, takeScreenshot } from \"./utils\";\n\nlet treeWidget: Locator;\ntest.beforeEach(async ({ page, baseURL }) => {\n assert(baseURL);\n await page.goto(baseURL, { waitUntil: \"networkidle\" });\n await page.evaluate(async () => document.fonts.ready);\n // expand panel size to ~300px\n await expandStagePanel(page, \"right\", 100);\n treeWidget = locateWidget(page, \"tree\");\n await treeWidget.waitFor();\n});\n\ntest.describe(\"should match image snapshot\", () => {\n\n test(\"initial tree\", async ({ page }) => {\n // wait for element to be visible in the tree\n await locateNode(treeWidget, \"ProcessPhysicalModel\").getByRole(\"checkbox\", { name: \"Visible\", exact: true }).waitFor();\n await takeScreenshot(page, treeWidget);\n });\n\n test(\"expanded tree node\", async ({ page }) => {\n const node = locateNode(treeWidget, \"ProcessPhysicalModel\");\n await node.getByTestId(\"tree-node-expansion-toggle\").click();\n\n // wait for node at the bottom to be visible/loaded\n await locateNode(treeWidget, \"Tag-Category\").waitFor();\n await takeScreenshot(page, treeWidget);\n });\n\n test(\"selected node\", async ({ page }) => {\n const node = locateNode(treeWidget, \"BayTown\");\n await node.click();\n\n // wait for node to become selected\n await expect(node).toHaveClass(/is-selected/);\n await takeScreenshot(page, treeWidget);\n });\n\n test(\"search\", async ({ page }) => {\n await treeWidget.getByText(\"BayTown\").waitFor();\n await treeWidget.getByTitle(\"Search for something\").click();\n await treeWidget.getByPlaceholder(\"Search...\").fill(\"Model\");\n await treeWidget.locator(\".components-activehighlight\").waitFor();\n await takeScreenshot(page, treeWidget);\n });\n\n});\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Locator, Page } from "@playwright/test";
|
|
2
|
-
export declare const locateNode: (tree: Page | Locator, name: string) => Locator;
|
|
3
|
-
export declare const locateWidget: (page: Page | Locator, widgetName: string) => Locator;
|
|
4
|
-
type PanelSide = "left" | "right" | "top" | "bottom";
|
|
5
|
-
export declare const locatePanel: (page: Page, side: PanelSide) => Locator;
|
|
6
|
-
export declare const expandStagePanel: (page: Page, side: PanelSide, px: number) => Promise<void>;
|
|
7
|
-
export declare function takeScreenshot(page: Page, component: Locator): Promise<void>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.takeScreenshot = exports.expandStagePanel = exports.locatePanel = exports.locateWidget = exports.locateNode = void 0;
|
|
11
|
-
const assert_1 = __importDefault(require("assert"));
|
|
12
|
-
const test_1 = require("@playwright/test");
|
|
13
|
-
const locateNode = (tree, name) => tree.getByRole("treeitem", { name });
|
|
14
|
-
exports.locateNode = locateNode;
|
|
15
|
-
const locateWidget = (page, widgetName) => page.locator(`.${widgetName}-widget`);
|
|
16
|
-
exports.locateWidget = locateWidget;
|
|
17
|
-
const locatePanel = (page, side) => page.locator(`.nz-widgetPanels-panel.nz-${side}`);
|
|
18
|
-
exports.locatePanel = locatePanel;
|
|
19
|
-
const expandStagePanel = async (page, side, px) => {
|
|
20
|
-
const widgetPanel = (0, exports.locatePanel)(page, side);
|
|
21
|
-
const handlePos = await widgetPanel
|
|
22
|
-
.locator(".nz-grip-container")
|
|
23
|
-
.locator(".nz-handle")
|
|
24
|
-
.boundingBox();
|
|
25
|
-
(0, assert_1.default)(handlePos);
|
|
26
|
-
await page.mouse.move(handlePos.x, handlePos.y);
|
|
27
|
-
await page.mouse.down();
|
|
28
|
-
switch (side) {
|
|
29
|
-
case "left":
|
|
30
|
-
await page.mouse.move(handlePos.x + px, handlePos.y);
|
|
31
|
-
break;
|
|
32
|
-
case "right":
|
|
33
|
-
await page.mouse.move(handlePos.x - px, handlePos.y);
|
|
34
|
-
break;
|
|
35
|
-
case "top":
|
|
36
|
-
await page.mouse.move(handlePos.x, handlePos.y - px);
|
|
37
|
-
break;
|
|
38
|
-
case "bottom":
|
|
39
|
-
await page.mouse.move(handlePos.x, handlePos.y + px);
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
await page.mouse.up();
|
|
43
|
-
};
|
|
44
|
-
exports.expandStagePanel = expandStagePanel;
|
|
45
|
-
async function takeScreenshot(page, component) {
|
|
46
|
-
const boundingBox = await component.boundingBox();
|
|
47
|
-
(0, assert_1.default)(boundingBox);
|
|
48
|
-
await (0, test_1.expect)(page).toHaveScreenshot({ clip: boundingBox });
|
|
49
|
-
}
|
|
50
|
-
exports.takeScreenshot = takeScreenshot;
|
|
51
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/e2e-tests/utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;AAEhG,oDAA4B;AAC5B,2CAA0C;AAInC,MAAM,UAAU,GAAG,CAAC,IAAoB,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAA1F,QAAA,UAAU,cAAgF;AAChG,MAAM,YAAY,GAAG,CAAC,IAAoB,EAAE,UAAkB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,SAAS,CAAC,CAAC;AAAnG,QAAA,YAAY,gBAAuF;AAGzG,MAAM,WAAW,GAAG,CAAC,IAAU,EAAE,IAAe,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;AAAjG,QAAA,WAAW,eAAsF;AAEvG,MAAM,gBAAgB,GAAG,KAAK,EAAE,IAAU,EAAE,IAAe,EAAE,EAAU,EAAE,EAAE;IAChF,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,MAAM,WAAW;SAChC,OAAO,CAAC,oBAAoB,CAAC;SAC7B,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,EAAE,CAAC;IACjB,IAAA,gBAAM,EAAC,SAAS,CAAC,CAAC;IAElB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAExB,QAAQ,IAAI,EAAE;QACZ,KAAK,MAAM;YACT,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;YACrD,MAAM;QACR,KAAK,OAAO;YACV,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;YACrD,MAAM;QACR,KAAK,KAAK;YACR,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;YACrD,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;YACrD,MAAM;KACT;IACD,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;AACxB,CAAC,CAAC;AA1BW,QAAA,gBAAgB,oBA0B3B;AAEK,KAAK,UAAU,cAAc,CAAC,IAAU,EAAE,SAAkB;IACjE,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC;IAClD,IAAA,gBAAM,EAAC,WAAW,CAAC,CAAC;IACpB,MAAM,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;AAC7D,CAAC;AAJD,wCAIC","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 assert from \"assert\";\nimport { expect } from \"@playwright/test\";\n\nimport type { Locator, Page } from \"@playwright/test\";\n\nexport const locateNode = (tree: Page | Locator, name: string) => tree.getByRole(\"treeitem\", { name });\nexport const locateWidget = (page: Page | Locator, widgetName: string) => page.locator(`.${widgetName}-widget`);\n\ntype PanelSide = \"left\" | \"right\" | \"top\" | \"bottom\";\nexport const locatePanel = (page: Page, side: PanelSide) => page.locator(`.nz-widgetPanels-panel.nz-${side}`);\n\nexport const expandStagePanel = async (page: Page, side: PanelSide, px: number) => {\n const widgetPanel = locatePanel(page, side);\n const handlePos = await widgetPanel\n .locator(\".nz-grip-container\")\n .locator(\".nz-handle\")\n .boundingBox();\n assert(handlePos);\n\n await page.mouse.move(handlePos.x, handlePos.y);\n await page.mouse.down();\n\n switch (side) {\n case \"left\":\n await page.mouse.move(handlePos.x + px, handlePos.y);\n break;\n case \"right\":\n await page.mouse.move(handlePos.x - px, handlePos.y);\n break;\n case \"top\":\n await page.mouse.move(handlePos.x, handlePos.y - px);\n break;\n case \"bottom\":\n await page.mouse.move(handlePos.x, handlePos.y + px);\n break;\n }\n await page.mouse.up();\n};\n\nexport async function takeScreenshot(page: Page, component: Locator) {\n const boundingBox = await component.boundingBox();\n assert(boundingBox);\n await expect(page).toHaveScreenshot({ clip: boundingBox });\n}\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import assert from "assert";
|
|
6
|
-
import { expect, test } from "@playwright/test";
|
|
7
|
-
import { expandStagePanel, locateNode, locateWidget, takeScreenshot } from "./utils";
|
|
8
|
-
let treeWidget;
|
|
9
|
-
test.beforeEach(async ({ page, baseURL }) => {
|
|
10
|
-
assert(baseURL);
|
|
11
|
-
await page.goto(baseURL, { waitUntil: "networkidle" });
|
|
12
|
-
await page.evaluate(async () => document.fonts.ready);
|
|
13
|
-
// expand panel size to ~300px
|
|
14
|
-
await expandStagePanel(page, "right", 100);
|
|
15
|
-
treeWidget = locateWidget(page, "tree");
|
|
16
|
-
await treeWidget.waitFor();
|
|
17
|
-
});
|
|
18
|
-
test.describe("should match image snapshot", () => {
|
|
19
|
-
test("initial tree", async ({ page }) => {
|
|
20
|
-
// wait for element to be visible in the tree
|
|
21
|
-
await locateNode(treeWidget, "ProcessPhysicalModel").getByRole("checkbox", { name: "Visible", exact: true }).waitFor();
|
|
22
|
-
await takeScreenshot(page, treeWidget);
|
|
23
|
-
});
|
|
24
|
-
test("expanded tree node", async ({ page }) => {
|
|
25
|
-
const node = locateNode(treeWidget, "ProcessPhysicalModel");
|
|
26
|
-
await node.getByTestId("tree-node-expansion-toggle").click();
|
|
27
|
-
// wait for node at the bottom to be visible/loaded
|
|
28
|
-
await locateNode(treeWidget, "Tag-Category").waitFor();
|
|
29
|
-
await takeScreenshot(page, treeWidget);
|
|
30
|
-
});
|
|
31
|
-
test("selected node", async ({ page }) => {
|
|
32
|
-
const node = locateNode(treeWidget, "BayTown");
|
|
33
|
-
await node.click();
|
|
34
|
-
// wait for node to become selected
|
|
35
|
-
await expect(node).toHaveClass(/is-selected/);
|
|
36
|
-
await takeScreenshot(page, treeWidget);
|
|
37
|
-
});
|
|
38
|
-
test("search", async ({ page }) => {
|
|
39
|
-
await treeWidget.getByText("BayTown").waitFor();
|
|
40
|
-
await treeWidget.getByTitle("Search for something").click();
|
|
41
|
-
await treeWidget.getByPlaceholder("Search...").fill("Model");
|
|
42
|
-
await treeWidget.locator(".components-activehighlight").waitFor();
|
|
43
|
-
await takeScreenshot(page, treeWidget);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=TreeWidget.test.js.map
|