@itwin/presentation-hierarchies 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/README.md +44 -47
- package/lib/cjs/hierarchies/HierarchyFiltering.d.ts +64 -0
- package/lib/cjs/hierarchies/HierarchyFiltering.d.ts.map +1 -0
- package/lib/cjs/hierarchies/HierarchyFiltering.js +80 -0
- package/lib/cjs/hierarchies/HierarchyFiltering.js.map +1 -0
- package/lib/cjs/hierarchies/HierarchyNode.d.ts +29 -233
- package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNode.js +25 -8
- package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts +7 -11
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +9 -8
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +31 -6
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.js +26 -23
- package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -1
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts +24 -89
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
- package/lib/cjs/hierarchies/HierarchyProvider.js +24 -381
- package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
- package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/FilteringHierarchyDefinition.d.ts +9 -9
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/FilteringHierarchyDefinition.js +35 -73
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts +18 -0
- package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{internal/ChildNodeObservablesCache.js → imodel/HierarchyCache.js} +4 -4
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +121 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +21 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +234 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +29 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +77 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +428 -0
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{LimitingECSqlQueryExecutor.js → imodel/LimitingECSqlQueryExecutor.js} +3 -3
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
- package/lib/{esm/hierarchies → cjs/hierarchies/imodel}/NodeSelectQueryFactory.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +140 -0
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{HierarchyDefinition.js → imodel/PredicateBasedHierarchyDefinition.js} +26 -36
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
- package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/TreeNodesReader.d.ts +6 -6
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/TreeNodesReader.js +2 -2
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/Utils.d.ts +4 -0
- package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/Utils.js +59 -0
- package/lib/cjs/hierarchies/imodel/Utils.js.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/DetermineChildren.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/DetermineChildren.js +3 -3
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/Grouping.d.ts +2 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/Grouping.js +5 -5
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/HideIfNoChildren.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/HideIfNoChildren.js +5 -5
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
- package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/operators/HideNodesInHierarchy.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/HideNodesInHierarchy.js +22 -9
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
- package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/operators/grouping/BaseClassGrouping.d.ts +2 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
- package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/operators/grouping/ClassGrouping.d.ts +2 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/LabelGrouping.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/LabelGrouping.js +2 -2
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
- package/lib/{esm/hierarchies/internal → cjs/hierarchies/imodel}/operators/grouping/PropertiesGrouping.d.ts +2 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
- package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/Shared.d.ts +1 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
- package/lib/cjs/hierarchies/internal/Common.d.ts +7 -4
- package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -1
- package/lib/cjs/hierarchies/internal/Common.js +0 -66
- package/lib/cjs/hierarchies/internal/Common.js.map +1 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts +3 -2
- package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +1 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -1
- package/lib/cjs/presentation-hierarchies.d.ts +10 -6
- package/lib/cjs/presentation-hierarchies.d.ts.map +1 -1
- package/lib/cjs/presentation-hierarchies.js +18 -10
- package/lib/cjs/presentation-hierarchies.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyFiltering.d.ts +64 -0
- package/lib/esm/hierarchies/HierarchyFiltering.d.ts.map +1 -0
- package/lib/esm/hierarchies/HierarchyFiltering.js +76 -0
- package/lib/esm/hierarchies/HierarchyFiltering.js.map +1 -0
- package/lib/esm/hierarchies/HierarchyNode.d.ts +29 -233
- package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyNode.js +24 -7
- package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +7 -11
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js +9 -8
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts +31 -6
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.js +26 -23
- package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -1
- package/lib/esm/hierarchies/HierarchyProvider.d.ts +24 -89
- package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
- package/lib/esm/hierarchies/HierarchyProvider.js +25 -382
- package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
- package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/FilteringHierarchyDefinition.d.ts +9 -9
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/FilteringHierarchyDefinition.js +36 -74
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js.map +1 -0
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +18 -0
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal/ChildNodeObservablesCache.js → imodel/HierarchyCache.js} +2 -2
- package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +1 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts +121 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js +18 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts +234 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js +26 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +77 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +425 -0
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
- package/lib/esm/hierarchies/{LimitingECSqlQueryExecutor.js → imodel/LimitingECSqlQueryExecutor.js} +3 -3
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
- package/lib/{cjs/hierarchies → esm/hierarchies/imodel}/NodeSelectQueryFactory.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +140 -0
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
- package/lib/esm/hierarchies/{HierarchyDefinition.js → imodel/PredicateBasedHierarchyDefinition.js} +25 -34
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
- package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/TreeNodesReader.d.ts +6 -6
- package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/TreeNodesReader.js +2 -2
- package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +1 -0
- package/lib/esm/hierarchies/imodel/Utils.d.ts +4 -0
- package/lib/esm/hierarchies/imodel/Utils.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/Utils.js +56 -0
- package/lib/esm/hierarchies/imodel/Utils.js.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/DetermineChildren.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/DetermineChildren.js +3 -3
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/Grouping.d.ts +2 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/Grouping.js +6 -6
- package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/HideIfNoChildren.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/HideIfNoChildren.js +5 -5
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
- package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/operators/HideNodesInHierarchy.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/HideNodesInHierarchy.js +22 -9
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
- package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/operators/grouping/BaseClassGrouping.d.ts +2 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
- package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/operators/grouping/ClassGrouping.d.ts +2 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/LabelGrouping.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/LabelGrouping.js +2 -2
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
- package/lib/{cjs/hierarchies/internal → esm/hierarchies/imodel}/operators/grouping/PropertiesGrouping.d.ts +2 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/PropertiesGrouping.js +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
- package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/Shared.d.ts +1 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
- package/lib/esm/hierarchies/internal/Common.d.ts +7 -4
- package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -1
- package/lib/esm/hierarchies/internal/Common.js +0 -65
- package/lib/esm/hierarchies/internal/Common.js.map +1 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +3 -2
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +1 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.js.map +1 -1
- package/lib/esm/presentation-hierarchies.d.ts +10 -6
- package/lib/esm/presentation-hierarchies.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies.js +8 -4
- package/lib/esm/presentation-hierarchies.js.map +1 -1
- package/package.json +3 -2
- package/lib/cjs/hierarchies/HierarchyDefinition.d.ts +0 -251
- package/lib/cjs/hierarchies/HierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/cjs/hierarchies/NodeSelectQueryFactory.js.map +0 -1
- package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts +0 -40
- package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js.map +0 -1
- package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/TreeNodesReader.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/TreeNodesReader.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Grouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Grouping.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyDefinition.d.ts +0 -251
- package/lib/esm/hierarchies/HierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/esm/hierarchies/NodeSelectQueryFactory.js.map +0 -1
- package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts +0 -40
- package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js.map +0 -1
- package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/internal/TreeNodesReader.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/TreeNodesReader.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/DetermineChildren.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Grouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Grouping.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/grouping/Shared.js.map +0 -1
- /package/lib/cjs/hierarchies/{LimitingECSqlQueryExecutor.d.ts → imodel/LimitingECSqlQueryExecutor.d.ts} +0 -0
- /package/lib/cjs/hierarchies/{NodeSelectQueryFactory.js → imodel/NodeSelectQueryFactory.js} +0 -0
- /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/AutoExpand.d.ts +0 -0
- /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/AutoExpand.js +0 -0
- /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/BaseClassGrouping.js +0 -0
- /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/ClassGrouping.js +0 -0
- /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/GroupHiding.d.ts +0 -0
- /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/GroupHiding.js +0 -0
- /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/PropertiesGrouping.js +0 -0
- /package/lib/cjs/hierarchies/{internal → imodel}/operators/grouping/Shared.js +0 -0
- /package/lib/esm/hierarchies/{LimitingECSqlQueryExecutor.d.ts → imodel/LimitingECSqlQueryExecutor.d.ts} +0 -0
- /package/lib/esm/hierarchies/{NodeSelectQueryFactory.js → imodel/NodeSelectQueryFactory.js} +0 -0
- /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/AutoExpand.d.ts +0 -0
- /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/AutoExpand.js +0 -0
- /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/BaseClassGrouping.js +0 -0
- /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/ClassGrouping.js +0 -0
- /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/GroupHiding.d.ts +0 -0
- /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/GroupHiding.js +0 -0
- /package/lib/esm/hierarchies/{internal → imodel}/operators/grouping/Shared.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { OmitOverUnion } from "@itwin/presentation-shared";
|
|
2
|
+
import { HierarchyFilteringPath, HierarchyFilteringPathOptions } from "./HierarchyFiltering";
|
|
3
|
+
import { ClassGroupingNodeKey, GenericNodeKey, GroupingNodeKey, HierarchyNodeKey, IModelHierarchyNodeKey, IModelInstanceKey, InstancesNodeKey, LabelGroupingNodeKey, PropertyGroupingNodeKey, PropertyOtherValuesGroupingNodeKey, PropertyValueGroupingNodeKey, PropertyValueRangeGroupingNodeKey } from "./HierarchyNodeKey";
|
|
4
4
|
/** @beta */
|
|
5
5
|
export type HierarchyNodeFilteringProps = {
|
|
6
6
|
/** If set to true, then one of the ancestor nodes in the hierarchy is the filter target. */
|
|
@@ -8,6 +8,7 @@ export type HierarchyNodeFilteringProps = {
|
|
|
8
8
|
/** Paths to node's children that are filter targets. */
|
|
9
9
|
filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];
|
|
10
10
|
} & ({
|
|
11
|
+
/** Whether or not this node is a filter target. */
|
|
11
12
|
isFilterTarget?: false;
|
|
12
13
|
} | {
|
|
13
14
|
/** Whether or not this node is a filter target. */
|
|
@@ -15,6 +16,15 @@ export type HierarchyNodeFilteringProps = {
|
|
|
15
16
|
/** Options that were used to filter the node. */
|
|
16
17
|
filterTargetOptions?: HierarchyFilteringPathOptions;
|
|
17
18
|
});
|
|
19
|
+
/** @beta */
|
|
20
|
+
export declare namespace HierarchyNodeFilteringProps {
|
|
21
|
+
function create(props: {
|
|
22
|
+
hasFilterTargetAncestor?: boolean;
|
|
23
|
+
filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];
|
|
24
|
+
isFilterTarget?: boolean;
|
|
25
|
+
filterTargetOptions?: HierarchyFilteringPathOptions;
|
|
26
|
+
}): HierarchyNodeFilteringProps | undefined;
|
|
27
|
+
}
|
|
18
28
|
/**
|
|
19
29
|
* A data structure that defines attributes that are common to all types of hierarchy nodes.
|
|
20
30
|
* @beta
|
|
@@ -41,7 +51,7 @@ interface BaseHierarchyNode {
|
|
|
41
51
|
*/
|
|
42
52
|
export interface NonGroupingHierarchyNode extends BaseHierarchyNode {
|
|
43
53
|
/** An identifier to identify the node in its hierarchy level. */
|
|
44
|
-
key:
|
|
54
|
+
key: GenericNodeKey | InstancesNodeKey;
|
|
45
55
|
/**
|
|
46
56
|
* Identifies whether the hierarchy level below this node supports filtering. If not, supplying an instance
|
|
47
57
|
* filter when requesting child hierarchy level will have no effect.
|
|
@@ -59,7 +69,7 @@ export interface GroupingHierarchyNode extends BaseHierarchyNode {
|
|
|
59
69
|
* Keys of all instances grouped by this node, including deeply nested under
|
|
60
70
|
* other grouping nodes.
|
|
61
71
|
*/
|
|
62
|
-
groupedInstanceKeys:
|
|
72
|
+
groupedInstanceKeys: IModelInstanceKey[];
|
|
63
73
|
/** The closest ancestor node that is not a grouping node. May be `undefined` if the grouping node grouped root level nodes. */
|
|
64
74
|
nonGroupingAncestor?: ParentHierarchyNode<NonGroupingHierarchyNode>;
|
|
65
75
|
}
|
|
@@ -70,70 +80,70 @@ export interface GroupingHierarchyNode extends BaseHierarchyNode {
|
|
|
70
80
|
export type HierarchyNode = NonGroupingHierarchyNode | GroupingHierarchyNode;
|
|
71
81
|
/** @beta */
|
|
72
82
|
export declare namespace HierarchyNode {
|
|
73
|
-
/** Checks whether the given node is a
|
|
74
|
-
function
|
|
83
|
+
/** Checks whether the given node is a generic node */
|
|
84
|
+
function isGeneric<TNode extends {
|
|
75
85
|
key: HierarchyNodeKey;
|
|
76
|
-
}>(node: TNode): node is TNode &
|
|
77
|
-
key:
|
|
86
|
+
}>(node: TNode): node is TNode & NonGroupingHierarchyNode & {
|
|
87
|
+
key: GenericNodeKey;
|
|
78
88
|
};
|
|
79
89
|
/** Checks whether the given node is a standard (iModel content based) node */
|
|
80
|
-
function
|
|
90
|
+
function isIModelNode<TNode extends {
|
|
81
91
|
key: HierarchyNodeKey;
|
|
82
92
|
}>(node: TNode): node is TNode & {
|
|
83
|
-
key:
|
|
93
|
+
key: IModelHierarchyNodeKey;
|
|
84
94
|
};
|
|
85
95
|
/** Checks whether the given node is an ECInstances-based node */
|
|
86
96
|
function isInstancesNode<TNode extends {
|
|
87
97
|
key: HierarchyNodeKey;
|
|
88
|
-
}>(node: TNode): node is TNode &
|
|
98
|
+
}>(node: TNode): node is TNode & NonGroupingHierarchyNode & {
|
|
89
99
|
key: InstancesNodeKey;
|
|
90
100
|
};
|
|
91
101
|
/** Checks whether the given node is a grouping node */
|
|
92
102
|
function isGroupingNode<TNode extends {
|
|
93
103
|
key: HierarchyNodeKey;
|
|
94
|
-
}>(node: TNode): node is TNode &
|
|
104
|
+
}>(node: TNode): node is TNode & GroupingHierarchyNode;
|
|
95
105
|
/** Checks whether the given node is a class grouping node */
|
|
96
106
|
function isClassGroupingNode<TNode extends {
|
|
97
107
|
key: HierarchyNodeKey;
|
|
98
108
|
}>(node: TNode): node is TNode & {
|
|
99
109
|
key: ClassGroupingNodeKey;
|
|
100
110
|
supportsFiltering?: undefined;
|
|
101
|
-
} &
|
|
111
|
+
} & GroupingHierarchyNode;
|
|
102
112
|
/** Checks whether the given node is a label grouping node */
|
|
103
113
|
function isLabelGroupingNode<TNode extends {
|
|
104
114
|
key: HierarchyNodeKey;
|
|
105
115
|
}>(node: TNode): node is TNode & {
|
|
106
116
|
key: LabelGroupingNodeKey;
|
|
107
117
|
supportsFiltering?: undefined;
|
|
108
|
-
} &
|
|
118
|
+
} & GroupingHierarchyNode;
|
|
109
119
|
/** Checks whether the given node is property grouping node for other values */
|
|
110
120
|
function isPropertyOtherValuesGroupingNode<TNode extends {
|
|
111
121
|
key: HierarchyNodeKey;
|
|
112
122
|
}>(node: TNode): node is TNode & {
|
|
113
123
|
key: PropertyOtherValuesGroupingNodeKey;
|
|
114
124
|
supportsFiltering?: undefined;
|
|
115
|
-
} &
|
|
125
|
+
} & GroupingHierarchyNode;
|
|
116
126
|
/** Checks whether the given node is a property value grouping node */
|
|
117
127
|
function isPropertyValueGroupingNode<TNode extends {
|
|
118
128
|
key: HierarchyNodeKey;
|
|
119
129
|
}>(node: TNode): node is TNode & {
|
|
120
130
|
key: PropertyValueGroupingNodeKey;
|
|
121
131
|
supportsFiltering?: undefined;
|
|
122
|
-
} &
|
|
132
|
+
} & GroupingHierarchyNode;
|
|
123
133
|
/** Checks whether the given node is a property value range grouping node */
|
|
124
134
|
function isPropertyValueRangeGroupingNode<TNode extends {
|
|
125
135
|
key: HierarchyNodeKey;
|
|
126
136
|
}>(node: TNode): node is TNode & {
|
|
127
137
|
key: PropertyValueRangeGroupingNodeKey;
|
|
128
138
|
supportsFiltering?: undefined;
|
|
129
|
-
} &
|
|
139
|
+
} & GroupingHierarchyNode;
|
|
130
140
|
/** Checks whether the given node is a property grouping node */
|
|
131
141
|
function isPropertyGroupingNode<TNode extends {
|
|
132
142
|
key: HierarchyNodeKey;
|
|
133
143
|
}>(node: TNode): node is TNode & {
|
|
134
144
|
key: PropertyGroupingNodeKey;
|
|
135
145
|
supportsFiltering?: undefined;
|
|
136
|
-
} &
|
|
146
|
+
} & GroupingHierarchyNode;
|
|
137
147
|
}
|
|
138
148
|
/**
|
|
139
149
|
* A type of `HierarchyNode` that doesn't know about its children and is an input when requesting
|
|
@@ -141,219 +151,5 @@ export declare namespace HierarchyNode {
|
|
|
141
151
|
* @beta
|
|
142
152
|
*/
|
|
143
153
|
export type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, "children">;
|
|
144
|
-
/**
|
|
145
|
-
* Base processing parameters that apply to every node.
|
|
146
|
-
* @beta
|
|
147
|
-
*/
|
|
148
|
-
interface HierarchyNodeProcessingParamsBase {
|
|
149
|
-
/** Indicates if this node should be hidden if it has no child nodes. */
|
|
150
|
-
hideIfNoChildren?: boolean;
|
|
151
|
-
/** Indicates that this node should always be hidden and its children should be loaded in its place. */
|
|
152
|
-
hideInHierarchy?: boolean;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* A data structure for defining nodes' grouping requirements.
|
|
156
|
-
* @beta
|
|
157
|
-
*/
|
|
158
|
-
interface HierarchyNodeGroupingParams {
|
|
159
|
-
byLabel?: HierarchyNodeLabelGroupingParams;
|
|
160
|
-
byClass?: boolean | HierarchyNodeGroupingParamsBase;
|
|
161
|
-
byBaseClasses?: HierarchyNodeBaseClassGroupingParams;
|
|
162
|
-
byProperties?: HierarchyNodePropertiesGroupingParams;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* A data structure for defining params specifically used for label grouping.
|
|
166
|
-
* @beta
|
|
167
|
-
*/
|
|
168
|
-
interface HierarchyNodeLabelGroupingBaseParams {
|
|
169
|
-
/** Label grouping option that determines whether to group nodes or to merge them. Defaults to "group".*/
|
|
170
|
-
action?: "group" | "merge";
|
|
171
|
-
/** Value that needs to match in order for nodes to be grouped or merged.*/
|
|
172
|
-
groupId?: string;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* A data structure for defining label merging.
|
|
176
|
-
* @beta
|
|
177
|
-
*/
|
|
178
|
-
interface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {
|
|
179
|
-
action: "merge";
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* A data structure for defining label grouping with additional parameters.
|
|
183
|
-
* @beta
|
|
184
|
-
*/
|
|
185
|
-
interface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {
|
|
186
|
-
action?: "group";
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* A data structure for defining possible label grouping types.
|
|
190
|
-
* @beta
|
|
191
|
-
*/
|
|
192
|
-
export type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;
|
|
193
|
-
/**
|
|
194
|
-
* Grouping parameters that are shared across all types of groupings.
|
|
195
|
-
* @beta
|
|
196
|
-
*/
|
|
197
|
-
export interface HierarchyNodeGroupingParamsBase {
|
|
198
|
-
/** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */
|
|
199
|
-
hideIfNoSiblings?: boolean;
|
|
200
|
-
/** Hiding option that determines whether to hide group nodes which have only one node as its children. */
|
|
201
|
-
hideIfOneGroupedNode?: boolean;
|
|
202
|
-
/** Option which auto expands grouping nodes' children when it has single child or always. */
|
|
203
|
-
autoExpand?: HierarchyNodeAutoExpandProp;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Defines possible values for `BaseGroupingParams.autoExpand` attribute:
|
|
207
|
-
* - `single-child` - set the grouping node to auto-expand if it groups a single node.
|
|
208
|
-
* - `always` - always set the grouping node to auto-expand.
|
|
209
|
-
* @beta
|
|
210
|
-
*/
|
|
211
|
-
export type HierarchyNodeAutoExpandProp = "single-child" | "always";
|
|
212
|
-
/**
|
|
213
|
-
* A data structure that represents base class grouping.
|
|
214
|
-
* @beta
|
|
215
|
-
*/
|
|
216
|
-
interface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {
|
|
217
|
-
/**
|
|
218
|
-
* Full names of classes, which should be used to group the node. Only has effect if the node
|
|
219
|
-
* represents an instance of that class.
|
|
220
|
-
*
|
|
221
|
-
* Full class name format: `SchemaName.ClassName`.
|
|
222
|
-
*/
|
|
223
|
-
fullClassNames: string[];
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* A data structure that represents properties grouping.
|
|
227
|
-
* @beta
|
|
228
|
-
*/
|
|
229
|
-
export interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {
|
|
230
|
-
/**
|
|
231
|
-
* Full name of a class whose properties are used to group the node. Only has effect if the node
|
|
232
|
-
* represents an instance of that class.
|
|
233
|
-
*
|
|
234
|
-
* Full class name format: `SchemaName.ClassName`.
|
|
235
|
-
*/
|
|
236
|
-
propertiesClassName: string;
|
|
237
|
-
/**
|
|
238
|
-
* Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.
|
|
239
|
-
*
|
|
240
|
-
* Label of the created grouping node will be `Not Specified`.
|
|
241
|
-
*/
|
|
242
|
-
createGroupForUnspecifiedValues?: boolean;
|
|
243
|
-
/**
|
|
244
|
-
* Property grouping option that determines whether to group nodes whose grouping value doesn't fit within any of the provided
|
|
245
|
-
* ranges, or is not a numeric value.
|
|
246
|
-
*
|
|
247
|
-
* Label of the created grouping node will be `Other`.
|
|
248
|
-
*/
|
|
249
|
-
createGroupForOutOfRangeValues?: boolean;
|
|
250
|
-
/**
|
|
251
|
-
* Properties of the specified class, by which the nodes should be grouped. Each provided group definition results in a
|
|
252
|
-
* grouping hierarchy level.
|
|
253
|
-
*
|
|
254
|
-
* Example usage:
|
|
255
|
-
* ```ts
|
|
256
|
-
* propertyGroups: [
|
|
257
|
-
* {
|
|
258
|
-
* propertyName: "type",
|
|
259
|
-
* propertyValue: "Wall"
|
|
260
|
-
* },
|
|
261
|
-
* {
|
|
262
|
-
* propertyName: "length",
|
|
263
|
-
* propertyValue: 15,
|
|
264
|
-
* ranges: [
|
|
265
|
-
* { fromValue: 1, toValue: 10, rangeLabel: "Small" },
|
|
266
|
-
* { fromValue: 11, toValue: 20, rangeLabel: "Medium" }
|
|
267
|
-
* ]
|
|
268
|
-
* },
|
|
269
|
-
* ]
|
|
270
|
-
* ```
|
|
271
|
-
*/
|
|
272
|
-
propertyGroups: HierarchyNodePropertyGroup[];
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* A data structure that represents specific properties' grouping params.
|
|
276
|
-
* @beta
|
|
277
|
-
*/
|
|
278
|
-
export interface HierarchyNodePropertyGroup {
|
|
279
|
-
/** A string indicating the name of the property to group by. */
|
|
280
|
-
propertyName: string;
|
|
281
|
-
/** Value of the property, which will be used to group the node. */
|
|
282
|
-
propertyValue?: PrimitiveValue | ConcatenatedValue;
|
|
283
|
-
/** Ranges are used to group nodes by numeric properties which are within specified bounds. */
|
|
284
|
-
ranges?: HierarchyNodePropertyValueRange[];
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* A data structure that represents boundaries for a value.
|
|
288
|
-
* @beta
|
|
289
|
-
*/
|
|
290
|
-
export interface HierarchyNodePropertyValueRange {
|
|
291
|
-
/** Defines the lower bound of the range. */
|
|
292
|
-
fromValue: number;
|
|
293
|
-
/** Defines the upper bound of the range. */
|
|
294
|
-
toValue: number;
|
|
295
|
-
/** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */
|
|
296
|
-
rangeLabel?: string;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Processing parameters that apply to instance nodes.
|
|
300
|
-
* @beta
|
|
301
|
-
*/
|
|
302
|
-
export interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {
|
|
303
|
-
grouping?: HierarchyNodeGroupingParams;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* A custom (not based on data in an iModel) node that has processing parameters.
|
|
307
|
-
* @beta
|
|
308
|
-
*/
|
|
309
|
-
export type ProcessedCustomHierarchyNode = Omit<NonGroupingHierarchyNode, "key" | "children"> & {
|
|
310
|
-
key: string;
|
|
311
|
-
children?: boolean;
|
|
312
|
-
processingParams?: HierarchyNodeProcessingParamsBase;
|
|
313
|
-
};
|
|
314
|
-
/**
|
|
315
|
-
* An instances' (based on data in an iModel) node that has processing parameters.
|
|
316
|
-
* @beta
|
|
317
|
-
*/
|
|
318
|
-
export type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, "key" | "children"> & {
|
|
319
|
-
key: InstancesNodeKey;
|
|
320
|
-
children?: boolean;
|
|
321
|
-
processingParams?: InstanceHierarchyNodeProcessingParams;
|
|
322
|
-
};
|
|
323
|
-
/**
|
|
324
|
-
* A grouping node that groups either instance nodes or other grouping nodes.
|
|
325
|
-
* @beta
|
|
326
|
-
*/
|
|
327
|
-
export type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, "children"> & {
|
|
328
|
-
children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;
|
|
329
|
-
};
|
|
330
|
-
/**
|
|
331
|
-
* A `HierarchyNode` that may have processing parameters defining whether it should be hidden under some conditions,
|
|
332
|
-
* how it should be grouped, sorted, etc.
|
|
333
|
-
*
|
|
334
|
-
* Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of
|
|
335
|
-
* `ProcessedHierarchyNode`.
|
|
336
|
-
*
|
|
337
|
-
* @beta
|
|
338
|
-
*/
|
|
339
|
-
export type ProcessedHierarchyNode = ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;
|
|
340
|
-
/**
|
|
341
|
-
* A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is
|
|
342
|
-
* returned when the node is just parsed from query results.
|
|
343
|
-
* @beta
|
|
344
|
-
*/
|
|
345
|
-
export type ParsedHierarchyNode<TBase = ParsedCustomHierarchyNode | ParsedInstanceHierarchyNode> = OmitOverUnion<TBase, "label" | "parentKeys"> & {
|
|
346
|
-
label: string | ConcatenatedValue;
|
|
347
|
-
};
|
|
348
|
-
/**
|
|
349
|
-
* A kind of `ProcessedCustomHierarchyNode` that has unformatted label and doesn't know about its ancestors.
|
|
350
|
-
* @beta
|
|
351
|
-
*/
|
|
352
|
-
export type ParsedCustomHierarchyNode = ParsedHierarchyNode<ProcessedCustomHierarchyNode>;
|
|
353
|
-
/**
|
|
354
|
-
* A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.
|
|
355
|
-
* @beta
|
|
356
|
-
*/
|
|
357
|
-
export type ParsedInstanceHierarchyNode = ParsedHierarchyNode<ProcessedInstanceHierarchyNode>;
|
|
358
154
|
export {};
|
|
359
155
|
//# sourceMappingURL=HierarchyNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyNode.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"HierarchyNode.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":"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"}
|
|
@@ -5,18 +5,35 @@
|
|
|
5
5
|
import { HierarchyNodeKey, } from "./HierarchyNodeKey";
|
|
6
6
|
/** @beta */
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
8
|
+
export var HierarchyNodeFilteringProps;
|
|
9
|
+
(function (HierarchyNodeFilteringProps) {
|
|
10
|
+
function create(props) {
|
|
11
|
+
const { hasFilterTargetAncestor, filteredChildrenIdentifierPaths, isFilterTarget, filterTargetOptions } = props;
|
|
12
|
+
if (isFilterTarget || hasFilterTargetAncestor || filteredChildrenIdentifierPaths?.length) {
|
|
13
|
+
return {
|
|
14
|
+
...(isFilterTarget ? { isFilterTarget, filterTargetOptions } : undefined),
|
|
15
|
+
...(hasFilterTargetAncestor ? { hasFilterTargetAncestor } : undefined),
|
|
16
|
+
...(!!filteredChildrenIdentifierPaths?.length ? { filteredChildrenIdentifierPaths } : undefined),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
HierarchyNodeFilteringProps.create = create;
|
|
22
|
+
})(HierarchyNodeFilteringProps || (HierarchyNodeFilteringProps = {}));
|
|
23
|
+
/** @beta */
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
8
25
|
export var HierarchyNode;
|
|
9
26
|
(function (HierarchyNode) {
|
|
10
|
-
/** Checks whether the given node is a
|
|
11
|
-
function
|
|
12
|
-
return HierarchyNodeKey.
|
|
27
|
+
/** Checks whether the given node is a generic node */
|
|
28
|
+
function isGeneric(node) {
|
|
29
|
+
return HierarchyNodeKey.isGeneric(node.key);
|
|
13
30
|
}
|
|
14
|
-
HierarchyNode.
|
|
31
|
+
HierarchyNode.isGeneric = isGeneric;
|
|
15
32
|
/** Checks whether the given node is a standard (iModel content based) node */
|
|
16
|
-
function
|
|
17
|
-
return HierarchyNodeKey.
|
|
33
|
+
function isIModelNode(node) {
|
|
34
|
+
return HierarchyNodeKey.isIModelNodeKey(node.key);
|
|
18
35
|
}
|
|
19
|
-
HierarchyNode.
|
|
36
|
+
HierarchyNode.isIModelNode = isIModelNode;
|
|
20
37
|
/** Checks whether the given node is an ECInstances-based node */
|
|
21
38
|
function isInstancesNode(node) {
|
|
22
39
|
return HierarchyNodeKey.isInstances(node.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyNode.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAGL,gBAAgB,GAQjB,MAAM,oBAAoB,CAAC;AA4E5B,YAAY;AACZ,2DAA2D;AAC3D,MAAM,KAAW,aAAa,CAuE7B;AAvED,WAAiB,aAAa;IAC5B,qDAAqD;IACrD,SAAgB,QAAQ,CACtB,IAAW;QAEX,OAAO,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;IAJe,sBAAQ,WAIvB,CAAA;IACD,8EAA8E;IAC9E,SAAgB,UAAU,CAA0C,IAAW;QAC7E,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAFe,wBAAU,aAEzB,CAAA;IACD,iEAAiE;IACjE,SAAgB,eAAe,CAC7B,IAAW;QAEX,OAAO,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAJe,6BAAe,kBAI9B,CAAA;IACD,uDAAuD;IACvD,SAAgB,cAAc,CAC5B,IAAW;QAEX,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAJe,4BAAc,iBAI7B,CAAA;IACD,6DAA6D;IAC7D,SAAgB,mBAAmB,CACjC,IAAW;QAIX,OAAO,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IANe,iCAAmB,sBAMlC,CAAA;IACD,6DAA6D;IAC7D,SAAgB,mBAAmB,CACjC,IAAW;QAIX,OAAO,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IANe,iCAAmB,sBAMlC,CAAA;IACD,gFAAgF;IAChF,SAAgB,iCAAiC,CAC/C,IAAW;QAIX,OAAO,gBAAgB,CAAC,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;IANe,+CAAiC,oCAMhD,CAAA;IACD,sEAAsE;IACtE,SAAgB,2BAA2B,CACzC,IAAW;QAIX,OAAO,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;IANe,yCAA2B,8BAM1C,CAAA;IACD,4EAA4E;IAC5E,SAAgB,gCAAgC,CAC9C,IAAW;QAIX,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IANe,8CAAgC,mCAM/C,CAAA;IACD,gEAAgE;IAChE,SAAgB,sBAAsB,CACpC,IAAW;QAIX,OAAO,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IANe,oCAAsB,yBAMrC,CAAA;AACH,CAAC,EAvEgB,aAAa,KAAb,aAAa,QAuE7B","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 { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from \"@itwin/presentation-shared\";\nimport {\n ClassGroupingNodeKey,\n GroupingNodeKey,\n HierarchyNodeKey,\n InstancesNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n StandardHierarchyNodeKey,\n} from \"./HierarchyNodeKey\";\nimport { HierarchyFilteringPath, HierarchyFilteringPathOptions } from \"./HierarchyProvider\";\n\n/** @beta */\nexport type HierarchyNodeFilteringProps = {\n /** If set to true, then one of the ancestor nodes in the hierarchy is the filter target. */\n hasFilterTargetAncestor?: boolean;\n /** Paths to node's children that are filter targets. */\n filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];\n} & (\n | { isFilterTarget?: false }\n | {\n /** Whether or not this node is a filter target. */\n isFilterTarget: true;\n /** Options that were used to filter the node. */\n filterTargetOptions?: HierarchyFilteringPathOptions;\n }\n);\n\n/**\n * A data structure that defines attributes that are common to all types of hierarchy nodes.\n * @beta\n */\ninterface BaseHierarchyNode {\n /** Identifiers of all node ancestors. Can be used to identify a node in the hierarchy. */\n parentKeys: HierarchyNodeKey[];\n /** Node's display label. */\n label: string;\n /** A flag indicating whether the node has children or not. */\n children: boolean;\n /** A flag indicating whether this node should be auto-expanded in the UI. */\n autoExpand?: boolean;\n /** Additional data that may be assigned to this node. */\n extendedData?: { [key: string]: any };\n /** Data that may be assigned to the node if filtering is enabled */\n filtering?: HierarchyNodeFilteringProps;\n}\n\n/**\n * A data structure that represents a single non-grouping hierarchy node.\n * @beta\n */\nexport interface NonGroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify the node in its hierarchy level. */\n key: string | InstancesNodeKey;\n /**\n * Identifies whether the hierarchy level below this node supports filtering. If not, supplying an instance\n * filter when requesting child hierarchy level will have no effect.\n */\n supportsFiltering?: boolean;\n}\n\n/**\n * A data structure that represents a grouping node that groups other nodes.\n * @beta\n */\nexport interface GroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify this grouping node in its hierarchy level. */\n key: GroupingNodeKey;\n\n /**\n * Keys of all instances grouped by this node, including deeply nested under\n * other grouping nodes.\n */\n groupedInstanceKeys: InstanceKey[];\n\n /** The closest ancestor node that is not a grouping node. May be `undefined` if the grouping node grouped root level nodes. */\n nonGroupingAncestor?: ParentHierarchyNode<NonGroupingHierarchyNode>;\n}\n\n/**\n * A data structure that represents a single hierarchy node.\n * @beta\n */\nexport type HierarchyNode = NonGroupingHierarchyNode | GroupingHierarchyNode;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNode {\n /** Checks whether the given node is a custom node */\n export function isCustom<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedCustomHierarchyNode : NonGroupingHierarchyNode) & { key: string } {\n return HierarchyNodeKey.isCustom(node.key);\n }\n /** Checks whether the given node is a standard (iModel content based) node */\n export function isStandard<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & { key: StandardHierarchyNodeKey } {\n return HierarchyNodeKey.isStandard(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedInstanceHierarchyNode : NonGroupingHierarchyNode) & { key: InstancesNodeKey } {\n return HierarchyNodeKey.isInstances(node.key);\n }\n /** Checks whether the given node is a grouping node */\n export function isGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & (TNode extends ProcessedHierarchyNode ? ProcessedGroupingHierarchyNode : GroupingHierarchyNode) {\n return HierarchyNodeKey.isGrouping(node.key);\n }\n /** Checks whether the given node is a class grouping node */\n export function isClassGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: ClassGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isClassGrouping(node.key);\n }\n /** Checks whether the given node is a label grouping node */\n export function isLabelGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: LabelGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isLabelGrouping(node.key);\n }\n /** Checks whether the given node is property grouping node for other values */\n export function isPropertyOtherValuesGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyOtherValuesGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isPropertyOtherValuesGrouping(node.key);\n }\n /** Checks whether the given node is a property value grouping node */\n export function isPropertyValueGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyValueGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isPropertyValueGrouping(node.key);\n }\n /** Checks whether the given node is a property value range grouping node */\n export function isPropertyValueRangeGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyValueRangeGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isPropertyValueRangeGrouping(node.key);\n }\n /** Checks whether the given node is a property grouping node */\n export function isPropertyGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyGroupingNodeKey; supportsFiltering?: undefined } & (TNode extends ProcessedHierarchyNode\n ? ProcessedGroupingHierarchyNode\n : GroupingHierarchyNode) {\n return HierarchyNodeKey.isPropertyGrouping(node.key);\n }\n}\n\n/**\n * A type of `HierarchyNode` that doesn't know about its children and is an input when requesting\n * them using `HierarchyProvider.getNodes`.\n * @beta\n */\nexport type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, \"children\">;\n\n/**\n * Base processing parameters that apply to every node.\n * @beta\n */\ninterface HierarchyNodeProcessingParamsBase {\n /** Indicates if this node should be hidden if it has no child nodes. */\n hideIfNoChildren?: boolean;\n /** Indicates that this node should always be hidden and its children should be loaded in its place. */\n hideInHierarchy?: boolean;\n}\n\n/**\n * A data structure for defining nodes' grouping requirements.\n * @beta\n */\ninterface HierarchyNodeGroupingParams {\n byLabel?: HierarchyNodeLabelGroupingParams;\n byClass?: boolean | HierarchyNodeGroupingParamsBase;\n byBaseClasses?: HierarchyNodeBaseClassGroupingParams;\n byProperties?: HierarchyNodePropertiesGroupingParams;\n}\n\n/**\n * A data structure for defining params specifically used for label grouping.\n * @beta\n */\ninterface HierarchyNodeLabelGroupingBaseParams {\n /** Label grouping option that determines whether to group nodes or to merge them. Defaults to \"group\".*/\n action?: \"group\" | \"merge\";\n /** Value that needs to match in order for nodes to be grouped or merged.*/\n groupId?: string;\n}\n\n/**\n * A data structure for defining label merging.\n * @beta\n */\ninterface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {\n action: \"merge\";\n}\n\n/**\n * A data structure for defining label grouping with additional parameters.\n * @beta\n */\ninterface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {\n action?: \"group\";\n}\n\n/**\n * A data structure for defining possible label grouping types.\n * @beta\n */\nexport type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;\n\n/**\n * Grouping parameters that are shared across all types of groupings.\n * @beta\n */\nexport interface HierarchyNodeGroupingParamsBase {\n /** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */\n hideIfNoSiblings?: boolean;\n /** Hiding option that determines whether to hide group nodes which have only one node as its children. */\n hideIfOneGroupedNode?: boolean;\n /** Option which auto expands grouping nodes' children when it has single child or always. */\n autoExpand?: HierarchyNodeAutoExpandProp;\n}\n\n/**\n * Defines possible values for `BaseGroupingParams.autoExpand` attribute:\n * - `single-child` - set the grouping node to auto-expand if it groups a single node.\n * - `always` - always set the grouping node to auto-expand.\n * @beta\n */\nexport type HierarchyNodeAutoExpandProp = \"single-child\" | \"always\";\n\n/**\n * A data structure that represents base class grouping.\n * @beta\n */\ninterface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full names of classes, which should be used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n fullClassNames: string[];\n}\n\n/**\n * A data structure that represents properties grouping.\n * @beta\n */\nexport interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {\n /**\n * Full name of a class whose properties are used to group the node. Only has effect if the node\n * represents an instance of that class.\n *\n * Full class name format: `SchemaName.ClassName`.\n */\n propertiesClassName: string;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value is not set or is set to an empty string.\n *\n * Label of the created grouping node will be `Not Specified`.\n */\n createGroupForUnspecifiedValues?: boolean;\n /**\n * Property grouping option that determines whether to group nodes whose grouping value doesn't fit within any of the provided\n * ranges, or is not a numeric value.\n *\n * Label of the created grouping node will be `Other`.\n */\n createGroupForOutOfRangeValues?: boolean;\n /**\n * Properties of the specified class, by which the nodes should be grouped. Each provided group definition results in a\n * grouping hierarchy level.\n *\n * Example usage:\n * ```ts\n * propertyGroups: [\n * {\n * propertyName: \"type\",\n * propertyValue: \"Wall\"\n * },\n * {\n * propertyName: \"length\",\n * propertyValue: 15,\n * ranges: [\n * { fromValue: 1, toValue: 10, rangeLabel: \"Small\" },\n * { fromValue: 11, toValue: 20, rangeLabel: \"Medium\" }\n * ]\n * },\n * ]\n * ```\n */\n propertyGroups: HierarchyNodePropertyGroup[];\n}\n\n/**\n * A data structure that represents specific properties' grouping params.\n * @beta\n */\nexport interface HierarchyNodePropertyGroup {\n /** A string indicating the name of the property to group by. */\n propertyName: string;\n /** Value of the property, which will be used to group the node. */\n propertyValue?: PrimitiveValue | ConcatenatedValue;\n /** Ranges are used to group nodes by numeric properties which are within specified bounds. */\n ranges?: HierarchyNodePropertyValueRange[];\n}\n\n/**\n * A data structure that represents boundaries for a value.\n * @beta\n */\nexport interface HierarchyNodePropertyValueRange {\n /** Defines the lower bound of the range. */\n fromValue: number;\n /** Defines the upper bound of the range. */\n toValue: number;\n /** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */\n rangeLabel?: string;\n}\n\n/**\n * Processing parameters that apply to instance nodes.\n * @beta\n */\nexport interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {\n grouping?: HierarchyNodeGroupingParams;\n}\n\n/**\n * A custom (not based on data in an iModel) node that has processing parameters.\n * @beta\n */\nexport type ProcessedCustomHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: string;\n children?: boolean;\n processingParams?: HierarchyNodeProcessingParamsBase;\n};\n\n/**\n * An instances' (based on data in an iModel) node that has processing parameters.\n * @beta\n */\nexport type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: InstancesNodeKey;\n children?: boolean;\n processingParams?: InstanceHierarchyNodeProcessingParams;\n};\n\n/**\n * A grouping node that groups either instance nodes or other grouping nodes.\n * @beta\n */\nexport type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, \"children\"> & {\n children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;\n};\n\n/**\n * A `HierarchyNode` that may have processing parameters defining whether it should be hidden under some conditions,\n * how it should be grouped, sorted, etc.\n *\n * Type guards under `HierarchyNode` namespace can be used to differentiate between different sub-types of\n * `ProcessedHierarchyNode`.\n *\n * @beta\n */\nexport type ProcessedHierarchyNode = ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode | ProcessedGroupingHierarchyNode;\n\n/**\n * A `ProcessedHierarchyNode` that has an unformatted label in a form of `ConcatenatedValue`. Generally this is\n * returned when the node is just parsed from query results.\n * @beta\n */\nexport type ParsedHierarchyNode<TBase = ParsedCustomHierarchyNode | ParsedInstanceHierarchyNode> = OmitOverUnion<TBase, \"label\" | \"parentKeys\"> & {\n label: string | ConcatenatedValue;\n};\n\n/**\n * A kind of `ProcessedCustomHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @beta\n */\nexport type ParsedCustomHierarchyNode = ParsedHierarchyNode<ProcessedCustomHierarchyNode>;\n\n/**\n * A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.\n * @beta\n */\nexport type ParsedInstanceHierarchyNode = ParsedHierarchyNode<ProcessedInstanceHierarchyNode>;\n"]}
|
|
1
|
+
{"version":3,"file":"HierarchyNode.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAIL,gBAAgB,GASjB,MAAM,oBAAoB,CAAC;AAoB5B,YAAY;AACZ,2DAA2D;AAC3D,MAAM,KAAW,2BAA2B,CAiB3C;AAjBD,WAAiB,2BAA2B;IAC1C,SAAgB,MAAM,CAAC,KAKtB;QACC,MAAM,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,cAAc,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;QAChH,IAAI,cAAc,IAAI,uBAAuB,IAAI,+BAA+B,EAAE,MAAM,EAAE,CAAC;YACzF,OAAO;gBACL,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACzE,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACtE,GAAG,CAAC,CAAC,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,+BAA+B,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;aACjG,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAfe,kCAAM,SAerB,CAAA;AACH,CAAC,EAjBgB,2BAA2B,KAA3B,2BAA2B,QAiB3C;AA2DD,YAAY;AACZ,2DAA2D;AAC3D,MAAM,KAAW,aAAa,CAqD7B;AArDD,WAAiB,aAAa;IAC5B,sDAAsD;IACtD,SAAgB,SAAS,CAA0C,IAAW;QAC5E,OAAO,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAFe,uBAAS,YAExB,CAAA;IACD,8EAA8E;IAC9E,SAAgB,YAAY,CAA0C,IAAW;QAC/E,OAAO,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAFe,0BAAY,eAE3B,CAAA;IACD,iEAAiE;IACjE,SAAgB,eAAe,CAA0C,IAAW;QAClF,OAAO,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAFe,6BAAe,kBAE9B,CAAA;IACD,uDAAuD;IACvD,SAAgB,cAAc,CAA0C,IAAW;QACjF,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAFe,4BAAc,iBAE7B,CAAA;IACD,6DAA6D;IAC7D,SAAgB,mBAAmB,CACjC,IAAW;QAEX,OAAO,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAJe,iCAAmB,sBAIlC,CAAA;IACD,6DAA6D;IAC7D,SAAgB,mBAAmB,CACjC,IAAW;QAEX,OAAO,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAJe,iCAAmB,sBAIlC,CAAA;IACD,gFAAgF;IAChF,SAAgB,iCAAiC,CAC/C,IAAW;QAEX,OAAO,gBAAgB,CAAC,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;IAJe,+CAAiC,oCAIhD,CAAA;IACD,sEAAsE;IACtE,SAAgB,2BAA2B,CACzC,IAAW;QAEX,OAAO,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;IAJe,yCAA2B,8BAI1C,CAAA;IACD,4EAA4E;IAC5E,SAAgB,gCAAgC,CAC9C,IAAW;QAEX,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAJe,8CAAgC,mCAI/C,CAAA;IACD,gEAAgE;IAChE,SAAgB,sBAAsB,CACpC,IAAW;QAEX,OAAO,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IAJe,oCAAsB,yBAIrC,CAAA;AACH,CAAC,EArDgB,aAAa,KAAb,aAAa,QAqD7B","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 { OmitOverUnion } from \"@itwin/presentation-shared\";\nimport { HierarchyFilteringPath, HierarchyFilteringPathOptions } from \"./HierarchyFiltering\";\nimport {\n ClassGroupingNodeKey,\n GenericNodeKey,\n GroupingNodeKey,\n HierarchyNodeKey,\n IModelHierarchyNodeKey,\n IModelInstanceKey,\n InstancesNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n} from \"./HierarchyNodeKey\";\n\n/** @beta */\nexport type HierarchyNodeFilteringProps = {\n /** If set to true, then one of the ancestor nodes in the hierarchy is the filter target. */\n hasFilterTargetAncestor?: boolean;\n /** Paths to node's children that are filter targets. */\n filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];\n} & (\n | {\n /** Whether or not this node is a filter target. */\n isFilterTarget?: false;\n }\n | {\n /** Whether or not this node is a filter target. */\n isFilterTarget: true;\n /** Options that were used to filter the node. */\n filterTargetOptions?: HierarchyFilteringPathOptions;\n }\n);\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeFilteringProps {\n export function create(props: {\n hasFilterTargetAncestor?: boolean;\n filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];\n isFilterTarget?: boolean;\n filterTargetOptions?: HierarchyFilteringPathOptions;\n }): HierarchyNodeFilteringProps | undefined {\n const { hasFilterTargetAncestor, filteredChildrenIdentifierPaths, isFilterTarget, filterTargetOptions } = props;\n if (isFilterTarget || hasFilterTargetAncestor || filteredChildrenIdentifierPaths?.length) {\n return {\n ...(isFilterTarget ? { isFilterTarget, filterTargetOptions } : undefined),\n ...(hasFilterTargetAncestor ? { hasFilterTargetAncestor } : undefined),\n ...(!!filteredChildrenIdentifierPaths?.length ? { filteredChildrenIdentifierPaths } : undefined),\n };\n }\n return undefined;\n }\n}\n\n/**\n * A data structure that defines attributes that are common to all types of hierarchy nodes.\n * @beta\n */\ninterface BaseHierarchyNode {\n /** Identifiers of all node ancestors. Can be used to identify a node in the hierarchy. */\n parentKeys: HierarchyNodeKey[];\n /** Node's display label. */\n label: string;\n /** A flag indicating whether the node has children or not. */\n children: boolean;\n /** A flag indicating whether this node should be auto-expanded in the UI. */\n autoExpand?: boolean;\n /** Additional data that may be assigned to this node. */\n extendedData?: { [key: string]: any };\n /** Data that may be assigned to the node if filtering is enabled */\n filtering?: HierarchyNodeFilteringProps;\n}\n\n/**\n * A data structure that represents a single non-grouping hierarchy node.\n * @beta\n */\nexport interface NonGroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify the node in its hierarchy level. */\n key: GenericNodeKey | InstancesNodeKey;\n /**\n * Identifies whether the hierarchy level below this node supports filtering. If not, supplying an instance\n * filter when requesting child hierarchy level will have no effect.\n */\n supportsFiltering?: boolean;\n}\n\n/**\n * A data structure that represents a grouping node that groups other nodes.\n * @beta\n */\nexport interface GroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify this grouping node in its hierarchy level. */\n key: GroupingNodeKey;\n\n /**\n * Keys of all instances grouped by this node, including deeply nested under\n * other grouping nodes.\n */\n groupedInstanceKeys: IModelInstanceKey[];\n\n /** The closest ancestor node that is not a grouping node. May be `undefined` if the grouping node grouped root level nodes. */\n nonGroupingAncestor?: ParentHierarchyNode<NonGroupingHierarchyNode>;\n}\n\n/**\n * A data structure that represents a single hierarchy node.\n * @beta\n */\nexport type HierarchyNode = NonGroupingHierarchyNode | GroupingHierarchyNode;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNode {\n /** Checks whether the given node is a generic node */\n export function isGeneric<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & NonGroupingHierarchyNode & { key: GenericNodeKey } {\n return HierarchyNodeKey.isGeneric(node.key);\n }\n /** Checks whether the given node is a standard (iModel content based) node */\n export function isIModelNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & { key: IModelHierarchyNodeKey } {\n return HierarchyNodeKey.isIModelNodeKey(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & NonGroupingHierarchyNode & { key: InstancesNodeKey } {\n return HierarchyNodeKey.isInstances(node.key);\n }\n /** Checks whether the given node is a grouping node */\n export function isGroupingNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & GroupingHierarchyNode {\n return HierarchyNodeKey.isGrouping(node.key);\n }\n /** Checks whether the given node is a class grouping node */\n export function isClassGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: ClassGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isClassGrouping(node.key);\n }\n /** Checks whether the given node is a label grouping node */\n export function isLabelGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: LabelGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isLabelGrouping(node.key);\n }\n /** Checks whether the given node is property grouping node for other values */\n export function isPropertyOtherValuesGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyOtherValuesGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isPropertyOtherValuesGrouping(node.key);\n }\n /** Checks whether the given node is a property value grouping node */\n export function isPropertyValueGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyValueGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isPropertyValueGrouping(node.key);\n }\n /** Checks whether the given node is a property value range grouping node */\n export function isPropertyValueRangeGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyValueRangeGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isPropertyValueRangeGrouping(node.key);\n }\n /** Checks whether the given node is a property grouping node */\n export function isPropertyGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isPropertyGrouping(node.key);\n }\n}\n\n/**\n * A type of `HierarchyNode` that doesn't know about its children and is an input when requesting\n * them using `HierarchyProvider.getNodes`.\n * @beta\n */\nexport type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, \"children\">;\n"]}
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GenericNodeKey, IModelInstanceKey } from "./HierarchyNodeKey";
|
|
2
2
|
/**
|
|
3
|
-
* An identifier that can be used to identify either an ECInstance or a
|
|
3
|
+
* An identifier that can be used to identify either an ECInstance or a generic node.
|
|
4
4
|
*
|
|
5
5
|
* This is different from `HierarchyNodeKey` - the key can represent more types of nodes and,
|
|
6
6
|
* in case of `InstancesNodeKey`, contains information about all instances the node represents.
|
|
7
7
|
* `HierarchyNodeIdentifier`, on the other hand, is used for matching a node, so it only needs
|
|
8
|
-
* to contain information about a single instance
|
|
8
|
+
* to contain information about a single instance.
|
|
9
9
|
*
|
|
10
10
|
* @beta
|
|
11
11
|
*/
|
|
12
|
-
export type HierarchyNodeIdentifier =
|
|
13
|
-
key: string;
|
|
14
|
-
};
|
|
12
|
+
export type HierarchyNodeIdentifier = IModelInstanceKey | GenericNodeKey;
|
|
15
13
|
/** @beta */
|
|
16
14
|
export declare namespace HierarchyNodeIdentifier {
|
|
17
15
|
/** Checks whether the given identifier is an instance node identifier */
|
|
18
|
-
function isInstanceNodeIdentifier(id: HierarchyNodeIdentifier): id is
|
|
19
|
-
/** Checks whether the given identifier is a
|
|
20
|
-
function
|
|
21
|
-
key: string;
|
|
22
|
-
};
|
|
16
|
+
function isInstanceNodeIdentifier(id: HierarchyNodeIdentifier): id is IModelInstanceKey;
|
|
17
|
+
/** Checks whether the given identifier is a generic node identifier */
|
|
18
|
+
function isGenericNodeIdentifier(id: HierarchyNodeIdentifier): id is GenericNodeKey;
|
|
23
19
|
/** Checks two identifiers for equality */
|
|
24
20
|
function equal(lhs: HierarchyNodeIdentifier, rhs: HierarchyNodeIdentifier): boolean;
|
|
25
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyNodeIdentifier.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HierarchyNodeIdentifier.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAEzE,YAAY;AAEZ,yBAAiB,uBAAuB,CAAC;IACvC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,iBAAiB,CAE7F;IAED,uEAAuE;IACvE,SAAgB,uBAAuB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,cAAc,CAEzF;IAED,0CAA0C;IAC1C,SAAgB,KAAK,CAAC,GAAG,EAAE,uBAAuB,EAAE,GAAG,EAAE,uBAAuB,WAQ/E;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,EAAE,CAAC"}
|
|
@@ -2,27 +2,28 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { InstanceKey } from "@itwin/presentation-shared";
|
|
5
6
|
/** @beta */
|
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
7
8
|
export var HierarchyNodeIdentifier;
|
|
8
9
|
(function (HierarchyNodeIdentifier) {
|
|
9
10
|
/** Checks whether the given identifier is an instance node identifier */
|
|
10
11
|
function isInstanceNodeIdentifier(id) {
|
|
11
|
-
return
|
|
12
|
+
return "className" in id;
|
|
12
13
|
}
|
|
13
14
|
HierarchyNodeIdentifier.isInstanceNodeIdentifier = isInstanceNodeIdentifier;
|
|
14
|
-
/** Checks whether the given identifier is a
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
/** Checks whether the given identifier is a generic node identifier */
|
|
16
|
+
function isGenericNodeIdentifier(id) {
|
|
17
|
+
return !isInstanceNodeIdentifier(id);
|
|
17
18
|
}
|
|
18
|
-
HierarchyNodeIdentifier.
|
|
19
|
+
HierarchyNodeIdentifier.isGenericNodeIdentifier = isGenericNodeIdentifier;
|
|
19
20
|
/** Checks two identifiers for equality */
|
|
20
21
|
function equal(lhs, rhs) {
|
|
21
22
|
if (isInstanceNodeIdentifier(lhs) && isInstanceNodeIdentifier(rhs)) {
|
|
22
|
-
return lhs
|
|
23
|
+
return InstanceKey.equals(lhs, rhs) && lhs.imodelKey === rhs.imodelKey;
|
|
23
24
|
}
|
|
24
|
-
if (
|
|
25
|
-
return lhs.
|
|
25
|
+
if (isGenericNodeIdentifier(lhs) && isGenericNodeIdentifier(rhs)) {
|
|
26
|
+
return lhs.source === rhs.source && lhs.id === rhs.id;
|
|
26
27
|
}
|
|
27
28
|
return false;
|
|
28
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyNodeIdentifier.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;
|
|
1
|
+
{"version":3,"file":"HierarchyNodeIdentifier.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAezD,YAAY;AACZ,2DAA2D;AAC3D,MAAM,KAAW,uBAAuB,CAqBvC;AArBD,WAAiB,uBAAuB;IACtC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAA2B;QAClE,OAAO,WAAW,IAAI,EAAE,CAAC;IAC3B,CAAC;IAFe,gDAAwB,2BAEvC,CAAA;IAED,uEAAuE;IACvE,SAAgB,uBAAuB,CAAC,EAA2B;QACjE,OAAO,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAFe,+CAAuB,0BAEtC,CAAA;IAED,0CAA0C;IAC1C,SAAgB,KAAK,CAAC,GAA4B,EAAE,GAA4B;QAC9E,IAAI,wBAAwB,CAAC,GAAG,CAAC,IAAI,wBAAwB,CAAC,GAAG,CAAC,EAAE,CAAC;YACnE,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,CAAC;QACzE,CAAC;QACD,IAAI,uBAAuB,CAAC,GAAG,CAAC,IAAI,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC;YACjE,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IARe,6BAAK,QAQpB,CAAA;AACH,CAAC,EArBgB,uBAAuB,KAAvB,uBAAuB,QAqBvC","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 { InstanceKey } from \"@itwin/presentation-shared\";\nimport { GenericNodeKey, IModelInstanceKey } from \"./HierarchyNodeKey\";\n\n/**\n * An identifier that can be used to identify either an ECInstance or a generic node.\n *\n * This is different from `HierarchyNodeKey` - the key can represent more types of nodes and,\n * in case of `InstancesNodeKey`, contains information about all instances the node represents.\n * `HierarchyNodeIdentifier`, on the other hand, is used for matching a node, so it only needs\n * to contain information about a single instance.\n *\n * @beta\n */\nexport type HierarchyNodeIdentifier = IModelInstanceKey | GenericNodeKey;\n\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeIdentifier {\n /** Checks whether the given identifier is an instance node identifier */\n export function isInstanceNodeIdentifier(id: HierarchyNodeIdentifier): id is IModelInstanceKey {\n return \"className\" in id;\n }\n\n /** Checks whether the given identifier is a generic node identifier */\n export function isGenericNodeIdentifier(id: HierarchyNodeIdentifier): id is GenericNodeKey {\n return !isInstanceNodeIdentifier(id);\n }\n\n /** Checks two identifiers for equality */\n export function equal(lhs: HierarchyNodeIdentifier, rhs: HierarchyNodeIdentifier) {\n if (isInstanceNodeIdentifier(lhs) && isInstanceNodeIdentifier(rhs)) {\n return InstanceKey.equals(lhs, rhs) && lhs.imodelKey === rhs.imodelKey;\n }\n if (isGenericNodeIdentifier(lhs) && isGenericNodeIdentifier(rhs)) {\n return lhs.source === rhs.source && lhs.id === rhs.id;\n }\n return false;\n }\n}\n\n/**\n * A path of hierarchy node identifiers, typically used to describe a path from root down\n * to specific node deep in the hierarchy.\n *\n * @beta\n */\nexport type HierarchyNodeIdentifiersPath = HierarchyNodeIdentifier[];\n"]}
|