@itwin/presentation-hierarchies 2.0.0-alpha.15 → 2.0.0-alpha.17
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 +74 -0
- package/README.md +6 -17
- package/lib/hierarchies/HierarchyErrors.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyErrors.js.map +1 -0
- package/lib/hierarchies/HierarchyMerge.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyMerge.js.map +1 -0
- package/lib/hierarchies/HierarchyNode.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyNode.js.map +1 -0
- package/lib/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.d.ts +4 -4
- package/lib/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.js +5 -5
- package/lib/hierarchies/HierarchyNodeKey.js.map +1 -0
- package/lib/hierarchies/HierarchyProvider.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyProvider.js.map +1 -0
- package/lib/hierarchies/HierarchySearch.d.ts.map +1 -0
- package/lib/hierarchies/HierarchySearch.js.map +1 -0
- package/lib/hierarchies/Logging.d.ts.map +1 -0
- package/lib/hierarchies/Logging.js.map +1 -0
- package/lib/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
- package/lib/hierarchies/imodel/HierarchyCache.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.d.ts +3 -34
- package/lib/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.d.ts +2 -2
- package/lib/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/IModelHierarchyProvider.d.ts +20 -2
- package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyProvider.js +27 -21
- package/lib/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
- package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.js +6 -2
- package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.d.ts +8 -7
- package/lib/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.js +16 -11
- package/lib/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.d.ts +2 -2
- package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/SearchHierarchyDefinition.js +3 -4
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.d.ts +1 -1
- package/lib/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.js +2 -5
- package/lib/hierarchies/imodel/TreeNodesReader.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/Utils.d.ts +1 -0
- package/lib/hierarchies/imodel/Utils.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/Utils.js +1 -0
- package/lib/hierarchies/imodel/Utils.js.map +1 -0
- package/lib/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
- package/lib/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/Grouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
- package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.js +4 -4
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.js +3 -3
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.js +10 -9
- package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
- package/lib/hierarchies/internal/Common.d.ts.map +1 -0
- package/lib/hierarchies/internal/Common.js.map +1 -0
- package/lib/hierarchies/internal/DisposePolyfill.d.ts.map +1 -0
- package/lib/hierarchies/internal/DisposePolyfill.js.map +1 -0
- package/lib/hierarchies/internal/EachValueFrom.d.ts.map +1 -0
- package/lib/hierarchies/internal/EachValueFrom.js.map +1 -0
- package/lib/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
- package/lib/hierarchies/internal/LoggingUtils.js.map +1 -0
- package/lib/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -0
- package/lib/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
- package/lib/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
- package/lib/hierarchies/internal/operators/Partition.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/Partition.js.map +1 -0
- package/lib/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
- package/lib/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
- package/lib/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
- package/lib/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/Sorting.js.map +1 -0
- package/lib/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/TapOnce.js.map +1 -0
- package/lib/{esm/presentation-hierarchies.d.ts → presentation-hierarchies.d.ts} +0 -2
- package/lib/presentation-hierarchies.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies.js → presentation-hierarchies.js} +0 -1
- package/lib/presentation-hierarchies.js.map +1 -0
- package/package.json +19 -21
- package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyErrors.js +0 -20
- package/lib/cjs/hierarchies/HierarchyErrors.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyMerge.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyMerge.js +0 -43
- package/lib/cjs/hierarchies/HierarchyMerge.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNode.js +0 -82
- package/lib/cjs/hierarchies/HierarchyNode.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +0 -52
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +0 -162
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.js +0 -166
- package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyProvider.js +0 -64
- package/lib/cjs/hierarchies/HierarchyProvider.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchySearch.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchySearch.js +0 -468
- package/lib/cjs/hierarchies/HierarchySearch.js.map +0 -1
- package/lib/cjs/hierarchies/Logging.d.ts.map +0 -1
- package/lib/cjs/hierarchies/Logging.js +0 -27
- package/lib/cjs/hierarchies/Logging.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js +0 -81
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +0 -175
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +0 -21
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +0 -234
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +0 -29
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +0 -651
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +0 -122
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +0 -230
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +0 -624
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +0 -140
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +0 -94
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js +0 -268
- package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +0 -35
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +0 -51
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/Utils.d.ts +0 -4
- package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/Utils.js +0 -71
- package/lib/cjs/hierarchies/imodel/Utils.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +0 -40
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js +0 -176
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +0 -75
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +0 -84
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js +0 -26
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +0 -113
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +0 -54
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +0 -49
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +0 -52
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +0 -310
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js +0 -31
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
- package/lib/cjs/hierarchies/internal/Common.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/Common.js +0 -91
- package/lib/cjs/hierarchies/internal/Common.js.map +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.js +0 -11
- package/lib/cjs/hierarchies/internal/DisposePolyfill.js.map +0 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.js +0 -111
- package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +0 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.js +0 -37
- package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +0 -1
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +0 -28
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +0 -54
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Partition.js +0 -60
- package/lib/cjs/hierarchies/internal/operators/Partition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +0 -50
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +0 -24
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +0 -23
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.js +0 -25
- package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js +0 -19
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +0 -1
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/presentation-hierarchies.d.ts +0 -26
- package/lib/cjs/presentation-hierarchies.d.ts.map +0 -1
- package/lib/cjs/presentation-hierarchies.js +0 -43
- package/lib/cjs/presentation-hierarchies.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyErrors.d.ts +0 -9
- package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyErrors.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyMerge.d.ts +0 -19
- package/lib/esm/hierarchies/HierarchyMerge.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyMerge.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNode.d.ts +0 -149
- package/lib/esm/hierarchies/HierarchyNode.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNode.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +0 -31
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyProvider.d.ts +0 -134
- package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyProvider.js.map +0 -1
- package/lib/esm/hierarchies/HierarchySearch.d.ts +0 -297
- package/lib/esm/hierarchies/HierarchySearch.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchySearch.js.map +0 -1
- package/lib/esm/hierarchies/Logging.d.ts +0 -13
- package/lib/esm/hierarchies/Logging.d.ts.map +0 -1
- package/lib/esm/hierarchies/Logging.js.map +0 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +0 -18
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -120
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +0 -21
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts +0 -35
- package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +0 -1
- package/lib/esm/hierarchies/imodel/Utils.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/Utils.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts +0 -26
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +0 -4
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +0 -4
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +0 -32
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts +0 -5
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
- package/lib/esm/hierarchies/internal/Common.d.ts +0 -61
- package/lib/esm/hierarchies/internal/Common.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/Common.js.map +0 -1
- package/lib/esm/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/DisposePolyfill.js.map +0 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +0 -12
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.js.map +0 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +0 -12
- package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.js.map +0 -1
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts +0 -75
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +0 -17
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts +0 -7
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Partition.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts +0 -22
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +0 -7
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +0 -9
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +0 -13
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts +0 -4
- package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +0 -1
- package/lib/esm/presentation-hierarchies.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies.js.map +0 -1
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyErrors.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyErrors.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyMerge.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyMerge.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyNode.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyNodeIdentifier.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeIdentifier.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyProvider.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyProvider.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchySearch.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchySearch.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/Logging.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/Logging.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/HierarchyCache.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/HierarchyCache.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/SearchHierarchyDefinition.d.ts +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/DetermineChildren.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/DetermineChildren.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/Grouping.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.d.ts +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/Shared.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/Common.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/Common.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/EachValueFrom.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/EachValueFrom.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/LoggingUtils.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/SubscriptionScheduler.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/SubscriptionScheduler.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Partition.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Partition.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Sorting.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Sorting.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/TapOnce.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HideIfNoChildren.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/operators/HideIfNoChildren.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,WAAW,EACX,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO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,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAC5B,CAAC,IAAI;QACJ,iCAAiC;QACjC,GAAG,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,8BAA8B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAClG,CAAC;IACJ,CAAC,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 { defer, filter, map, merge, mergeMap } from \"rxjs\";\nimport {\n createNodeIdentifierForLogging,\n createOperatorLoggingNamespace,\n hasChildren,\n LOGGING_NAMESPACE_INTERNAL,\n} from \"../../internal/Common.js\";\nimport { doLog, log } from \"../../internal/LoggingUtils.js\";\nimport { partition } from \"../../internal/operators/Partition.js\";\nimport { ProcessedHierarchyNode } from \"../IModelHierarchyNode.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { ProcessedGenericHierarchyNode, ProcessedInstanceHierarchyNode } from \"../IModelHierarchyNode.js\";\n\n// cspell:words doesnt\n\nconst OPERATOR_NAME = \"HideIfNoChildren\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME, LOGGING_NAMESPACE_INTERNAL);\n\n/**\n * Creates an operator that hides nodes with no children if they have a `hideIfNoChildren` handling param.\n *\n * @internal\n */\nexport function createHideIfNoChildrenOperator(hasNodes: (node: ProcessedHierarchyNode) => Observable<boolean>) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n const inputNodes = nodes.pipe(\n /* v8 ignore next -- @preserve */\n log({ category: LOGGING_NAMESPACE, message: (n) => `in: ${createNodeIdentifierForLogging(n)}` }),\n );\n // split input into 3 pieces:\n // - `doesntNeedHide` - nodes without the flag (return no matter if they have children or not)\n // - `determinedChildren` - nodes with the flag and known children\n // - `undeterminedChildren` - nodes with the flag and unknown children\n const [needsHide, doesntNeedHide] = partition(\n inputNodes,\n (n): n is ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode =>\n (ProcessedHierarchyNode.isGeneric(n) || ProcessedHierarchyNode.isInstancesNode(n)) &&\n !!n.processingParams?.hideIfNoChildren,\n );\n const [determinedChildren, undeterminedChildren] = partition(needsHide, (n) => n.children !== undefined);\n return merge(\n doesntNeedHide.pipe(\n /* v8 ignore next -- @preserve */\n log({ category: LOGGING_NAMESPACE, message: (n) => `${createNodeIdentifierForLogging(n)}: doesn't need hide` }),\n ),\n merge(\n determinedChildren.pipe(\n /* v8 ignore next -- @preserve */\n log({\n category: LOGGING_NAMESPACE,\n message: (n) => `${createNodeIdentifierForLogging(n)}: needs hide, has children`,\n }),\n ),\n undeterminedChildren.pipe(\n /* v8 ignore next -- @preserve */\n log({\n category: LOGGING_NAMESPACE,\n message: (n) => `${createNodeIdentifierForLogging(n)}: needs hide, needs children`,\n }),\n mergeMap(\n (n) =>\n defer(() => {\n /* v8 ignore next -- @preserve */\n doLog({\n category: LOGGING_NAMESPACE,\n message: () => `${createNodeIdentifierForLogging(n)}: requesting children flag`,\n });\n return hasNodes(n).pipe(\n /* v8 ignore next -- @preserve */\n log({\n category: LOGGING_NAMESPACE,\n message: (childrenFlag) =>\n `${createNodeIdentifierForLogging(n)}: determined children: ${childrenFlag}`,\n }),\n map((children) => Object.assign(n, { children })),\n );\n }),\n // Sending child check requests for all nodes without any limit greatly slows down\n // the following case:\n // - NodeX (determining children) -> ... lots of children with \"hide if no children\" -> ...\n // We check the nodes with \"hide if no children\" at most 2 at a time to prefer going deep into\n // the hierarchy, where we're more likely to find an answer, rather than going wide.\n 2,\n ),\n /* v8 ignore next -- @preserve */\n log({\n category: LOGGING_NAMESPACE,\n message: (n) => `${createNodeIdentifierForLogging(n)}: needs hide, determined children: ${hasChildren(n)}`,\n }),\n ),\n ).pipe(filter(hasChildren)),\n ).pipe(\n /* v8 ignore next -- @preserve */\n log({ category: LOGGING_NAMESPACE, message: (n) => `out: ${createNodeIdentifierForLogging(n)}` }),\n );\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HideNodesInHierarchy.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/operators/HideNodesInHierarchy.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKvC,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAA4E,CAAC;AAE3G;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,UAAU,CAAC,sBAAsB,CAAC,EACpF,gBAAgB,EAAE,OAAO,WAED,UAAU,CAAC,sBAAsB,CAAC,KAAG,UAAU,CAAC,sBAAsB,CAAC,CAiFhG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HideNodesInHierarchy.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/operators/HideNodesInHierarchy.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACpG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,WAAW,EACX,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,S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AAC;YACnB,iCAAiC;YACjC,GAAG,CAAC;gBACF,QAAQ,EAAE,iBAAiB;gBAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACb,wCAAwC,8BAA8B,CAAC,CAAC,CAAC,gFAAgF;aAC5J,CAAC,CACH,EACD,KAAK,CAAC,IAAI,CACR,QAAQ,CAAC,GAAG,EAAE;gBACZ,iCAAiC;gBACjC,KAAK,CAAC;oBACJ,QAAQ,EAAE,iBAAiB;oBAC3B,OAAO,EAAE,GAAG,EAAE,CACZ,0GAA0G;iBAC7G,CAAC,CAAC;YACL,CAAC,CAAC,CACH,EACD,kBAAkB,CACnB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,kBAAkB,CACvB,CAAC,IAAI;QACJ,iCAAiC;QACjC,GAAG,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,8BAA8B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAClG,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAA2D,IAAW;IAC9F,IAAI,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;IACzE,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,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 { concat, defer, EMPTY, filter, finalize, map, merge, mergeAll, mergeMap, take } from \"rxjs\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { HierarchyNodeKey } from \"../../HierarchyNodeKey.js\";\nimport {\n createNodeIdentifierForLogging,\n createOperatorLoggingNamespace,\n hasChildren,\n LOGGING_NAMESPACE_INTERNAL,\n} from \"../../internal/Common.js\";\nimport { doLog, log } from \"../../internal/LoggingUtils.js\";\nimport { partition } from \"../../internal/operators/Partition.js\";\nimport { reduceToMergeMapItem } from \"../../internal/operators/ReduceToMergeMap.js\";\nimport { ProcessedHierarchyNode } from \"../IModelHierarchyNode.js\";\nimport { mergeInstanceNodes } from \"../Utils.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { GenericNodeKey, InstancesNodeKey } from \"../../HierarchyNodeKey.js\";\nimport type { ProcessedGenericHierarchyNode, ProcessedInstanceHierarchyNode } from \"../IModelHierarchyNode.js\";\n\nconst OPERATOR_NAME = \"HideNodesInHierarchy\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME, LOGGING_NAMESPACE_INTERNAL);\n\n/**\n * Creates an operator that hides nodes and instead returns their children if the nodes have a `hideInHierarchy` handling param.\n *\n * @internal\n */\nexport function createHideNodesInHierarchyOperator(\n getNodes: (parentNode: ProcessedHierarchyNode) => Observable<ProcessedHierarchyNode>,\n stopOnFirstChild: boolean,\n) {\n return function (nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n const inputNodes = nodes.pipe(\n /* v8 ignore next -- @preserve */\n log({ category: LOGGING_NAMESPACE, message: (n) => `in: ${createNodeIdentifierForLogging(n)}` }),\n );\n const [withFlag, withoutFlag] = partition(\n inputNodes,\n (n): n is ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode =>\n (ProcessedHierarchyNode.isGeneric(n) || ProcessedHierarchyNode.isInstancesNode(n)) &&\n !!n.processingParams?.hideInHierarchy,\n );\n // Defer to create a new seed for reduce on every subscribe\n const withLoadedChildren = defer(() =>\n withFlag.pipe(\n /* v8 ignore next -- @preserve */\n log({\n category: LOGGING_NAMESPACE,\n message: (n) => `${createNodeIdentifierForLogging(n)} needs hide and needs children to be loaded`,\n }),\n filter((node) => node.children !== false),\n reduceToMergeMapItem(\n (node) => createMergeMapKey(node),\n (node, mergedNode: ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode | undefined) => {\n if (mergedNode) {\n if (ProcessedHierarchyNode.isGeneric(mergedNode)) {\n // we don't merge generic nodes, just return the first one\n return mergedNode;\n }\n assert(ProcessedHierarchyNode.isInstancesNode(node));\n return mergeInstanceNodes(mergedNode, node);\n }\n return node;\n },\n ),\n /* v8 ignore next -- @preserve */\n log({ category: LOGGING_NAMESPACE, message: (mm) => `created a merge map of size ${mm.size}` }),\n mergeMap((mm) => [...mm.values()].map((mergedNode) => defer(() => getNodes(mergedNode)))),\n mergeAll(),\n map((n): ProcessedHierarchyNode => n),\n ),\n );\n\n return merge(\n withoutFlag.pipe(\n /* v8 ignore next -- @preserve */\n log({\n category: LOGGING_NAMESPACE,\n message: (n) => `${createNodeIdentifierForLogging(n)} doesn't need hide, return the node`,\n }),\n ),\n stopOnFirstChild\n ? concat(\n // a small hack to handle situation when we're here to only check if parent node has children and one of them has `hideIfNoChildren` flag\n // with a `hasChildren = true` - we just return the hidden node itself in that case to avoid digging deeper into the hierarchy\n inputNodes.pipe(\n filter(hasChildren),\n /* v8 ignore next -- @preserve */\n log({\n category: LOGGING_NAMESPACE,\n message: (n) =>\n `\\`stopOnFirstChild = true\\` and node ${createNodeIdentifierForLogging(n)} is set to always have nodes - return the hidden node without loading children`,\n }),\n ),\n EMPTY.pipe(\n finalize(() => {\n /* v8 ignore next -- @preserve */\n doLog({\n category: LOGGING_NAMESPACE,\n message: () =>\n `\\`stopOnFirstChild = true\\` but none of the nodes had children determined to \\`true\\` - do load children`,\n });\n }),\n ),\n withLoadedChildren,\n ).pipe(take(1))\n : withLoadedChildren,\n ).pipe(\n /* v8 ignore next -- @preserve */\n log({ category: LOGGING_NAMESPACE, message: (n) => `out: ${createNodeIdentifierForLogging(n)}` }),\n );\n };\n}\n\nfunction createMergeMapKey<TNode extends { key: InstancesNodeKey | GenericNodeKey }>(node: TNode): string {\n if (HierarchyNodeKey.isGeneric(node.key)) {\n return `${node.key.source ? `${node.key.source}:` : \"\"}${node.key.id}`;\n }\n return node.key.instanceKeys[0].className;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoExpand.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/AutoExpand.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,qBAAqB,CAepF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoExpand.js","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/AutoExpand.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAK7D,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACjC,IAAI,cAAuD,CAAC;QAC5D,8BAA8B,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,aAAa,EAAE,EAAE;YACzE,IAAI,cAAc,KAAK,QAAQ,EAAE,CAAC;gBAChC,OAAO,IAAI,CAAC;YACd,CAAC;YACD,cAAc,GAAG,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC;YACvF,OAAO;QACT,CAAC,CAAC,CAAC;QACH,IAAI,cAAc,KAAK,QAAQ,IAAI,CAAC,cAAc,KAAK,cAAc,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;YACrG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,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 { iterateChildNodeGroupingParams } from \"./Shared.js\";\n\nimport type { HierarchyNodeAutoExpandProp } from \"../../IModelHierarchyNode.js\";\nimport type { GroupingHandlerResult } from \"../Grouping.js\";\n\n/** @internal */\nexport function assignAutoExpand(props: GroupingHandlerResult): GroupingHandlerResult {\n for (const node of props.grouped) {\n let autoExpandProp: HierarchyNodeAutoExpandProp | undefined;\n iterateChildNodeGroupingParams(node, props.groupingType, (groupingProps) => {\n if (autoExpandProp === \"always\") {\n return true;\n }\n autoExpandProp = groupingProps?.autoExpand ? groupingProps.autoExpand : autoExpandProp;\n return;\n });\n if (autoExpandProp === \"always\" || (autoExpandProp === \"single-child\" && node.children.length === 1)) {\n node.autoExpand = true;\n }\n }\n return props;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseClassGrouping.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/BaseClassGrouping.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,gBAAgB;AAChB,wBAAsB,6BAA6B,CACjD,cAAc,EAAE,gBAAgB,EAChC,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAC3C,KAAK,EAAE,8BAA8B,EAAE,GACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CA6BrB;AAED,gBAAgB;AAChB,wBAAsB,uCAAuC,CAC3D,KAAK,EAAE,8BAA8B,EAAE,EACvC,WAAW,EAAE,EAAE,CAAC,KAAK,EACrB,uBAAuB,EAAE,yBAAyB,GACjD,OAAO,CAAC,qBAAqB,CAAC,CA4ChC;AAyCD,gBAAgB;AAChB,wBAAsB,+BAA+B,CACnD,YAAY,EAAE,gBAAgB,GAAG,yBAAyB,EAC1D,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAC3C,KAAK,EAAE,8BAA8B,EAAE,GACtC,OAAO,CAAC,eAAe,EAAE,CAAC,CAK5B"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { SortedArray } from "@itwin/core-bentley";
|
|
6
|
-
import {
|
|
6
|
+
import { createMainThreadReleaseOnTimePassedHandler, getClass } from "@itwin/presentation-shared";
|
|
7
7
|
import { HierarchyNode } from "../../../HierarchyNode.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export async function getBaseClassGroupingECClasses(schemaProvider, parentNode, nodes) {
|
|
@@ -21,7 +21,7 @@ export async function getBaseClassGroupingECClasses(schemaProvider, parentNode,
|
|
|
21
21
|
const sortedClasses = await sortByBaseClass(baseClasses.filter((baseClass) => baseClass.isRelationshipClass() || baseClass.isEntityClass()));
|
|
22
22
|
if (parentNode && HierarchyNode.isClassGroupingNode(parentNode)) {
|
|
23
23
|
// if we have a class grouping node, we can cut the front of sortedClasses up to a point where our grouping class is
|
|
24
|
-
const cutPosition = sortedClasses.findIndex((c) =>
|
|
24
|
+
const cutPosition = sortedClasses.findIndex((c) => c.fullName.toLocaleLowerCase() === parentNode.key.className.toLocaleLowerCase());
|
|
25
25
|
if (cutPosition >= 0) {
|
|
26
26
|
return sortedClasses.slice(cutPosition + 1);
|
|
27
27
|
}
|
|
@@ -38,7 +38,7 @@ export async function createBaseClassGroupsForSingleBaseClass(nodes, baseECClass
|
|
|
38
38
|
for (const node of nodes) {
|
|
39
39
|
await releaseMainThread();
|
|
40
40
|
if (!node.processingParams?.grouping?.byBaseClasses ||
|
|
41
|
-
!node.processingParams.grouping.byBaseClasses.fullClassNames.some((className) =>
|
|
41
|
+
!node.processingParams.grouping.byBaseClasses.fullClassNames.some((className) => className.toLocaleLowerCase() === baseClassFullName.toLocaleLowerCase())) {
|
|
42
42
|
ungroupedNodes.push(node);
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
@@ -69,7 +69,7 @@ export async function createBaseClassGroupsForSingleBaseClass(nodes, baseECClass
|
|
|
69
69
|
}
|
|
70
70
|
async function getGroupingBaseClassNames(nodes) {
|
|
71
71
|
const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();
|
|
72
|
-
const baseClasses = new SortedArray(
|
|
72
|
+
const baseClasses = new SortedArray((a, b) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()), false);
|
|
73
73
|
for (const node of nodes) {
|
|
74
74
|
await releaseMainThread();
|
|
75
75
|
if (node.processingParams?.grouping?.byBaseClasses) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseClassGrouping.js","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/BaseClassGrouping.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,0CAA0C,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAQ1D,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,cAAgC,EAChC,UAA2C,EA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,EAAE,EAAE,CAAC,uCAAuC,CAAC,QAAQ,EAAE,WAAW,EAAE,YAAY,CAAC,CAClH,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 { SortedArray } from \"@itwin/core-bentley\";\nimport { createMainThreadReleaseOnTimePassedHandler, getClass } from \"@itwin/presentation-shared\";\nimport { HierarchyNode } from \"../../../HierarchyNode.js\";\n\nimport type { EC, ECClassHierarchyInspector, ECSchemaProvider } from \"@itwin/presentation-shared\";\nimport type { ParentHierarchyNode } from \"../../../HierarchyNode.js\";\nimport type { ClassGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport type { ProcessedInstanceHierarchyNode } from \"../../IModelHierarchyNode.js\";\nimport type { GroupingHandler, GroupingHandlerResult } from \"../Grouping.js\";\n\n/** @internal */\nexport async function getBaseClassGroupingECClasses(\n schemaProvider: ECSchemaProvider,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n): Promise<EC.Class[]> {\n // Get all base class names that are provided in the grouping information\n const baseClassesFullClassNames = await getGroupingBaseClassNames(nodes);\n if (baseClassesFullClassNames.length === 0) {\n return [];\n }\n\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const baseClasses = [];\n for (const fullName of baseClassesFullClassNames) {\n await releaseMainThread();\n baseClasses.push(await getClass(schemaProvider, fullName));\n }\n const sortedClasses = await sortByBaseClass(\n baseClasses.filter((baseClass) => baseClass.isRelationshipClass() || baseClass.isEntityClass()),\n );\n\n if (parentNode && HierarchyNode.isClassGroupingNode(parentNode)) {\n // if we have a class grouping node, we can cut the front of sortedClasses up to a point where our grouping class is\n const cutPosition = sortedClasses.findIndex(\n (c) => c.fullName.toLocaleLowerCase() === parentNode.key.className.toLocaleLowerCase(),\n );\n if (cutPosition >= 0) {\n return sortedClasses.slice(cutPosition + 1);\n }\n return [];\n }\n\n return sortedClasses;\n}\n\n/** @internal */\nexport async function createBaseClassGroupsForSingleBaseClass(\n nodes: ProcessedInstanceHierarchyNode[],\n baseECClass: EC.Class,\n classHierarchyInspector: ECClassHierarchyInspector,\n): Promise<GroupingHandlerResult> {\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const groupedNodes = new Array<ProcessedInstanceHierarchyNode>();\n const ungroupedNodes = new Array<ProcessedInstanceHierarchyNode>();\n const baseClassFullName = baseECClass.fullName;\n for (const node of nodes) {\n await releaseMainThread();\n if (\n !node.processingParams?.grouping?.byBaseClasses ||\n !node.processingParams.grouping.byBaseClasses.fullClassNames.some(\n (className) => className.toLocaleLowerCase() === baseClassFullName.toLocaleLowerCase(),\n )\n ) {\n ungroupedNodes.push(node);\n continue;\n }\n const fullCurrentNodeClassName = node.key.instanceKeys[0].className;\n\n const baseCheckerResult = classHierarchyInspector.classDerivesFrom(fullCurrentNodeClassName, baseClassFullName);\n\n const isCurrentNodeClassOfBase =\n baseCheckerResult instanceof Promise\n ? await baseCheckerResult\n : /* v8 ignore next -- @preserve */ baseCheckerResult;\n\n if (isCurrentNodeClassOfBase) {\n groupedNodes.push(node);\n } else {\n ungroupedNodes.push(node);\n }\n }\n\n const result: GroupingHandlerResult = { grouped: [], ungrouped: ungroupedNodes, groupingType: \"base-class\" };\n if (groupedNodes.length > 0) {\n const groupingNodeKey: ClassGroupingNodeKey = { type: \"class-grouping\", className: baseClassFullName };\n result.grouped.push({\n label: baseECClass.label ?? baseECClass.name,\n key: groupingNodeKey,\n parentKeys: [...groupedNodes[0].parentKeys],\n groupedInstanceKeys: groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: groupedNodes.map((gn) => Object.assign(gn, { parentKeys: [...gn.parentKeys, groupingNodeKey] })),\n });\n }\n return result;\n}\n\nasync function getGroupingBaseClassNames(nodes: ProcessedInstanceHierarchyNode[]) {\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const baseClasses = new SortedArray<EC.FullClassNameDotNotation>(\n (a, b) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()),\n false,\n );\n for (const node of nodes) {\n await releaseMainThread();\n if (node.processingParams?.grouping?.byBaseClasses) {\n for (const className of node.processingParams.grouping.byBaseClasses.fullClassNames) {\n baseClasses.insert(className);\n }\n }\n }\n return baseClasses;\n}\n\nasync function sortByBaseClass(classes: EC.Class[]): Promise<EC.Class[]> {\n if (classes.length === 0) {\n return classes;\n }\n const output: EC.Class[] = [classes[0]];\n for (let inputIndex = 1; inputIndex < classes.length; ++inputIndex) {\n let wasAdded = false;\n for (let outputIndex = output.length - 1; outputIndex >= 0; --outputIndex) {\n if (await classes[inputIndex].is(output[outputIndex])) {\n output.splice(outputIndex + 1, 0, classes[inputIndex]);\n wasAdded = true;\n break;\n }\n }\n if (!wasAdded) {\n output.splice(0, 0, classes[inputIndex]);\n }\n }\n\n return output;\n}\n\n/** @internal */\nexport async function createBaseClassGroupingHandlers(\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n): Promise<GroupingHandler[]> {\n const baseClassGroupingECClasses = await getBaseClassGroupingECClasses(imodelAccess, parentNode, nodes);\n return baseClassGroupingECClasses.map(\n (baseECClass) => async (allNodes) => createBaseClassGroupsForSingleBaseClass(allNodes, baseECClass, imodelAccess),\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassGrouping.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/ClassGrouping.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAM,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAA2C,MAAM,gBAAgB,CAAC;AAgBrG,gBAAgB;AAChB,wBAAsB,iBAAiB,CACrC,cAAc,EAAE,gBAAgB,EAChC,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAC3C,KAAK,EAAE,8BAA8B,EAAE,GACtC,OAAO,CAAC,qBAAqB,CAAC,CA8BhC"}
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Dictionary } from "@itwin/core-bentley";
|
|
6
|
-
import {
|
|
6
|
+
import { createMainThreadReleaseOnTimePassedHandler, getClass } from "@itwin/presentation-shared";
|
|
7
7
|
import { HierarchyNode } from "../../../HierarchyNode.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export async function createClassGroups(schemaProvider, parentNode, nodes) {
|
|
10
10
|
const parentNodeClass = parentNode && HierarchyNode.isClassGroupingNode(parentNode) ? parentNode.key.className : undefined;
|
|
11
11
|
const groupings = {
|
|
12
12
|
ungrouped: [],
|
|
13
|
-
grouped: new Dictionary(
|
|
13
|
+
grouped: new Dictionary((a, b) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())),
|
|
14
14
|
};
|
|
15
15
|
const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();
|
|
16
16
|
for (const node of nodes) {
|
|
17
17
|
await releaseMainThread();
|
|
18
18
|
const nodeClassName = node.key.instanceKeys[0].className;
|
|
19
19
|
if (node.processingParams?.grouping?.byClass &&
|
|
20
|
-
(!parentNodeClass ||
|
|
20
|
+
(!parentNodeClass || nodeClassName.toLocaleLowerCase() !== parentNodeClass.toLocaleLowerCase())) {
|
|
21
21
|
let groupingInfo = groupings.grouped.get(nodeClassName);
|
|
22
22
|
if (!groupingInfo) {
|
|
23
23
|
const nodeClass = await getClass(schemaProvider, nodeClassName);
|
|
@@ -0,0 +1 @@
|
|
|
1
|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E,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CACtC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,qBAAqB,EAAE,eAAe,CAAC,EAAE,CAAC,CAC/E;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAC1F,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 { Dictionary } from \"@itwin/core-bentley\";\nimport { createMainThreadReleaseOnTimePassedHandler, getClass } from \"@itwin/presentation-shared\";\nimport { HierarchyNode } from \"../../../HierarchyNode.js\";\n\nimport type { EC, ECSchemaProvider } from \"@itwin/presentation-shared\";\nimport type { ParentHierarchyNode } from \"../../../HierarchyNode.js\";\nimport type { ClassGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport type { ProcessedInstanceHierarchyNode } from \"../../IModelHierarchyNode.js\";\nimport type { GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\ninterface ClassInfo {\n fullName: EC.FullClassNameDotNotation;\n name: string;\n label?: string;\n}\n\ninterface ClassGroupingInformation {\n ungrouped: ProcessedInstanceHierarchyNode[];\n grouped: Dictionary<\n EC.FullClassNameDotNotation,\n { class: ClassInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }\n >;\n}\n\n/** @internal */\nexport async function createClassGroups(\n schemaProvider: ECSchemaProvider,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n): Promise<GroupingHandlerResult> {\n const parentNodeClass =\n parentNode && HierarchyNode.isClassGroupingNode(parentNode) ? parentNode.key.className : undefined;\n const groupings: ClassGroupingInformation = {\n ungrouped: [],\n grouped: new Dictionary<\n EC.FullClassNameDotNotation,\n { class: ClassInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }\n >((a, b) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())),\n };\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n for (const node of nodes) {\n await releaseMainThread();\n const nodeClassName = node.key.instanceKeys[0].className;\n if (\n node.processingParams?.grouping?.byClass &&\n (!parentNodeClass || nodeClassName.toLocaleLowerCase() !== parentNodeClass.toLocaleLowerCase())\n ) {\n let groupingInfo = groupings.grouped.get(nodeClassName);\n if (!groupingInfo) {\n const nodeClass = await getClass(schemaProvider, nodeClassName);\n groupingInfo = { class: nodeClass, groupedNodes: [] };\n groupings.grouped.set(nodeClassName, groupingInfo);\n }\n groupingInfo.groupedNodes.push(node);\n continue;\n }\n groupings.ungrouped.push(node);\n }\n return createGroupingNodes(groupings);\n}\n\nasync function createGroupingNodes(groupings: ClassGroupingInformation): Promise<GroupingHandlerResult> {\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n for (const { value: entry } of groupings.grouped) {\n await releaseMainThread();\n const groupingNodeKey: ClassGroupingNodeKey = { type: \"class-grouping\", className: entry.class.fullName };\n const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;\n groupedNodes.push({\n label: entry.class.label ?? entry.class.name,\n key: groupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.groupedNodes.map((gn) =>\n Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] }),\n ),\n });\n }\n return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: \"class\" };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupHiding.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/GroupHiding.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAyD,MAAM,gBAAgB,CAAC;AAEnH,gBAAgB;AAChB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,GAAG,qBAAqB,CA2BjH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupHiding.js","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/GroupHiding.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAI7D,gBAAgB;AAChB,MAAM,UAAU,sBAAsB,CAAC,KAA4B,EAAE,aAAqB;IACxF,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gCAAgC;IAChC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;QAC1E,MAAM,UAAU,GAAG,sCAAsC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QACpF,IAAI,UAAU,CAAC,gBAAgB,EAAE,CAAC;YAChC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACvE,CAAC;IACH,CAAC;IAED,gCAAgC;IAChC,MAAM,eAAe,GAAG,IAAI,KAAK,EAA2C,CAAC;IAC7E,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,UAAU,GAAG,sCAAsC,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAC9E,IAAI,UAAU,CAAC,oBAAoB,EAAE,CAAC;gBACpC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,SAAS;YACX,CAAC;QACH,CAAC;QACD,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,sCAAsC,CAC7C,YAAqD,EACrD,YAA0B;IAE1B,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,oBAAoB,GAAG,KAAK,CAAC;IACjC,8BAA8B,CAAC,YAAY,EAAE,YAAY,EAAE,CAAC,aAAa,EAAE,EAAE;QAC3E,IAAI,gBAAgB,IAAI,oBAAoB,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,gBAAgB,KAAK,CAAC,CAAC,aAAa,EAAE,gBAAgB,CAAC;QACvD,oBAAoB,KAAK,CAAC,CAAC,aAAa,EAAE,oBAAoB,CAAC;QAC/D,OAAO;IACT,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;AACpD,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 { iterateChildNodeGroupingParams } from \"./Shared.js\";\n\nimport type { GroupingHandlerResult, GroupingType, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\n/** @internal */\nexport function applyGroupHidingParams(props: GroupingHandlerResult, extraSiblings: number): GroupingHandlerResult {\n const { grouped, ungrouped, groupingType } = props;\n if (grouped.length === 0) {\n return props;\n }\n\n // handle the \"no siblings\" case\n if (grouped.length === 1 && ungrouped.length === 0 && extraSiblings === 0) {\n const hideParams = getHideOptionsFromNodeProcessingParams(grouped[0], groupingType);\n if (hideParams.hideIfNoSiblings) {\n return { groupingType, grouped: [], ungrouped: grouped[0].children };\n }\n }\n\n // handle the \"no children\" case\n const filteredGrouped = new Array<ProcessedInstancesGroupingHierarchyNode>();\n for (const node of grouped) {\n if (node.children.length === 1) {\n const hideParams = getHideOptionsFromNodeProcessingParams(node, groupingType);\n if (hideParams.hideIfOneGroupedNode) {\n ungrouped.push(node.children[0]);\n continue;\n }\n }\n filteredGrouped.push(node);\n }\n return { groupingType, grouped: filteredGrouped, ungrouped };\n}\n\nfunction getHideOptionsFromNodeProcessingParams(\n groupingNode: ProcessedInstancesGroupingHierarchyNode,\n groupingType: GroupingType,\n): { hideIfNoSiblings: boolean; hideIfOneGroupedNode: boolean } {\n let hideIfNoSiblings = false;\n let hideIfOneGroupedNode = false;\n iterateChildNodeGroupingParams(groupingNode, groupingType, (groupingProps) => {\n if (hideIfNoSiblings && hideIfOneGroupedNode) {\n return true;\n }\n hideIfNoSiblings ||= !!groupingProps?.hideIfNoSiblings;\n hideIfOneGroupedNode ||= !!groupingProps?.hideIfOneGroupedNode;\n return;\n });\n return { hideIfNoSiblings, hideIfOneGroupedNode };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelGrouping.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/LabelGrouping.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAA2C,MAAM,gBAAgB,CAAC;AAErG,gBAAgB;AAChB,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,8BAA8B,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4C/G"}
|
|
@@ -0,0 +1 @@
|
|
|
1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AAE,UAAU,EAAE,CAAC,GAAG,qBAAqB,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;SAC5G,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AACrE,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 { mergeInstanceNodes } from \"../../Utils.js\";\n\nimport type { LabelGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport type { ProcessedInstanceHierarchyNode } from \"../../IModelHierarchyNode.js\";\nimport type { GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\n/** @internal */\nexport async function createLabelGroups(nodes: ProcessedInstanceHierarchyNode[]): Promise<GroupingHandlerResult> {\n const ungrouped = new Array<ProcessedInstanceHierarchyNode>();\n const nodesToMergeMap = new Map<string, ProcessedInstanceHierarchyNode[]>();\n const nodesToGroupMap = new Map<string, ProcessedInstanceHierarchyNode[]>();\n for (const node of nodes) {\n const byLabel = node.processingParams?.grouping?.byLabel;\n if (!byLabel) {\n ungrouped.push(node);\n continue;\n }\n const nodeMapKeyIdentifier = `label:\"${node.label}\";groupId:${JSON.stringify(typeof byLabel === \"object\" ? byLabel.groupId : undefined)}`;\n const map = typeof byLabel === \"object\" && byLabel.action === \"merge\" ? nodesToMergeMap : nodesToGroupMap;\n let list = map.get(nodeMapKeyIdentifier);\n if (!list) {\n list = [];\n map.set(nodeMapKeyIdentifier, list);\n }\n list.push(node);\n }\n\n nodesToMergeMap.forEach((entry) => {\n let finalNode = entry[0];\n for (let i = 1; i < entry.length; ++i) {\n finalNode = mergeInstanceNodes(finalNode, entry[i]);\n }\n ungrouped.push(finalNode);\n });\n\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n nodesToGroupMap.forEach((entry) => {\n const byLabel = entry[0].processingParams?.grouping?.byLabel;\n const groupId = typeof byLabel === \"object\" ? byLabel.groupId : undefined;\n const groupingNodeKey: LabelGroupingNodeKey = { type: \"label-grouping\", label: entry[0].label, groupId };\n const groupedNodeParentKeys = entry[0].parentKeys;\n groupedNodes.push({\n label: entry[0].label,\n key: groupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.map((gn) => Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] })),\n });\n });\n\n return { groupingType: \"label\", grouped: groupedNodes, ungrouped };\n}\n"]}
|
package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.d.ts
RENAMED
|
@@ -15,7 +15,7 @@ export interface PropertyGroupInfo {
|
|
|
15
15
|
}
|
|
16
16
|
/** @internal */
|
|
17
17
|
export type PreviousPropertiesGroupingInfo = Array<{
|
|
18
|
-
propertiesClassName: EC.
|
|
18
|
+
propertiesClassName: EC.FullClassNameDotNotation;
|
|
19
19
|
propertyName: string;
|
|
20
20
|
isRange?: boolean;
|
|
21
21
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertiesGrouping.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/PropertiesGrouping.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,EAAE,EACF,yBAAyB,EACzB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EACV,qCAAqC,EACrC,0BAA0B,EAC1B,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,uCAAuC,E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;AAChB,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,gBAAgB,GAAG,yBAAyB,EAC1D,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAC3C,KAAK,EAAE,8BAA8B,EAAE,EACvC,cAAc,EAAE,wBAAwB,EACxC,gBAAgB,EAAE,kCAAkC,GACnD,OAAO,CAAC,eAAe,EAAE,CAAC,CAa5B"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { assert } from "@itwin/core-bentley";
|
|
6
|
-
import {
|
|
6
|
+
import { createMainThreadReleaseOnTimePassedHandler, formatConcatenatedValue, getClass, TypedPrimitiveValue, } from "@itwin/presentation-shared";
|
|
7
7
|
import { HierarchyNode } from "../../../HierarchyNode.js";
|
|
8
8
|
import { HierarchyNodeKey } from "../../../HierarchyNodeKey.js";
|
|
9
9
|
/** @internal */
|
|
@@ -107,7 +107,7 @@ export async function createPropertyGroups(nodesToGroup, nodesAlreadyGrouped, ha
|
|
|
107
107
|
className: propertyIdentifier.propertyClassName,
|
|
108
108
|
propertyName: propertyIdentifier.propertyName,
|
|
109
109
|
};
|
|
110
|
-
const hasPropertyIdentifier = groupingNode.key.properties.find((x) =>
|
|
110
|
+
const hasPropertyIdentifier = groupingNode.key.properties.find((x) => x.className.toLocaleLowerCase() === thisPropertyIdentifier.className.toLocaleLowerCase() &&
|
|
111
111
|
x.propertyName.toLocaleLowerCase() === thisPropertyIdentifier.propertyName.toLocaleLowerCase());
|
|
112
112
|
if (!hasPropertyIdentifier) {
|
|
113
113
|
groupingNode.key.properties.push(thisPropertyIdentifier);
|
|
@@ -182,14 +182,14 @@ function createNodePropertyGroupPathMatchers(node) {
|
|
|
182
182
|
return propertyGroupingNodeKeys.map((key) => {
|
|
183
183
|
switch (key.type) {
|
|
184
184
|
case "property-grouping:other":
|
|
185
|
-
return (x) => key.properties.some((p) =>
|
|
185
|
+
return (x) => key.properties.some((p) => p.className.toLocaleLowerCase() === x.propertiesClassName.toLocaleLowerCase() &&
|
|
186
186
|
p.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase() &&
|
|
187
187
|
!!x.isRange);
|
|
188
188
|
case "property-grouping:range":
|
|
189
|
-
return (x) =>
|
|
189
|
+
return (x) => key.propertyClassName.toLocaleLowerCase() === x.propertiesClassName.toLocaleLowerCase() &&
|
|
190
190
|
key.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase();
|
|
191
191
|
case "property-grouping:value":
|
|
192
|
-
return (x) =>
|
|
192
|
+
return (x) => key.propertyClassName.toLocaleLowerCase() === x.propertiesClassName.toLocaleLowerCase() &&
|
|
193
193
|
key.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase();
|
|
194
194
|
}
|
|
195
195
|
});
|
|
@@ -213,7 +213,7 @@ export async function getUniquePropertiesGroupInfo(schemaProvider, parentNode, n
|
|
|
213
213
|
? previousPropertiesInfo[previousPropertiesInfo.length - 1].propertyGroupKey
|
|
214
214
|
: "";
|
|
215
215
|
const propertyGroupKey = `${lastKey}:${propertyGroup.propertyName}(${mapKeyRanges})`;
|
|
216
|
-
const mapKey = `${
|
|
216
|
+
const mapKey = `${byProperties.propertiesClassName}:${propertyGroupKey}`.toLocaleLowerCase();
|
|
217
217
|
let isAlreadyGrouped = false;
|
|
218
218
|
if (parentPropertyGroupPath.length > 0 && propertyGroupIndex < parentPropertyGroupPath.length) {
|
|
219
219
|
const groupMatcher = parentPropertyGroupPath[propertyGroupIndex];
|
|
@@ -250,8 +250,8 @@ function getRangesAsString(ranges) {
|
|
|
250
250
|
: "";
|
|
251
251
|
}
|
|
252
252
|
async function shouldCreatePropertyGroup(handlerGroupingParams, nodePropertyGroupingParams, nodeFullClassName, classHierarchyInspector) {
|
|
253
|
-
if (
|
|
254
|
-
|
|
253
|
+
if (nodePropertyGroupingParams.propertiesClassName.toLocaleLowerCase() !==
|
|
254
|
+
handlerGroupingParams.ecClass.fullName.toLocaleLowerCase() ||
|
|
255
255
|
nodePropertyGroupingParams.propertyGroups.length < handlerGroupingParams.previousPropertiesGroupingInfo.length + 1) {
|
|
256
256
|
return false;
|
|
257
257
|
}
|
|
@@ -269,7 +269,8 @@ async function shouldCreatePropertyGroup(handlerGroupingParams, nodePropertyGrou
|
|
|
269
269
|
/** @internal */
|
|
270
270
|
export function doPreviousPropertiesMatch(previousPropertiesGroupingInfo, nodesProperties) {
|
|
271
271
|
return (previousPropertiesGroupingInfo.length <= nodesProperties.propertyGroups.length &&
|
|
272
|
-
previousPropertiesGroupingInfo.every((groupingInfo, index) =>
|
|
272
|
+
previousPropertiesGroupingInfo.every((groupingInfo, index) => groupingInfo.propertiesClassName.toLocaleLowerCase() ===
|
|
273
|
+
nodesProperties.propertiesClassName.toLocaleLowerCase() &&
|
|
273
274
|
groupingInfo.propertyName.toLocaleLowerCase() ===
|
|
274
275
|
nodesProperties.propertyGroups[index].propertyName.toLocaleLowerCase() &&
|
|
275
276
|
!!groupingInfo.isRange === !!nodesProperties.propertyGroups[index].ranges));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertiesGrouping.js","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/PropertiesGrouping.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,0CAA0C,EAC1C,uBAAuB,EACvB,QAAQ,EACR,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAoDhE,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,YAA8C,EAC9C,mBAA8D,EAC9D,qBAAwC,EACxC,cAAwC,EACxC,gBAAoD,EACpD,uBAAkD;IA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AAE,CAAC,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,CAC5D,oBAAoB,CAClB,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,YAAY,CACb,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { assert } from \"@itwin/core-bentley\";\nimport {\n createMainThreadReleaseOnTimePassedHandler,\n formatConcatenatedValue,\n getClass,\n TypedPrimitiveValue,\n} from \"@itwin/presentation-shared\";\nimport { HierarchyNode } from \"../../../HierarchyNode.js\";\nimport { HierarchyNodeKey } from \"../../../HierarchyNodeKey.js\";\n\nimport type {\n ArrayElement,\n EC,\n ECClassHierarchyInspector,\n ECSchemaProvider,\n IPrimitiveValueFormatter,\n} from \"@itwin/presentation-shared\";\nimport type { ParentHierarchyNode } from \"../../../HierarchyNode.js\";\nimport type { PropertyGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport type {\n HierarchyNodePropertiesGroupingParams,\n HierarchyNodePropertyGroup,\n HierarchyNodePropertyValueRange,\n ProcessedInstanceHierarchyNode,\n} from \"../../IModelHierarchyNode.js\";\nimport type { GroupingHandler, GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\ninterface DisplayablePropertyGroupingInfo {\n label: string;\n propertyGroupingNodeKey: PropertyGroupingNodeKey;\n}\n\ninterface PropertyGroupingInformation {\n ungrouped: ProcessedInstanceHierarchyNode[];\n grouped: Map<\n string,\n { displayablePropertyGroupingInfo: DisplayablePropertyGroupingInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }\n >;\n}\n\n/** @internal */\nexport interface PropertiesGroupingLocalizedStrings {\n other: string;\n unspecified: string;\n}\n\n/** @internal */\nexport interface PropertyGroupInfo {\n ecClass: EC.Class;\n previousPropertiesGroupingInfo: PreviousPropertiesGroupingInfo;\n propertyGroup: Omit<HierarchyNodePropertyGroup, \"propertyValue\">;\n}\n\n/** @internal */\nexport type PreviousPropertiesGroupingInfo = Array<{\n propertiesClassName: EC.FullClassNameDotNotation;\n propertyName: string;\n isRange?: boolean;\n}>;\n\n/** @internal */\nexport async function createPropertyGroups(\n nodesToGroup: ProcessedInstanceHierarchyNode[],\n nodesAlreadyGrouped: ProcessedInstancesGroupingHierarchyNode[],\n handlerGroupingParams: PropertyGroupInfo,\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n classHierarchyInspector: ECClassHierarchyInspector,\n): Promise<GroupingHandlerResult> {\n let otherValuesGrouping: { node: ProcessedInstancesGroupingHierarchyNode; new: boolean } | undefined;\n const getOtherValuesGroupingNode = () => {\n if (!otherValuesGrouping) {\n const node = nodesAlreadyGrouped.find((n) => HierarchyNodeKey.isPropertyOtherValuesGrouping(n.key));\n if (node) {\n otherValuesGrouping = { node, new: false };\n }\n }\n otherValuesGrouping ??= {\n node: {\n key: { type: \"property-grouping:other\" as const, properties: [] },\n parentKeys: [],\n groupedInstanceKeys: [],\n label: localizedStrings.other,\n children: [],\n },\n new: true,\n };\n return otherValuesGrouping.node;\n };\n\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const groupings: PropertyGroupingInformation = { ungrouped: [], grouped: new Map() };\n for (const node of nodesToGroup) {\n await releaseMainThread();\n\n const byProperties = node.processingParams?.grouping?.byProperties;\n if (!byProperties) {\n groupings.ungrouped.push(node);\n continue;\n }\n if (\n !(await shouldCreatePropertyGroup(\n handlerGroupingParams,\n byProperties,\n node.key.instanceKeys[0].className,\n classHierarchyInspector,\n ))\n ) {\n groupings.ungrouped.push(node);\n continue;\n }\n const currentProperty = byProperties.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];\n const propertyClass = handlerGroupingParams.ecClass;\n const property = await propertyClass.getProperty(currentProperty.propertyName);\n\n if (\n !property?.isNavigation() &&\n (!property?.isPrimitive() || property.primitiveType === \"Binary\" || property.primitiveType === \"IGeometry\")\n ) {\n groupings.ungrouped.push(node);\n continue;\n }\n\n const propertyIdentifier = { propertyName: property.name, propertyClassName: property.class.fullName };\n const extendedTypeName = \"extendedTypeName\" in property ? property.extendedTypeName : undefined;\n const primitiveType = \"primitiveType\" in property ? property.primitiveType : \"String\";\n assert(primitiveType !== \"Binary\" && primitiveType !== \"IGeometry\");\n\n if (!currentProperty.propertyValue) {\n if (byProperties.createGroupForUnspecifiedValues) {\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName.toLocaleLowerCase()}:Unspecified`,\n {\n label: localizedStrings.unspecified,\n propertyGroupingNodeKey: {\n type: \"property-grouping:value\",\n ...propertyIdentifier,\n formattedPropertyValue: \"\",\n },\n },\n node,\n );\n continue;\n }\n groupings.ungrouped.push(node);\n continue;\n }\n\n const koqName = (await property.kindOfQuantity)?.fullName;\n if (currentProperty.ranges) {\n if (typeof currentProperty.propertyValue === \"number\") {\n const propValue = currentProperty.propertyValue;\n const matchingRange = currentProperty.ranges.find(\n (range) => propValue >= range.fromValue && propValue <= range.toValue,\n );\n\n if (matchingRange) {\n const fromValueTypedPrimitive: TypedPrimitiveValue = {\n type: Number.isInteger(matchingRange.fromValue) ? \"Integer\" : \"Double\",\n extendedType: extendedTypeName,\n koqName,\n value: matchingRange.fromValue,\n };\n const toValueTypedPrimitive: TypedPrimitiveValue = {\n type: Number.isInteger(matchingRange.toValue) ? \"Integer\" : \"Double\",\n extendedType: extendedTypeName,\n koqName,\n value: matchingRange.toValue,\n };\n\n const rangeLabel =\n matchingRange.rangeLabel ??\n `${await valueFormatter(fromValueTypedPrimitive)} - ${await valueFormatter(toValueTypedPrimitive)}`;\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName.toLocaleLowerCase()}:[${matchingRange.fromValue}-${matchingRange.toValue}]${matchingRange.rangeLabel ? `(${matchingRange.rangeLabel})` : \"\"}`,\n {\n label: rangeLabel,\n propertyGroupingNodeKey: {\n ...propertyIdentifier,\n type: \"property-grouping:range\",\n fromValue: matchingRange.fromValue,\n toValue: matchingRange.toValue,\n },\n },\n node,\n );\n continue;\n }\n }\n if (byProperties.createGroupForOutOfRangeValues) {\n const groupingNode = getOtherValuesGroupingNode();\n assert(HierarchyNodeKey.isPropertyOtherValuesGrouping(groupingNode.key));\n const thisPropertyIdentifier = {\n className: propertyIdentifier.propertyClassName,\n propertyName: propertyIdentifier.propertyName,\n };\n const hasPropertyIdentifier = groupingNode.key.properties.find(\n (x) =>\n x.className.toLocaleLowerCase() === thisPropertyIdentifier.className.toLocaleLowerCase() &&\n x.propertyName.toLocaleLowerCase() === thisPropertyIdentifier.propertyName.toLocaleLowerCase(),\n );\n if (!hasPropertyIdentifier) {\n groupingNode.key.properties.push(thisPropertyIdentifier);\n }\n node.key.instanceKeys.forEach((k) => groupingNode.groupedInstanceKeys.push(k));\n groupingNode.parentKeys = node.parentKeys;\n groupingNode.children.push(Object.assign(node, { parentKeys: [...node.parentKeys, groupingNode.key] }));\n continue;\n }\n groupings.ungrouped.push(node);\n continue;\n }\n\n const formattedValue =\n currentProperty.propertyValue instanceof Array\n ? await formatConcatenatedValue({ value: currentProperty.propertyValue, valueFormatter })\n : await valueFormatter(\n TypedPrimitiveValue.create(currentProperty.propertyValue, primitiveType, koqName, extendedTypeName),\n );\n\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName.toLocaleLowerCase()}:${formattedValue}`,\n {\n label: formattedValue,\n propertyGroupingNodeKey: {\n ...propertyIdentifier,\n type: \"property-grouping:value\",\n formattedPropertyValue: formattedValue,\n },\n },\n node,\n );\n }\n return createGroupingNodes(groupings, otherValuesGrouping?.new ? otherValuesGrouping.node : undefined);\n}\n\nfunction addGroupingToMap(\n groupingMap: Map<\n string,\n { displayablePropertyGroupingInfo: DisplayablePropertyGroupingInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }\n >,\n mapKey: string,\n propertyToAdd: DisplayablePropertyGroupingInfo,\n node: ProcessedInstanceHierarchyNode,\n): void {\n let groupingInfo = groupingMap.get(mapKey);\n if (!groupingInfo) {\n groupingInfo = { displayablePropertyGroupingInfo: propertyToAdd, groupedNodes: [node] };\n groupingMap.set(mapKey, groupingInfo);\n return;\n }\n groupingInfo.groupedNodes.push(node);\n}\n\nfunction createGroupingNodes(\n groupings: PropertyGroupingInformation,\n otherValuesGroupingNode: ProcessedInstancesGroupingHierarchyNode | undefined,\n): GroupingHandlerResult {\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n groupings.grouped.forEach((entry) => {\n const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;\n groupedNodes.push({\n label: entry.displayablePropertyGroupingInfo.label,\n key: entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.groupedNodes.map((gn) => ({\n ...gn,\n parentKeys: [...groupedNodeParentKeys, entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey],\n })),\n });\n });\n if (otherValuesGroupingNode) {\n groupedNodes.push(otherValuesGroupingNode);\n }\n return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: \"property\" };\n}\n\nfunction createNodePropertyGroupPathMatchers(\n node: ParentHierarchyNode,\n): Array<(x: ArrayElement<PreviousPropertiesGroupingInfo>) => boolean> {\n if (!HierarchyNode.isPropertyGroupingNode(node)) {\n return [];\n }\n\n const keys = [...node.parentKeys, node.key];\n const propertyGroupingNodeKeys: PropertyGroupingNodeKey[] = [];\n for (let i = keys.length - 1; i >= 0; --i) {\n const key = keys[i];\n if (HierarchyNodeKey.isPropertyGrouping(key)) {\n propertyGroupingNodeKeys.push(key);\n } else {\n break;\n }\n }\n propertyGroupingNodeKeys.reverse();\n\n return propertyGroupingNodeKeys.map((key): ((x: ArrayElement<PreviousPropertiesGroupingInfo>) => boolean) => {\n switch (key.type) {\n case \"property-grouping:other\":\n return (x) =>\n key.properties.some(\n (p) =>\n p.className.toLocaleLowerCase() === x.propertiesClassName.toLocaleLowerCase() &&\n p.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase() &&\n !!x.isRange,\n );\n case \"property-grouping:range\":\n return (x) =>\n key.propertyClassName.toLocaleLowerCase() === x.propertiesClassName.toLocaleLowerCase() &&\n key.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase();\n case \"property-grouping:value\":\n return (x) =>\n key.propertyClassName.toLocaleLowerCase() === x.propertiesClassName.toLocaleLowerCase() &&\n key.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase();\n }\n });\n}\n\n/** @internal */\nexport async function getUniquePropertiesGroupInfo(\n schemaProvider: ECSchemaProvider,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n): Promise<Array<PropertyGroupInfo>> {\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const parentPropertyGroupPath = parentNode ? createNodePropertyGroupPathMatchers(parentNode) : [];\n const uniqueProperties = new Map<string, PropertyGroupInfo>();\n for (const node of nodes) {\n await releaseMainThread();\n\n const byProperties = node.processingParams?.grouping?.byProperties;\n if (!byProperties) {\n continue;\n }\n\n let propertyGroupIndex = 0;\n const previousPropertiesInfo = new Array<{ propertyGroup: HierarchyNodePropertyGroup; propertyGroupKey: string }>();\n for (const propertyGroup of byProperties.propertyGroups) {\n const mapKeyRanges = getRangesAsString(propertyGroup.ranges);\n const lastKey =\n previousPropertiesInfo.length > 0\n ? previousPropertiesInfo[previousPropertiesInfo.length - 1].propertyGroupKey\n : \"\";\n const propertyGroupKey = `${lastKey}:${propertyGroup.propertyName}(${mapKeyRanges})`;\n const mapKey = `${byProperties.propertiesClassName}:${propertyGroupKey}`.toLocaleLowerCase();\n\n let isAlreadyGrouped = false;\n if (parentPropertyGroupPath.length > 0 && propertyGroupIndex < parentPropertyGroupPath.length) {\n const groupMatcher = parentPropertyGroupPath[propertyGroupIndex];\n isAlreadyGrouped = groupMatcher({\n propertiesClassName: byProperties.propertiesClassName,\n propertyName: propertyGroup.propertyName,\n isRange: !!propertyGroup.ranges,\n });\n }\n if (!isAlreadyGrouped && !uniqueProperties.get(mapKey)) {\n uniqueProperties.set(mapKey, {\n ecClass: await getClass(schemaProvider, byProperties.propertiesClassName),\n propertyGroup: { propertyName: propertyGroup.propertyName, ranges: propertyGroup.ranges },\n previousPropertiesGroupingInfo: previousPropertiesInfo.map((groupingInfo) => ({\n propertiesClassName: byProperties.propertiesClassName,\n propertyName: groupingInfo.propertyGroup.propertyName,\n isRange: !!groupingInfo.propertyGroup.ranges,\n })),\n });\n }\n\n previousPropertiesInfo.push({ propertyGroup, propertyGroupKey });\n ++propertyGroupIndex;\n }\n }\n // Order might change in uniqueProperties, resorting to make sure that properties with fewer previous properties are returned first.\n return [...uniqueProperties.values()].sort(\n (lhs, rhs) => lhs.previousPropertiesGroupingInfo.length - rhs.previousPropertiesGroupingInfo.length,\n );\n}\n\nfunction getRangesAsString(ranges?: HierarchyNodePropertyValueRange[]): string {\n return ranges\n ? ranges\n .map((range) => `${range.fromValue}-${range.toValue}(${range.rangeLabel ?? \"\"})`)\n .sort()\n .join(\";\")\n : \"\";\n}\n\nasync function shouldCreatePropertyGroup(\n handlerGroupingParams: PropertyGroupInfo,\n nodePropertyGroupingParams: HierarchyNodePropertiesGroupingParams,\n nodeFullClassName: EC.FullClassNameDotNotation,\n classHierarchyInspector: ECClassHierarchyInspector,\n): Promise<boolean> {\n if (\n nodePropertyGroupingParams.propertiesClassName.toLocaleLowerCase() !==\n handlerGroupingParams.ecClass.fullName.toLocaleLowerCase() ||\n nodePropertyGroupingParams.propertyGroups.length < handlerGroupingParams.previousPropertiesGroupingInfo.length + 1\n ) {\n return false;\n }\n const currentProperty =\n nodePropertyGroupingParams.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];\n if (\n currentProperty.propertyName.toLocaleLowerCase() !==\n handlerGroupingParams.propertyGroup.propertyName.toLocaleLowerCase() ||\n !doRangesMatch(currentProperty.ranges, handlerGroupingParams.propertyGroup.ranges)\n ) {\n return false;\n }\n if (!doPreviousPropertiesMatch(handlerGroupingParams.previousPropertiesGroupingInfo, nodePropertyGroupingParams)) {\n return false;\n }\n return classHierarchyInspector.classDerivesFrom(nodeFullClassName, handlerGroupingParams.ecClass.fullName);\n}\n\n/** @internal */\nexport function doPreviousPropertiesMatch(\n previousPropertiesGroupingInfo: PreviousPropertiesGroupingInfo,\n nodesProperties: HierarchyNodePropertiesGroupingParams,\n): boolean {\n return (\n previousPropertiesGroupingInfo.length <= nodesProperties.propertyGroups.length &&\n previousPropertiesGroupingInfo.every(\n (groupingInfo, index) =>\n groupingInfo.propertiesClassName.toLocaleLowerCase() ===\n nodesProperties.propertiesClassName.toLocaleLowerCase() &&\n groupingInfo.propertyName.toLocaleLowerCase() ===\n nodesProperties.propertyGroups[index].propertyName.toLocaleLowerCase() &&\n !!groupingInfo.isRange === !!nodesProperties.propertyGroups[index].ranges,\n )\n );\n}\n\n/** @internal */\nexport function doRangesMatch(\n ranges1: HierarchyNodePropertyValueRange[] | undefined,\n ranges2: HierarchyNodePropertyValueRange[] | undefined,\n): boolean {\n if (typeof ranges1 !== typeof ranges2) {\n return false;\n }\n if (!ranges1) {\n return true;\n }\n assert(Array.isArray(ranges2));\n if (ranges1.length !== ranges2.length) {\n return false;\n }\n return (\n // Check twice, to validate if both ranges have the same elements (elements can be in a different order)\n ranges1.every((lhsRange) =>\n ranges2.some(\n (rhsRange) =>\n lhsRange.fromValue === rhsRange.fromValue &&\n lhsRange.toValue === rhsRange.toValue &&\n lhsRange.rangeLabel === rhsRange.rangeLabel,\n ),\n ) &&\n ranges2.every((lhsRange) =>\n ranges1.some(\n (rhsRange) =>\n lhsRange.fromValue === rhsRange.fromValue &&\n lhsRange.toValue === rhsRange.toValue &&\n lhsRange.rangeLabel === rhsRange.rangeLabel,\n ),\n )\n );\n}\n\n/** @internal */\nexport async function createPropertiesGroupingHandlers(\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n): Promise<GroupingHandler[]> {\n const propertiesGroupInfo = await getUniquePropertiesGroupInfo(imodelAccess, parentNode, nodes);\n return propertiesGroupInfo.map(\n (propertyInfo) => async (nodesToGroup, nodesAlreadyGrouped) =>\n createPropertyGroups(\n nodesToGroup,\n nodesAlreadyGrouped,\n propertyInfo,\n valueFormatter,\n localizedStrings,\n imodelAccess,\n ),\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shared.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/Shared.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,+BAA+B,EAEhC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,uCAAuC,EAAE,MAAM,gBAAgB,CAAC;AAE5F,gBAAgB;AAChB,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,uCAAuC,EACnD,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,CAAC,cAAc,EAAE,+BAA+B,GAAG,SAAS,KAAK,OAAO,GAAG,SAAS,GACvF,IAAI,CAqBN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shared.js","sourceRoot":"","sources":["../../../../../src/hierarchies/imodel/operators/grouping/Shared.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAQhG,gBAAgB;AAChB,MAAM,UAAU,8BAA8B,CAC5C,UAAmD,EACnD,YAA0B,EAC1B,EAAwF;IAExF,SAAS,iBAAiB,CAAC,MAAyD;QAClF,QAAQ,YAAY,EAAE,CAAC;YACrB,KAAK,YAAY;gBACf,OAAO,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC;YACzC,KAAK,OAAO;gBACV,OAAO,OAAO,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YAC7F,KAAK,OAAO;gBACV,OAAO,OAAO,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK,OAAO;oBAChG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO;oBACzB,CAAC,CAAC,SAAS,CAAC;YAChB,KAAK,UAAU;gBACb,OAAO,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC;QAC1C,CAAC;IACH,CAAC;IACD,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC5C,MAAM,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACrE,IAAI,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type {\n HierarchyNodeGroupingParamsBase,\n InstanceHierarchyNodeProcessingParams,\n} from \"../../IModelHierarchyNode.js\";\nimport type { GroupingType, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\n/** @internal */\nexport function iterateChildNodeGroupingParams(\n parentNode: ProcessedInstancesGroupingHierarchyNode,\n groupingType: GroupingType,\n cb: (groupingParams: HierarchyNodeGroupingParamsBase | undefined) => boolean | undefined,\n): void {\n function getGroupingParams(params: InstanceHierarchyNodeProcessingParams | undefined) {\n switch (groupingType) {\n case \"base-class\":\n return params?.grouping?.byBaseClasses;\n case \"class\":\n return typeof params?.grouping?.byClass === \"object\" ? params.grouping.byClass : undefined;\n case \"label\":\n return typeof params?.grouping?.byLabel === \"object\" && params.grouping.byLabel.action !== \"merge\"\n ? params.grouping.byLabel\n : undefined;\n case \"property\":\n return params?.grouping?.byProperties;\n }\n }\n for (const childNode of parentNode.children) {\n const groupingParams = getGroupingParams(childNode.processingParams);\n if (cb(groupingParams)) {\n return;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Common.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/internal/Common.ts"],"names":[],"mappings":"AAKA,OAAO,sBAAsB,CAAC;AAK9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,6BAA6B,yCAAqC,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,iDAA8C,CAAC;AAElG,gBAAgB;AAChB,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,EACpB,YAAY,EACR,OAAO,iBAAiB,GACxB,OAAO,6BAA6B,GACpC,OAAO,0BAA0B,GACjC,OAAO,sCAAsC,UAGlD;AAED,gBAAgB;AAEhB,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAC;IAAC,GAAG,EAAE,gBAAgB,CAAC;IAAC,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAAE,GAAG,SAAS,UAchH;AAGD,gBAAgB;AAChB,wBAAgB,WAAW,CAAC,KAAK,SAAS;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,EAAE,CAAC,CAAC;AACtF,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,UAA2E;IACrG,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;QAC5B,UAAU,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;SAAM,IAAI,MAAM,CAAC,OAAO,IAAI,UAAU,EAAE,CAAC;QACxC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/B,CAAC;AACH,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,mBAAmB,CAAI,eAA+B;IACpE,OAAO,eAAe,YAAY,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;AAC1F,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 \"./DisposePolyfill.js\";\n\nimport naturalCompare from \"natural-compare-lite\";\nimport { from, of } from \"rxjs\";\n\nimport type { Observable } from \"rxjs\";\nimport type { ConcatenatedValue } from \"@itwin/presentation-shared\";\nimport type { HierarchyNodeKey } from \"../HierarchyNodeKey.js\";\n\n/**\n * This is a logging namespace for public log messages that may be interesting to consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE = \"Presentation.Hierarchies\";\n\n/**\n * This is a logging namespace for public performance-related log messages that may be interesting to consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_PERFORMANCE = `${LOGGING_NAMESPACE}.Performance`;\n\n/**\n * This is a logging namespace for internal log messages that are only interesting to package contributors,\n * but not the consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_INTERNAL = \"Presentation.HierarchiesInternal\";\n\n/**\n * This is a logging namespace for internal performance-related log messages that are only interesting\n * to package contributors, but not the consumers.\n * @internal\n */\nexport const LOGGING_NAMESPACE_PERFORMANCE_INTERNAL = `${LOGGING_NAMESPACE_INTERNAL}.Performance`;\n\n/** @internal */\nexport function createOperatorLoggingNamespace(\n operatorName: string,\n baseCategory:\n | typeof LOGGING_NAMESPACE\n | typeof LOGGING_NAMESPACE_PERFORMANCE\n | typeof LOGGING_NAMESPACE_INTERNAL\n | typeof LOGGING_NAMESPACE_PERFORMANCE_INTERNAL,\n) {\n return `${baseCategory}.Operators.${operatorName}`;\n}\n\n/** @internal */\n/* v8 ignore start */\nexport function createNodeIdentifierForLogging(\n node: { label: string | ConcatenatedValue; key: HierarchyNodeKey; parentKeys?: HierarchyNodeKey[] } | undefined,\n) {\n if (!node) {\n return \"<root>\";\n }\n const { label, key } = node;\n const parentKeys = \"parentKeys\" in node ? node.parentKeys : \"<unknown>\";\n const groupedInstanceKeys =\n \"groupedInstanceKeys\" in node && Array.isArray(node.groupedInstanceKeys)\n ? node.groupedInstanceKeys.length <= 3\n ? node.groupedInstanceKeys\n : `<${node.groupedInstanceKeys.length} keys>`\n : undefined;\n return JSON.stringify({ label, key, parentKeys, groupedInstanceKeys });\n}\n/* v8 ignore stop */\n\n/** @internal */\nexport function hasChildren<TNode extends { children?: boolean | Array<unknown> }>(node: TNode) {\n return node.children === true || (Array.isArray(node.children) && node.children.length > 0);\n}\n\n/** @internal */\nexport function compareNodesByLabel<TLhsNode extends { label: string }, TRhsNode extends { label: string }>(\n lhs: TLhsNode,\n rhs: TRhsNode,\n): number {\n return naturalCompare(lhs.label.toLocaleLowerCase(), rhs.label.toLocaleLowerCase());\n}\n\n/**\n * A helper that disposes the given object, if it's disposable.\n *\n * The first option is to dispose using the deprecated `dispose` method if it exists on the object.\n * If not, we use the new `Symbol.dispose` method. If that doesn't exist either, the object is\n * considered as non-disposable and nothing is done with it.\n *\n * @internal\n */\nexport function safeDispose(disposable: {} | { [Symbol.dispose]: () => void } | { dispose: () => void }) {\n if (\"dispose\" in disposable) {\n disposable.dispose();\n } else if (Symbol.dispose in disposable) {\n disposable[Symbol.dispose]();\n }\n}\n\n/** @internal */\nexport function fromPossiblyPromise<T>(possiblyPromise: T | Promise<T>): Observable<T> {\n return possiblyPromise instanceof Promise ? from(possiblyPromise) : of(possiblyPromise);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisposePolyfill.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/internal/DisposePolyfill.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisposePolyfill.js","sourceRoot":"","sources":["../../../src/hierarchies/internal/DisposePolyfill.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AACF,MAAc,CAAC,OAAO,KAAK,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACpD,MAAc,CAAC,YAAY,KAAK,MAAM,CAAC,qBAAqB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * Polyfill for upcoming resource management feature: https://github.com/tc39/proposal-explicit-resource-management\n */\n(Symbol as any).dispose ??= Symbol(\"Symbol.dispose\");\n(Symbol as any).asyncDispose ??= Symbol(\"Symbol.asyncDispose\");\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EachValueFrom.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/internal/EachValueFrom.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC;;;;;;;;GAQG;AACH,wBAAuB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAwDvF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EachValueFrom.js","sourceRoot":"","sources":["../../../src/hierarchies/internal/EachValueF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B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;IAEM,GAAG;QACR,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACzB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { Observable } from \"rxjs\";\n\n// cspell:words deferreds\n\n/**\n * This is pretty much a combination of:\n * - https://github.com/benlesh/rxjs-for-await/blob/94f9cf9cb015ac3700dfd1850eb81d36962eb70f/src/index.ts#L33,\n * - https://github.com/ReactiveX/rxjs/blob/2587ee852eb43eeb0883a7787bac2944d823392b/packages/observable/src/observable.ts#L922.\n *\n * Our implementation uses a linked list rather than an array to store values, which is more efficient.\n *\n * @internal\n */\nexport async function* eachValueFrom<T>(source: Observable<T>): AsyncIterableIterator<T> {\n const deferreds = new Queue<{ resolve: (value: IteratorResult<T>) => void; reject: (reason: unknown) => void }>();\n const values = new Queue<T>();\n let error;\n let completed = false;\n const subs = source.subscribe({\n next: (value) => {\n const deferred = deferreds.pop();\n if (deferred) {\n deferred.resolve({ value, done: false });\n } else {\n values.push(value);\n }\n },\n error: (err) => {\n error = err;\n for (let deferred = deferreds.pop(); deferred !== undefined; deferred = deferreds.pop()) {\n deferred.reject(err);\n }\n },\n complete: () => {\n completed = true;\n for (let deferred = deferreds.pop(); deferred !== undefined; deferred = deferreds.pop()) {\n deferred.resolve({ value: undefined, done: true });\n }\n },\n });\n try {\n while (true) {\n const value = values.pop();\n if (value !== undefined) {\n yield value;\n continue;\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (completed) {\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (error) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw error;\n }\n const result = await new Promise<IteratorResult<T>>((resolve, reject) => {\n deferreds.push({ resolve, reject });\n });\n if (result.done) {\n return;\n }\n yield result.value;\n }\n } catch (err) {\n throw err;\n } finally {\n subs.unsubscribe();\n }\n}\n\nclass QueueEntry<T> {\n constructor(\n public readonly value: T,\n public next?: QueueEntry<T>,\n ) {}\n}\n\nclass Queue<T> {\n private _front?: QueueEntry<T>;\n private _back?: QueueEntry<T>;\n\n public push(item: T) {\n const entry = new QueueEntry<T>(item);\n if (this._back) {\n this._back.next = entry;\n }\n this._back = entry;\n if (!this._front) {\n this._front = entry;\n }\n }\n\n public pop(): T | undefined {\n if (!this._front) {\n return undefined;\n }\n const value = this._front.value;\n this._front = this._front.next;\n if (!this._front) {\n this._back = undefined;\n }\n return value;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoggingUtils.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/internal/LoggingUtils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEpE,gBAAgB;AAChB,MAAM,WAAW,eAAe,CAAC,WAAW,GAAG,IAAI;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,CAAC;CACvC;AAED,gBAAgB;AAChB,wBAAgB,KAAK,CAAC,KAAK,EAAE,eAAe,QAQ3C;AAeD,gBAAg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AAc,KAAmC;IAClE,OAAO,GAAG,CAAc,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { tap } from \"rxjs\";\nimport { getLogger } from \"../Logging.js\";\n\nimport type { ILogger, LogLevel } from \"@itwin/presentation-shared\";\n\n/** @internal */\nexport interface LogMessageProps<TMessageArg = void> {\n category: string;\n severity?: LogLevel;\n message: (arg: TMessageArg) => string;\n}\n\n/** @internal */\nexport function doLog(props: LogMessageProps) {\n const logger = getLogger();\n const severity = props.severity ?? \"trace\";\n if (!logger.isEnabled(props.category, severity)) {\n return;\n }\n const logFunc = getLogFunc(logger, severity);\n logFunc(props.category, props.message());\n}\n\nfunction getLogFunc(logger: ILogger, severity: LogLevel) {\n switch (severity) {\n case \"error\":\n return logger.logError.bind(logger);\n case \"warning\":\n return logger.logWarning.bind(logger);\n case \"info\":\n return logger.logInfo.bind(logger);\n case \"trace\":\n return logger.logTrace.bind(logger);\n }\n}\n\n/** @internal */\nexport function log<TMessageArg>(props: LogMessageProps<TMessageArg>) {\n return tap<TMessageArg>((n) => doLog({ ...props, message: () => props.message(n) }));\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RxjsHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/internal/RxjsHierarchyDefinition.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EACV,yBAAy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iB5G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RxjsHierarchyDefinition.js","sourceRoot":"","sources":["../../../src/hierarchies/internal/RxjsHierarchyDefinition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA4FlD,gBAAgB;AAChB,MAAM,UAAU,0BAA0B,CAAC,mBAAwC;IACjF,OAAO;QACL,SAAS,EAAE,mBAAmB,CAAC,SAAS;YACtC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;gBACR,MAAM,UAAU,GAAG,mBAAmB,CAAC,SAAU,CAAC,KAAK,CAAC,CAAC;gBACzD,OAAO,mBAAmB,CAAC,UAAU,CAAC,CAAC;YACzC,CAAC;YACH,CAAC,CAAC,SAAS;QACb,cAAc,EAAE,mBAAmB,CAAC,cAAc;YAChD,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,CAAC,mBAAmB,CAAC,cAAe,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;YAC3G,CAAC,CAAC,SAAS;QACb,eAAe,EAAE,mBAAmB,CAAC,eAAe;YAClD,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,eAAgB,CAAC,KAAK,CAAC,CAAC;YAC9D,CAAC,CAAC,SAAS;QACb,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;KACvF,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, from } from \"rxjs\";\nimport { fromPossiblyPromise } from \"./Common.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { ParentHierarchyNode } from \"../HierarchyNode.js\";\nimport type {\n DefineHierarchyLevelProps,\n HierarchyDefinition,\n HierarchyDefinitionParentNode,\n HierarchyLevelDefinition,\n} from \"../imodel/IModelHierarchyDefinition.js\";\nimport type {\n ProcessedGenericHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n SourceInstanceHierarchyNode,\n} from \"../imodel/IModelHierarchyNode.js\";\n\n/**\n * A type for a function that parses a `SourceInstanceHierarchyNode` from provided ECSQL `row` object.\n * @internal\n */\nexport type RxjsNodeParser = (props: {\n row: { [columnName: string]: any };\n parentNode?: HierarchyDefinitionParentNode;\n imodelKey: string;\n}) => Observable<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 * @internal\n */\nexport type RxjsNodePreProcessor = <\n TNode extends ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode,\n>(props: {\n node: TNode;\n parentNode?: ParentHierarchyNode;\n}) => Observable<TNode>;\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 * @internal\n */\nexport type RxjsNodePostProcessor = (props: {\n node: ProcessedHierarchyNode;\n parentNode?: ParentHierarchyNode;\n}) => Observable<ProcessedHierarchyNode>;\n\n/**\n * An interface for a factory that knows how define a hierarchy based on a given parent node.\n * @internal\n */\nexport interface RxjsHierarchyDefinition {\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?: RxjsNodeParser;\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?: RxjsNodePreProcessor;\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?: RxjsNodePostProcessor;\n\n /** A function to create a hierarchy level definition for given parent node. */\n defineHierarchyLevel(props: DefineHierarchyLevelProps): Observable<HierarchyLevelDefinition>;\n}\n\n/** @internal */\nexport function getRxjsHierarchyDefinition(hierarchyDefinition: HierarchyDefinition): RxjsHierarchyDefinition {\n return {\n parseNode: hierarchyDefinition.parseNode\n ? (props) => {\n const parsedNode = hierarchyDefinition.parseNode!(props);\n return fromPossiblyPromise(parsedNode);\n }\n : undefined,\n preProcessNode: hierarchyDefinition.preProcessNode\n ? (props) =>\n from(hierarchyDefinition.preProcessNode!(props)).pipe(filter((preprocessedNode) => !!preprocessedNode))\n : undefined,\n postProcessNode: hierarchyDefinition.postProcessNode\n ? (props) => from(hierarchyDefinition.postProcessNode!(props))\n : undefined,\n defineHierarchyLevel: (props) => from(hierarchyDefinition.defineHierarchyLevel(props)),\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionScheduler.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/internal/SubscriptionScheduler.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpD,gBAAgB;AAChB,qBAAa,qBAAqB;IAChC,OAAO,CAAC,UAAU,CAAuC;IACzD,YAAY,WAAW,EAAE,MAAM,EAuB9B;IACD;;;;;;;;OAQG;IACI,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAcnE;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionScheduler.js","sourceRoot":"","sources":["../../../src/hierarchies/internal/SubscriptionScheduler.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,EACH,QAAQ,EACR,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,OAAO,EACP,WAAW,EACX,GAAG,GACJ,MAAM,MAAM,CAAC;AAId,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IACxB,UAAU,GAAG,IAAI,OAAO,EAAwB,CAAC;IACzD,YAAY,WAAmB;QAC7B,IAAI,CAAC,UAAU;aACZ,IAAI,CACH,QAAQ,CAAC,CAAC,gBAAgB,EAAE,EAAE;YAC5B,OAAO,gBAAgB,CAAC,IAAI;YAC1B,sDAAsD;YACtD,GAAG,CAAC;gBACF,SAAS,EAAE,GAAG,EAAE;oBACd,gBAAgB,CAAC,OAAO,EAAE,CAAC;gBAC7B,CAAC;aACF,CAAC;YACF,0GAA0G;YAC1G,4EAA4E;YAC5E,SAAS,CAAC,cAAc,CAAC;YACzB,qDAAqD;YACrD,WAAW,CAAC,aAAa,CAAC;YAC1B,gFAAgF;YAChF,qBAAqB,EAAE,CACxB,CAAC;QACJ,CAAC,EAAE,WAAW,CAAC,CAChB;YACD,wCAAwC;aACvC,SAAS,EAAE,CAAC;IACjB,CAAC;IACD;;;;;;;;OAQG;IACI,oBAAoB,CAAI,MAAqB;QAClD,OAAO,KAAK,CAAC,GAAG,EAAE;YAChB,IAAI,YAAY,GAAG,KAAK,CAAC;YACzB,MAAM,qBAAqB,GAAG,WAAW,CACvC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,EACtC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,OAAO,EAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAChE,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;YAC5C,OAAO,qBAAqB,CAAC,IAAI,CAC/B,QAAQ,CAAC,GAAG,EAAE;gBACZ,YAAY,GAAG,IAAI,CAAC;YACtB,CAAC,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF","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 {\n asapScheduler,\n connectable,\n defer,\n EMPTY,\n finalize,\n iif,\n mergeMap,\n observeOn,\n onErrorResumeNextWith,\n queueScheduler,\n Subject,\n subscribeOn,\n tap,\n} from \"rxjs\";\n\nimport type { Connectable, Observable } from \"rxjs\";\n\n/** @internal */\nexport class SubscriptionScheduler {\n private _scheduler = new Subject<Connectable<unknown>>();\n constructor(concurrency: number) {\n this._scheduler\n .pipe(\n mergeMap((sourceObservable) => {\n return sourceObservable.pipe(\n // connect source observable when scheduler subscribes\n tap({\n subscribe: () => {\n sourceObservable.connect();\n },\n }),\n // Guard against stack overflow when a lot of observables are scheduled. Without this operation `mergeMap`\n // will process each observable that is present in the pipeline recursively.\n observeOn(queueScheduler),\n // Delay the connection until another event loop task\n subscribeOn(asapScheduler),\n // Ignore errors in this pipeline without suppressing them for other subscribers\n onErrorResumeNextWith(),\n );\n }, concurrency),\n )\n // Start consuming scheduled observables\n .subscribe();\n }\n /**\n * Schedules `source` for subscription in the current scheduler.\n *\n * The actual scheduling is performed when the returned observable is subscribed to. To cancel, remove all subscribers\n * from the returned observable.\n *\n * @param source Input observable for which to schedule a subscription.\n * @returns Hot observable which starts emitting `source` values after subscription.\n */\n public scheduleSubscription<T>(source: Observable<T>): Observable<T> {\n return defer(() => {\n let unsubscribed = false;\n const connectableObservable = connectable(\n iif(() => unsubscribed, EMPTY, source),\n { connector: () => new Subject<T>(), resetOnDisconnect: false },\n );\n this._scheduler.next(connectableObservable);\n return connectableObservable.pipe(\n finalize(() => {\n unsubscribed = true;\n }),\n );\n });\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Partition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/Partition.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;AAGvD,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,MAAM,CAAC;AAE1D,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,EAC1B,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,GAClC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,CAAC,EACzB,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,EAC1B,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAC/B,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Partition.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/Partition.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;A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D,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,GAAG,CAC9B,CAAC,OAAO,EAAE,EAAE,CACV,IAAI,UAAU,CAAC,CAAC,UAAU,EAAE,EAAE;QAC5B,MAAM,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC1D,iBAAiB,EAAE,CAAC;QACpB,OAAO,GAAG,EAAE;YACV,mBAAmB,CAAC,WAAW,EAAE,CAAC;YAClC,qBAAqB,EAAE,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,CAAC,CAC6B,CAAC;AACtC,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 { from, Observable, ReplaySubject } from \"rxjs\";\nimport { assert } from \"@itwin/core-bentley\";\n\nimport type { ObservableInput, Subscription } from \"rxjs\";\n\n/** @internal */\nexport function partition<T, U extends T>(\n source: ObservableInput<T>,\n predicate: (value: T) => value is U,\n): [Observable<U>, Observable<Exclude<T, U>>];\n/** @internal */\nexport function partition<T>(\n source: ObservableInput<T>,\n predicate: (value: T) => boolean,\n): [Observable<T>, Observable<T>];\n\n/**\n * This is similar to `rxjs` `partition` operator, but it subscribes to source observable only once.\n * @internal\n */\nexport function partition<T>(\n source: ObservableInput<T>,\n predicate: (value: T) => boolean,\n): [Observable<T>, Observable<T>] {\n const matches = new ReplaySubject<T>();\n const nonMatches = new ReplaySubject<T>();\n let sourceSubscription: Subscription | undefined;\n let sourceSubscriptionsCount = 0;\n function subscribeToSource() {\n if (sourceSubscriptionsCount++ > 0) {\n return;\n }\n assert(!sourceSubscription);\n sourceSubscription = from(source).subscribe({\n next(value) {\n if (predicate(value)) {\n matches.next(value);\n } else {\n nonMatches.next(value);\n }\n },\n error(error) {\n matches.error(error);\n nonMatches.error(error);\n },\n complete() {\n matches.complete();\n nonMatches.complete();\n },\n });\n }\n function unsubscribeFromSource() {\n assert(sourceSubscriptionsCount > 0);\n if (--sourceSubscriptionsCount === 0) {\n assert(!!sourceSubscription);\n sourceSubscription.unsubscribe();\n sourceSubscription = undefined;\n }\n }\n return [matches, nonMatches].map(\n (subject) =>\n new Observable((subscriber) => {\n const subjectSubscription = subject.subscribe(subscriber);\n subscribeToSource();\n return () => {\n subjectSubscription.unsubscribe();\n unsubscribeFromSource();\n };\n }),\n ) as [Observable<T>, Observable<T>];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReduceToMergeMap.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/ReduceToMergeMap.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5C;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,SAAS,MAAM,EAChF,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,EACnC,KAAK,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,QAAQ,iGASvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,SAAS,MAAM,EAChF,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,EACnC,SAAS,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,GAAG,SAAS,KAAK,QAAQ,YAE/D,eAAe,CAAC,WAAW,CAAC,uDAa7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReduceToMergeMap.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/ReduceToMergeMap.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAIpC;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAmC,EACnC,KAAsC;IAEtC,OAAO,oBAAoB,CAAmC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAChF,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,GAAG,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAmC,EACnC,SAA+E;IAE/E,OAAO,CAAC,MAAoC,EAAE,EAAE,CAC9C,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CACf,MAAM,CAAsC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE;QAC9D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,6EAA6E;YAC7E,0BAA0B;YAC1B,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QACxB,CAAC;QACD,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAClE,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,SAAS,CAAC,CACd,CAAC;AACN,CAAC;AACD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,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 { from, reduce } from \"rxjs\";\n\nimport type { ObservableInput } from \"rxjs\";\n\n/**\n * Reduces the source observable into a `Map<string, TMapItem[]>`, where all input items are grouped based on their key\n * and placed into arrays.\n *\n * @param key A function to calculate map key for the item.\n * @param value A function to calculate entry value for the item.\n *\n * @internal\n */\nexport function reduceToMergeMapList<TSourceItem, TMapItem, TMapKey extends string>(\n key: (item: TSourceItem) => TMapKey,\n value: (item: TSourceItem) => TMapItem,\n) {\n return reduceToMergeMapItem<TSourceItem, TMapItem[], TMapKey>(key, (item, list) => {\n if (!list) {\n list = [];\n }\n list.push(value(item));\n return list;\n });\n}\n\n/**\n * Reduces the source observable into a `Map<string, TMapItem>`, where all input items are grouped based on their key\n * and merged into a single value using provided merge function.\n *\n * @param key A function to calculate map key for the item.\n * @param value A function to create map value using the _current_ item and an item already _existing_ in the map with the same key.\n *\n * @internal\n */\nexport function reduceToMergeMapItem<TSourceItem, TMapItem, TMapKey extends string>(\n key: (item: TSourceItem) => TMapKey,\n mergeFunc: (sourceItem: TSourceItem, mapItem: TMapItem | undefined) => TMapItem,\n) {\n return (source: ObservableInput<TSourceItem>) =>\n from(source).pipe(\n reduce<TSourceItem, Map<TMapKey, TMapItem>>((mergedMap, item) => {\n if (mergedMap === EMPTY_MAP) {\n // this helps us avoid creating an empty map for cases when source observable\n // doesn't emit any values\n mergedMap = new Map();\n }\n const mergeKey = key(item);\n mergedMap.set(mergeKey, mergeFunc(item, mergedMap.get(mergeKey)));\n return mergedMap;\n }, EMPTY_MAP),\n );\n}\nconst EMPTY_MAP = new Map();\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReleaseMainThread.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/ReleaseMainThread.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,SACtD,UAAU,CAAC,CAAC,CAAC,KAAG,UAAU,CAAC,CAAC,CAAC,CAa3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReleaseMainThread.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/ReleaseMainThread.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAIpE;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAAI,YAAoB;IACnE,OAAO,CAAC,GAAkB,EAAiB,EAAE;QAC3C,OAAO,GAAG,CAAC,IAAI,CACb,WAAW,CAAC,YAAY,CAAC,EACzB,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;YACpB,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;YACrB,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,YAAY,EAAE,CAAC;gBAC1C,OAAO,GAAG,CAAC;YACb,CAAC;YACD,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,EACF,SAAS,EAAE,CACZ,CAAC;IACJ,CAAC,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 { bufferCount, concatAll, concatMap, delay, of } from \"rxjs\";\n\nimport type { Observable } from \"rxjs\";\n\n/**\n * Emits a certain amount of values, then releases the main thread for other timers to use.\n * @internal\n */\nexport function releaseMainThreadOnItemsCount<T>(elementCount: number) {\n return (obs: Observable<T>): Observable<T> => {\n return obs.pipe(\n bufferCount(elementCount),\n concatMap((buff, i) => {\n const out = of(buff);\n if (i === 0 && buff.length < elementCount) {\n return out;\n }\n return out.pipe(delay(0));\n }),\n concatAll(),\n );\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShareReplayWithErrors.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/ShareReplayWithErrors.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAErD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,KAAK,wBAAwB,CAAC,CAAC,CAAC,CAOtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShareReplayWithErrors.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/ShareReplayWithErrors.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAI5C;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,KAAK,CAAI;QACd,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,aAAa,EAAE;QACpC,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,mBAAmB,EAAE,KAAK;KAC3B,CAAC,CAAC;AACL,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 { ReplaySubject, share } from \"rxjs\";\n\nimport type { MonoTypeOperatorFunction } from \"rxjs\";\n\n/**\n * This is doing exactly the same as the standard `shareReplay` from `rxjs`, except that\n * source is not retried on error.\n *\n * @internal\n */\nexport function shareReplayWithErrors<T>(): MonoTypeOperatorFunction<T> {\n return share<T>({\n connector: () => new ReplaySubject(),\n resetOnError: false,\n resetOnComplete: false,\n resetOnRefCountZero: false,\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sorting.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/Sorting.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,SAAS;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CASrH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sorting.js","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/Sorting.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAInD;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAkC,KAAwB;IAChG,OAAO,KAAK,CAAC,IAAI,CACf,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,IAAI,WAAW,CAAQ,mBAAmB,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,EACtE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,EAChD,SAAS,EAAE,CACZ,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 { concatAll, map, reduce } from \"rxjs\";\nimport { DuplicatePolicy, SortedArray } from \"@itwin/core-bentley\";\nimport { compareNodesByLabel } from \"../Common.js\";\n\nimport type { Observable } from \"rxjs\";\n\n/**\n * This should accept sorting params in some form:\n * - is sorting disabled?\n * - are we sorting by label or some property value, in case of the latter - how do we get the value?\n *\n * @note Nodes with same labels are returned in undefined order.\n * @internal\n */\nexport function sortNodesByLabelOperator<TNode extends { label: string }>(nodes: Observable<TNode>): Observable<TNode> {\n return nodes.pipe(\n reduce((sorted, node) => {\n sorted.insert(node);\n return sorted;\n }, new SortedArray<TNode>(compareNodesByLabel, DuplicatePolicy.Allow)),\n map((sortedArray) => sortedArray.extractArray()),\n concatAll(),\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TapOnce.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/internal/operators/TapOnce.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAErD,gBAAgB;AAChB,wBAAgB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAW5E"}
|