@itwin/presentation-hierarchies 2.0.0-alpha.2 → 2.0.0-alpha.20
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 +929 -12
- package/README.md +20 -50
- package/lib/hierarchies/HierarchyErrors.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyErrors.js.map +1 -0
- package/lib/hierarchies/HierarchyMerge.d.ts +19 -0
- package/lib/hierarchies/HierarchyMerge.d.ts.map +1 -0
- package/lib/{esm/hierarchies/HierarchyProvider.js → hierarchies/HierarchyMerge.js} +5 -6
- package/lib/hierarchies/HierarchyMerge.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.d.ts +21 -28
- package/lib/hierarchies/HierarchyNode.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.js +19 -21
- package/lib/hierarchies/HierarchyNode.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/HierarchyNodeIdentifier.d.ts +3 -1
- package/lib/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeIdentifier.js +23 -6
- package/lib/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.d.ts +5 -4
- package/lib/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.js +1 -1
- package/lib/hierarchies/HierarchyNodeKey.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyProvider.d.ts +59 -34
- package/lib/hierarchies/HierarchyProvider.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyProvider.js +61 -0
- package/lib/hierarchies/HierarchyProvider.js.map +1 -0
- package/lib/hierarchies/HierarchySearch.d.ts +297 -0
- package/lib/hierarchies/HierarchySearch.d.ts.map +1 -0
- package/lib/hierarchies/HierarchySearch.js +464 -0
- package/lib/hierarchies/HierarchySearch.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/Logging.d.ts +1 -1
- package/lib/hierarchies/Logging.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/Logging.js +1 -1
- package/lib/hierarchies/Logging.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/HierarchyCache.d.ts +1 -1
- package/lib/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/HierarchyCache.js +4 -7
- package/lib/hierarchies/imodel/HierarchyCache.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.d.ts +34 -11
- package/lib/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/IModelHierarchyNode.d.ts +5 -5
- package/lib/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts +136 -0
- package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyProvider.js +656 -0
- package/lib/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.d.ts +1 -1
- package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.js +14 -11
- package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.d.ts +17 -12
- package/lib/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.js +214 -139
- package/lib/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.d.ts +7 -7
- package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.js +3 -2
- package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts +35 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.js +261 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.d.ts +10 -12
- package/lib/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.js +12 -9
- package/lib/hierarchies/imodel/TreeNodesReader.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/Utils.d.ts +2 -1
- package/lib/hierarchies/imodel/Utils.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/Utils.js +20 -7
- package/lib/hierarchies/imodel/Utils.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/DetermineChildren.d.ts +2 -2
- package/lib/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/DetermineChildren.js +11 -5
- package/lib/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
- package/lib/hierarchies/imodel/operators/Grouping.d.ts +26 -0
- package/lib/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.js +33 -19
- package/lib/hierarchies/imodel/operators/Grouping.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.js +33 -10
- package/lib/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.js +31 -15
- package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +11 -0
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.js +10 -12
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +7 -0
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.js +8 -11
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.js +1 -5
- package/lib/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +5 -0
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.js +2 -10
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.d.ts +7 -7
- package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.js +46 -37
- package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.d.ts +2 -2
- package/lib/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.js +3 -1
- package/lib/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/Common.d.ts +5 -2
- package/lib/hierarchies/internal/Common.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/Common.js +13 -3
- package/lib/hierarchies/internal/Common.js.map +1 -0
- package/lib/hierarchies/internal/DisposePolyfill.d.ts.map +1 -0
- package/lib/hierarchies/internal/DisposePolyfill.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.d.ts +1 -1
- package/lib/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
- package/lib/hierarchies/internal/LoggingUtils.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.d.ts +19 -8
- package/lib/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.js +9 -6
- package/lib/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/SubscriptionScheduler.d.ts +1 -1
- package/lib/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/SubscriptionScheduler.js +1 -4
- package/lib/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Partition.d.ts +2 -1
- package/lib/hierarchies/internal/operators/Partition.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/Partition.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.d.ts +3 -3
- package/lib/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.d.ts +1 -1
- package/lib/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.d.ts +1 -1
- package/lib/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Sorting.d.ts +1 -1
- package/lib/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/Sorting.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.d.ts +1 -1
- package/lib/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/TapOnce.js.map +1 -0
- package/lib/presentation-hierarchies.d.ts +24 -0
- package/lib/presentation-hierarchies.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies.js → presentation-hierarchies.js} +7 -7
- package/lib/presentation-hierarchies.js.map +1 -0
- package/package.json +29 -39
- package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyErrors.js +0 -20
- package/lib/cjs/hierarchies/HierarchyErrors.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyFiltering.d.ts +0 -133
- package/lib/cjs/hierarchies/HierarchyFiltering.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyFiltering.js +0 -232
- package/lib/cjs/hierarchies/HierarchyFiltering.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNode.d.ts +0 -156
- package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNode.js +0 -84
- package/lib/cjs/hierarchies/HierarchyNode.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +0 -35
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +0 -161
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.js +0 -166
- package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts +0 -109
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyProvider.js +0 -44
- package/lib/cjs/hierarchies/HierarchyProvider.js.map +0 -1
- package/lib/cjs/hierarchies/Logging.d.ts.map +0 -1
- package/lib/cjs/hierarchies/Logging.js +0 -27
- package/lib/cjs/hierarchies/Logging.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +0 -36
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js +0 -283
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js +0 -84
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +0 -121
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +0 -21
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +0 -29
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -80
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +0 -449
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +0 -21
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +0 -123
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +0 -230
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +0 -591
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +0 -93
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +0 -37
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +0 -44
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/Utils.js +0 -59
- package/lib/cjs/hierarchies/imodel/Utils.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +0 -34
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts +0 -26
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js +0 -162
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +0 -52
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +0 -68
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +0 -4
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js +0 -26
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +0 -114
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +0 -55
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +0 -4
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +0 -53
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +0 -60
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +0 -309
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts +0 -5
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js +0 -29
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
- package/lib/cjs/hierarchies/internal/Common.d.ts +0 -58
- package/lib/cjs/hierarchies/internal/Common.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/Common.js +0 -80
- package/lib/cjs/hierarchies/internal/Common.js.map +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.js +0 -11
- package/lib/cjs/hierarchies/internal/DisposePolyfill.js.map +0 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +0 -12
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.js +0 -110
- package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +0 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts +0 -12
- package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.js +0 -37
- package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +0 -1
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts +0 -64
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +0 -25
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +0 -57
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Partition.js +0 -60
- package/lib/cjs/hierarchies/internal/operators/Partition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts +0 -22
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +0 -50
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +0 -24
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +0 -23
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.js +0 -25
- package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts +0 -4
- package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js +0 -19
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +0 -1
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/presentation-hierarchies.d.ts +0 -15
- package/lib/cjs/presentation-hierarchies.d.ts.map +0 -1
- package/lib/cjs/presentation-hierarchies.js +0 -40
- package/lib/cjs/presentation-hierarchies.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyErrors.d.ts +0 -9
- package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyErrors.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyFiltering.d.ts +0 -133
- package/lib/esm/hierarchies/HierarchyFiltering.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyFiltering.js +0 -227
- package/lib/esm/hierarchies/HierarchyFiltering.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNode.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNode.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +0 -29
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyProvider.js.map +0 -1
- package/lib/esm/hierarchies/Logging.d.ts +0 -13
- package/lib/esm/hierarchies/Logging.d.ts.map +0 -1
- package/lib/esm/hierarchies/Logging.js.map +0 -1
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +0 -36
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js +0 -277
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +0 -18
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts +0 -234
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -80
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +0 -446
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +0 -140
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +0 -1
- package/lib/esm/hierarchies/imodel/Utils.d.ts +0 -4
- package/lib/esm/hierarchies/imodel/Utils.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/Utils.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts +0 -26
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +0 -32
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
- package/lib/esm/hierarchies/internal/Common.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/Common.js.map +0 -1
- package/lib/esm/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/DisposePolyfill.js.map +0 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +0 -12
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.js +0 -107
- package/lib/esm/hierarchies/internal/EachValueFrom.js.map +0 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.js.map +0 -1
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +0 -17
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts +0 -6
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Partition.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +0 -7
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +0 -9
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +0 -13
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +0 -1
- package/lib/esm/presentation-hierarchies.d.ts +0 -15
- package/lib/esm/presentation-hierarchies.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies.js.map +0 -1
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyErrors.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyErrors.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Partition.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Sorting.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.js +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode.js";
|
|
1
|
+
import type { GenericInstanceFilter } from "@itwin/core-common";
|
|
2
|
+
import type { Event, EventListener, InstanceKey, IPrimitiveValueFormatter, Props, RaisableEvent } from "@itwin/presentation-shared";
|
|
3
|
+
import type { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode.js";
|
|
4
|
+
import type { HierarchySearchTree } from "./HierarchySearch.js";
|
|
6
5
|
/**
|
|
7
6
|
* Props for the `HierarchyProvider.getNodes` call.
|
|
8
7
|
* @public
|
|
@@ -32,9 +31,9 @@ interface HierarchyChangedEventArgs {
|
|
|
32
31
|
formatterChange?: {
|
|
33
32
|
newFormatter: IPrimitiveValueFormatter | undefined;
|
|
34
33
|
};
|
|
35
|
-
/** Set when the hierarchy change was caused by a hierarchy
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
/** Set when the hierarchy change was caused by a hierarchy search change. */
|
|
35
|
+
searchChange?: {
|
|
36
|
+
newSearch: Props<HierarchyProvider["setHierarchySearch"]>;
|
|
38
37
|
};
|
|
39
38
|
}
|
|
40
39
|
/**
|
|
@@ -43,14 +42,13 @@ interface HierarchyChangedEventArgs {
|
|
|
43
42
|
*/
|
|
44
43
|
export interface HierarchyProvider {
|
|
45
44
|
/**
|
|
46
|
-
* An event that provider raises due to a hierarchy change
|
|
47
|
-
* set additional event arguments to provide extra information about what caused the change.
|
|
45
|
+
* An event that provider raises due to a hierarchy change that requires a reload.
|
|
48
46
|
*
|
|
49
47
|
* Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.
|
|
50
|
-
* Implementations may provide additional details on what caused the change through the
|
|
48
|
+
* Implementations may provide additional details on what caused the change through the
|
|
51
49
|
* event arguments.
|
|
52
50
|
*/
|
|
53
|
-
readonly hierarchyChanged: Event<(args
|
|
51
|
+
readonly hierarchyChanged: Event<(args: HierarchyChangedEventArgs) => void>;
|
|
54
52
|
/**
|
|
55
53
|
* Gets nodes for the specified parent node. This is **the method to implement**, otherwise
|
|
56
54
|
* the provider doesn't return any nodes.
|
|
@@ -74,36 +72,63 @@ export interface HierarchyProvider {
|
|
|
74
72
|
*/
|
|
75
73
|
setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;
|
|
76
74
|
/**
|
|
77
|
-
* Sets the hierarchy
|
|
78
|
-
* removes the
|
|
75
|
+
* Sets the hierarchy search used by this hierarchy provider. Setting to `undefined`
|
|
76
|
+
* removes the search.
|
|
79
77
|
*
|
|
80
|
-
* @note There's a difference between `undefined`
|
|
81
|
-
* former means no
|
|
78
|
+
* @note There's a difference between `undefined` search and search with empty paths list. The
|
|
79
|
+
* former means no search is applied, while the latter means the search is applied and it filters-out
|
|
82
80
|
* all hierarchy.
|
|
83
81
|
*
|
|
84
|
-
* @note Changing
|
|
82
|
+
* @note Changing search is expected to trigger the `hierarchyChanged` event with `searchChange` arg.
|
|
85
83
|
*/
|
|
86
|
-
|
|
87
|
-
/** A list of
|
|
88
|
-
paths:
|
|
84
|
+
setHierarchySearch(props: {
|
|
85
|
+
/** A list of search trees that define paths from root to search target nodes. */
|
|
86
|
+
paths: HierarchySearchTree[];
|
|
89
87
|
} | undefined): void;
|
|
90
88
|
}
|
|
91
89
|
/**
|
|
92
|
-
*
|
|
90
|
+
* An utility to create a `HierarchyProvider` from a partial implementation.
|
|
91
|
+
*
|
|
92
|
+
* Creating a `HierarchyProvider` directly requires implementing all its methods:
|
|
93
|
+
* ```ts
|
|
94
|
+
* {
|
|
95
|
+
* hierarchyChanged: new BeEvent(),
|
|
96
|
+
* async *getNodes({ parentNode }) {
|
|
97
|
+
* // yield nodes...
|
|
98
|
+
* },
|
|
99
|
+
* async *getNodeInstanceKeys() {},
|
|
100
|
+
* setFormatter() {},
|
|
101
|
+
* setHierarchySearch() {},
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* However, in many cases you may only need to implement the `getNodes` method and
|
|
106
|
+
* can rely on default implementations for other methods.
|
|
107
|
+
*
|
|
108
|
+
* With this utility you can implement only part of it, e.g. just the `getNodes` method:
|
|
109
|
+
* ```ts
|
|
110
|
+
* // provide implementation as a javascript object
|
|
111
|
+
* createHierarchyProvider(({ hierarchyChanged }) => ({
|
|
112
|
+
* async *getNodes({ parentNode }) {
|
|
113
|
+
* // yield nodes...
|
|
114
|
+
* },
|
|
115
|
+
* }));
|
|
116
|
+
*
|
|
117
|
+
* // or, provide implementation as a class instance:
|
|
118
|
+
* createHierarchyProvider(
|
|
119
|
+
* ({ hierarchyChanged }) =>
|
|
120
|
+
* new (class implements Pick<HierarchyProvider, "getNodes"> {
|
|
121
|
+
* public async *getNodes({ parentNode }): ReturnType<HierarchyProvider["getNodes"]> {
|
|
122
|
+
* // yield nodes...
|
|
123
|
+
* }
|
|
124
|
+
* })(),
|
|
125
|
+
* );
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
93
128
|
* @public
|
|
94
129
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Creates a single, merged, hierarchy provider from multiple given providers.
|
|
101
|
-
* @public
|
|
102
|
-
*/
|
|
103
|
-
export declare function mergeProviders({ providers }: MergeHierarchyProvidersProps): HierarchyProvider & {
|
|
104
|
-
/** @deprecated in 1.4. Use `[Symbol.dispose]` instead. */
|
|
105
|
-
dispose: () => void;
|
|
106
|
-
[Symbol.dispose]: () => void;
|
|
107
|
-
};
|
|
130
|
+
export declare function createHierarchyProvider<TPartialProvider extends Partial<Omit<HierarchyProvider, "hierarchyChanged">> & Pick<HierarchyProvider, "getNodes">>(partialFactory: (props: {
|
|
131
|
+
hierarchyChanged: RaisableEvent<EventListener<HierarchyProvider["hierarchyChanged"]>>;
|
|
132
|
+
}) => TPartialProvider): TPartialProvider & HierarchyProvider;
|
|
108
133
|
export {};
|
|
109
134
|
//# sourceMappingURL=HierarchyProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HierarchyProvider.d.ts","sourceRoot":"","sources":["../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,WAAW,EACX,wBAAwB,EACxB,KAAK,EACL,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,sBAA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,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,EAEnH,cAAc,EAAE,CAAC,KAAK,EAAE;IACtB,gBAAgB,EAAE,aAAa,CAAC,aAAa,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACvF,KAAK,gBAAgB,GACrB,gBAAgB,GAAG,iBAAiB,CAatC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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 { BeEvent } from "@itwin/core-bentley";
|
|
6
|
+
/**
|
|
7
|
+
* An utility to create a `HierarchyProvider` from a partial implementation.
|
|
8
|
+
*
|
|
9
|
+
* Creating a `HierarchyProvider` directly requires implementing all its methods:
|
|
10
|
+
* ```ts
|
|
11
|
+
* {
|
|
12
|
+
* hierarchyChanged: new BeEvent(),
|
|
13
|
+
* async *getNodes({ parentNode }) {
|
|
14
|
+
* // yield nodes...
|
|
15
|
+
* },
|
|
16
|
+
* async *getNodeInstanceKeys() {},
|
|
17
|
+
* setFormatter() {},
|
|
18
|
+
* setHierarchySearch() {},
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* However, in many cases you may only need to implement the `getNodes` method and
|
|
23
|
+
* can rely on default implementations for other methods.
|
|
24
|
+
*
|
|
25
|
+
* With this utility you can implement only part of it, e.g. just the `getNodes` method:
|
|
26
|
+
* ```ts
|
|
27
|
+
* // provide implementation as a javascript object
|
|
28
|
+
* createHierarchyProvider(({ hierarchyChanged }) => ({
|
|
29
|
+
* async *getNodes({ parentNode }) {
|
|
30
|
+
* // yield nodes...
|
|
31
|
+
* },
|
|
32
|
+
* }));
|
|
33
|
+
*
|
|
34
|
+
* // or, provide implementation as a class instance:
|
|
35
|
+
* createHierarchyProvider(
|
|
36
|
+
* ({ hierarchyChanged }) =>
|
|
37
|
+
* new (class implements Pick<HierarchyProvider, "getNodes"> {
|
|
38
|
+
* public async *getNodes({ parentNode }): ReturnType<HierarchyProvider["getNodes"]> {
|
|
39
|
+
* // yield nodes...
|
|
40
|
+
* }
|
|
41
|
+
* })(),
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export function createHierarchyProvider(partialFactory) {
|
|
48
|
+
const hierarchyChanged = new BeEvent();
|
|
49
|
+
const impl = partialFactory({ hierarchyChanged });
|
|
50
|
+
return Object.assign(impl, {
|
|
51
|
+
hierarchyChanged,
|
|
52
|
+
...(impl.getNodeInstanceKeys
|
|
53
|
+
? { getNodeInstanceKeys: impl.getNodeInstanceKeys }
|
|
54
|
+
: /* v8 ignore next */ { async *getNodeInstanceKeys() { } }),
|
|
55
|
+
...(impl.setFormatter ? { setFormatter: impl.setFormatter } : /* v8 ignore next */ { setFormatter() { } }),
|
|
56
|
+
...(impl.setHierarchySearch
|
|
57
|
+
? { setHierarchySearch: impl.setHierarchySearch }
|
|
58
|
+
: /* v8 ignore next */ { setHierarchySearch() { } }),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=HierarchyProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HierarchyProvider.js","sourceRoot":"","sources":["../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AA6G9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,uBAAuB,CAGrC,cAEsB;IAEtB,MAAM,gBAAgB,GAAqD,IAAI,OAAO,EAAE,CAAC;IACzF,MAAM,IAAI,GAAG,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QACzB,gBAAgB;QAChB,GAAG,CAAC,IAAI,CAAC,mBAAmB;YAC1B,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE;YACnD,CAAC,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,CAAC,mBAAmB,KAAI,CAAC,EAAE,CAAC;QAC7D,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,EAAE,YAAY,KAAI,CAAC,EAAE,CAAC;QACzG,GAAG,CAAC,IAAI,CAAC,kBAAkB;YACzB,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE;YACjD,CAAC,CAAC,oBAAoB,CAAC,EAAE,kBAAkB,KAAI,CAAC,EAAE,CAAC;KACtD,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 { BeEvent } from \"@itwin/core-bentley\";\n\nimport type { GenericInstanceFilter } from \"@itwin/core-common\";\nimport type {\n Event,\n EventListener,\n InstanceKey,\n IPrimitiveValueFormatter,\n Props,\n RaisableEvent,\n} from \"@itwin/presentation-shared\";\nimport type { HierarchyNode, ParentHierarchyNode } from \"./HierarchyNode.js\";\nimport type { HierarchySearchTree } from \"./HierarchySearch.js\";\n\n/**\n * Props for the `HierarchyProvider.getNodes` call.\n * @public\n */\nexport interface GetHierarchyNodesProps {\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: ParentHierarchyNode | undefined;\n\n /** Optional hierarchy level filter. Has no effect if `parentNode` is a `GroupingNode`. */\n instanceFilter?: GenericInstanceFilter;\n\n /**\n * Optional hierarchy level size limit override. This value is passed to `LimitingECSqlQueryExecutor` used\n * by this provider to override query rows limit per hierarchy level. If not provided, defaults to whatever\n * is used by the limiting query executor.\n *\n * Has no effect if `parentNode` is a `GroupingNode`.\n */\n hierarchyLevelSizeLimit?: number | \"unbounded\";\n\n /** When set to `true` ignores the cache and fetches the nodes again. */\n ignoreCache?: boolean;\n}\n\n/**\n * Event arguments for `HierarchyProvider.hierarchyChanged` event.\n * @public\n */\ninterface HierarchyChangedEventArgs {\n /** Set when the hierarchy change was caused by a formatter change. */\n formatterChange?: { newFormatter: IPrimitiveValueFormatter | undefined };\n\n /** Set when the hierarchy change was caused by a hierarchy search change. */\n searchChange?: { newSearch: Props<HierarchyProvider[\"setHierarchySearch\"]> };\n}\n\n/**\n * An interface for a hierarchy provider that knows how to create child nodes for a given parent node.\n * @public\n */\nexport interface HierarchyProvider {\n /**\n * An event that provider raises due to a hierarchy change that requires a reload.\n *\n * Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.\n * Implementations may provide additional details on what caused the change through the\n * event arguments.\n */\n readonly hierarchyChanged: Event<(args: HierarchyChangedEventArgs) => void>;\n\n /**\n * Gets nodes for the specified parent node. This is **the method to implement**, otherwise\n * the provider doesn't return any nodes.\n */\n getNodes(props: GetHierarchyNodesProps): AsyncIterableIterator<HierarchyNode>;\n\n /**\n * Gets instance keys for the specified parent node.\n *\n * The result of this method may be used to determine instances whose nodes would be displayed as children\n * of the specified parent node. For such use cases calling this method should be more efficient compared\n * to calling `getNodes`.\n */\n getNodeInstanceKeys(props: Omit<GetHierarchyNodesProps, \"ignoreCache\">): AsyncIterableIterator<InstanceKey>;\n\n /**\n * Overrides the property value formatter used by the hierarchy provider. Setting to `undefined`\n * resets the formatter, but what that means depends on the provider implementation - it could just\n * use unformatted values, or use some default formatter, e.g. the on created by `createDefaultValueFormatter`\n * from `@itwin/presentation-shared` package.\n *\n * @note Changing formatter is expected to trigger the `hierarchyChanged` event with `formatterChange` arg.\n */\n setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;\n\n /**\n * Sets the hierarchy search used by this hierarchy provider. Setting to `undefined`\n * removes the search.\n *\n * @note There's a difference between `undefined` search and search with empty paths list. The\n * former means no search is applied, while the latter means the search is applied and it filters-out\n * all hierarchy.\n *\n * @note Changing search is expected to trigger the `hierarchyChanged` event with `searchChange` arg.\n */\n setHierarchySearch(\n props:\n | {\n /** A list of search trees that define paths from root to search target nodes. */\n paths: HierarchySearchTree[];\n }\n | undefined,\n ): void;\n}\n\n/**\n * An utility to create a `HierarchyProvider` from a partial implementation.\n *\n * Creating a `HierarchyProvider` directly requires implementing all its methods:\n * ```ts\n * {\n * hierarchyChanged: new BeEvent(),\n * async *getNodes({ parentNode }) {\n * // yield nodes...\n * },\n * async *getNodeInstanceKeys() {},\n * setFormatter() {},\n * setHierarchySearch() {},\n * }\n * ```\n *\n * However, in many cases you may only need to implement the `getNodes` method and\n * can rely on default implementations for other methods.\n *\n * With this utility you can implement only part of it, e.g. just the `getNodes` method:\n * ```ts\n * // provide implementation as a javascript object\n * createHierarchyProvider(({ hierarchyChanged }) => ({\n * async *getNodes({ parentNode }) {\n * // yield nodes...\n * },\n * }));\n *\n * // or, provide implementation as a class instance:\n * createHierarchyProvider(\n * ({ hierarchyChanged }) =>\n * new (class implements Pick<HierarchyProvider, \"getNodes\"> {\n * public async *getNodes({ parentNode }): ReturnType<HierarchyProvider[\"getNodes\"]> {\n * // yield nodes...\n * }\n * })(),\n * );\n * ```\n *\n * @public\n */\nexport function createHierarchyProvider<\n TPartialProvider extends Partial<Omit<HierarchyProvider, \"hierarchyChanged\">> & Pick<HierarchyProvider, \"getNodes\">,\n>(\n partialFactory: (props: {\n hierarchyChanged: RaisableEvent<EventListener<HierarchyProvider[\"hierarchyChanged\"]>>;\n }) => TPartialProvider,\n): TPartialProvider & HierarchyProvider {\n const hierarchyChanged: Props<typeof partialFactory>[\"hierarchyChanged\"] = new BeEvent();\n const impl = partialFactory({ hierarchyChanged });\n return Object.assign(impl, {\n hierarchyChanged,\n ...(impl.getNodeInstanceKeys\n ? { getNodeInstanceKeys: impl.getNodeInstanceKeys }\n : /* v8 ignore next */ { async *getNodeInstanceKeys() {} }),\n ...(impl.setFormatter ? { setFormatter: impl.setFormatter } : /* v8 ignore next */ { setFormatter() {} }),\n ...(impl.setHierarchySearch\n ? { setHierarchySearch: impl.setHierarchySearch }\n : /* v8 ignore next */ { setHierarchySearch() {} }),\n });\n}\n"]}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { HierarchyNodeIdentifier } from "./HierarchyNodeIdentifier.js";
|
|
2
|
+
import type { NonGroupingHierarchyNode } from "./HierarchyNode.js";
|
|
3
|
+
import type { HierarchyNodeIdentifiersPath } from "./HierarchyNodeIdentifier.js";
|
|
4
|
+
import type { GenericNodeKey, InstancesNodeKey } from "./HierarchyNodeKey.js";
|
|
5
|
+
/** @public */
|
|
6
|
+
export interface HierarchySearchPathOptions {
|
|
7
|
+
/**
|
|
8
|
+
* This option specifies the way `autoExpand` flag should be assigned to nodes in the searched hierarchy.
|
|
9
|
+
* - If it's `false` or `undefined`, nodes have no 'autoExpand' flag.
|
|
10
|
+
* - If it's `true`, then all nodes up to the search target will have `autoExpand` flag.
|
|
11
|
+
* - If it's a object with `groupingLevel` then `groupingLevel` determines the number of grouping levels to expand for
|
|
12
|
+
* the search target.
|
|
13
|
+
*/
|
|
14
|
+
reveal?: boolean | {
|
|
15
|
+
/**
|
|
16
|
+
* Index of the node in search path should be revealed in hierarchy by auto-expanding its ancestors.
|
|
17
|
+
*
|
|
18
|
+
* Use when you want to expand up to specific instance node and don't care about grouping nodes.
|
|
19
|
+
*
|
|
20
|
+
* **Use case example:**
|
|
21
|
+
*
|
|
22
|
+
* All nodes up to `Element1` should be expanded in the following hierarchy:
|
|
23
|
+
* - Node1
|
|
24
|
+
* - GroupingNode1
|
|
25
|
+
* - GroupingNode2
|
|
26
|
+
* - Element1
|
|
27
|
+
* - Element2
|
|
28
|
+
*
|
|
29
|
+
* Provide `{ path: [Node1, Element1], reveal: { depthInPath: 1 } }`
|
|
30
|
+
*
|
|
31
|
+
* **NOTE**: All nodes that are up to `depthInPath` will be expanded **except** search targets.
|
|
32
|
+
*/
|
|
33
|
+
depthInPath: number;
|
|
34
|
+
} | {
|
|
35
|
+
/**
|
|
36
|
+
* The number of grouping levels to expand for the search target. For example, if `groupingLevel` is set to `2`, then all grouping nodes up to the second level
|
|
37
|
+
* will have the `autoExpand` flag.
|
|
38
|
+
*
|
|
39
|
+
* **Note:** if search target has less grouping levels than specified by this attribute, then all grouping nodes up to the search target will have
|
|
40
|
+
* the `autoExpand` flag, but the search target itself won't have the `autoExpand` flag.
|
|
41
|
+
*/
|
|
42
|
+
groupingLevel: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* This option specifies whether or not search target should be expanded.
|
|
46
|
+
* - If it's `false` or `undefined`, search target won't have 'autoExpand' flag.
|
|
47
|
+
* - If it's `true`, search target will have `autoExpand` flag.
|
|
48
|
+
*
|
|
49
|
+
* **Note:** this attribute does not set `autoExpand` flag on nodes up to the search target. For that use `reveal`.
|
|
50
|
+
*/
|
|
51
|
+
autoExpand?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A path of hierarchy node identifiers for search the hierarchy with additional options.
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
export type HierarchySearchPath = HierarchyNodeIdentifiersPath | {
|
|
58
|
+
path: HierarchyNodeIdentifiersPath;
|
|
59
|
+
options?: HierarchySearchPathOptions;
|
|
60
|
+
};
|
|
61
|
+
/** @public */
|
|
62
|
+
export declare namespace HierarchySearchPath {
|
|
63
|
+
/**
|
|
64
|
+
* Normalizes the hierarchy search path to the object form.
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
function normalize(source: HierarchySearchPath): Exclude<HierarchySearchPath, HierarchyNodeIdentifiersPath>;
|
|
68
|
+
/**
|
|
69
|
+
* Merges two given `HierarchySearchPathOptions` objects.
|
|
70
|
+
*
|
|
71
|
+
* For the `reveal` attribute, the merge chooses to `reveal` as deep as the deepest input:
|
|
72
|
+
* - if any one of the inputs is `true`, return `true`,
|
|
73
|
+
* - else if only one of the inputs is an object, return it,
|
|
74
|
+
* - else if both inputs are falsy, return `false` or `undefined`,
|
|
75
|
+
* - else:
|
|
76
|
+
* - if only one of the inputs has `groupingLevel` set, return that one,
|
|
77
|
+
* - else compare by matching reveal type (`groupingLevel` or `depthInPath`) and return the deeper one.
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
function mergeOptions(lhs: HierarchySearchPathOptions | undefined, rhs: HierarchySearchPathOptions | undefined): HierarchySearchPathOptions | undefined;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A tree structure representing hierarchy search paths. Each node in the tree corresponds
|
|
85
|
+
* to a hierarchy node identifier and may have children that represent deeper levels in the
|
|
86
|
+
* hierarchy.
|
|
87
|
+
*
|
|
88
|
+
* The `HierarchySearchTree.createBuilder` or `HierarchySearchTree.createFromPathsList` are
|
|
89
|
+
* typically used create this tree from a flat list of search paths.
|
|
90
|
+
*
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
export interface HierarchySearchTree {
|
|
94
|
+
/** Identifier of the hierarchy node this tree entry represents. */
|
|
95
|
+
identifier: HierarchyNodeIdentifier;
|
|
96
|
+
/**
|
|
97
|
+
* When `true`, indicates that this node is a search target.
|
|
98
|
+
*
|
|
99
|
+
* Note: A `HierarchySearchTree` node is considered a search target if it has no children, even if `isTarget` is not explicitly set to `true`. This
|
|
100
|
+
* is because a node with no children represents the end of a search path.
|
|
101
|
+
*/
|
|
102
|
+
isTarget?: boolean;
|
|
103
|
+
/** Provides options for handling this search tree entry, such as auto-expansion behavior. */
|
|
104
|
+
options?: {
|
|
105
|
+
/**
|
|
106
|
+
* - `true` to expand the node and its grouping nodes,
|
|
107
|
+
* - `{ groupingLevel: number }` to expand ancestor grouping nodes, e.g. for the following hierarchy:
|
|
108
|
+
* ```
|
|
109
|
+
* - Grouping node A
|
|
110
|
+
* - Instance node A
|
|
111
|
+
* - Grouping node B1
|
|
112
|
+
* - Grouping node B2
|
|
113
|
+
* - ...
|
|
114
|
+
* - Grouping node Bn
|
|
115
|
+
* - Instance node B
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* For "Instance node B" search tree entry:
|
|
119
|
+
* - `{ groupingLevel: 1 }` expands its first grouping node "Grouping node B1",
|
|
120
|
+
* - `{ groupingLevel: 2 }` expands two levels to "Grouping node B2".
|
|
121
|
+
* - `{ groupingLevel: Number.MAX_SAFE_INTEGER }` expands all grouping nodes of that instance node.
|
|
122
|
+
*
|
|
123
|
+
* Note that there's a slight difference between `HierarchySearchTree.options.autoExpand` and
|
|
124
|
+
* `HierarchySearchPath.options.reveal`. The latter option reveals the search target node by expanding its ancestors,
|
|
125
|
+
* while the `HierarchySearchTree.options.autoExpand` also expands the target node itself.
|
|
126
|
+
*/
|
|
127
|
+
autoExpand?: boolean | {
|
|
128
|
+
groupingLevel: number;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
/** Child search tree entries representing the next level(s) in the hierarchy search paths. */
|
|
132
|
+
children?: HierarchySearchTree[];
|
|
133
|
+
}
|
|
134
|
+
/** @public */
|
|
135
|
+
export declare namespace HierarchySearchTree {
|
|
136
|
+
/** @public */
|
|
137
|
+
type HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras extends Record<string, unknown>> = Readonly<Pick<HierarchySearchTree, "identifier" | "options"> & {
|
|
138
|
+
extras: TExtras;
|
|
139
|
+
}> & Pick<HierarchySearchTree, "isTarget">;
|
|
140
|
+
/** @public */
|
|
141
|
+
type HierarchySearchTreeBuilderAcceptHandlerTreeInput = Readonly<Pick<HierarchySearchTree, "identifier" | "isTarget" | "options"> & {
|
|
142
|
+
hasChildren: boolean;
|
|
143
|
+
}>;
|
|
144
|
+
/** @public */
|
|
145
|
+
interface HierarchySearchTreeBuilderAcceptHandler<TExtras extends Record<string, unknown>> {
|
|
146
|
+
/**
|
|
147
|
+
* Called when a new entry is added to the tree. Return `true` to accept the entry, `false` to reject it and all its children, if any.
|
|
148
|
+
*/
|
|
149
|
+
onNewEntry?: (props: {
|
|
150
|
+
/** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */
|
|
151
|
+
parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;
|
|
152
|
+
/** The new entry being added to the tree. */
|
|
153
|
+
inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;
|
|
154
|
+
}) => boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Called when a new entry is added to the tree and accepted (either it's a new entry or it merges with an existing entry). This can be used to perform
|
|
157
|
+
* side effects such as assigning extra information to the tree entry.
|
|
158
|
+
*/
|
|
159
|
+
onEntryHandled?: (props: {
|
|
160
|
+
/** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */
|
|
161
|
+
parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;
|
|
162
|
+
/** The tree entry that has been handled. It's allowed to mutate this entry. */
|
|
163
|
+
treeEntry: HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>;
|
|
164
|
+
/** The input entry being added to the tree. */
|
|
165
|
+
inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;
|
|
166
|
+
}) => void;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Props supplied to HierarchySearchTreeBuilder.accept() method for accepting a hierarchy search path or tree with an optional handler for customizing
|
|
170
|
+
* the behavior of the builder when accepting new entries.
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
type HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras extends Record<string, unknown>> = ({
|
|
174
|
+
path: HierarchySearchPath;
|
|
175
|
+
} | {
|
|
176
|
+
tree: HierarchySearchTree;
|
|
177
|
+
}) & {
|
|
178
|
+
/** An optional handler for customizing the behavior of the builder when accepting new entries. */
|
|
179
|
+
handler?: HierarchySearchTreeBuilderAcceptHandler<TAcceptHandlerExtras>;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Props supplied to HierarchySearchTreeBuilder.getTree() method for customizing the resulting tree entries, e.g. by omitting some of them or
|
|
183
|
+
* assigning extra information to them.
|
|
184
|
+
* @public
|
|
185
|
+
*/
|
|
186
|
+
interface HierarchySearchTreeBuilderFinalizeTreeProps<TAcceptHandlerExtras extends Record<string, unknown>> {
|
|
187
|
+
/**
|
|
188
|
+
* A function that can be used to process each tree entry before it's added to the final tree.
|
|
189
|
+
*
|
|
190
|
+
* Return `undefined` to omit the entry and its entire branch from the resulting tree.
|
|
191
|
+
*/
|
|
192
|
+
processEntry?: (props: {
|
|
193
|
+
treeEntry: HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TAcceptHandlerExtras>;
|
|
194
|
+
parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TAcceptHandlerExtras>>;
|
|
195
|
+
}) => (Omit<HierarchySearchTree, "children"> & {
|
|
196
|
+
extras: TAcceptHandlerExtras;
|
|
197
|
+
}) | undefined;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* An utility that accepts hierarchy search paths or search trees one by one and builds a `HierarchySearchTree` structure based on them.
|
|
201
|
+
* @public
|
|
202
|
+
*/
|
|
203
|
+
interface HierarchySearchTreeBuilder<TAcceptHandlerExtras extends Record<string, unknown>> {
|
|
204
|
+
/**
|
|
205
|
+
* Accepts a hierarchy search path or paths' tree and adds it to the builder's internal tree structure. Use `getTree()` to create
|
|
206
|
+
* a `HierarchySearchTree[]` from the added paths.
|
|
207
|
+
*/
|
|
208
|
+
accept(props: HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras>): HierarchySearchTreeBuilder<TAcceptHandlerExtras>;
|
|
209
|
+
/**
|
|
210
|
+
* Create `HierarchySearchTree[]` from currently added search paths.
|
|
211
|
+
*/
|
|
212
|
+
getTree(props?: HierarchySearchTreeBuilderFinalizeTreeProps<TAcceptHandlerExtras>): HierarchySearchTree[];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Create a `HierarchySearchTree` builder utility that accepts hierarchy search paths or search trees one by one and builds
|
|
216
|
+
* a `HierarchySearchTree` structure based on them.
|
|
217
|
+
*
|
|
218
|
+
* Usage example:
|
|
219
|
+
*
|
|
220
|
+
* ```ts
|
|
221
|
+
* const builder = HierarchySearchTree.createBuilder();
|
|
222
|
+
* for (const path of searchPaths) {
|
|
223
|
+
* builder.accept({ path });
|
|
224
|
+
* }
|
|
225
|
+
* const searchTree = builder.getTree();
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
export function createBuilder<TAcceptHandlerExtras extends Record<string, unknown> = Record<string, unknown>>(): HierarchySearchTreeBuilder<TAcceptHandlerExtras>;
|
|
231
|
+
/**
|
|
232
|
+
* Builds a list of `HierarchySearchTree` nodes from an iterable of search paths. Shared
|
|
233
|
+
* path prefixes are merged so that each unique hierarchy node identifier appears only once
|
|
234
|
+
* per level. The resulting trees carry `isTarget`, `options`, and `children` attributes
|
|
235
|
+
* derived from the paths and their options (`autoExpand`, `reveal`).
|
|
236
|
+
*
|
|
237
|
+
* @public
|
|
238
|
+
*/
|
|
239
|
+
export function createFromPathsList(paths: Iterable<HierarchySearchPath>): Promise<HierarchySearchTree[]>;
|
|
240
|
+
/**
|
|
241
|
+
* Merges two `HierarchySearchTree` option objects. For the `autoExpand` attribute,
|
|
242
|
+
* `true` takes precedence over `{ groupingLevel }`, and when both sides are
|
|
243
|
+
* `{ groupingLevel }` objects the larger value wins.
|
|
244
|
+
* @public
|
|
245
|
+
*/
|
|
246
|
+
export function mergeOptions(lhs: HierarchySearchTree["options"] | undefined, rhs: HierarchySearchTree["options"] | undefined): HierarchySearchTree["options"] | undefined;
|
|
247
|
+
export {};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Creates a set of utilities for making it easier to search the given hierarchy
|
|
251
|
+
* level.
|
|
252
|
+
*
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
export declare function createHierarchySearchHelper(rootLevelSearchProps: HierarchySearchTree[] | undefined, parentNode: Pick<NonGroupingHierarchyNode, "search"> | undefined): {
|
|
256
|
+
/** Returns a flag indicating if the hierarchy level is filtered. */
|
|
257
|
+
hasSearch: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Returns a flag indicating whether this hierarchy level has an ancestor node
|
|
260
|
+
* that is a search target. That generally means that this and all downstream hierarchy
|
|
261
|
+
* levels should be displayed without search being applied to them, even if search paths
|
|
262
|
+
* say otherwise.
|
|
263
|
+
*/
|
|
264
|
+
hasSearchTargetAncestor: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Returns a list of hierarchy node identifiers that apply specifically for this
|
|
267
|
+
* hierarchy level. Returns `undefined` if search is not applied to this level.
|
|
268
|
+
*/
|
|
269
|
+
getChildNodeSearchIdentifiers: () => HierarchyNodeIdentifier[] | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `search`
|
|
272
|
+
* and `autoExpand`) to be set based on the search paths and search options. This function calculates
|
|
273
|
+
* these props for a child node based on its key or path matcher.
|
|
274
|
+
*
|
|
275
|
+
* When using `pathMatcher` or `asyncPathMatcher` prop, callers have more flexibility to decide whether the given `HierarchyNodeIdentifier` applies
|
|
276
|
+
* to their node. For example, only some parts of the identifier can be checked for improved performance. Otherwise, the
|
|
277
|
+
* `nodeKey` prop can be used to check the whole identifier.
|
|
278
|
+
*
|
|
279
|
+
* There are multiple overloads of `createChildNodeProps`: depending on props type it returns different values:
|
|
280
|
+
* - `asyncPathMatcher` is provided - returns either Promise or the regular return value based on whether or not `asyncPathMatcher` returns a `Promise`.
|
|
281
|
+
* - `pathMatcher` or only `nodeKey` is provided - returns undefined **or** `search` and `autoExpand` prop from `HierarchyNode`;
|
|
282
|
+
*/
|
|
283
|
+
createChildNodeProps: {
|
|
284
|
+
(props: {
|
|
285
|
+
nodeKey: InstancesNodeKey | GenericNodeKey;
|
|
286
|
+
}): Pick<NonGroupingHierarchyNode, "search" | "autoExpand"> | undefined;
|
|
287
|
+
(props: {
|
|
288
|
+
nodeKey: InstancesNodeKey | GenericNodeKey;
|
|
289
|
+
pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;
|
|
290
|
+
}): Pick<NonGroupingHierarchyNode, "search" | "autoExpand"> | undefined;
|
|
291
|
+
(props: {
|
|
292
|
+
nodeKey: InstancesNodeKey | GenericNodeKey;
|
|
293
|
+
asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;
|
|
294
|
+
}): Promise<Pick<NonGroupingHierarchyNode, "search" | "autoExpand"> | undefined> | Pick<NonGroupingHierarchyNode, "search" | "autoExpand"> | undefined;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
//# sourceMappingURL=HierarchySearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HierarchySearch.d.ts","sourceRoot":"","sources":["../../src/hierarchies/HierarchySearch.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAIvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,cAAc;AACd,MAAM,WAAW,0BAA0B;IACzC;;;;;;OAMG;IACH,MAAM,CAAC,EACH,OAAO,GACP;QACE;;;;;;;;;;;;;;;;;WAiBG;QACH,WAAW,EAAE,MAAM,CAAC;KACrB,GACD;QACE;;;;;;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