@itwin/presentation-hierarchies 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE.md +9 -0
- package/README.md +178 -0
- package/lib/cjs/hierarchies/HierarchyDefinition.d.ts +228 -0
- package/lib/cjs/hierarchies/HierarchyDefinition.d.ts.map +1 -0
- package/lib/cjs/hierarchies/HierarchyDefinition.js +94 -0
- package/lib/cjs/hierarchies/HierarchyDefinition.js.map +1 -0
- package/lib/cjs/hierarchies/HierarchyErrors.d.ts +9 -0
- package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +1 -0
- package/lib/cjs/hierarchies/HierarchyErrors.js +20 -0
- package/lib/cjs/hierarchies/HierarchyErrors.js.map +1 -0
- package/lib/cjs/hierarchies/HierarchyNode.d.ts +337 -0
- package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -0
- package/lib/cjs/hierarchies/HierarchyNode.js +64 -0
- package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -0
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts +33 -0
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +34 -0
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +137 -0
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
- package/lib/cjs/hierarchies/HierarchyNodeKey.js +163 -0
- package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -0
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts +104 -0
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -0
- package/lib/cjs/hierarchies/HierarchyProvider.js +384 -0
- package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -0
- package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.d.ts +21 -0
- package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +1 -0
- package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js +100 -0
- package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js.map +1 -0
- package/lib/cjs/hierarchies/Logging.d.ts +13 -0
- package/lib/cjs/hierarchies/Logging.d.ts.map +1 -0
- package/lib/cjs/hierarchies/Logging.js +28 -0
- package/lib/cjs/hierarchies/Logging.js.map +1 -0
- package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts +205 -0
- package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts.map +1 -0
- package/lib/cjs/hierarchies/NodeSelectQueryFactory.js +467 -0
- package/lib/cjs/hierarchies/NodeSelectQueryFactory.js.map +1 -0
- package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts +40 -0
- package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js +84 -0
- package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js.map +1 -0
- package/lib/cjs/hierarchies/internal/Common.d.ts +20 -0
- package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/Common.js +106 -0
- package/lib/cjs/hierarchies/internal/Common.js.map +1 -0
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +12 -0
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/EachValueFrom.js +108 -0
- package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +1 -0
- package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts +39 -0
- package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js +181 -0
- package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js.map +1 -0
- package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts +14 -0
- package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/LoggingUtils.js +56 -0
- package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +1 -0
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts +17 -0
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +57 -0
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
- package/lib/cjs/hierarchies/internal/TreeNodesReader.d.ts +37 -0
- package/lib/cjs/hierarchies/internal/TreeNodesReader.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/TreeNodesReader.js +46 -0
- package/lib/cjs/hierarchies/internal/TreeNodesReader.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/DetermineChildren.d.ts +11 -0
- package/lib/cjs/hierarchies/internal/operators/DetermineChildren.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js +34 -0
- package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/Grouping.d.ts +27 -0
- package/lib/cjs/hierarchies/internal/operators/Grouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/Grouping.js +161 -0
- package/lib/cjs/hierarchies/internal/operators/Grouping.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.d.ts +11 -0
- package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js +52 -0
- package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.d.ts +11 -0
- package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js +55 -0
- package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/Partition.d.ts +6 -0
- package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/Partition.js +61 -0
- package/lib/cjs/hierarchies/internal/operators/Partition.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts +22 -0
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +51 -0
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts +7 -0
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +25 -0
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +9 -0
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +24 -0
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts +12 -0
- package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/Sorting.js +26 -0
- package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts +4 -0
- package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js +20 -0
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.d.ts +4 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js +27 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts +10 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js +115 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.d.ts +6 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js +56 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.d.ts +4 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js +54 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.d.ts +5 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js +61 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts +31 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js +310 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/Shared.d.ts +5 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/Shared.d.ts.map +1 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js +30 -0
- package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js.map +1 -0
- package/lib/cjs/presentation-hierarchies.d.ts +11 -0
- package/lib/cjs/presentation-hierarchies.d.ts.map +1 -0
- package/lib/cjs/presentation-hierarchies.js +31 -0
- package/lib/cjs/presentation-hierarchies.js.map +1 -0
- package/lib/esm/hierarchies/HierarchyDefinition.d.ts +228 -0
- package/lib/esm/hierarchies/HierarchyDefinition.d.ts.map +1 -0
- package/lib/esm/hierarchies/HierarchyDefinition.js +90 -0
- package/lib/esm/hierarchies/HierarchyDefinition.js.map +1 -0
- package/lib/esm/hierarchies/HierarchyErrors.d.ts +9 -0
- package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +1 -0
- package/lib/esm/hierarchies/HierarchyErrors.js +16 -0
- package/lib/esm/hierarchies/HierarchyErrors.js.map +1 -0
- package/lib/esm/hierarchies/HierarchyNode.d.ts +337 -0
- package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -0
- package/lib/esm/hierarchies/HierarchyNode.js +61 -0
- package/lib/esm/hierarchies/HierarchyNode.js.map +1 -0
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +33 -0
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js +31 -0
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts +137 -0
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
- package/lib/esm/hierarchies/HierarchyNodeKey.js +160 -0
- package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -0
- package/lib/esm/hierarchies/HierarchyProvider.d.ts +104 -0
- package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -0
- package/lib/esm/hierarchies/HierarchyProvider.js +380 -0
- package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -0
- package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.d.ts +21 -0
- package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +1 -0
- package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js +96 -0
- package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js.map +1 -0
- package/lib/esm/hierarchies/Logging.d.ts +13 -0
- package/lib/esm/hierarchies/Logging.d.ts.map +1 -0
- package/lib/esm/hierarchies/Logging.js +23 -0
- package/lib/esm/hierarchies/Logging.js.map +1 -0
- package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts +205 -0
- package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts.map +1 -0
- package/lib/esm/hierarchies/NodeSelectQueryFactory.js +463 -0
- package/lib/esm/hierarchies/NodeSelectQueryFactory.js.map +1 -0
- package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts +40 -0
- package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js +80 -0
- package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js.map +1 -0
- package/lib/esm/hierarchies/internal/Common.d.ts +20 -0
- package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/Common.js +95 -0
- package/lib/esm/hierarchies/internal/Common.js.map +1 -0
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +12 -0
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/EachValueFrom.js +104 -0
- package/lib/esm/hierarchies/internal/EachValueFrom.js.map +1 -0
- package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts +39 -0
- package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js +176 -0
- package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js.map +1 -0
- package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +14 -0
- package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/LoggingUtils.js +50 -0
- package/lib/esm/hierarchies/internal/LoggingUtils.js.map +1 -0
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +17 -0
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.js +53 -0
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
- package/lib/esm/hierarchies/internal/TreeNodesReader.d.ts +37 -0
- package/lib/esm/hierarchies/internal/TreeNodesReader.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/TreeNodesReader.js +41 -0
- package/lib/esm/hierarchies/internal/TreeNodesReader.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/DetermineChildren.d.ts +11 -0
- package/lib/esm/hierarchies/internal/operators/DetermineChildren.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/DetermineChildren.js +30 -0
- package/lib/esm/hierarchies/internal/operators/DetermineChildren.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/Grouping.d.ts +27 -0
- package/lib/esm/hierarchies/internal/operators/Grouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/Grouping.js +156 -0
- package/lib/esm/hierarchies/internal/operators/Grouping.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.d.ts +11 -0
- package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js +48 -0
- package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.d.ts +11 -0
- package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js +51 -0
- package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts +6 -0
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/Partition.js +57 -0
- package/lib/esm/hierarchies/internal/operators/Partition.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts +22 -0
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js +46 -0
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +7 -0
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js +21 -0
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +9 -0
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js +20 -0
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +12 -0
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/Sorting.js +22 -0
- package/lib/esm/hierarchies/internal/operators/Sorting.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts +4 -0
- package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/TapOnce.js +16 -0
- package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.d.ts +4 -0
- package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.js +23 -0
- package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts +10 -0
- package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.js +109 -0
- package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.d.ts +6 -0
- package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.js +52 -0
- package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.d.ts +4 -0
- package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.js +50 -0
- package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.d.ts +5 -0
- package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.js +57 -0
- package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts +31 -0
- package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js +302 -0
- package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/Shared.d.ts +5 -0
- package/lib/esm/hierarchies/internal/operators/grouping/Shared.d.ts.map +1 -0
- package/lib/esm/hierarchies/internal/operators/grouping/Shared.js +26 -0
- package/lib/esm/hierarchies/internal/operators/grouping/Shared.js.map +1 -0
- package/lib/esm/presentation-hierarchies.d.ts +11 -0
- package/lib/esm/presentation-hierarchies.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies.js +15 -0
- package/lib/esm/presentation-hierarchies.js.map +1 -0
- package/media/sample-hierarchy.png +0 -0
- package/package.json +71 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { defer, filter, map, merge, mergeMap } from "rxjs";
|
|
6
|
+
import { HierarchyNode } from "../../HierarchyNode";
|
|
7
|
+
import { createNodeIdentifierForLogging, createOperatorLoggingNamespace, hasChildren } from "../Common";
|
|
8
|
+
import { doLog, log } from "../LoggingUtils";
|
|
9
|
+
import { partition } from "./Partition";
|
|
10
|
+
const OPERATOR_NAME = "HideIfNoChildren";
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);
|
|
13
|
+
/**
|
|
14
|
+
* Creates an operator that hides nodes with no children if they have a `hideIfNoChildren` handling param.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export function createHideIfNoChildrenOperator(hasNodes) {
|
|
19
|
+
return function (nodes) {
|
|
20
|
+
const inputNodes = nodes.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }));
|
|
21
|
+
// split input into 3 pieces:
|
|
22
|
+
// - `doesntNeedHide` - nodes without the flag (return no matter if they have children or not)
|
|
23
|
+
// - `determinedChildren` - nodes with the flag and known children
|
|
24
|
+
// - `undeterminedChildren` - nodes with the flag and unknown children
|
|
25
|
+
const [needsHide, doesntNeedHide] = partition(inputNodes, (n) => (HierarchyNode.isCustom(n) || HierarchyNode.isInstancesNode(n)) && !!n.processingParams?.hideIfNoChildren);
|
|
26
|
+
const [determinedChildren, undeterminedChildren] = partition(needsHide, (n) => n.children !== undefined);
|
|
27
|
+
return merge(doesntNeedHide.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: doesn't need hide` })), merge(determinedChildren.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, has children` })), undeterminedChildren.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, needs children` }), mergeMap((n) => defer(() => {
|
|
28
|
+
doLog({
|
|
29
|
+
category: LOGGING_NAMESPACE,
|
|
30
|
+
message: /* istanbul ignore next */ () => `${createNodeIdentifierForLogging(n)}: requesting children flag`,
|
|
31
|
+
});
|
|
32
|
+
return hasNodes(n).pipe(log({
|
|
33
|
+
category: LOGGING_NAMESPACE,
|
|
34
|
+
message: /* istanbul ignore next */ (childrenFlag) => `${createNodeIdentifierForLogging(n)}: determined children: ${childrenFlag}`,
|
|
35
|
+
}), map((children) => Object.assign(n, { children })));
|
|
36
|
+
}),
|
|
37
|
+
// Sending child check requests for all nodes without any limit greatly slows down
|
|
38
|
+
// the following case:
|
|
39
|
+
// - NodeX (determining children) -> ... lots of children with "hide if no children" -> ...
|
|
40
|
+
// We check the nodes with "hide if no children" at most 2 at a time to prefer going deep into
|
|
41
|
+
// the hierarchy, where we're more likely to find an answer, rather than going wide.
|
|
42
|
+
2), log({
|
|
43
|
+
category: LOGGING_NAMESPACE,
|
|
44
|
+
message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, determined children: ${hasChildren(n)}`,
|
|
45
|
+
}))).pipe(filter(hasChildren))).pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }));
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=HideIfNoChildren.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HideIfNoChildren.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideIfNoChildren.ts"],"names":[],"mappings":"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","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, Observable } from \"rxjs\";\nimport { HierarchyNode, ProcessedCustomHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode } from \"../../HierarchyNode\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace, hasChildren } from \"../Common\";\nimport { doLog, log } from \"../LoggingUtils\";\nimport { partition } from \"./Partition\";\n\nconst OPERATOR_NAME = \"HideIfNoChildren\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);\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(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(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 ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode =>\n (HierarchyNode.isCustom(n) || HierarchyNode.isInstancesNode(n)) && !!n.processingParams?.hideIfNoChildren,\n );\n const [determinedChildren, undeterminedChildren] = partition(needsHide, (n) => n.children !== undefined);\n return merge(\n doesntNeedHide.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: doesn't need hide` }),\n ),\n merge(\n determinedChildren.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, has children` }),\n ),\n undeterminedChildren.pipe(\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, needs children` }),\n mergeMap(\n (n) =>\n defer(() => {\n doLog({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () => `${createNodeIdentifierForLogging(n)}: requesting children flag`,\n });\n return hasNodes(n).pipe(\n log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (childrenFlag) => `${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 log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)}: needs hide, determined children: ${hasChildren(n)}`,\n }),\n ),\n ).pipe(filter(hasChildren)),\n ).pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }));\n };\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { ProcessedHierarchyNode } from "../../HierarchyNode";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare const LOGGING_NAMESPACE: string;
|
|
5
|
+
/**
|
|
6
|
+
* Creates an operator that hides nodes and instead returns their children if the nodes have a `hideInHierarchy` handling param.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function createHideNodesInHierarchyOperator(getNodes: (parentNode: ProcessedHierarchyNode) => Observable<ProcessedHierarchyNode>, stopOnFirstChild: boolean): (nodes: Observable<ProcessedHierarchyNode>) => Observable<ProcessedHierarchyNode>;
|
|
11
|
+
//# sourceMappingURL=HideNodesInHierarchy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HideNodesInHierarchy.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideNodesInHierarchy.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0E,UAAU,EAAQ,MAAM,MAAM,CAAC;AAChH,OAAO,EAA+C,sBAAsB,EAAkC,MAAM,qBAAqB,CAAC;AAQ1I,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,QAAgD,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,UAAU,CAAC,sBAAsB,CAAC,EACpF,gBAAgB,EAAE,OAAO,WAED,WAAW,sBAAsB,CAAC,KAAG,WAAW,sBAAsB,CAAC,CA2DhG"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { concat, defer, EMPTY, filter, finalize, map, merge, mergeAll, mergeMap, take } from "rxjs";
|
|
6
|
+
import { HierarchyNode } from "../../HierarchyNode";
|
|
7
|
+
import { createNodeIdentifierForLogging, createOperatorLoggingNamespace, hasChildren, mergeNodes } from "../Common";
|
|
8
|
+
import { doLog, log } from "../LoggingUtils";
|
|
9
|
+
import { partition } from "./Partition";
|
|
10
|
+
import { reduceToMergeMapItem } from "./ReduceToMergeMap";
|
|
11
|
+
const OPERATOR_NAME = "HideNodesInHierarchy";
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);
|
|
14
|
+
/**
|
|
15
|
+
* Creates an operator that hides nodes and instead returns their children if the nodes have a `hideInHierarchy` handling param.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export function createHideNodesInHierarchyOperator(getNodes, stopOnFirstChild) {
|
|
20
|
+
return function (nodes) {
|
|
21
|
+
const inputNodes = nodes.pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }));
|
|
22
|
+
const [withFlag, withoutFlag] = partition(inputNodes, (n) => (HierarchyNode.isCustom(n) || HierarchyNode.isInstancesNode(n)) && !!n.processingParams?.hideInHierarchy);
|
|
23
|
+
// Defer to create a new seed for reduce on every subscribe
|
|
24
|
+
const withLoadedChildren = defer(() => withFlag.pipe(log({
|
|
25
|
+
category: LOGGING_NAMESPACE,
|
|
26
|
+
message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)} needs hide and needs children to be loaded`,
|
|
27
|
+
}), filter((node) => node.children !== false), reduceToMergeMapItem((node) => createMergeMapKey(node), (node, mergedNode) => (mergedNode ? mergeNodes(mergedNode, node) : node)), log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (mm) => `created a merge map of size ${mm.size}` }), mergeMap((mm) => [...mm.values()].map((mergedNode) => defer(() => getNodes(mergedNode)))), mergeAll(), map((n) => n)));
|
|
28
|
+
return merge(withoutFlag.pipe(log({
|
|
29
|
+
category: LOGGING_NAMESPACE,
|
|
30
|
+
message: /* istanbul ignore next */ (n) => `${createNodeIdentifierForLogging(n)} doesn't need hide, return the node`,
|
|
31
|
+
})), stopOnFirstChild
|
|
32
|
+
? concat(
|
|
33
|
+
// 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
|
|
34
|
+
// with a `hasChildren = true` - we just return the hidden node itself in that case to avoid digging deeper into the hierarchy
|
|
35
|
+
inputNodes.pipe(filter(hasChildren), log({
|
|
36
|
+
category: LOGGING_NAMESPACE,
|
|
37
|
+
message: /* istanbul ignore next */ (n) => `\`stopOnFirstChild = true\` and node ${createNodeIdentifierForLogging(n)} is set to always have nodes - return the hidden node without loading children`,
|
|
38
|
+
})), EMPTY.pipe(finalize(() => doLog({
|
|
39
|
+
category: LOGGING_NAMESPACE,
|
|
40
|
+
message: /* istanbul ignore next */ () => `\`stopOnFirstChild = true\` but none of the nodes had children determined to \`true\` - do load children`,
|
|
41
|
+
}))), withLoadedChildren).pipe(take(1))
|
|
42
|
+
: withLoadedChildren).pipe(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }));
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function createMergeMapKey(node) {
|
|
46
|
+
if (typeof node.key === "string") {
|
|
47
|
+
return node.key;
|
|
48
|
+
}
|
|
49
|
+
return node.key.instanceKeys[0].className;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=HideNodesInHierarchy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HideNodesInHierarchy.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/HideNodesInHierarchy.ts"],"names":[],"mappings":"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","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, Observable, take } from \"rxjs\";\nimport { HierarchyNode, ProcessedCustomHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode } from \"../../HierarchyNode\";\nimport { InstancesNodeKey } from \"../../HierarchyNodeKey\";\nimport { createNodeIdentifierForLogging, createOperatorLoggingNamespace, hasChildren, mergeNodes } from \"../Common\";\nimport { doLog, log } from \"../LoggingUtils\";\nimport { partition } from \"./Partition\";\nimport { reduceToMergeMapItem } from \"./ReduceToMergeMap\";\n\nconst OPERATOR_NAME = \"HideNodesInHierarchy\";\n/** @internal */\nexport const LOGGING_NAMESPACE = createOperatorLoggingNamespace(OPERATOR_NAME);\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(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `in: ${createNodeIdentifierForLogging(n)}` }));\n const [withFlag, withoutFlag] = partition(\n inputNodes,\n (n): n is ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode =>\n (HierarchyNode.isCustom(n) || HierarchyNode.isInstancesNode(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 log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (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: ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode | undefined) => (mergedNode ? mergeNodes(mergedNode, node) : node),\n ),\n log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (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 log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (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 log({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ (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 doLog({\n category: LOGGING_NAMESPACE,\n message: /* istanbul ignore next */ () =>\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(log({ category: LOGGING_NAMESPACE, message: /* istanbul ignore next */ (n) => `out: ${createNodeIdentifierForLogging(n)}` }));\n };\n}\n\nfunction createMergeMapKey<TNode extends { key: InstancesNodeKey | string }>(node: TNode): string {\n if (typeof node.key === \"string\") {\n return node.key;\n }\n return node.key.instanceKeys[0].className;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Observable, ObservableInput } from "rxjs";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare function partition<T, U extends T>(source: ObservableInput<T>, predicate: (value: T) => value is U): [Observable<U>, Observable<Exclude<T, U>>];
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare function partition<T>(source: ObservableInput<T>, predicate: (value: T) => boolean): [Observable<T>, Observable<T>];
|
|
6
|
+
//# sourceMappingURL=Partition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Partition.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/Partition.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,UAAU,EAAE,eAAe,EAA+B,MAAM,MAAM,CAAC;AAGtF,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACvJ,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { from, Observable, ReplaySubject } from "rxjs";
|
|
6
|
+
import { assert } from "@itwin/core-bentley";
|
|
7
|
+
/**
|
|
8
|
+
* This is similar to `rxjs` `partition` operator, but it subscribes to source observable only once.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function partition(source, predicate) {
|
|
12
|
+
const matches = new ReplaySubject();
|
|
13
|
+
const nonMatches = new ReplaySubject();
|
|
14
|
+
let sourceSubscription;
|
|
15
|
+
let sourceSubscriptionsCount = 0;
|
|
16
|
+
function subscribeToSource() {
|
|
17
|
+
if (sourceSubscriptionsCount++ > 0) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
assert(!sourceSubscription);
|
|
21
|
+
sourceSubscription = from(source).subscribe({
|
|
22
|
+
next(value) {
|
|
23
|
+
if (predicate(value)) {
|
|
24
|
+
matches.next(value);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
nonMatches.next(value);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
error(error) {
|
|
31
|
+
matches.error(error);
|
|
32
|
+
nonMatches.error(error);
|
|
33
|
+
},
|
|
34
|
+
complete() {
|
|
35
|
+
matches.complete();
|
|
36
|
+
nonMatches.complete();
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function unsubscribeFromSource() {
|
|
41
|
+
assert(sourceSubscriptionsCount > 0);
|
|
42
|
+
if (--sourceSubscriptionsCount === 0) {
|
|
43
|
+
assert(!!sourceSubscription);
|
|
44
|
+
sourceSubscription.unsubscribe();
|
|
45
|
+
sourceSubscription = undefined;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return [matches, nonMatches].map((subject) => new Observable((subscriber) => {
|
|
49
|
+
const subjectSubscription = subject.subscribe(subscriber);
|
|
50
|
+
subscribeToSource();
|
|
51
|
+
return () => {
|
|
52
|
+
subjectSubscription.unsubscribe();
|
|
53
|
+
unsubscribeFromSource();
|
|
54
|
+
};
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=Partition.js.map
|
|
@@ -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,EAAmB,aAAa,EAAgB,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO7C;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAI,MAA0B,EAAE,SAAgC;IACvF,MAAM,OAAO,GAAG,IAAI,aAAa,EAAK,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,aAAa,EAAK,CAAC;IAC1C,IAAI,kBAA4C,CAAC;IACjD,IAAI,wBAAwB,GAAG,CAAC,CAAC;IACjC,SAAS,iBAAiB;QACxB,IAAI,wBAAwB,EAAE,GAAG,CAAC,EAAE,CAAC;YACnC,OAAO;QACT,CAAC;QACD,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAC5B,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;YAC1C,IAAI,CAAC,KAAK;gBACR,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;oBACrB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACtB,CAAC;qBAAM,CAAC;oBACN,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;YACD,KAAK,CAAC,KAAK;gBACT,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACrB,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC;YACD,QAAQ;gBACN,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACnB,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IACD,SAAS,qBAAqB;QAC5B,MAAM,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAC;QACrC,IAAI,EAAE,wBAAwB,KAAK,CAAC,EAAE,CAAC;YACrC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;YAC7B,kBAAkB,CAAC,WAAW,EAAE,CAAC;YACjC,kBAAkB,GAAG,SAAS,CAAC;QACjC,CAAC;IACH,CAAC;IACD,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, ObservableInput, ReplaySubject, Subscription } from \"rxjs\";\nimport { assert } from \"@itwin/core-bentley\";\n\n/** @internal */\nexport function partition<T, U extends T>(source: ObservableInput<T>, predicate: (value: T) => value is U): [Observable<U>, Observable<Exclude<T, U>>];\n/** @internal */\nexport function partition<T>(source: ObservableInput<T>, predicate: (value: T) => boolean): [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>(source: ObservableInput<T>, predicate: (value: T) => boolean): [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,22 @@
|
|
|
1
|
+
import { ObservableInput } from "rxjs";
|
|
2
|
+
/**
|
|
3
|
+
* Reduces the source observable into a `Map<string, TMapItem[]>`, where all input items are grouped based on their key
|
|
4
|
+
* and placed into arrays.
|
|
5
|
+
*
|
|
6
|
+
* @param key A function to calculate map key for the item.
|
|
7
|
+
* @param value A function to calculate entry value for the item.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function reduceToMergeMapList<TSourceItem, TMapItem>(key: (item: TSourceItem) => string, value: (item: TSourceItem) => TMapItem): (source: ObservableInput<TSourceItem>) => import("rxjs").Observable<Map<string, TMapItem[]>>;
|
|
12
|
+
/**
|
|
13
|
+
* Reduces the source observable into a `Map<string, TMapItem>`, where all input items are grouped based on their key
|
|
14
|
+
* and merged into a single value using provided merge function.
|
|
15
|
+
*
|
|
16
|
+
* @param key A function to calculate map key for the item.
|
|
17
|
+
* @param value A function to create map value using the _current_ item and an item already _existing_ in the map with the same key.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function reduceToMergeMapItem<TSourceItem, TMapItem>(key: (item: TSourceItem) => string, mergeFunc: (sourceItem: TSourceItem, mapItem: TMapItem | undefined) => TMapItem): (source: ObservableInput<TSourceItem>) => import("rxjs").Observable<Map<string, TMapItem>>;
|
|
22
|
+
//# sourceMappingURL=ReduceToMergeMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReduceToMergeMap.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/ReduceToMergeMap.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,eAAe,EAAU,MAAM,MAAM,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,QAAQ,gGAQrI;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EACxD,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,EAClC,SAAS,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,GAAG,SAAS,KAAK,QAAQ,YAE/D,gBAAgB,WAAW,CAAC,sDAa7C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { from, reduce } from "rxjs";
|
|
6
|
+
/**
|
|
7
|
+
* Reduces the source observable into a `Map<string, TMapItem[]>`, where all input items are grouped based on their key
|
|
8
|
+
* and placed into arrays.
|
|
9
|
+
*
|
|
10
|
+
* @param key A function to calculate map key for the item.
|
|
11
|
+
* @param value A function to calculate entry value for the item.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export function reduceToMergeMapList(key, value) {
|
|
16
|
+
return reduceToMergeMapItem(key, (item, list) => {
|
|
17
|
+
if (!list) {
|
|
18
|
+
list = [];
|
|
19
|
+
}
|
|
20
|
+
list.push(value(item));
|
|
21
|
+
return list;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Reduces the source observable into a `Map<string, TMapItem>`, where all input items are grouped based on their key
|
|
26
|
+
* and merged into a single value using provided merge function.
|
|
27
|
+
*
|
|
28
|
+
* @param key A function to calculate map key for the item.
|
|
29
|
+
* @param value A function to create map value using the _current_ item and an item already _existing_ in the map with the same key.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export function reduceToMergeMapItem(key, mergeFunc) {
|
|
34
|
+
return (source) => from(source).pipe(reduce((mergedMap, item) => {
|
|
35
|
+
if (mergedMap === EMPTY_MAP) {
|
|
36
|
+
// this helps us avoid creating an empty map for cases when source observable
|
|
37
|
+
// doesn't emit any values
|
|
38
|
+
mergedMap = new Map();
|
|
39
|
+
}
|
|
40
|
+
const mergeKey = key(item);
|
|
41
|
+
mergedMap.set(mergeKey, mergeFunc(item, mergedMap.get(mergeKey)));
|
|
42
|
+
return mergedMap;
|
|
43
|
+
}, EMPTY_MAP));
|
|
44
|
+
}
|
|
45
|
+
const EMPTY_MAP = new Map();
|
|
46
|
+
//# sourceMappingURL=ReduceToMergeMap.js.map
|
|
@@ -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,EAAmB,MAAM,EAAE,MAAM,MAAM,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAwB,GAAkC,EAAE,KAAsC;IACpI,OAAO,oBAAoB,CAA0B,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QACvE,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,GAAkC,EAClC,SAA+E;IAE/E,OAAO,CAAC,MAAoC,EAAE,EAAE,CAC9C,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CACf,MAAM,CAAqC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE;QAC7D,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, ObservableInput, reduce } 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>(key: (item: TSourceItem) => string, value: (item: TSourceItem) => TMapItem) {\n return reduceToMergeMapItem<TSourceItem, TMapItem[]>(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>(\n key: (item: TSourceItem) => string,\n mergeFunc: (sourceItem: TSourceItem, mapItem: TMapItem | undefined) => TMapItem,\n) {\n return (source: ObservableInput<TSourceItem>) =>\n from(source).pipe(\n reduce<TSourceItem, Map<string, 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,7 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
/**
|
|
3
|
+
* Emits a certain amount of values, then releases the main thread for other timers to use.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare function releaseMainThreadOnItemsCount<T>(elementCount: number): (obs: Observable<T>) => Observable<T>;
|
|
7
|
+
//# sourceMappingURL=ReleaseMainThread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReleaseMainThread.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/ReleaseMainThread.ts"],"names":[],"mappings":"AAKA,OAAO,EAA4C,UAAU,EAAM,MAAM,MAAM,CAAC;AAEhF;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,SACtD,WAAW,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAa3C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { bufferCount, concatAll, concatMap, delay, of } from "rxjs";
|
|
6
|
+
/**
|
|
7
|
+
* Emits a certain amount of values, then releases the main thread for other timers to use.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export function releaseMainThreadOnItemsCount(elementCount) {
|
|
11
|
+
return (obs) => {
|
|
12
|
+
return obs.pipe(bufferCount(elementCount), concatMap((buff, i) => {
|
|
13
|
+
const out = of(buff);
|
|
14
|
+
if (i === 0 && buff.length < elementCount) {
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
return out.pipe(delay(0));
|
|
18
|
+
}), concatAll());
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=ReleaseMainThread.js.map
|
|
@@ -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,EAAc,EAAE,EAAE,MAAM,MAAM,CAAC;AAEhF;;;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, Observable, of } 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,9 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from "rxjs";
|
|
2
|
+
/**
|
|
3
|
+
* This is doing exactly the same as the standard `shareReplay` from `rxjs`, except that
|
|
4
|
+
* source is not retried on error.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function shareReplayWithErrors<T>(): MonoTypeOperatorFunction<T>;
|
|
9
|
+
//# sourceMappingURL=ShareReplayWithErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShareReplayWithErrors.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/ShareReplayWithErrors.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAwB,MAAM,MAAM,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,KAAK,wBAAwB,CAAC,CAAC,CAAC,CAOtE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ReplaySubject, share } from "rxjs";
|
|
6
|
+
/**
|
|
7
|
+
* This is doing exactly the same as the standard `shareReplay` from `rxjs`, except that
|
|
8
|
+
* source is not retried on error.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export function shareReplayWithErrors() {
|
|
13
|
+
return share({
|
|
14
|
+
connector: () => new ReplaySubject(),
|
|
15
|
+
resetOnError: false,
|
|
16
|
+
resetOnComplete: false,
|
|
17
|
+
resetOnRefCountZero: false,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ShareReplayWithErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShareReplayWithErrors.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/ShareReplayWithErrors.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAA4B,aAAa,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAEtE;;;;;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 { MonoTypeOperatorFunction, ReplaySubject, share } 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,12 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { ProcessedHierarchyNode } from "../../HierarchyNode";
|
|
3
|
+
/**
|
|
4
|
+
* This should accept sorting params in some form:
|
|
5
|
+
* - is sorting disabled?
|
|
6
|
+
* - are we sorting by label or some property value, in case of the latter - how do we get the value?
|
|
7
|
+
*
|
|
8
|
+
* @note Nodes with same labels are returned in undefined order.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function sortNodesByLabelOperator(nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode>;
|
|
12
|
+
//# sourceMappingURL=Sorting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sorting.d.ts","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/Sorting.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,UAAU,EAAU,MAAM,MAAM,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG7D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,UAAU,CAAC,sBAAsB,CAAC,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAYtH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { concatAll, map, reduce } from "rxjs";
|
|
6
|
+
import { DuplicatePolicy, SortedArray } from "@itwin/core-bentley";
|
|
7
|
+
import { compareNodesByLabel } from "../Common";
|
|
8
|
+
/**
|
|
9
|
+
* This should accept sorting params in some form:
|
|
10
|
+
* - is sorting disabled?
|
|
11
|
+
* - are we sorting by label or some property value, in case of the latter - how do we get the value?
|
|
12
|
+
*
|
|
13
|
+
* @note Nodes with same labels are returned in undefined order.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export function sortNodesByLabelOperator(nodes) {
|
|
17
|
+
return nodes.pipe(reduce((sorted, node) => {
|
|
18
|
+
sorted.insert(node);
|
|
19
|
+
return sorted;
|
|
20
|
+
}, new SortedArray(compareNodesByLabel, DuplicatePolicy.Allow)), map((sortedArray) => sortedArray.extractArray()), concatAll());
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=Sorting.js.map
|
|
@@ -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,EAAc,MAAM,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAyC;IAChF,OAAO,KAAK,CAAC,IAAI,CACf,MAAM,CACJ,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;QACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC,EACD,IAAI,WAAW,CAAyB,mBAAmB,EAAE,eAAe,CAAC,KAAK,CAAC,CACpF,EACD,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, Observable, reduce } from \"rxjs\";\nimport { DuplicatePolicy, SortedArray } from \"@itwin/core-bentley\";\nimport { ProcessedHierarchyNode } from \"../../HierarchyNode\";\nimport { compareNodesByLabel } from \"../Common\";\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(nodes: Observable<ProcessedHierarchyNode>): Observable<ProcessedHierarchyNode> {\n return nodes.pipe(\n reduce(\n (sorted, node) => {\n sorted.insert(node);\n return sorted;\n },\n new SortedArray<ProcessedHierarchyNode>(compareNodesByLabel, DuplicatePolicy.Allow),\n ),\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":"AAKA,OAAO,EAAE,wBAAwB,EAAO,MAAM,MAAM,CAAC;AAErD,gBAAgB;AAChB,wBAAgB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAW5E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { tap } from "rxjs";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export function tapOnce(observer) {
|
|
8
|
+
let first = true;
|
|
9
|
+
return (source) => source.pipe(tap(() => {
|
|
10
|
+
if (first) {
|
|
11
|
+
first = false;
|
|
12
|
+
observer();
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=TapOnce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TapOnce.js","sourceRoot":"","sources":["../../../../../src/hierarchies/internal/operators/TapOnce.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAA4B,GAAG,EAAE,MAAM,MAAM,CAAC;AAErD,gBAAgB;AAChB,MAAM,UAAU,OAAO,CAAI,QAAoB;IAC7C,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,OAAO,CAAC,MAAM,EAAE,EAAE,CAChB,MAAM,CAAC,IAAI,CACT,GAAG,CAAC,GAAG,EAAE;QACP,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,GAAG,KAAK,CAAC;YACd,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACN,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 { MonoTypeOperatorFunction, tap } from \"rxjs\";\n\n/** @internal */\nexport function tapOnce<T>(observer: () => void): MonoTypeOperatorFunction<T> {\n let first = true;\n return (source) =>\n source.pipe(\n tap(() => {\n if (first) {\n first = false;\n observer();\n }\n }),\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoExpand.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/internal/operators/grouping/AutoExpand.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,qBAAqB,CAepF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { iterateChildNodeGroupingParams } from "./Shared";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export function assignAutoExpand(props) {
|
|
8
|
+
for (const node of props.grouped) {
|
|
9
|
+
let autoExpandProp;
|
|
10
|
+
iterateChildNodeGroupingParams(node, props.groupingType, (groupingProps) => {
|
|
11
|
+
if (autoExpandProp === "always") {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
autoExpandProp = groupingProps?.autoExpand ? groupingProps.autoExpand : autoExpandProp;
|
|
15
|
+
return;
|
|
16
|
+
});
|
|
17
|
+
if (autoExpandProp === "always" || (autoExpandProp === "single-child" && node.children.length === 1)) {
|
|
18
|
+
node.autoExpand = true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return props;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=AutoExpand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoExpand.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/internal/operators/grouping/AutoExpand.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAE1D,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 { HierarchyNodeAutoExpandProp } from \"../../../HierarchyNode\";\nimport { GroupingHandlerResult } from \"../Grouping\";\nimport { iterateChildNodeGroupingParams } from \"./Shared\";\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,10 @@
|
|
|
1
|
+
import { EC, ECClassHierarchyInspector, ECSchemaProvider } from "@itwin/presentation-shared";
|
|
2
|
+
import { ParentHierarchyNode, ProcessedInstanceHierarchyNode } from "../../../HierarchyNode";
|
|
3
|
+
import { GroupingHandler, GroupingHandlerResult } from "../Grouping";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare function getBaseClassGroupingECClasses(schemaProvider: ECSchemaProvider, parentNode: ParentHierarchyNode | undefined, nodes: ProcessedInstanceHierarchyNode[]): Promise<EC.Class[]>;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare function createBaseClassGroupsForSingleBaseClass(nodes: ProcessedInstanceHierarchyNode[], baseECClass: EC.Class, classHierarchyInspector: ECClassHierarchyInspector): Promise<GroupingHandlerResult>;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare function createBaseClassGroupingHandlers(imodelAccess: ECSchemaProvider & ECClassHierarchyInspector, parentNode: ParentHierarchyNode | undefined, nodes: ProcessedInstanceHierarchyNode[]): Promise<GroupingHandler[]>;
|
|
10
|
+
//# sourceMappingURL=BaseClassGrouping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseClassGrouping.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/internal/operators/grouping/BaseClassGrouping.ts"],"names":[],"mappings":"AAKA,OAAO,EAA8C,EAAE,EAAE,yBAAyB,EAAE,gBAAgB,EAAY,MAAM,4BAA4B,CAAC;AACnJ,OAAO,EAAiB,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAE5G,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAErE,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,CAyBrB;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,CA0ChC;AAsCD,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,CAG5B"}
|