@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":"HierarchyNodeKey.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,IAAI,EAAE,SAAS,CAAC;IAEhB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,IAAI,EAAE,WAAW,CAAC;IAElB;;;OAGG;IACH,YAAY,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED;;;G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AGG;AACH,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,cAAc,CAAC;AAEvE,
|
|
1
|
+
{"version":3,"file":"HierarchyNodeKey.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,IAAI,EAAE,SAAS,CAAC;IAEhB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,IAAI,EAAE,WAAW,CAAC;IAElB;;;OAGG;IACH,YAAY,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;IAEvB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;IAEvB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD,uBAAuB;IACvB,IAAI,EAAE,yBAAyB,CAAC;IAChC,0EAA0E;IAC1E,UAAU,EAAE,KAAK,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC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BAAgB,GAAG,GAAG,IAAI,eAAe,CAExE;IAED,qEAAqE;IACrE,SAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,IAAI,oBAAoB,CAElF;IAED,qEAAqE;IACrE,SAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,IAAI,oBAAoB,CAElF;IAED,mFAAmF;IACnF,SAAgB,6BAA6B,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,IAAI,kCAAkC,CAE9G;IAED,kFAAkF;IAClF,SAAgB,4BAA4B,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,IAAI,iCAAiC,CAE5G;IAED,6EAA6E;IAC7E,SAAgB,uBAAuB,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,IAAI,4BAA4B,CAElG;IAED,wEAAwE;IACxE,SAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,IAAI,uBAAuB,CAExF;IAED;;;;;OAKG;IACH,SAAgB,OAAO,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAwF5E;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAE5E;CACF"}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.HierarchyNodeKey = void 0;
|
|
8
8
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
9
|
const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
10
|
-
/** @
|
|
10
|
+
/** @public */
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
12
12
|
var HierarchyNodeKey;
|
|
13
13
|
(function (HierarchyNodeKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyNodeKey.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode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G,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAxFe,wBAAO,UAwFtB,CAAA;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAqB,EAAE,GAAqB;QACjE,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAFe,uBAAM,SAErB,CAAA;AACH,CAAC,EAvJgB,gBAAgB,gCAAhB,gBAAgB,QAuJhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { assert, compareStrings, compareStringsOrUndefined } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"@itwin/presentation-shared\";\n\n/**\n * An instance key that may be associated with specific iModel.\n * @beta\n */\nexport interface IModelInstanceKey extends InstanceKey {\n imodelKey?: string;\n}\n\n/**\n * A key for a generic node.\n * @beta\n */\nexport interface GenericNodeKey {\n /** Type of the node */\n type: \"generic\";\n\n /**\n * Node key identifier, which uniquely identifies the node within the hierarchy level the node is used.\n * The format of the identifier is not specified and is up to the data source.\n */\n id: string;\n\n /**\n * Optional data source identifier. Useful when a hierarchy is built using multiple hierarchy providers - in that\n * case each provider can assign a unique source identifier to its nodes.\n */\n source?: string;\n}\n\n/**\n * A key for a node that represents one or more ECInstances.\n * @beta\n */\nexport interface InstancesNodeKey {\n /** Type of the node */\n type: \"instances\";\n\n /**\n * Keys of ECInstances that are represented by the node. Generally, one node represents a single\n * ECInstance, but in some cases (e.g. node merging) there could be more.\n */\n instanceKeys: IModelInstanceKey[];\n}\n\n/**\n * A key for a class-grouping node.\n * @beta\n */\nexport interface ClassGroupingNodeKey {\n /** Type of the node */\n type: \"class-grouping\";\n\n /** Full name of the ECClass that this grouping node is grouping by. */\n className: string;\n}\n\n/**\n * A key for a label-grouping node.\n * @beta\n */\nexport interface LabelGroupingNodeKey {\n /** Type of the node */\n type: \"label-grouping\";\n\n /** Node label that this grouping node is grouping by. */\n label: string;\n\n /**\n * Optional group identifier that is assigned to the node key when multiple nodes\n * with the same label shouldn't be grouped together.\n */\n groupId?: string;\n}\n\n/**\n * A key property grouping node that groups nodes whose values don't fall into any other\n * property group in the hierarchy level.\n * @beta\n */\nexport interface PropertyOtherValuesGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:other\";\n /** Identifiers of properties whose values are grouped under this node. */\n properties: Array<{\n className: string;\n propertyName: string;\n }>;\n}\n\n/**\n * A key for a property grouping node that groups nodes by formatted property value.\n * @beta\n */\nexport interface PropertyValueGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:value\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Formatted property value that this node is grouping by. */\n formattedPropertyValue: string;\n}\n\n/**\n * A key for a property grouping node that groups nodes by a range of property values.\n * @beta\n */\nexport interface PropertyValueRangeGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:range\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Defines the start of the values' range that this node is grouping by. */\n fromValue: number;\n\n /** Defines the end of the values' range that this node is grouping by. */\n toValue: number;\n}\n\n/**\n * A key for a property grouping node.\n * @beta\n */\nexport type PropertyGroupingNodeKey = PropertyValueRangeGroupingNodeKey | PropertyValueGroupingNodeKey | PropertyOtherValuesGroupingNodeKey;\n\n/**\n * A key for one of the instance grouping nodes.\n * @beta\n */\nexport type GroupingNodeKey = ClassGroupingNodeKey | LabelGroupingNodeKey | PropertyGroupingNodeKey;\n\n/**\n * A key for either an instance node or one of the instance grouping nodes.\n * @beta\n */\nexport type IModelHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;\n\n/**\n * A key that uniquely identifies a node in a hierarchy level.\n * @beta\n */\nexport type HierarchyNodeKey = IModelHierarchyNodeKey | GenericNodeKey;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeKey {\n /** Checks whether the given node key is a generic node key. */\n export function isGeneric(key: HierarchyNodeKey): key is GenericNodeKey {\n return key.type === \"generic\";\n }\n\n /** Checks whether the given node key is a `StandardHierarchyNodeKey`. */\n export function isIModelNodeKey(key: HierarchyNodeKey): key is IModelHierarchyNodeKey {\n return !isGeneric(key);\n }\n\n /** Checks whether the given node key is an `InstancesNodeKey`. */\n export function isInstances(key: HierarchyNodeKey): key is InstancesNodeKey {\n return key.type === \"instances\";\n }\n\n /** Checks whether the given node key is a `GroupingNodeKey`. */\n export function isGrouping(key: HierarchyNodeKey): key is GroupingNodeKey {\n return !isGeneric(key) && !isInstances(key);\n }\n\n /** Checks whether the given node key is a `ClassGroupingNodeKey`. */\n export function isClassGrouping(key: HierarchyNodeKey): key is ClassGroupingNodeKey {\n return key.type === \"class-grouping\";\n }\n\n /** Checks whether the given node key is a `LabelGroupingNodeKey`. */\n export function isLabelGrouping(key: HierarchyNodeKey): key is LabelGroupingNodeKey {\n return key.type === \"label-grouping\";\n }\n\n /** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */\n export function isPropertyOtherValuesGrouping(key: HierarchyNodeKey): key is PropertyOtherValuesGroupingNodeKey {\n return key.type === \"property-grouping:other\";\n }\n\n /** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */\n export function isPropertyValueRangeGrouping(key: HierarchyNodeKey): key is PropertyValueRangeGroupingNodeKey {\n return key.type === \"property-grouping:range\";\n }\n\n /** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */\n export function isPropertyValueGrouping(key: HierarchyNodeKey): key is PropertyValueGroupingNodeKey {\n return key.type === \"property-grouping:value\";\n }\n\n /** Checks whether the given node key is a `PropertyGroupingNodeKey`. */\n export function isPropertyGrouping(key: HierarchyNodeKey): key is PropertyGroupingNodeKey {\n return isPropertyOtherValuesGrouping(key) || isPropertyValueRangeGrouping(key) || isPropertyValueGrouping(key);\n }\n\n /**\n * Compares two given keys. Returns:\n * - `0` if they are equal,\n * - `negative value` if lhs key is less than rhs key,\n * - `positive value` if lhs key is more than rhs key.\n */\n export function compare(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): number {\n const typeCompareResult = compareStrings(lhs.type, rhs.type);\n if (typeCompareResult !== 0) {\n return typeCompareResult;\n }\n switch (lhs.type) {\n case \"generic\": {\n assert(rhs.type === \"generic\");\n const idCompareResult = compareStrings(lhs.id, rhs.id);\n if (idCompareResult !== 0) {\n return idCompareResult;\n }\n return compareStringsOrUndefined(lhs.source, rhs.source);\n }\n case \"instances\": {\n assert(rhs.type === \"instances\");\n if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {\n return lhs.instanceKeys.length > rhs.instanceKeys.length ? 1 : -1;\n }\n for (let i = 0; i < lhs.instanceKeys.length; ++i) {\n const instanceKeyCompareResult = InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i]);\n if (instanceKeyCompareResult !== 0) {\n return instanceKeyCompareResult;\n }\n const imodelKeyCompareResult = compareStringsOrUndefined(lhs.instanceKeys[0].imodelKey, rhs.instanceKeys[0].imodelKey);\n if (imodelKeyCompareResult !== 0) {\n return imodelKeyCompareResult;\n }\n }\n return 0;\n }\n case \"class-grouping\": {\n assert(rhs.type === \"class-grouping\");\n return compareStrings(lhs.className, rhs.className);\n }\n case \"label-grouping\": {\n assert(rhs.type === \"label-grouping\");\n const labelCompareResult = compareStrings(lhs.label, rhs.label);\n if (labelCompareResult !== 0) {\n return labelCompareResult;\n }\n return compareStringsOrUndefined(lhs.groupId, rhs.groupId);\n }\n case \"property-grouping:other\": {\n assert(rhs.type === \"property-grouping:other\");\n if (lhs.properties.length !== rhs.properties.length) {\n return lhs.properties.length - rhs.properties.length;\n }\n for (let i = 0; i < lhs.properties.length; ++i) {\n const classCompareResult = compareStrings(lhs.properties[i].className, rhs.properties[i].className);\n if (classCompareResult !== 0) {\n return classCompareResult;\n }\n const nameCompareResult = compareStrings(lhs.properties[i].propertyName, rhs.properties[i].propertyName);\n if (nameCompareResult !== 0) {\n return nameCompareResult;\n }\n }\n return 0;\n }\n case \"property-grouping:value\": {\n assert(rhs.type === \"property-grouping:value\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n return compareStrings(lhs.formattedPropertyValue, rhs.formattedPropertyValue);\n }\n case \"property-grouping:range\": {\n assert(rhs.type === \"property-grouping:range\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n if (lhs.fromValue !== rhs.fromValue) {\n return lhs.fromValue > rhs.fromValue ? 1 : -1;\n }\n return lhs.toValue > rhs.toValue ? 1 : lhs.toValue < rhs.toValue ? -1 : 0;\n }\n }\n }\n\n /** Checks whether the two given keys are equal. */\n export function equals(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): boolean {\n return compare(lhs, rhs) === 0;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HierarchyNodeKey.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,sDAAwF;AACxF,oEAAyD;AA0JzD,cAAc;AACd,2DAA2D;AAC3D,IAAiB,gBAAg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C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAxFe,wBAAO,UAwFtB,CAAA;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAqB,EAAE,GAAqB;QACjE,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAFe,uBAAM,SAErB,CAAA;AACH,CAAC,EAvJgB,gBAAgB,gCAAhB,gBAAgB,QAuJhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { assert, compareStrings, compareStringsOrUndefined } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"@itwin/presentation-shared\";\n\n/**\n * An instance key that may be associated with specific iModel.\n * @public\n */\nexport interface IModelInstanceKey extends InstanceKey {\n imodelKey?: string;\n}\n\n/**\n * A key for a generic node.\n * @public\n */\nexport interface GenericNodeKey {\n /** Type of the node */\n type: \"generic\";\n\n /**\n * Node key identifier, which uniquely identifies the node within the hierarchy level the node is used.\n * The format of the identifier is not specified and is up to the data source.\n */\n id: string;\n\n /**\n * Optional data source identifier. Useful when a hierarchy is built using multiple hierarchy providers - in that\n * case each provider can assign a unique source identifier to its nodes.\n */\n source?: string;\n}\n\n/**\n * A key for a node that represents one or more ECInstances.\n * @public\n */\nexport interface InstancesNodeKey {\n /** Type of the node */\n type: \"instances\";\n\n /**\n * Keys of ECInstances that are represented by the node. Generally, one node represents a single\n * ECInstance, but in some cases (e.g. node merging) there could be more.\n */\n instanceKeys: IModelInstanceKey[];\n}\n\n/**\n * A key for a class-grouping node.\n * @public\n */\nexport interface ClassGroupingNodeKey {\n /** Type of the node */\n type: \"class-grouping\";\n\n /** Full name of the ECClass that this grouping node is grouping by. */\n className: string;\n}\n\n/**\n * A key for a label-grouping node.\n * @public\n */\nexport interface LabelGroupingNodeKey {\n /** Type of the node */\n type: \"label-grouping\";\n\n /** Node label that this grouping node is grouping by. */\n label: string;\n\n /**\n * Optional group identifier that is assigned to the node key when multiple nodes\n * with the same label shouldn't be grouped together.\n */\n groupId?: string;\n}\n\n/**\n * A key property grouping node that groups nodes whose values don't fall into any other\n * property group in the hierarchy level.\n * @public\n */\nexport interface PropertyOtherValuesGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:other\";\n /** Identifiers of properties whose values are grouped under this node. */\n properties: Array<{\n className: string;\n propertyName: string;\n }>;\n}\n\n/**\n * A key for a property grouping node that groups nodes by formatted property value.\n * @public\n */\nexport interface PropertyValueGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:value\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Formatted property value that this node is grouping by. */\n formattedPropertyValue: string;\n}\n\n/**\n * A key for a property grouping node that groups nodes by a range of property values.\n * @public\n */\nexport interface PropertyValueRangeGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:range\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Defines the start of the values' range that this node is grouping by. */\n fromValue: number;\n\n /** Defines the end of the values' range that this node is grouping by. */\n toValue: number;\n}\n\n/**\n * A key for a property grouping node.\n * @public\n */\nexport type PropertyGroupingNodeKey = PropertyValueRangeGroupingNodeKey | PropertyValueGroupingNodeKey | PropertyOtherValuesGroupingNodeKey;\n\n/**\n * A key for one of the instance grouping nodes.\n * @public\n */\nexport type GroupingNodeKey = ClassGroupingNodeKey | LabelGroupingNodeKey | PropertyGroupingNodeKey;\n\n/**\n * A key for either an instance node or one of the instance grouping nodes.\n * @public\n */\nexport type IModelHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;\n\n/**\n * A key that uniquely identifies a node in a hierarchy level.\n * @public\n */\nexport type HierarchyNodeKey = IModelHierarchyNodeKey | GenericNodeKey;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeKey {\n /** Checks whether the given node key is a generic node key. */\n export function isGeneric(key: HierarchyNodeKey): key is GenericNodeKey {\n return key.type === \"generic\";\n }\n\n /** Checks whether the given node key is a `StandardHierarchyNodeKey`. */\n export function isIModelNodeKey(key: HierarchyNodeKey): key is IModelHierarchyNodeKey {\n return !isGeneric(key);\n }\n\n /** Checks whether the given node key is an `InstancesNodeKey`. */\n export function isInstances(key: HierarchyNodeKey): key is InstancesNodeKey {\n return key.type === \"instances\";\n }\n\n /** Checks whether the given node key is a `GroupingNodeKey`. */\n export function isGrouping(key: HierarchyNodeKey): key is GroupingNodeKey {\n return !isGeneric(key) && !isInstances(key);\n }\n\n /** Checks whether the given node key is a `ClassGroupingNodeKey`. */\n export function isClassGrouping(key: HierarchyNodeKey): key is ClassGroupingNodeKey {\n return key.type === \"class-grouping\";\n }\n\n /** Checks whether the given node key is a `LabelGroupingNodeKey`. */\n export function isLabelGrouping(key: HierarchyNodeKey): key is LabelGroupingNodeKey {\n return key.type === \"label-grouping\";\n }\n\n /** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */\n export function isPropertyOtherValuesGrouping(key: HierarchyNodeKey): key is PropertyOtherValuesGroupingNodeKey {\n return key.type === \"property-grouping:other\";\n }\n\n /** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */\n export function isPropertyValueRangeGrouping(key: HierarchyNodeKey): key is PropertyValueRangeGroupingNodeKey {\n return key.type === \"property-grouping:range\";\n }\n\n /** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */\n export function isPropertyValueGrouping(key: HierarchyNodeKey): key is PropertyValueGroupingNodeKey {\n return key.type === \"property-grouping:value\";\n }\n\n /** Checks whether the given node key is a `PropertyGroupingNodeKey`. */\n export function isPropertyGrouping(key: HierarchyNodeKey): key is PropertyGroupingNodeKey {\n return isPropertyOtherValuesGrouping(key) || isPropertyValueRangeGrouping(key) || isPropertyValueGrouping(key);\n }\n\n /**\n * Compares two given keys. Returns:\n * - `0` if they are equal,\n * - `negative value` if lhs key is less than rhs key,\n * - `positive value` if lhs key is more than rhs key.\n */\n export function compare(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): number {\n const typeCompareResult = compareStrings(lhs.type, rhs.type);\n if (typeCompareResult !== 0) {\n return typeCompareResult;\n }\n switch (lhs.type) {\n case \"generic\": {\n assert(rhs.type === \"generic\");\n const idCompareResult = compareStrings(lhs.id, rhs.id);\n if (idCompareResult !== 0) {\n return idCompareResult;\n }\n return compareStringsOrUndefined(lhs.source, rhs.source);\n }\n case \"instances\": {\n assert(rhs.type === \"instances\");\n if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {\n return lhs.instanceKeys.length > rhs.instanceKeys.length ? 1 : -1;\n }\n for (let i = 0; i < lhs.instanceKeys.length; ++i) {\n const instanceKeyCompareResult = InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i]);\n if (instanceKeyCompareResult !== 0) {\n return instanceKeyCompareResult;\n }\n const imodelKeyCompareResult = compareStringsOrUndefined(lhs.instanceKeys[0].imodelKey, rhs.instanceKeys[0].imodelKey);\n if (imodelKeyCompareResult !== 0) {\n return imodelKeyCompareResult;\n }\n }\n return 0;\n }\n case \"class-grouping\": {\n assert(rhs.type === \"class-grouping\");\n return compareStrings(lhs.className, rhs.className);\n }\n case \"label-grouping\": {\n assert(rhs.type === \"label-grouping\");\n const labelCompareResult = compareStrings(lhs.label, rhs.label);\n if (labelCompareResult !== 0) {\n return labelCompareResult;\n }\n return compareStringsOrUndefined(lhs.groupId, rhs.groupId);\n }\n case \"property-grouping:other\": {\n assert(rhs.type === \"property-grouping:other\");\n if (lhs.properties.length !== rhs.properties.length) {\n return lhs.properties.length - rhs.properties.length;\n }\n for (let i = 0; i < lhs.properties.length; ++i) {\n const classCompareResult = compareStrings(lhs.properties[i].className, rhs.properties[i].className);\n if (classCompareResult !== 0) {\n return classCompareResult;\n }\n const nameCompareResult = compareStrings(lhs.properties[i].propertyName, rhs.properties[i].propertyName);\n if (nameCompareResult !== 0) {\n return nameCompareResult;\n }\n }\n return 0;\n }\n case \"property-grouping:value\": {\n assert(rhs.type === \"property-grouping:value\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n return compareStrings(lhs.formattedPropertyValue, rhs.formattedPropertyValue);\n }\n case \"property-grouping:range\": {\n assert(rhs.type === \"property-grouping:range\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n if (lhs.fromValue !== rhs.fromValue) {\n return lhs.fromValue > rhs.fromValue ? 1 : -1;\n }\n return lhs.toValue > rhs.toValue ? 1 : lhs.toValue < rhs.toValue ? -1 : 0;\n }\n }\n }\n\n /** Checks whether the two given keys are equal. */\n export function equals(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): boolean {\n return compare(lhs, rhs) === 0;\n }\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GenericInstanceFilter } from "@itwin/core-common";
|
|
2
2
|
import { Event, InstanceKey, IPrimitiveValueFormatter } from "@itwin/presentation-shared";
|
|
3
|
-
import { HierarchyFilteringPath } from "./HierarchyFiltering";
|
|
4
|
-
import { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode";
|
|
3
|
+
import { HierarchyFilteringPath } from "./HierarchyFiltering.js";
|
|
4
|
+
import { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode.js";
|
|
5
5
|
/**
|
|
6
6
|
* Props for the `HierarchyProvider.getNodes` call.
|
|
7
|
-
* @
|
|
7
|
+
* @public
|
|
8
8
|
*/
|
|
9
9
|
export interface GetHierarchyNodesProps {
|
|
10
10
|
/** Parent node to get children for. Pass `undefined` to get root nodes. */
|
|
@@ -24,7 +24,7 @@ export interface GetHierarchyNodesProps {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* An interface for a hierarchy provider that knows how to create child nodes for a given parent node.
|
|
27
|
-
* @
|
|
27
|
+
* @public
|
|
28
28
|
*/
|
|
29
29
|
export interface HierarchyProvider {
|
|
30
30
|
/**
|
|
@@ -54,7 +54,7 @@ export interface HierarchyProvider {
|
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Props for `mergeProviders` function.
|
|
57
|
-
* @
|
|
57
|
+
* @public
|
|
58
58
|
*/
|
|
59
59
|
interface MergeHierarchyProvidersProps {
|
|
60
60
|
/** List of providers to merge. */
|
|
@@ -62,7 +62,7 @@ interface MergeHierarchyProvidersProps {
|
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Creates a single, merged, hierarchy provider from multiple given providers.
|
|
65
|
-
* @
|
|
65
|
+
* @public
|
|
66
66
|
*/
|
|
67
67
|
export declare function mergeProviders({ providers }: MergeHierarchyProvidersProps): HierarchyProvider & {
|
|
68
68
|
dispose: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyProvider.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"HierarchyProvider.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProv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gB,cAAc,CAAC,EAAE,SAAS,EAAE,EAAE,4BAA4B,GAAG,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA2CvH"}
|
|
@@ -7,11 +7,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.mergeProviders = mergeProviders;
|
|
8
8
|
const rxjs_1 = require("rxjs");
|
|
9
9
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const EachValueFrom_js_1 = require("./internal/EachValueFrom.js");
|
|
11
|
+
const Sorting_js_1 = require("./internal/operators/Sorting.js");
|
|
12
12
|
/**
|
|
13
13
|
* Creates a single, merged, hierarchy provider from multiple given providers.
|
|
14
|
-
* @
|
|
14
|
+
* @public
|
|
15
15
|
*/
|
|
16
16
|
function mergeProviders({ providers }) {
|
|
17
17
|
const hierarchyChanged = new core_bentley_1.BeEvent();
|
|
@@ -20,15 +20,15 @@ function mergeProviders({ providers }) {
|
|
|
20
20
|
});
|
|
21
21
|
return {
|
|
22
22
|
hierarchyChanged,
|
|
23
|
-
getNodes: (props) => (0,
|
|
23
|
+
getNodes: (props) => (0, EachValueFrom_js_1.eachValueFrom)((0, rxjs_1.from)(providers).pipe((0, rxjs_1.mergeMap)((provider) => (0, rxjs_1.from)(provider.getNodes(props)).pipe((0, rxjs_1.mergeMap)((node) => {
|
|
24
24
|
if (node.children) {
|
|
25
25
|
return (0, rxjs_1.of)(node);
|
|
26
26
|
}
|
|
27
27
|
// each provider only considers its own data when determining node's children - in case it says
|
|
28
28
|
// the node has no children, we have to check against the other providers too
|
|
29
29
|
return (0, rxjs_1.from)(providers).pipe((0, rxjs_1.filter)((p) => p !== provider), (0, rxjs_1.mergeMap)((p) => p.getNodes({ parentNode: node })), (0, rxjs_1.map)(() => true), (0, rxjs_1.first)(undefined, false), (0, rxjs_1.map)((hasChildren) => ({ ...node, children: hasChildren })));
|
|
30
|
-
}))),
|
|
31
|
-
getNodeInstanceKeys: (props) => (0,
|
|
30
|
+
}))), Sorting_js_1.sortNodesByLabelOperator)),
|
|
31
|
+
getNodeInstanceKeys: (props) => (0, EachValueFrom_js_1.eachValueFrom)((0, rxjs_1.from)(providers).pipe((0, rxjs_1.mergeMap)((p) => p.getNodeInstanceKeys(props)))),
|
|
32
32
|
setFormatter: (formatter) => providers.forEach((p) => p.setFormatter(formatter)),
|
|
33
33
|
setHierarchyFilter: (props) => providers.forEach((p) => p.setHierarchyFilter(props)),
|
|
34
34
|
dispose: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyProvider.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAuFhG,wCA2CC;AAhID,+BAA8D;AAC9D,sDAA6D;AAK7D,
|
|
1
|
+
{"version":3,"file":"HierarchyProvider.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAuFhG,wCA2CC;AAhID,+BAA8D;AAC9D,sDAA6D;AAK7D,kEAA4D;AAC5D,gEAA2E;AA0E3E;;;GAGG;AACH,SAAgB,cAAc,CAAC,EAAE,SAAS,EAAgC;IACxE,MAAM,gBAAgB,GAAG,IAAI,sBAAO,EAAc,CAAC;IACnD,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QACtB,CAAC,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,gBAAgB;QAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,IAAA,gCAAa,EACX,IAAA,WAAI,EAAC,SAAS,CAAC,CAAC,IAAI,CAClB,IAAA,eAAQ,EAAC,CAAC,QAAQ,EAAE,EAAE,CACpB,IAAA,WAAI,EAAC,QAAQ,CAA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AE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpF,OAAO,EAAE,GAAG,EAAE;YACZ,gBAAgB,CAAC,KAAK,EAAE,CAAC;YACzB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBACtB,IAAA,4BAAa,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;YAClC,CAAC,CAAC,CAAC;QACL,CAAC;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 { filter, first, from, map, mergeMap, of } from \"rxjs\";\nimport { BeEvent, isIDisposable } from \"@itwin/core-bentley\";\nimport { GenericInstanceFilter } from \"@itwin/core-common\";\nimport { Event, InstanceKey, IPrimitiveValueFormatter } from \"@itwin/presentation-shared\";\nimport { HierarchyFilteringPath } from \"./HierarchyFiltering.js\";\nimport { HierarchyNode, ParentHierarchyNode } from \"./HierarchyNode.js\";\nimport { eachValueFrom } from \"./internal/EachValueFrom.js\";\nimport { sortNodesByLabelOperator } from \"./internal/operators/Sorting.js\";\n\n/**\n * Props for the `HierarchyProvider.getNodes` call.\n * @public\n */\nexport interface GetHierarchyNodesProps {\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: ParentHierarchyNode | undefined;\n\n /** Optional hierarchy level filter. Has no effect if `parentNode` is a `GroupingNode`. */\n instanceFilter?: GenericInstanceFilter;\n\n /**\n * Optional hierarchy level size limit override. This value is passed to `LimitingECSqlQueryExecutor` used\n * by this provider to override query rows limit per hierarchy level. If not provided, defaults to whatever\n * is used by the limiting query executor.\n *\n * Has no effect if `parentNode` is a `GroupingNode`.\n */\n hierarchyLevelSizeLimit?: number | \"unbounded\";\n\n /** When set to true ignores the cache and fetches the nodes again. */\n ignoreCache?: boolean;\n}\n\n/**\n * An interface for a hierarchy provider that knows how to create child nodes for a given parent node.\n * @public\n */\nexport interface HierarchyProvider {\n /**\n * An event that provider raises when the internal data source changes, resulting in a\n * hierarchy change.\n *\n * Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.\n */\n readonly hierarchyChanged: Event<() => void>;\n\n /** Gets nodes for the specified parent node. */\n getNodes(props: GetHierarchyNodesProps): AsyncIterableIterator<HierarchyNode>;\n\n /** Gets instance keys for the specified parent node. */\n getNodeInstanceKeys(props: Omit<GetHierarchyNodesProps, \"ignoreCache\">): AsyncIterableIterator<InstanceKey>;\n\n /**\n * Overrides the property value formatter used by the hierarchy provider. Setting to `undefined`\n * resets the formatter to the result of `createDefaultValueFormatter` called with default parameters.\n */\n setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;\n\n /**\n * Sets the hierarchy filter used by this hierarchy provider. Setting to `undefined`\n * removes the filter.\n */\n setHierarchyFilter(\n props:\n | {\n /** A list of node identifiers from root to target node. */\n paths: HierarchyFilteringPath[];\n }\n | undefined,\n ): void;\n}\n\n/**\n * Props for `mergeProviders` function.\n * @public\n */\ninterface MergeHierarchyProvidersProps {\n /** List of providers to merge. */\n providers: HierarchyProvider[];\n}\n\n/**\n * Creates a single, merged, hierarchy provider from multiple given providers.\n * @public\n */\nexport function mergeProviders({ providers }: MergeHierarchyProvidersProps): HierarchyProvider & { dispose: () => void } {\n const hierarchyChanged = new BeEvent<() => void>();\n providers.forEach((p) => {\n p.hierarchyChanged.addListener(() => hierarchyChanged.raiseEvent());\n });\n\n return {\n hierarchyChanged,\n getNodes: (props) =>\n eachValueFrom(\n from(providers).pipe(\n mergeMap((provider) =>\n from(provider.getNodes(props)).pipe(\n mergeMap((node) => {\n if (node.children) {\n return of(node);\n }\n // each provider only considers its own data when determining node's children - in case it says\n // the node has no children, we have to check against the other providers too\n return from(providers).pipe(\n filter((p) => p !== provider),\n mergeMap((p) => p.getNodes({ parentNode: node })),\n map(() => true),\n first(undefined, false),\n map((hasChildren) => ({ ...node, children: hasChildren })),\n );\n }),\n ),\n ),\n sortNodesByLabelOperator,\n // TODO: consider merging similar nodes\n ),\n ),\n getNodeInstanceKeys: (props) => eachValueFrom(from(providers).pipe(mergeMap((p) => p.getNodeInstanceKeys(props)))),\n setFormatter: (formatter) => providers.forEach((p) => p.setFormatter(formatter)),\n setHierarchyFilter: (props) => providers.forEach((p) => p.setHierarchyFilter(props)),\n dispose: () => {\n hierarchyChanged.clear();\n providers.forEach((p) => {\n isIDisposable(p) && p.dispose();\n });\n },\n };\n}\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ILogger } from "@itwin/presentation-shared";
|
|
2
2
|
/**
|
|
3
3
|
* Set logger to use by this package. By default the package uses a no-op logger.
|
|
4
|
-
* @
|
|
4
|
+
* @public
|
|
5
5
|
*/
|
|
6
6
|
export declare function setLogger(logger: ILogger | undefined): void;
|
|
7
7
|
/**
|
|
8
8
|
* Get logger used by this package.
|
|
9
9
|
* @see `setLogger`
|
|
10
|
-
* @
|
|
10
|
+
* @public
|
|
11
11
|
*/
|
|
12
12
|
export declare function getLogger(): ILogger;
|
|
13
13
|
//# sourceMappingURL=Logging.d.ts.map
|
|
@@ -11,15 +11,15 @@ const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
|
11
11
|
let g_logger = presentation_shared_1.NOOP_LOGGER;
|
|
12
12
|
/**
|
|
13
13
|
* Set logger to use by this package. By default the package uses a no-op logger.
|
|
14
|
-
* @
|
|
14
|
+
* @public
|
|
15
15
|
*/
|
|
16
16
|
function setLogger(logger) {
|
|
17
|
-
g_logger = logger ?? /*
|
|
17
|
+
g_logger = logger ?? /* c8 ignore next */ presentation_shared_1.NOOP_LOGGER;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Get logger used by this package.
|
|
21
21
|
* @see `setLogger`
|
|
22
|
-
* @
|
|
22
|
+
* @public
|
|
23
23
|
*/
|
|
24
24
|
function getLogger() {
|
|
25
25
|
return g_logger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/hierarchies/Logging.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAWhG,8BAEC;AAOD,8BAEC;AApBD,oEAAkE;AAElE,gEAAgE;AAChE,IAAI,QAAQ,GAAY,iCAAW,CAAC;AAEpC;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAA2B;IACnD,QAAQ,GAAG,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/hierarchies/Logging.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAWhG,8BAEC;AAOD,8BAEC;AApBD,oEAAkE;AAElE,gEAAgE;AAChE,IAAI,QAAQ,GAAY,iCAAW,CAAC;AAEpC;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAA2B;IACnD,QAAQ,GAAG,MAAM,IAAI,oBAAoB,CAAC,iCAAW,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS;IACvB,OAAO,QAAQ,CAAC;AAClB,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 { ILogger, NOOP_LOGGER } from \"@itwin/presentation-shared\";\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet g_logger: ILogger = NOOP_LOGGER;\n\n/**\n * Set logger to use by this package. By default the package uses a no-op logger.\n * @public\n */\nexport function setLogger(logger: ILogger | undefined) {\n g_logger = logger ?? /* c8 ignore next */ NOOP_LOGGER;\n}\n\n/**\n * Get logger used by this package.\n * @see `setLogger`\n * @public\n */\nexport function getLogger(): ILogger {\n return g_logger;\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ECClassHierarchyInspector, InstanceKey } from "@itwin/presentation-shared";
|
|
2
|
-
import { HierarchyFilteringPath
|
|
3
|
-
import {
|
|
4
|
-
import { DefineHierarchyLevelProps, HierarchyDefinition, HierarchyLevelDefinition, InstanceNodesQueryDefinition, NodeParser, NodePostProcessor, NodePreProcessor } from "./IModelHierarchyDefinition";
|
|
2
|
+
import { HierarchyFilteringPath } from "../HierarchyFiltering.js";
|
|
3
|
+
import { DefineHierarchyLevelProps, HierarchyDefinition, HierarchyLevelDefinition, InstanceNodesQueryDefinition, NodeParser, NodePostProcessor, NodePreProcessor } from "./IModelHierarchyDefinition.js";
|
|
5
4
|
interface FilteringHierarchyDefinitionProps {
|
|
6
5
|
imodelAccess: ECClassHierarchyInspector & {
|
|
7
6
|
imodelKey: string;
|
|
@@ -22,19 +21,6 @@ export declare class FilteringHierarchyDefinition implements HierarchyDefinition
|
|
|
22
21
|
private getChildrenIdentifierPaths;
|
|
23
22
|
defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition>;
|
|
24
23
|
}
|
|
25
|
-
type MatchedFilter<TIdentifier extends HierarchyNodeIdentifier> = {
|
|
26
|
-
id: TIdentifier;
|
|
27
|
-
childrenIdentifierPaths: HierarchyFilteringPath[];
|
|
28
|
-
} & ({
|
|
29
|
-
isFilterTarget: false;
|
|
30
|
-
} | {
|
|
31
|
-
isFilterTarget: true;
|
|
32
|
-
filterTargetOptions?: HierarchyFilteringPathOptions;
|
|
33
|
-
});
|
|
34
|
-
/** @internal */
|
|
35
|
-
export declare const ECSQL_COLUMN_NAME_IsFilterTarget = "IsFilterTarget";
|
|
36
|
-
/** @internal */
|
|
37
|
-
export declare const ECSQL_COLUMN_NAME_FilterTargetOptions = "FilterTargetOptions";
|
|
38
24
|
/** @internal */
|
|
39
25
|
export declare const ECSQL_COLUMN_NAME_HasFilterTargetAncestor = "HasFilterTargetAncestor";
|
|
40
26
|
/** @internal */
|
|
@@ -42,6 +28,8 @@ export declare const ECSQL_COLUMN_NAME_FilterECInstanceId = "FilterECInstanceId"
|
|
|
42
28
|
/** @internal */
|
|
43
29
|
export declare const ECSQL_COLUMN_NAME_FilterClassName = "FilterClassName";
|
|
44
30
|
/** @internal */
|
|
45
|
-
export declare function applyECInstanceIdsFilter(def: InstanceNodesQueryDefinition, matchingFilters: Array<
|
|
31
|
+
export declare function applyECInstanceIdsFilter(def: InstanceNodesQueryDefinition, matchingFilters: Array<{
|
|
32
|
+
id: InstanceKey;
|
|
33
|
+
}>, hasFilterTargetAncestor: boolean): InstanceNodesQueryDefinition;
|
|
46
34
|
export {};
|
|
47
35
|
//# sourceMappingURL=FilteringHierarchyDefinition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilteringHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/FilteringHierarchyDefinition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilteringHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/FilteringHierarchyDefinition.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAyB,sBAAsB,EAAiC,MAAM,0BAA0B,CAAC;AAIxH,OAAO,EACL,yBAAyB,EAEzB,mBAAmB,EAEnB,wBAAwB,EAExB,4BAA4B,EAC5B,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,gCAAgC,CAAC;AAIxC,UAAU,iCAAiC;IACzC,YAAY,EAAE,yBAAyB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,MAAM,EAAE,mBAAmB,CAAC;IAC5B,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;CAC/C;AAED,gBAAgB;AAChB,qBAAa,4BAA6B,YAAW,mBAAmB;IACtE,OAAO,CAAC,aAAa,CAAoD;IACzE,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,oBAAoB,CAA2B;gBAEpC,KAAK,EAAE,iCAAiC;IAM3D,IAAW,cAAc,IAAI,gBAAgB,CAS5C;IAED,OAAO,CAAC,wBAAwB;IA2ChC,IAAW,eAAe,IAAI,iBAAiB,CAS9C;IAED,IAAW,SAAS,IAAI,UAAU,CAqBjC;YAEa,0BAA0B;IA8C3B,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CA+DvG;AA4GD,gBAAgB;AAEhB,eAAO,MAAM,yCAAyC,4BAA4B,CAAC;AAEnF,gBAAgB;AAEhB,eAAO,MAAM,oCAAoC,uBAAuB,CAAC;AAEzE,gBAAgB;AAEhB,eAAO,MAAM,iCAAiC,oBAAoB,CAAC;AAenE,gBAAgB;AAChB,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,4BAA4B,EACjC,eAAe,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,WAAW,CAAA;CAAE,CAAC,EAC3C,uBAAuB,EAAE,OAAO,GAC/B,4BAA4B,CAoC9B"}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ECSQL_COLUMN_NAME_FilterClassName = exports.ECSQL_COLUMN_NAME_FilterECInstanceId = exports.ECSQL_COLUMN_NAME_HasFilterTargetAncestor = exports.
|
|
7
|
+
exports.ECSQL_COLUMN_NAME_FilterClassName = exports.ECSQL_COLUMN_NAME_FilterECInstanceId = exports.ECSQL_COLUMN_NAME_HasFilterTargetAncestor = exports.FilteringHierarchyDefinition = void 0;
|
|
8
8
|
exports.applyECInstanceIdsFilter = applyECInstanceIdsFilter;
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
9
|
+
const HierarchyFiltering_js_1 = require("../HierarchyFiltering.js");
|
|
10
|
+
const HierarchyNode_js_1 = require("../HierarchyNode.js");
|
|
11
|
+
const HierarchyNodeIdentifier_js_1 = require("../HierarchyNodeIdentifier.js");
|
|
12
|
+
const IModelHierarchyDefinition_js_1 = require("./IModelHierarchyDefinition.js");
|
|
13
|
+
const IModelHierarchyNode_js_1 = require("./IModelHierarchyNode.js");
|
|
14
|
+
const TreeNodesReader_js_1 = require("./TreeNodesReader.js");
|
|
15
15
|
/** @internal */
|
|
16
16
|
class FilteringHierarchyDefinition {
|
|
17
17
|
_imodelAccess;
|
|
@@ -34,7 +34,7 @@ class FilteringHierarchyDefinition {
|
|
|
34
34
|
}
|
|
35
35
|
shouldExpandGroupingNode(node) {
|
|
36
36
|
for (const child of node.children) {
|
|
37
|
-
|
|
37
|
+
/* c8 ignore next 3 */
|
|
38
38
|
if (!child.filtering) {
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
@@ -57,7 +57,7 @@ class FilteringHierarchyDefinition {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
if (!child.filtering.filteredChildrenIdentifierPaths) {
|
|
60
|
-
|
|
60
|
+
/* c8 ignore next */
|
|
61
61
|
continue;
|
|
62
62
|
}
|
|
63
63
|
for (const path of child.filtering.filteredChildrenIdentifierPaths) {
|
|
@@ -72,7 +72,7 @@ class FilteringHierarchyDefinition {
|
|
|
72
72
|
return async (node) => {
|
|
73
73
|
const processedNode = this._source.postProcessNode ? await this._source.postProcessNode(node) : node;
|
|
74
74
|
// instance nodes get the auto-expand flag in `parseNode`, but grouping ones need to be handled during post-processing
|
|
75
|
-
if (
|
|
75
|
+
if (IModelHierarchyNode_js_1.ProcessedHierarchyNode.isGroupingNode(node) && this.shouldExpandGroupingNode(node)) {
|
|
76
76
|
Object.assign(processedNode, { autoExpand: true });
|
|
77
77
|
}
|
|
78
78
|
return processedNode;
|
|
@@ -81,17 +81,13 @@ class FilteringHierarchyDefinition {
|
|
|
81
81
|
get parseNode() {
|
|
82
82
|
return async (row, parentNode) => {
|
|
83
83
|
const hasFilterTargetAncestor = !!row[exports.ECSQL_COLUMN_NAME_HasFilterTargetAncestor];
|
|
84
|
-
const isFilterTarget =
|
|
85
|
-
const filterTargetOptions = row[exports.ECSQL_COLUMN_NAME_FilterTargetOptions]
|
|
86
|
-
? JSON.parse(row[exports.ECSQL_COLUMN_NAME_FilterTargetOptions])
|
|
87
|
-
: undefined;
|
|
88
|
-
const filteredChildrenIdentifierPaths = row[exports.ECSQL_COLUMN_NAME_FilterECInstanceId] && row[exports.ECSQL_COLUMN_NAME_FilterClassName]
|
|
84
|
+
const { filteredChildrenIdentifierPaths, filterTargetOptions, isFilterTarget } = row[exports.ECSQL_COLUMN_NAME_FilterECInstanceId] && row[exports.ECSQL_COLUMN_NAME_FilterClassName]
|
|
89
85
|
? await this.getChildrenIdentifierPaths(parentNode?.filtering?.filteredChildrenIdentifierPaths ?? this._nodeIdentifierPaths, {
|
|
90
86
|
className: row[exports.ECSQL_COLUMN_NAME_FilterClassName],
|
|
91
87
|
id: row[exports.ECSQL_COLUMN_NAME_FilterECInstanceId],
|
|
92
88
|
})
|
|
93
|
-
: [];
|
|
94
|
-
const defaultNode = await (this._source.parseNode ??
|
|
89
|
+
: { filteredChildrenIdentifierPaths: [], filterTargetOptions: undefined, isFilterTarget: false };
|
|
90
|
+
const defaultNode = await (this._source.parseNode ?? TreeNodesReader_js_1.defaultNodesParser)(row);
|
|
95
91
|
return applyFilterAttributes({
|
|
96
92
|
node: defaultNode,
|
|
97
93
|
filteredChildrenIdentifierPaths,
|
|
@@ -104,19 +100,21 @@ class FilteringHierarchyDefinition {
|
|
|
104
100
|
async getChildrenIdentifierPaths(filteredChildrenNodeIdentifierPaths, providedIdentifier) {
|
|
105
101
|
const { id, className } = providedIdentifier;
|
|
106
102
|
let filteredChildrenIdentifierPaths;
|
|
103
|
+
let isFilterTarget = false;
|
|
104
|
+
let filterTargetOptions;
|
|
107
105
|
for (const filteredChildrenNodeIdentifierPath of filteredChildrenNodeIdentifierPaths) {
|
|
108
|
-
const path =
|
|
109
|
-
|
|
110
|
-
if (path.
|
|
106
|
+
const { path, options } = HierarchyFiltering_js_1.HierarchyFilteringPath.normalize(filteredChildrenNodeIdentifierPath);
|
|
107
|
+
/* c8 ignore next 3 */
|
|
108
|
+
if (path.length === 0) {
|
|
111
109
|
continue;
|
|
112
110
|
}
|
|
113
111
|
// We need to check if identifiers have the same id and imodelKey and are
|
|
114
112
|
// of the same class / derived class / is derived from class
|
|
115
|
-
const identifier = path
|
|
113
|
+
const identifier = path[0];
|
|
116
114
|
if (identifier.id !== id) {
|
|
117
115
|
continue;
|
|
118
116
|
}
|
|
119
|
-
if (
|
|
117
|
+
if (HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.isInstanceNodeIdentifier(identifier)) {
|
|
120
118
|
if (identifier.imodelKey && identifier.imodelKey !== this._imodelAccess.imodelKey) {
|
|
121
119
|
continue;
|
|
122
120
|
}
|
|
@@ -129,24 +127,31 @@ class FilteringHierarchyDefinition {
|
|
|
129
127
|
if (!filteredChildrenIdentifierPaths) {
|
|
130
128
|
filteredChildrenIdentifierPaths = [];
|
|
131
129
|
}
|
|
132
|
-
if (path.
|
|
133
|
-
filteredChildrenIdentifierPaths.push(
|
|
130
|
+
if (path.length > 1) {
|
|
131
|
+
filteredChildrenIdentifierPaths.push(options ? { path: path.slice(1), options } : path.slice(1));
|
|
132
|
+
}
|
|
133
|
+
else if (isFilterTarget) {
|
|
134
|
+
filterTargetOptions = HierarchyFiltering_js_1.HierarchyFilteringPath.mergeOptions(filterTargetOptions, options);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
isFilterTarget = true;
|
|
138
|
+
filterTargetOptions = options;
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
|
-
return filteredChildrenIdentifierPaths;
|
|
141
|
+
return { filteredChildrenIdentifierPaths, filterTargetOptions, isFilterTarget };
|
|
137
142
|
}
|
|
138
143
|
async defineHierarchyLevel(props) {
|
|
139
144
|
const sourceDefinitions = await this._source.defineHierarchyLevel(props);
|
|
140
|
-
const filteringProps = (0,
|
|
145
|
+
const filteringProps = (0, HierarchyFiltering_js_1.extractFilteringProps)(this._nodeIdentifierPaths, props.parentNode);
|
|
141
146
|
if (!filteringProps) {
|
|
142
147
|
return sourceDefinitions;
|
|
143
148
|
}
|
|
144
149
|
const filteredDefinitions = [];
|
|
145
150
|
await Promise.all(sourceDefinitions.map(async (definition) => {
|
|
146
151
|
let matchedDefinition;
|
|
147
|
-
if (
|
|
152
|
+
if (IModelHierarchyDefinition_js_1.HierarchyNodesDefinition.isGenericNode(definition)) {
|
|
148
153
|
matchedDefinition = await matchFilters(definition, filteringProps, async (id) => {
|
|
149
|
-
return (
|
|
154
|
+
return (HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.isGenericNodeIdentifier(id) &&
|
|
150
155
|
(!id.source || id.source === this._imodelAccess.imodelKey) &&
|
|
151
156
|
id.id === definition.node.key);
|
|
152
157
|
}, this._imodelAccess, (def, matchingFilters) => {
|
|
@@ -157,6 +162,7 @@ class FilteringHierarchyDefinition {
|
|
|
157
162
|
node: def.node,
|
|
158
163
|
filteredChildrenIdentifierPaths,
|
|
159
164
|
isFilterTarget: matchingFilters.some((mc) => mc.isFilterTarget),
|
|
165
|
+
filterTargetOptions: matchingFilters.find((mc) => mc.isFilterTarget)?.filterTargetOptions,
|
|
160
166
|
hasFilterTargetAncestor: filteringProps.hasFilterTargetAncestor,
|
|
161
167
|
}),
|
|
162
168
|
};
|
|
@@ -164,7 +170,7 @@ class FilteringHierarchyDefinition {
|
|
|
164
170
|
}
|
|
165
171
|
else {
|
|
166
172
|
matchedDefinition = await matchFilters(definition, filteringProps, async (id) => {
|
|
167
|
-
return (
|
|
173
|
+
return (HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.isInstanceNodeIdentifier(id) &&
|
|
168
174
|
(!id.imodelKey || id.imodelKey === this._imodelAccess.imodelKey) &&
|
|
169
175
|
(await this._imodelAccess.classDerivesFrom(id.className, definition.fullClassName)));
|
|
170
176
|
}, this._imodelAccess, (def, matchingFilters) => applyECInstanceIdsFilter(def, matchingFilters, !!filteringProps.hasFilterTargetAncestor), false);
|
|
@@ -177,11 +183,11 @@ class FilteringHierarchyDefinition {
|
|
|
177
183
|
}
|
|
178
184
|
}
|
|
179
185
|
exports.FilteringHierarchyDefinition = FilteringHierarchyDefinition;
|
|
180
|
-
async function matchFilters(definition, filteringProps, predicate, classHierarchy, matchedDefinitionProcessor,
|
|
186
|
+
async function matchFilters(definition, filteringProps, predicate, classHierarchy, matchedDefinitionProcessor, extractPathsAndOptions = true) {
|
|
181
187
|
const { filteredNodePaths, hasFilterTargetAncestor } = filteringProps;
|
|
182
188
|
const matchingFilters = [];
|
|
183
189
|
for (const filteredNodePath of filteredNodePaths) {
|
|
184
|
-
const { path, options } =
|
|
190
|
+
const { path, options } = HierarchyFiltering_js_1.HierarchyFilteringPath.normalize(filteredNodePath);
|
|
185
191
|
if (path.length === 0) {
|
|
186
192
|
continue;
|
|
187
193
|
}
|
|
@@ -198,13 +204,14 @@ async function matchFilters(definition, filteringProps, predicate, classHierarch
|
|
|
198
204
|
};
|
|
199
205
|
matchingFilters.push(entry);
|
|
200
206
|
}
|
|
207
|
+
if (!extractPathsAndOptions) {
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
201
210
|
if (path.length > 1) {
|
|
202
|
-
|
|
203
|
-
entry.childrenIdentifierPaths.push(options ? { path: path.slice(1), options } : path.slice(1));
|
|
204
|
-
}
|
|
211
|
+
entry.childrenIdentifierPaths.push(options ? { path: path.slice(1), options } : path.slice(1));
|
|
205
212
|
}
|
|
206
213
|
else if (entry.isFilterTarget) {
|
|
207
|
-
entry.filterTargetOptions =
|
|
214
|
+
entry.filterTargetOptions = HierarchyFiltering_js_1.HierarchyFilteringPath.mergeOptions(entry.filterTargetOptions, options);
|
|
208
215
|
}
|
|
209
216
|
else {
|
|
210
217
|
Object.assign(entry, { isFilterTarget: true, filterTargetOptions: options });
|
|
@@ -225,24 +232,24 @@ async function findMatchingFilterEntry(filters, nodeId, classHierarchy) {
|
|
|
225
232
|
return undefined;
|
|
226
233
|
}
|
|
227
234
|
async function identifiersEqual(lhs, rhs, classHierarchy) {
|
|
228
|
-
if (
|
|
235
|
+
if (HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.isInstanceNodeIdentifier(lhs) && HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.isInstanceNodeIdentifier(rhs)) {
|
|
229
236
|
return (lhs.id === rhs.id &&
|
|
230
237
|
(lhs.className === rhs.className ||
|
|
231
238
|
(await classHierarchy.classDerivesFrom(lhs.className, rhs.className)) ||
|
|
232
239
|
(await classHierarchy.classDerivesFrom(rhs.className, lhs.className))));
|
|
233
240
|
}
|
|
234
|
-
return
|
|
241
|
+
return HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.equal(lhs, rhs);
|
|
235
242
|
}
|
|
236
243
|
function applyFilterAttributes(props) {
|
|
237
244
|
const { node, filteredChildrenIdentifierPaths } = props;
|
|
238
245
|
const result = { ...node };
|
|
239
246
|
const shouldAutoExpand = !!filteredChildrenIdentifierPaths?.some((childPath) => {
|
|
240
|
-
return !!
|
|
247
|
+
return !!HierarchyFiltering_js_1.HierarchyFilteringPath.normalize(childPath).options?.autoExpand;
|
|
241
248
|
});
|
|
242
249
|
if (shouldAutoExpand) {
|
|
243
250
|
result.autoExpand = true;
|
|
244
251
|
}
|
|
245
|
-
const filteringProps =
|
|
252
|
+
const filteringProps = HierarchyNode_js_1.HierarchyNodeFilteringProps.create(props);
|
|
246
253
|
if (filteringProps) {
|
|
247
254
|
result.filtering = filteringProps;
|
|
248
255
|
}
|
|
@@ -250,12 +257,6 @@ function applyFilterAttributes(props) {
|
|
|
250
257
|
}
|
|
251
258
|
/** @internal */
|
|
252
259
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
253
|
-
exports.ECSQL_COLUMN_NAME_IsFilterTarget = "IsFilterTarget";
|
|
254
|
-
/** @internal */
|
|
255
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
256
|
-
exports.ECSQL_COLUMN_NAME_FilterTargetOptions = "FilterTargetOptions";
|
|
257
|
-
/** @internal */
|
|
258
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
259
260
|
exports.ECSQL_COLUMN_NAME_HasFilterTargetAncestor = "HasFilterTargetAncestor";
|
|
260
261
|
/** @internal */
|
|
261
262
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -263,32 +264,43 @@ exports.ECSQL_COLUMN_NAME_FilterECInstanceId = "FilterECInstanceId";
|
|
|
263
264
|
/** @internal */
|
|
264
265
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
265
266
|
exports.ECSQL_COLUMN_NAME_FilterClassName = "FilterClassName";
|
|
267
|
+
function getClassECInstanceIds(matchingFilters) {
|
|
268
|
+
const classNameECInstanceIds = new Map();
|
|
269
|
+
for (const matchingFilter of matchingFilters) {
|
|
270
|
+
const entry = classNameECInstanceIds.get(matchingFilter.id.className);
|
|
271
|
+
if (entry === undefined) {
|
|
272
|
+
classNameECInstanceIds.set(matchingFilter.id.className, [matchingFilter.id.id]);
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
entry.push(matchingFilter.id.id);
|
|
276
|
+
}
|
|
277
|
+
return classNameECInstanceIds;
|
|
278
|
+
}
|
|
266
279
|
/** @internal */
|
|
267
280
|
function applyECInstanceIdsFilter(def, matchingFilters, hasFilterTargetAncestor) {
|
|
268
281
|
if (matchingFilters.length === 0) {
|
|
269
282
|
return def;
|
|
270
283
|
}
|
|
284
|
+
const matchingFiltersToUse = getClassECInstanceIds(matchingFilters);
|
|
271
285
|
return {
|
|
272
286
|
...def,
|
|
273
287
|
query: {
|
|
274
288
|
...def.query,
|
|
275
289
|
ctes: [
|
|
276
290
|
...(def.query.ctes ?? []),
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
291
|
+
`FilteringInfo(ECInstanceId, FilterClassName) AS (
|
|
292
|
+
${Array.from(matchingFiltersToUse)
|
|
293
|
+
.map(([className, ecInstanceIds]) => `
|
|
294
|
+
SELECT ECInstanceId, '${className}' AS FilterClassName
|
|
295
|
+
FROM ${className}
|
|
296
|
+
WHERE ECInstanceId IN (${ecInstanceIds.join(", ")})
|
|
297
|
+
`)
|
|
284
298
|
.join(" UNION ALL ")}
|
|
285
299
|
)`,
|
|
286
300
|
],
|
|
287
301
|
ecsql: `
|
|
288
302
|
SELECT
|
|
289
303
|
[q].*,
|
|
290
|
-
[f].[IsFilterTarget] AS [${exports.ECSQL_COLUMN_NAME_IsFilterTarget}],
|
|
291
|
-
[f].[FilterTargetOptions] AS [${exports.ECSQL_COLUMN_NAME_FilterTargetOptions}],
|
|
292
304
|
${hasFilterTargetAncestor ? "1" : "0"} AS [${exports.ECSQL_COLUMN_NAME_HasFilterTargetAncestor}],
|
|
293
305
|
IdToHex([f].[ECInstanceId]) AS [${exports.ECSQL_COLUMN_NAME_FilterECInstanceId}],
|
|
294
306
|
[f].[FilterClassName] AS [${exports.ECSQL_COLUMN_NAME_FilterClassName}]
|