@itwin/presentation-hierarchies 2.0.0-alpha.16 → 2.0.0-alpha.18
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 +134 -0
- package/README.md +4 -6
- package/lib/hierarchies/HierarchyErrors.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyErrors.js.map +1 -0
- package/lib/hierarchies/HierarchyMerge.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyMerge.js +1 -1
- package/lib/hierarchies/HierarchyMerge.js.map +1 -0
- package/lib/hierarchies/HierarchyNode.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyNode.js.map +1 -0
- package/lib/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.d.ts +4 -4
- package/lib/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.js +8 -8
- package/lib/hierarchies/HierarchyNodeKey.js.map +1 -0
- package/lib/hierarchies/HierarchyProvider.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyProvider.js.map +1 -0
- package/lib/hierarchies/HierarchySearch.d.ts.map +1 -0
- package/lib/hierarchies/HierarchySearch.js.map +1 -0
- package/lib/hierarchies/Logging.d.ts.map +1 -0
- package/lib/hierarchies/Logging.js.map +1 -0
- package/lib/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
- package/lib/hierarchies/imodel/HierarchyCache.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.d.ts +3 -3
- package/lib/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.d.ts +2 -2
- package/lib/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/IModelHierarchyProvider.d.ts +2 -4
- package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyProvider.js +15 -12
- package/lib/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
- package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
- package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.d.ts +10 -6
- package/lib/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.js +80 -43
- package/lib/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.d.ts +4 -4
- package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.js +1 -1
- package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/SearchHierarchyDefinition.d.ts +2 -2
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/SearchHierarchyDefinition.js +3 -4
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.d.ts +1 -1
- package/lib/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.js +2 -5
- package/lib/hierarchies/imodel/TreeNodesReader.js.map +1 -0
- package/lib/hierarchies/imodel/Utils.d.ts.map +1 -0
- package/lib/hierarchies/imodel/Utils.js.map +1 -0
- package/lib/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.d.ts +2 -2
- package/lib/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/Grouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
- package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.d.ts +3 -3
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.js +9 -10
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.js +4 -6
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.d.ts +4 -4
- package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.js +38 -30
- package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
- package/lib/hierarchies/internal/Common.d.ts.map +1 -0
- package/lib/hierarchies/internal/Common.js.map +1 -0
- package/lib/hierarchies/internal/DisposePolyfill.d.ts.map +1 -0
- package/lib/hierarchies/internal/DisposePolyfill.js.map +1 -0
- package/lib/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
- package/lib/hierarchies/internal/LoggingUtils.js.map +1 -0
- package/lib/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -0
- package/lib/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
- package/lib/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
- package/lib/hierarchies/internal/operators/Partition.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/Partition.js.map +1 -0
- package/lib/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
- package/lib/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
- package/lib/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
- package/lib/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/Sorting.js.map +1 -0
- package/lib/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/TapOnce.js.map +1 -0
- package/lib/presentation-hierarchies.d.ts.map +1 -0
- package/lib/{cjs/presentation-hierarchies.js.map → presentation-hierarchies.js.map} +1 -1
- package/package.json +19 -21
- package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyErrors.js +0 -20
- package/lib/cjs/hierarchies/HierarchyErrors.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyMerge.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyMerge.js +0 -43
- package/lib/cjs/hierarchies/HierarchyMerge.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNode.js +0 -82
- package/lib/cjs/hierarchies/HierarchyNode.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +0 -52
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +0 -162
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.js +0 -166
- package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyProvider.js +0 -64
- package/lib/cjs/hierarchies/HierarchyProvider.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchySearch.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchySearch.js +0 -468
- package/lib/cjs/hierarchies/HierarchySearch.js.map +0 -1
- package/lib/cjs/hierarchies/Logging.d.ts.map +0 -1
- package/lib/cjs/hierarchies/Logging.js +0 -27
- package/lib/cjs/hierarchies/Logging.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js +0 -81
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +0 -144
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +0 -21
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +0 -234
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +0 -29
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +0 -657
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +0 -126
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +0 -231
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +0 -629
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +0 -140
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +0 -94
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js +0 -268
- package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +0 -35
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +0 -51
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/Utils.js +0 -73
- package/lib/cjs/hierarchies/imodel/Utils.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +0 -40
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts +0 -26
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js +0 -176
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +0 -75
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +0 -84
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js +0 -26
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +0 -113
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +0 -54
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +0 -49
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +0 -52
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +0 -310
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js +0 -31
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
- package/lib/cjs/hierarchies/internal/Common.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/Common.js +0 -91
- package/lib/cjs/hierarchies/internal/Common.js.map +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.js +0 -11
- package/lib/cjs/hierarchies/internal/DisposePolyfill.js.map +0 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +0 -12
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.js +0 -111
- package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +0 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.js +0 -37
- package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +0 -1
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +0 -28
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +0 -54
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Partition.js +0 -60
- package/lib/cjs/hierarchies/internal/operators/Partition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +0 -50
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +0 -24
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +0 -23
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.js +0 -25
- package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js +0 -19
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +0 -1
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/presentation-hierarchies.d.ts.map +0 -1
- package/lib/cjs/presentation-hierarchies.js +0 -40
- package/lib/esm/hierarchies/HierarchyErrors.d.ts +0 -9
- package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyErrors.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyMerge.d.ts +0 -19
- package/lib/esm/hierarchies/HierarchyMerge.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyMerge.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNode.d.ts +0 -149
- package/lib/esm/hierarchies/HierarchyNode.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNode.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +0 -31
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyProvider.d.ts +0 -134
- package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyProvider.js.map +0 -1
- package/lib/esm/hierarchies/HierarchySearch.d.ts +0 -297
- package/lib/esm/hierarchies/HierarchySearch.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchySearch.js.map +0 -1
- package/lib/esm/hierarchies/Logging.d.ts +0 -13
- package/lib/esm/hierarchies/Logging.d.ts.map +0 -1
- package/lib/esm/hierarchies/Logging.js.map +0 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +0 -18
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -138
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +0 -21
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts +0 -35
- package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +0 -1
- package/lib/esm/hierarchies/imodel/Utils.d.ts +0 -5
- 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.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +0 -4
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +0 -4
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +0 -32
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts +0 -5
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
- package/lib/esm/hierarchies/internal/Common.d.ts +0 -61
- package/lib/esm/hierarchies/internal/Common.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/Common.js.map +0 -1
- package/lib/esm/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/DisposePolyfill.js.map +0 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +0 -12
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.js +0 -108
- package/lib/esm/hierarchies/internal/EachValueFrom.js.map +0 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +0 -12
- package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.js.map +0 -1
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts +0 -75
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +0 -17
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts +0 -7
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Partition.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts +0 -22
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +0 -7
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +0 -9
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +0 -13
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts +0 -4
- package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +0 -1
- package/lib/esm/presentation-hierarchies.d.ts +0 -24
- package/lib/esm/presentation-hierarchies.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies.js.map +0 -1
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyErrors.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyErrors.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyMerge.d.ts +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyNode.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyNodeIdentifier.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeIdentifier.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyProvider.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyProvider.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchySearch.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchySearch.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/Logging.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/Logging.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/HierarchyCache.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/HierarchyCache.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/Utils.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/Utils.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/DetermineChildren.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/DetermineChildren.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.d.ts +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/Shared.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/Common.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/Common.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/LoggingUtils.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/SubscriptionScheduler.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/SubscriptionScheduler.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Partition.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Partition.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Sorting.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Sorting.js +0 -0
- /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/TapOnce.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.js +0 -0
- /package/lib/{cjs/presentation-hierarchies.d.ts → presentation-hierarchies.d.ts} +0 -0
- /package/lib/{esm/presentation-hierarchies.js → presentation-hierarchies.js} +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
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.createClassGroups = createClassGroups;
|
|
8
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
|
-
const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
10
|
-
const HierarchyNode_js_1 = require("../../../HierarchyNode.js");
|
|
11
|
-
/** @internal */
|
|
12
|
-
async function createClassGroups(schemaProvider, parentNode, nodes) {
|
|
13
|
-
const parentNodeClass = parentNode && HierarchyNode_js_1.HierarchyNode.isClassGroupingNode(parentNode) ? parentNode.key.className : undefined;
|
|
14
|
-
const groupings = {
|
|
15
|
-
ungrouped: [],
|
|
16
|
-
grouped: new core_bentley_1.Dictionary(presentation_shared_1.compareFullClassNames),
|
|
17
|
-
};
|
|
18
|
-
const releaseMainThread = (0, presentation_shared_1.createMainThreadReleaseOnTimePassedHandler)();
|
|
19
|
-
for (const node of nodes) {
|
|
20
|
-
await releaseMainThread();
|
|
21
|
-
const nodeClassName = node.key.instanceKeys[0].className;
|
|
22
|
-
if (node.processingParams?.grouping?.byClass &&
|
|
23
|
-
(!parentNodeClass || (0, presentation_shared_1.compareFullClassNames)(nodeClassName, parentNodeClass) !== 0)) {
|
|
24
|
-
let groupingInfo = groupings.grouped.get(nodeClassName);
|
|
25
|
-
if (!groupingInfo) {
|
|
26
|
-
const nodeClass = await (0, presentation_shared_1.getClass)(schemaProvider, nodeClassName);
|
|
27
|
-
groupingInfo = { class: nodeClass, groupedNodes: [] };
|
|
28
|
-
groupings.grouped.set(nodeClassName, groupingInfo);
|
|
29
|
-
}
|
|
30
|
-
groupingInfo.groupedNodes.push(node);
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
groupings.ungrouped.push(node);
|
|
34
|
-
}
|
|
35
|
-
return createGroupingNodes(groupings);
|
|
36
|
-
}
|
|
37
|
-
async function createGroupingNodes(groupings) {
|
|
38
|
-
const groupedNodes = new Array();
|
|
39
|
-
const releaseMainThread = (0, presentation_shared_1.createMainThreadReleaseOnTimePassedHandler)();
|
|
40
|
-
for (const { value: entry } of groupings.grouped) {
|
|
41
|
-
await releaseMainThread();
|
|
42
|
-
const groupingNodeKey = { type: "class-grouping", className: entry.class.fullName };
|
|
43
|
-
const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;
|
|
44
|
-
groupedNodes.push({
|
|
45
|
-
label: entry.class.label ?? entry.class.name,
|
|
46
|
-
key: groupingNodeKey,
|
|
47
|
-
parentKeys: groupedNodeParentKeys,
|
|
48
|
-
groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),
|
|
49
|
-
children: entry.groupedNodes.map((gn) => Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] })),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: "class" };
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=ClassGrouping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClassGrouping.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/ClassGrouping.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AA4BhG,8CAiCC;AA3DD,sDAAiD;AACjD,oEAIoC;AACpC,gEAA0D;AAmB1D,gBAAgB;AACT,KAAK,UAAU,iBAAiB,CACrC,cAAgC,EAChC,UAA2C,EAC3C,KAAuC;IAEvC,MAAM,eAAe,GACnB,UAAU,IAAI,gCAAa,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IACrG,MAAM,SAAS,GAA6B;QAC1C,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,IAAI,yBAAU,CACrB,2CAAqB,CACtB;KACF,CAAC;IACF,MAAM,iBAAiB,GAAG,IAAA,gEAA0C,GAAE,CAAC;IACvE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,iBAAiB,EAAE,CAAC;QAC1B,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACzD,IACE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO;YACxC,CAAC,CAAC,eAAe,IAAI,IAAA,2CAAqB,EAAC,aAAa,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,EACjF,CAAC;YACD,IAAI,YAAY,GAAG,SAAS,CAAC,OAAO,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CAAC,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC;YAC9G,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CACtC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,qBAAqB,EAAE,eAAe,CAAC,EAAE,CAAC,CAC/E;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAC1F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Dictionary } from \"@itwin/core-bentley\";\nimport {\n compareFullClassNames,\n createMainThreadReleaseOnTimePassedHandler,\n getClass,\n} from \"@itwin/presentation-shared\";\nimport { HierarchyNode } from \"../../../HierarchyNode.js\";\n\nimport type { EC, ECSchemaProvider } from \"@itwin/presentation-shared\";\nimport type { ParentHierarchyNode } from \"../../../HierarchyNode.js\";\nimport type { ClassGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport type { ProcessedInstanceHierarchyNode } from \"../../IModelHierarchyNode.js\";\nimport type { GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\ninterface ClassInfo {\n fullName: EC.FullClassName;\n name: string;\n label?: string;\n}\n\ninterface ClassGroupingInformation {\n ungrouped: ProcessedInstanceHierarchyNode[];\n grouped: Dictionary<EC.FullClassName, { class: ClassInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }>;\n}\n\n/** @internal */\nexport async function createClassGroups(\n schemaProvider: ECSchemaProvider,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n): Promise<GroupingHandlerResult> {\n const parentNodeClass =\n parentNode && HierarchyNode.isClassGroupingNode(parentNode) ? parentNode.key.className : undefined;\n const groupings: ClassGroupingInformation = {\n ungrouped: [],\n grouped: new Dictionary<EC.FullClassName, { class: ClassInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }>(\n compareFullClassNames,\n ),\n };\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n for (const node of nodes) {\n await releaseMainThread();\n const nodeClassName = node.key.instanceKeys[0].className;\n if (\n node.processingParams?.grouping?.byClass &&\n (!parentNodeClass || compareFullClassNames(nodeClassName, parentNodeClass) !== 0)\n ) {\n let groupingInfo = groupings.grouped.get(nodeClassName);\n if (!groupingInfo) {\n const nodeClass = await getClass(schemaProvider, nodeClassName);\n groupingInfo = { class: nodeClass, groupedNodes: [] };\n groupings.grouped.set(nodeClassName, groupingInfo);\n }\n groupingInfo.groupedNodes.push(node);\n continue;\n }\n groupings.ungrouped.push(node);\n }\n return createGroupingNodes(groupings);\n}\n\nasync function createGroupingNodes(groupings: ClassGroupingInformation): Promise<GroupingHandlerResult> {\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n for (const { value: entry } of groupings.grouped) {\n await releaseMainThread();\n const groupingNodeKey: ClassGroupingNodeKey = { type: \"class-grouping\", className: entry.class.fullName };\n const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;\n groupedNodes.push({\n label: entry.class.label ?? entry.class.name,\n key: groupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.groupedNodes.map((gn) =>\n Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] }),\n ),\n });\n }\n return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: \"class\" };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupHiding.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/GroupHiding.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAyD,MAAM,gBAAgB,CAAC;AAEnH,gBAAgB;AAChB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,GAAG,qBAAqB,CA2BjH"}
|
|
@@ -1,49 +0,0 @@
|
|
|
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.applyGroupHidingParams = applyGroupHidingParams;
|
|
8
|
-
const Shared_js_1 = require("./Shared.js");
|
|
9
|
-
/** @internal */
|
|
10
|
-
function applyGroupHidingParams(props, extraSiblings) {
|
|
11
|
-
const { grouped, ungrouped, groupingType } = props;
|
|
12
|
-
if (grouped.length === 0) {
|
|
13
|
-
return props;
|
|
14
|
-
}
|
|
15
|
-
// handle the "no siblings" case
|
|
16
|
-
if (grouped.length === 1 && ungrouped.length === 0 && extraSiblings === 0) {
|
|
17
|
-
const hideParams = getHideOptionsFromNodeProcessingParams(grouped[0], groupingType);
|
|
18
|
-
if (hideParams.hideIfNoSiblings) {
|
|
19
|
-
return { groupingType, grouped: [], ungrouped: grouped[0].children };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
// handle the "no children" case
|
|
23
|
-
const filteredGrouped = new Array();
|
|
24
|
-
for (const node of grouped) {
|
|
25
|
-
if (node.children.length === 1) {
|
|
26
|
-
const hideParams = getHideOptionsFromNodeProcessingParams(node, groupingType);
|
|
27
|
-
if (hideParams.hideIfOneGroupedNode) {
|
|
28
|
-
ungrouped.push(node.children[0]);
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
filteredGrouped.push(node);
|
|
33
|
-
}
|
|
34
|
-
return { groupingType, grouped: filteredGrouped, ungrouped };
|
|
35
|
-
}
|
|
36
|
-
function getHideOptionsFromNodeProcessingParams(groupingNode, groupingType) {
|
|
37
|
-
let hideIfNoSiblings = false;
|
|
38
|
-
let hideIfOneGroupedNode = false;
|
|
39
|
-
(0, Shared_js_1.iterateChildNodeGroupingParams)(groupingNode, groupingType, (groupingProps) => {
|
|
40
|
-
if (hideIfNoSiblings && hideIfOneGroupedNode) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
hideIfNoSiblings ||= !!groupingProps?.hideIfNoSiblings;
|
|
44
|
-
hideIfOneGroupedNode ||= !!groupingProps?.hideIfOneGroupedNode;
|
|
45
|
-
return;
|
|
46
|
-
});
|
|
47
|
-
return { hideIfNoSiblings, hideIfOneGroupedNode };
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=GroupHiding.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupHiding.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/GroupHiding.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAOhG,wDA2BC;AAhCD,2CAA6D;AAI7D,gBAAgB;AAChB,SAAgB,sBAAsB,CAAC,KAA4B,EAAE,aAAqB;IACxF,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gCAAgC;IAChC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;QAC1E,MAAM,UAAU,GAAG,sCAAsC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CA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AACpD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { iterateChildNodeGroupingParams } from \"./Shared.js\";\n\nimport type { GroupingHandlerResult, GroupingType, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\n/** @internal */\nexport function applyGroupHidingParams(props: GroupingHandlerResult, extraSiblings: number): GroupingHandlerResult {\n const { grouped, ungrouped, groupingType } = props;\n if (grouped.length === 0) {\n return props;\n }\n\n // handle the \"no siblings\" case\n if (grouped.length === 1 && ungrouped.length === 0 && extraSiblings === 0) {\n const hideParams = getHideOptionsFromNodeProcessingParams(grouped[0], groupingType);\n if (hideParams.hideIfNoSiblings) {\n return { groupingType, grouped: [], ungrouped: grouped[0].children };\n }\n }\n\n // handle the \"no children\" case\n const filteredGrouped = new Array<ProcessedInstancesGroupingHierarchyNode>();\n for (const node of grouped) {\n if (node.children.length === 1) {\n const hideParams = getHideOptionsFromNodeProcessingParams(node, groupingType);\n if (hideParams.hideIfOneGroupedNode) {\n ungrouped.push(node.children[0]);\n continue;\n }\n }\n filteredGrouped.push(node);\n }\n return { groupingType, grouped: filteredGrouped, ungrouped };\n}\n\nfunction getHideOptionsFromNodeProcessingParams(\n groupingNode: ProcessedInstancesGroupingHierarchyNode,\n groupingType: GroupingType,\n): { hideIfNoSiblings: boolean; hideIfOneGroupedNode: boolean } {\n let hideIfNoSiblings = false;\n let hideIfOneGroupedNode = false;\n iterateChildNodeGroupingParams(groupingNode, groupingType, (groupingProps) => {\n if (hideIfNoSiblings && hideIfOneGroupedNode) {\n return true;\n }\n hideIfNoSiblings ||= !!groupingProps?.hideIfNoSiblings;\n hideIfOneGroupedNode ||= !!groupingProps?.hideIfOneGroupedNode;\n return;\n });\n return { hideIfNoSiblings, hideIfOneGroupedNode };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LabelGrouping.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/LabelGrouping.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAA2C,MAAM,gBAAgB,CAAC;AAErG,gBAAgB;AAChB,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,8BAA8B,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4C/G"}
|
|
@@ -1,52 +0,0 @@
|
|
|
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.createLabelGroups = createLabelGroups;
|
|
8
|
-
const Utils_js_1 = require("../../Utils.js");
|
|
9
|
-
/** @internal */
|
|
10
|
-
async function createLabelGroups(nodes) {
|
|
11
|
-
const ungrouped = new Array();
|
|
12
|
-
const nodesToMergeMap = new Map();
|
|
13
|
-
const nodesToGroupMap = new Map();
|
|
14
|
-
for (const node of nodes) {
|
|
15
|
-
const byLabel = node.processingParams?.grouping?.byLabel;
|
|
16
|
-
if (!byLabel) {
|
|
17
|
-
ungrouped.push(node);
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
const nodeMapKeyIdentifier = `label:"${node.label}";groupId:${JSON.stringify(typeof byLabel === "object" ? byLabel.groupId : undefined)}`;
|
|
21
|
-
const map = typeof byLabel === "object" && byLabel.action === "merge" ? nodesToMergeMap : nodesToGroupMap;
|
|
22
|
-
let list = map.get(nodeMapKeyIdentifier);
|
|
23
|
-
if (!list) {
|
|
24
|
-
list = [];
|
|
25
|
-
map.set(nodeMapKeyIdentifier, list);
|
|
26
|
-
}
|
|
27
|
-
list.push(node);
|
|
28
|
-
}
|
|
29
|
-
nodesToMergeMap.forEach((entry) => {
|
|
30
|
-
let finalNode = entry[0];
|
|
31
|
-
for (let i = 1; i < entry.length; ++i) {
|
|
32
|
-
finalNode = (0, Utils_js_1.mergeInstanceNodes)(finalNode, entry[i]);
|
|
33
|
-
}
|
|
34
|
-
ungrouped.push(finalNode);
|
|
35
|
-
});
|
|
36
|
-
const groupedNodes = new Array();
|
|
37
|
-
nodesToGroupMap.forEach((entry) => {
|
|
38
|
-
const byLabel = entry[0].processingParams?.grouping?.byLabel;
|
|
39
|
-
const groupId = typeof byLabel === "object" ? byLabel.groupId : undefined;
|
|
40
|
-
const groupingNodeKey = { type: "label-grouping", label: entry[0].label, groupId };
|
|
41
|
-
const groupedNodeParentKeys = entry[0].parentKeys;
|
|
42
|
-
groupedNodes.push({
|
|
43
|
-
label: entry[0].label,
|
|
44
|
-
key: groupingNodeKey,
|
|
45
|
-
parentKeys: groupedNodeParentKeys,
|
|
46
|
-
groupedInstanceKeys: entry.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),
|
|
47
|
-
children: entry.map((gn) => Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] })),
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
return { groupingType: "label", grouped: groupedNodes, ungrouped };
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=LabelGrouping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LabelGrouping.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/LabelGrouping.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAShG,8CA4CC;AAnDD,6CAAoD;AAMpD,gBAAgB;AACT,KAAK,UAAU,iBAAiB,CAAC,KAAuC;IAC7E,MAAM,SAAS,GAAG,IAAI,KAAK,EAAkC,CAAC;IAC9D,MAAM,eAAe,GAAG,IAAI,GAAG,EAA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AAC;IAC5B,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,IAAI,KAAK,EAA2C,CAAC;IAC1E,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAChC,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC;QAC7D,MAAM,OAAO,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1E,MAAM,eAAe,GAAyB,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;QACzG,MAAM,qBAAqB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAClD,YAAY,CAAC,IAAI,CAAC;YAChB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;YACrB,GAAG,EAAE,eAAe;YACpB,UAAU,EAAE,qBAAqB;YACjC,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,mBAAmB,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC;YACjG,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,qBAAqB,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;SAC5G,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AACrE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { mergeInstanceNodes } from \"../../Utils.js\";\n\nimport type { LabelGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport type { ProcessedInstanceHierarchyNode } from \"../../IModelHierarchyNode.js\";\nimport type { GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\n/** @internal */\nexport async function createLabelGroups(nodes: ProcessedInstanceHierarchyNode[]): Promise<GroupingHandlerResult> {\n const ungrouped = new Array<ProcessedInstanceHierarchyNode>();\n const nodesToMergeMap = new Map<string, ProcessedInstanceHierarchyNode[]>();\n const nodesToGroupMap = new Map<string, ProcessedInstanceHierarchyNode[]>();\n for (const node of nodes) {\n const byLabel = node.processingParams?.grouping?.byLabel;\n if (!byLabel) {\n ungrouped.push(node);\n continue;\n }\n const nodeMapKeyIdentifier = `label:\"${node.label}\";groupId:${JSON.stringify(typeof byLabel === \"object\" ? byLabel.groupId : undefined)}`;\n const map = typeof byLabel === \"object\" && byLabel.action === \"merge\" ? nodesToMergeMap : nodesToGroupMap;\n let list = map.get(nodeMapKeyIdentifier);\n if (!list) {\n list = [];\n map.set(nodeMapKeyIdentifier, list);\n }\n list.push(node);\n }\n\n nodesToMergeMap.forEach((entry) => {\n let finalNode = entry[0];\n for (let i = 1; i < entry.length; ++i) {\n finalNode = mergeInstanceNodes(finalNode, entry[i]);\n }\n ungrouped.push(finalNode);\n });\n\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n nodesToGroupMap.forEach((entry) => {\n const byLabel = entry[0].processingParams?.grouping?.byLabel;\n const groupId = typeof byLabel === \"object\" ? byLabel.groupId : undefined;\n const groupingNodeKey: LabelGroupingNodeKey = { type: \"label-grouping\", label: entry[0].label, groupId };\n const groupedNodeParentKeys = entry[0].parentKeys;\n groupedNodes.push({\n label: entry[0].label,\n key: groupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.map((gn) => Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] })),\n });\n });\n\n return { groupingType: \"label\", grouped: groupedNodes, ungrouped };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertiesGrouping.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/PropertiesGrouping.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAEV,EAAE,EACF,yBAAyB,EACzB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EACV,qCAAqC,EACrC,0BAA0B,EAC1B,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,uCAAuC,EAAE,MAAM,gBAAgB,CAAC;AAetH,gBAAgB;AAChB,MAAM,WAAW,kCAAkC;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,gBAAgB;AAChB,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC;IAClB,8BAA8B,EAAE,8BAA8B,CAAC;IAC/D,aAAa,EAAE,IAAI,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAC;CAClE;AAED,gBAAgB;AAChB,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAAC;IACjD,mBAAmB,EAAE,EAAE,CAAC,aAAa,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,gBAAgB;AAChB,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,8BAA8B,EAAE,EAC9C,mBAAmB,EAAE,uCAAuC,EAAE,EAC9D,qBAAqB,EAAE,iBAAiB,EACxC,cAAc,EAAE,wBAAwB,EACxC,gBAAgB,EAAE,kCAAkC,EACpD,uBAAuB,EAAE,yBAAyB,GACjD,OAAO,CAAC,qBAAqB,CAAC,CAyKhC;AAqFD,gBAAgB;AAChB,wBAAsB,4BAA4B,CAChD,cAAc,EAAE,gBAAgB,EAChC,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAC3C,KAAK,EAAE,8BAA8B,EAAE,GACtC,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAqDnC;AAuCD,gBAAgB;AAChB,wBAAgB,yBAAyB,CACvC,8BAA8B,EAAE,8BAA8B,EAC9D,eAAe,EAAE,qCAAqC,GACrD,OAAO,CAWT;AAED,gBAAgB;AAChB,wBAAgB,aAAa,CAC3B,OAAO,EAAE,+BAA+B,EAAE,GAAG,SAAS,EACtD,OAAO,EAAE,+BAA+B,EAAE,GAAG,SAAS,GACrD,OAAO,CA8BT;AAED,gBAAgB;AAChB,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,gBAAgB,GAAG,yBAAyB,EAC1D,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAC3C,KAAK,EAAE,8BAA8B,EAAE,EACvC,cAAc,EAAE,wBAAwB,EACxC,gBAAgB,EAAE,kCAAkC,GACnD,OAAO,CAAC,eAAe,EAAE,CAAC,CAa5B"}
|
|
@@ -1,310 +0,0 @@
|
|
|
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.createPropertyGroups = createPropertyGroups;
|
|
8
|
-
exports.getUniquePropertiesGroupInfo = getUniquePropertiesGroupInfo;
|
|
9
|
-
exports.doPreviousPropertiesMatch = doPreviousPropertiesMatch;
|
|
10
|
-
exports.doRangesMatch = doRangesMatch;
|
|
11
|
-
exports.createPropertiesGroupingHandlers = createPropertiesGroupingHandlers;
|
|
12
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
|
-
const presentation_shared_1 = require("@itwin/presentation-shared");
|
|
14
|
-
const HierarchyNode_js_1 = require("../../../HierarchyNode.js");
|
|
15
|
-
const HierarchyNodeKey_js_1 = require("../../../HierarchyNodeKey.js");
|
|
16
|
-
/** @internal */
|
|
17
|
-
async function createPropertyGroups(nodesToGroup, nodesAlreadyGrouped, handlerGroupingParams, valueFormatter, localizedStrings, classHierarchyInspector) {
|
|
18
|
-
let otherValuesGrouping;
|
|
19
|
-
const getOtherValuesGroupingNode = () => {
|
|
20
|
-
if (!otherValuesGrouping) {
|
|
21
|
-
const node = nodesAlreadyGrouped.find((n) => HierarchyNodeKey_js_1.HierarchyNodeKey.isPropertyOtherValuesGrouping(n.key));
|
|
22
|
-
if (node) {
|
|
23
|
-
otherValuesGrouping = { node, new: false };
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
otherValuesGrouping ??= {
|
|
27
|
-
node: {
|
|
28
|
-
key: { type: "property-grouping:other", properties: [] },
|
|
29
|
-
parentKeys: [],
|
|
30
|
-
groupedInstanceKeys: [],
|
|
31
|
-
label: localizedStrings.other,
|
|
32
|
-
children: [],
|
|
33
|
-
},
|
|
34
|
-
new: true,
|
|
35
|
-
};
|
|
36
|
-
return otherValuesGrouping.node;
|
|
37
|
-
};
|
|
38
|
-
const releaseMainThread = (0, presentation_shared_1.createMainThreadReleaseOnTimePassedHandler)();
|
|
39
|
-
const groupings = { ungrouped: [], grouped: new Map() };
|
|
40
|
-
for (const node of nodesToGroup) {
|
|
41
|
-
await releaseMainThread();
|
|
42
|
-
const byProperties = node.processingParams?.grouping?.byProperties;
|
|
43
|
-
if (!byProperties) {
|
|
44
|
-
groupings.ungrouped.push(node);
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
if (!(await shouldCreatePropertyGroup(handlerGroupingParams, byProperties, node.key.instanceKeys[0].className, classHierarchyInspector))) {
|
|
48
|
-
groupings.ungrouped.push(node);
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
const currentProperty = byProperties.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];
|
|
52
|
-
const propertyClass = handlerGroupingParams.ecClass;
|
|
53
|
-
const property = await propertyClass.getProperty(currentProperty.propertyName);
|
|
54
|
-
if (!property?.isNavigation() &&
|
|
55
|
-
(!property?.isPrimitive() || property.primitiveType === "Binary" || property.primitiveType === "IGeometry")) {
|
|
56
|
-
groupings.ungrouped.push(node);
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
const propertyIdentifier = { propertyName: property.name, propertyClassName: property.class.fullName };
|
|
60
|
-
const extendedTypeName = "extendedTypeName" in property ? property.extendedTypeName : undefined;
|
|
61
|
-
const primitiveType = "primitiveType" in property ? property.primitiveType : "String";
|
|
62
|
-
(0, core_bentley_1.assert)(primitiveType !== "Binary" && primitiveType !== "IGeometry");
|
|
63
|
-
if (!currentProperty.propertyValue) {
|
|
64
|
-
if (byProperties.createGroupForUnspecifiedValues) {
|
|
65
|
-
addGroupingToMap(groupings.grouped, `${currentProperty.propertyName.toLocaleLowerCase()}:Unspecified`, {
|
|
66
|
-
label: localizedStrings.unspecified,
|
|
67
|
-
propertyGroupingNodeKey: {
|
|
68
|
-
type: "property-grouping:value",
|
|
69
|
-
...propertyIdentifier,
|
|
70
|
-
formattedPropertyValue: "",
|
|
71
|
-
},
|
|
72
|
-
}, node);
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
groupings.ungrouped.push(node);
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
const koqName = (await property.kindOfQuantity)?.fullName;
|
|
79
|
-
if (currentProperty.ranges) {
|
|
80
|
-
if (typeof currentProperty.propertyValue === "number") {
|
|
81
|
-
const propValue = currentProperty.propertyValue;
|
|
82
|
-
const matchingRange = currentProperty.ranges.find((range) => propValue >= range.fromValue && propValue <= range.toValue);
|
|
83
|
-
if (matchingRange) {
|
|
84
|
-
const fromValueTypedPrimitive = {
|
|
85
|
-
type: Number.isInteger(matchingRange.fromValue) ? "Integer" : "Double",
|
|
86
|
-
extendedType: extendedTypeName,
|
|
87
|
-
koqName,
|
|
88
|
-
value: matchingRange.fromValue,
|
|
89
|
-
};
|
|
90
|
-
const toValueTypedPrimitive = {
|
|
91
|
-
type: Number.isInteger(matchingRange.toValue) ? "Integer" : "Double",
|
|
92
|
-
extendedType: extendedTypeName,
|
|
93
|
-
koqName,
|
|
94
|
-
value: matchingRange.toValue,
|
|
95
|
-
};
|
|
96
|
-
const rangeLabel = matchingRange.rangeLabel ??
|
|
97
|
-
`${await valueFormatter(fromValueTypedPrimitive)} - ${await valueFormatter(toValueTypedPrimitive)}`;
|
|
98
|
-
addGroupingToMap(groupings.grouped, `${currentProperty.propertyName.toLocaleLowerCase()}:[${matchingRange.fromValue}-${matchingRange.toValue}]${matchingRange.rangeLabel ? `(${matchingRange.rangeLabel})` : ""}`, {
|
|
99
|
-
label: rangeLabel,
|
|
100
|
-
propertyGroupingNodeKey: {
|
|
101
|
-
...propertyIdentifier,
|
|
102
|
-
type: "property-grouping:range",
|
|
103
|
-
fromValue: matchingRange.fromValue,
|
|
104
|
-
toValue: matchingRange.toValue,
|
|
105
|
-
},
|
|
106
|
-
}, node);
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (byProperties.createGroupForOutOfRangeValues) {
|
|
111
|
-
const groupingNode = getOtherValuesGroupingNode();
|
|
112
|
-
(0, core_bentley_1.assert)(HierarchyNodeKey_js_1.HierarchyNodeKey.isPropertyOtherValuesGrouping(groupingNode.key));
|
|
113
|
-
const thisPropertyIdentifier = {
|
|
114
|
-
className: propertyIdentifier.propertyClassName,
|
|
115
|
-
propertyName: propertyIdentifier.propertyName,
|
|
116
|
-
};
|
|
117
|
-
const hasPropertyIdentifier = groupingNode.key.properties.find((x) => (0, presentation_shared_1.compareFullClassNames)(x.className, thisPropertyIdentifier.className) === 0 &&
|
|
118
|
-
x.propertyName.toLocaleLowerCase() === thisPropertyIdentifier.propertyName.toLocaleLowerCase());
|
|
119
|
-
if (!hasPropertyIdentifier) {
|
|
120
|
-
groupingNode.key.properties.push(thisPropertyIdentifier);
|
|
121
|
-
}
|
|
122
|
-
node.key.instanceKeys.forEach((k) => groupingNode.groupedInstanceKeys.push(k));
|
|
123
|
-
groupingNode.parentKeys = node.parentKeys;
|
|
124
|
-
groupingNode.children.push(Object.assign(node, { parentKeys: [...node.parentKeys, groupingNode.key] }));
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
groupings.ungrouped.push(node);
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
const formattedValue = currentProperty.propertyValue instanceof Array
|
|
131
|
-
? await (0, presentation_shared_1.formatConcatenatedValue)({ value: currentProperty.propertyValue, valueFormatter })
|
|
132
|
-
: await valueFormatter(presentation_shared_1.TypedPrimitiveValue.create(currentProperty.propertyValue, primitiveType, koqName, extendedTypeName));
|
|
133
|
-
addGroupingToMap(groupings.grouped, `${currentProperty.propertyName.toLocaleLowerCase()}:${formattedValue}`, {
|
|
134
|
-
label: formattedValue,
|
|
135
|
-
propertyGroupingNodeKey: {
|
|
136
|
-
...propertyIdentifier,
|
|
137
|
-
type: "property-grouping:value",
|
|
138
|
-
formattedPropertyValue: formattedValue,
|
|
139
|
-
},
|
|
140
|
-
}, node);
|
|
141
|
-
}
|
|
142
|
-
return createGroupingNodes(groupings, otherValuesGrouping?.new ? otherValuesGrouping.node : undefined);
|
|
143
|
-
}
|
|
144
|
-
function addGroupingToMap(groupingMap, mapKey, propertyToAdd, node) {
|
|
145
|
-
let groupingInfo = groupingMap.get(mapKey);
|
|
146
|
-
if (!groupingInfo) {
|
|
147
|
-
groupingInfo = { displayablePropertyGroupingInfo: propertyToAdd, groupedNodes: [node] };
|
|
148
|
-
groupingMap.set(mapKey, groupingInfo);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
groupingInfo.groupedNodes.push(node);
|
|
152
|
-
}
|
|
153
|
-
function createGroupingNodes(groupings, otherValuesGroupingNode) {
|
|
154
|
-
const groupedNodes = new Array();
|
|
155
|
-
groupings.grouped.forEach((entry) => {
|
|
156
|
-
const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;
|
|
157
|
-
groupedNodes.push({
|
|
158
|
-
label: entry.displayablePropertyGroupingInfo.label,
|
|
159
|
-
key: entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey,
|
|
160
|
-
parentKeys: groupedNodeParentKeys,
|
|
161
|
-
groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),
|
|
162
|
-
children: entry.groupedNodes.map((gn) => ({
|
|
163
|
-
...gn,
|
|
164
|
-
parentKeys: [...groupedNodeParentKeys, entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey],
|
|
165
|
-
})),
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
if (otherValuesGroupingNode) {
|
|
169
|
-
groupedNodes.push(otherValuesGroupingNode);
|
|
170
|
-
}
|
|
171
|
-
return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: "property" };
|
|
172
|
-
}
|
|
173
|
-
function createNodePropertyGroupPathMatchers(node) {
|
|
174
|
-
if (!HierarchyNode_js_1.HierarchyNode.isPropertyGroupingNode(node)) {
|
|
175
|
-
return [];
|
|
176
|
-
}
|
|
177
|
-
const keys = [...node.parentKeys, node.key];
|
|
178
|
-
const propertyGroupingNodeKeys = [];
|
|
179
|
-
for (let i = keys.length - 1; i >= 0; --i) {
|
|
180
|
-
const key = keys[i];
|
|
181
|
-
if (HierarchyNodeKey_js_1.HierarchyNodeKey.isPropertyGrouping(key)) {
|
|
182
|
-
propertyGroupingNodeKeys.push(key);
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
break;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
propertyGroupingNodeKeys.reverse();
|
|
189
|
-
return propertyGroupingNodeKeys.map((key) => {
|
|
190
|
-
switch (key.type) {
|
|
191
|
-
case "property-grouping:other":
|
|
192
|
-
return (x) => key.properties.some((p) => (0, presentation_shared_1.compareFullClassNames)(p.className, x.propertiesClassName) === 0 &&
|
|
193
|
-
p.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase() &&
|
|
194
|
-
!!x.isRange);
|
|
195
|
-
case "property-grouping:range":
|
|
196
|
-
return (x) => (0, presentation_shared_1.compareFullClassNames)(key.propertyClassName, x.propertiesClassName) === 0 &&
|
|
197
|
-
key.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase();
|
|
198
|
-
case "property-grouping:value":
|
|
199
|
-
return (x) => (0, presentation_shared_1.compareFullClassNames)(key.propertyClassName, x.propertiesClassName) === 0 &&
|
|
200
|
-
key.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase();
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
/** @internal */
|
|
205
|
-
async function getUniquePropertiesGroupInfo(schemaProvider, parentNode, nodes) {
|
|
206
|
-
const releaseMainThread = (0, presentation_shared_1.createMainThreadReleaseOnTimePassedHandler)();
|
|
207
|
-
const parentPropertyGroupPath = parentNode ? createNodePropertyGroupPathMatchers(parentNode) : [];
|
|
208
|
-
const uniqueProperties = new Map();
|
|
209
|
-
for (const node of nodes) {
|
|
210
|
-
await releaseMainThread();
|
|
211
|
-
const byProperties = node.processingParams?.grouping?.byProperties;
|
|
212
|
-
if (!byProperties) {
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
let propertyGroupIndex = 0;
|
|
216
|
-
const previousPropertiesInfo = new Array();
|
|
217
|
-
for (const propertyGroup of byProperties.propertyGroups) {
|
|
218
|
-
const mapKeyRanges = getRangesAsString(propertyGroup.ranges);
|
|
219
|
-
const lastKey = previousPropertiesInfo.length > 0
|
|
220
|
-
? previousPropertiesInfo[previousPropertiesInfo.length - 1].propertyGroupKey
|
|
221
|
-
: "";
|
|
222
|
-
const propertyGroupKey = `${lastKey}:${propertyGroup.propertyName}(${mapKeyRanges})`;
|
|
223
|
-
const mapKey = `${(0, presentation_shared_1.normalizeFullClassName)(byProperties.propertiesClassName)}:${propertyGroupKey}`.toLocaleLowerCase();
|
|
224
|
-
let isAlreadyGrouped = false;
|
|
225
|
-
if (parentPropertyGroupPath.length > 0 && propertyGroupIndex < parentPropertyGroupPath.length) {
|
|
226
|
-
const groupMatcher = parentPropertyGroupPath[propertyGroupIndex];
|
|
227
|
-
isAlreadyGrouped = groupMatcher({
|
|
228
|
-
propertiesClassName: byProperties.propertiesClassName,
|
|
229
|
-
propertyName: propertyGroup.propertyName,
|
|
230
|
-
isRange: !!propertyGroup.ranges,
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
if (!isAlreadyGrouped && !uniqueProperties.get(mapKey)) {
|
|
234
|
-
uniqueProperties.set(mapKey, {
|
|
235
|
-
ecClass: await (0, presentation_shared_1.getClass)(schemaProvider, byProperties.propertiesClassName),
|
|
236
|
-
propertyGroup: { propertyName: propertyGroup.propertyName, ranges: propertyGroup.ranges },
|
|
237
|
-
previousPropertiesGroupingInfo: previousPropertiesInfo.map((groupingInfo) => ({
|
|
238
|
-
propertiesClassName: byProperties.propertiesClassName,
|
|
239
|
-
propertyName: groupingInfo.propertyGroup.propertyName,
|
|
240
|
-
isRange: !!groupingInfo.propertyGroup.ranges,
|
|
241
|
-
})),
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
previousPropertiesInfo.push({ propertyGroup, propertyGroupKey });
|
|
245
|
-
++propertyGroupIndex;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
// Order might change in uniqueProperties, resorting to make sure that properties with fewer previous properties are returned first.
|
|
249
|
-
return [...uniqueProperties.values()].sort((lhs, rhs) => lhs.previousPropertiesGroupingInfo.length - rhs.previousPropertiesGroupingInfo.length);
|
|
250
|
-
}
|
|
251
|
-
function getRangesAsString(ranges) {
|
|
252
|
-
return ranges
|
|
253
|
-
? ranges
|
|
254
|
-
.map((range) => `${range.fromValue}-${range.toValue}(${range.rangeLabel ?? ""})`)
|
|
255
|
-
.sort()
|
|
256
|
-
.join(";")
|
|
257
|
-
: "";
|
|
258
|
-
}
|
|
259
|
-
async function shouldCreatePropertyGroup(handlerGroupingParams, nodePropertyGroupingParams, nodeFullClassName, classHierarchyInspector) {
|
|
260
|
-
if ((0, presentation_shared_1.compareFullClassNames)(nodePropertyGroupingParams.propertiesClassName, handlerGroupingParams.ecClass.fullName) !==
|
|
261
|
-
0 ||
|
|
262
|
-
nodePropertyGroupingParams.propertyGroups.length < handlerGroupingParams.previousPropertiesGroupingInfo.length + 1) {
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
const currentProperty = nodePropertyGroupingParams.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];
|
|
266
|
-
if (currentProperty.propertyName.toLocaleLowerCase() !==
|
|
267
|
-
handlerGroupingParams.propertyGroup.propertyName.toLocaleLowerCase() ||
|
|
268
|
-
!doRangesMatch(currentProperty.ranges, handlerGroupingParams.propertyGroup.ranges)) {
|
|
269
|
-
return false;
|
|
270
|
-
}
|
|
271
|
-
if (!doPreviousPropertiesMatch(handlerGroupingParams.previousPropertiesGroupingInfo, nodePropertyGroupingParams)) {
|
|
272
|
-
return false;
|
|
273
|
-
}
|
|
274
|
-
return classHierarchyInspector.classDerivesFrom(nodeFullClassName, handlerGroupingParams.ecClass.fullName);
|
|
275
|
-
}
|
|
276
|
-
/** @internal */
|
|
277
|
-
function doPreviousPropertiesMatch(previousPropertiesGroupingInfo, nodesProperties) {
|
|
278
|
-
return (previousPropertiesGroupingInfo.length <= nodesProperties.propertyGroups.length &&
|
|
279
|
-
previousPropertiesGroupingInfo.every((groupingInfo, index) => (0, presentation_shared_1.compareFullClassNames)(groupingInfo.propertiesClassName, nodesProperties.propertiesClassName) === 0 &&
|
|
280
|
-
groupingInfo.propertyName.toLocaleLowerCase() ===
|
|
281
|
-
nodesProperties.propertyGroups[index].propertyName.toLocaleLowerCase() &&
|
|
282
|
-
!!groupingInfo.isRange === !!nodesProperties.propertyGroups[index].ranges));
|
|
283
|
-
}
|
|
284
|
-
/** @internal */
|
|
285
|
-
function doRangesMatch(ranges1, ranges2) {
|
|
286
|
-
if (typeof ranges1 !== typeof ranges2) {
|
|
287
|
-
return false;
|
|
288
|
-
}
|
|
289
|
-
if (!ranges1) {
|
|
290
|
-
return true;
|
|
291
|
-
}
|
|
292
|
-
(0, core_bentley_1.assert)(Array.isArray(ranges2));
|
|
293
|
-
if (ranges1.length !== ranges2.length) {
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
return (
|
|
297
|
-
// Check twice, to validate if both ranges have the same elements (elements can be in a different order)
|
|
298
|
-
ranges1.every((lhsRange) => ranges2.some((rhsRange) => lhsRange.fromValue === rhsRange.fromValue &&
|
|
299
|
-
lhsRange.toValue === rhsRange.toValue &&
|
|
300
|
-
lhsRange.rangeLabel === rhsRange.rangeLabel)) &&
|
|
301
|
-
ranges2.every((lhsRange) => ranges1.some((rhsRange) => lhsRange.fromValue === rhsRange.fromValue &&
|
|
302
|
-
lhsRange.toValue === rhsRange.toValue &&
|
|
303
|
-
lhsRange.rangeLabel === rhsRange.rangeLabel)));
|
|
304
|
-
}
|
|
305
|
-
/** @internal */
|
|
306
|
-
async function createPropertiesGroupingHandlers(imodelAccess, parentNode, nodes, valueFormatter, localizedStrings) {
|
|
307
|
-
const propertiesGroupInfo = await getUniquePropertiesGroupInfo(imodelAccess, parentNode, nodes);
|
|
308
|
-
return propertiesGroupInfo.map((propertyInfo) => async (nodesToGroup, nodesAlreadyGrouped) => createPropertyGroups(nodesToGroup, nodesAlreadyGrouped, propertyInfo, valueFormatter, localizedStrings, imodelAccess));
|
|
309
|
-
}
|
|
310
|
-
//# sourceMappingURL=PropertiesGrouping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertiesGrouping.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/PropertiesGrouping.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAiEhG,oDAgLC;AAsFD,oEAyDC;AAwCD,8DAcC;AAGD,sCAiCC;AAGD,4EAmBC;AA9eD,sDAA6C;AAC7C,oEAOoC;AACpC,gEAA0D;AAC1D,sEAAgE;AAoDhE,gBAAgB;AACT,KAAK,UAAU,oBAAoB,CACxC,YAA8C,EAC9C,mBAA8D,EAC9D,qBAAwC,EACxC,cAAwC,EACxC,gBAAoD,EACpD,uBAAkD;IAElD,IAAI,mBAAgG,CAAC;IACrG,MAAM,0BAA0B,GAAG,GAAG,EAAE;QACtC,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,sCAAgB,CAAC,6BAA6B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACpG,IAAI,IAAI,EAAE,CAAC;gBACT,mBAAmB,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;YAC7C,CAAC;QACH,CAAC;QACD,mBAAmB,KAAK;YACtB,IAAI,EAAE;gBACJ,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAkC,EAAE,UAAU,EAAE,EAAE,EAAE;gBACjE,UAAU,EAAE,EAAE;gBACd,mBAAmB,EAAE,EAAE;gBACvB,KAAK,EAAE,gBAAgB,CAAC,KAAK;gBAC7B,QAAQ,EAAE,EAAE;aACb;YACD,GAAG,EAAE,IAAI;SACV,CAAC;QACF,OAAO,mBAAmB,CAAC,IAAI,CAAC;IAClC,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAA,gEAA0C,GAAE,CAAC;IACvE,MAAM,SAAS,GAAgC,EAAE,SAAS,EA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C,QAAQ,EAAE,EAAE,CACX,QAAQ,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS;YACzC,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO;YACrC,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU,CAC9C,CACF,CACF,CAAC;AACJ,CAAC;AAED,gBAAgB;AACT,KAAK,UAAU,gCAAgC,CACpD,YAA0D,EAC1D,UAA2C,EAC3C,KAAuC,EACvC,cAAwC,EACxC,gBAAoD;IAEpD,MAAM,mBAAmB,GAAG,MAAM,4BAA4B,CAAC,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAChG,OAAO,mBAAmB,CAAC,GAAG,CAC5B,CAAC,YAAY,EAAE,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,CAC5D,oBAAoB,CAClB,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,YAAY,CACb,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { assert } from \"@itwin/core-bentley\";\nimport {\n compareFullClassNames,\n createMainThreadReleaseOnTimePassedHandler,\n formatConcatenatedValue,\n getClass,\n normalizeFullClassName,\n TypedPrimitiveValue,\n} from \"@itwin/presentation-shared\";\nimport { HierarchyNode } from \"../../../HierarchyNode.js\";\nimport { HierarchyNodeKey } from \"../../../HierarchyNodeKey.js\";\n\nimport type {\n ArrayElement,\n EC,\n ECClassHierarchyInspector,\n ECSchemaProvider,\n IPrimitiveValueFormatter,\n} from \"@itwin/presentation-shared\";\nimport type { ParentHierarchyNode } from \"../../../HierarchyNode.js\";\nimport type { PropertyGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport type {\n HierarchyNodePropertiesGroupingParams,\n HierarchyNodePropertyGroup,\n HierarchyNodePropertyValueRange,\n ProcessedInstanceHierarchyNode,\n} from \"../../IModelHierarchyNode.js\";\nimport type { GroupingHandler, GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\ninterface DisplayablePropertyGroupingInfo {\n label: string;\n propertyGroupingNodeKey: PropertyGroupingNodeKey;\n}\n\ninterface PropertyGroupingInformation {\n ungrouped: ProcessedInstanceHierarchyNode[];\n grouped: Map<\n string,\n { displayablePropertyGroupingInfo: DisplayablePropertyGroupingInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }\n >;\n}\n\n/** @internal */\nexport interface PropertiesGroupingLocalizedStrings {\n other: string;\n unspecified: string;\n}\n\n/** @internal */\nexport interface PropertyGroupInfo {\n ecClass: EC.Class;\n previousPropertiesGroupingInfo: PreviousPropertiesGroupingInfo;\n propertyGroup: Omit<HierarchyNodePropertyGroup, \"propertyValue\">;\n}\n\n/** @internal */\nexport type PreviousPropertiesGroupingInfo = Array<{\n propertiesClassName: EC.FullClassName;\n propertyName: string;\n isRange?: boolean;\n}>;\n\n/** @internal */\nexport async function createPropertyGroups(\n nodesToGroup: ProcessedInstanceHierarchyNode[],\n nodesAlreadyGrouped: ProcessedInstancesGroupingHierarchyNode[],\n handlerGroupingParams: PropertyGroupInfo,\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n classHierarchyInspector: ECClassHierarchyInspector,\n): Promise<GroupingHandlerResult> {\n let otherValuesGrouping: { node: ProcessedInstancesGroupingHierarchyNode; new: boolean } | undefined;\n const getOtherValuesGroupingNode = () => {\n if (!otherValuesGrouping) {\n const node = nodesAlreadyGrouped.find((n) => HierarchyNodeKey.isPropertyOtherValuesGrouping(n.key));\n if (node) {\n otherValuesGrouping = { node, new: false };\n }\n }\n otherValuesGrouping ??= {\n node: {\n key: { type: \"property-grouping:other\" as const, properties: [] },\n parentKeys: [],\n groupedInstanceKeys: [],\n label: localizedStrings.other,\n children: [],\n },\n new: true,\n };\n return otherValuesGrouping.node;\n };\n\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const groupings: PropertyGroupingInformation = { ungrouped: [], grouped: new Map() };\n for (const node of nodesToGroup) {\n await releaseMainThread();\n\n const byProperties = node.processingParams?.grouping?.byProperties;\n if (!byProperties) {\n groupings.ungrouped.push(node);\n continue;\n }\n if (\n !(await shouldCreatePropertyGroup(\n handlerGroupingParams,\n byProperties,\n node.key.instanceKeys[0].className,\n classHierarchyInspector,\n ))\n ) {\n groupings.ungrouped.push(node);\n continue;\n }\n const currentProperty = byProperties.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];\n const propertyClass = handlerGroupingParams.ecClass;\n const property = await propertyClass.getProperty(currentProperty.propertyName);\n\n if (\n !property?.isNavigation() &&\n (!property?.isPrimitive() || property.primitiveType === \"Binary\" || property.primitiveType === \"IGeometry\")\n ) {\n groupings.ungrouped.push(node);\n continue;\n }\n\n const propertyIdentifier = { propertyName: property.name, propertyClassName: property.class.fullName };\n const extendedTypeName = \"extendedTypeName\" in property ? property.extendedTypeName : undefined;\n const primitiveType = \"primitiveType\" in property ? property.primitiveType : \"String\";\n assert(primitiveType !== \"Binary\" && primitiveType !== \"IGeometry\");\n\n if (!currentProperty.propertyValue) {\n if (byProperties.createGroupForUnspecifiedValues) {\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName.toLocaleLowerCase()}:Unspecified`,\n {\n label: localizedStrings.unspecified,\n propertyGroupingNodeKey: {\n type: \"property-grouping:value\",\n ...propertyIdentifier,\n formattedPropertyValue: \"\",\n },\n },\n node,\n );\n continue;\n }\n groupings.ungrouped.push(node);\n continue;\n }\n\n const koqName = (await property.kindOfQuantity)?.fullName;\n if (currentProperty.ranges) {\n if (typeof currentProperty.propertyValue === \"number\") {\n const propValue = currentProperty.propertyValue;\n const matchingRange = currentProperty.ranges.find(\n (range) => propValue >= range.fromValue && propValue <= range.toValue,\n );\n\n if (matchingRange) {\n const fromValueTypedPrimitive: TypedPrimitiveValue = {\n type: Number.isInteger(matchingRange.fromValue) ? \"Integer\" : \"Double\",\n extendedType: extendedTypeName,\n koqName,\n value: matchingRange.fromValue,\n };\n const toValueTypedPrimitive: TypedPrimitiveValue = {\n type: Number.isInteger(matchingRange.toValue) ? \"Integer\" : \"Double\",\n extendedType: extendedTypeName,\n koqName,\n value: matchingRange.toValue,\n };\n\n const rangeLabel =\n matchingRange.rangeLabel ??\n `${await valueFormatter(fromValueTypedPrimitive)} - ${await valueFormatter(toValueTypedPrimitive)}`;\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName.toLocaleLowerCase()}:[${matchingRange.fromValue}-${matchingRange.toValue}]${matchingRange.rangeLabel ? `(${matchingRange.rangeLabel})` : \"\"}`,\n {\n label: rangeLabel,\n propertyGroupingNodeKey: {\n ...propertyIdentifier,\n type: \"property-grouping:range\",\n fromValue: matchingRange.fromValue,\n toValue: matchingRange.toValue,\n },\n },\n node,\n );\n continue;\n }\n }\n if (byProperties.createGroupForOutOfRangeValues) {\n const groupingNode = getOtherValuesGroupingNode();\n assert(HierarchyNodeKey.isPropertyOtherValuesGrouping(groupingNode.key));\n const thisPropertyIdentifier = {\n className: propertyIdentifier.propertyClassName,\n propertyName: propertyIdentifier.propertyName,\n };\n const hasPropertyIdentifier = groupingNode.key.properties.find(\n (x) =>\n compareFullClassNames(x.className, thisPropertyIdentifier.className) === 0 &&\n x.propertyName.toLocaleLowerCase() === thisPropertyIdentifier.propertyName.toLocaleLowerCase(),\n );\n if (!hasPropertyIdentifier) {\n groupingNode.key.properties.push(thisPropertyIdentifier);\n }\n node.key.instanceKeys.forEach((k) => groupingNode.groupedInstanceKeys.push(k));\n groupingNode.parentKeys = node.parentKeys;\n groupingNode.children.push(Object.assign(node, { parentKeys: [...node.parentKeys, groupingNode.key] }));\n continue;\n }\n groupings.ungrouped.push(node);\n continue;\n }\n\n const formattedValue =\n currentProperty.propertyValue instanceof Array\n ? await formatConcatenatedValue({ value: currentProperty.propertyValue, valueFormatter })\n : await valueFormatter(\n TypedPrimitiveValue.create(currentProperty.propertyValue, primitiveType, koqName, extendedTypeName),\n );\n\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName.toLocaleLowerCase()}:${formattedValue}`,\n {\n label: formattedValue,\n propertyGroupingNodeKey: {\n ...propertyIdentifier,\n type: \"property-grouping:value\",\n formattedPropertyValue: formattedValue,\n },\n },\n node,\n );\n }\n return createGroupingNodes(groupings, otherValuesGrouping?.new ? otherValuesGrouping.node : undefined);\n}\n\nfunction addGroupingToMap(\n groupingMap: Map<\n string,\n { displayablePropertyGroupingInfo: DisplayablePropertyGroupingInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }\n >,\n mapKey: string,\n propertyToAdd: DisplayablePropertyGroupingInfo,\n node: ProcessedInstanceHierarchyNode,\n): void {\n let groupingInfo = groupingMap.get(mapKey);\n if (!groupingInfo) {\n groupingInfo = { displayablePropertyGroupingInfo: propertyToAdd, groupedNodes: [node] };\n groupingMap.set(mapKey, groupingInfo);\n return;\n }\n groupingInfo.groupedNodes.push(node);\n}\n\nfunction createGroupingNodes(\n groupings: PropertyGroupingInformation,\n otherValuesGroupingNode: ProcessedInstancesGroupingHierarchyNode | undefined,\n): GroupingHandlerResult {\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n groupings.grouped.forEach((entry) => {\n const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;\n groupedNodes.push({\n label: entry.displayablePropertyGroupingInfo.label,\n key: entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.groupedNodes.map((gn) => ({\n ...gn,\n parentKeys: [...groupedNodeParentKeys, entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey],\n })),\n });\n });\n if (otherValuesGroupingNode) {\n groupedNodes.push(otherValuesGroupingNode);\n }\n return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: \"property\" };\n}\n\nfunction createNodePropertyGroupPathMatchers(\n node: ParentHierarchyNode,\n): Array<(x: ArrayElement<PreviousPropertiesGroupingInfo>) => boolean> {\n if (!HierarchyNode.isPropertyGroupingNode(node)) {\n return [];\n }\n\n const keys = [...node.parentKeys, node.key];\n const propertyGroupingNodeKeys: PropertyGroupingNodeKey[] = [];\n for (let i = keys.length - 1; i >= 0; --i) {\n const key = keys[i];\n if (HierarchyNodeKey.isPropertyGrouping(key)) {\n propertyGroupingNodeKeys.push(key);\n } else {\n break;\n }\n }\n propertyGroupingNodeKeys.reverse();\n\n return propertyGroupingNodeKeys.map((key): ((x: ArrayElement<PreviousPropertiesGroupingInfo>) => boolean) => {\n switch (key.type) {\n case \"property-grouping:other\":\n return (x) =>\n key.properties.some(\n (p) =>\n compareFullClassNames(p.className, x.propertiesClassName) === 0 &&\n p.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase() &&\n !!x.isRange,\n );\n case \"property-grouping:range\":\n return (x) =>\n compareFullClassNames(key.propertyClassName, x.propertiesClassName) === 0 &&\n key.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase();\n case \"property-grouping:value\":\n return (x) =>\n compareFullClassNames(key.propertyClassName, x.propertiesClassName) === 0 &&\n key.propertyName.toLocaleLowerCase() === x.propertyName.toLocaleLowerCase();\n }\n });\n}\n\n/** @internal */\nexport async function getUniquePropertiesGroupInfo(\n schemaProvider: ECSchemaProvider,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n): Promise<Array<PropertyGroupInfo>> {\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const parentPropertyGroupPath = parentNode ? createNodePropertyGroupPathMatchers(parentNode) : [];\n const uniqueProperties = new Map<string, PropertyGroupInfo>();\n for (const node of nodes) {\n await releaseMainThread();\n\n const byProperties = node.processingParams?.grouping?.byProperties;\n if (!byProperties) {\n continue;\n }\n\n let propertyGroupIndex = 0;\n const previousPropertiesInfo = new Array<{ propertyGroup: HierarchyNodePropertyGroup; propertyGroupKey: string }>();\n for (const propertyGroup of byProperties.propertyGroups) {\n const mapKeyRanges = getRangesAsString(propertyGroup.ranges);\n const lastKey =\n previousPropertiesInfo.length > 0\n ? previousPropertiesInfo[previousPropertiesInfo.length - 1].propertyGroupKey\n : \"\";\n const propertyGroupKey = `${lastKey}:${propertyGroup.propertyName}(${mapKeyRanges})`;\n const mapKey =\n `${normalizeFullClassName(byProperties.propertiesClassName)}:${propertyGroupKey}`.toLocaleLowerCase();\n\n let isAlreadyGrouped = false;\n if (parentPropertyGroupPath.length > 0 && propertyGroupIndex < parentPropertyGroupPath.length) {\n const groupMatcher = parentPropertyGroupPath[propertyGroupIndex];\n isAlreadyGrouped = groupMatcher({\n propertiesClassName: byProperties.propertiesClassName,\n propertyName: propertyGroup.propertyName,\n isRange: !!propertyGroup.ranges,\n });\n }\n if (!isAlreadyGrouped && !uniqueProperties.get(mapKey)) {\n uniqueProperties.set(mapKey, {\n ecClass: await getClass(schemaProvider, byProperties.propertiesClassName),\n propertyGroup: { propertyName: propertyGroup.propertyName, ranges: propertyGroup.ranges },\n previousPropertiesGroupingInfo: previousPropertiesInfo.map((groupingInfo) => ({\n propertiesClassName: byProperties.propertiesClassName,\n propertyName: groupingInfo.propertyGroup.propertyName,\n isRange: !!groupingInfo.propertyGroup.ranges,\n })),\n });\n }\n\n previousPropertiesInfo.push({ propertyGroup, propertyGroupKey });\n ++propertyGroupIndex;\n }\n }\n // Order might change in uniqueProperties, resorting to make sure that properties with fewer previous properties are returned first.\n return [...uniqueProperties.values()].sort(\n (lhs, rhs) => lhs.previousPropertiesGroupingInfo.length - rhs.previousPropertiesGroupingInfo.length,\n );\n}\n\nfunction getRangesAsString(ranges?: HierarchyNodePropertyValueRange[]): string {\n return ranges\n ? ranges\n .map((range) => `${range.fromValue}-${range.toValue}(${range.rangeLabel ?? \"\"})`)\n .sort()\n .join(\";\")\n : \"\";\n}\n\nasync function shouldCreatePropertyGroup(\n handlerGroupingParams: PropertyGroupInfo,\n nodePropertyGroupingParams: HierarchyNodePropertiesGroupingParams,\n nodeFullClassName: EC.FullClassName,\n classHierarchyInspector: ECClassHierarchyInspector,\n): Promise<boolean> {\n if (\n compareFullClassNames(nodePropertyGroupingParams.propertiesClassName, handlerGroupingParams.ecClass.fullName) !==\n 0 ||\n nodePropertyGroupingParams.propertyGroups.length < handlerGroupingParams.previousPropertiesGroupingInfo.length + 1\n ) {\n return false;\n }\n const currentProperty =\n nodePropertyGroupingParams.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];\n if (\n currentProperty.propertyName.toLocaleLowerCase() !==\n handlerGroupingParams.propertyGroup.propertyName.toLocaleLowerCase() ||\n !doRangesMatch(currentProperty.ranges, handlerGroupingParams.propertyGroup.ranges)\n ) {\n return false;\n }\n if (!doPreviousPropertiesMatch(handlerGroupingParams.previousPropertiesGroupingInfo, nodePropertyGroupingParams)) {\n return false;\n }\n return classHierarchyInspector.classDerivesFrom(nodeFullClassName, handlerGroupingParams.ecClass.fullName);\n}\n\n/** @internal */\nexport function doPreviousPropertiesMatch(\n previousPropertiesGroupingInfo: PreviousPropertiesGroupingInfo,\n nodesProperties: HierarchyNodePropertiesGroupingParams,\n): boolean {\n return (\n previousPropertiesGroupingInfo.length <= nodesProperties.propertyGroups.length &&\n previousPropertiesGroupingInfo.every(\n (groupingInfo, index) =>\n compareFullClassNames(groupingInfo.propertiesClassName, nodesProperties.propertiesClassName) === 0 &&\n groupingInfo.propertyName.toLocaleLowerCase() ===\n nodesProperties.propertyGroups[index].propertyName.toLocaleLowerCase() &&\n !!groupingInfo.isRange === !!nodesProperties.propertyGroups[index].ranges,\n )\n );\n}\n\n/** @internal */\nexport function doRangesMatch(\n ranges1: HierarchyNodePropertyValueRange[] | undefined,\n ranges2: HierarchyNodePropertyValueRange[] | undefined,\n): boolean {\n if (typeof ranges1 !== typeof ranges2) {\n return false;\n }\n if (!ranges1) {\n return true;\n }\n assert(Array.isArray(ranges2));\n if (ranges1.length !== ranges2.length) {\n return false;\n }\n return (\n // Check twice, to validate if both ranges have the same elements (elements can be in a different order)\n ranges1.every((lhsRange) =>\n ranges2.some(\n (rhsRange) =>\n lhsRange.fromValue === rhsRange.fromValue &&\n lhsRange.toValue === rhsRange.toValue &&\n lhsRange.rangeLabel === rhsRange.rangeLabel,\n ),\n ) &&\n ranges2.every((lhsRange) =>\n ranges1.some(\n (rhsRange) =>\n lhsRange.fromValue === rhsRange.fromValue &&\n lhsRange.toValue === rhsRange.toValue &&\n lhsRange.rangeLabel === rhsRange.rangeLabel,\n ),\n )\n );\n}\n\n/** @internal */\nexport async function createPropertiesGroupingHandlers(\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n): Promise<GroupingHandler[]> {\n const propertiesGroupInfo = await getUniquePropertiesGroupInfo(imodelAccess, parentNode, nodes);\n return propertiesGroupInfo.map(\n (propertyInfo) => async (nodesToGroup, nodesAlreadyGrouped) =>\n createPropertyGroups(\n nodesToGroup,\n nodesAlreadyGrouped,\n propertyInfo,\n valueFormatter,\n localizedStrings,\n imodelAccess,\n ),\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shared.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/Shared.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,+BAA+B,EAEhC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,uCAAuC,EAAE,MAAM,gBAAgB,CAAC;AAE5F,gBAAgB;AAChB,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,uCAAuC,EACnD,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,CAAC,cAAc,EAAE,+BAA+B,GAAG,SAAS,KAAK,OAAO,GAAG,SAAS,GACvF,IAAI,CAqBN"}
|
|
@@ -1,31 +0,0 @@
|
|
|
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.iterateChildNodeGroupingParams = iterateChildNodeGroupingParams;
|
|
8
|
-
/** @internal */
|
|
9
|
-
function iterateChildNodeGroupingParams(parentNode, groupingType, cb) {
|
|
10
|
-
function getGroupingParams(params) {
|
|
11
|
-
switch (groupingType) {
|
|
12
|
-
case "base-class":
|
|
13
|
-
return params?.grouping?.byBaseClasses;
|
|
14
|
-
case "class":
|
|
15
|
-
return typeof params?.grouping?.byClass === "object" ? params.grouping.byClass : undefined;
|
|
16
|
-
case "label":
|
|
17
|
-
return typeof params?.grouping?.byLabel === "object" && params.grouping.byLabel.action !== "merge"
|
|
18
|
-
? params.grouping.byLabel
|
|
19
|
-
: undefined;
|
|
20
|
-
case "property":
|
|
21
|
-
return params?.grouping?.byProperties;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
for (const childNode of parentNode.children) {
|
|
25
|
-
const groupingParams = getGroupingParams(childNode.processingParams);
|
|
26
|
-
if (cb(groupingParams)) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=Shared.js.map
|