@itwin/presentation-hierarchies 0.2.0 → 0.4.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.
Files changed (136) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +15 -11
  3. package/lib/cjs/hierarchies/HierarchyDefinition.d.ts +13 -2
  4. package/lib/cjs/hierarchies/HierarchyDefinition.d.ts.map +1 -1
  5. package/lib/cjs/hierarchies/HierarchyDefinition.js +2 -2
  6. package/lib/cjs/hierarchies/HierarchyDefinition.js.map +1 -1
  7. package/lib/cjs/hierarchies/HierarchyNode.d.ts +56 -14
  8. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
  9. package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
  10. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +25 -6
  11. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  12. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -1
  13. package/lib/cjs/hierarchies/HierarchyProvider.d.ts +13 -1
  14. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
  15. package/lib/cjs/hierarchies/HierarchyProvider.js +33 -19
  16. package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
  17. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +1 -1
  18. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js +33 -13
  19. package/lib/cjs/hierarchies/LimitingECSqlQueryExecutor.js.map +1 -1
  20. package/lib/cjs/hierarchies/Logging.js +2 -3
  21. package/lib/cjs/hierarchies/Logging.js.map +1 -1
  22. package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts +28 -4
  23. package/lib/cjs/hierarchies/NodeSelectQueryFactory.d.ts.map +1 -1
  24. package/lib/cjs/hierarchies/NodeSelectQueryFactory.js +9 -9
  25. package/lib/cjs/hierarchies/NodeSelectQueryFactory.js.map +1 -1
  26. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +1 -1
  27. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js +3 -3
  28. package/lib/cjs/hierarchies/internal/ChildNodeObservablesCache.js.map +1 -1
  29. package/lib/cjs/hierarchies/internal/Common.d.ts +25 -5
  30. package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -1
  31. package/lib/cjs/hierarchies/internal/Common.js +41 -21
  32. package/lib/cjs/hierarchies/internal/Common.js.map +1 -1
  33. package/lib/cjs/hierarchies/internal/EachValueFrom.js +1 -2
  34. package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +1 -1
  35. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts +5 -4
  36. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +1 -1
  37. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js +29 -24
  38. package/lib/cjs/hierarchies/internal/FilteringHierarchyDefinition.js.map +1 -1
  39. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts +1 -3
  40. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +1 -1
  41. package/lib/cjs/hierarchies/internal/LoggingUtils.js +2 -21
  42. package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +1 -1
  43. package/lib/cjs/hierarchies/internal/TreeNodesReader.js +2 -3
  44. package/lib/cjs/hierarchies/internal/TreeNodesReader.js.map +1 -1
  45. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.d.ts.map +1 -1
  46. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js +3 -3
  47. package/lib/cjs/hierarchies/internal/operators/DetermineChildren.js.map +1 -1
  48. package/lib/cjs/hierarchies/internal/operators/Grouping.d.ts.map +1 -1
  49. package/lib/cjs/hierarchies/internal/operators/Grouping.js +13 -12
  50. package/lib/cjs/hierarchies/internal/operators/Grouping.js.map +1 -1
  51. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +1 -1
  52. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js +3 -3
  53. package/lib/cjs/hierarchies/internal/operators/HideIfNoChildren.js.map +1 -1
  54. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +1 -1
  55. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js +3 -3
  56. package/lib/cjs/hierarchies/internal/operators/HideNodesInHierarchy.js.map +1 -1
  57. package/lib/cjs/hierarchies/internal/operators/Partition.js +1 -2
  58. package/lib/cjs/hierarchies/internal/operators/Partition.js.map +1 -1
  59. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -1
  60. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +2 -3
  61. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -1
  62. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -1
  63. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +1 -2
  64. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -1
  65. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +1 -2
  66. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -1
  67. package/lib/cjs/hierarchies/internal/operators/Sorting.js +1 -2
  68. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +1 -1
  69. package/lib/cjs/hierarchies/internal/operators/TapOnce.js +1 -2
  70. package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +1 -1
  71. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js +1 -2
  72. package/lib/cjs/hierarchies/internal/operators/grouping/AutoExpand.js.map +1 -1
  73. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js +3 -4
  74. package/lib/cjs/hierarchies/internal/operators/grouping/BaseClassGrouping.js.map +1 -1
  75. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js +1 -2
  76. package/lib/cjs/hierarchies/internal/operators/grouping/ClassGrouping.js.map +1 -1
  77. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js +1 -2
  78. package/lib/cjs/hierarchies/internal/operators/grouping/GroupHiding.js.map +1 -1
  79. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js +1 -2
  80. package/lib/cjs/hierarchies/internal/operators/grouping/LabelGrouping.js.map +1 -1
  81. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js +7 -8
  82. package/lib/cjs/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +1 -1
  83. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js +1 -2
  84. package/lib/cjs/hierarchies/internal/operators/grouping/Shared.js.map +1 -1
  85. package/lib/esm/hierarchies/HierarchyDefinition.d.ts +13 -2
  86. package/lib/esm/hierarchies/HierarchyDefinition.d.ts.map +1 -1
  87. package/lib/esm/hierarchies/HierarchyDefinition.js.map +1 -1
  88. package/lib/esm/hierarchies/HierarchyNode.d.ts +56 -14
  89. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
  90. package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
  91. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts +25 -6
  92. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  93. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -1
  94. package/lib/esm/hierarchies/HierarchyProvider.d.ts +13 -1
  95. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
  96. package/lib/esm/hierarchies/HierarchyProvider.js +34 -19
  97. package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
  98. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.d.ts.map +1 -1
  99. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js +35 -14
  100. package/lib/esm/hierarchies/LimitingECSqlQueryExecutor.js.map +1 -1
  101. package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts +28 -4
  102. package/lib/esm/hierarchies/NodeSelectQueryFactory.d.ts.map +1 -1
  103. package/lib/esm/hierarchies/NodeSelectQueryFactory.js +7 -7
  104. package/lib/esm/hierarchies/NodeSelectQueryFactory.js.map +1 -1
  105. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.d.ts.map +1 -1
  106. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js +3 -3
  107. package/lib/esm/hierarchies/internal/ChildNodeObservablesCache.js.map +1 -1
  108. package/lib/esm/hierarchies/internal/Common.d.ts +25 -5
  109. package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -1
  110. package/lib/esm/hierarchies/internal/Common.js +35 -15
  111. package/lib/esm/hierarchies/internal/Common.js.map +1 -1
  112. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts +5 -4
  113. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.d.ts.map +1 -1
  114. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js +27 -22
  115. package/lib/esm/hierarchies/internal/FilteringHierarchyDefinition.js.map +1 -1
  116. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +1 -3
  117. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +1 -1
  118. package/lib/esm/hierarchies/internal/LoggingUtils.js +0 -17
  119. package/lib/esm/hierarchies/internal/LoggingUtils.js.map +1 -1
  120. package/lib/esm/hierarchies/internal/operators/DetermineChildren.d.ts.map +1 -1
  121. package/lib/esm/hierarchies/internal/operators/DetermineChildren.js +2 -2
  122. package/lib/esm/hierarchies/internal/operators/DetermineChildren.js.map +1 -1
  123. package/lib/esm/hierarchies/internal/operators/Grouping.d.ts.map +1 -1
  124. package/lib/esm/hierarchies/internal/operators/Grouping.js +11 -10
  125. package/lib/esm/hierarchies/internal/operators/Grouping.js.map +1 -1
  126. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.d.ts.map +1 -1
  127. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js +2 -2
  128. package/lib/esm/hierarchies/internal/operators/HideIfNoChildren.js.map +1 -1
  129. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.d.ts.map +1 -1
  130. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js +2 -2
  131. package/lib/esm/hierarchies/internal/operators/HideNodesInHierarchy.js.map +1 -1
  132. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -1
  133. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -1
  134. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js +2 -2
  135. package/lib/esm/hierarchies/internal/operators/grouping/PropertiesGrouping.js.map +1 -1
  136. package/package.json +16 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @itwin/presentation-hierarchies
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#676](https://github.com/iTwin/presentation/pull/676): `createHierarchyProvider`: Added ability to specify whether hierarchy should be expanded to filtering path target, when specifying the `filtering.paths` prop.
8
+
9
+ With this change, hierarchy is no longer expanded to filter targets by default. To achieve the same behavior, paths with `autoExpand` option should be provided:
10
+
11
+ _Before:_
12
+
13
+ ```tsx
14
+ const hierarchyProvider = createHierarchyProvider({
15
+ imodelAccess,
16
+ hierarchyDefinition: createHierarchyDefinition(imodelAccess),
17
+ filtering: { paths: filterPaths },
18
+ });
19
+ ```
20
+
21
+ _Now:_
22
+
23
+ ```tsx
24
+ const hierarchyProvider = createHierarchyProvider({
25
+ imodelAccess,
26
+ hierarchyDefinition: createHierarchyDefinition(imodelAccess),
27
+ filtering: { paths: filterPaths.map((path) => ({ path, options: { autoExpand: true } })) },
28
+ });
29
+ ```
30
+
31
+ - [#672](https://github.com/iTwin/presentation/pull/672): Fix `autoExpand` prop of grouping specification for `NodesQueryClauseFactory.createSelectClause` being wrongly defined as `string`. Define it as a string union of `"always" | "single-child"`.
32
+
33
+ ### Patch Changes
34
+
35
+ - [#675](https://github.com/iTwin/presentation/pull/675): Fix nodes being erroneously set as filter targets when they had filter target siblings.
36
+ - [#672](https://github.com/iTwin/presentation/pull/672): Fix grouped nodes not being returned for "Not specified" property grouping node when grouping by value ranges.
37
+ - [#672](https://github.com/iTwin/presentation/pull/672): Fix hierarchy provider not returning all nodes in situations when internal cache is full and a prior request of grouped children was made.
38
+ - Updated dependencies:
39
+ - @itwin/presentation-shared@0.4.0
40
+
41
+ ## 0.3.0
42
+
43
+ ### Minor Changes
44
+
45
+ - [#665](https://github.com/iTwin/presentation/pull/665): Remove the option to specify `ecClassId` and `ecInstanceId` in `NodesQueryClauseFactory.createSelectClause` as `Id64String`. Now they can only be specified as a selector object, e.g. `{ selector: "this.ECClassId" }`. In case a static string is needed, the selector can return one.
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies:
50
+ - @itwin/presentation-shared@0.3.2
51
+
3
52
  ## 0.2.0
4
53
 
5
54
  ### Minor Changes
package/README.md CHANGED
@@ -57,6 +57,9 @@ In iTwin.js, the most common way to create hierarchies is based on EC data (sche
57
57
 
58
58
  Here's a simple example of how to create a hierarchy provider and build a hierarchy of Models and their Elements, with the latter grouped by class:
59
59
 
60
+ <!-- [[include: Presentation.Hierarchies.Readme.BasicExample, ts]] -->
61
+ <!-- BEGIN EXTRACTION -->
62
+
60
63
  ```ts
61
64
  import { IModelConnection } from "@itwin/core-frontend";
62
65
  import { SchemaContext } from "@itwin/ecschema-metadata";
@@ -93,9 +96,9 @@ function createProvider(imodel: IModelConnection): HierarchyProvider {
93
96
  const schemaProvider = createECSchemaProvider(getIModelSchemaContext(imodel));
94
97
  const imodelAccess = {
95
98
  ...schemaProvider,
96
- // while caching for hierarchy inspector is not mandatory, it's recommended to use it to improve performance
99
+ // While caching for hierarchy inspector is not mandatory, it's recommended to use it to improve performance
97
100
  ...createCachingECClassHierarchyInspector({ schemaProvider, cacheSize: 100 }),
98
- // the second argument is the maximum number of rows the executor will return - this allows us to
101
+ // The second argument is the maximum number of rows the executor will return - this allows us to
99
102
  // avoid creating hierarchy levels of insane size (expensive to us and useless to users)
100
103
  ...createLimitingECSqlQueryExecutor(createECSqlQueryExecutor(imodel), 1000),
101
104
  };
@@ -109,10 +112,10 @@ function createProvider(imodel: IModelConnection): HierarchyProvider {
109
112
  const hierarchyDefinition = createClassBasedHierarchyDefinition({
110
113
  classHierarchyInspector: imodelAccess,
111
114
  hierarchy: {
112
- // for root nodes, select all root level bis.Model instances
115
+ // For root nodes, select all BisCore.GeometricModel3d instances
113
116
  rootNodes: async () => [
114
117
  {
115
- fullClassName: "BisCore.Model",
118
+ fullClassName: "BisCore.GeometricModel3d",
116
119
  query: {
117
120
  ecsql: `
118
121
  SELECT
@@ -120,18 +123,17 @@ function createProvider(imodel: IModelConnection): HierarchyProvider {
120
123
  ecClassId: { selector: "this.ECClassId" },
121
124
  ecInstanceId: { selector: "this.ECInstanceId" },
122
125
  nodeLabel: {
123
- selector: await labelsQueryFactory.createSelectClause({ classAlias: "this", className: "BisCore.Model" }),
126
+ selector: await labelsQueryFactory.createSelectClause({ classAlias: "this", className: "BisCore.GeometricModel3d" }),
124
127
  },
125
128
  })}
126
- FROM BisCore.Model this
127
- WHERE this.ParentModel IS NULL
129
+ FROM BisCore.GeometricModel3d this
128
130
  `,
129
131
  },
130
132
  },
131
133
  ],
132
134
  childNodes: [
133
135
  {
134
- // for bis.Model parent nodes, select all bis.Element instances contained in corresponding model
136
+ // For BisCore.Model parent nodes, select all BisCore.Element instances contained in corresponding model
135
137
  parentNodeClassName: "BisCore.Model",
136
138
  definitions: async ({ parentNodeInstanceIds }: DefineInstanceNodeChildHierarchyLevelProps) => [
137
139
  {
@@ -166,13 +168,15 @@ function createProvider(imodel: IModelConnection): HierarchyProvider {
166
168
  }
167
169
 
168
170
  async function main() {
169
- const provider = createProvider(/* pass your IModelConnection here */);
171
+ const provider = createProvider(await getIModelConnection());
170
172
  async function loadBranch(parentNode: HierarchyNode | undefined, indent: number = 0) {
171
173
  for await (const node of provider.getNodes({ parentNode })) {
172
- console.log(`${new Array(indent + 1).join(" ")} ${node.label}`);
173
- await loadBranch(node);
174
+ console.log(`${new Array(indent * 2 + 1).join(" ")}${node.label}`);
175
+ await loadBranch(node, indent + 1);
174
176
  }
175
177
  }
176
178
  await loadBranch(undefined);
177
179
  }
178
180
  ```
181
+
182
+ <!-- END EXTRACTION -->
@@ -3,12 +3,18 @@ import { GenericInstanceFilter } from "@itwin/core-common";
3
3
  import { ECClassHierarchyInspector, ECSqlQueryDef } from "@itwin/presentation-shared";
4
4
  import { NonGroupingHierarchyNode, ParsedCustomHierarchyNode, ParsedInstanceHierarchyNode, ProcessedCustomHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode } from "./HierarchyNode";
5
5
  import { InstancesNodeKey } from "./HierarchyNodeKey";
6
- /** A nodes definition that returns a single custom defined node. */
6
+ /**
7
+ * A nodes definition that returns a single custom defined node.
8
+ * @beta
9
+ */
7
10
  export interface CustomHierarchyNodeDefinition {
8
11
  /** The node to be created in the hierarchy level */
9
12
  node: ParsedCustomHierarchyNode;
10
13
  }
11
- /** A nodes definition that returns an ECSQL query for selecting nodes from an iModel. */
14
+ /**
15
+ * A nodes definition that returns an ECSQL query for selecting nodes from an iModel.
16
+ * @beta
17
+ */
12
18
  export interface InstanceNodesQueryDefinition {
13
19
  /**
14
20
  * Full name of the class whose instances are going to be returned. It's okay if the attribute
@@ -64,6 +70,7 @@ export type NodePostProcessor = (node: ProcessedHierarchyNode) => Promise<Proces
64
70
  * a `HierarchyNode` that:
65
71
  * - knows nothing about its children,
66
72
  * - is either an instances node (key is of `InstancesNodeKey` type) or a custom node (key is of `string` type).
73
+ * @beta
67
74
  */
68
75
  type HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, "children">;
69
76
  /**
@@ -143,6 +150,7 @@ export type DefineInstanceNodeChildHierarchyLevelProps = Omit<DefineHierarchyLev
143
150
  };
144
151
  /**
145
152
  * A definition of a hierarchy level that should be used for specific class of parent instance nodes.
153
+ * @beta
146
154
  */
147
155
  interface InstancesNodeChildHierarchyLevelDefinition {
148
156
  /**
@@ -189,6 +197,7 @@ export type DefineCustomNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevel
189
197
  };
190
198
  /**
191
199
  * A definition of a hierarchy level for that should be used for specific custom parent nodes.
200
+ * @beta
192
201
  */
193
202
  interface CustomNodeChildHierarchyLevelDefinition {
194
203
  /**
@@ -203,6 +212,7 @@ interface CustomNodeChildHierarchyLevelDefinition {
203
212
  /**
204
213
  * A hierarchy level definition associated with either parent instance node's class or custom
205
214
  * node's key.
215
+ * @beta
206
216
  */
207
217
  type ClassBasedHierarchyLevelDefinition = InstancesNodeChildHierarchyLevelDefinition | CustomNodeChildHierarchyLevelDefinition;
208
218
  /**
@@ -213,6 +223,7 @@ type ClassBasedHierarchyLevelDefinition = InstancesNodeChildHierarchyLevelDefini
213
223
  export type DefineRootHierarchyLevelProps = Omit<DefineHierarchyLevelProps, "parentNode">;
214
224
  /**
215
225
  * Props for `createClassBasedHierarchyDefinition`.
226
+ * @beta
216
227
  */
217
228
  interface ClassBasedHierarchyDefinitionProps {
218
229
  /** Access to ECClass hierarchy in the iModel */
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAe,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAEL,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,oEAAoE;AACpE,MAAM,WAAW,6BAA6B;IA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AE,YAAY,CAAC,CAAC;AAE1F;;;GAGG;AACH,UAAU,kCAAkC;IAC1C,gDAAgD;IAChD,uBAAuB,EAAE,yBAAyB,CAAC;IAEnD,8FAA8F;IAC9F,SAAS,EAAE;QACT,4DAA4D;QAC5D,SAAS,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;QAEvF;;;WAGG;QACH,UAAU,EAAE,kCAAkC,EAAE,CAAC;KAClD,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,kCAAkC,GAAG,mBAAmB,CAElH"}
@@ -4,7 +4,8 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createClassBasedHierarchyDefinition = exports.HierarchyNodesDefinition = void 0;
7
+ exports.HierarchyNodesDefinition = void 0;
8
+ exports.createClassBasedHierarchyDefinition = createClassBasedHierarchyDefinition;
8
9
  const HierarchyNode_1 = require("./HierarchyNode");
9
10
  const rxjs_1 = require("rxjs");
10
11
  /** @beta */
@@ -30,7 +31,6 @@ var HierarchyNodesDefinition;
30
31
  function createClassBasedHierarchyDefinition(props) {
31
32
  return new ClassBasedHierarchyDefinition(props);
32
33
  }
33
- exports.createClassBasedHierarchyDefinition = createClassBasedHierarchyDefinition;
34
34
  class ClassBasedHierarchyDefinition {
35
35
  _props;
36
36
  constructor(_props) {
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyDefinition.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAKhG,mDAQyB;AAEzB,+BAA4F;AA4B5F,YAAY;AACZ,2DAA2D;AAC3D,IAAiB,wBAAwB,CAOxC;AAPD,WAAiB,wBAAwB;IACvC,SAAgB,YAAY,CAAC,GAA6B;QACxD,OAAO,CAAC,CAAE,GAAqC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------------------------------------------------------------------------------------------\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 { Id64String } from \"@itwin/core-bentley\";\nimport { GenericInstanceFilter } from \"@itwin/core-common\";\nimport { ECClassHierarchyInspector, ECSqlQueryDef, InstanceKey } from \"@itwin/presentation-shared\";\nimport {\n HierarchyNode,\n NonGroupingHierarchyNode,\n ParsedCustomHierarchyNode,\n ParsedInstanceHierarchyNode,\n ProcessedCustomHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n} from \"./HierarchyNode\";\nimport { InstancesNodeKey } from \"./HierarchyNodeKey\";\nimport { concatMap, filter, firstValueFrom, from, mergeAll, mergeMap, toArray } from \"rxjs\";\n\n/** A nodes definition that returns a single custom defined node. */\nexport interface CustomHierarchyNodeDefinition {\n /** The node to be created in the hierarchy level */\n node: ParsedCustomHierarchyNode;\n}\n\n/** A nodes definition that returns an ECSQL query for selecting nodes from an iModel. */\nexport interface InstanceNodesQueryDefinition {\n /**\n * Full name of the class whose instances are going to be returned. It's okay if the attribute\n * points to a base class of multiple different classes of instances returned by the query, however\n * the more specific this class is, the more efficient hierarchy building process is.\n */\n fullClassName: string;\n /**\n * An ECSQL query that selects nodes from an iModel. `SELECT` clause of the query is expected\n * to be built using `NodeSelectQueryFactory.createSelectClause`.\n */\n query: ECSqlQueryDef;\n}\n\n/**\n * A definition of nodes included in a hierarchy level.\n * @beta\n */\nexport type HierarchyNodesDefinition = CustomHierarchyNodeDefinition | InstanceNodesQueryDefinition;\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodesDefinition {\n export function isCustomNode(def: HierarchyNodesDefinition): def is CustomHierarchyNodeDefinition {\n return !!(def as CustomHierarchyNodeDefinition).node;\n }\n export function isInstanceNodesQuery(def: HierarchyNodesDefinition): def is InstanceNodesQueryDefinition {\n return !!(def as InstanceNodesQueryDefinition).query;\n }\n}\n\n/**\n * A definition of a hierarchy level, which may consist of multiple node definitions.\n * @beta\n */\nexport type HierarchyLevelDefinition = HierarchyNodesDefinition[];\n\n/**\n * A type for a function that parses a `ParsedInstanceHierarchyNode` from provided ECSQL `row` object.\n * @beta\n */\nexport type NodeParser = (row: { [columnName: string]: any }) => ParsedInstanceHierarchyNode;\n\n/**\n * A type for a function that pre-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one. Returning `undefined` omits the node\n * from the hierarchy.\n *\n * @beta\n */\nexport type NodePreProcessor = <TNode extends ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode>(node: TNode) => Promise<TNode | undefined>;\n\n/**\n * A type for a function that post-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one.\n *\n * @beta\n */\nexport type NodePostProcessor = (node: ProcessedHierarchyNode) => Promise<ProcessedHierarchyNode>;\n\n/**\n * A type of node that can be passed to `HierarchyDefinition.defineHierarchyLevel`. This basically means\n * a `HierarchyNode` that:\n * - knows nothing about its children,\n * - is either an instances node (key is of `InstancesNodeKey` type) or a custom node (key is of `string` type).\n */\ntype HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, \"children\">;\n\n/**\n * Props for `HierarchyDefinition.defineHierarchyLevel`.\n * @beta\n */\nexport interface DefineHierarchyLevelProps {\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: HierarchyDefinitionParentNode | undefined;\n\n /** Optional hierarchy level filter. */\n instanceFilter?: GenericInstanceFilter;\n}\n\n/**\n * An interface for a factory that knows how define a hierarchy based on a given parent node.\n * @beta\n */\nexport interface HierarchyDefinition {\n /**\n * An optional function for parsing ECInstance node from ECSQL row.\n *\n * Should be used in situations when the `HierarchyDefinition` implementation\n * introduces additional ECSQL columns into the select clause and wants to assign additional\n * data to the nodes it produces.\n *\n * Defaults to a function that parses all `HierarchyNode` attributes from a query, whose SELECT\n * clause is created using `NodeSelectQueryFactory.createSelectClause`.\n */\n parseNode?: NodeParser;\n\n /**\n * An optional function for pre-processing nodes.\n *\n * Pre-processing happens immediately after the nodes are loaded based on `HierarchyLevelDefinition`\n * returned by this `HierarchyDefinition` and before their processing (hiding, grouping, sorting, etc.) starts.\n * The step allows assigning nodes additional data or excluding them from the hierarchy based on some attributes.\n */\n preProcessNode?: NodePreProcessor;\n\n /**\n * An optional function for post-processing nodes.\n *\n * Post-processing happens after the loaded nodes go through all the merging, hiding and grouping\n * steps, but before sorting them. This step allows `HierarchyDefinition` implementations to assign additional data\n * to nodes after they're processed. This is especially true for grouping nodes as they're only created during\n * processing.\n */\n postProcessNode?: NodePostProcessor;\n\n /** A function to create a hierarchy level definition for given parent node. */\n defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition>;\n}\n\n/**\n * Props for defining child hierarchy level for specific parent instance node.\n * @see `createClassBasedHierarchyDefinition`\n * @beta\n */\nexport type DefineInstanceNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\"> & {\n /** The parent instance node. */\n parentNode: Omit<HierarchyDefinitionParentNode, \"key\"> & { key: InstancesNodeKey };\n\n /**\n * Full name of the parent instance node class.\n *\n * The `parentNode.key` also contains information about the instances the parent node is based on. However,\n * an instance node may be based on instances of multiple classes. In case that happens, parent node's instance\n * keys are grouped by class and a hierarchy level definition is requested for each combination of class and\n * instance IDs (with the same `parentNode`).\n */\n parentNodeClassName: string;\n\n /**\n * ECInstanceIds of the parent instance node.\n *\n * The `parentNode.key` also contains information about the instances the parent node is based on. However,\n * an instance node may be based on instances of multiple classes. In case that happens, parent node's instance\n * keys are grouped by class and a hierarchy level definition is requested for each combination of class and\n * instance IDs (with the same `parentNode`).\n */\n parentNodeInstanceIds: Id64String[];\n};\n\n/**\n * A definition of a hierarchy level that should be used for specific class of parent instance nodes.\n */\ninterface InstancesNodeChildHierarchyLevelDefinition {\n /**\n * Full name of the parent instance node's class to match against when checking if this hierarchy\n * level should be used for specific parent instance node.\n *\n * The check is polymorphic, so `BisCore.Element` class would match `BisCore.GeometricElement`, `BisCore.Category` and\n * all other element classes.\n */\n parentNodeClassName: string;\n\n /**\n * Called to create a hierarchy level definition when the class check passes (see `parentNodeClassName`).\n */\n definitions: (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n\n /**\n * If set to true, and node matches at least one of the previous definitions, this definition will not be applied.\n *\n * For example:\n * ```ts\n * {\n * parentNodeClassName: \"BisCore.GeometricElement3d\",\n * definitions: () => ...,\n * },\n * // This will apply to all elements, that are not BisCore.GeometricElement3d\n * {\n * parentNodeClassName: \"BisCore.Element\",\n * onlyIfNotHandled: true,\n * definitions: () => ...,\n * }\n * ```\n */\n onlyIfNotHandled?: boolean;\n}\n\n/**\n * Props for defining child hierarchy level for specific parent custom node.\n * @see `createClassBasedHierarchyDefinition`\n * @beta\n */\nexport type DefineCustomNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\"> & {\n /** The parent custom node. */\n parentNode: Omit<HierarchyDefinitionParentNode, \"key\"> & { key: string };\n};\n\n/**\n * A definition of a hierarchy level for that should be used for specific custom parent nodes.\n */\ninterface CustomNodeChildHierarchyLevelDefinition {\n /**\n * `HierarchyNode.key` of the custom node that this child hierarchy level definition should be used for.\n */\n customParentNodeKey: string;\n\n /**\n * Called to create a hierarchy level definition when the node key check passes (see `customParentNodeKey`).\n */\n definitions: (requestProps: DefineCustomNodeChildHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n}\n\n/**\n * A hierarchy level definition associated with either parent instance node's class or custom\n * node's key.\n */\ntype ClassBasedHierarchyLevelDefinition = InstancesNodeChildHierarchyLevelDefinition | CustomNodeChildHierarchyLevelDefinition;\n\n/**\n * Props for defining root hierarchy level.\n * @see `createClassBasedHierarchyDefinition`\n * @beta\n */\nexport type DefineRootHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\">;\n\n/**\n * Props for `createClassBasedHierarchyDefinition`.\n */\ninterface ClassBasedHierarchyDefinitionProps {\n /** Access to ECClass hierarchy in the iModel */\n classHierarchyInspector: ECClassHierarchyInspector;\n\n /** Hierarchy level definitions based on parent instance node's class or custom node's key. */\n hierarchy: {\n /** Called to create the root hierarchy level definition. */\n rootNodes: (props: DefineRootHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n\n /**\n * Called to get child hierarchy level definitions based on parent instance node's class\n * or custom node's key.\n */\n childNodes: ClassBasedHierarchyLevelDefinition[];\n };\n}\n\n/**\n * Creates an instance of `HierarchyDefinition` that uses a somewhat declarative approach to define the\n * hierarchy - each hierarchy level is assigned either an instance node's class or custom node's\n * key and they're used to assign hierarchy level definitions based on parent node.\n *\n * @beta\n */\nexport function createClassBasedHierarchyDefinition(props: ClassBasedHierarchyDefinitionProps): HierarchyDefinition {\n return new ClassBasedHierarchyDefinition(props);\n}\n\nclass ClassBasedHierarchyDefinition implements HierarchyDefinition {\n public constructor(private _props: ClassBasedHierarchyDefinitionProps) {}\n\n /**\n * Create hierarchy level definitions for specific hierarchy level.\n * @param parentNode Parent node to create children definitions for.\n */\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const { parentNode } = props;\n if (!parentNode) {\n return this._props.hierarchy.rootNodes(props);\n }\n\n if (HierarchyNode.isCustom(parentNode)) {\n const defs = this._props.hierarchy.childNodes\n .filter(isCustomNodeChildHierarchyLevelDefinition)\n .filter((def) => def.customParentNodeKey === parentNode.key);\n return (await Promise.all(defs.map(async (def) => def.definitions({ ...props, parentNode })))).flat();\n }\n\n // istanbul ignore else\n if (HierarchyNode.isInstancesNode(parentNode)) {\n const instanceIdsByClass = groupInstanceIdsByClass(parentNode.key.instanceKeys);\n const instancesParentNodeDefs = this._props.hierarchy.childNodes.filter(isInstancesNodeChildHierarchyLevelDefinition);\n return (\n await Promise.all(\n [...instanceIdsByClass.entries()].map(async ([parentNodeClassName, parentNodeInstanceIds]) =>\n createHierarchyLevelDefinitions(this._props.classHierarchyInspector, instancesParentNodeDefs, {\n ...props,\n parentNodeClassName,\n parentNodeInstanceIds,\n parentNode,\n }),\n ),\n )\n ).flat();\n }\n\n // istanbul ignore next\n return [];\n }\n}\n\nasync function createHierarchyLevelDefinitions(\n classHierarchy: ECClassHierarchyInspector,\n defs: InstancesNodeChildHierarchyLevelDefinition[],\n requestProps: DefineInstanceNodeChildHierarchyLevelProps,\n) {\n const obs = from(defs).pipe(\n mergeMap(async (def, idx) => {\n if (await classHierarchy.classDerivesFrom(requestProps.parentNodeClassName, def.parentNodeClassName)) {\n return { def, idx };\n }\n return undefined;\n }),\n filter((x): x is Exclude<typeof x, undefined> => !!x),\n toArray(),\n concatMap((x) => x.sort((a, b) => a.idx - b.idx).map(({ def }) => def)),\n filter((def, idx) => !def.onlyIfNotHandled || idx === 0),\n mergeMap(async (def) => def.definitions(requestProps)),\n mergeAll(),\n );\n return firstValueFrom(obs.pipe(toArray()));\n}\n\nfunction groupInstanceIdsByClass(instanceKeys: InstanceKey[]) {\n const instanceIdsByClass = new Map<string, Id64String[]>();\n instanceKeys.forEach((key) => {\n let instanceIds = instanceIdsByClass.get(key.className);\n if (!instanceIds) {\n instanceIds = [];\n instanceIdsByClass.set(key.className, instanceIds);\n }\n instanceIds.push(key.id);\n });\n return instanceIdsByClass;\n}\n\nfunction isCustomNodeChildHierarchyLevelDefinition(def: ClassBasedHierarchyLevelDefinition): def is CustomNodeChildHierarchyLevelDefinition {\n return !!(def as CustomNodeChildHierarchyLevelDefinition).customParentNodeKey;\n}\n\nfunction isInstancesNodeChildHierarchyLevelDefinition(def: ClassBasedHierarchyLevelDefinition): def is InstancesNodeChildHierarchyLevelDefinition {\n return !!(def as InstancesNodeChildHierarchyLevelDefinition).parentNodeClassName;\n}\n"]}
1
+ {"version":3,"file":"HierarchyDefinition.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA+RhG,kFAEC;AA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AC,CAAE,GAA+C,CAAC,mBAAmB,CAAC;AAChF,CAAC;AAED,SAAS,4CAA4C,CAAC,GAAuC;IAC3F,OAAO,CAAC,CAAE,GAAkD,CAAC,mBAAmB,CAAC;AACnF,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 { Id64String } from \"@itwin/core-bentley\";\nimport { GenericInstanceFilter } from \"@itwin/core-common\";\nimport { ECClassHierarchyInspector, ECSqlQueryDef, InstanceKey } from \"@itwin/presentation-shared\";\nimport {\n HierarchyNode,\n NonGroupingHierarchyNode,\n ParsedCustomHierarchyNode,\n ParsedInstanceHierarchyNode,\n ProcessedCustomHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n} from \"./HierarchyNode\";\nimport { InstancesNodeKey } from \"./HierarchyNodeKey\";\nimport { concatMap, filter, firstValueFrom, from, mergeAll, mergeMap, toArray } from \"rxjs\";\n\n/**\n * A nodes definition that returns a single custom defined node.\n * @beta\n */\nexport interface CustomHierarchyNodeDefinition {\n /** The node to be created in the hierarchy level */\n node: ParsedCustomHierarchyNode;\n}\n\n/**\n * A nodes definition that returns an ECSQL query for selecting nodes from an iModel.\n * @beta\n */\nexport interface InstanceNodesQueryDefinition {\n /**\n * Full name of the class whose instances are going to be returned. It's okay if the attribute\n * points to a base class of multiple different classes of instances returned by the query, however\n * the more specific this class is, the more efficient hierarchy building process is.\n */\n fullClassName: string;\n /**\n * An ECSQL query that selects nodes from an iModel. `SELECT` clause of the query is expected\n * to be built using `NodeSelectQueryFactory.createSelectClause`.\n */\n query: ECSqlQueryDef;\n}\n\n/**\n * A definition of nodes included in a hierarchy level.\n * @beta\n */\nexport type HierarchyNodesDefinition = CustomHierarchyNodeDefinition | InstanceNodesQueryDefinition;\n/** @beta */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodesDefinition {\n export function isCustomNode(def: HierarchyNodesDefinition): def is CustomHierarchyNodeDefinition {\n return !!(def as CustomHierarchyNodeDefinition).node;\n }\n export function isInstanceNodesQuery(def: HierarchyNodesDefinition): def is InstanceNodesQueryDefinition {\n return !!(def as InstanceNodesQueryDefinition).query;\n }\n}\n\n/**\n * A definition of a hierarchy level, which may consist of multiple node definitions.\n * @beta\n */\nexport type HierarchyLevelDefinition = HierarchyNodesDefinition[];\n\n/**\n * A type for a function that parses a `ParsedInstanceHierarchyNode` from provided ECSQL `row` object.\n * @beta\n */\nexport type NodeParser = (row: { [columnName: string]: any }) => ParsedInstanceHierarchyNode;\n\n/**\n * A type for a function that pre-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one. Returning `undefined` omits the node\n * from the hierarchy.\n *\n * @beta\n */\nexport type NodePreProcessor = <TNode extends ProcessedCustomHierarchyNode | ProcessedInstanceHierarchyNode>(node: TNode) => Promise<TNode | undefined>;\n\n/**\n * A type for a function that post-processes given node. Unless the function decides not to make any modifications,\n * it should return a new - modified - node, rather than modifying the given one.\n *\n * @beta\n */\nexport type NodePostProcessor = (node: ProcessedHierarchyNode) => Promise<ProcessedHierarchyNode>;\n\n/**\n * A type of node that can be passed to `HierarchyDefinition.defineHierarchyLevel`. This basically means\n * a `HierarchyNode` that:\n * - knows nothing about its children,\n * - is either an instances node (key is of `InstancesNodeKey` type) or a custom node (key is of `string` type).\n * @beta\n */\ntype HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, \"children\">;\n\n/**\n * Props for `HierarchyDefinition.defineHierarchyLevel`.\n * @beta\n */\nexport interface DefineHierarchyLevelProps {\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: HierarchyDefinitionParentNode | undefined;\n\n /** Optional hierarchy level filter. */\n instanceFilter?: GenericInstanceFilter;\n}\n\n/**\n * An interface for a factory that knows how define a hierarchy based on a given parent node.\n * @beta\n */\nexport interface HierarchyDefinition {\n /**\n * An optional function for parsing ECInstance node from ECSQL row.\n *\n * Should be used in situations when the `HierarchyDefinition` implementation\n * introduces additional ECSQL columns into the select clause and wants to assign additional\n * data to the nodes it produces.\n *\n * Defaults to a function that parses all `HierarchyNode` attributes from a query, whose SELECT\n * clause is created using `NodeSelectQueryFactory.createSelectClause`.\n */\n parseNode?: NodeParser;\n\n /**\n * An optional function for pre-processing nodes.\n *\n * Pre-processing happens immediately after the nodes are loaded based on `HierarchyLevelDefinition`\n * returned by this `HierarchyDefinition` and before their processing (hiding, grouping, sorting, etc.) starts.\n * The step allows assigning nodes additional data or excluding them from the hierarchy based on some attributes.\n */\n preProcessNode?: NodePreProcessor;\n\n /**\n * An optional function for post-processing nodes.\n *\n * Post-processing happens after the loaded nodes go through all the merging, hiding and grouping\n * steps, but before sorting them. This step allows `HierarchyDefinition` implementations to assign additional data\n * to nodes after they're processed. This is especially true for grouping nodes as they're only created during\n * processing.\n */\n postProcessNode?: NodePostProcessor;\n\n /** A function to create a hierarchy level definition for given parent node. */\n defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition>;\n}\n\n/**\n * Props for defining child hierarchy level for specific parent instance node.\n * @see `createClassBasedHierarchyDefinition`\n * @beta\n */\nexport type DefineInstanceNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\"> & {\n /** The parent instance node. */\n parentNode: Omit<HierarchyDefinitionParentNode, \"key\"> & { key: InstancesNodeKey };\n\n /**\n * Full name of the parent instance node class.\n *\n * The `parentNode.key` also contains information about the instances the parent node is based on. However,\n * an instance node may be based on instances of multiple classes. In case that happens, parent node's instance\n * keys are grouped by class and a hierarchy level definition is requested for each combination of class and\n * instance IDs (with the same `parentNode`).\n */\n parentNodeClassName: string;\n\n /**\n * ECInstanceIds of the parent instance node.\n *\n * The `parentNode.key` also contains information about the instances the parent node is based on. However,\n * an instance node may be based on instances of multiple classes. In case that happens, parent node's instance\n * keys are grouped by class and a hierarchy level definition is requested for each combination of class and\n * instance IDs (with the same `parentNode`).\n */\n parentNodeInstanceIds: Id64String[];\n};\n\n/**\n * A definition of a hierarchy level that should be used for specific class of parent instance nodes.\n * @beta\n */\ninterface InstancesNodeChildHierarchyLevelDefinition {\n /**\n * Full name of the parent instance node's class to match against when checking if this hierarchy\n * level should be used for specific parent instance node.\n *\n * The check is polymorphic, so `BisCore.Element` class would match `BisCore.GeometricElement`, `BisCore.Category` and\n * all other element classes.\n */\n parentNodeClassName: string;\n\n /**\n * Called to create a hierarchy level definition when the class check passes (see `parentNodeClassName`).\n */\n definitions: (requestProps: DefineInstanceNodeChildHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n\n /**\n * If set to true, and node matches at least one of the previous definitions, this definition will not be applied.\n *\n * For example:\n * ```ts\n * {\n * parentNodeClassName: \"BisCore.GeometricElement3d\",\n * definitions: () => ...,\n * },\n * // This will apply to all elements, that are not BisCore.GeometricElement3d\n * {\n * parentNodeClassName: \"BisCore.Element\",\n * onlyIfNotHandled: true,\n * definitions: () => ...,\n * }\n * ```\n */\n onlyIfNotHandled?: boolean;\n}\n\n/**\n * Props for defining child hierarchy level for specific parent custom node.\n * @see `createClassBasedHierarchyDefinition`\n * @beta\n */\nexport type DefineCustomNodeChildHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\"> & {\n /** The parent custom node. */\n parentNode: Omit<HierarchyDefinitionParentNode, \"key\"> & { key: string };\n};\n\n/**\n * A definition of a hierarchy level for that should be used for specific custom parent nodes.\n * @beta\n */\ninterface CustomNodeChildHierarchyLevelDefinition {\n /**\n * `HierarchyNode.key` of the custom node that this child hierarchy level definition should be used for.\n */\n customParentNodeKey: string;\n\n /**\n * Called to create a hierarchy level definition when the node key check passes (see `customParentNodeKey`).\n */\n definitions: (requestProps: DefineCustomNodeChildHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n}\n\n/**\n * A hierarchy level definition associated with either parent instance node's class or custom\n * node's key.\n * @beta\n */\ntype ClassBasedHierarchyLevelDefinition = InstancesNodeChildHierarchyLevelDefinition | CustomNodeChildHierarchyLevelDefinition;\n\n/**\n * Props for defining root hierarchy level.\n * @see `createClassBasedHierarchyDefinition`\n * @beta\n */\nexport type DefineRootHierarchyLevelProps = Omit<DefineHierarchyLevelProps, \"parentNode\">;\n\n/**\n * Props for `createClassBasedHierarchyDefinition`.\n * @beta\n */\ninterface ClassBasedHierarchyDefinitionProps {\n /** Access to ECClass hierarchy in the iModel */\n classHierarchyInspector: ECClassHierarchyInspector;\n\n /** Hierarchy level definitions based on parent instance node's class or custom node's key. */\n hierarchy: {\n /** Called to create the root hierarchy level definition. */\n rootNodes: (props: DefineRootHierarchyLevelProps) => Promise<HierarchyLevelDefinition>;\n\n /**\n * Called to get child hierarchy level definitions based on parent instance node's class\n * or custom node's key.\n */\n childNodes: ClassBasedHierarchyLevelDefinition[];\n };\n}\n\n/**\n * Creates an instance of `HierarchyDefinition` that uses a somewhat declarative approach to define the\n * hierarchy - each hierarchy level is assigned either an instance node's class or custom node's\n * key and they're used to assign hierarchy level definitions based on parent node.\n *\n * @beta\n */\nexport function createClassBasedHierarchyDefinition(props: ClassBasedHierarchyDefinitionProps): HierarchyDefinition {\n return new ClassBasedHierarchyDefinition(props);\n}\n\nclass ClassBasedHierarchyDefinition implements HierarchyDefinition {\n public constructor(private _props: ClassBasedHierarchyDefinitionProps) {}\n\n /**\n * Create hierarchy level definitions for specific hierarchy level.\n * @param parentNode Parent node to create children definitions for.\n */\n public async defineHierarchyLevel(props: DefineHierarchyLevelProps): Promise<HierarchyLevelDefinition> {\n const { parentNode } = props;\n if (!parentNode) {\n return this._props.hierarchy.rootNodes(props);\n }\n\n if (HierarchyNode.isCustom(parentNode)) {\n const defs = this._props.hierarchy.childNodes\n .filter(isCustomNodeChildHierarchyLevelDefinition)\n .filter((def) => def.customParentNodeKey === parentNode.key);\n return (await Promise.all(defs.map(async (def) => def.definitions({ ...props, parentNode })))).flat();\n }\n\n // istanbul ignore else\n if (HierarchyNode.isInstancesNode(parentNode)) {\n const instanceIdsByClass = groupInstanceIdsByClass(parentNode.key.instanceKeys);\n const instancesParentNodeDefs = this._props.hierarchy.childNodes.filter(isInstancesNodeChildHierarchyLevelDefinition);\n return (\n await Promise.all(\n [...instanceIdsByClass.entries()].map(async ([parentNodeClassName, parentNodeInstanceIds]) =>\n createHierarchyLevelDefinitions(this._props.classHierarchyInspector, instancesParentNodeDefs, {\n ...props,\n parentNodeClassName,\n parentNodeInstanceIds,\n parentNode,\n }),\n ),\n )\n ).flat();\n }\n\n // istanbul ignore next\n return [];\n }\n}\n\nasync function createHierarchyLevelDefinitions(\n classHierarchy: ECClassHierarchyInspector,\n defs: InstancesNodeChildHierarchyLevelDefinition[],\n requestProps: DefineInstanceNodeChildHierarchyLevelProps,\n) {\n const obs = from(defs).pipe(\n mergeMap(async (def, idx) => {\n if (await classHierarchy.classDerivesFrom(requestProps.parentNodeClassName, def.parentNodeClassName)) {\n return { def, idx };\n }\n return undefined;\n }),\n filter((x): x is Exclude<typeof x, undefined> => !!x),\n toArray(),\n concatMap((x) => x.sort((a, b) => a.idx - b.idx).map(({ def }) => def)),\n filter((def, idx) => !def.onlyIfNotHandled || idx === 0),\n mergeMap(async (def) => def.definitions(requestProps)),\n mergeAll(),\n );\n return firstValueFrom(obs.pipe(toArray()));\n}\n\nfunction groupInstanceIdsByClass(instanceKeys: InstanceKey[]) {\n const instanceIdsByClass = new Map<string, Id64String[]>();\n instanceKeys.forEach((key) => {\n let instanceIds = instanceIdsByClass.get(key.className);\n if (!instanceIds) {\n instanceIds = [];\n instanceIdsByClass.set(key.className, instanceIds);\n }\n instanceIds.push(key.id);\n });\n return instanceIdsByClass;\n}\n\nfunction isCustomNodeChildHierarchyLevelDefinition(def: ClassBasedHierarchyLevelDefinition): def is CustomNodeChildHierarchyLevelDefinition {\n return !!(def as CustomNodeChildHierarchyLevelDefinition).customParentNodeKey;\n}\n\nfunction isInstancesNodeChildHierarchyLevelDefinition(def: ClassBasedHierarchyLevelDefinition): def is InstancesNodeChildHierarchyLevelDefinition {\n return !!(def as InstancesNodeChildHierarchyLevelDefinition).parentNodeClassName;\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import { ConcatenatedValue, InstanceKey, OmitOverUnion, PrimitiveValue } from "@itwin/presentation-shared";
2
- import { HierarchyNodeIdentifiersPath } from "./HierarchyNodeIdentifier";
3
2
  import { ClassGroupingNodeKey, GroupingNodeKey, HierarchyNodeKey, InstancesNodeKey, LabelGroupingNodeKey, PropertyGroupingNodeKey, PropertyOtherValuesGroupingNodeKey, PropertyValueGroupingNodeKey, PropertyValueRangeGroupingNodeKey, StandardHierarchyNodeKey } from "./HierarchyNodeKey";
3
+ import { HierarchyFilteringPath } from "./HierarchyProvider";
4
4
  /**
5
- * A data structure that represents a single non-grouping hierarchy node.
5
+ * A data structure that defines attributes that are common to all types of hierarchy nodes.
6
+ * @beta
6
7
  */
7
8
  interface BaseHierarchyNode {
8
9
  /** Identifiers of all node ancestors. Can be used to identify a node in the hierarchy. */
@@ -21,7 +22,7 @@ interface BaseHierarchyNode {
21
22
  filtering?: {
22
23
  isFilterTarget?: boolean;
23
24
  hasFilterTargetAncestor?: boolean;
24
- filteredChildrenIdentifierPaths?: HierarchyNodeIdentifiersPath[];
25
+ filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];
25
26
  };
26
27
  }
27
28
  /**
@@ -127,10 +128,12 @@ export declare namespace HierarchyNode {
127
128
  /**
128
129
  * A type of `HierarchyNode` that doesn't know about its children and is an input when requesting
129
130
  * them using `HierarchyProvider.getNodes`.
131
+ * @beta
130
132
  */
131
133
  export type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, "children">;
132
134
  /**
133
135
  * Base processing parameters that apply to every node.
136
+ * @beta
134
137
  */
135
138
  interface HierarchyNodeProcessingParamsBase {
136
139
  /** Indicates if this node should be hidden if it has no child nodes. */
@@ -140,6 +143,7 @@ interface HierarchyNodeProcessingParamsBase {
140
143
  }
141
144
  /**
142
145
  * A data structure for defining nodes' grouping requirements.
146
+ * @beta
143
147
  */
144
148
  interface HierarchyNodeGroupingParams {
145
149
  byLabel?: HierarchyNodeLabelGroupingParams;
@@ -149,6 +153,7 @@ interface HierarchyNodeGroupingParams {
149
153
  }
150
154
  /**
151
155
  * A data structure for defining params specifically used for label grouping.
156
+ * @beta
152
157
  */
153
158
  interface HierarchyNodeLabelGroupingBaseParams {
154
159
  /** Label grouping option that determines whether to group nodes or to merge them. Defaults to "group".*/
@@ -158,19 +163,27 @@ interface HierarchyNodeLabelGroupingBaseParams {
158
163
  }
159
164
  /**
160
165
  * A data structure for defining label merging.
166
+ * @beta
161
167
  */
162
168
  interface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {
163
169
  action: "merge";
164
170
  }
165
171
  /**
166
172
  * A data structure for defining label grouping with additional parameters.
173
+ * @beta
167
174
  */
168
175
  interface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {
169
176
  action?: "group";
170
177
  }
171
- /** A data structure for defining possible label grouping types. */
178
+ /**
179
+ * A data structure for defining possible label grouping types.
180
+ * @beta
181
+ */
172
182
  export type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;
173
- /** Grouping parameters that are shared across all types of groupings. */
183
+ /**
184
+ * Grouping parameters that are shared across all types of groupings.
185
+ * @beta
186
+ */
174
187
  export interface HierarchyNodeGroupingParamsBase {
175
188
  /** Hiding option that determines whether to hide group nodes which have no siblings at the same hierarchy level. */
176
189
  hideIfNoSiblings?: boolean;
@@ -183,10 +196,12 @@ export interface HierarchyNodeGroupingParamsBase {
183
196
  * Defines possible values for `BaseGroupingParams.autoExpand` attribute:
184
197
  * - `single-child` - set the grouping node to auto-expand if it groups a single node.
185
198
  * - `always` - always set the grouping node to auto-expand.
199
+ * @beta
186
200
  */
187
201
  export type HierarchyNodeAutoExpandProp = "single-child" | "always";
188
202
  /**
189
203
  * A data structure that represents base class grouping.
204
+ * @beta
190
205
  */
191
206
  interface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingParamsBase {
192
207
  /**
@@ -197,7 +212,10 @@ interface HierarchyNodeBaseClassGroupingParams extends HierarchyNodeGroupingPara
197
212
  */
198
213
  fullClassNames: string[];
199
214
  }
200
- /** A data structure that represents properties grouping. */
215
+ /**
216
+ * A data structure that represents properties grouping.
217
+ * @beta
218
+ */
201
219
  export interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGroupingParamsBase {
202
220
  /**
203
221
  * Full name of a class whose properties are used to group the node. Only has effect if the node
@@ -243,7 +261,10 @@ export interface HierarchyNodePropertiesGroupingParams extends HierarchyNodeGrou
243
261
  */
244
262
  propertyGroups: HierarchyNodePropertyGroup[];
245
263
  }
246
- /** A data structure that represents specific properties' grouping params. */
264
+ /**
265
+ * A data structure that represents specific properties' grouping params.
266
+ * @beta
267
+ */
247
268
  export interface HierarchyNodePropertyGroup {
248
269
  /** A string indicating the name of the property to group by. */
249
270
  propertyName: string;
@@ -252,7 +273,10 @@ export interface HierarchyNodePropertyGroup {
252
273
  /** Ranges are used to group nodes by numeric properties which are within specified bounds. */
253
274
  ranges?: HierarchyNodePropertyValueRange[];
254
275
  }
255
- /** A data structure that represents boundaries for a value. */
276
+ /**
277
+ * A data structure that represents boundaries for a value.
278
+ * @beta
279
+ */
256
280
  export interface HierarchyNodePropertyValueRange {
257
281
  /** Defines the lower bound of the range. */
258
282
  fromValue: number;
@@ -261,23 +285,35 @@ export interface HierarchyNodePropertyValueRange {
261
285
  /** Defines the range label. Will be used as `PropertyValueRangeGroupingNode` node's display label. */
262
286
  rangeLabel?: string;
263
287
  }
264
- /** Processing parameters that apply to instance nodes. */
288
+ /**
289
+ * Processing parameters that apply to instance nodes.
290
+ * @beta
291
+ */
265
292
  export interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {
266
293
  grouping?: HierarchyNodeGroupingParams;
267
294
  }
268
- /** A custom (not based on data in an iModel) node that has processing parameters. */
295
+ /**
296
+ * A custom (not based on data in an iModel) node that has processing parameters.
297
+ * @beta
298
+ */
269
299
  export type ProcessedCustomHierarchyNode = Omit<NonGroupingHierarchyNode, "key" | "children"> & {
270
300
  key: string;
271
301
  children?: boolean;
272
302
  processingParams?: HierarchyNodeProcessingParamsBase;
273
303
  };
274
- /** An instances' (based on data in an iModel) node that has processing parameters. */
304
+ /**
305
+ * An instances' (based on data in an iModel) node that has processing parameters.
306
+ * @beta
307
+ */
275
308
  export type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, "key" | "children"> & {
276
309
  key: InstancesNodeKey;
277
310
  children?: boolean;
278
311
  processingParams?: InstanceHierarchyNodeProcessingParams;
279
312
  };
280
- /** A grouping node that groups either instance nodes or other grouping nodes. */
313
+ /**
314
+ * A grouping node that groups either instance nodes or other grouping nodes.
315
+ * @beta
316
+ */
281
317
  export type ProcessedGroupingHierarchyNode = Omit<GroupingHierarchyNode, "children"> & {
282
318
  children: Array<ProcessedGroupingHierarchyNode | ProcessedInstanceHierarchyNode>;
283
319
  };
@@ -299,9 +335,15 @@ export type ProcessedHierarchyNode = ProcessedCustomHierarchyNode | ProcessedIns
299
335
  export type ParsedHierarchyNode<TBase = ParsedCustomHierarchyNode | ParsedInstanceHierarchyNode> = OmitOverUnion<TBase, "label" | "parentKeys"> & {
300
336
  label: string | ConcatenatedValue;
301
337
  };
302
- /** A kind of `ProcessedCustomHierarchyNode` that has unformatted label and doesn't know about its ancestors. */
338
+ /**
339
+ * A kind of `ProcessedCustomHierarchyNode` that has unformatted label and doesn't know about its ancestors.
340
+ * @beta
341
+ */
303
342
  export type ParsedCustomHierarchyNode = ParsedHierarchyNode<ProcessedCustomHierarchyNode>;
304
- /** A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors. */
343
+ /**
344
+ * A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors.
345
+ * @beta
346
+ */
305
347
  export type ParsedInstanceHierarchyNode = ParsedHierarchyNode<ProcessedInstanceHierarchyNode>;
306
348
  export {};
307
349
  //# 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,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC3G,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,4BAA4B,EAC5B,iCAAiC,EACjC,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,UAAU,iBAAiB;IACzB,0FAA0F;IAC1F,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,QAAQ,EAAE,OAAO,CAAC;IAClB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yDAAyD;IACzD,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACtC,oEAAoE;IACpE,SAAS,CAAC,EAAE;QACV,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC,+BAA+B,CAAC,EAAE,4BAA4B,EAAE,CAAC;KAClE,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,iEAAiE;IACjE,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAC/B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,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,GAAG,CAAC,CAAC;IAClE,CAAC;IANe,+CAAiC,oCAMhD,CAAA;IACD,sEAAsE;IACtE,SAAgB,2BAA2B,CACzC,IAAW;QAIX,OAAO,mCAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;IANe,yCAA2B,8BAM1C,CAAA;IACD,4EAA4E;IAC5E,SAAgB,gCAAgC,CAC9C,IAAW;QAIX,OAAO,mCAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IANe,8CAAgC,mCAM/C,CAAA;IACD,gEAAgE;IAChE,SAAgB,sBAAsB,CACpC,IAAW;QAIX,OAAO,mCAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IANe,oCAAsB,yBAMrC,CAAA;AACH,CAAC,EAvEgB,aAAa,6BAAb,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 { HierarchyNodeIdentifiersPath } from \"./HierarchyNodeIdentifier\";\nimport {\n ClassGroupingNodeKey,\n GroupingNodeKey,\n HierarchyNodeKey,\n InstancesNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n StandardHierarchyNodeKey,\n} from \"./HierarchyNodeKey\";\n\n/**\n * A data structure that represents a single non-grouping hierarchy node.\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?: {\n isFilterTarget?: boolean;\n hasFilterTargetAncestor?: boolean;\n filteredChildrenIdentifierPaths?: HierarchyNodeIdentifiersPath[];\n };\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 */\nexport type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, \"children\">;\n\n/**\n * Base processing parameters that apply to every node.\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 */\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 */\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 */\ninterface HierarchyNodeLabelGroupingMergeParams extends HierarchyNodeLabelGroupingBaseParams {\n action: \"merge\";\n}\n\n/**\n * A data structure for defining label grouping with additional parameters.\n */\ninterface HierarchyNodeLabelGroupingGroupParams extends HierarchyNodeLabelGroupingBaseParams, HierarchyNodeGroupingParamsBase {\n action?: \"group\";\n}\n\n/** A data structure for defining possible label grouping types. */\nexport type HierarchyNodeLabelGroupingParams = boolean | HierarchyNodeLabelGroupingMergeParams | HierarchyNodeLabelGroupingGroupParams;\n\n/** Grouping parameters that are shared across all types of groupings. */\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 */\nexport type HierarchyNodeAutoExpandProp = \"single-child\" | \"always\";\n\n/**\n * A data structure that represents base class grouping.\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/** A data structure that represents properties grouping. */\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/** A data structure that represents specific properties' grouping params. */\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;\n /** Ranges are used to group nodes by numeric properties which are within specified bounds. */\n ranges?: HierarchyNodePropertyValueRange[];\n}\n\n/** A data structure that represents boundaries for a value. */\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/** Processing parameters that apply to instance nodes. */\nexport interface InstanceHierarchyNodeProcessingParams extends HierarchyNodeProcessingParamsBase {\n grouping?: HierarchyNodeGroupingParams;\n}\n\n/** A custom (not based on data in an iModel) node that has processing parameters. */\nexport type ProcessedCustomHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: string;\n children?: boolean;\n processingParams?: HierarchyNodeProcessingParamsBase;\n};\n/** An instances' (based on data in an iModel) node that has processing parameters. */\nexport type ProcessedInstanceHierarchyNode = Omit<NonGroupingHierarchyNode, \"key\" | \"children\"> & {\n key: InstancesNodeKey;\n children?: boolean;\n processingParams?: InstanceHierarchyNodeProcessingParams;\n};\n/** A grouping node that groups either instance nodes or other grouping nodes. */\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/** A kind of `ProcessedCustomHierarchyNode` that has unformatted label and doesn't know about its ancestors. */\nexport type ParsedCustomHierarchyNode = ParsedHierarchyNode<ProcessedCustomHierarchyNode>;\n/** A kind of `ProcessedInstanceHierarchyNode` that has unformatted label and doesn't know about its ancestors. */\nexport type ParsedInstanceHierarchyNode = ParsedHierarchyNode<ProcessedInstanceHierarchyNode>;\n"]}
1
+ {"version":3,"file":"HierarchyNode.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAGhG,yDAW4B;AAgE5B,YAAY;AACZ,2DAA2D;AAC3D,IAAiB,aAAa,CAuE7B;AAvED,WAAiB,aAAa;IAC5B,qDAAqD;IACrD,SAAgB,QAAQ,CACtB,IAAW;QAEX,OAAO,mCAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;IAJe,sBAAQ,WAIvB,C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;IANe,8CAAgC,mCAM/C,CAAA;IACD,gEAAgE;IAChE,SAAgB,sBAAsB,CACpC,IAAW;QAIX,OAAO,mCAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IANe,oCAAsB,yBAMrC,CAAA;AACH,CAAC,EAvEgB,aAAa,6BAAb,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 } from \"./HierarchyProvider\";\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?: {\n isFilterTarget?: boolean;\n hasFilterTargetAncestor?: boolean;\n filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];\n };\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;\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"]}