@itwin/presentation-hierarchies 1.1.0 → 1.2.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 +17 -0
- package/lib/cjs/hierarchies/HierarchyErrors.d.ts +1 -1
- package/lib/cjs/hierarchies/HierarchyErrors.js +1 -1
- package/lib/cjs/hierarchies/HierarchyErrors.js.map +1 -1
- package/lib/cjs/hierarchies/HierarchyFiltering.d.ts +12 -11
- package/lib/cjs/hierarchies/HierarchyFiltering.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyFiltering.js +16 -21
- package/lib/cjs/hierarchies/HierarchyFiltering.js.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNode.d.ts +10 -10
- package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNode.js +13 -13
- package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts +4 -4
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +13 -13
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.js +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -1
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts +6 -6
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyProvider.js +6 -6
- package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
- package/lib/cjs/hierarchies/Logging.d.ts +2 -2
- package/lib/cjs/hierarchies/Logging.js +3 -3
- package/lib/cjs/hierarchies/Logging.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +5 -17
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js +66 -54
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js +2 -2
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +13 -13
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +1 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +23 -23
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +5 -5
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +8 -8
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +88 -87
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +2 -2
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +17 -14
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +16 -16
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +2 -2
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +10 -10
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +5 -10
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +4 -4
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +1 -2
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/Utils.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/Utils.js +2 -2
- package/lib/cjs/hierarchies/imodel/Utils.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +8 -8
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts +3 -3
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js +42 -42
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +16 -16
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +25 -25
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js +2 -2
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +3 -3
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +3 -3
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +3 -3
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +2 -2
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +2 -2
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +2 -2
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +2 -2
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +3 -3
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +13 -18
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts +2 -2
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +1 -1
- package/lib/cjs/hierarchies/internal/Common.d.ts +1 -1
- package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -1
- package/lib/cjs/hierarchies/internal/Common.js +2 -1
- package/lib/cjs/hierarchies/internal/Common.js.map +1 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +1 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.js +3 -0
- package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +1 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.js +2 -2
- package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +1 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.js +2 -2
- package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -1
- package/lib/cjs/presentation-hierarchies.d.ts +13 -13
- package/lib/cjs/presentation-hierarchies.d.ts.map +1 -1
- package/lib/cjs/presentation-hierarchies.js +29 -29
- package/lib/cjs/presentation-hierarchies.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyErrors.d.ts +1 -1
- package/lib/esm/hierarchies/HierarchyErrors.js +1 -1
- package/lib/esm/hierarchies/HierarchyErrors.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyFiltering.d.ts +12 -11
- package/lib/esm/hierarchies/HierarchyFiltering.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyFiltering.js +16 -21
- package/lib/esm/hierarchies/HierarchyFiltering.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyNode.d.ts +10 -10
- package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyNode.js +3 -3
- package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +4 -4
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js +1 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts +13 -13
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.js +1 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyProvider.d.ts +6 -6
- package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyProvider.js +3 -3
- package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
- package/lib/esm/hierarchies/Logging.d.ts +2 -2
- package/lib/esm/hierarchies/Logging.js +3 -3
- package/lib/esm/hierarchies/Logging.js.map +1 -1
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +5 -17
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js +52 -40
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js.map +1 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.js +1 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +1 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts +13 -13
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js +1 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts +23 -23
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js +2 -2
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +1 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +8 -8
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +41 -40
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +2 -2
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js +11 -8
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts +16 -16
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js +2 -2
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +10 -10
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +5 -10
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts +4 -4
- package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.js +1 -2
- package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +1 -1
- package/lib/esm/hierarchies/imodel/Utils.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/Utils.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/Utils.js +1 -1
- package/lib/esm/hierarchies/imodel/Utils.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js +6 -6
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts +3 -3
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.js +22 -22
- package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js +10 -10
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js +14 -14
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +3 -3
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +2 -2
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +3 -3
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +2 -2
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +3 -3
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +9 -14
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts +2 -2
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +1 -1
- package/lib/esm/hierarchies/internal/Common.d.ts +1 -1
- package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -1
- package/lib/esm/hierarchies/internal/Common.js +2 -1
- package/lib/esm/hierarchies/internal/Common.js.map +1 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +1 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.js +3 -0
- package/lib/esm/hierarchies/internal/EachValueFrom.js.map +1 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.js +1 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.js.map +1 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.js +1 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.js.map +1 -1
- package/lib/esm/presentation-hierarchies.d.ts +13 -13
- package/lib/esm/presentation-hierarchies.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies.js +13 -13
- package/lib/esm/presentation-hierarchies.js.map +1 -1
- package/package.json +21 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelHierarchyNode.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyNode.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAIhG,0DAAyF;AAuNzF,YAAY;AACZ,2DAA2D;AAC3D,IAAiB,sBAAsB,CAatC;AAbD,WAAiB,sBAAsB;IACrC,sDAAsD;IACtD,SAAgB,SAAS,CAAC,IAA4B;QACpD,OAAO,mCAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAFe,gCAAS,YAExB,CAAA;IACD,iEAAiE;IACjE,SAAgB,eAAe,CAAC,IAA4B;QAC1D,OAAO,mCAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAFe,sCAAe,kBAE9B,CAAA;IACD,uDAAuD;IACvD,SAAgB,cAAc,CAAC,IAA4B;QACzD,OAAO,mCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAFe,qCAAc,iBAE7B,CAAA;AACH,CAAC,EAbgB,sBAAsB,sCAAtB,sBAAsB,QAatC","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 { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from \"@itwin/presentation-shared\";\nimport { GroupingHierarchyNode, NonGroupingHierarchyNode } from \"../HierarchyNode\";\nimport { GenericNodeKey, HierarchyNodeKey, InstancesNodeKey } from \"../HierarchyNodeKey\";\n\n/**\n * Base processing parameters that apply to every node.\n * @beta\n */\ninterface HierarchyNodeProcessingParamsBase {\n /** Indicates if this node should be hidden if it has no child nodes. */\n hideIfNoChildren?: boolean;\n /** Indicates that this node should always be hidden and its children should be loaded in its place. */\n hideInHierarchy?: boolean;\n}\n\n/**\n * A data structure for defining nodes' grouping requirements.\n * @beta\n */\ninterface HierarchyNodeGroupingParams {\n byLabel?: HierarchyNodeLabelGroupingParams;\n byClass?: boolean | HierarchyNodeGroupingParamsBase;\n byBaseClasses?: HierarchyNodeBaseClassGroupingParams;\n byProperties?: HierarchyNodePropertiesGroupingParams;\n}\n\n/**\n * A data structure for defining params specifically used for label grouping.\n * @beta\n */\ninterface HierarchyNodeLabelGroupingBaseParams {\n /** Label grouping option that determines whether to group nodes or to merge them. Defaults to \"group\".*/\n action?: \"group\" | \"merge\";\n /** Value that needs to match in order for nodes to be grouped or merged.*/\n groupId?: string;\n}\n\n/**\n * A data structure for defining label merging.\n * @beta\n */\ninterface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {\n action: \"merge\";\n}\n\n/**\n * A data structure for defining label grouping with additional parameters.\n * @beta\n */\ninterface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {\n action?: \"group\";\n}\n\n/**\n * A data structure for defining possible label grouping types.\n * @beta\n */\nexport type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;\n\n/**\n * Grouping parameters that are shared across all types of groupings.\n * @beta\n */\nexport interface HierarchyNodeGroupingParamsBase {\n /** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */\n hideIfNoSiblings?: boolean;\n /** Hiding option that determines whether to hide group nodes which have only one node as its children. */\n hideIfOneGroupedNode?: boolean;\n /** Option which auto expands grouping nodes' children when it has single child or always. */\n autoExpand?: HierarchyNodeAutoExpandProp;\n}\n\n/**\n * Defines possible values for `BaseGroupingParams.autoExpand` attribute:\n * - `single-child` - set the grouping node to auto-expand if it groups a single node.\n * - `always` - always set the grouping node to auto-expand.\n * @beta\n */\nexport type HierarchyNodeAutoExpandProp = \"single-child\" | \"always\";\n\n/**\n * A data structure that represents base class grouping.\n * @beta\n */\ninterface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full names of classes, which should be used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n fullClassNames: string[];\n}\n\n/**\n * A data structure that represents properties grouping.\n * @beta\n */\nexport interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full name of a class whose properties are used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n propertiesClassName: string;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.\n *\n * Label of the created grouping node will be `Not Specified`.\n */\n createGroupForUnspecifiedValues?: boolean;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value doesn't fit within any of the provided\n * ranges, or is not a numeric value.\n *\n * Label of the created grouping node will be `Other`.\n */\n createGroupForOutOfRangeValues?: boolean;\n /**\n * Properties of the specified class, by which the nodes should be grouped. Each provided group definition results in a\n * grouping hierarchy level.\n *\n * Example usage:\n * ```ts\n * propertyGroups: [\n * {\n * propertyName: \"type\",\n * propertyValue: \"Wall\"\n * },\n * {\n * propertyName: \"length\",\n * propertyValue: 15,\n * ranges: [\n * { fromValue: 1, toValue: 10, rangeLabel: \"Small\" },\n * { fromValue: 11, toValue: 20, rangeLabel: \"Medium\" }\n * ]\n * },\n * ]\n * ```\n */\n propertyGroups: HierarchyNodePropertyGroup[];\n}\n\n/**\n * A data structure that represents specific properties' grouping params.\n * @beta\n */\nexport interface HierarchyNodePropertyGroup {\n /** A string indicating the name of the property to group by. */\n propertyName: string;\n /** Value of the property, which will be used to group the node. */\n propertyValue?: PrimitiveValue | ConcatenatedValue;\n /** Ranges are used to group nodes by numeric properties which are within specified bounds. */\n ranges?: HierarchyNodePropertyValueRange[];\n}\n\n/**\n * A data structure that represents boundaries for a value.\n * @beta\n */\nexport interface HierarchyNodePropertyValueRange {\n /** Defines the lower bound of the range. */\n fromValue: number;\n /** Defines the upper bound of the range. */\n toValue: number;\n /** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */\n rangeLabel?: string;\n}\n\n/**\n * Processing parameters that apply to instance nodes.\n * @beta\n */\nexport interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {\n grouping?: HierarchyNodeGroupingParams;\n}\n\n/**\n * A generic (not based on data in an iModel) node that has processing parameters.\n * @beta\n */\nexport type ProcessedGenericHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: GenericNodeKey;\n children?: boolean;\n processingParams?: HierarchyNodeProcessingParamsBase;\n};\n\n/**\n * An instances' (based on data in an iModel) node that has processing parameters.\n * @beta\n */\nexport type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: InstancesNodeKey;\n children?: boolean;\n processingParams?: InstanceHierarchyNodeProcessingParams;\n};\n\n/**\n * A grouping node that groups either instance nodes or other grouping nodes.\n * @beta\n */\nexport type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, \"children\"> & {\n children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;\n};\n\n/**\n * A `HierarchyNode` that may have processing parameters defining whether it should be hidden under some conditions,\n * how it should be grouped, sorted, etc.\n *\n * Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of\n * `ProcessedHierarchyNode`.\n *\n * @beta\n */\nexport type ProcessedHierarchyNode = ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace ProcessedHierarchyNode {\n /** Checks whether the given node is a generic node */\n export function isGeneric(node: ProcessedHierarchyNode): node is ProcessedGenericHierarchyNode {\n return HierarchyNodeKey.isGeneric(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode(node: ProcessedHierarchyNode): node is ProcessedInstanceHierarchyNode {\n return HierarchyNodeKey.isInstances(node.key);\n }\n /** Checks whether the given node is a grouping node */\n export function isGroupingNode(node: ProcessedHierarchyNode): node is ProcessedGroupingHierarchyNode {\n return HierarchyNodeKey.isGrouping(node.key);\n }\n}\n\n/**\n * A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is\n * returned by hierarchy definitions as a generic node or when the node is just parsed from query results.\n * @beta\n */\nexport type SourceHierarchyNode<TBase = SourceGenericHierarchyNode | SourceInstanceHierarchyNode> = OmitOverUnion<TBase, \"label\" | \"parentKeys\"> & {\n label: string | ConcatenatedValue;\n};\n\n/**\n * A kind of `ProcessedGenericHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @beta\n */\nexport type SourceGenericHierarchyNode = SourceHierarchyNode<Omit<ProcessedGenericHierarchyNode, \"key\"> & { key: string }>;\n\n/**\n * A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @beta\n */\nexport type SourceInstanceHierarchyNode = SourceHierarchyNode<\n Omit<ProcessedInstanceHierarchyNode, \"key\"> & {\n key: Omit<InstancesNodeKey, \"instanceKeys\"> & { instanceKeys: InstanceKey[] };\n }\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"IModelHierarchyNode.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyNode.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAIhG,gEAA4F;AAuN5F,cAAc;AACd,2DAA2D;AAC3D,IAAiB,sBAAsB,CAatC;AAbD,WAAiB,sBAAsB;IACrC,sDAAsD;IACtD,SAAgB,SAAS,CAAC,IAA4B;QACpD,OAAO,sCAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAFe,gCAAS,YAExB,CAAA;IACD,iEAAiE;IACjE,SAAgB,eAAe,CAAC,IAA4B;QAC1D,OAAO,sCAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAFe,sCAAe,kBAE9B,CAAA;IACD,uDAAuD;IACvD,SAAgB,cAAc,CAAC,IAA4B;QACzD,OAAO,sCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAFe,qCAAc,iBAE7B,CAAA;AACH,CAAC,EAbgB,sBAAsB,sCAAtB,sBAAsB,QAatC","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 { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from \"@itwin/presentation-shared\";\nimport { GroupingHierarchyNode, NonGroupingHierarchyNode } from \"../HierarchyNode.js\";\nimport { GenericNodeKey, HierarchyNodeKey, InstancesNodeKey } from \"../HierarchyNodeKey.js\";\n\n/**\n * Base processing parameters that apply to every node.\n * @public\n */\ninterface HierarchyNodeProcessingParamsBase {\n /** Indicates if this node should be hidden if it has no child nodes. */\n hideIfNoChildren?: boolean;\n /** Indicates that this node should always be hidden and its children should be loaded in its place. */\n hideInHierarchy?: boolean;\n}\n\n/**\n * A data structure for defining nodes' grouping requirements.\n * @public\n */\ninterface HierarchyNodeGroupingParams {\n byLabel?: HierarchyNodeLabelGroupingParams;\n byClass?: boolean | HierarchyNodeGroupingParamsBase;\n byBaseClasses?: HierarchyNodeBaseClassGroupingParams;\n byProperties?: HierarchyNodePropertiesGroupingParams;\n}\n\n/**\n * A data structure for defining params specifically used for label grouping.\n * @public\n */\ninterface HierarchyNodeLabelGroupingBaseParams {\n /** Label grouping option that determines whether to group nodes or to merge them. Defaults to \"group\".*/\n action?: \"group\" | \"merge\";\n /** Value that needs to match in order for nodes to be grouped or merged.*/\n groupId?: string;\n}\n\n/**\n * A data structure for defining label merging.\n * @public\n */\ninterface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {\n action: \"merge\";\n}\n\n/**\n * A data structure for defining label grouping with additional parameters.\n * @public\n */\ninterface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {\n action?: \"group\";\n}\n\n/**\n * A data structure for defining possible label grouping types.\n * @public\n */\nexport type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;\n\n/**\n * Grouping parameters that are shared across all types of groupings.\n * @public\n */\nexport interface HierarchyNodeGroupingParamsBase {\n /** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */\n hideIfNoSiblings?: boolean;\n /** Hiding option that determines whether to hide group nodes which have only one node as its children. */\n hideIfOneGroupedNode?: boolean;\n /** Option which auto expands grouping nodes' children when it has single child or always. */\n autoExpand?: HierarchyNodeAutoExpandProp;\n}\n\n/**\n * Defines possible values for `BaseGroupingParams.autoExpand` attribute:\n * - `single-child` - set the grouping node to auto-expand if it groups a single node.\n * - `always` - always set the grouping node to auto-expand.\n * @public\n */\nexport type HierarchyNodeAutoExpandProp = \"single-child\" | \"always\";\n\n/**\n * A data structure that represents base class grouping.\n * @public\n */\ninterface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full names of classes, which should be used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n fullClassNames: string[];\n}\n\n/**\n * A data structure that represents properties grouping.\n * @public\n */\nexport interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full name of a class whose properties are used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n propertiesClassName: string;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.\n *\n * Label of the created grouping node will be `Not Specified`.\n */\n createGroupForUnspecifiedValues?: boolean;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value doesn't fit within any of the provided\n * ranges, or is not a numeric value.\n *\n * Label of the created grouping node will be `Other`.\n */\n createGroupForOutOfRangeValues?: boolean;\n /**\n * Properties of the specified class, by which the nodes should be grouped. Each provided group definition results in a\n * grouping hierarchy level.\n *\n * Example usage:\n * ```ts\n * propertyGroups: [\n * {\n * propertyName: \"type\",\n * propertyValue: \"Wall\"\n * },\n * {\n * propertyName: \"length\",\n * propertyValue: 15,\n * ranges: [\n * { fromValue: 1, toValue: 10, rangeLabel: \"Small\" },\n * { fromValue: 11, toValue: 20, rangeLabel: \"Medium\" }\n * ]\n * },\n * ]\n * ```\n */\n propertyGroups: HierarchyNodePropertyGroup[];\n}\n\n/**\n * A data structure that represents specific properties' grouping params.\n * @public\n */\nexport interface HierarchyNodePropertyGroup {\n /** A string indicating the name of the property to group by. */\n propertyName: string;\n /** Value of the property, which will be used to group the node. */\n propertyValue?: PrimitiveValue | ConcatenatedValue;\n /** Ranges are used to group nodes by numeric properties which are within specified bounds. */\n ranges?: HierarchyNodePropertyValueRange[];\n}\n\n/**\n * A data structure that represents boundaries for a value.\n * @public\n */\nexport interface HierarchyNodePropertyValueRange {\n /** Defines the lower bound of the range. */\n fromValue: number;\n /** Defines the upper bound of the range. */\n toValue: number;\n /** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */\n rangeLabel?: string;\n}\n\n/**\n * Processing parameters that apply to instance nodes.\n * @public\n */\nexport interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {\n grouping?: HierarchyNodeGroupingParams;\n}\n\n/**\n * A generic (not based on data in an iModel) node that has processing parameters.\n * @public\n */\nexport type ProcessedGenericHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: GenericNodeKey;\n children?: boolean;\n processingParams?: HierarchyNodeProcessingParamsBase;\n};\n\n/**\n * An instances' (based on data in an iModel) node that has processing parameters.\n * @public\n */\nexport type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: InstancesNodeKey;\n children?: boolean;\n processingParams?: InstanceHierarchyNodeProcessingParams;\n};\n\n/**\n * A grouping node that groups either instance nodes or other grouping nodes.\n * @public\n */\nexport type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, \"children\"> & {\n children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;\n};\n\n/**\n * A `HierarchyNode` that may have processing parameters defining whether it should be hidden under some conditions,\n * how it should be grouped, sorted, etc.\n *\n * Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of\n * `ProcessedHierarchyNode`.\n *\n * @public\n */\nexport type ProcessedHierarchyNode = ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace ProcessedHierarchyNode {\n /** Checks whether the given node is a generic node */\n export function isGeneric(node: ProcessedHierarchyNode): node is ProcessedGenericHierarchyNode {\n return HierarchyNodeKey.isGeneric(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode(node: ProcessedHierarchyNode): node is ProcessedInstanceHierarchyNode {\n return HierarchyNodeKey.isInstances(node.key);\n }\n /** Checks whether the given node is a grouping node */\n export function isGroupingNode(node: ProcessedHierarchyNode): node is ProcessedGroupingHierarchyNode {\n return HierarchyNodeKey.isGrouping(node.key);\n }\n}\n\n/**\n * A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is\n * returned by hierarchy definitions as a generic node or when the node is just parsed from query results.\n * @public\n */\nexport type SourceHierarchyNode<TBase = SourceGenericHierarchyNode | SourceInstanceHierarchyNode> = OmitOverUnion<TBase, \"label\" | \"parentKeys\"> & {\n label: string | ConcatenatedValue;\n};\n\n/**\n * A kind of `ProcessedGenericHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @public\n */\nexport type SourceGenericHierarchyNode = SourceHierarchyNode<Omit<ProcessedGenericHierarchyNode, \"key\"> & { key: string }>;\n\n/**\n * A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @public\n */\nexport type SourceInstanceHierarchyNode = SourceHierarchyNode<\n Omit<ProcessedInstanceHierarchyNode, \"key\"> & {\n key: Omit<InstancesNodeKey, \"instanceKeys\"> & { instanceKeys: InstanceKey[] };\n }\n>;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ECClassHierarchyInspector, ECSchemaProvider, Event, IPrimitiveValueFormatter } from "@itwin/presentation-shared";
|
|
2
|
-
import { HierarchyFilteringPath } from "../HierarchyFiltering";
|
|
3
|
-
import { HierarchyProvider } from "../HierarchyProvider";
|
|
4
|
-
import { HierarchyDefinition } from "./IModelHierarchyDefinition";
|
|
5
|
-
import { LimitingECSqlQueryExecutor } from "./LimitingECSqlQueryExecutor";
|
|
2
|
+
import { HierarchyFilteringPath } from "../HierarchyFiltering.js";
|
|
3
|
+
import { HierarchyProvider } from "../HierarchyProvider.js";
|
|
4
|
+
import { HierarchyDefinition } from "./IModelHierarchyDefinition.js";
|
|
5
|
+
import { LimitingECSqlQueryExecutor } from "./LimitingECSqlQueryExecutor.js";
|
|
6
6
|
/**
|
|
7
7
|
* Defines the strings used by hierarchy provider.
|
|
8
|
-
* @
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
10
|
interface IModelHierarchyProviderLocalizedStrings {
|
|
11
11
|
/**
|
|
@@ -19,13 +19,13 @@ interface IModelHierarchyProviderLocalizedStrings {
|
|
|
19
19
|
*/
|
|
20
20
|
other: string;
|
|
21
21
|
}
|
|
22
|
-
/** @
|
|
22
|
+
/** @public */
|
|
23
23
|
type IModelAccess = ECSchemaProvider & LimitingECSqlQueryExecutor & ECClassHierarchyInspector & {
|
|
24
24
|
imodelKey: string;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* Props for `createIModelHierarchyProvider`.
|
|
28
|
-
* @
|
|
28
|
+
* @public
|
|
29
29
|
*/
|
|
30
30
|
interface IModelHierarchyProviderProps {
|
|
31
31
|
/**
|
|
@@ -68,7 +68,7 @@ interface IModelHierarchyProviderProps {
|
|
|
68
68
|
* Creates an instance of `HierarchyProvider` that creates a hierarchy based on given iModel and
|
|
69
69
|
* a hierarchy definition, which defines each hierarchy level through ECSQL queries.
|
|
70
70
|
*
|
|
71
|
-
* @
|
|
71
|
+
* @public
|
|
72
72
|
*/
|
|
73
73
|
export declare function createIModelHierarchyProvider(props: IModelHierarchyProviderProps): HierarchyProvider & {
|
|
74
74
|
dispose: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelHierarchyProvider.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyProvider.ts"],"names":[],"mappings":"AA2BA,OAAO,EAGL,yBAAyB,EACzB,gBAAgB,EAGhB,KAAK,EAGL,wBAAwB,EAEzB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"IModelHierarchyProvider.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyProvider.ts"],"names":[],"mappings":"AA2BA,OAAO,EAGL,yBAAyB,EACzB,gBAAgB,EAGhB,KAAK,EAGL,wBAAwB,EAEzB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAA0B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAiBpF,OAAO,EAA6B,mBAAmB,EAA4B,MAAM,gCAAgC,CAAC;AAS1H,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAe7E;;;GAGG;AACH,UAAU,uCAAuC;IAC/C;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,cAAc;AACd,KAAK,YAAY,GAAG,gBAAgB,GAAG,0BAA0B,GAAG,yBAAyB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtH;;;GAGG;AACH,UAAU,4BAA4B;IACpC;;;;;;OAMG;IACH,YAAY,EAAE,YAAY,CAAC;IAE3B,wFAAwF;IACxF,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;IAElC;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;IAEzC,qGAAqG;IACrG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,OAAO,CAAC,uCAAuC,CAAC,CAAC;IAEpE;;;;OAIG;IACH,SAAS,CAAC,EAAE,wBAAwB,CAAC;IACrC,yCAAyC;IACzC,SAAS,CAAC,EAAE;QACV,2DAA2D;QAC3D,KAAK,EAAE,sBAAsB,EAAE,CAAC;KACjC,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,4BAA4B,GAAG,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAE9H"}
|
|
@@ -8,36 +8,36 @@ exports.createIModelHierarchyProvider = createIModelHierarchyProvider;
|
|
|
8
8
|
const rxjs_1 = require("rxjs");
|
|
9
9
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
10
10
|
const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const LOGGING_NAMESPACE = `${
|
|
32
|
-
const LOGGING_NAMESPACE_INTERNAL = `${
|
|
33
|
-
const LOGGING_NAMESPACE_PERFORMANCE = `${
|
|
11
|
+
const HierarchyErrors_js_1 = require("../HierarchyErrors.js");
|
|
12
|
+
const HierarchyNode_js_1 = require("../HierarchyNode.js");
|
|
13
|
+
const HierarchyNodeKey_js_1 = require("../HierarchyNodeKey.js");
|
|
14
|
+
const Common_js_1 = require("../internal/Common.js");
|
|
15
|
+
const EachValueFrom_js_1 = require("../internal/EachValueFrom.js");
|
|
16
|
+
const LoggingUtils_js_1 = require("../internal/LoggingUtils.js");
|
|
17
|
+
const Partition_js_1 = require("../internal/operators/Partition.js");
|
|
18
|
+
const ReduceToMergeMap_js_1 = require("../internal/operators/ReduceToMergeMap.js");
|
|
19
|
+
const ShareReplayWithErrors_js_1 = require("../internal/operators/ShareReplayWithErrors.js");
|
|
20
|
+
const Sorting_js_1 = require("../internal/operators/Sorting.js");
|
|
21
|
+
const SubscriptionScheduler_js_1 = require("../internal/SubscriptionScheduler.js");
|
|
22
|
+
const FilteringHierarchyDefinition_js_1 = require("./FilteringHierarchyDefinition.js");
|
|
23
|
+
const HierarchyCache_js_1 = require("./HierarchyCache.js");
|
|
24
|
+
const IModelHierarchyDefinition_js_1 = require("./IModelHierarchyDefinition.js");
|
|
25
|
+
const NodeSelectQueryFactory_js_1 = require("./NodeSelectQueryFactory.js");
|
|
26
|
+
const DetermineChildren_js_1 = require("./operators/DetermineChildren.js");
|
|
27
|
+
const Grouping_js_1 = require("./operators/Grouping.js");
|
|
28
|
+
const HideIfNoChildren_js_1 = require("./operators/HideIfNoChildren.js");
|
|
29
|
+
const HideNodesInHierarchy_js_1 = require("./operators/HideNodesInHierarchy.js");
|
|
30
|
+
const TreeNodesReader_js_1 = require("./TreeNodesReader.js");
|
|
31
|
+
const LOGGING_NAMESPACE = `${Common_js_1.LOGGING_NAMESPACE}.IModelHierarchyProvider`;
|
|
32
|
+
const LOGGING_NAMESPACE_INTERNAL = `${Common_js_1.LOGGING_NAMESPACE_INTERNAL}.IModelHierarchyProvider`;
|
|
33
|
+
const LOGGING_NAMESPACE_PERFORMANCE = `${Common_js_1.LOGGING_NAMESPACE_PERFORMANCE}.IModelHierarchyProvider`;
|
|
34
34
|
const DEFAULT_QUERY_CONCURRENCY = 10;
|
|
35
35
|
const DEFAULT_QUERY_CACHE_SIZE = 1;
|
|
36
36
|
/**
|
|
37
37
|
* Creates an instance of `HierarchyProvider` that creates a hierarchy based on given iModel and
|
|
38
38
|
* a hierarchy definition, which defines each hierarchy level through ECSQL queries.
|
|
39
39
|
*
|
|
40
|
-
* @
|
|
40
|
+
* @public
|
|
41
41
|
*/
|
|
42
42
|
function createIModelHierarchyProvider(props) {
|
|
43
43
|
return new IModelHierarchyProviderImpl(props);
|
|
@@ -59,11 +59,11 @@ class IModelHierarchyProviderImpl {
|
|
|
59
59
|
this._activeHierarchyDefinition = this._sourceHierarchyDefinition = props.hierarchyDefinition;
|
|
60
60
|
this._valuesFormatter = props?.formatter ?? (0, presentation_shared_1.createDefaultValueFormatter)();
|
|
61
61
|
this._localizedStrings = { other: "Other", unspecified: "Not specified", ...props?.localizedStrings };
|
|
62
|
-
this._queryScheduler = new
|
|
62
|
+
this._queryScheduler = new SubscriptionScheduler_js_1.SubscriptionScheduler(props.queryConcurrency ?? DEFAULT_QUERY_CONCURRENCY);
|
|
63
63
|
this.setHierarchyFilter(props.filtering);
|
|
64
64
|
const queryCacheSize = props.queryCacheSize ?? DEFAULT_QUERY_CACHE_SIZE;
|
|
65
65
|
if (queryCacheSize !== 0) {
|
|
66
|
-
this._nodesCache = new
|
|
66
|
+
this._nodesCache = new HierarchyCache_js_1.HierarchyCache({
|
|
67
67
|
// we divide the size by 2, because each variation also counts as a query that we cache
|
|
68
68
|
size: Math.ceil(queryCacheSize / 2),
|
|
69
69
|
variationsCount: 1,
|
|
@@ -82,9 +82,9 @@ class IModelHierarchyProviderImpl {
|
|
|
82
82
|
return this._imodelChanged;
|
|
83
83
|
}
|
|
84
84
|
invalidateHierarchyCache(reason) {
|
|
85
|
-
(0,
|
|
85
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
86
86
|
category: `${LOGGING_NAMESPACE}.Events`,
|
|
87
|
-
message: /*
|
|
87
|
+
message: /* c8 ignore next */ () => (reason ? `${reason}: clear hierarchy cache` : `Clear hierarchy cache`),
|
|
88
88
|
});
|
|
89
89
|
this._nodesCache?.clear();
|
|
90
90
|
}
|
|
@@ -103,7 +103,7 @@ class IModelHierarchyProviderImpl {
|
|
|
103
103
|
}
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
this._activeHierarchyDefinition = new
|
|
106
|
+
this._activeHierarchyDefinition = new FilteringHierarchyDefinition_js_1.FilteringHierarchyDefinition({
|
|
107
107
|
imodelAccess: this._imodelAccess,
|
|
108
108
|
source: this._sourceHierarchyDefinition,
|
|
109
109
|
nodeIdentifierPaths: props.paths,
|
|
@@ -116,16 +116,16 @@ class IModelHierarchyProviderImpl {
|
|
|
116
116
|
}
|
|
117
117
|
createHierarchyLevelDefinitionsObservable(props) {
|
|
118
118
|
const { requestContext, ...defineHierarchyLevelProps } = props;
|
|
119
|
-
(0,
|
|
119
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
120
120
|
category: LOGGING_NAMESPACE_PERFORMANCE,
|
|
121
|
-
message: /*
|
|
121
|
+
message: /* c8 ignore next */ () => `[${requestContext.requestId}] Requesting hierarchy level definitions for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}`,
|
|
122
122
|
});
|
|
123
123
|
return (0, rxjs_1.from)((0, rxjs_1.defer)(async () => {
|
|
124
124
|
let parentNode = props.parentNode;
|
|
125
|
-
if (parentNode &&
|
|
125
|
+
if (parentNode && HierarchyNode_js_1.HierarchyNode.isGeneric(parentNode) && parentNode.key.source && parentNode.key.source !== this._imodelAccess.imodelKey) {
|
|
126
126
|
return [];
|
|
127
127
|
}
|
|
128
|
-
if (parentNode &&
|
|
128
|
+
if (parentNode && HierarchyNode_js_1.HierarchyNode.isInstancesNode(parentNode)) {
|
|
129
129
|
parentNode = {
|
|
130
130
|
...parentNode,
|
|
131
131
|
key: {
|
|
@@ -133,24 +133,24 @@ class IModelHierarchyProviderImpl {
|
|
|
133
133
|
instanceKeys: parentNode.key.instanceKeys.filter((ik) => !ik.imodelKey || ik.imodelKey === this._imodelAccess.imodelKey),
|
|
134
134
|
},
|
|
135
135
|
};
|
|
136
|
-
(0, core_bentley_1.assert)(
|
|
136
|
+
(0, core_bentley_1.assert)(HierarchyNodeKey_js_1.HierarchyNodeKey.isInstances(parentNode.key));
|
|
137
137
|
if (parentNode.key.instanceKeys.length === 0) {
|
|
138
138
|
return [];
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
return this._activeHierarchyDefinition.defineHierarchyLevel({ ...defineHierarchyLevelProps, parentNode });
|
|
142
|
-
})).pipe((0, rxjs_1.mergeAll)(), (0, rxjs_1.finalize)(() => (0,
|
|
142
|
+
})).pipe((0, rxjs_1.mergeAll)(), (0, rxjs_1.finalize)(() => (0, LoggingUtils_js_1.doLog)({
|
|
143
143
|
category: LOGGING_NAMESPACE_PERFORMANCE,
|
|
144
|
-
message: /*
|
|
144
|
+
message: /* c8 ignore next */ () => `[${requestContext.requestId}] Received all hierarchy level definitions for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}`,
|
|
145
145
|
})));
|
|
146
146
|
}
|
|
147
147
|
createSourceNodesObservable(props) {
|
|
148
148
|
// pipe definitions to nodes and put "share replay" on it
|
|
149
149
|
return this.createHierarchyLevelDefinitionsObservable(props).pipe((0, rxjs_1.mergeMap)((def) => {
|
|
150
|
-
if (
|
|
150
|
+
if (IModelHierarchyDefinition_js_1.HierarchyNodesDefinition.isGenericNode(def)) {
|
|
151
151
|
return (0, rxjs_1.of)({ ...def.node, key: { type: "generic", id: def.node.key, source: this._imodelAccess.imodelKey } });
|
|
152
152
|
}
|
|
153
|
-
return this._queryScheduler.scheduleSubscription((0, rxjs_1.of)(def.query).pipe((0, rxjs_1.map)((query) => filterQueryByInstanceKeys(query, props.filteredInstanceKeys)), (0, rxjs_1.mergeMap)((query) => (0,
|
|
153
|
+
return this._queryScheduler.scheduleSubscription((0, rxjs_1.of)(def.query).pipe((0, rxjs_1.map)((query) => filterQueryByInstanceKeys(query, props.filteredInstanceKeys)), (0, rxjs_1.mergeMap)((query) => (0, TreeNodesReader_js_1.readNodes)({
|
|
154
154
|
queryExecutor: this._imodelAccess,
|
|
155
155
|
query,
|
|
156
156
|
limit: props.hierarchyLevelSizeLimit,
|
|
@@ -161,10 +161,10 @@ class IModelHierarchyProviderImpl {
|
|
|
161
161
|
...node,
|
|
162
162
|
key: { ...node.key, instanceKeys: node.key.instanceKeys.map((key) => ({ ...key, imodelKey: this._imodelAccess.imodelKey })) },
|
|
163
163
|
}))));
|
|
164
|
-
}), (0, rxjs_1.finalize)(() => (0,
|
|
164
|
+
}), (0, rxjs_1.finalize)(() => (0, LoggingUtils_js_1.doLog)({
|
|
165
165
|
category: LOGGING_NAMESPACE_PERFORMANCE,
|
|
166
|
-
message: /*
|
|
167
|
-
})), (0,
|
|
166
|
+
message: /* c8 ignore next */ () => `[${props.requestContext.requestId}] Read all child nodes ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}`,
|
|
167
|
+
})), (0, ShareReplayWithErrors_js_1.shareReplayWithErrors)());
|
|
168
168
|
}
|
|
169
169
|
createPreProcessedNodesObservable(queryNodesObservable, props) {
|
|
170
170
|
return queryNodesObservable.pipe(
|
|
@@ -177,57 +177,56 @@ class IModelHierarchyProviderImpl {
|
|
|
177
177
|
// we have `ProcessedHierarchyNode` from here
|
|
178
178
|
preProcessNodes(this._activeHierarchyDefinition),
|
|
179
179
|
// process hiding
|
|
180
|
-
(0,
|
|
180
|
+
(0, HideIfNoChildren_js_1.createHideIfNoChildrenOperator)((n) => this.getChildNodesObservables({ parentNode: n, requestContext: props.requestContext }).hasNodes), (0, HideNodesInHierarchy_js_1.createHideNodesInHierarchyOperator)(
|
|
181
181
|
// note: for child nodes created because of hidden parent, we want to use parent's request props (instance filter, limit)
|
|
182
|
-
(n) => this.getChildNodesObservables({ ...props, parentNode: n }).processedNodes, false), (0, rxjs_1.finalize)(() => (0,
|
|
182
|
+
(n) => this.getChildNodesObservables({ ...props, parentNode: n }).processedNodes, false), (0, rxjs_1.finalize)(() => (0, LoggingUtils_js_1.doLog)({
|
|
183
183
|
category: LOGGING_NAMESPACE_PERFORMANCE,
|
|
184
|
-
message: /*
|
|
184
|
+
message: /* c8 ignore next */ () => `[${props.requestContext.requestId}] Finished pre-processing child nodes for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}`,
|
|
185
185
|
})));
|
|
186
186
|
}
|
|
187
187
|
createProcessedNodesObservable(preprocessedNodesObservable, props) {
|
|
188
|
-
return preprocessedNodesObservable.pipe((0,
|
|
188
|
+
return preprocessedNodesObservable.pipe((0, Grouping_js_1.createGroupingOperator)(this._imodelAccess, props.parentNode, this._valuesFormatter, this._localizedStrings, (gn) => this.onGroupingNodeCreated(gn, props)), (0, rxjs_1.finalize)(() => (0, LoggingUtils_js_1.doLog)({
|
|
189
189
|
category: LOGGING_NAMESPACE_PERFORMANCE,
|
|
190
|
-
message: /*
|
|
190
|
+
message: /* c8 ignore next */ () => `[${props.requestContext.requestId}] Finished grouping child nodes for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}`,
|
|
191
191
|
})));
|
|
192
192
|
}
|
|
193
193
|
createFinalizedNodesObservable(processedNodesObservable, props) {
|
|
194
|
-
return processedNodesObservable.pipe((0,
|
|
194
|
+
return processedNodesObservable.pipe((0, DetermineChildren_js_1.createDetermineChildrenOperator)((n) => this.getChildNodesObservables({ parentNode: n, requestContext: props.requestContext }).hasNodes), postProcessNodes(this._activeHierarchyDefinition), Sorting_js_1.sortNodesByLabelOperator, (0, rxjs_1.map)((n) => {
|
|
195
195
|
if ("processingParams" in n) {
|
|
196
196
|
delete n.processingParams;
|
|
197
197
|
}
|
|
198
198
|
return Object.assign(n, {
|
|
199
|
-
children: (0,
|
|
199
|
+
children: (0, Common_js_1.hasChildren)(n),
|
|
200
200
|
});
|
|
201
|
-
}), (0, rxjs_1.takeUntil)(this._dispose), (0, rxjs_1.finalize)(() => (0,
|
|
201
|
+
}), (0, rxjs_1.takeUntil)(this._dispose), (0, rxjs_1.finalize)(() => (0, LoggingUtils_js_1.doLog)({
|
|
202
202
|
category: LOGGING_NAMESPACE_PERFORMANCE,
|
|
203
|
-
message: /*
|
|
203
|
+
message: /* c8 ignore next */ () => `[${props.requestContext.requestId}] Finished finalizing child nodes for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}`,
|
|
204
204
|
})));
|
|
205
205
|
}
|
|
206
206
|
createHasNodesObservable(preprocessedNodesObservable, possiblyKnownChildrenObservable, props) {
|
|
207
207
|
const loggingCategory = `${LOGGING_NAMESPACE_INTERNAL}.HasNodes`;
|
|
208
|
-
return (0, rxjs_1.concat)((possiblyKnownChildrenObservable ?? rxjs_1.EMPTY).pipe((0, rxjs_1.filter)((n) => (0,
|
|
208
|
+
return (0, rxjs_1.concat)((possiblyKnownChildrenObservable ?? rxjs_1.EMPTY).pipe((0, rxjs_1.filter)((n) => (0, Common_js_1.hasChildren)(n))), preprocessedNodesObservable).pipe((0, LoggingUtils_js_1.log)({
|
|
209
209
|
category: loggingCategory,
|
|
210
|
-
message: /*
|
|
210
|
+
message: /* c8 ignore next */ (n) => `[${props.requestContext.requestId}] Node before mapping to 'true': ${(0, Common_js_1.createNodeIdentifierForLogging)(n)}`,
|
|
211
211
|
}), (0, rxjs_1.take)(1), (0, rxjs_1.map)(() => true), (0, rxjs_1.defaultIfEmpty)(false), (0, rxjs_1.catchError)((e) => {
|
|
212
|
-
(0,
|
|
212
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
213
213
|
category: loggingCategory,
|
|
214
|
-
message: /*
|
|
214
|
+
message: /* c8 ignore next */ () => `[${props.requestContext.requestId}] Error while determining children: ${e.message}`,
|
|
215
215
|
});
|
|
216
|
-
if (e instanceof
|
|
216
|
+
if (e instanceof HierarchyErrors_js_1.RowsLimitExceededError) {
|
|
217
217
|
return (0, rxjs_1.of)(true);
|
|
218
218
|
}
|
|
219
219
|
throw e;
|
|
220
|
-
}), (0,
|
|
220
|
+
}), (0, LoggingUtils_js_1.log)({ category: loggingCategory, message: /* c8 ignore next */ (r) => `[${props.requestContext.requestId}] Result: ${r}` }));
|
|
221
221
|
}
|
|
222
222
|
getCachedObservableEntry(props) {
|
|
223
223
|
const loggingCategory = `${LOGGING_NAMESPACE}.QueryResultsCache`;
|
|
224
224
|
const { parentNode, ...restProps } = props;
|
|
225
225
|
const cached = props.ignoreCache || !this._nodesCache ? undefined : this._nodesCache.get(props);
|
|
226
226
|
if (cached) {
|
|
227
|
-
|
|
228
|
-
(0, LoggingUtils_1.doLog)({
|
|
227
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
229
228
|
category: loggingCategory,
|
|
230
|
-
message: /*
|
|
229
|
+
message: /* c8 ignore next */ () => `[${props.requestContext.requestId}] Found query nodes observable for ${(0, Common_js_1.createNodeIdentifierForLogging)(parentNode)}`,
|
|
231
230
|
});
|
|
232
231
|
return cached;
|
|
233
232
|
}
|
|
@@ -236,13 +235,13 @@ class IModelHierarchyProviderImpl {
|
|
|
236
235
|
let filteredInstanceKeys;
|
|
237
236
|
let parentNonGroupingNode;
|
|
238
237
|
if (parentNode) {
|
|
239
|
-
if (
|
|
238
|
+
if (HierarchyNode_js_1.HierarchyNode.isGroupingNode(parentNode)) {
|
|
240
239
|
parentNonGroupingNode = parentNode.nonGroupingAncestor;
|
|
241
240
|
filteredInstanceKeys = parentNode.groupedInstanceKeys;
|
|
242
241
|
}
|
|
243
242
|
else {
|
|
244
243
|
// not sure why type checker doesn't pick this up
|
|
245
|
-
(0, core_bentley_1.assert)(
|
|
244
|
+
(0, core_bentley_1.assert)(HierarchyNode_js_1.HierarchyNode.isGeneric(parentNode) || HierarchyNode_js_1.HierarchyNode.isInstancesNode(parentNode));
|
|
246
245
|
parentNonGroupingNode = parentNode;
|
|
247
246
|
}
|
|
248
247
|
}
|
|
@@ -253,9 +252,9 @@ class IModelHierarchyProviderImpl {
|
|
|
253
252
|
};
|
|
254
253
|
const value = { observable: this.createSourceNodesObservable(nonGroupingNodeChildrenRequestProps), processingStatus: "none" };
|
|
255
254
|
this._nodesCache?.set(nonGroupingNodeChildrenRequestProps, value);
|
|
256
|
-
(0,
|
|
255
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
257
256
|
category: loggingCategory,
|
|
258
|
-
message: /*
|
|
257
|
+
message: /* c8 ignore next */ () => `[${props.requestContext.requestId}] Saved query nodes observable for ${(0, Common_js_1.createNodeIdentifierForLogging)(parentNode)}`,
|
|
259
258
|
});
|
|
260
259
|
return value;
|
|
261
260
|
}
|
|
@@ -290,38 +289,39 @@ class IModelHierarchyProviderImpl {
|
|
|
290
289
|
const timer = new core_bentley_1.StopWatch(undefined, true);
|
|
291
290
|
let error;
|
|
292
291
|
let nodesCount = 0;
|
|
293
|
-
(0,
|
|
292
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
294
293
|
category: loggingCategory,
|
|
295
|
-
message: /*
|
|
294
|
+
message: /* c8 ignore next */ () => `[${requestContext.requestId}] Requesting child nodes for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}`,
|
|
296
295
|
});
|
|
297
|
-
return (0,
|
|
296
|
+
return (0, EachValueFrom_js_1.eachValueFrom)(this.getChildNodesObservables({ ...props, requestContext }).finalizedNodes.pipe((0, rxjs_1.tap)(() => ++nodesCount), (0, rxjs_1.catchError)((e) => {
|
|
298
297
|
error = e;
|
|
299
298
|
throw e;
|
|
300
299
|
}), (0, rxjs_1.finalize)(() => {
|
|
301
|
-
(0,
|
|
300
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
302
301
|
category: loggingCategory,
|
|
303
|
-
message: /*
|
|
304
|
-
|
|
305
|
-
|
|
302
|
+
message: /* c8 ignore next */ () =>
|
|
303
|
+
/* c8 ignore next 3 */ error
|
|
304
|
+
? `[${requestContext.requestId}] Error creating child nodes for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}: ${error instanceof Error ? error.message : error.toString()}`
|
|
305
|
+
: `[${requestContext.requestId}] Returned ${nodesCount} child nodes for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)} in ${timer.currentSeconds.toFixed(2)} s.`,
|
|
306
306
|
});
|
|
307
307
|
})));
|
|
308
308
|
}
|
|
309
309
|
getNodeInstanceKeysObs(props) {
|
|
310
310
|
const { parentNode, instanceFilter, hierarchyLevelSizeLimit = "unbounded", requestContext } = props;
|
|
311
|
-
if (parentNode &&
|
|
311
|
+
if (parentNode && HierarchyNode_js_1.HierarchyNode.isGroupingNode(parentNode)) {
|
|
312
312
|
return (0, rxjs_1.from)(parentNode.groupedInstanceKeys);
|
|
313
313
|
}
|
|
314
|
-
(0, core_bentley_1.assert)(!parentNode ||
|
|
314
|
+
(0, core_bentley_1.assert)(!parentNode || HierarchyNode_js_1.HierarchyNode.isGeneric(parentNode) || HierarchyNode_js_1.HierarchyNode.isInstancesNode(parentNode));
|
|
315
315
|
const hierarchyLevelDefinitions = this.createHierarchyLevelDefinitionsObservable({ parentNode, instanceFilter, requestContext });
|
|
316
316
|
// split the definitions based on whether they're for generic nodes or for instance nodes
|
|
317
|
-
const [genericDefs, instanceDefs] = (0,
|
|
317
|
+
const [genericDefs, instanceDefs] = (0, Partition_js_1.partition)(hierarchyLevelDefinitions, IModelHierarchyDefinition_js_1.HierarchyNodesDefinition.isGenericNode);
|
|
318
318
|
// query instance keys and a flag whether they should be hidden
|
|
319
319
|
const instanceKeys = instanceDefs.pipe((0, rxjs_1.mergeMap)((def) => this._queryScheduler.scheduleSubscription((0, rxjs_1.of)(def.query).pipe((0, rxjs_1.mergeMap)(async (query) => {
|
|
320
320
|
const ecsql = `
|
|
321
321
|
SELECT
|
|
322
|
-
${
|
|
323
|
-
${
|
|
324
|
-
${
|
|
322
|
+
${NodeSelectQueryFactory_js_1.NodeSelectClauseColumnNames.FullClassName},
|
|
323
|
+
${NodeSelectQueryFactory_js_1.NodeSelectClauseColumnNames.ECInstanceId},
|
|
324
|
+
${NodeSelectQueryFactory_js_1.NodeSelectClauseColumnNames.HideNodeInHierarchy}
|
|
325
325
|
FROM (
|
|
326
326
|
${query.ecsql}
|
|
327
327
|
)
|
|
@@ -337,7 +337,7 @@ class IModelHierarchyProviderImpl {
|
|
|
337
337
|
})));
|
|
338
338
|
}), (0, rxjs_1.mergeAll)()))));
|
|
339
339
|
// split the instance keys observable based on whether they should be hidden or not
|
|
340
|
-
const [visibleNodeInstanceKeys, hiddenNodeInstanceKeys] = (0,
|
|
340
|
+
const [visibleNodeInstanceKeys, hiddenNodeInstanceKeys] = (0, Partition_js_1.partition)(instanceKeys, ({ hide }) => !hide);
|
|
341
341
|
// hidden items' handling:
|
|
342
342
|
// - if a generic node is hidden, we'll want to retrieve instance keys of its children, otherwise we don't care about it,
|
|
343
343
|
// - if an instance key is hidden, we want to create a merged node similar to what we do in `createHideNodesInHierarchyOperator`
|
|
@@ -347,7 +347,7 @@ class IModelHierarchyProviderImpl {
|
|
|
347
347
|
source: this._imodelAccess.imodelKey,
|
|
348
348
|
}))), hiddenNodeInstanceKeys.pipe(
|
|
349
349
|
// first merge all keys by class
|
|
350
|
-
(0,
|
|
350
|
+
(0, ReduceToMergeMap_js_1.reduceToMergeMapList)(({ key }) => key.className, ({ key }) => key.id),
|
|
351
351
|
// then, for each class, create an instance key
|
|
352
352
|
(0, rxjs_1.mergeMap)((mergedMap) => [...mergedMap.entries()].map(([className, ids]) => ({
|
|
353
353
|
type: "instances",
|
|
@@ -368,21 +368,22 @@ class IModelHierarchyProviderImpl {
|
|
|
368
368
|
const requestContext = { requestId: core_bentley_1.Guid.createValue() };
|
|
369
369
|
const loggingCategory = `${LOGGING_NAMESPACE}.GetNodeInstanceKeys`;
|
|
370
370
|
const timer = new core_bentley_1.StopWatch(undefined, true);
|
|
371
|
-
(0,
|
|
371
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
372
372
|
category: loggingCategory,
|
|
373
|
-
message: /*
|
|
373
|
+
message: /* c8 ignore next */ () => `[${requestContext.requestId}] Requesting keys for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}`,
|
|
374
374
|
});
|
|
375
375
|
let error;
|
|
376
376
|
let keysCount = 0;
|
|
377
|
-
return (0,
|
|
377
|
+
return (0, EachValueFrom_js_1.eachValueFrom)(this.getNodeInstanceKeysObs({ ...props, requestContext }).pipe((0, rxjs_1.tap)(() => ++keysCount), (0, rxjs_1.catchError)((e) => {
|
|
378
378
|
error = e;
|
|
379
379
|
throw e;
|
|
380
380
|
}), (0, rxjs_1.finalize)(() => {
|
|
381
|
-
(0,
|
|
381
|
+
(0, LoggingUtils_js_1.doLog)({
|
|
382
382
|
category: loggingCategory,
|
|
383
|
-
message: /*
|
|
384
|
-
|
|
385
|
-
|
|
383
|
+
message: /* c8 ignore next */ () =>
|
|
384
|
+
/* c8 ignore next 3 */ error
|
|
385
|
+
? `[${requestContext.requestId}] Error creating node instance keys for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)}: ${error instanceof Error ? error.message : error.toString()}`
|
|
386
|
+
: `[${requestContext.requestId}] Returned ${keysCount} instance keys for ${(0, Common_js_1.createNodeIdentifierForLogging)(props.parentNode)} in ${timer.currentSeconds.toFixed(2)} s.`,
|
|
386
387
|
});
|
|
387
388
|
})));
|
|
388
389
|
}
|
|
@@ -420,7 +421,6 @@ function filterQueryByInstanceKeys(query, filteredInstanceKeys) {
|
|
|
420
421
|
return query;
|
|
421
422
|
}
|
|
422
423
|
const MAX_ALLOWED_BINDINGS = 1000;
|
|
423
|
-
// istanbul ignore else
|
|
424
424
|
if (filteredInstanceKeys.length < MAX_ALLOWED_BINDINGS) {
|
|
425
425
|
return {
|
|
426
426
|
...query,
|
|
@@ -432,7 +432,7 @@ function filterQueryByInstanceKeys(query, filteredInstanceKeys) {
|
|
|
432
432
|
bindings: [...(query.bindings ?? []), ...filteredInstanceKeys.map((k) => ({ type: "id", value: k.id }))],
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
|
-
|
|
435
|
+
/* c8 ignore start */
|
|
436
436
|
return {
|
|
437
437
|
...query,
|
|
438
438
|
ecsql: `
|
|
@@ -442,5 +442,6 @@ function filterQueryByInstanceKeys(query, filteredInstanceKeys) {
|
|
|
442
442
|
`,
|
|
443
443
|
bindings: [...(query.bindings ?? []), { type: "idset", value: filteredInstanceKeys.map((k) => k.id) }],
|
|
444
444
|
};
|
|
445
|
+
/* c8 ignore end */
|
|
445
446
|
}
|
|
446
447
|
//# sourceMappingURL=IModelHierarchyProvider.js.map
|