@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,137 @@
|
|
|
1
|
+
import { InstanceKey } from "@itwin/presentation-shared";
|
|
2
|
+
/**
|
|
3
|
+
* A key for a node that represents one or more ECInstances.
|
|
4
|
+
* @beta
|
|
5
|
+
*/
|
|
6
|
+
export interface InstancesNodeKey {
|
|
7
|
+
/** Type of the node */
|
|
8
|
+
type: "instances";
|
|
9
|
+
/**
|
|
10
|
+
* Keys of ECInstances that are represented by the node. Generally, one node represents a single
|
|
11
|
+
* ECInstance, but in some cases (e.g. node merging) there could be more.
|
|
12
|
+
*/
|
|
13
|
+
instanceKeys: InstanceKey[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A key for a class-grouping node.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export interface ClassGroupingNodeKey {
|
|
20
|
+
/** Type of the node */
|
|
21
|
+
type: "class-grouping";
|
|
22
|
+
/** Full name of the ECClass that this grouping node is grouping by. */
|
|
23
|
+
className: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A key for a label-grouping node.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export interface LabelGroupingNodeKey {
|
|
30
|
+
/** Type of the node */
|
|
31
|
+
type: "label-grouping";
|
|
32
|
+
/** Node label that this grouping node is grouping by. */
|
|
33
|
+
label: string;
|
|
34
|
+
/**
|
|
35
|
+
* Optional group identifier that is assigned to the node key when multiple nodes
|
|
36
|
+
* with the same label shouldn't be grouped together.
|
|
37
|
+
*/
|
|
38
|
+
groupId?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A key property grouping node that groups nodes whose values don't fall into any other
|
|
42
|
+
* property group in the hierarchy level.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
export interface PropertyOtherValuesGroupingNodeKey {
|
|
47
|
+
/** Type of the node */
|
|
48
|
+
type: "property-grouping:other";
|
|
49
|
+
/** Identifiers of properties whose values are grouped under this node. */
|
|
50
|
+
properties: Array<{
|
|
51
|
+
className: string;
|
|
52
|
+
propertyName: string;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A key for a property grouping node that groups nodes by formatted property value.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export interface PropertyValueGroupingNodeKey {
|
|
60
|
+
/** Type of the node */
|
|
61
|
+
type: "property-grouping:value";
|
|
62
|
+
/** Name of the property that is used for grouping nodes. */
|
|
63
|
+
propertyName: string;
|
|
64
|
+
/** Full name of the ECClass containing the property. */
|
|
65
|
+
propertyClassName: string;
|
|
66
|
+
/** Formatted property value that this node is grouping by. */
|
|
67
|
+
formattedPropertyValue: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A key for a property grouping node that groups nodes by a range of property values.
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export interface PropertyValueRangeGroupingNodeKey {
|
|
74
|
+
/** Type of the node */
|
|
75
|
+
type: "property-grouping:range";
|
|
76
|
+
/** Name of the property that is used for grouping nodes. */
|
|
77
|
+
propertyName: string;
|
|
78
|
+
/** Full name of the ECClass containing the property. */
|
|
79
|
+
propertyClassName: string;
|
|
80
|
+
/** Defines the start of the values' range that this node is grouping by. */
|
|
81
|
+
fromValue: number;
|
|
82
|
+
/** Defines the end of the values' range that this node is grouping by. */
|
|
83
|
+
toValue: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A key for a property grouping node.
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
export type PropertyGroupingNodeKey = PropertyValueRangeGroupingNodeKey | PropertyValueGroupingNodeKey | PropertyOtherValuesGroupingNodeKey;
|
|
90
|
+
/**
|
|
91
|
+
* A key for one of the instance grouping nodes.
|
|
92
|
+
* @beta
|
|
93
|
+
*/
|
|
94
|
+
export type GroupingNodeKey = ClassGroupingNodeKey | LabelGroupingNodeKey | PropertyGroupingNodeKey;
|
|
95
|
+
/**
|
|
96
|
+
* A key for either an instance node or one of the instance grouping nodes.
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
export type StandardHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;
|
|
100
|
+
/**
|
|
101
|
+
* A key that uniquely identifies a node in a hierarchy level.
|
|
102
|
+
* @beta
|
|
103
|
+
*/
|
|
104
|
+
export type HierarchyNodeKey = StandardHierarchyNodeKey | string;
|
|
105
|
+
/** @beta */
|
|
106
|
+
export declare namespace HierarchyNodeKey {
|
|
107
|
+
/** Checks whether the given node key is a custom node key. */
|
|
108
|
+
function isCustom(key: HierarchyNodeKey): key is string;
|
|
109
|
+
/** Checks whether the given node key is a `StandardHierarchyNodeKey`. */
|
|
110
|
+
function isStandard(key: HierarchyNodeKey): key is StandardHierarchyNodeKey;
|
|
111
|
+
/** Checks whether the given node key is an `InstancesNodeKey`. */
|
|
112
|
+
function isInstances(key: HierarchyNodeKey): key is InstancesNodeKey;
|
|
113
|
+
/** Checks whether the given node key is a `GroupingNodeKey`. */
|
|
114
|
+
function isGrouping(key: HierarchyNodeKey): key is GroupingNodeKey;
|
|
115
|
+
/** Checks whether the given node key is a `ClassGroupingNodeKey`. */
|
|
116
|
+
function isClassGrouping(key: HierarchyNodeKey): key is ClassGroupingNodeKey;
|
|
117
|
+
/** Checks whether the given node key is a `LabelGroupingNodeKey`. */
|
|
118
|
+
function isLabelGrouping(key: HierarchyNodeKey): key is LabelGroupingNodeKey;
|
|
119
|
+
/** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */
|
|
120
|
+
function isPropertyOtherValuesGrouping(key: HierarchyNodeKey): key is PropertyOtherValuesGroupingNodeKey;
|
|
121
|
+
/** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */
|
|
122
|
+
function isPropertyValueRangeGrouping(key: HierarchyNodeKey): key is PropertyValueRangeGroupingNodeKey;
|
|
123
|
+
/** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */
|
|
124
|
+
function isPropertyValueGrouping(key: HierarchyNodeKey): key is PropertyValueGroupingNodeKey;
|
|
125
|
+
/** Checks whether the given node key is a `PropertyGroupingNodeKey`. */
|
|
126
|
+
function isPropertyGrouping(key: HierarchyNodeKey): key is PropertyGroupingNodeKey;
|
|
127
|
+
/**
|
|
128
|
+
* Compares two given keys. Returns:
|
|
129
|
+
* - `0` if they are equal,
|
|
130
|
+
* - `negative value` if lhs key is less than rhs key,
|
|
131
|
+
* - `positive value` if lhs key is more than rhs key.
|
|
132
|
+
*/
|
|
133
|
+
function compare(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): number;
|
|
134
|
+
/** Checks whether the two given keys are equal. */
|
|
135
|
+
function equals(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): boolean;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=HierarchyNodeKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HierarchyNodeKey.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,IAAI,EAAE,WAAW,CAAC;IAElB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AAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAuF5E;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAE5E;CACF"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.HierarchyNodeKey = void 0;
|
|
8
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
|
+
const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
10
|
+
/** @beta */
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
12
|
+
var HierarchyNodeKey;
|
|
13
|
+
(function (HierarchyNodeKey) {
|
|
14
|
+
/** Checks whether the given node key is a custom node key. */
|
|
15
|
+
function isCustom(key) {
|
|
16
|
+
return typeof key === "string";
|
|
17
|
+
}
|
|
18
|
+
HierarchyNodeKey.isCustom = isCustom;
|
|
19
|
+
/** Checks whether the given node key is a `StandardHierarchyNodeKey`. */
|
|
20
|
+
function isStandard(key) {
|
|
21
|
+
return !!key.type;
|
|
22
|
+
}
|
|
23
|
+
HierarchyNodeKey.isStandard = isStandard;
|
|
24
|
+
/** Checks whether the given node key is an `InstancesNodeKey`. */
|
|
25
|
+
function isInstances(key) {
|
|
26
|
+
return isStandard(key) && key.type === "instances";
|
|
27
|
+
}
|
|
28
|
+
HierarchyNodeKey.isInstances = isInstances;
|
|
29
|
+
/** Checks whether the given node key is a `GroupingNodeKey`. */
|
|
30
|
+
function isGrouping(key) {
|
|
31
|
+
return isStandard(key) && !isInstances(key);
|
|
32
|
+
}
|
|
33
|
+
HierarchyNodeKey.isGrouping = isGrouping;
|
|
34
|
+
/** Checks whether the given node key is a `ClassGroupingNodeKey`. */
|
|
35
|
+
function isClassGrouping(key) {
|
|
36
|
+
return isStandard(key) && key.type === "class-grouping";
|
|
37
|
+
}
|
|
38
|
+
HierarchyNodeKey.isClassGrouping = isClassGrouping;
|
|
39
|
+
/** Checks whether the given node key is a `LabelGroupingNodeKey`. */
|
|
40
|
+
function isLabelGrouping(key) {
|
|
41
|
+
return isStandard(key) && key.type === "label-grouping";
|
|
42
|
+
}
|
|
43
|
+
HierarchyNodeKey.isLabelGrouping = isLabelGrouping;
|
|
44
|
+
/** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */
|
|
45
|
+
function isPropertyOtherValuesGrouping(key) {
|
|
46
|
+
return isStandard(key) && key.type === "property-grouping:other";
|
|
47
|
+
}
|
|
48
|
+
HierarchyNodeKey.isPropertyOtherValuesGrouping = isPropertyOtherValuesGrouping;
|
|
49
|
+
/** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */
|
|
50
|
+
function isPropertyValueRangeGrouping(key) {
|
|
51
|
+
return isStandard(key) && key.type === "property-grouping:range";
|
|
52
|
+
}
|
|
53
|
+
HierarchyNodeKey.isPropertyValueRangeGrouping = isPropertyValueRangeGrouping;
|
|
54
|
+
/** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */
|
|
55
|
+
function isPropertyValueGrouping(key) {
|
|
56
|
+
return isStandard(key) && key.type === "property-grouping:value";
|
|
57
|
+
}
|
|
58
|
+
HierarchyNodeKey.isPropertyValueGrouping = isPropertyValueGrouping;
|
|
59
|
+
/** Checks whether the given node key is a `PropertyGroupingNodeKey`. */
|
|
60
|
+
function isPropertyGrouping(key) {
|
|
61
|
+
return isPropertyOtherValuesGrouping(key) || isPropertyValueRangeGrouping(key) || isPropertyValueGrouping(key);
|
|
62
|
+
}
|
|
63
|
+
HierarchyNodeKey.isPropertyGrouping = isPropertyGrouping;
|
|
64
|
+
/**
|
|
65
|
+
* Compares two given keys. Returns:
|
|
66
|
+
* - `0` if they are equal,
|
|
67
|
+
* - `negative value` if lhs key is less than rhs key,
|
|
68
|
+
* - `positive value` if lhs key is more than rhs key.
|
|
69
|
+
*/
|
|
70
|
+
function compare(lhs, rhs) {
|
|
71
|
+
if (typeof lhs === "string") {
|
|
72
|
+
if (typeof rhs !== "string") {
|
|
73
|
+
return 1;
|
|
74
|
+
}
|
|
75
|
+
return (0, core_bentley_1.compareStrings)(lhs, rhs);
|
|
76
|
+
}
|
|
77
|
+
if (typeof rhs === "string") {
|
|
78
|
+
return -1;
|
|
79
|
+
}
|
|
80
|
+
const typeCompareResult = (0, core_bentley_1.compareStrings)(lhs.type, rhs.type);
|
|
81
|
+
if (typeCompareResult !== 0) {
|
|
82
|
+
return typeCompareResult;
|
|
83
|
+
}
|
|
84
|
+
switch (lhs.type) {
|
|
85
|
+
case "instances": {
|
|
86
|
+
(0, core_bentley_1.assert)(rhs.type === "instances");
|
|
87
|
+
if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {
|
|
88
|
+
return lhs.instanceKeys.length > rhs.instanceKeys.length ? 1 : -1;
|
|
89
|
+
}
|
|
90
|
+
for (let i = 0; i < lhs.instanceKeys.length; ++i) {
|
|
91
|
+
const instanceKeyCompareResult = presentation_shared_1.InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i]);
|
|
92
|
+
if (instanceKeyCompareResult !== 0) {
|
|
93
|
+
return instanceKeyCompareResult;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
case "class-grouping": {
|
|
99
|
+
(0, core_bentley_1.assert)(rhs.type === "class-grouping");
|
|
100
|
+
return (0, core_bentley_1.compareStrings)(lhs.className, rhs.className);
|
|
101
|
+
}
|
|
102
|
+
case "label-grouping": {
|
|
103
|
+
(0, core_bentley_1.assert)(rhs.type === "label-grouping");
|
|
104
|
+
const labelCompareResult = (0, core_bentley_1.compareStrings)(lhs.label, rhs.label);
|
|
105
|
+
if (labelCompareResult !== 0) {
|
|
106
|
+
return labelCompareResult;
|
|
107
|
+
}
|
|
108
|
+
return (0, core_bentley_1.compareStringsOrUndefined)(lhs.groupId, rhs.groupId);
|
|
109
|
+
}
|
|
110
|
+
case "property-grouping:other": {
|
|
111
|
+
(0, core_bentley_1.assert)(rhs.type === "property-grouping:other");
|
|
112
|
+
if (lhs.properties.length !== rhs.properties.length) {
|
|
113
|
+
return lhs.properties.length - rhs.properties.length;
|
|
114
|
+
}
|
|
115
|
+
for (let i = 0; i < lhs.properties.length; ++i) {
|
|
116
|
+
const classCompareResult = (0, core_bentley_1.compareStrings)(lhs.properties[i].className, rhs.properties[i].className);
|
|
117
|
+
if (classCompareResult !== 0) {
|
|
118
|
+
return classCompareResult;
|
|
119
|
+
}
|
|
120
|
+
const nameCompareResult = (0, core_bentley_1.compareStrings)(lhs.properties[i].propertyName, rhs.properties[i].propertyName);
|
|
121
|
+
if (nameCompareResult !== 0) {
|
|
122
|
+
return nameCompareResult;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
case "property-grouping:value": {
|
|
128
|
+
(0, core_bentley_1.assert)(rhs.type === "property-grouping:value");
|
|
129
|
+
const propertyClassNameCompareResult = (0, core_bentley_1.compareStrings)(lhs.propertyClassName, rhs.propertyClassName);
|
|
130
|
+
if (propertyClassNameCompareResult !== 0) {
|
|
131
|
+
return propertyClassNameCompareResult;
|
|
132
|
+
}
|
|
133
|
+
const propertyNameCompareResult = (0, core_bentley_1.compareStrings)(lhs.propertyName, rhs.propertyName);
|
|
134
|
+
if (propertyNameCompareResult !== 0) {
|
|
135
|
+
return propertyNameCompareResult;
|
|
136
|
+
}
|
|
137
|
+
return (0, core_bentley_1.compareStrings)(lhs.formattedPropertyValue, rhs.formattedPropertyValue);
|
|
138
|
+
}
|
|
139
|
+
case "property-grouping:range": {
|
|
140
|
+
(0, core_bentley_1.assert)(rhs.type === "property-grouping:range");
|
|
141
|
+
const propertyClassNameCompareResult = (0, core_bentley_1.compareStrings)(lhs.propertyClassName, rhs.propertyClassName);
|
|
142
|
+
if (propertyClassNameCompareResult !== 0) {
|
|
143
|
+
return propertyClassNameCompareResult;
|
|
144
|
+
}
|
|
145
|
+
const propertyNameCompareResult = (0, core_bentley_1.compareStrings)(lhs.propertyName, rhs.propertyName);
|
|
146
|
+
if (propertyNameCompareResult !== 0) {
|
|
147
|
+
return propertyNameCompareResult;
|
|
148
|
+
}
|
|
149
|
+
if (lhs.fromValue !== rhs.fromValue) {
|
|
150
|
+
return lhs.fromValue > rhs.fromValue ? 1 : -1;
|
|
151
|
+
}
|
|
152
|
+
return lhs.toValue > rhs.toValue ? 1 : lhs.toValue < rhs.toValue ? -1 : 0;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
HierarchyNodeKey.compare = compare;
|
|
157
|
+
/** Checks whether the two given keys are equal. */
|
|
158
|
+
function equals(lhs, rhs) {
|
|
159
|
+
return compare(lhs, rhs) === 0;
|
|
160
|
+
}
|
|
161
|
+
HierarchyNodeKey.equals = equals;
|
|
162
|
+
})(HierarchyNodeKey || (exports.HierarchyNodeKey = HierarchyNodeKey = {}));
|
|
163
|
+
//# sourceMappingURL=HierarchyNodeKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HierarchyNodeKey.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,sDAAwF;AACxF,oEAAyD;AA8HzD,YAAY;AACZ,2DAA2D;AAC3D,IAAiB,gBAAgB,CAsJhC;AAtJD,WAAiB,gBAAgB;IAC/B,8DAA8D;IAC9D,SAAgB,QAAQ,CAAC,GAAqB;QAC5C,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC;IACjC,CAAC;IAFe,yBAAQ,WAEvB,CAAA;IAED,yEAAyE;IACzE,SAAgB,UAAU,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AC,sBAAsB,CAAC,CAAC;YAChF,CAAC;YACD,KAAK,yBAAyB,CAAC,CAAC,CAAC;gBAC/B,IAAA,qBAAM,EAAC,GAAG,CAAC,IAAI,KAAK,yBAAyB,CAAC,CAAC;gBAC/C,MAAM,8BAA8B,GAAG,IAAA,6BAAc,EAAC,GAAG,CAAC,iBAAiB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;gBACpG,IAAI,8BAA8B,KAAK,CAAC,EAAE,CAAC;oBACzC,OAAO,8BAA8B,CAAC;gBACxC,CAAC;gBACD,MAAM,yBAAyB,GAAG,IAAA,6BAAc,EAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;gBACrF,IAAI,yBAAyB,KAAK,CAAC,EAAE,CAAC;oBACpC,OAAO,yBAAyB,CAAC;gBACnC,CAAC;gBACD,IAAI,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,EAAE,CAAC;oBACpC,OAAO,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChD,CAAC;gBACD,OAAO,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAvFe,wBAAO,UAuFtB,CAAA;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAqB,EAAE,GAAqB;QACjE,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAFe,uBAAM,SAErB,CAAA;AACH,CAAC,EAtJgB,gBAAgB,gCAAhB,gBAAgB,QAsJhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { assert, compareStrings, compareStringsOrUndefined } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"@itwin/presentation-shared\";\n\n/**\n * A key for a node that represents one or more ECInstances.\n * @beta\n */\nexport interface InstancesNodeKey {\n /** Type of the node */\n type: \"instances\";\n\n /**\n * Keys of ECInstances that are represented by the node. Generally, one node represents a single\n * ECInstance, but in some cases (e.g. node merging) there could be more.\n */\n instanceKeys: InstanceKey[];\n}\n\n/**\n * A key for a class-grouping node.\n * @internal\n */\nexport interface ClassGroupingNodeKey {\n /** Type of the node */\n type: \"class-grouping\";\n\n /** Full name of the ECClass that this grouping node is grouping by. */\n className: string;\n}\n\n/**\n * A key for a label-grouping node.\n * @internal\n */\nexport interface LabelGroupingNodeKey {\n /** Type of the node */\n type: \"label-grouping\";\n\n /** Node label that this grouping node is grouping by. */\n label: string;\n\n /**\n * Optional group identifier that is assigned to the node key when multiple nodes\n * with the same label shouldn't be grouped together.\n */\n groupId?: string;\n}\n\n/**\n * A key property grouping node that groups nodes whose values don't fall into any other\n * property group in the hierarchy level.\n *\n * @internal\n */\nexport interface PropertyOtherValuesGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:other\";\n /** Identifiers of properties whose values are grouped under this node. */\n properties: Array<{\n className: string;\n propertyName: string;\n }>;\n}\n\n/**\n * A key for a property grouping node that groups nodes by formatted property value.\n * @internal\n */\nexport interface PropertyValueGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:value\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Formatted property value that this node is grouping by. */\n formattedPropertyValue: string;\n}\n\n/**\n * A key for a property grouping node that groups nodes by a range of property values.\n * @internal\n */\nexport interface PropertyValueRangeGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:range\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Defines the start of the values' range that this node is grouping by. */\n fromValue: number;\n\n /** Defines the end of the values' range that this node is grouping by. */\n toValue: number;\n}\n\n/**\n * A key for a property grouping node.\n * @internal\n */\nexport type PropertyGroupingNodeKey = PropertyValueRangeGroupingNodeKey | PropertyValueGroupingNodeKey | PropertyOtherValuesGroupingNodeKey;\n\n/**\n * A key for one of the instance grouping nodes.\n * @beta\n */\nexport type GroupingNodeKey = ClassGroupingNodeKey | LabelGroupingNodeKey | PropertyGroupingNodeKey;\n\n/**\n * A key for either an instance node or one of the instance grouping nodes.\n * @internal\n */\nexport type StandardHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;\n\n/**\n * A key that uniquely identifies a node in a hierarchy level.\n * @beta\n */\nexport type HierarchyNodeKey = StandardHierarchyNodeKey | string;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeKey {\n /** Checks whether the given node key is a custom node key. */\n export function isCustom(key: HierarchyNodeKey): key is string {\n return typeof key === \"string\";\n }\n\n /** Checks whether the given node key is a `StandardHierarchyNodeKey`. */\n export function isStandard(key: HierarchyNodeKey): key is StandardHierarchyNodeKey {\n return !!(key as StandardHierarchyNodeKey).type;\n }\n\n /** Checks whether the given node key is an `InstancesNodeKey`. */\n export function isInstances(key: HierarchyNodeKey): key is InstancesNodeKey {\n return isStandard(key) && key.type === \"instances\";\n }\n\n /** Checks whether the given node key is a `GroupingNodeKey`. */\n export function isGrouping(key: HierarchyNodeKey): key is GroupingNodeKey {\n return isStandard(key) && !isInstances(key);\n }\n\n /** Checks whether the given node key is a `ClassGroupingNodeKey`. */\n export function isClassGrouping(key: HierarchyNodeKey): key is ClassGroupingNodeKey {\n return isStandard(key) && key.type === \"class-grouping\";\n }\n\n /** Checks whether the given node key is a `LabelGroupingNodeKey`. */\n export function isLabelGrouping(key: HierarchyNodeKey): key is LabelGroupingNodeKey {\n return isStandard(key) && key.type === \"label-grouping\";\n }\n\n /** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */\n export function isPropertyOtherValuesGrouping(key: HierarchyNodeKey): key is PropertyOtherValuesGroupingNodeKey {\n return isStandard(key) && key.type === \"property-grouping:other\";\n }\n\n /** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */\n export function isPropertyValueRangeGrouping(key: HierarchyNodeKey): key is PropertyValueRangeGroupingNodeKey {\n return isStandard(key) && key.type === \"property-grouping:range\";\n }\n\n /** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */\n export function isPropertyValueGrouping(key: HierarchyNodeKey): key is PropertyValueGroupingNodeKey {\n return isStandard(key) && key.type === \"property-grouping:value\";\n }\n\n /** Checks whether the given node key is a `PropertyGroupingNodeKey`. */\n export function isPropertyGrouping(key: HierarchyNodeKey): key is PropertyGroupingNodeKey {\n return isPropertyOtherValuesGrouping(key) || isPropertyValueRangeGrouping(key) || isPropertyValueGrouping(key);\n }\n\n /**\n * Compares two given keys. Returns:\n * - `0` if they are equal,\n * - `negative value` if lhs key is less than rhs key,\n * - `positive value` if lhs key is more than rhs key.\n */\n export function compare(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): number {\n if (typeof lhs === \"string\") {\n if (typeof rhs !== \"string\") {\n return 1;\n }\n return compareStrings(lhs, rhs);\n }\n if (typeof rhs === \"string\") {\n return -1;\n }\n\n const typeCompareResult = compareStrings(lhs.type, rhs.type);\n if (typeCompareResult !== 0) {\n return typeCompareResult;\n }\n\n switch (lhs.type) {\n case \"instances\": {\n assert(rhs.type === \"instances\");\n if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {\n return lhs.instanceKeys.length > rhs.instanceKeys.length ? 1 : -1;\n }\n for (let i = 0; i < lhs.instanceKeys.length; ++i) {\n const instanceKeyCompareResult = InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i]);\n if (instanceKeyCompareResult !== 0) {\n return instanceKeyCompareResult;\n }\n }\n return 0;\n }\n case \"class-grouping\": {\n assert(rhs.type === \"class-grouping\");\n return compareStrings(lhs.className, rhs.className);\n }\n case \"label-grouping\": {\n assert(rhs.type === \"label-grouping\");\n const labelCompareResult = compareStrings(lhs.label, rhs.label);\n if (labelCompareResult !== 0) {\n return labelCompareResult;\n }\n return compareStringsOrUndefined(lhs.groupId, rhs.groupId);\n }\n case \"property-grouping:other\": {\n assert(rhs.type === \"property-grouping:other\");\n if (lhs.properties.length !== rhs.properties.length) {\n return lhs.properties.length - rhs.properties.length;\n }\n for (let i = 0; i < lhs.properties.length; ++i) {\n const classCompareResult = compareStrings(lhs.properties[i].className, rhs.properties[i].className);\n if (classCompareResult !== 0) {\n return classCompareResult;\n }\n const nameCompareResult = compareStrings(lhs.properties[i].propertyName, rhs.properties[i].propertyName);\n if (nameCompareResult !== 0) {\n return nameCompareResult;\n }\n }\n return 0;\n }\n case \"property-grouping:value\": {\n assert(rhs.type === \"property-grouping:value\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n return compareStrings(lhs.formattedPropertyValue, rhs.formattedPropertyValue);\n }\n case \"property-grouping:range\": {\n assert(rhs.type === \"property-grouping:range\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n if (lhs.fromValue !== rhs.fromValue) {\n return lhs.fromValue > rhs.fromValue ? 1 : -1;\n }\n return lhs.toValue > rhs.toValue ? 1 : lhs.toValue < rhs.toValue ? -1 : 0;\n }\n }\n }\n\n /** Checks whether the two given keys are equal. */\n export function equals(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): boolean {\n return compare(lhs, rhs) === 0;\n }\n}\n"]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { GenericInstanceFilter } from "@itwin/core-common";
|
|
2
|
+
import { ECClassHierarchyInspector, ECSchemaProvider, InstanceKey, IPrimitiveValueFormatter } from "@itwin/presentation-shared";
|
|
3
|
+
import { HierarchyDefinition } from "./HierarchyDefinition";
|
|
4
|
+
import { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode";
|
|
5
|
+
import { HierarchyNodeIdentifiersPath } from "./HierarchyNodeIdentifier";
|
|
6
|
+
import { LimitingECSqlQueryExecutor } from "./LimitingECSqlQueryExecutor";
|
|
7
|
+
/**
|
|
8
|
+
* Props for the `HierarchyProvider.getNodes` call.
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export interface GetHierarchyNodesProps {
|
|
12
|
+
/** Parent node to get children for. Pass `undefined` to get root nodes. */
|
|
13
|
+
parentNode: ParentHierarchyNode | undefined;
|
|
14
|
+
/** Optional hierarchy level filter. Has no effect if `parentNode` is a `GroupingNode`. */
|
|
15
|
+
instanceFilter?: GenericInstanceFilter;
|
|
16
|
+
/**
|
|
17
|
+
* Optional hierarchy level size limit override. This value is passed to `LimitingECSqlQueryExecutor` used
|
|
18
|
+
* by this provider to override query rows limit per hierarchy level. If not provided, defaults to whatever
|
|
19
|
+
* is used by the limiting query executor.
|
|
20
|
+
*
|
|
21
|
+
* Has no effect if `parentNode` is a `GroupingNode`.
|
|
22
|
+
*/
|
|
23
|
+
hierarchyLevelSizeLimit?: number | "unbounded";
|
|
24
|
+
/** When set to true ignores the cache and fetches the nodes again. */
|
|
25
|
+
ignoreCache?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* An interface for a hierarchy provider knows how to create child nodes for a given parent node.
|
|
29
|
+
* @beta
|
|
30
|
+
*/
|
|
31
|
+
export interface HierarchyProvider {
|
|
32
|
+
/** Gets nodes for the specified parent node. */
|
|
33
|
+
getNodes(props: GetHierarchyNodesProps): AsyncIterableIterator<HierarchyNode>;
|
|
34
|
+
/** Gets instance keys for the specified parent node. */
|
|
35
|
+
getNodeInstanceKeys(props: Omit<GetHierarchyNodesProps, "ignoreCache">): AsyncIterableIterator<InstanceKey>;
|
|
36
|
+
/** Notifies the provider that the underlying data source has changed and caches should be invalidated. */
|
|
37
|
+
notifyDataSourceChanged(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Overrides the property value formatter used by the hierarchy provider. Setting to `undefined`
|
|
40
|
+
* resets the formatter to the result of `createDefaultValueFormatter` called with default parameters.
|
|
41
|
+
*/
|
|
42
|
+
setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Defines the strings used by hierarchy provider.
|
|
46
|
+
*/
|
|
47
|
+
interface HierarchyProviderLocalizedStrings {
|
|
48
|
+
/**
|
|
49
|
+
* A string for "Unspecified". Used for labels of property grouping nodes
|
|
50
|
+
* that group by an empty value.
|
|
51
|
+
*/
|
|
52
|
+
unspecified: string;
|
|
53
|
+
/**
|
|
54
|
+
* A string for "Other". Used for label of a range property grouping node that
|
|
55
|
+
* groups values which don't fit into any other range.
|
|
56
|
+
*/
|
|
57
|
+
other: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Props for `createHierarchyProvider`.
|
|
61
|
+
*/
|
|
62
|
+
interface HierarchyProviderProps {
|
|
63
|
+
/**
|
|
64
|
+
* An object that provides access to iModel's data and metadata.
|
|
65
|
+
*
|
|
66
|
+
* @see `ECSchemaProvider`
|
|
67
|
+
* @see `LimitingECSqlQueryExecutor`
|
|
68
|
+
* @see `ECClassHierarchyInspector`
|
|
69
|
+
*/
|
|
70
|
+
imodelAccess: ECSchemaProvider & LimitingECSqlQueryExecutor & ECClassHierarchyInspector;
|
|
71
|
+
/**
|
|
72
|
+
* A function that returns a hierarchy definition, describing how the hierarchy that the provider should be create. The
|
|
73
|
+
* function is called once during the provider's construction.
|
|
74
|
+
*/
|
|
75
|
+
hierarchyDefinition: HierarchyDefinition;
|
|
76
|
+
/** Maximum number of queries that the provider attempts to execute in parallel. Defaults to `10`. */
|
|
77
|
+
queryConcurrency?: number;
|
|
78
|
+
/**
|
|
79
|
+
* The amount of queries whose results are stored in-memory for quick retrieval. Defaults to `1`,
|
|
80
|
+
* which means only results of the last run query are cached.
|
|
81
|
+
*/
|
|
82
|
+
queryCacheSize?: number;
|
|
83
|
+
/**
|
|
84
|
+
* A values formatter for formatting node labels. Defaults to the
|
|
85
|
+
* result of `createDefaultValueFormatter` called with default parameters.
|
|
86
|
+
*/
|
|
87
|
+
formatter?: IPrimitiveValueFormatter;
|
|
88
|
+
/** A set of localized strings to use. Defaults to English strings. */
|
|
89
|
+
localizedStrings?: Partial<HierarchyProviderLocalizedStrings>;
|
|
90
|
+
/** Props for filtering the hierarchy. */
|
|
91
|
+
filtering?: {
|
|
92
|
+
/** A list of node identifiers from root to target node. */
|
|
93
|
+
paths: HierarchyNodeIdentifiersPath[];
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Creates an instance of `HierarchyProvider` that creates a hierarchy based on given iModel and
|
|
98
|
+
* a hierarchy definition, which defines each hierarchy level through ECSQL queries.
|
|
99
|
+
*
|
|
100
|
+
* @beta
|
|
101
|
+
*/
|
|
102
|
+
export declare function createHierarchyProvider(props: HierarchyProviderProps): HierarchyProvider;
|
|
103
|
+
export {};
|
|
104
|
+
//# sourceMappingURL=HierarchyProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HierarchyProvider.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAGL,yBAAyB,EACzB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