@itwin/presentation-hierarchies 1.1.0 → 1.2.1
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 +23 -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/package.json +1 -0
- 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":"FilteringHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/FilteringHierarchyDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAwWhG,4DAyCC;AA9YD,8DAAqH;AACrH,oDAA+D;AAC/D,wEAAqE;AAErE,2EAWqC;AACrC,+DAAiJ;AACjJ,uDAAuD;AAQvD,gBAAgB;AAChB,MAAa,4BAA4B;IAC/B,aAAa,CAAoD;IACjE,OAAO,CAAsB;IAC7B,oBAAoB,CAA2B;IAEvD,YAAmB,KAAwC;QACzD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,mBAAmB,CAAC;IACxD,CAAC;IAED,IAAW,cAAc;QACvB,OAAO,KAAK,EAAE,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D,KAAK,EAAE;;;qCAGwB,wCAAgC;0CAC3B,6CAAqC;YACnE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,iDAAyC;4CACpD,4CAAoC;sCAC1C,yCAAiC;;YAE3D,GAAG,CAAC,KAAK,CAAC,KAAK;;UAEjB,uBAAuB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;OACzC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ECClassHierarchyInspector, InstanceKey } from \"@itwin/presentation-shared\";\nimport { extractFilteringProps, HierarchyFilteringPath, HierarchyFilteringPathOptions } from \"../HierarchyFiltering\";\nimport { HierarchyNodeFilteringProps } from \"../HierarchyNode\";\nimport { HierarchyNodeIdentifier } from \"../HierarchyNodeIdentifier\";\nimport { GenericNodeKey } from \"../HierarchyNodeKey\";\nimport {\n DefineHierarchyLevelProps,\n GenericHierarchyNodeDefinition,\n HierarchyDefinition,\n HierarchyDefinitionParentNode,\n HierarchyLevelDefinition,\n HierarchyNodesDefinition,\n InstanceNodesQueryDefinition,\n NodeParser,\n NodePostProcessor,\n NodePreProcessor,\n} from \"./IModelHierarchyDefinition\";\nimport { ProcessedGroupingHierarchyNode, ProcessedHierarchyNode, SourceHierarchyNode, SourceInstanceHierarchyNode } from \"./IModelHierarchyNode\";\nimport { defaultNodesParser } from \"./TreeNodesReader\";\n\ninterface FilteringHierarchyDefinitionProps {\n imodelAccess: ECClassHierarchyInspector & { imodelKey: string };\n source: HierarchyDefinition;\n nodeIdentifierPaths: HierarchyFilteringPath[];\n}\n\n/** @internal */\nexport class FilteringHierarchyDefinition implements HierarchyDefinition {\n private _imodelAccess: ECClassHierarchyInspector & { imodelKey: string };\n private _source: HierarchyDefinition;\n private _nodeIdentifierPaths: HierarchyFilteringPath[];\n\n public constructor(props: FilteringHierarchyDefinitionProps) {\n this._imodelAccess = props.imodelAccess;\n this._source = props.source;\n this._nodeIdentifierPaths = props.nodeIdentifierPaths;\n }\n\n public get preProcessNode(): NodePreProcessor {\n return async (node) => {\n const processedNode = this._source.preProcessNode ? await this._source.preProcessNode(node) : node;\n if (processedNode?.processingParams?.hideInHierarchy && processedNode.filtering?.isFilterTarget && !processedNode.filtering.hasFilterTargetAncestor) {\n // we want to hide target nodes if they have `hideInHierarchy` param, but only if they're not under another filter target\n return undefined;\n }\n return processedNode;\n };\n }\n\n private shouldExpandGroupingNode(node: ProcessedGroupingHierarchyNode) {\n for (const child of node.children) {\n // istanbul ignore next\n if (!child.filtering) {\n continue;\n }\n\n if (child.filtering.isFilterTarget) {\n const childAutoExpand = child.filtering.filterTargetOptions?.autoExpand;\n\n // If child is a filter target and is has no `autoExpand` flag, then it's always to be expanded.\n if (childAutoExpand === true) {\n return true;\n }\n\n // If it's not an object and not `true`, then it's falsy - continue looking\n if (typeof childAutoExpand !== \"object\") {\n continue;\n }\n\n // If grouping node's child has `autoExpandUntil` flag,\n // auto-expand the grouping node only if it's depth is lower than that of the grouping node in associated with the target.\n const nodeDepth = node.parentKeys.length;\n const filterTargetDepth = childAutoExpand.depth;\n if (nodeDepth < filterTargetDepth) {\n return true;\n }\n }\n\n if (!child.filtering.filteredChildrenIdentifierPaths) {\n // istanbul ignore next\n continue;\n }\n\n for (const path of child.filtering.filteredChildrenIdentifierPaths) {\n if (\"path\" in path && path.options?.autoExpand) {\n return true;\n }\n }\n }\n return false;\n }\n\n public get postProcessNode(): NodePostProcessor {\n return async (node: ProcessedHierarchyNode) => {\n const processedNode = this._source.postProcessNode ? await this._source.postProcessNode(node) : node;\n // instance nodes get the auto-expand flag in `parseNode`, but grouping ones need to be handled during post-processing\n if (ProcessedHierarchyNode.isGroupingNode(node) && this.shouldExpandGroupingNode(node)) {\n Object.assign(processedNode, { autoExpand: true });\n }\n return processedNode;\n };\n }\n\n public get parseNode(): NodeParser {\n return async (row: { [columnName: string]: any }, parentNode?: HierarchyDefinitionParentNode): Promise<SourceInstanceHierarchyNode> => {\n const hasFilterTargetAncestor: boolean = !!row[ECSQL_COLUMN_NAME_HasFilterTargetAncestor];\n const isFilterTarget: boolean = !!row[ECSQL_COLUMN_NAME_IsFilterTarget];\n const filterTargetOptions: HierarchyFilteringPathOptions | undefined = row[ECSQL_COLUMN_NAME_FilterTargetOptions]\n ? JSON.parse(row[ECSQL_COLUMN_NAME_FilterTargetOptions])\n : undefined;\n\n const filteredChildrenIdentifierPaths =\n row[ECSQL_COLUMN_NAME_FilterECInstanceId] && row[ECSQL_COLUMN_NAME_FilterClassName]\n ? await this.getChildrenIdentifierPaths(parentNode?.filtering?.filteredChildrenIdentifierPaths ?? this._nodeIdentifierPaths, {\n className: row[ECSQL_COLUMN_NAME_FilterClassName],\n id: row[ECSQL_COLUMN_NAME_FilterECInstanceId],\n })\n : [];\n\n const defaultNode = await (this._source.parseNode ?? defaultNodesParser)(row);\n return applyFilterAttributes({\n node: defaultNode,\n filteredChildrenIdentifierPaths,\n isFilterTarget,\n filterTargetOptions,\n hasFilterTargetAncestor,\n });\n };\n }\n\n private async getChildrenIdentifierPaths(filteredChildrenNodeIdentifierPaths: HierarchyFilteringPath[], providedIdentifier: InstanceKey) {\n const { id, className } = providedIdentifier;\n\n let filteredChildrenIdentifierPaths: HierarchyFilteringPath[] | undefined;\n for (const filteredChildrenNodeIdentifierPath of filteredChildrenNodeIdentifierPaths) {\n const path = HierarchyFilteringPath.normalize(filteredChildrenNodeIdentifierPath);\n // istanbul ignore if\n if (path.path.length === 0) {\n continue;\n }\n\n // We need to check if identifiers have the same id and imodelKey and are\n // of the same class / derived class / is derived from class\n const identifier = path.path[0];\n if (identifier.id !== id) {\n continue;\n }\n if (HierarchyNodeIdentifier.isInstanceNodeIdentifier(identifier)) {\n if (identifier.imodelKey && identifier.imodelKey !== this._imodelAccess.imodelKey) {\n continue;\n }\n if (\n identifier.className !== className &&\n !(await this._imodelAccess.classDerivesFrom(identifier.className, className)) &&\n !(await this._imodelAccess.classDerivesFrom(className, identifier.className))\n ) {\n continue;\n }\n }\n if (!filteredChildrenIdentifierPaths) {\n filteredChildrenIdentifierPaths = [];\n }\n if (path.path.length > 1) {\n filteredChildrenIdentifierPaths.push(path.options ? { path: path.path.slice(1), options: path.options } : path.path.slice(1));\n }\n }\n return filteredChildrenIdentifierPaths;\n }\n\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const sourceDefinitions = await this._source.defineHierarchyLevel(props);\n const filteringProps = extractFilteringProps(this._nodeIdentifierPaths, props.parentNode);\n if (!filteringProps) {\n return sourceDefinitions;\n }\n\n const filteredDefinitions: HierarchyLevelDefinition = [];\n await Promise.all(\n sourceDefinitions.map(async (definition) => {\n let matchedDefinition: HierarchyNodesDefinition | undefined;\n if (HierarchyNodesDefinition.isGenericNode(definition)) {\n matchedDefinition = await matchFilters<GenericNodeKey>(\n definition,\n filteringProps,\n async (id) => {\n return (\n HierarchyNodeIdentifier.isGenericNodeIdentifier(id) &&\n (!id.source || id.source === this._imodelAccess.imodelKey) &&\n id.id === definition.node.key\n );\n },\n this._imodelAccess,\n (def, matchingFilters) => {\n const filteredChildrenIdentifierPaths = matchingFilters.reduce(\n (r, c) => [...r, ...c.childrenIdentifierPaths],\n new Array<HierarchyFilteringPath>(),\n );\n return {\n ...def,\n node: applyFilterAttributes({\n node: def.node,\n filteredChildrenIdentifierPaths,\n isFilterTarget: matchingFilters.some((mc) => mc.isFilterTarget),\n hasFilterTargetAncestor: filteringProps.hasFilterTargetAncestor,\n }),\n };\n },\n );\n } else {\n matchedDefinition = await matchFilters<InstanceKey>(\n definition,\n filteringProps,\n async (id) => {\n return (\n HierarchyNodeIdentifier.isInstanceNodeIdentifier(id) &&\n (!id.imodelKey || id.imodelKey === this._imodelAccess.imodelKey) &&\n (await this._imodelAccess.classDerivesFrom(id.className, definition.fullClassName))\n );\n },\n this._imodelAccess,\n (def, matchingFilters) => applyECInstanceIdsFilter(def, matchingFilters, !!filteringProps.hasFilterTargetAncestor),\n false,\n );\n }\n if (matchedDefinition) {\n filteredDefinitions.push(matchedDefinition);\n }\n }),\n );\n return filteredDefinitions;\n }\n}\n\ntype MatchedFilter<TIdentifier extends HierarchyNodeIdentifier> = {\n id: TIdentifier;\n childrenIdentifierPaths: HierarchyFilteringPath[];\n} & ({ isFilterTarget: false } | { isFilterTarget: true; filterTargetOptions?: HierarchyFilteringPathOptions });\n\nasync function matchFilters<\n TIdentifier extends HierarchyNodeIdentifier,\n TDefinition = TIdentifier extends InstanceKey ? InstanceNodesQueryDefinition : GenericHierarchyNodeDefinition,\n>(\n definition: TDefinition,\n filteringProps: { filteredNodePaths: HierarchyFilteringPath[]; hasFilterTargetAncestor?: boolean },\n predicate: (id: HierarchyNodeIdentifier) => Promise<boolean>,\n classHierarchy: ECClassHierarchyInspector,\n matchedDefinitionProcessor: (def: TDefinition, matchingFilters: Array<MatchedFilter<TIdentifier>>) => TDefinition,\n extractChildrenIdentifierPaths: boolean = true,\n): Promise<TDefinition | undefined> {\n const { filteredNodePaths, hasFilterTargetAncestor } = filteringProps;\n const matchingFilters: Array<MatchedFilter<TIdentifier>> = [];\n for (const filteredNodePath of filteredNodePaths) {\n const { path, options } = HierarchyFilteringPath.normalize(filteredNodePath);\n if (path.length === 0) {\n continue;\n }\n const nodeId = path[0];\n if (await predicate(nodeId)) {\n let entry = await findMatchingFilterEntry(matchingFilters, nodeId, classHierarchy);\n if (!entry) {\n entry = {\n // ideally, `predicate` would act as a type guard to guarantee that `id` is `TIdentifier`, but at the moment\n // async type guards aren't supported\n id: nodeId as TIdentifier,\n childrenIdentifierPaths: [],\n isFilterTarget: false,\n };\n matchingFilters.push(entry);\n }\n\n if (path.length > 1) {\n if (extractChildrenIdentifierPaths) {\n entry.childrenIdentifierPaths.push(options ? { path: path.slice(1), options } : path.slice(1));\n }\n } else if (entry.isFilterTarget) {\n entry.filterTargetOptions = HierarchyFilteringPath.mergeOptions(entry.filterTargetOptions, options);\n } else {\n Object.assign(entry, { isFilterTarget: true, filterTargetOptions: options });\n }\n }\n }\n if (hasFilterTargetAncestor || matchingFilters.length > 0) {\n return matchedDefinitionProcessor(definition, matchingFilters);\n }\n return undefined;\n}\n\nasync function findMatchingFilterEntry<TEntry extends { id: TIdentifier }, TIdentifier extends HierarchyNodeIdentifier>(\n filters: TEntry[],\n nodeId: TIdentifier,\n classHierarchy: ECClassHierarchyInspector,\n): Promise<TEntry | undefined> {\n for (const filter of filters) {\n if (await identifiersEqual(filter.id, nodeId, classHierarchy)) {\n return filter;\n }\n }\n return undefined;\n}\n\nasync function identifiersEqual<TIdentifier extends HierarchyNodeIdentifier>(lhs: TIdentifier, rhs: TIdentifier, classHierarchy: ECClassHierarchyInspector) {\n if (HierarchyNodeIdentifier.isInstanceNodeIdentifier(lhs) && HierarchyNodeIdentifier.isInstanceNodeIdentifier(rhs)) {\n return (\n lhs.id === rhs.id &&\n (lhs.className === rhs.className ||\n (await classHierarchy.classDerivesFrom(lhs.className, rhs.className)) ||\n (await classHierarchy.classDerivesFrom(rhs.className, lhs.className)))\n );\n }\n return HierarchyNodeIdentifier.equal(lhs, rhs);\n}\n\nfunction applyFilterAttributes<TNode extends SourceHierarchyNode>(props: {\n node: TNode;\n filteredChildrenIdentifierPaths: HierarchyFilteringPath[] | undefined;\n isFilterTarget?: boolean;\n filterTargetOptions?: HierarchyFilteringPathOptions;\n hasFilterTargetAncestor: boolean;\n}): TNode {\n const { node, filteredChildrenIdentifierPaths } = props;\n const result = { ...node };\n\n const shouldAutoExpand = !!filteredChildrenIdentifierPaths?.some((childPath) => {\n return !!HierarchyFilteringPath.normalize(childPath).options?.autoExpand;\n });\n if (shouldAutoExpand) {\n result.autoExpand = true;\n }\n\n const filteringProps = HierarchyNodeFilteringProps.create(props);\n if (filteringProps) {\n result.filtering = filteringProps;\n }\n\n return result;\n}\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ECSQL_COLUMN_NAME_IsFilterTarget = \"IsFilterTarget\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ECSQL_COLUMN_NAME_FilterTargetOptions = \"FilterTargetOptions\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ECSQL_COLUMN_NAME_HasFilterTargetAncestor = \"HasFilterTargetAncestor\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ECSQL_COLUMN_NAME_FilterECInstanceId = \"FilterECInstanceId\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ECSQL_COLUMN_NAME_FilterClassName = \"FilterClassName\";\n\n/** @internal */\nexport function applyECInstanceIdsFilter(\n def: InstanceNodesQueryDefinition,\n matchingFilters: Array<MatchedFilter<InstanceKey>>,\n hasFilterTargetAncestor: boolean,\n): InstanceNodesQueryDefinition {\n if (matchingFilters.length === 0) {\n return def;\n }\n return {\n ...def,\n query: {\n ...def.query,\n ctes: [\n ...(def.query.ctes ?? []),\n // note: generally we'd use `VALUES (1,1),(2,2)`, but that doesn't work in ECSQL (https://github.com/iTwin/itwinjs-backlog/issues/865),\n // so using UNION as a workaround\n `FilteringInfo(ECInstanceId, IsFilterTarget, FilterTargetOptions, FilterClassName) AS (\n ${matchingFilters\n .map((mc) =>\n mc.isFilterTarget\n ? `VALUES (${mc.id.id}, 1, ${mc.filterTargetOptions ? `'${JSON.stringify(mc.filterTargetOptions)}'` : \"CAST(NULL AS TEXT)\"}, '${mc.id.className}')`\n : `VALUES (${mc.id.id}, 0, CAST(NULL AS TEXT), '${mc.id.className}')`,\n )\n .join(\" UNION ALL \")}\n )`,\n ],\n ecsql: `\n SELECT\n [q].*,\n [f].[IsFilterTarget] AS [${ECSQL_COLUMN_NAME_IsFilterTarget}],\n [f].[FilterTargetOptions] AS [${ECSQL_COLUMN_NAME_FilterTargetOptions}],\n ${hasFilterTargetAncestor ? \"1\" : \"0\"} AS [${ECSQL_COLUMN_NAME_HasFilterTargetAncestor}],\n IdToHex([f].[ECInstanceId]) AS [${ECSQL_COLUMN_NAME_FilterECInstanceId}],\n [f].[FilterClassName] AS [${ECSQL_COLUMN_NAME_FilterClassName}]\n FROM (\n ${def.query.ecsql}\n ) [q]\n ${hasFilterTargetAncestor ? \"LEFT \" : \"\"} JOIN FilteringInfo [f] ON [f].[ECInstanceId] = [q].[ECInstanceId]\n `,\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FilteringHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/FilteringHierarchyDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAoXhG,4DAwCC;AAxZD,oEAAwH;AACxH,0DAAkE;AAClE,8EAAwE;AAExE,iFAWwC;AACxC,qEAAoJ;AACpJ,6DAA0D;AAQ1D,gBAAgB;AAChB,MAAa,4BAA4B;IAC/B,aAAa,CAAoD;IACjE,OAAO,CAAsB;IAC7B,oBAAoB,CAA2B;IAEvD,YAAmB,KAAwC;QACzD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,mBAAmB,CAAC;IACxD,CAAC;IAED,IAAW,cAAc;QACvB,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACnG,IAAI,aAAa,EAAE,gBAAgB,EAAE,eAAe,IAAI,aAAa,CAAC,SAAS,EAAE,cAAc,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,uBAAuB,EAAE,CAAC;gBACpJ,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,CAAC,EAAE,EAAE,CAAC;wCACN,SAAS;uBAC1B,SAAS;yCACS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;eAClD,CACF;qBACA,IAAI,CAAC,aAAa,CAAC;UACtB;aACH;YACD,KAAK,EAAE;;;YAGD,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,iDAAyC;4CACpD,4CAAoC;sCAC1C,yCAAiC;;YAE3D,GAAG,CAAC,KAAK,CAAC,KAAK;;UAEjB,uBAAuB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;OACzC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { ECClassHierarchyInspector, InstanceKey } from \"@itwin/presentation-shared\";\nimport { extractFilteringProps, HierarchyFilteringPath, HierarchyFilteringPathOptions } from \"../HierarchyFiltering.js\";\nimport { HierarchyNodeFilteringProps } from \"../HierarchyNode.js\";\nimport { HierarchyNodeIdentifier } from \"../HierarchyNodeIdentifier.js\";\nimport { GenericNodeKey } from \"../HierarchyNodeKey.js\";\nimport {\n DefineHierarchyLevelProps,\n GenericHierarchyNodeDefinition,\n HierarchyDefinition,\n HierarchyDefinitionParentNode,\n HierarchyLevelDefinition,\n HierarchyNodesDefinition,\n InstanceNodesQueryDefinition,\n NodeParser,\n NodePostProcessor,\n NodePreProcessor,\n} from \"./IModelHierarchyDefinition.js\";\nimport { ProcessedGroupingHierarchyNode, ProcessedHierarchyNode, SourceHierarchyNode, SourceInstanceHierarchyNode } from \"./IModelHierarchyNode.js\";\nimport { defaultNodesParser } from \"./TreeNodesReader.js\";\n\ninterface FilteringHierarchyDefinitionProps {\n imodelAccess: ECClassHierarchyInspector & { imodelKey: string };\n source: HierarchyDefinition;\n nodeIdentifierPaths: HierarchyFilteringPath[];\n}\n\n/** @internal */\nexport class FilteringHierarchyDefinition implements HierarchyDefinition {\n private _imodelAccess: ECClassHierarchyInspector & { imodelKey: string };\n private _source: HierarchyDefinition;\n private _nodeIdentifierPaths: HierarchyFilteringPath[];\n\n public constructor(props: FilteringHierarchyDefinitionProps) {\n this._imodelAccess = props.imodelAccess;\n this._source = props.source;\n this._nodeIdentifierPaths = props.nodeIdentifierPaths;\n }\n\n public get preProcessNode(): NodePreProcessor {\n return async (node) => {\n const processedNode = this._source.preProcessNode ? await this._source.preProcessNode(node) : node;\n if (processedNode?.processingParams?.hideInHierarchy && processedNode.filtering?.isFilterTarget && !processedNode.filtering.hasFilterTargetAncestor) {\n // we want to hide target nodes if they have `hideInHierarchy` param, but only if they're not under another filter target\n return undefined;\n }\n return processedNode;\n };\n }\n\n private shouldExpandGroupingNode(node: ProcessedGroupingHierarchyNode) {\n for (const child of node.children) {\n /* c8 ignore next 3 */\n if (!child.filtering) {\n continue;\n }\n\n if (child.filtering.isFilterTarget) {\n const childAutoExpand = child.filtering.filterTargetOptions?.autoExpand;\n\n // If child is a filter target and is has no `autoExpand` flag, then it's always to be expanded.\n if (childAutoExpand === true) {\n return true;\n }\n\n // If it's not an object and not `true`, then it's falsy - continue looking\n if (typeof childAutoExpand !== \"object\") {\n continue;\n }\n\n // If grouping node's child has `autoExpandUntil` flag,\n // auto-expand the grouping node only if it's depth is lower than that of the grouping node in associated with the target.\n const nodeDepth = node.parentKeys.length;\n const filterTargetDepth = childAutoExpand.depth;\n if (nodeDepth < filterTargetDepth) {\n return true;\n }\n }\n\n if (!child.filtering.filteredChildrenIdentifierPaths) {\n /* c8 ignore next */\n continue;\n }\n\n for (const path of child.filtering.filteredChildrenIdentifierPaths) {\n if (\"path\" in path && path.options?.autoExpand) {\n return true;\n }\n }\n }\n return false;\n }\n\n public get postProcessNode(): NodePostProcessor {\n return async (node: ProcessedHierarchyNode) => {\n const processedNode = this._source.postProcessNode ? await this._source.postProcessNode(node) : node;\n // instance nodes get the auto-expand flag in `parseNode`, but grouping ones need to be handled during post-processing\n if (ProcessedHierarchyNode.isGroupingNode(node) && this.shouldExpandGroupingNode(node)) {\n Object.assign(processedNode, { autoExpand: true });\n }\n return processedNode;\n };\n }\n\n public get parseNode(): NodeParser {\n return async (row: { [columnName: string]: any }, parentNode?: HierarchyDefinitionParentNode): Promise<SourceInstanceHierarchyNode> => {\n const hasFilterTargetAncestor: boolean = !!row[ECSQL_COLUMN_NAME_HasFilterTargetAncestor];\n\n const { filteredChildrenIdentifierPaths, filterTargetOptions, isFilterTarget } =\n row[ECSQL_COLUMN_NAME_FilterECInstanceId] && row[ECSQL_COLUMN_NAME_FilterClassName]\n ? await this.getChildrenIdentifierPaths(parentNode?.filtering?.filteredChildrenIdentifierPaths ?? this._nodeIdentifierPaths, {\n className: row[ECSQL_COLUMN_NAME_FilterClassName],\n id: row[ECSQL_COLUMN_NAME_FilterECInstanceId],\n })\n : { filteredChildrenIdentifierPaths: [], filterTargetOptions: undefined, isFilterTarget: false };\n\n const defaultNode = await (this._source.parseNode ?? defaultNodesParser)(row);\n return applyFilterAttributes({\n node: defaultNode,\n filteredChildrenIdentifierPaths,\n isFilterTarget,\n filterTargetOptions,\n hasFilterTargetAncestor,\n });\n };\n }\n\n private async getChildrenIdentifierPaths(filteredChildrenNodeIdentifierPaths: HierarchyFilteringPath[], providedIdentifier: InstanceKey) {\n const { id, className } = providedIdentifier;\n\n let filteredChildrenIdentifierPaths: HierarchyFilteringPath[] | undefined;\n let isFilterTarget = false;\n let filterTargetOptions: HierarchyFilteringPathOptions | undefined;\n for (const filteredChildrenNodeIdentifierPath of filteredChildrenNodeIdentifierPaths) {\n const { path, options } = HierarchyFilteringPath.normalize(filteredChildrenNodeIdentifierPath);\n /* c8 ignore next 3 */\n if (path.length === 0) {\n continue;\n }\n\n // We need to check if identifiers have the same id and imodelKey and are\n // of the same class / derived class / is derived from class\n const identifier = path[0];\n if (identifier.id !== id) {\n continue;\n }\n if (HierarchyNodeIdentifier.isInstanceNodeIdentifier(identifier)) {\n if (identifier.imodelKey && identifier.imodelKey !== this._imodelAccess.imodelKey) {\n continue;\n }\n if (\n identifier.className !== className &&\n !(await this._imodelAccess.classDerivesFrom(identifier.className, className)) &&\n !(await this._imodelAccess.classDerivesFrom(className, identifier.className))\n ) {\n continue;\n }\n }\n if (!filteredChildrenIdentifierPaths) {\n filteredChildrenIdentifierPaths = [];\n }\n if (path.length > 1) {\n filteredChildrenIdentifierPaths.push(options ? { path: path.slice(1), options } : path.slice(1));\n } else if (isFilterTarget) {\n filterTargetOptions = HierarchyFilteringPath.mergeOptions(filterTargetOptions, options);\n } else {\n isFilterTarget = true;\n filterTargetOptions = options;\n }\n }\n return { filteredChildrenIdentifierPaths, filterTargetOptions, isFilterTarget };\n }\n\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const sourceDefinitions = await this._source.defineHierarchyLevel(props);\n const filteringProps = extractFilteringProps(this._nodeIdentifierPaths, props.parentNode);\n if (!filteringProps) {\n return sourceDefinitions;\n }\n\n const filteredDefinitions: HierarchyLevelDefinition = [];\n await Promise.all(\n sourceDefinitions.map(async (definition) => {\n let matchedDefinition: HierarchyNodesDefinition | undefined;\n if (HierarchyNodesDefinition.isGenericNode(definition)) {\n matchedDefinition = await matchFilters<GenericNodeKey>(\n definition,\n filteringProps,\n async (id) => {\n return (\n HierarchyNodeIdentifier.isGenericNodeIdentifier(id) &&\n (!id.source || id.source === this._imodelAccess.imodelKey) &&\n id.id === definition.node.key\n );\n },\n this._imodelAccess,\n (def, matchingFilters) => {\n const filteredChildrenIdentifierPaths = matchingFilters.reduce(\n (r, c) => [...r, ...c.childrenIdentifierPaths],\n new Array<HierarchyFilteringPath>(),\n );\n return {\n ...def,\n node: applyFilterAttributes({\n node: def.node,\n filteredChildrenIdentifierPaths,\n isFilterTarget: matchingFilters.some((mc) => mc.isFilterTarget),\n filterTargetOptions: matchingFilters.find((mc) => mc.isFilterTarget)?.filterTargetOptions,\n hasFilterTargetAncestor: filteringProps.hasFilterTargetAncestor,\n }),\n };\n },\n );\n } else {\n matchedDefinition = await matchFilters<InstanceKey>(\n definition,\n filteringProps,\n async (id) => {\n return (\n HierarchyNodeIdentifier.isInstanceNodeIdentifier(id) &&\n (!id.imodelKey || id.imodelKey === this._imodelAccess.imodelKey) &&\n (await this._imodelAccess.classDerivesFrom(id.className, definition.fullClassName))\n );\n },\n this._imodelAccess,\n (def, matchingFilters) => applyECInstanceIdsFilter(def, matchingFilters, !!filteringProps.hasFilterTargetAncestor),\n false,\n );\n }\n if (matchedDefinition) {\n filteredDefinitions.push(matchedDefinition);\n }\n }),\n );\n return filteredDefinitions;\n }\n}\n\ntype MatchedFilter<TIdentifier extends HierarchyNodeIdentifier> = {\n id: TIdentifier;\n childrenIdentifierPaths: HierarchyFilteringPath[];\n} & ({ isFilterTarget: false } | { isFilterTarget: true; filterTargetOptions?: HierarchyFilteringPathOptions });\n\nasync function matchFilters<\n TIdentifier extends HierarchyNodeIdentifier,\n TDefinition = TIdentifier extends InstanceKey ? InstanceNodesQueryDefinition : GenericHierarchyNodeDefinition,\n>(\n definition: TDefinition,\n filteringProps: { filteredNodePaths: HierarchyFilteringPath[]; hasFilterTargetAncestor?: boolean },\n predicate: (id: HierarchyNodeIdentifier) => Promise<boolean>,\n classHierarchy: ECClassHierarchyInspector,\n matchedDefinitionProcessor: (def: TDefinition, matchingFilters: Array<MatchedFilter<TIdentifier>>) => TDefinition,\n extractPathsAndOptions: boolean = true,\n): Promise<TDefinition | undefined> {\n const { filteredNodePaths, hasFilterTargetAncestor } = filteringProps;\n const matchingFilters: Array<MatchedFilter<TIdentifier>> = [];\n for (const filteredNodePath of filteredNodePaths) {\n const { path, options } = HierarchyFilteringPath.normalize(filteredNodePath);\n if (path.length === 0) {\n continue;\n }\n const nodeId = path[0];\n if (await predicate(nodeId)) {\n let entry = await findMatchingFilterEntry(matchingFilters, nodeId, classHierarchy);\n if (!entry) {\n entry = {\n // ideally, `predicate` would act as a type guard to guarantee that `id` is `TIdentifier`, but at the moment\n // async type guards aren't supported\n id: nodeId as TIdentifier,\n childrenIdentifierPaths: [],\n isFilterTarget: false,\n };\n matchingFilters.push(entry);\n }\n\n if (!extractPathsAndOptions) {\n continue;\n }\n\n if (path.length > 1) {\n entry.childrenIdentifierPaths.push(options ? { path: path.slice(1), options } : path.slice(1));\n } else if (entry.isFilterTarget) {\n entry.filterTargetOptions = HierarchyFilteringPath.mergeOptions(entry.filterTargetOptions, options);\n } else {\n Object.assign(entry, { isFilterTarget: true, filterTargetOptions: options });\n }\n }\n }\n if (hasFilterTargetAncestor || matchingFilters.length > 0) {\n return matchedDefinitionProcessor(definition, matchingFilters);\n }\n return undefined;\n}\n\nasync function findMatchingFilterEntry<TEntry extends { id: TIdentifier }, TIdentifier extends HierarchyNodeIdentifier>(\n filters: TEntry[],\n nodeId: TIdentifier,\n classHierarchy: ECClassHierarchyInspector,\n): Promise<TEntry | undefined> {\n for (const filter of filters) {\n if (await identifiersEqual(filter.id, nodeId, classHierarchy)) {\n return filter;\n }\n }\n return undefined;\n}\n\nasync function identifiersEqual<TIdentifier extends HierarchyNodeIdentifier>(lhs: TIdentifier, rhs: TIdentifier, classHierarchy: ECClassHierarchyInspector) {\n if (HierarchyNodeIdentifier.isInstanceNodeIdentifier(lhs) && HierarchyNodeIdentifier.isInstanceNodeIdentifier(rhs)) {\n return (\n lhs.id === rhs.id &&\n (lhs.className === rhs.className ||\n (await classHierarchy.classDerivesFrom(lhs.className, rhs.className)) ||\n (await classHierarchy.classDerivesFrom(rhs.className, lhs.className)))\n );\n }\n return HierarchyNodeIdentifier.equal(lhs, rhs);\n}\n\nfunction applyFilterAttributes<TNode extends SourceHierarchyNode>(props: {\n node: TNode;\n filteredChildrenIdentifierPaths: HierarchyFilteringPath[] | undefined;\n isFilterTarget?: boolean;\n filterTargetOptions?: HierarchyFilteringPathOptions;\n hasFilterTargetAncestor: boolean;\n}): TNode {\n const { node, filteredChildrenIdentifierPaths } = props;\n const result = { ...node };\n\n const shouldAutoExpand = !!filteredChildrenIdentifierPaths?.some((childPath) => {\n return !!HierarchyFilteringPath.normalize(childPath).options?.autoExpand;\n });\n if (shouldAutoExpand) {\n result.autoExpand = true;\n }\n\n const filteringProps = HierarchyNodeFilteringProps.create(props);\n if (filteringProps) {\n result.filtering = filteringProps;\n }\n\n return result;\n}\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ECSQL_COLUMN_NAME_HasFilterTargetAncestor = \"HasFilterTargetAncestor\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ECSQL_COLUMN_NAME_FilterECInstanceId = \"FilterECInstanceId\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ECSQL_COLUMN_NAME_FilterClassName = \"FilterClassName\";\n\nfunction getClassECInstanceIds(matchingFilters: Array<{ id: InstanceKey }>) {\n const classNameECInstanceIds = new Map<string, Id64String[]>();\n for (const matchingFilter of matchingFilters) {\n const entry = classNameECInstanceIds.get(matchingFilter.id.className);\n if (entry === undefined) {\n classNameECInstanceIds.set(matchingFilter.id.className, [matchingFilter.id.id]);\n continue;\n }\n entry.push(matchingFilter.id.id);\n }\n return classNameECInstanceIds;\n}\n\n/** @internal */\nexport function applyECInstanceIdsFilter(\n def: InstanceNodesQueryDefinition,\n matchingFilters: Array<{ id: InstanceKey }>,\n hasFilterTargetAncestor: boolean,\n): InstanceNodesQueryDefinition {\n if (matchingFilters.length === 0) {\n return def;\n }\n const matchingFiltersToUse = getClassECInstanceIds(matchingFilters);\n return {\n ...def,\n query: {\n ...def.query,\n ctes: [\n ...(def.query.ctes ?? []),\n `FilteringInfo(ECInstanceId, FilterClassName) AS (\n ${Array.from(matchingFiltersToUse)\n .map(\n ([className, ecInstanceIds]) => `\n SELECT ECInstanceId, '${className}' AS FilterClassName\n FROM ${className}\n WHERE ECInstanceId IN (${ecInstanceIds.join(\", \")})\n `,\n )\n .join(\" UNION ALL \")}\n )`,\n ],\n ecsql: `\n SELECT\n [q].*,\n ${hasFilterTargetAncestor ? \"1\" : \"0\"} AS [${ECSQL_COLUMN_NAME_HasFilterTargetAncestor}],\n IdToHex([f].[ECInstanceId]) AS [${ECSQL_COLUMN_NAME_FilterECInstanceId}],\n [f].[FilterClassName] AS [${ECSQL_COLUMN_NAME_FilterClassName}]\n FROM (\n ${def.query.ecsql}\n ) [q]\n ${hasFilterTargetAncestor ? \"LEFT \" : \"\"} JOIN FilteringInfo [f] ON [f].[ECInstanceId] = [q].[ECInstanceId]\n `,\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyCache.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/HierarchyCache.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"HierarchyCache.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/HierarchyCache.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AASjE,UAAU,8BAA8B;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gBAAgB;AAChB,qBAAa,cAAc,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAA4D;IACxE,OAAO,CAAC,MAAM,CAAiC;gBAE5B,KAAK,EAAE,8BAA8B;IAKxD,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,iBAAiB;IAyBlB,GAAG,CAAC,YAAY,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC;IAKlD,GAAG,CAAC,YAAY,EAAE,sBAAsB,GAAG,CAAC,GAAG,SAAS;IAKxD,KAAK;CAGb"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.HierarchyCache = void 0;
|
|
8
8
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
|
-
const
|
|
9
|
+
const HierarchyNodeKey_js_1 = require("../HierarchyNodeKey.js");
|
|
10
10
|
/** @internal */
|
|
11
11
|
class HierarchyCache {
|
|
12
12
|
_map;
|
|
@@ -74,7 +74,7 @@ function compareHierarchyNodeKeys(lhs, rhs) {
|
|
|
74
74
|
return lhs.length - rhs.length;
|
|
75
75
|
}
|
|
76
76
|
for (let i = 0; i < lhs.length; ++i) {
|
|
77
|
-
const keysCompareResult =
|
|
77
|
+
const keysCompareResult = HierarchyNodeKey_js_1.HierarchyNodeKey.compare(lhs[i], rhs[i]);
|
|
78
78
|
if (keysCompareResult !== 0) {
|
|
79
79
|
return keysCompareResult;
|
|
80
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyCache.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/HierarchyCache.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,sDAAsE;AAEtE,
|
|
1
|
+
{"version":3,"file":"HierarchyCache.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/HierarchyCache.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,sDAAsE;AAEtE,gEAA0D;AAe1D,gBAAgB;AAChB,MAAa,cAAc;IACjB,IAAI,CAA4D;IAChE,MAAM,CAAiC;IAE/C,YAAmB,KAAqC;QACtD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,4BAAa,CAA6C,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAC;IAClH,CAAC;IAEO,eAAe,CACrB,KAGC;QAED,SAAS,kBAAkB;YACzB,MAAM,EAAE,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAC;YAChF,IAAI,cAAc,KAAK,SAAS,IAAI,uBAAuB,K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AAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,IAAI,iBAAiB,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,iBAAiB,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,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 { LRUCache, LRUDictionary, LRUMap } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"@itwin/presentation-shared\";\nimport { HierarchyNodeKey } from \"../HierarchyNodeKey.js\";\nimport { GetHierarchyNodesProps } from \"../HierarchyProvider.js\";\n\ninterface HierarchyCacheEntry<T> {\n /** Stores observables for the default case - no instance filter or custom limit for the hierarchy level. */\n primary: T | undefined;\n /** Stores a limited number of variations with custom instance filter and/or custom limit for the hierarchy level. */\n variations: LRUCache<string, T>;\n}\n\ninterface ChildNodeObservablesCacheProps {\n size: number;\n variationsCount?: number;\n}\n\n/** @internal */\nexport class HierarchyCache<T> {\n private _map: LRUDictionary<HierarchyNodeKey[], HierarchyCacheEntry<T>>;\n private _props: ChildNodeObservablesCacheProps;\n\n public constructor(props: ChildNodeObservablesCacheProps) {\n this._props = props;\n this._map = new LRUDictionary<HierarchyNodeKey[], HierarchyCacheEntry<T>>(props.size, compareHierarchyNodeKeys);\n }\n\n private createCacheKeys(\n props: Omit<GetHierarchyNodesProps, \"parentNode\"> & {\n parentNode: { key: HierarchyNodeKey; parentKeys: HierarchyNodeKey[] } | undefined;\n filteredInstanceKeys?: InstanceKey[];\n },\n ) {\n function createVariationKey() {\n const { instanceFilter, hierarchyLevelSizeLimit, filteredInstanceKeys } = props;\n if (instanceFilter === undefined && hierarchyLevelSizeLimit === undefined && filteredInstanceKeys === undefined) {\n return undefined;\n }\n return JSON.stringify({ instanceFilter, hierarchyLevelSizeLimit, filteredInstanceKeys });\n }\n\n if (!props.parentNode) {\n return { primaryKey: [], variationKey: createVariationKey() };\n }\n\n const parentKeys = props.parentNode.parentKeys;\n\n return {\n primaryKey: [...parentKeys, props.parentNode.key],\n variationKey: createVariationKey(),\n };\n }\n\n private getCacheAccessors(primaryKey: HierarchyNodeKey[], variationKey?: string) {\n const getMapEntry = (create: boolean) => {\n let entry = this._map.get(primaryKey);\n if (!entry && create) {\n entry = { primary: undefined, variations: new LRUMap(this._props.variationsCount ?? 1) };\n this._map.set(primaryKey, entry);\n }\n return entry;\n };\n if (variationKey) {\n return {\n get: () => getMapEntry(false)?.variations.get(variationKey),\n set: (value: T) => {\n getMapEntry(true)!.variations.set(variationKey, value);\n },\n };\n }\n return {\n get: () => getMapEntry(false)?.primary,\n set: (value: T) => {\n getMapEntry(true)!.primary = value;\n },\n };\n }\n\n public set(requestProps: GetHierarchyNodesProps, value: T) {\n const { primaryKey, variationKey } = this.createCacheKeys(requestProps);\n this.getCacheAccessors(primaryKey, variationKey).set(value);\n }\n\n public get(requestProps: GetHierarchyNodesProps): T | undefined {\n const { primaryKey, variationKey } = this.createCacheKeys(requestProps);\n return this.getCacheAccessors(primaryKey, variationKey).get();\n }\n\n public clear() {\n this._map.clear();\n }\n}\n\nfunction compareHierarchyNodeKeys(lhs: HierarchyNodeKey[], rhs: HierarchyNodeKey[]) {\n if (lhs.length !== rhs.length) {\n return lhs.length - rhs.length;\n }\n for (let i = 0; i < lhs.length; ++i) {\n const keysCompareResult = HierarchyNodeKey.compare(lhs[i], rhs[i]);\n if (keysCompareResult !== 0) {\n return keysCompareResult;\n }\n }\n return 0;\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GenericInstanceFilter } from "@itwin/core-common";
|
|
2
2
|
import { ECSqlQueryDef } from "@itwin/presentation-shared";
|
|
3
|
-
import { NonGroupingHierarchyNode } from "../HierarchyNode";
|
|
4
|
-
import { ProcessedGenericHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode, SourceGenericHierarchyNode, SourceInstanceHierarchyNode } from "./IModelHierarchyNode";
|
|
3
|
+
import { NonGroupingHierarchyNode } from "../HierarchyNode.js";
|
|
4
|
+
import { ProcessedGenericHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode, SourceGenericHierarchyNode, SourceInstanceHierarchyNode } from "./IModelHierarchyNode.js";
|
|
5
5
|
/**
|
|
6
6
|
* A nodes definition that returns a single generic node.
|
|
7
|
-
* @
|
|
7
|
+
* @public
|
|
8
8
|
*/
|
|
9
9
|
export interface GenericHierarchyNodeDefinition {
|
|
10
10
|
/** The node to be created in the hierarchy level */
|
|
@@ -12,7 +12,7 @@ export interface GenericHierarchyNodeDefinition {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* A nodes definition that returns an ECSQL query for selecting nodes from an iModel.
|
|
15
|
-
* @
|
|
15
|
+
* @public
|
|
16
16
|
*/
|
|
17
17
|
export interface InstanceNodesQueryDefinition {
|
|
18
18
|
/**
|
|
@@ -29,22 +29,22 @@ export interface InstanceNodesQueryDefinition {
|
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* A definition of nodes included in a hierarchy level.
|
|
32
|
-
* @
|
|
32
|
+
* @public
|
|
33
33
|
*/
|
|
34
34
|
export type HierarchyNodesDefinition = GenericHierarchyNodeDefinition | InstanceNodesQueryDefinition;
|
|
35
|
-
/** @
|
|
35
|
+
/** @public */
|
|
36
36
|
export declare namespace HierarchyNodesDefinition {
|
|
37
37
|
function isGenericNode(def: HierarchyNodesDefinition): def is GenericHierarchyNodeDefinition;
|
|
38
38
|
function isInstanceNodesQuery(def: HierarchyNodesDefinition): def is InstanceNodesQueryDefinition;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* A definition of a hierarchy level, which may consist of multiple node definitions.
|
|
42
|
-
* @
|
|
42
|
+
* @public
|
|
43
43
|
*/
|
|
44
44
|
export type HierarchyLevelDefinition = HierarchyNodesDefinition[];
|
|
45
45
|
/**
|
|
46
46
|
* A type for a function that parses a `SourceInstanceHierarchyNode` from provided ECSQL `row` object.
|
|
47
|
-
* @
|
|
47
|
+
* @public
|
|
48
48
|
*/
|
|
49
49
|
export type NodeParser = (row: {
|
|
50
50
|
[columnName: string]: any;
|
|
@@ -54,14 +54,14 @@ export type NodeParser = (row: {
|
|
|
54
54
|
* it should return a new - modified - node, rather than modifying the given one. Returning `undefined` omits the node
|
|
55
55
|
* from the hierarchy.
|
|
56
56
|
*
|
|
57
|
-
* @
|
|
57
|
+
* @public
|
|
58
58
|
*/
|
|
59
59
|
export type NodePreProcessor = <TNode extends ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode>(node: TNode) => Promise<TNode | undefined>;
|
|
60
60
|
/**
|
|
61
61
|
* A type for a function that post-processes given node. Unless the function decides not to make any modifications,
|
|
62
62
|
* it should return a new - modified - node, rather than modifying the given one.
|
|
63
63
|
*
|
|
64
|
-
* @
|
|
64
|
+
* @public
|
|
65
65
|
*/
|
|
66
66
|
export type NodePostProcessor = (node: ProcessedHierarchyNode) => Promise<ProcessedHierarchyNode>;
|
|
67
67
|
/**
|
|
@@ -69,12 +69,12 @@ export type NodePostProcessor = (node: ProcessedHierarchyNode) => Promise<Proces
|
|
|
69
69
|
* a `HierarchyNode` that:
|
|
70
70
|
* - knows nothing about its children,
|
|
71
71
|
* - is either an instances node (key is of `InstancesNodeKey` type) or a generic node (key is of `GenericNodeKey` type).
|
|
72
|
-
* @
|
|
72
|
+
* @public
|
|
73
73
|
*/
|
|
74
74
|
export type HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, "children">;
|
|
75
75
|
/**
|
|
76
76
|
* Props for `HierarchyDefinition.defineHierarchyLevel`.
|
|
77
|
-
* @
|
|
77
|
+
* @public
|
|
78
78
|
*/
|
|
79
79
|
export interface DefineHierarchyLevelProps {
|
|
80
80
|
/** Parent node to get children for. Pass `undefined` to get root nodes. */
|
|
@@ -84,7 +84,7 @@ export interface DefineHierarchyLevelProps {
|
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* An interface for a factory that knows how define a hierarchy based on a given parent node.
|
|
87
|
-
* @
|
|
87
|
+
* @public
|
|
88
88
|
*/
|
|
89
89
|
export interface HierarchyDefinition {
|
|
90
90
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"IModelHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,EACtB,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,oDAAoD;IACpD,IAAI,EAAE,0BAA0B,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,GAAG,4BAA4B,CAAC;AACrG,cAAc;AAEd,yBAAiB,wBAAwB,CAAC;IACxC,SAAgB,aAAa,CAAC,GAAG,EAAE,wBAAwB,GA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@@ -5,7 +5,7 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.HierarchyNodesDefinition = void 0;
|
|
8
|
-
/** @
|
|
8
|
+
/** @public */
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
10
10
|
var HierarchyNodesDefinition;
|
|
11
11
|
(function (HierarchyNodesDefinition) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA6ChG,
|
|
1
|
+
{"version":3,"file":"IModelHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA6ChG,cAAc;AACd,2DAA2D;AAC3D,IAAiB,wBAAwB,CAOxC;AAPD,WAAiB,wBAAwB;IACvC,SAAgB,aAAa,CAAC,GAA6B;QACzD,OAAO,CAAC,CAAE,GAAsC,CAAC,IAAI,CAAC;IACxD,CAAC;IAFe,sCAAa,gBAE5B,CAAA;IACD,SAAgB,oBAAoB,CAAC,GAA6B;QAChE,OAAO,CAAC,CAAE,GAAoC,CAAC,KAAK,CAAC;IACvD,CAAC;IAFe,6CAAoB,uBAEnC,CAAA;AACH,CAAC,EAPgB,wBAAwB,wCAAxB,wBAAwB,QAOxC","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 { GenericInstanceFilter } from \"@itwin/core-common\";\nimport { ECSqlQueryDef } from \"@itwin/presentation-shared\";\nimport { NonGroupingHierarchyNode } from \"../HierarchyNode.js\";\nimport {\n ProcessedGenericHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n SourceGenericHierarchyNode,\n SourceInstanceHierarchyNode,\n} from \"./IModelHierarchyNode.js\";\n\n/**\n * A nodes definition that returns a single generic node.\n * @public\n */\nexport interface GenericHierarchyNodeDefinition {\n /** The node to be created in the hierarchy level */\n node: SourceGenericHierarchyNode;\n}\n\n/**\n * A nodes definition that returns an ECSQL query for selecting nodes from an iModel.\n * @public\n */\nexport interface InstanceNodesQueryDefinition {\n /**\n * Full name of the class whose instances are going to be returned. It's okay if the attribute\n * points to a base class of multiple different classes of instances returned by the query, however\n * the more specific this class is, the more efficient hierarchy building process is.\n */\n fullClassName: string;\n /**\n * An ECSQL query that selects nodes from an iModel. `SELECT` clause of the query is expected\n * to be built using `NodeSelectQueryFactory.createSelectClause`.\n */\n query: ECSqlQueryDef;\n}\n\n/**\n * A definition of nodes included in a hierarchy level.\n * @public\n */\nexport type HierarchyNodesDefinition = GenericHierarchyNodeDefinition | InstanceNodesQueryDefinition;\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodesDefinition {\n export function isGenericNode(def: HierarchyNodesDefinition): def is GenericHierarchyNodeDefinition {\n return !!(def as GenericHierarchyNodeDefinition).node;\n }\n export function isInstanceNodesQuery(def: HierarchyNodesDefinition): def is InstanceNodesQueryDefinition {\n return !!(def as InstanceNodesQueryDefinition).query;\n }\n}\n\n/**\n * A definition of a hierarchy level, which may consist of multiple node definitions.\n * @public\n */\nexport type HierarchyLevelDefinition = HierarchyNodesDefinition[];\n\n/**\n * A type for a function that parses a `SourceInstanceHierarchyNode` from provided ECSQL `row` object.\n * @public\n */\nexport type NodeParser = (\n row: { [columnName: string]: any },\n parentNode?: HierarchyDefinitionParentNode,\n) => SourceInstanceHierarchyNode | Promise<SourceInstanceHierarchyNode>;\n\n/**\n * A type for a function that pre-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one. Returning `undefined` omits the node\n * from the hierarchy.\n *\n * @public\n */\nexport type NodePreProcessor = <TNode extends ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode>(node: TNode) => Promise<TNode | undefined>;\n\n/**\n * A type for a function that post-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one.\n *\n * @public\n */\nexport type NodePostProcessor = (node: ProcessedHierarchyNode) => Promise<ProcessedHierarchyNode>;\n\n/**\n * A type of node that can be passed to `HierarchyDefinition.defineHierarchyLevel`. This basically means\n * a `HierarchyNode` that:\n * - knows nothing about its children,\n * - is either an instances node (key is of `InstancesNodeKey` type) or a generic node (key is of `GenericNodeKey` type).\n * @public\n */\nexport type HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, \"children\">;\n\n/**\n * Props for `HierarchyDefinition.defineHierarchyLevel`.\n * @public\n */\nexport interface DefineHierarchyLevelProps {\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: HierarchyDefinitionParentNode | undefined;\n\n /** Optional hierarchy level filter. */\n instanceFilter?: GenericInstanceFilter;\n}\n\n/**\n * An interface for a factory that knows how define a hierarchy based on a given parent node.\n * @public\n */\nexport interface HierarchyDefinition {\n /**\n * An optional function for parsing ECInstance node from ECSQL row.\n *\n * Should be used in situations when the `HierarchyDefinition` implementation\n * introduces additional ECSQL columns into the select clause and wants to assign additional\n * data to the nodes it produces.\n *\n * Defaults to a function that parses all `HierarchyNode` attributes from a query, whose SELECT\n * clause is created using `NodeSelectQueryFactory.createSelectClause`.\n */\n parseNode?: NodeParser;\n\n /**\n * An optional function for pre-processing nodes.\n *\n * Pre-processing happens immediately after the nodes are loaded based on `HierarchyLevelDefinition`\n * returned by this `HierarchyDefinition` and before their processing (hiding, grouping, sorting, etc.) starts.\n * The step allows assigning nodes additional data or excluding them from the hierarchy based on some attributes.\n */\n preProcessNode?: NodePreProcessor;\n\n /**\n * An optional function for post-processing nodes.\n *\n * Post-processing happens after the loaded nodes go through all the merging, hiding and grouping\n * steps, but before sorting them. This step allows `HierarchyDefinition` implementations to assign additional data\n * to nodes after they're processed. This is especially true for grouping nodes as they're only created during\n * processing.\n */\n postProcessNode?: NodePostProcessor;\n\n /** A function to create a hierarchy level definition for given parent node. */\n defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition>;\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from "@itwin/presentation-shared";
|
|
2
|
-
import { GroupingHierarchyNode, NonGroupingHierarchyNode } from "../HierarchyNode";
|
|
3
|
-
import { GenericNodeKey, InstancesNodeKey } from "../HierarchyNodeKey";
|
|
2
|
+
import { GroupingHierarchyNode, NonGroupingHierarchyNode } from "../HierarchyNode.js";
|
|
3
|
+
import { GenericNodeKey, InstancesNodeKey } from "../HierarchyNodeKey.js";
|
|
4
4
|
/**
|
|
5
5
|
* Base processing parameters that apply to every node.
|
|
6
|
-
* @
|
|
6
|
+
* @public
|
|
7
7
|
*/
|
|
8
8
|
interface HierarchyNodeProcessingParamsBase {
|
|
9
9
|
/** Indicates if this node should be hidden if it has no child nodes. */
|
|
@@ -13,7 +13,7 @@ interface HierarchyNodeProcessingParamsBase {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* A data structure for defining nodes' grouping requirements.
|
|
16
|
-
* @
|
|
16
|
+
* @public
|
|
17
17
|
*/
|
|
18
18
|
interface HierarchyNodeGroupingParams {
|
|
19
19
|
byLabel?: HierarchyNodeLabelGroupingParams;
|
|
@@ -23,7 +23,7 @@ interface HierarchyNodeGroupingParams {
|
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* A data structure for defining params specifically used for label grouping.
|
|
26
|
-
* @
|
|
26
|
+
* @public
|
|
27
27
|
*/
|
|
28
28
|
interface HierarchyNodeLabelGroupingBaseParams {
|
|
29
29
|
/** Label grouping option that determines whether to group nodes or to merge them. Defaults to "group".*/
|
|
@@ -33,26 +33,26 @@ interface HierarchyNodeLabelGroupingBaseParams {
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* A data structure for defining label merging.
|
|
36
|
-
* @
|
|
36
|
+
* @public
|
|
37
37
|
*/
|
|
38
38
|
interface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {
|
|
39
39
|
action: "merge";
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* A data structure for defining label grouping with additional parameters.
|
|
43
|
-
* @
|
|
43
|
+
* @public
|
|
44
44
|
*/
|
|
45
45
|
interface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {
|
|
46
46
|
action?: "group";
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* A data structure for defining possible label grouping types.
|
|
50
|
-
* @
|
|
50
|
+
* @public
|
|
51
51
|
*/
|
|
52
52
|
export type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;
|
|
53
53
|
/**
|
|
54
54
|
* Grouping parameters that are shared across all types of groupings.
|
|
55
|
-
* @
|
|
55
|
+
* @public
|
|
56
56
|
*/
|
|
57
57
|
export interface HierarchyNodeGroupingParamsBase {
|
|
58
58
|
/** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */
|
|
@@ -66,12 +66,12 @@ export interface HierarchyNodeGroupingParamsBase {
|
|
|
66
66
|
* Defines possible values for `BaseGroupingParams.autoExpand` attribute:
|
|
67
67
|
* - `single-child` - set the grouping node to auto-expand if it groups a single node.
|
|
68
68
|
* - `always` - always set the grouping node to auto-expand.
|
|
69
|
-
* @
|
|
69
|
+
* @public
|
|
70
70
|
*/
|
|
71
71
|
export type HierarchyNodeAutoExpandProp = "single-child" | "always";
|
|
72
72
|
/**
|
|
73
73
|
* A data structure that represents base class grouping.
|
|
74
|
-
* @
|
|
74
|
+
* @public
|
|
75
75
|
*/
|
|
76
76
|
interface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {
|
|
77
77
|
/**
|
|
@@ -84,7 +84,7 @@ interface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingPara
|
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* A data structure that represents properties grouping.
|
|
87
|
-
* @
|
|
87
|
+
* @public
|
|
88
88
|
*/
|
|
89
89
|
export interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {
|
|
90
90
|
/**
|
|
@@ -133,7 +133,7 @@ export interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGrou
|
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* A data structure that represents specific properties' grouping params.
|
|
136
|
-
* @
|
|
136
|
+
* @public
|
|
137
137
|
*/
|
|
138
138
|
export interface HierarchyNodePropertyGroup {
|
|
139
139
|
/** A string indicating the name of the property to group by. */
|
|
@@ -145,7 +145,7 @@ export interface HierarchyNodePropertyGroup {
|
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
147
|
* A data structure that represents boundaries for a value.
|
|
148
|
-
* @
|
|
148
|
+
* @public
|
|
149
149
|
*/
|
|
150
150
|
export interface HierarchyNodePropertyValueRange {
|
|
151
151
|
/** Defines the lower bound of the range. */
|
|
@@ -157,14 +157,14 @@ export interface HierarchyNodePropertyValueRange {
|
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
159
159
|
* Processing parameters that apply to instance nodes.
|
|
160
|
-
* @
|
|
160
|
+
* @public
|
|
161
161
|
*/
|
|
162
162
|
export interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {
|
|
163
163
|
grouping?: HierarchyNodeGroupingParams;
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* A generic (not based on data in an iModel) node that has processing parameters.
|
|
167
|
-
* @
|
|
167
|
+
* @public
|
|
168
168
|
*/
|
|
169
169
|
export type ProcessedGenericHierarchyNode = Omit<NonGroupingHierarchyNode, "key" | "children"> & {
|
|
170
170
|
key: GenericNodeKey;
|
|
@@ -173,7 +173,7 @@ export type ProcessedGenericHierarchyNode = Omit<NonGroupingHierarchyNode, "key"
|
|
|
173
173
|
};
|
|
174
174
|
/**
|
|
175
175
|
* An instances' (based on data in an iModel) node that has processing parameters.
|
|
176
|
-
* @
|
|
176
|
+
* @public
|
|
177
177
|
*/
|
|
178
178
|
export type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, "key" | "children"> & {
|
|
179
179
|
key: InstancesNodeKey;
|
|
@@ -182,7 +182,7 @@ export type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, "key
|
|
|
182
182
|
};
|
|
183
183
|
/**
|
|
184
184
|
* A grouping node that groups either instance nodes or other grouping nodes.
|
|
185
|
-
* @
|
|
185
|
+
* @public
|
|
186
186
|
*/
|
|
187
187
|
export type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, "children"> & {
|
|
188
188
|
children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;
|
|
@@ -194,10 +194,10 @@ export type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, "childr
|
|
|
194
194
|
* Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of
|
|
195
195
|
* `ProcessedHierarchyNode`.
|
|
196
196
|
*
|
|
197
|
-
* @
|
|
197
|
+
* @public
|
|
198
198
|
*/
|
|
199
199
|
export type ProcessedHierarchyNode = ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;
|
|
200
|
-
/** @
|
|
200
|
+
/** @public */
|
|
201
201
|
export declare namespace ProcessedHierarchyNode {
|
|
202
202
|
/** Checks whether the given node is a generic node */
|
|
203
203
|
function isGeneric(node: ProcessedHierarchyNode): node is ProcessedGenericHierarchyNode;
|
|
@@ -209,21 +209,21 @@ export declare namespace ProcessedHierarchyNode {
|
|
|
209
209
|
/**
|
|
210
210
|
* A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is
|
|
211
211
|
* returned by hierarchy definitions as a generic node or when the node is just parsed from query results.
|
|
212
|
-
* @
|
|
212
|
+
* @public
|
|
213
213
|
*/
|
|
214
214
|
export type SourceHierarchyNode<TBase = SourceGenericHierarchyNode | SourceInstanceHierarchyNode> = OmitOverUnion<TBase, "label" | "parentKeys"> & {
|
|
215
215
|
label: string | ConcatenatedValue;
|
|
216
216
|
};
|
|
217
217
|
/**
|
|
218
218
|
* A kind of `ProcessedGenericHierarchyNode` that has unformatted label and doesn't know about its ancestors.
|
|
219
|
-
* @
|
|
219
|
+
* @public
|
|
220
220
|
*/
|
|
221
221
|
export type SourceGenericHierarchyNode = SourceHierarchyNode<Omit<ProcessedGenericHierarchyNode, "key"> & {
|
|
222
222
|
key: string;
|
|
223
223
|
}>;
|
|
224
224
|
/**
|
|
225
225
|
* A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.
|
|
226
|
-
* @
|
|
226
|
+
* @public
|
|
227
227
|
*/
|
|
228
228
|
export type SourceInstanceHierarchyNode = SourceHierarchyNode<Omit<ProcessedInstanceHierarchyNode, "key"> & {
|
|
229
229
|
key: Omit<InstancesNodeKey, "instanceKeys"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelHierarchyNode.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyNode.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC3G,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"IModelHierarchyNode.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyNode.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B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,WAAW,EAAE,CAAA;KAAE,CAAC;CAC/E,CACF,CAAC"}
|
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ProcessedHierarchyNode = void 0;
|
|
8
|
-
const
|
|
9
|
-
/** @
|
|
8
|
+
const HierarchyNodeKey_js_1 = require("../HierarchyNodeKey.js");
|
|
9
|
+
/** @public */
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
11
11
|
var ProcessedHierarchyNode;
|
|
12
12
|
(function (ProcessedHierarchyNode) {
|
|
13
13
|
/** Checks whether the given node is a generic node */
|
|
14
14
|
function isGeneric(node) {
|
|
15
|
-
return
|
|
15
|
+
return HierarchyNodeKey_js_1.HierarchyNodeKey.isGeneric(node.key);
|
|
16
16
|
}
|
|
17
17
|
ProcessedHierarchyNode.isGeneric = isGeneric;
|
|
18
18
|
/** Checks whether the given node is an ECInstances-based node */
|
|
19
19
|
function isInstancesNode(node) {
|
|
20
|
-
return
|
|
20
|
+
return HierarchyNodeKey_js_1.HierarchyNodeKey.isInstances(node.key);
|
|
21
21
|
}
|
|
22
22
|
ProcessedHierarchyNode.isInstancesNode = isInstancesNode;
|
|
23
23
|
/** Checks whether the given node is a grouping node */
|
|
24
24
|
function isGroupingNode(node) {
|
|
25
|
-
return
|
|
25
|
+
return HierarchyNodeKey_js_1.HierarchyNodeKey.isGrouping(node.key);
|
|
26
26
|
}
|
|
27
27
|
ProcessedHierarchyNode.isGroupingNode = isGroupingNode;
|
|
28
28
|
})(ProcessedHierarchyNode || (exports.ProcessedHierarchyNode = ProcessedHierarchyNode = {}));
|