@itwin/presentation-hierarchies 2.0.0-alpha.13 → 2.0.0-alpha.15

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 (190) hide show
  1. package/CHANGELOG.md +132 -4
  2. package/README.md +19 -18
  3. package/lib/cjs/hierarchies/HierarchyMerge.d.ts +1 -1
  4. package/lib/cjs/hierarchies/HierarchyMerge.d.ts.map +1 -1
  5. package/lib/cjs/hierarchies/HierarchyMerge.js +1 -1
  6. package/lib/cjs/hierarchies/HierarchyMerge.js.map +1 -1
  7. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +1 -1
  8. package/lib/cjs/hierarchies/HierarchyNode.js.map +1 -1
  9. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  10. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +1 -1
  11. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +1 -1
  12. package/lib/cjs/hierarchies/HierarchyProvider.js +7 -3
  13. package/lib/cjs/hierarchies/HierarchyProvider.js.map +1 -1
  14. package/lib/cjs/hierarchies/HierarchySearch.d.ts +24 -2
  15. package/lib/cjs/hierarchies/HierarchySearch.d.ts.map +1 -1
  16. package/lib/cjs/hierarchies/HierarchySearch.js +33 -16
  17. package/lib/cjs/hierarchies/HierarchySearch.js.map +1 -1
  18. package/lib/cjs/hierarchies/Logging.js +1 -1
  19. package/lib/cjs/hierarchies/Logging.js.map +1 -1
  20. package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +1 -1
  21. package/lib/cjs/hierarchies/imodel/HierarchyCache.js +1 -4
  22. package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +1 -1
  23. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +35 -2
  24. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -1
  25. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -1
  26. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -1
  27. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +1 -1
  28. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
  29. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +144 -78
  30. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
  31. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -1
  32. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +6 -7
  33. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -1
  34. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
  35. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +33 -62
  36. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
  37. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
  38. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +2 -1
  39. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
  40. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -1
  41. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js +11 -4
  42. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -1
  43. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -1
  44. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +3 -5
  45. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +1 -1
  46. package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +1 -1
  47. package/lib/cjs/hierarchies/imodel/Utils.js +19 -7
  48. package/lib/cjs/hierarchies/imodel/Utils.js.map +1 -1
  49. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -1
  50. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +10 -4
  51. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +1 -1
  52. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +1 -1
  53. package/lib/cjs/hierarchies/imodel/operators/Grouping.js +32 -18
  54. package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +1 -1
  55. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -1
  56. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +31 -9
  57. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -1
  58. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -1
  59. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +30 -14
  60. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -1
  61. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -1
  62. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +4 -6
  63. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -1
  64. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -1
  65. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +4 -9
  66. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -1
  67. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -1
  68. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +1 -5
  69. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -1
  70. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -1
  71. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +2 -10
  72. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -1
  73. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -1
  74. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +24 -28
  75. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -1
  76. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -1
  77. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js +3 -1
  78. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +1 -1
  79. package/lib/cjs/hierarchies/internal/Common.d.ts.map +1 -1
  80. package/lib/cjs/hierarchies/internal/Common.js +2 -2
  81. package/lib/cjs/hierarchies/internal/Common.js.map +1 -1
  82. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +1 -1
  83. package/lib/cjs/hierarchies/internal/EachValueFrom.js +0 -2
  84. package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +1 -1
  85. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -1
  86. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +3 -1
  87. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -1
  88. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -1
  89. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +1 -4
  90. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +1 -1
  91. package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +1 -1
  92. package/lib/cjs/hierarchies/internal/operators/Partition.js.map +1 -1
  93. package/lib/cjs/presentation-hierarchies.d.ts +3 -3
  94. package/lib/cjs/presentation-hierarchies.d.ts.map +1 -1
  95. package/lib/cjs/presentation-hierarchies.js.map +1 -1
  96. package/lib/esm/hierarchies/HierarchyMerge.d.ts +1 -1
  97. package/lib/esm/hierarchies/HierarchyMerge.d.ts.map +1 -1
  98. package/lib/esm/hierarchies/HierarchyMerge.js +1 -1
  99. package/lib/esm/hierarchies/HierarchyMerge.js.map +1 -1
  100. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +1 -1
  101. package/lib/esm/hierarchies/HierarchyNode.js.map +1 -1
  102. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +1 -1
  103. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +1 -1
  104. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +1 -1
  105. package/lib/esm/hierarchies/HierarchyProvider.js +7 -3
  106. package/lib/esm/hierarchies/HierarchyProvider.js.map +1 -1
  107. package/lib/esm/hierarchies/HierarchySearch.d.ts +24 -2
  108. package/lib/esm/hierarchies/HierarchySearch.d.ts.map +1 -1
  109. package/lib/esm/hierarchies/HierarchySearch.js +33 -16
  110. package/lib/esm/hierarchies/HierarchySearch.js.map +1 -1
  111. package/lib/esm/hierarchies/Logging.js +1 -1
  112. package/lib/esm/hierarchies/Logging.js.map +1 -1
  113. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +1 -1
  114. package/lib/esm/hierarchies/imodel/HierarchyCache.js +1 -4
  115. package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +1 -1
  116. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts +35 -2
  117. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -1
  118. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -1
  119. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -1
  120. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +1 -1
  121. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -1
  122. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +147 -81
  123. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -1
  124. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -1
  125. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js +7 -8
  126. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -1
  127. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -1
  128. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js +34 -63
  129. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -1
  130. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -1
  131. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +2 -1
  132. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -1
  133. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -1
  134. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js +11 -4
  135. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -1
  136. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -1
  137. package/lib/esm/hierarchies/imodel/TreeNodesReader.js +3 -5
  138. package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +1 -1
  139. package/lib/esm/hierarchies/imodel/Utils.d.ts.map +1 -1
  140. package/lib/esm/hierarchies/imodel/Utils.js +19 -7
  141. package/lib/esm/hierarchies/imodel/Utils.js.map +1 -1
  142. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -1
  143. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js +11 -5
  144. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +1 -1
  145. package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +1 -1
  146. package/lib/esm/hierarchies/imodel/operators/Grouping.js +33 -19
  147. package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +1 -1
  148. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -1
  149. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js +32 -10
  150. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -1
  151. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -1
  152. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js +31 -15
  153. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -1
  154. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -1
  155. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +5 -7
  156. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -1
  157. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -1
  158. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js +5 -10
  159. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -1
  160. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -1
  161. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js +1 -5
  162. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -1
  163. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -1
  164. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js +2 -10
  165. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -1
  166. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -1
  167. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +24 -28
  168. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -1
  169. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -1
  170. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js +3 -1
  171. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +1 -1
  172. package/lib/esm/hierarchies/internal/Common.d.ts.map +1 -1
  173. package/lib/esm/hierarchies/internal/Common.js +2 -2
  174. package/lib/esm/hierarchies/internal/Common.js.map +1 -1
  175. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +1 -1
  176. package/lib/esm/hierarchies/internal/EachValueFrom.js +0 -2
  177. package/lib/esm/hierarchies/internal/EachValueFrom.js.map +1 -1
  178. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -1
  179. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js +3 -1
  180. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -1
  181. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -1
  182. package/lib/esm/hierarchies/internal/SubscriptionScheduler.js +1 -4
  183. package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +1 -1
  184. package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +1 -1
  185. package/lib/esm/hierarchies/internal/operators/Partition.js.map +1 -1
  186. package/lib/esm/presentation-hierarchies.d.ts +3 -3
  187. package/lib/esm/presentation-hierarchies.d.ts.map +1 -1
  188. package/lib/esm/presentation-hierarchies.js +3 -3
  189. package/lib/esm/presentation-hierarchies.js.map +1 -1
  190. package/package.json +15 -23
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchySearch.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchySearch.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAIvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,cAAc;AACd,MAAM,WAAW,0BAA0B;IACzC;;;;;;OAMG;IACH,MAAM,CAAC,EACH,OAAO,GACP;QACE;;;;;;;;;;;;;;;;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AAgB,GAAG,cAAc,CAAC;YAC3C,gBAAgB,EAAE,CAAC,UAAU,EAAE,uBAAuB,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;SACvF,GACG,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,YAAY,CAAC,GAAG,SAAS,CAAC,GAC5E,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,YAAY,CAAC,GACvD,SAAS;;EAkEd"}
@@ -95,10 +95,23 @@ var HierarchySearchTree;
95
95
  var _a;
96
96
  return new (class Impl {
97
97
  #rootsDictionary = new core_bentley_1.Dictionary(HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.compare);
98
- static #mapDictionaryToTree(dictionary) {
98
+ static #mapDictionaryToTree(dictionary, parentEntries, props) {
99
99
  const list = [];
100
- for (const { children, extras: _, ...entry } of dictionary.values()) {
101
- list.push({ ...entry, ...(children ? { children: Impl.#mapDictionaryToTree(children) } : undefined) });
100
+ for (const { children, ...entry } of dictionary.values()) {
101
+ let processedEntry = entry;
102
+ if (props?.processEntry) {
103
+ processedEntry = props.processEntry({ treeEntry: entry, parentEntries });
104
+ }
105
+ if (!processedEntry) {
106
+ continue;
107
+ }
108
+ const { extras: _, ...entryWithoutExtras } = processedEntry;
109
+ parentEntries.push(processedEntry);
110
+ list.push({
111
+ ...entryWithoutExtras,
112
+ ...(children ? { children: Impl.#mapDictionaryToTree(children, parentEntries, props) } : undefined),
113
+ });
114
+ parentEntries.pop();
102
115
  }
103
116
  return list;
104
117
  }
@@ -250,8 +263,8 @@ var HierarchySearchTree;
250
263
  }
251
264
  return this;
252
265
  }
253
- getTree() {
254
- return Impl.#mapDictionaryToTree(this.#rootsDictionary);
266
+ getTree(props) {
267
+ return Impl.#mapDictionaryToTree(this.#rootsDictionary, [], props);
255
268
  }
256
269
  })();
257
270
  }
@@ -282,9 +295,7 @@ var HierarchySearchTree;
282
295
  return lhs;
283
296
  }
284
297
  const autoExpand = mergeSearchTreeAutoExpandOption(lhs.autoExpand, rhs.autoExpand);
285
- const options = {
286
- ...(autoExpand ? { autoExpand } : undefined),
287
- };
298
+ const options = { ...(autoExpand ? { autoExpand } : undefined) };
288
299
  return Object.keys(options).length > 0 ? options : undefined;
289
300
  }
290
301
  HierarchySearchTree.mergeOptions = mergeOptions;
@@ -300,10 +311,14 @@ var HierarchySearchTree;
300
311
  })(HierarchySearchTree || (exports.HierarchySearchTree = HierarchySearchTree = {}));
301
312
  function extractSearchPropsInternal(rootLevelSearchProps, parentNode) {
302
313
  if (!parentNode) {
303
- return rootLevelSearchProps ? { childrenTargetPaths: rootLevelSearchProps, hasSearchTargetAncestor: false } : undefined;
314
+ return rootLevelSearchProps
315
+ ? { childrenTargetPaths: rootLevelSearchProps, hasSearchTargetAncestor: false }
316
+ : undefined;
304
317
  }
305
318
  const searchProps = {
306
- ...(parentNode.search?.childrenTargetPaths ? { childrenTargetPaths: parentNode.search.childrenTargetPaths } : undefined),
319
+ ...(parentNode.search?.childrenTargetPaths
320
+ ? { childrenTargetPaths: parentNode.search.childrenTargetPaths }
321
+ : undefined),
307
322
  hasSearchTargetAncestor: !!parentNode.search?.hasSearchTargetAncestor || !!parentNode.search?.isSearchTarget,
308
323
  };
309
324
  return searchProps.childrenTargetPaths || searchProps.hasSearchTargetAncestor ? searchProps : undefined;
@@ -356,7 +371,11 @@ function createHierarchySearchHelper(rootLevelSearchProps, parentNode) {
356
371
  }
357
372
  const reducer = new MatchingSearchPathsReducer(searchProps.hasSearchTargetAncestor);
358
373
  if ("asyncPathMatcher" in props) {
359
- const extractResult = saveSearchPropsFromPathsIntoReducer({ pathsReducer: reducer, nodeKey: props.nodeKey, asyncPathMatcher: props.asyncPathMatcher });
374
+ const extractResult = saveSearchPropsFromPathsIntoReducer({
375
+ pathsReducer: reducer,
376
+ nodeKey: props.nodeKey,
377
+ asyncPathMatcher: props.asyncPathMatcher,
378
+ });
360
379
  if (extractResult instanceof Promise) {
361
380
  return extractResult.then(() => reducer.aggregatedOptions);
362
381
  }
@@ -404,7 +423,8 @@ function createHierarchySearchHelper(rootLevelSearchProps, parentNode) {
404
423
  }
405
424
  function nodeKeyMatchesIdentifier(nodeKey, identifier) {
406
425
  return ((HierarchyNodeKey_js_1.HierarchyNodeKey.isGeneric(nodeKey) && HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.equal(identifier, nodeKey)) ||
407
- (HierarchyNodeKey_js_1.HierarchyNodeKey.isInstances(nodeKey) && nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.equal(identifier, ik))));
426
+ (HierarchyNodeKey_js_1.HierarchyNodeKey.isInstances(nodeKey) &&
427
+ nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.equal(identifier, ik))));
408
428
  }
409
429
  /**
410
430
  * Extracts information from search paths and later returns `search` and `autoExpand` values from `HierarchyNode`.
@@ -442,10 +462,7 @@ class MatchingSearchPathsReducer {
442
462
  }
443
463
  : undefined;
444
464
  const autoExpand = this._options?.autoExpand === true;
445
- return {
446
- ...(search ? { search } : undefined),
447
- ...(autoExpand ? { autoExpand } : undefined),
448
- };
465
+ return { ...(search ? { search } : undefined), ...(autoExpand ? { autoExpand } : undefined) };
449
466
  }
450
467
  }
451
468
  //# sourceMappingURL=HierarchySearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchySearch.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchySearch.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA6iBhG,kEA0IC;AArrBD,+BAAyD;AACzD,sDAAiD;AACjD,6EAAuE;AACvE,+DAAyD;AACzD,oFAA0F;AA+D1F,cAAc;AACd,2DAA2D;AAC3D,IAAiB,mBAAmB,CAgEnC;AAhED,WAAiB,mBAAmB;IAClC;;;OAGG;IACH,SAAgB,SAAS,CAAC,MAA2B;QACnD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;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AC,CAAC,CAAC,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAClF,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAChE,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC1G,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;aAC5D;YACH,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,KAAK,IAAI,CAAC;QACtD,OAAO;YACL,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YACpC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;SAC7C,CAAC;IACJ,CAAC;CACF","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 { firstValueFrom, from, map, reduce } from \"rxjs\";\nimport { Dictionary } from \"@itwin/core-bentley\";\nimport { HierarchyNodeIdentifier } from \"./HierarchyNodeIdentifier.js\";\nimport { HierarchyNodeKey } from \"./HierarchyNodeKey.js\";\nimport { releaseMainThreadOnItemsCount } from \"./internal/operators/ReleaseMainThread.js\";\n\nimport type { NonGroupingHierarchyNode } from \"./HierarchyNode.js\";\nimport type { HierarchyNodeIdentifiersPath } from \"./HierarchyNodeIdentifier.js\";\nimport type { GenericNodeKey, InstancesNodeKey } from \"./HierarchyNodeKey.js\";\n\n/** @public */\nexport interface HierarchySearchPathOptions {\n /**\n * This option specifies the way `autoExpand` flag should be assigned to nodes in the searched hierarchy.\n * - If it's `false` or `undefined`, nodes have no 'autoExpand' flag.\n * - If it's `true`, then all nodes up to the search target will have `autoExpand` flag.\n * - If it's a object with `groupingLevel` then `groupingLevel` determines the number of grouping levels to expand for\n * the search target.\n */\n reveal?:\n | boolean\n | {\n /**\n * Index of the node in search path should be revealed in hierarchy by auto-expanding its ancestors.\n *\n * Use when you want to expand up to specific instance node and don't care about grouping nodes.\n *\n * **Use case example:**\n *\n * All nodes up to `Element1` should be expanded in the following hierarchy:\n * - Node1\n * - GroupingNode1\n * - GroupingNode2\n * - Element1\n * - Element2\n *\n * Provide `{ path: [Node1, Element1], reveal: { depthInPath: 1 } }`\n *\n * **NOTE**: All nodes that are up to `depthInPath` will be expanded **except** search targets.\n */\n depthInPath: number;\n }\n | {\n /**\n * The number of grouping levels to expand for the search target. For example, if `groupingLevel` is set to `2`, then all grouping nodes up to the second level\n * will have the `autoExpand` flag.\n *\n * **Note:** if search target has less grouping levels than specified by this attribute, then all grouping nodes up to the search target will have\n * the `autoExpand` flag, but the search target itself won't have the `autoExpand` flag.\n */\n groupingLevel: number;\n };\n /**\n * This option specifies whether or not search target should be expanded.\n * - If it's `false` or `undefined`, search target won't have 'autoExpand' flag.\n * - If it's `true`, search target will have `autoExpand` flag.\n *\n * **Note:** this attribute does not set `autoExpand` flag on nodes up to the search target. For that use `reveal`.\n */\n autoExpand?: boolean;\n}\n\n/**\n * A path of hierarchy node identifiers for search the hierarchy with additional options.\n * @public\n */\nexport type HierarchySearchPath = HierarchyNodeIdentifiersPath | { path: HierarchyNodeIdentifiersPath; options?: HierarchySearchPathOptions };\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchySearchPath {\n /**\n * Normalizes the hierarchy search path to the object form.\n * @public\n */\n export function normalize(source: HierarchySearchPath): Exclude<HierarchySearchPath, HierarchyNodeIdentifiersPath> {\n if (Array.isArray(source)) {\n return { path: source };\n }\n return source;\n }\n\n /**\n * Merges two given `HierarchySearchPathOptions` objects.\n *\n * For the `reveal` attribute, the merge chooses to `reveal` as deep as the deepest input:\n * - if any one of the inputs is `true`, return `true`,\n * - else if only one of the inputs is an object, return it,\n * - else if both inputs are falsy, return `false` or `undefined`,\n * - else:\n * - if only one of the inputs has `groupingLevel` set, return that one,\n * - else compare by matching reveal type (`groupingLevel` or `depthInPath`) and return the deeper one.\n *\n * @public\n */\n export function mergeOptions(\n lhs: HierarchySearchPathOptions | undefined,\n rhs: HierarchySearchPathOptions | undefined,\n ): HierarchySearchPathOptions | undefined {\n const reveal = mergeRevealOptions(lhs?.reveal, rhs?.reveal);\n const autoExpand = mergeAutoExpandOption(lhs?.autoExpand, rhs?.autoExpand);\n return reveal || autoExpand\n ? {\n ...(reveal !== undefined ? { reveal } : undefined),\n ...(autoExpand !== undefined ? { autoExpand } : undefined),\n }\n : undefined;\n }\n function mergeRevealOptions(lhs: HierarchySearchPathOptions[\"reveal\"], rhs: HierarchySearchPathOptions[\"reveal\"]): HierarchySearchPathOptions[\"reveal\"] {\n if (rhs === true || lhs === true) {\n return true;\n }\n if (!rhs || !lhs) {\n return !!rhs ? rhs : lhs;\n }\n\n if (\"groupingLevel\" in lhs) {\n if (\"groupingLevel\" in rhs) {\n return lhs.groupingLevel > rhs.groupingLevel ? lhs : rhs;\n }\n return lhs;\n } else if (\"groupingLevel\" in rhs) {\n return rhs;\n }\n\n return lhs.depthInPath > rhs.depthInPath ? lhs : rhs;\n }\n\n function mergeAutoExpandOption(\n lhs: HierarchySearchPathOptions[\"autoExpand\"],\n rhs: HierarchySearchPathOptions[\"autoExpand\"],\n ): HierarchySearchPathOptions[\"autoExpand\"] {\n return lhs || rhs ? true : undefined;\n }\n}\n\n/**\n * A tree structure representing hierarchy search paths. Each node in the tree corresponds\n * to a hierarchy node identifier and may have children that represent deeper levels in the\n * hierarchy.\n *\n * The `HierarchySearchTree.createBuilder` or `HierarchySearchTree.createFromPathsList` are\n * typically used create this tree from a flat list of search paths.\n *\n * @public\n */\nexport interface HierarchySearchTree {\n /** Identifier of the hierarchy node this tree entry represents. */\n identifier: HierarchyNodeIdentifier;\n\n /**\n * When `true`, indicates that this node is a search target.\n *\n * Note: A `HierarchySearchTree` node is considered a search target if it has no children, even if `isTarget` is not explicitly set to `true`. This\n * is because a node with no children represents the end of a search path.\n */\n isTarget?: boolean;\n\n /** Provides options for handling this search tree entry, such as auto-expansion behavior. */\n options?: {\n /**\n * - `true` to expand the node and its grouping nodes,\n * - `{ groupingLevel: number }` to expand ancestor grouping nodes, e.g. for the following hierarchy:\n * ```\n * - Grouping node A\n * - Instance node A\n * - Grouping node B1\n * - Grouping node B2\n * - ...\n * - Grouping node Bn\n * - Instance node B\n * ```\n *\n * For \"Instance node B\" search tree entry:\n * - `{ groupingLevel: 1 }` expands its first grouping node \"Grouping node B1\",\n * - `{ groupingLevel: 2 }` expands two levels to \"Grouping node B2\".\n * - `{ groupingLevel: Number.MAX_SAFE_INTEGER }` expands all grouping nodes of that instance node.\n *\n * Note that there's a slight difference between `HierarchySearchTree.options.autoExpand` and\n * `HierarchySearchPath.options.reveal`. The latter option reveals the search target node by expanding its ancestors,\n * while the `HierarchySearchTree.options.autoExpand` also expands the target node itself.\n */\n autoExpand?: boolean | { groupingLevel: number };\n };\n\n /** Child search tree entries representing the next level(s) in the hierarchy search paths. */\n children?: HierarchySearchTree[];\n}\n\n/** @public */\nexport namespace HierarchySearchTree {\n /** @public */\n type HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras extends Record<string, unknown>> = Readonly<\n Pick<HierarchySearchTree, \"identifier\" | \"options\"> & {\n extras: TExtras;\n }\n > &\n Pick<HierarchySearchTree, \"isTarget\">;\n /** @public */\n type HierarchySearchTreeBuilderAcceptHandlerTreeInput = Readonly<Pick<HierarchySearchTree, \"identifier\" | \"isTarget\" | \"options\"> & { hasChildren: boolean }>;\n /** @public */\n interface HierarchySearchTreeBuilderAcceptHandler<TExtras extends Record<string, unknown>> {\n /**\n * Called when a new entry is added to the tree. Return `true` to accept the entry, `false` to reject it and all its children, if any.\n */\n onNewEntry?: (props: {\n /** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */\n parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;\n /** The new entry being added to the tree. */\n inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;\n }) => boolean;\n /**\n * Called when a new entry is added to the tree and accepted (either it's a new entry or it merges with an existing entry). This can be used to perform\n * side effects such as assigning extra information to the tree entry.\n */\n onEntryHandled?: (props: {\n /** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */\n parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;\n /** The tree entry that has been handled. It's allowed to mutate this entry. */\n treeEntry: HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>;\n /** The input entry being added to the tree. */\n inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;\n }) => void;\n }\n /** @public */\n type HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras extends Record<string, unknown>> = (\n | { path: HierarchySearchPath }\n | { tree: HierarchySearchTree }\n ) & {\n /** An optional handler for customizing the behavior of the builder when accepting new entries. */\n handler?: HierarchySearchTreeBuilderAcceptHandler<TAcceptHandlerExtras>;\n };\n /**\n * An utility that accepts hierarchy search paths or search trees one by one and builds a `HierarchySearchTree` structure based on them.\n * @public\n */\n interface HierarchySearchTreeBuilder<TAcceptHandlerExtras extends Record<string, unknown>> {\n /**\n * Accepts a hierarchy search path or paths' tree and adds it to the builder's internal tree structure. Use `getTree()` to create\n * a `HierarchySearchTree[]` from the added paths.\n */\n accept(props: HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras>): HierarchySearchTreeBuilder<TAcceptHandlerExtras>;\n /**\n * Create `HierarchySearchTree[]` from currently added search paths.\n */\n getTree(): HierarchySearchTree[];\n }\n\n /**\n * Create a `HierarchySearchTree` builder utility that accepts hierarchy search paths or search trees one by one and builds\n * a `HierarchySearchTree` structure based on them.\n *\n * Usage example:\n *\n * ```ts\n * const builder = HierarchySearchTree.createBuilder();\n * for (const path of searchPaths) {\n * builder.accept({ path });\n * }\n * const searchTree = builder.getTree();\n * ```\n *\n * @public\n */\n export function createBuilder<\n TAcceptHandlerExtras extends Record<string, unknown> = Record<string, unknown>,\n >(): HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n type HierarchySearchTreeDictionaryEntry = Omit<HierarchySearchTree, \"children\"> & {\n children?: HierarchySearchTreeDictionary;\n extras: TAcceptHandlerExtras;\n };\n type HierarchySearchTreeDictionary = Dictionary<HierarchyNodeIdentifier, HierarchySearchTreeDictionaryEntry>;\n type AcceptHandler = HierarchySearchTreeBuilderAcceptHandler<TAcceptHandlerExtras>;\n return new (class Impl implements HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n #rootsDictionary: HierarchySearchTreeDictionary = new Dictionary(HierarchyNodeIdentifier.compare);\n\n static #mapDictionaryToTree(dictionary: HierarchySearchTreeDictionary): HierarchySearchTree[] {\n const list: HierarchySearchTree[] = [];\n for (const { children, extras: _, ...entry } of dictionary.values()) {\n list.push({ ...entry, ...(children ? { children: Impl.#mapDictionaryToTree(children) } : undefined) });\n }\n return list;\n }\n\n static #assignAutoExpandOptionsBasedOnReveal(\n treePath: Pick<HierarchySearchTree, \"options\">[],\n revealOption: HierarchySearchPathOptions[\"reveal\"] | undefined,\n ) {\n if (revealOption === true) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // auto-expand all grouping nodes of the revealed node\n return { autoExpand: { groupingLevel: Number.MAX_SAFE_INTEGER } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n } else if (revealOption && \"groupingLevel\" in revealOption) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // the last entry should have `autoExpand` with `groupingLevel` set to the value based on `reveal.groupingLevel`\n return { autoExpand: { groupingLevel: Math.max(revealOption.groupingLevel - 1, 0) } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n } else if (revealOption && \"depthInPath\" in revealOption) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: Math.min(revealOption.depthInPath, treePath.length - 1),\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // auto-expand all grouping nodes of the revealed node\n return { autoExpand: { groupingLevel: Number.MAX_SAFE_INTEGER } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n }\n }\n\n static #assignOptionsOnTreePath({\n treePath,\n targetEntryIndex,\n getEntryOptions,\n }: {\n treePath: Array<Pick<HierarchySearchTree, \"options\">>;\n targetEntryIndex: number;\n getEntryOptions: (index: number, targetEntryIndex: number) => HierarchySearchTree[\"options\"] | undefined;\n }) {\n // set all parent entries to auto-expand\n for (let i = 0; i <= targetEntryIndex; i++) {\n const options = mergeOptions(treePath[i].options, getEntryOptions(i, targetEntryIndex));\n if (options) {\n treePath[i].options = options;\n }\n }\n }\n\n #acceptNode({\n parentEntries,\n level,\n node,\n handler,\n }: {\n parentEntries: HierarchySearchTreeDictionaryEntry[];\n level: HierarchySearchTreeDictionary;\n node: Pick<HierarchySearchTree, \"identifier\" | \"isTarget\"> & { hasChildren: boolean };\n handler?: AcceptHandler;\n }): HierarchySearchTreeDictionaryEntry | undefined {\n let entry = level.get(node.identifier);\n if (!entry) {\n if (handler?.onNewEntry && !handler.onNewEntry({ parentEntries, inputEntry: node })) {\n return undefined;\n }\n entry = {\n identifier: node.identifier,\n children: node.hasChildren ? new Dictionary(HierarchyNodeIdentifier.compare) : undefined,\n extras: {} as TAcceptHandlerExtras,\n };\n level.set(node.identifier, entry);\n }\n\n const isNodeSearchTarget = node.isTarget || !node.hasChildren;\n if (isNodeSearchTarget && entry.children) {\n entry.isTarget = true;\n }\n if (!entry.children && node.hasChildren) {\n // Existing leaf nodes are implied targets. Preserve that status when adding children.\n entry.isTarget = true;\n entry.children = new Dictionary(HierarchyNodeIdentifier.compare);\n }\n handler?.onEntryHandled?.({ parentEntries, treeEntry: entry, inputEntry: node });\n return entry;\n }\n\n #acceptPath({ path, handler }: { path: HierarchySearchPath; handler?: AcceptHandler }) {\n const normalized = HierarchySearchPath.normalize(path);\n const treePath: Array<HierarchySearchTreeDictionaryEntry> = [];\n let currentLevel: HierarchySearchTreeDictionary = this.#rootsDictionary;\n for (let i = 0; i < normalized.path.length; i++) {\n const identifier = normalized.path[i];\n const acceptedNode = this.#acceptNode({\n parentEntries: treePath,\n node: { identifier, hasChildren: i < normalized.path.length - 1 },\n level: currentLevel,\n handler,\n });\n if (!acceptedNode) {\n break;\n }\n treePath.push(acceptedNode);\n if (!acceptedNode.children) {\n break;\n }\n currentLevel = acceptedNode.children;\n }\n\n if (treePath.length === 0) {\n return;\n }\n\n // handle auto-expand\n const lastNode = treePath[treePath.length - 1];\n if (normalized.options?.autoExpand) {\n (lastNode.options ??= {}).autoExpand = true;\n }\n\n // handle auto-reveal\n Impl.#assignAutoExpandOptionsBasedOnReveal(treePath, normalized.options?.reveal);\n }\n\n #acceptTree({ tree, handler }: { tree: HierarchySearchTree; handler?: AcceptHandler }) {\n const acceptTreeNode = (\n parentEntries: HierarchySearchTreeDictionaryEntry[],\n parentInputs: HierarchySearchTree[],\n level: HierarchySearchTreeDictionary,\n node: HierarchySearchTree,\n ) => {\n const acceptedNode = this.#acceptNode({\n parentEntries,\n node: { ...node, hasChildren: node.children !== undefined },\n level,\n handler,\n });\n if (!acceptedNode) {\n // It was decided to reject this node and its children, if any\n return;\n }\n const treePath = [...parentEntries, acceptedNode];\n const inputsPath = [...parentInputs, node];\n if (!node.children || node.isTarget) {\n // Found an effective search target - merge options from its path\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index) => inputsPath[index].options,\n });\n }\n const currentLevel = acceptedNode.children;\n if (currentLevel) {\n node.children?.forEach((child) => acceptTreeNode(treePath, inputsPath, currentLevel, child));\n }\n };\n acceptTreeNode([], [], this.#rootsDictionary, tree);\n }\n\n public accept(\n props: ({ path: HierarchySearchPath } | { tree: HierarchySearchTree }) & { handler?: AcceptHandler },\n ): HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n if (\"path\" in props) {\n this.#acceptPath(props);\n } else {\n this.#acceptTree(props);\n }\n return this;\n }\n\n public getTree() {\n return Impl.#mapDictionaryToTree(this.#rootsDictionary);\n }\n })();\n }\n\n /**\n * Builds a list of `HierarchySearchTree` nodes from an iterable of search paths. Shared\n * path prefixes are merged so that each unique hierarchy node identifier appears only once\n * per level. The resulting trees carry `isTarget`, `options`, and `children` attributes\n * derived from the paths and their options (`autoExpand`, `reveal`).\n *\n * @public\n */\n export async function createFromPathsList(paths: Iterable<HierarchySearchPath>): Promise<HierarchySearchTree[]> {\n return firstValueFrom(\n from(paths).pipe(\n releaseMainThreadOnItemsCount(1000),\n reduce((builder, path) => builder.accept({ path }), createBuilder()),\n map((builder) => builder.getTree()),\n ),\n );\n }\n\n /**\n * Merges two `HierarchySearchTree` option objects. For the `autoExpand` attribute,\n * `true` takes precedence over `{ groupingLevel }`, and when both sides are\n * `{ groupingLevel }` objects the larger value wins.\n * @public\n */\n export function mergeOptions(\n lhs: HierarchySearchTree[\"options\"] | undefined,\n rhs: HierarchySearchTree[\"options\"] | undefined,\n ): HierarchySearchTree[\"options\"] | undefined {\n if (!lhs) {\n return rhs;\n }\n if (!rhs) {\n return lhs;\n }\n const autoExpand = mergeSearchTreeAutoExpandOption(lhs.autoExpand, rhs.autoExpand);\n const options: NonNullable<HierarchySearchTree[\"options\"]> = {\n ...(autoExpand ? { autoExpand } : undefined),\n };\n return Object.keys(options).length > 0 ? options : undefined;\n }\n\n function mergeSearchTreeAutoExpandOption(\n lhs: NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined,\n rhs: NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined,\n ): NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined {\n if (!lhs) {\n return rhs;\n }\n if (!rhs) {\n return lhs;\n }\n return lhs === true || rhs === true ? true : { groupingLevel: Math.max(lhs.groupingLevel, rhs.groupingLevel) };\n }\n}\n\nfunction extractSearchPropsInternal(\n rootLevelSearchProps: HierarchySearchTree[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"search\"> | undefined,\n):\n | {\n childrenTargetPaths?: HierarchySearchTree[];\n hasSearchTargetAncestor: boolean;\n }\n | undefined {\n if (!parentNode) {\n return rootLevelSearchProps ? { childrenTargetPaths: rootLevelSearchProps, hasSearchTargetAncestor: false } : undefined;\n }\n const searchProps: {\n childrenTargetPaths?: HierarchySearchTree[];\n hasSearchTargetAncestor: boolean;\n } = {\n ...(parentNode.search?.childrenTargetPaths ? { childrenTargetPaths: parentNode.search.childrenTargetPaths } : undefined),\n hasSearchTargetAncestor: !!parentNode.search?.hasSearchTargetAncestor || !!parentNode.search?.isSearchTarget,\n };\n return searchProps.childrenTargetPaths || searchProps.hasSearchTargetAncestor ? searchProps : undefined;\n}\n\n/**\n * Creates a set of utilities for making it easier to search the given hierarchy\n * level.\n *\n * @public\n */\nexport function createHierarchySearchHelper(\n rootLevelSearchProps: HierarchySearchTree[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"search\"> | undefined,\n) {\n const searchProps = extractSearchPropsInternal(rootLevelSearchProps, parentNode);\n const hasSearch = !!searchProps;\n\n function saveSearchPropsFromPathsIntoReducer(\n extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n nodeKey: InstancesNodeKey | GenericNodeKey;\n } & (\n | {\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }\n | {}\n ),\n ): void;\n function saveSearchPropsFromPathsIntoReducer(extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n nodeKey: InstancesNodeKey | GenericNodeKey;\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): void | Promise<void>;\n function saveSearchPropsFromPathsIntoReducer(\n extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n nodeKey: InstancesNodeKey | GenericNodeKey;\n } & (\n | { pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean }\n | { asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean> }\n | {}\n ),\n ): void | Promise<void> {\n // Passes down matching hierarchy search trees to the reducer.\n // It uses `nodeKey`, `pathMatcher` or `asyncPathMatcher` to check if `HierarchyNodeIdentifier` in the search tree item's identifier matches the node\n // and if it does, the path is passed down to the reducer.\n // This function returns a promise only if `asyncPathMatcher` returns a promise.\n if (!searchProps?.childrenTargetPaths) {\n return;\n }\n const matchedTreePromises = new Array<Promise<HierarchySearchTree | undefined>>();\n for (const childrenSearchTree of searchProps.childrenTargetPaths) {\n if (\"asyncPathMatcher\" in extractionProps) {\n const matchesPossiblyPromise = extractionProps.asyncPathMatcher(childrenSearchTree.identifier);\n if (matchesPossiblyPromise instanceof Promise) {\n matchedTreePromises.push(matchesPossiblyPromise.then((matches) => (matches ? childrenSearchTree : undefined)));\n } else if (matchesPossiblyPromise) {\n extractionProps.pathsReducer.accept(childrenSearchTree);\n }\n } else {\n const matches =\n \"pathMatcher\" in extractionProps\n ? extractionProps.pathMatcher(childrenSearchTree.identifier)\n : nodeKeyMatchesIdentifier(extractionProps.nodeKey, childrenSearchTree.identifier);\n if (matches) {\n extractionProps.pathsReducer.accept(childrenSearchTree);\n }\n }\n }\n if (matchedTreePromises.length === 0) {\n return;\n }\n return Promise.all(matchedTreePromises).then((matchedTrees) =>\n matchedTrees.forEach((matchedTree) => matchedTree && extractionProps.pathsReducer.accept(matchedTree)),\n );\n }\n\n function createChildNodeProps(props: { nodeKey: InstancesNodeKey | GenericNodeKey }): Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(props: {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }): Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(props: {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): Promise<Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined> | Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(\n props: { nodeKey: InstancesNodeKey | GenericNodeKey } & (\n | {\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }\n | {\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }\n | {}\n ),\n ): Promise<Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined> | Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined {\n if (!hasSearch) {\n return undefined;\n }\n\n const reducer = new MatchingSearchPathsReducer(searchProps.hasSearchTargetAncestor);\n if (\"asyncPathMatcher\" in props) {\n const extractResult = saveSearchPropsFromPathsIntoReducer({ pathsReducer: reducer, nodeKey: props.nodeKey, asyncPathMatcher: props.asyncPathMatcher });\n if (extractResult instanceof Promise) {\n return extractResult.then(() => reducer.aggregatedOptions);\n }\n } else {\n saveSearchPropsFromPathsIntoReducer({ pathsReducer: reducer, ...props });\n }\n return reducer.aggregatedOptions;\n }\n\n return {\n /** Returns a flag indicating if the hierarchy level is filtered. */\n hasSearch,\n /**\n * Returns a flag indicating whether this hierarchy level has an ancestor node\n * that is a search target. That generally means that this and all downstream hierarchy\n * levels should be displayed without search being applied to them, even if search paths\n * say otherwise.\n */\n hasSearchTargetAncestor: searchProps?.hasSearchTargetAncestor ?? false,\n /**\n * Returns a list of hierarchy node identifiers that apply specifically for this\n * hierarchy level. Returns `undefined` if search is not applied to this level.\n */\n getChildNodeSearchIdentifiers: () => {\n if (!searchProps?.childrenTargetPaths) {\n return undefined;\n }\n return searchProps.childrenTargetPaths.map(({ identifier }) => identifier);\n },\n /**\n * When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `search`\n * and `autoExpand`) to be set based on the search paths and search options. This function calculates\n * these props for a child node based on its key or path matcher.\n *\n * When using `pathMatcher` or `asyncPathMatcher` prop, callers have more flexibility to decide whether the given `HierarchyNodeIdentifier` applies\n * to their node. For example, only some parts of the identifier can be checked for improved performance. Otherwise, the\n * `nodeKey` prop can be used to check the whole identifier.\n *\n * There are multiple overloads of `createChildNodeProps`: depending on props type it returns different values:\n * - `asyncPathMatcher` is provided - returns either Promise or the regular return value based on whether or not `asyncPathMatcher` returns a `Promise`.\n * - `pathMatcher` or only `nodeKey` is provided - returns undefined **or** `search` and `autoExpand` prop from `HierarchyNode`;\n */\n createChildNodeProps,\n };\n}\n\nfunction nodeKeyMatchesIdentifier(nodeKey: InstancesNodeKey | GenericNodeKey, identifier: HierarchyNodeIdentifier): boolean {\n return (\n (HierarchyNodeKey.isGeneric(nodeKey) && HierarchyNodeIdentifier.equal(identifier, nodeKey)) ||\n (HierarchyNodeKey.isInstances(nodeKey) && nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier.equal(identifier, ik)))\n );\n}\n\n/**\n * Extracts information from search paths and later returns `search` and `autoExpand` values from `HierarchyNode`.\n *\n * Saved values can be applied to a single `HierarchyNode` - this means that a new reducer should be created every time these props are requested for a `HierarchyNode`.\n *\n * Extracts information using `accept` function:\n * - Determines if node is search target, and if it is saves the options as `searchTargetOptions`\n * - Saves `HierarchySearchPathOptions` and `childrenTargetPaths`\n */\nclass MatchingSearchPathsReducer {\n private _childrenTargetPaths = new Array<HierarchySearchTree>();\n private _isSearchTarget = false;\n private _options: HierarchySearchTree[\"options\"] | undefined = undefined;\n\n public constructor(private _hasSearchTargetAncestor: boolean) {}\n\n public accept(tree: HierarchySearchTree): void {\n if (tree.isTarget || tree.children === undefined) {\n this._isSearchTarget = true;\n }\n if (tree.children && tree.children.length > 0) {\n this._childrenTargetPaths.push(...tree.children);\n }\n this._options = HierarchySearchTree.mergeOptions(this._options, tree.options);\n }\n\n public get aggregatedOptions() {\n const search =\n this._hasSearchTargetAncestor || this._isSearchTarget || this._childrenTargetPaths.length > 0 || this._options\n ? {\n ...(this._hasSearchTargetAncestor ? { hasSearchTargetAncestor: true } : undefined),\n ...(this._isSearchTarget ? { isSearchTarget: true } : undefined),\n ...(this._childrenTargetPaths.length > 0 ? { childrenTargetPaths: this._childrenTargetPaths } : undefined),\n ...(this._options ? { options: this._options } : undefined),\n }\n : undefined;\n const autoExpand = this._options?.autoExpand === true;\n return {\n ...(search ? { search } : undefined),\n ...(autoExpand ? { autoExpand } : undefined),\n };\n }\n}\n"]}
1
+ {"version":3,"file":"HierarchySearch.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchySearch.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAolBhG,kEA4IC;AA9tBD,+BAAyD;AACzD,sDAAiD;AACjD,6EAAuE;AACvE,+DAAyD;AACzD,oFAA0F;AAiE1F,cAAc;AACd,2DAA2D;AAC3D,IAAiB,mBAAmB,CAmEnC;AAnED,WAAiB,mBAAmB;IAClC;;;OAGG;IACH,SAAgB,SAAS,CAAC,MAA2B;QACnD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC1B,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,6BAAS,YAKxB,CAAA;IAED;;;;;;;;;;;;OAYG;IACH,SAAgB,YAAY,CAC1B,GAA2C,EA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B,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChF,CAAC;IAED,IAAW,iBAAiB;QAC1B,MAAM,MAAM,GACV,IAAI,CAAC,wBAAwB,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ;YAC5G,CAAC,CAAC;gBACE,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAClF,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAChE,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC1G,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;aAC5D;YACH,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,KAAK,IAAI,CAAC;QACtD,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;IAChG,CAAC;CACF","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 { firstValueFrom, from, map, reduce } from \"rxjs\";\nimport { Dictionary } from \"@itwin/core-bentley\";\nimport { HierarchyNodeIdentifier } from \"./HierarchyNodeIdentifier.js\";\nimport { HierarchyNodeKey } from \"./HierarchyNodeKey.js\";\nimport { releaseMainThreadOnItemsCount } from \"./internal/operators/ReleaseMainThread.js\";\n\nimport type { NonGroupingHierarchyNode } from \"./HierarchyNode.js\";\nimport type { HierarchyNodeIdentifiersPath } from \"./HierarchyNodeIdentifier.js\";\nimport type { GenericNodeKey, InstancesNodeKey } from \"./HierarchyNodeKey.js\";\n\n/** @public */\nexport interface HierarchySearchPathOptions {\n /**\n * This option specifies the way `autoExpand` flag should be assigned to nodes in the searched hierarchy.\n * - If it's `false` or `undefined`, nodes have no 'autoExpand' flag.\n * - If it's `true`, then all nodes up to the search target will have `autoExpand` flag.\n * - If it's a object with `groupingLevel` then `groupingLevel` determines the number of grouping levels to expand for\n * the search target.\n */\n reveal?:\n | boolean\n | {\n /**\n * Index of the node in search path should be revealed in hierarchy by auto-expanding its ancestors.\n *\n * Use when you want to expand up to specific instance node and don't care about grouping nodes.\n *\n * **Use case example:**\n *\n * All nodes up to `Element1` should be expanded in the following hierarchy:\n * - Node1\n * - GroupingNode1\n * - GroupingNode2\n * - Element1\n * - Element2\n *\n * Provide `{ path: [Node1, Element1], reveal: { depthInPath: 1 } }`\n *\n * **NOTE**: All nodes that are up to `depthInPath` will be expanded **except** search targets.\n */\n depthInPath: number;\n }\n | {\n /**\n * The number of grouping levels to expand for the search target. For example, if `groupingLevel` is set to `2`, then all grouping nodes up to the second level\n * will have the `autoExpand` flag.\n *\n * **Note:** if search target has less grouping levels than specified by this attribute, then all grouping nodes up to the search target will have\n * the `autoExpand` flag, but the search target itself won't have the `autoExpand` flag.\n */\n groupingLevel: number;\n };\n /**\n * This option specifies whether or not search target should be expanded.\n * - If it's `false` or `undefined`, search target won't have 'autoExpand' flag.\n * - If it's `true`, search target will have `autoExpand` flag.\n *\n * **Note:** this attribute does not set `autoExpand` flag on nodes up to the search target. For that use `reveal`.\n */\n autoExpand?: boolean;\n}\n\n/**\n * A path of hierarchy node identifiers for search the hierarchy with additional options.\n * @public\n */\nexport type HierarchySearchPath =\n | HierarchyNodeIdentifiersPath\n | { path: HierarchyNodeIdentifiersPath; options?: HierarchySearchPathOptions };\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchySearchPath {\n /**\n * Normalizes the hierarchy search path to the object form.\n * @public\n */\n export function normalize(source: HierarchySearchPath): Exclude<HierarchySearchPath, HierarchyNodeIdentifiersPath> {\n if (Array.isArray(source)) {\n return { path: source };\n }\n return source;\n }\n\n /**\n * Merges two given `HierarchySearchPathOptions` objects.\n *\n * For the `reveal` attribute, the merge chooses to `reveal` as deep as the deepest input:\n * - if any one of the inputs is `true`, return `true`,\n * - else if only one of the inputs is an object, return it,\n * - else if both inputs are falsy, return `false` or `undefined`,\n * - else:\n * - if only one of the inputs has `groupingLevel` set, return that one,\n * - else compare by matching reveal type (`groupingLevel` or `depthInPath`) and return the deeper one.\n *\n * @public\n */\n export function mergeOptions(\n lhs: HierarchySearchPathOptions | undefined,\n rhs: HierarchySearchPathOptions | undefined,\n ): HierarchySearchPathOptions | undefined {\n const reveal = mergeRevealOptions(lhs?.reveal, rhs?.reveal);\n const autoExpand = mergeAutoExpandOption(lhs?.autoExpand, rhs?.autoExpand);\n return reveal || autoExpand\n ? {\n ...(reveal !== undefined ? { reveal } : undefined),\n ...(autoExpand !== undefined ? { autoExpand } : undefined),\n }\n : undefined;\n }\n function mergeRevealOptions(\n lhs: HierarchySearchPathOptions[\"reveal\"],\n rhs: HierarchySearchPathOptions[\"reveal\"],\n ): HierarchySearchPathOptions[\"reveal\"] {\n if (rhs === true || lhs === true) {\n return true;\n }\n if (!rhs || !lhs) {\n return !!rhs ? rhs : lhs;\n }\n\n if (\"groupingLevel\" in lhs) {\n if (\"groupingLevel\" in rhs) {\n return lhs.groupingLevel > rhs.groupingLevel ? lhs : rhs;\n }\n return lhs;\n } else if (\"groupingLevel\" in rhs) {\n return rhs;\n }\n\n return lhs.depthInPath > rhs.depthInPath ? lhs : rhs;\n }\n\n function mergeAutoExpandOption(\n lhs: HierarchySearchPathOptions[\"autoExpand\"],\n rhs: HierarchySearchPathOptions[\"autoExpand\"],\n ): HierarchySearchPathOptions[\"autoExpand\"] {\n return lhs || rhs ? true : undefined;\n }\n}\n\n/**\n * A tree structure representing hierarchy search paths. Each node in the tree corresponds\n * to a hierarchy node identifier and may have children that represent deeper levels in the\n * hierarchy.\n *\n * The `HierarchySearchTree.createBuilder` or `HierarchySearchTree.createFromPathsList` are\n * typically used create this tree from a flat list of search paths.\n *\n * @public\n */\nexport interface HierarchySearchTree {\n /** Identifier of the hierarchy node this tree entry represents. */\n identifier: HierarchyNodeIdentifier;\n\n /**\n * When `true`, indicates that this node is a search target.\n *\n * Note: A `HierarchySearchTree` node is considered a search target if it has no children, even if `isTarget` is not explicitly set to `true`. This\n * is because a node with no children represents the end of a search path.\n */\n isTarget?: boolean;\n\n /** Provides options for handling this search tree entry, such as auto-expansion behavior. */\n options?: {\n /**\n * - `true` to expand the node and its grouping nodes,\n * - `{ groupingLevel: number }` to expand ancestor grouping nodes, e.g. for the following hierarchy:\n * ```\n * - Grouping node A\n * - Instance node A\n * - Grouping node B1\n * - Grouping node B2\n * - ...\n * - Grouping node Bn\n * - Instance node B\n * ```\n *\n * For \"Instance node B\" search tree entry:\n * - `{ groupingLevel: 1 }` expands its first grouping node \"Grouping node B1\",\n * - `{ groupingLevel: 2 }` expands two levels to \"Grouping node B2\".\n * - `{ groupingLevel: Number.MAX_SAFE_INTEGER }` expands all grouping nodes of that instance node.\n *\n * Note that there's a slight difference between `HierarchySearchTree.options.autoExpand` and\n * `HierarchySearchPath.options.reveal`. The latter option reveals the search target node by expanding its ancestors,\n * while the `HierarchySearchTree.options.autoExpand` also expands the target node itself.\n */\n autoExpand?: boolean | { groupingLevel: number };\n };\n\n /** Child search tree entries representing the next level(s) in the hierarchy search paths. */\n children?: HierarchySearchTree[];\n}\n\n/** @public */\nexport namespace HierarchySearchTree {\n /** @public */\n type HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras extends Record<string, unknown>> = Readonly<\n Pick<HierarchySearchTree, \"identifier\" | \"options\"> & { extras: TExtras }\n > &\n Pick<HierarchySearchTree, \"isTarget\">;\n /** @public */\n type HierarchySearchTreeBuilderAcceptHandlerTreeInput = Readonly<\n Pick<HierarchySearchTree, \"identifier\" | \"isTarget\" | \"options\"> & { hasChildren: boolean }\n >;\n /** @public */\n interface HierarchySearchTreeBuilderAcceptHandler<TExtras extends Record<string, unknown>> {\n /**\n * Called when a new entry is added to the tree. Return `true` to accept the entry, `false` to reject it and all its children, if any.\n */\n onNewEntry?: (props: {\n /** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */\n parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;\n /** The new entry being added to the tree. */\n inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;\n }) => boolean;\n /**\n * Called when a new entry is added to the tree and accepted (either it's a new entry or it merges with an existing entry). This can be used to perform\n * side effects such as assigning extra information to the tree entry.\n */\n onEntryHandled?: (props: {\n /** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */\n parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;\n /** The tree entry that has been handled. It's allowed to mutate this entry. */\n treeEntry: HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>;\n /** The input entry being added to the tree. */\n inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;\n }) => void;\n }\n /**\n * Props supplied to HierarchySearchTreeBuilder.accept() method for accepting a hierarchy search path or tree with an optional handler for customizing\n * the behavior of the builder when accepting new entries.\n * @public\n */\n type HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras extends Record<string, unknown>> = (\n | { path: HierarchySearchPath }\n | { tree: HierarchySearchTree }\n ) & {\n /** An optional handler for customizing the behavior of the builder when accepting new entries. */\n handler?: HierarchySearchTreeBuilderAcceptHandler<TAcceptHandlerExtras>;\n };\n /**\n * Props supplied to HierarchySearchTreeBuilder.getTree() method for customizing the resulting tree entries, e.g. by omitting some of them or\n * assigning extra information to them.\n * @public\n */\n interface HierarchySearchTreeBuilderFinalizeTreeProps<TAcceptHandlerExtras extends Record<string, unknown>> {\n /**\n * A function that can be used to process each tree entry before it's added to the final tree.\n *\n * Return `undefined` to omit the entry and its entire branch from the resulting tree.\n */\n processEntry?: (props: {\n treeEntry: HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TAcceptHandlerExtras>;\n parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TAcceptHandlerExtras>>;\n }) => (Omit<HierarchySearchTree, \"children\"> & { extras: TAcceptHandlerExtras }) | undefined;\n }\n /**\n * An utility that accepts hierarchy search paths or search trees one by one and builds a `HierarchySearchTree` structure based on them.\n * @public\n */\n interface HierarchySearchTreeBuilder<TAcceptHandlerExtras extends Record<string, unknown>> {\n /**\n * Accepts a hierarchy search path or paths' tree and adds it to the builder's internal tree structure. Use `getTree()` to create\n * a `HierarchySearchTree[]` from the added paths.\n */\n accept(\n props: HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras>,\n ): HierarchySearchTreeBuilder<TAcceptHandlerExtras>;\n /**\n * Create `HierarchySearchTree[]` from currently added search paths.\n */\n getTree(props?: HierarchySearchTreeBuilderFinalizeTreeProps<TAcceptHandlerExtras>): HierarchySearchTree[];\n }\n\n /**\n * Create a `HierarchySearchTree` builder utility that accepts hierarchy search paths or search trees one by one and builds\n * a `HierarchySearchTree` structure based on them.\n *\n * Usage example:\n *\n * ```ts\n * const builder = HierarchySearchTree.createBuilder();\n * for (const path of searchPaths) {\n * builder.accept({ path });\n * }\n * const searchTree = builder.getTree();\n * ```\n *\n * @public\n */\n export function createBuilder<\n TAcceptHandlerExtras extends Record<string, unknown> = Record<string, unknown>,\n >(): HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n type HierarchySearchTreeDictionaryEntry = Omit<HierarchySearchTree, \"children\"> & {\n children?: HierarchySearchTreeDictionary;\n extras: TAcceptHandlerExtras;\n };\n type HierarchySearchTreeDictionary = Dictionary<HierarchyNodeIdentifier, HierarchySearchTreeDictionaryEntry>;\n type AcceptHandler = HierarchySearchTreeBuilderAcceptHandler<TAcceptHandlerExtras>;\n return new (class Impl implements HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n #rootsDictionary: HierarchySearchTreeDictionary = new Dictionary(HierarchyNodeIdentifier.compare);\n\n static #mapDictionaryToTree(\n dictionary: HierarchySearchTreeDictionary,\n parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TAcceptHandlerExtras>>,\n props?: HierarchySearchTreeBuilderFinalizeTreeProps<TAcceptHandlerExtras>,\n ): HierarchySearchTree[] {\n const list: HierarchySearchTree[] = [];\n for (const { children, ...entry } of dictionary.values()) {\n let processedEntry: (Omit<HierarchySearchTree, \"children\"> & { extras: TAcceptHandlerExtras }) | undefined =\n entry;\n if (props?.processEntry) {\n processedEntry = props.processEntry({ treeEntry: entry, parentEntries });\n }\n if (!processedEntry) {\n continue;\n }\n const { extras: _, ...entryWithoutExtras } = processedEntry;\n parentEntries.push(processedEntry);\n list.push({\n ...entryWithoutExtras,\n ...(children ? { children: Impl.#mapDictionaryToTree(children, parentEntries, props) } : undefined),\n });\n parentEntries.pop();\n }\n return list;\n }\n\n static #assignAutoExpandOptionsBasedOnReveal(\n treePath: Pick<HierarchySearchTree, \"options\">[],\n revealOption: HierarchySearchPathOptions[\"reveal\"] | undefined,\n ) {\n if (revealOption === true) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // auto-expand all grouping nodes of the revealed node\n return { autoExpand: { groupingLevel: Number.MAX_SAFE_INTEGER } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n } else if (revealOption && \"groupingLevel\" in revealOption) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // the last entry should have `autoExpand` with `groupingLevel` set to the value based on `reveal.groupingLevel`\n return { autoExpand: { groupingLevel: Math.max(revealOption.groupingLevel - 1, 0) } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n } else if (revealOption && \"depthInPath\" in revealOption) {\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: Math.min(revealOption.depthInPath, treePath.length - 1),\n getEntryOptions: (index, targetEntryIndex) => {\n if (index === targetEntryIndex) {\n // auto-expand all grouping nodes of the revealed node\n return { autoExpand: { groupingLevel: Number.MAX_SAFE_INTEGER } };\n }\n // auto-expand all parent nodes\n return { autoExpand: true };\n },\n });\n }\n }\n\n static #assignOptionsOnTreePath({\n treePath,\n targetEntryIndex,\n getEntryOptions,\n }: {\n treePath: Array<Pick<HierarchySearchTree, \"options\">>;\n targetEntryIndex: number;\n getEntryOptions: (index: number, targetEntryIndex: number) => HierarchySearchTree[\"options\"] | undefined;\n }) {\n // set all parent entries to auto-expand\n for (let i = 0; i <= targetEntryIndex; i++) {\n const options = mergeOptions(treePath[i].options, getEntryOptions(i, targetEntryIndex));\n if (options) {\n treePath[i].options = options;\n }\n }\n }\n\n #acceptNode({\n parentEntries,\n level,\n node,\n handler,\n }: {\n parentEntries: HierarchySearchTreeDictionaryEntry[];\n level: HierarchySearchTreeDictionary;\n node: Pick<HierarchySearchTree, \"identifier\" | \"isTarget\"> & { hasChildren: boolean };\n handler?: AcceptHandler;\n }): HierarchySearchTreeDictionaryEntry | undefined {\n let entry = level.get(node.identifier);\n if (!entry) {\n if (handler?.onNewEntry && !handler.onNewEntry({ parentEntries, inputEntry: node })) {\n return undefined;\n }\n entry = {\n identifier: node.identifier,\n children: node.hasChildren ? new Dictionary(HierarchyNodeIdentifier.compare) : undefined,\n extras: {} as TAcceptHandlerExtras,\n };\n level.set(node.identifier, entry);\n }\n\n const isNodeSearchTarget = node.isTarget || !node.hasChildren;\n if (isNodeSearchTarget && entry.children) {\n entry.isTarget = true;\n }\n if (!entry.children && node.hasChildren) {\n // Existing leaf nodes are implied targets. Preserve that status when adding children.\n entry.isTarget = true;\n entry.children = new Dictionary(HierarchyNodeIdentifier.compare);\n }\n handler?.onEntryHandled?.({ parentEntries, treeEntry: entry, inputEntry: node });\n return entry;\n }\n\n #acceptPath({ path, handler }: { path: HierarchySearchPath; handler?: AcceptHandler }) {\n const normalized = HierarchySearchPath.normalize(path);\n const treePath: Array<HierarchySearchTreeDictionaryEntry> = [];\n let currentLevel: HierarchySearchTreeDictionary = this.#rootsDictionary;\n for (let i = 0; i < normalized.path.length; i++) {\n const identifier = normalized.path[i];\n const acceptedNode = this.#acceptNode({\n parentEntries: treePath,\n node: { identifier, hasChildren: i < normalized.path.length - 1 },\n level: currentLevel,\n handler,\n });\n if (!acceptedNode) {\n break;\n }\n treePath.push(acceptedNode);\n if (!acceptedNode.children) {\n break;\n }\n currentLevel = acceptedNode.children;\n }\n\n if (treePath.length === 0) {\n return;\n }\n\n // handle auto-expand\n const lastNode = treePath[treePath.length - 1];\n if (normalized.options?.autoExpand) {\n (lastNode.options ??= {}).autoExpand = true;\n }\n\n // handle auto-reveal\n Impl.#assignAutoExpandOptionsBasedOnReveal(treePath, normalized.options?.reveal);\n }\n\n #acceptTree({ tree, handler }: { tree: HierarchySearchTree; handler?: AcceptHandler }) {\n const acceptTreeNode = (\n parentEntries: HierarchySearchTreeDictionaryEntry[],\n parentInputs: HierarchySearchTree[],\n level: HierarchySearchTreeDictionary,\n node: HierarchySearchTree,\n ) => {\n const acceptedNode = this.#acceptNode({\n parentEntries,\n node: { ...node, hasChildren: node.children !== undefined },\n level,\n handler,\n });\n if (!acceptedNode) {\n // It was decided to reject this node and its children, if any\n return;\n }\n const treePath = [...parentEntries, acceptedNode];\n const inputsPath = [...parentInputs, node];\n if (!node.children || node.isTarget) {\n // Found an effective search target - merge options from its path\n Impl.#assignOptionsOnTreePath({\n treePath,\n targetEntryIndex: treePath.length - 1,\n getEntryOptions: (index) => inputsPath[index].options,\n });\n }\n const currentLevel = acceptedNode.children;\n if (currentLevel) {\n node.children?.forEach((child) => acceptTreeNode(treePath, inputsPath, currentLevel, child));\n }\n };\n acceptTreeNode([], [], this.#rootsDictionary, tree);\n }\n\n public accept(\n props: ({ path: HierarchySearchPath } | { tree: HierarchySearchTree }) & { handler?: AcceptHandler },\n ): HierarchySearchTreeBuilder<TAcceptHandlerExtras> {\n if (\"path\" in props) {\n this.#acceptPath(props);\n } else {\n this.#acceptTree(props);\n }\n return this;\n }\n\n public getTree(props?: HierarchySearchTreeBuilderFinalizeTreeProps<TAcceptHandlerExtras>) {\n return Impl.#mapDictionaryToTree(this.#rootsDictionary, [], props);\n }\n })();\n }\n\n /**\n * Builds a list of `HierarchySearchTree` nodes from an iterable of search paths. Shared\n * path prefixes are merged so that each unique hierarchy node identifier appears only once\n * per level. The resulting trees carry `isTarget`, `options`, and `children` attributes\n * derived from the paths and their options (`autoExpand`, `reveal`).\n *\n * @public\n */\n export async function createFromPathsList(paths: Iterable<HierarchySearchPath>): Promise<HierarchySearchTree[]> {\n return firstValueFrom(\n from(paths).pipe(\n releaseMainThreadOnItemsCount(1000),\n reduce((builder, path) => builder.accept({ path }), createBuilder()),\n map((builder) => builder.getTree()),\n ),\n );\n }\n\n /**\n * Merges two `HierarchySearchTree` option objects. For the `autoExpand` attribute,\n * `true` takes precedence over `{ groupingLevel }`, and when both sides are\n * `{ groupingLevel }` objects the larger value wins.\n * @public\n */\n export function mergeOptions(\n lhs: HierarchySearchTree[\"options\"] | undefined,\n rhs: HierarchySearchTree[\"options\"] | undefined,\n ): HierarchySearchTree[\"options\"] | undefined {\n if (!lhs) {\n return rhs;\n }\n if (!rhs) {\n return lhs;\n }\n const autoExpand = mergeSearchTreeAutoExpandOption(lhs.autoExpand, rhs.autoExpand);\n const options: NonNullable<HierarchySearchTree[\"options\"]> = { ...(autoExpand ? { autoExpand } : undefined) };\n return Object.keys(options).length > 0 ? options : undefined;\n }\n\n function mergeSearchTreeAutoExpandOption(\n lhs: NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined,\n rhs: NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined,\n ): NonNullable<HierarchySearchTree[\"options\"]>[\"autoExpand\"] | undefined {\n if (!lhs) {\n return rhs;\n }\n if (!rhs) {\n return lhs;\n }\n return lhs === true || rhs === true ? true : { groupingLevel: Math.max(lhs.groupingLevel, rhs.groupingLevel) };\n }\n}\n\nfunction extractSearchPropsInternal(\n rootLevelSearchProps: HierarchySearchTree[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"search\"> | undefined,\n): { childrenTargetPaths?: HierarchySearchTree[]; hasSearchTargetAncestor: boolean } | undefined {\n if (!parentNode) {\n return rootLevelSearchProps\n ? { childrenTargetPaths: rootLevelSearchProps, hasSearchTargetAncestor: false }\n : undefined;\n }\n const searchProps: { childrenTargetPaths?: HierarchySearchTree[]; hasSearchTargetAncestor: boolean } = {\n ...(parentNode.search?.childrenTargetPaths\n ? { childrenTargetPaths: parentNode.search.childrenTargetPaths }\n : undefined),\n hasSearchTargetAncestor: !!parentNode.search?.hasSearchTargetAncestor || !!parentNode.search?.isSearchTarget,\n };\n return searchProps.childrenTargetPaths || searchProps.hasSearchTargetAncestor ? searchProps : undefined;\n}\n\n/**\n * Creates a set of utilities for making it easier to search the given hierarchy\n * level.\n *\n * @public\n */\nexport function createHierarchySearchHelper(\n rootLevelSearchProps: HierarchySearchTree[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"search\"> | undefined,\n) {\n const searchProps = extractSearchPropsInternal(rootLevelSearchProps, parentNode);\n const hasSearch = !!searchProps;\n\n function saveSearchPropsFromPathsIntoReducer(\n extractionProps: { pathsReducer: MatchingSearchPathsReducer; nodeKey: InstancesNodeKey | GenericNodeKey } & (\n | { pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean }\n | {}\n ),\n ): void;\n function saveSearchPropsFromPathsIntoReducer(extractionProps: {\n pathsReducer: MatchingSearchPathsReducer;\n nodeKey: InstancesNodeKey | GenericNodeKey;\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): void | Promise<void>;\n function saveSearchPropsFromPathsIntoReducer(\n extractionProps: { pathsReducer: MatchingSearchPathsReducer; nodeKey: InstancesNodeKey | GenericNodeKey } & (\n | { pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean }\n | { asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean> }\n | {}\n ),\n ): void | Promise<void> {\n // Passes down matching hierarchy search trees to the reducer.\n // It uses `nodeKey`, `pathMatcher` or `asyncPathMatcher` to check if `HierarchyNodeIdentifier` in the search tree item's identifier matches the node\n // and if it does, the path is passed down to the reducer.\n // This function returns a promise only if `asyncPathMatcher` returns a promise.\n if (!searchProps?.childrenTargetPaths) {\n return;\n }\n const matchedTreePromises = new Array<Promise<HierarchySearchTree | undefined>>();\n for (const childrenSearchTree of searchProps.childrenTargetPaths) {\n if (\"asyncPathMatcher\" in extractionProps) {\n const matchesPossiblyPromise = extractionProps.asyncPathMatcher(childrenSearchTree.identifier);\n if (matchesPossiblyPromise instanceof Promise) {\n matchedTreePromises.push(\n matchesPossiblyPromise.then((matches) => (matches ? childrenSearchTree : undefined)),\n );\n } else if (matchesPossiblyPromise) {\n extractionProps.pathsReducer.accept(childrenSearchTree);\n }\n } else {\n const matches =\n \"pathMatcher\" in extractionProps\n ? extractionProps.pathMatcher(childrenSearchTree.identifier)\n : nodeKeyMatchesIdentifier(extractionProps.nodeKey, childrenSearchTree.identifier);\n if (matches) {\n extractionProps.pathsReducer.accept(childrenSearchTree);\n }\n }\n }\n if (matchedTreePromises.length === 0) {\n return;\n }\n return Promise.all(matchedTreePromises).then((matchedTrees) =>\n matchedTrees.forEach((matchedTree) => matchedTree && extractionProps.pathsReducer.accept(matchedTree)),\n );\n }\n\n function createChildNodeProps(props: {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n }): Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(props: {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n }): Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined;\n function createChildNodeProps(props: {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }):\n | Promise<Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined>\n | Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\">\n | undefined;\n function createChildNodeProps(\n props: { nodeKey: InstancesNodeKey | GenericNodeKey } & (\n | { asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean> }\n | { pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean }\n | {}\n ),\n ):\n | Promise<Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\"> | undefined>\n | Pick<NonGroupingHierarchyNode, \"search\" | \"autoExpand\">\n | undefined {\n if (!hasSearch) {\n return undefined;\n }\n\n const reducer = new MatchingSearchPathsReducer(searchProps.hasSearchTargetAncestor);\n if (\"asyncPathMatcher\" in props) {\n const extractResult = saveSearchPropsFromPathsIntoReducer({\n pathsReducer: reducer,\n nodeKey: props.nodeKey,\n asyncPathMatcher: props.asyncPathMatcher,\n });\n if (extractResult instanceof Promise) {\n return extractResult.then(() => reducer.aggregatedOptions);\n }\n } else {\n saveSearchPropsFromPathsIntoReducer({ pathsReducer: reducer, ...props });\n }\n return reducer.aggregatedOptions;\n }\n\n return {\n /** Returns a flag indicating if the hierarchy level is filtered. */\n hasSearch,\n /**\n * Returns a flag indicating whether this hierarchy level has an ancestor node\n * that is a search target. That generally means that this and all downstream hierarchy\n * levels should be displayed without search being applied to them, even if search paths\n * say otherwise.\n */\n hasSearchTargetAncestor: searchProps?.hasSearchTargetAncestor ?? false,\n /**\n * Returns a list of hierarchy node identifiers that apply specifically for this\n * hierarchy level. Returns `undefined` if search is not applied to this level.\n */\n getChildNodeSearchIdentifiers: () => {\n if (!searchProps?.childrenTargetPaths) {\n return undefined;\n }\n return searchProps.childrenTargetPaths.map(({ identifier }) => identifier);\n },\n /**\n * When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `search`\n * and `autoExpand`) to be set based on the search paths and search options. This function calculates\n * these props for a child node based on its key or path matcher.\n *\n * When using `pathMatcher` or `asyncPathMatcher` prop, callers have more flexibility to decide whether the given `HierarchyNodeIdentifier` applies\n * to their node. For example, only some parts of the identifier can be checked for improved performance. Otherwise, the\n * `nodeKey` prop can be used to check the whole identifier.\n *\n * There are multiple overloads of `createChildNodeProps`: depending on props type it returns different values:\n * - `asyncPathMatcher` is provided - returns either Promise or the regular return value based on whether or not `asyncPathMatcher` returns a `Promise`.\n * - `pathMatcher` or only `nodeKey` is provided - returns undefined **or** `search` and `autoExpand` prop from `HierarchyNode`;\n */\n createChildNodeProps,\n };\n}\n\nfunction nodeKeyMatchesIdentifier(\n nodeKey: InstancesNodeKey | GenericNodeKey,\n identifier: HierarchyNodeIdentifier,\n): boolean {\n return (\n (HierarchyNodeKey.isGeneric(nodeKey) && HierarchyNodeIdentifier.equal(identifier, nodeKey)) ||\n (HierarchyNodeKey.isInstances(nodeKey) &&\n nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier.equal(identifier, ik)))\n );\n}\n\n/**\n * Extracts information from search paths and later returns `search` and `autoExpand` values from `HierarchyNode`.\n *\n * Saved values can be applied to a single `HierarchyNode` - this means that a new reducer should be created every time these props are requested for a `HierarchyNode`.\n *\n * Extracts information using `accept` function:\n * - Determines if node is search target, and if it is saves the options as `searchTargetOptions`\n * - Saves `HierarchySearchPathOptions` and `childrenTargetPaths`\n */\nclass MatchingSearchPathsReducer {\n private _childrenTargetPaths = new Array<HierarchySearchTree>();\n private _isSearchTarget = false;\n private _options: HierarchySearchTree[\"options\"] | undefined = undefined;\n\n public constructor(private _hasSearchTargetAncestor: boolean) {}\n\n public accept(tree: HierarchySearchTree): void {\n if (tree.isTarget || tree.children === undefined) {\n this._isSearchTarget = true;\n }\n if (tree.children && tree.children.length > 0) {\n this._childrenTargetPaths.push(...tree.children);\n }\n this._options = HierarchySearchTree.mergeOptions(this._options, tree.options);\n }\n\n public get aggregatedOptions() {\n const search =\n this._hasSearchTargetAncestor || this._isSearchTarget || this._childrenTargetPaths.length > 0 || this._options\n ? {\n ...(this._hasSearchTargetAncestor ? { hasSearchTargetAncestor: true } : undefined),\n ...(this._isSearchTarget ? { isSearchTarget: true } : undefined),\n ...(this._childrenTargetPaths.length > 0 ? { childrenTargetPaths: this._childrenTargetPaths } : undefined),\n ...(this._options ? { options: this._options } : undefined),\n }\n : undefined;\n const autoExpand = this._options?.autoExpand === true;\n return { ...(search ? { search } : undefined), ...(autoExpand ? { autoExpand } : undefined) };\n }\n}\n"]}
@@ -14,7 +14,7 @@ let g_logger = presentation_shared_1.NOOP_LOGGER;
14
14
  * @public
15
15
  */
16
16
  function setLogger(logger) {
17
- g_logger = logger ?? /* c8 ignore next */ presentation_shared_1.NOOP_LOGGER;
17
+ g_logger = logger ?? /* v8 ignore next -- @preserve */ presentation_shared_1.NOOP_LOGGER;
18
18
  }
19
19
  /**
20
20
  * Get logger used by this package.
@@ -1 +1 @@
1
- {"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/hierarchies/Logging.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAahG,8BAEC;AAOD,8BAEC;AAtBD,oEAAyD;AAIzD,gEAAgE;AAChE,IAAI,QAAQ,GAAY,iCAAW,CAAC;AAEpC;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAA2B;IACnD,QAAQ,GAAG,MAAM,IAAI,oBAAoB,CAAC,iCAAW,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS;IACvB,OAAO,QAAQ,CAAC;AAClB,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 { NOOP_LOGGER } from \"@itwin/presentation-shared\";\n\nimport type { ILogger } from \"@itwin/presentation-shared\";\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet g_logger: ILogger = NOOP_LOGGER;\n\n/**\n * Set logger to use by this package. By default the package uses a no-op logger.\n * @public\n */\nexport function setLogger(logger: ILogger | undefined) {\n g_logger = logger ?? /* c8 ignore next */ NOOP_LOGGER;\n}\n\n/**\n * Get logger used by this package.\n * @see `setLogger`\n * @public\n */\nexport function getLogger(): ILogger {\n return g_logger;\n}\n"]}
1
+ {"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/hierarchies/Logging.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAahG,8BAEC;AAOD,8BAEC;AAtBD,oEAAyD;AAIzD,gEAAgE;AAChE,IAAI,QAAQ,GAAY,iCAAW,CAAC;AAEpC;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAA2B;IACnD,QAAQ,GAAG,MAAM,IAAI,iCAAiC,CAAC,iCAAW,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS;IACvB,OAAO,QAAQ,CAAC;AAClB,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 { NOOP_LOGGER } from \"@itwin/presentation-shared\";\n\nimport type { ILogger } from \"@itwin/presentation-shared\";\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet g_logger: ILogger = NOOP_LOGGER;\n\n/**\n * Set logger to use by this package. By default the package uses a no-op logger.\n * @public\n */\nexport function setLogger(logger: ILogger | undefined) {\n g_logger = logger ?? /* v8 ignore next -- @preserve */ NOOP_LOGGER;\n}\n\n/**\n * Get logger used by this package.\n * @see `setLogger`\n * @public\n */\nexport function getLogger(): ILogger {\n return g_logger;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyCache.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/HierarchyCache.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAStE,UAAU,8BAA8B;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gBAAgB;AAChB,qBAAa,cAAc,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAA4D;IACxE,OAAO,CAAC,MAAM,CAAiC;gBAE5B,KAAK,EAAE,8BAA8B;IAKxD,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,iBAAiB;IAyBlB,GAAG,CAAC,YAAY,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC;IAKlD,GAAG,CAAC,YAAY,EAAE,sBAAsB,GAAG,CAAC,GAAG,SAAS;IAKxD,KAAK;CAGb"}
1
+ {"version":3,"file":"HierarchyCache.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/HierarchyCache.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAStE,UAAU,8BAA8B;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gBAAgB;AAChB,qBAAa,cAAc,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAA4D;IACxE,OAAO,CAAC,MAAM,CAAiC;gBAE5B,KAAK,EAAE,8BAA8B;IAKxD,OAAO,CAAC,eAAe;IAuBvB,OAAO,CAAC,iBAAiB;IAyBlB,GAAG,CAAC,YAAY,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC;IAKlD,GAAG,CAAC,YAAY,EAAE,sBAAsB,GAAG,CAAC,GAAG,SAAS;IAKxD,KAAK;CAGb"}
@@ -27,10 +27,7 @@ class HierarchyCache {
27
27
  return { primaryKey: [], variationKey: createVariationKey() };
28
28
  }
29
29
  const parentKeys = props.parentNode.parentKeys;
30
- return {
31
- primaryKey: [...parentKeys, props.parentNode.key],
32
- variationKey: createVariationKey(),
33
- };
30
+ return { primaryKey: [...parentKeys, props.parentNode.key], variationKey: createVariationKey() };
34
31
  }
35
32
  getCacheAccessors(primaryKey, variationKey) {
36
33
  const getMapEntry = (create) => {
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyCache.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/HierarchyCache.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,sDAA4D;AAC5D,gEAA0D;AAkB1D,gBAAgB;AAChB,MAAa,cAAc;IACjB,IAAI,CAA4D;IAChE,MAAM,CAAiC;IAE/C,YAAmB,KAAqC;QACtD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,4BAAa,CAA6C,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAC;IAClH,CAAC;IAEO,eAAe,CACrB,KAGC;QAED,SAAS,kBAAkB;YACzB,MAAM,EAAE,cAAc,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;YAC9E,IAAI,cAAc,KAAK,SAAS,IAAI,uBAAuB,KAAK,SAAS,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;gBAC9G,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,cAAc,EAAE,uBAAuB,EAAE,kBA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;AACX,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 { LRUDictionary, LRUMap } from \"@itwin/core-bentley\";\nimport { HierarchyNodeKey } from \"../HierarchyNodeKey.js\";\n\nimport type { LRUCache } from \"@itwin/core-bentley\";\nimport type { InstanceKey } from \"@itwin/presentation-shared\";\nimport type { GetHierarchyNodesProps } from \"../HierarchyProvider.js\";\n\ninterface HierarchyCacheEntry<T> {\n /** Stores observables for the default case - no instance filter or custom limit for the hierarchy level. */\n primary: T | undefined;\n /** Stores a limited number of variations with custom instance filter and/or custom limit for the hierarchy level. */\n variations: LRUCache<string, T>;\n}\n\ninterface ChildNodeObservablesCacheProps {\n size: number;\n variationsCount?: number;\n}\n\n/** @internal */\nexport class HierarchyCache<T> {\n private _map: LRUDictionary<HierarchyNodeKey[], HierarchyCacheEntry<T>>;\n private _props: ChildNodeObservablesCacheProps;\n\n public constructor(props: ChildNodeObservablesCacheProps) {\n this._props = props;\n this._map = new LRUDictionary<HierarchyNodeKey[], HierarchyCacheEntry<T>>(props.size, compareHierarchyNodeKeys);\n }\n\n private createCacheKeys(\n props: Omit<GetHierarchyNodesProps, \"parentNode\"> & {\n parentNode: { key: HierarchyNodeKey; parentKeys: HierarchyNodeKey[] } | undefined;\n targetInstanceKeys?: InstanceKey[];\n },\n ) {\n function createVariationKey() {\n const { instanceFilter, hierarchyLevelSizeLimit, targetInstanceKeys } = props;\n if (instanceFilter === undefined && hierarchyLevelSizeLimit === undefined && targetInstanceKeys === undefined) {\n return undefined;\n }\n return JSON.stringify({ instanceFilter, hierarchyLevelSizeLimit, targetInstanceKeys });\n }\n\n if (!props.parentNode) {\n return { primaryKey: [], variationKey: createVariationKey() };\n }\n\n const parentKeys = props.parentNode.parentKeys;\n\n return {\n primaryKey: [...parentKeys, props.parentNode.key],\n variationKey: createVariationKey(),\n };\n }\n\n private getCacheAccessors(primaryKey: HierarchyNodeKey[], variationKey?: string) {\n const getMapEntry = (create: boolean) => {\n let entry = this._map.get(primaryKey);\n if (!entry && create) {\n entry = { primary: undefined, variations: new LRUMap(this._props.variationsCount ?? 1) };\n this._map.set(primaryKey, entry);\n }\n return entry;\n };\n if (variationKey) {\n return {\n get: () => getMapEntry(false)?.variations.get(variationKey),\n set: (value: T) => {\n getMapEntry(true)!.variations.set(variationKey, value);\n },\n };\n }\n return {\n get: () => getMapEntry(false)?.primary,\n set: (value: T) => {\n getMapEntry(true)!.primary = value;\n },\n };\n }\n\n public set(requestProps: GetHierarchyNodesProps, value: T) {\n const { primaryKey, variationKey } = this.createCacheKeys(requestProps);\n this.getCacheAccessors(primaryKey, variationKey).set(value);\n }\n\n public get(requestProps: GetHierarchyNodesProps): T | undefined {\n const { primaryKey, variationKey } = this.createCacheKeys(requestProps);\n return this.getCacheAccessors(primaryKey, variationKey).get();\n }\n\n public clear() {\n this._map.clear();\n }\n}\n\nfunction compareHierarchyNodeKeys(lhs: HierarchyNodeKey[], rhs: HierarchyNodeKey[]) {\n if (lhs.length !== rhs.length) {\n return lhs.length - rhs.length;\n }\n for (let i = 0; i < lhs.length; ++i) {\n const keysCompareResult = HierarchyNodeKey.compare(lhs[i], rhs[i]);\n if (keysCompareResult !== 0) {\n return keysCompareResult;\n }\n }\n return 0;\n}\n"]}
1
+ {"version":3,"file":"HierarchyCache.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/HierarchyCache.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,sDAA4D;AAC5D,gEAA0D;AAkB1D,gBAAgB;AAChB,MAAa,cAAc;IACjB,IAAI,CAA4D;IAChE,MAAM,CAAiC;IAE/C,YAAmB,KAAqC;QACtD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,4BAAa,CAA6C,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC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C,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QACpC,MAAM,iBAAiB,GAAG,sCAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,IAAI,iBAAiB,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,iBAAiB,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,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 { LRUDictionary, LRUMap } from \"@itwin/core-bentley\";\nimport { HierarchyNodeKey } from \"../HierarchyNodeKey.js\";\n\nimport type { LRUCache } from \"@itwin/core-bentley\";\nimport type { InstanceKey } from \"@itwin/presentation-shared\";\nimport type { GetHierarchyNodesProps } from \"../HierarchyProvider.js\";\n\ninterface HierarchyCacheEntry<T> {\n /** Stores observables for the default case - no instance filter or custom limit for the hierarchy level. */\n primary: T | undefined;\n /** Stores a limited number of variations with custom instance filter and/or custom limit for the hierarchy level. */\n variations: LRUCache<string, T>;\n}\n\ninterface ChildNodeObservablesCacheProps {\n size: number;\n variationsCount?: number;\n}\n\n/** @internal */\nexport class HierarchyCache<T> {\n private _map: LRUDictionary<HierarchyNodeKey[], HierarchyCacheEntry<T>>;\n private _props: ChildNodeObservablesCacheProps;\n\n public constructor(props: ChildNodeObservablesCacheProps) {\n this._props = props;\n this._map = new LRUDictionary<HierarchyNodeKey[], HierarchyCacheEntry<T>>(props.size, compareHierarchyNodeKeys);\n }\n\n private createCacheKeys(\n props: Omit<GetHierarchyNodesProps, \"parentNode\"> & {\n parentNode: { key: HierarchyNodeKey; parentKeys: HierarchyNodeKey[] } | undefined;\n targetInstanceKeys?: InstanceKey[];\n },\n ) {\n function createVariationKey() {\n const { instanceFilter, hierarchyLevelSizeLimit, targetInstanceKeys } = props;\n if (instanceFilter === undefined && hierarchyLevelSizeLimit === undefined && targetInstanceKeys === undefined) {\n return undefined;\n }\n return JSON.stringify({ instanceFilter, hierarchyLevelSizeLimit, targetInstanceKeys });\n }\n\n if (!props.parentNode) {\n return { primaryKey: [], variationKey: createVariationKey() };\n }\n\n const parentKeys = props.parentNode.parentKeys;\n\n return { primaryKey: [...parentKeys, props.parentNode.key], variationKey: createVariationKey() };\n }\n\n private getCacheAccessors(primaryKey: HierarchyNodeKey[], variationKey?: string) {\n const getMapEntry = (create: boolean) => {\n let entry = this._map.get(primaryKey);\n if (!entry && create) {\n entry = { primary: undefined, variations: new LRUMap(this._props.variationsCount ?? 1) };\n this._map.set(primaryKey, entry);\n }\n return entry;\n };\n if (variationKey) {\n return {\n get: () => getMapEntry(false)?.variations.get(variationKey),\n set: (value: T) => {\n getMapEntry(true)!.variations.set(variationKey, value);\n },\n };\n }\n return {\n get: () => getMapEntry(false)?.primary,\n set: (value: T) => {\n getMapEntry(true)!.primary = value;\n },\n };\n }\n\n public set(requestProps: GetHierarchyNodesProps, value: T) {\n const { primaryKey, variationKey } = this.createCacheKeys(requestProps);\n this.getCacheAccessors(primaryKey, variationKey).set(value);\n }\n\n public get(requestProps: GetHierarchyNodesProps): T | undefined {\n const { primaryKey, variationKey } = this.createCacheKeys(requestProps);\n return this.getCacheAccessors(primaryKey, variationKey).get();\n }\n\n public clear() {\n this._map.clear();\n }\n}\n\nfunction compareHierarchyNodeKeys(lhs: HierarchyNodeKey[], rhs: HierarchyNodeKey[]) {\n if (lhs.length !== rhs.length) {\n return lhs.length - rhs.length;\n }\n for (let i = 0; i < lhs.length; ++i) {\n const keysCompareResult = HierarchyNodeKey.compare(lhs[i], rhs[i]);\n if (keysCompareResult !== 0) {\n return keysCompareResult;\n }\n }\n return 0;\n}\n"]}
@@ -1,7 +1,9 @@
1
1
  import type { GenericInstanceFilter } from "@itwin/core-common";
2
- import type { EC, ECClassHierarchyInspector, ECSchemaProvider, ECSqlQueryDef } from "@itwin/presentation-shared";
2
+ import type { EC, ECClassHierarchyInspector, ECSchemaProvider, ECSqlQueryDef, IInstanceLabelSelectClauseFactory } from "@itwin/presentation-shared";
3
3
  import type { NonGroupingHierarchyNode, ParentHierarchyNode } from "../HierarchyNode.js";
4
4
  import type { ProcessedGenericHierarchyNode, ProcessedHierarchyNode, ProcessedInstanceHierarchyNode, SourceGenericHierarchyNode, SourceInstanceHierarchyNode } from "./IModelHierarchyNode.js";
5
+ import type { LimitingECSqlQueryExecutor } from "./LimitingECSqlQueryExecutor.js";
6
+ import type { NodesQueryClauseFactory } from "./NodeSelectQueryFactory.js";
5
7
  /**
6
8
  * A nodes definition that returns a single generic node.
7
9
  * @public
@@ -95,13 +97,44 @@ export type HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, "chil
95
97
  */
96
98
  export interface DefineHierarchyLevelProps {
97
99
  /** The iModel for which the hierarchy definition is being requested for. */
98
- imodelAccess: ECSchemaProvider & ECClassHierarchyInspector & {
100
+ imodelAccess: LimitingECSqlQueryExecutor & ECSchemaProvider & ECClassHierarchyInspector & {
99
101
  imodelKey: string;
100
102
  };
101
103
  /** Parent node to get children for. Pass `undefined` to get root nodes. */
102
104
  parentNode: HierarchyDefinitionParentNode | undefined;
103
105
  /** Optional hierarchy level filter. */
104
106
  instanceFilter?: GenericInstanceFilter;
107
+ /**
108
+ * A factory for creating ECSQL select clauses for instance labels. Created using
109
+ * `createIModelInstanceLabelSelectClauseFactory` from `@itwin/presentation-shared` and scoped
110
+ * to the iModel identified by `imodelAccess`.
111
+ *
112
+ * Example:
113
+ * ```ts
114
+ * const labelClause = await instanceLabelSelectClauseFactory.createSelectClause({ classAlias: "this", className: "SomeSchema.SomeClass" });
115
+ * ```
116
+ *
117
+ * Using this factory is optional — consumers may create their own `IInstanceLabelSelectClauseFactory`
118
+ * and use it instead, or just define instance label select clauses manually without a factory.
119
+ */
120
+ instanceLabelSelectClauseFactory: IInstanceLabelSelectClauseFactory;
121
+ /**
122
+ * A factory for creating ECSQL select clauses for hierarchy nodes. Created using
123
+ * `createNodesQueryClauseFactory` and scoped to the iModel identified by `imodelAccess`.
124
+ *
125
+ * Example:
126
+ * ```ts
127
+ * const selectClause = await nodeSelectClauseFactory.createSelectClause({
128
+ * ecClassId: { selector: "this.ECClassId" },
129
+ * ecInstanceId: { selector: "this.ECInstanceId" },
130
+ * nodeLabel: { selector: "this.UserLabel" },
131
+ * });
132
+ * ```
133
+ *
134
+ * While using this factory is optional, and consumers may create their own `NodesQueryClauseFactory`,
135
+ * it's strongly recommended to use it to ensure the select clause format is consistent with the parser.
136
+ */
137
+ nodeSelectClauseFactory: NodesQueryClauseFactory;
105
138
  }
106
139
  /**
107
140
  * An interface for a factory that knows how define a hierarchy based on a given parent node.
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACjH,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EACV,6BAA6B,EAC7B,sBAAsB,EACtB,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,oDAAoD;IACpD,IAAI,EAAE,0BAA0B,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC;IAChC;;;OAGG;IACH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wB,EAAE,UAAU,CAAC,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,YAAY,EAAE,gBAAgB,GAAG,yBAAyB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAEnF,2EAA2E;IAC3E,UAAU,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAEtD,uCAAuC;IACvC,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAElC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAEpC,+EAA+E;IAC/E,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC3F"}
1
+ {"version":3,"file":"IModelHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EACV,EAAE,EACF,yBAAyB,EACzB,gBAAgB,EAChB,aAAa,EACb,iCAAiC,EAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EACV,6BAA6B,EAC7B,sBAAsB,EACtB,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,8BAA8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AAC;IAE7B,gEAAgE;IAChE,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,YAAY,EAAE,0BAA0B,GAAG,gBAAgB,GAAG,yBAAyB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAEhH,2EAA2E;IAC3E,UAAU,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAEtD,uCAAuC;IACvC,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAEvC;;;;;;;;;;;;OAYG;IACH,gCAAgC,EAAE,iCAAiC,CAAC;IAEpE;;;;;;;;;;;;;;;OAeG;IACH,uBAAuB,EAAE,uBAAuB,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAElC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAEpC,+EAA+E;IAC/E,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA6ChG,cAAc;AACd,2DAA2D;AAC3D,IAAiB,wBAAwB,CAOxC;AAPD,WAAiB,wBAAwB;IACvC,SAAgB,aAAa,CAAC,GAA6B;QACzD,OAAO,CAAC,CAAE,GAAsC,CAAC,IAAI,CAAC;IACxD,CAAC;IAFe,sCAAa,gBAE5B,CAAA;IACD,SAAgB,oBAAoB,CAAC,GAA6B;QAChE,OAAO,CAAC,CAAE,GAAoC,CAAC,KAAK,CAAC;IACvD,CAAC;IAFe,6CAAoB,uBAEnC,CAAA;AACH,CAAC,EAPgB,wBAAwB,wCAAxB,wBAAwB,QAOxC","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 type { GenericInstanceFilter } from \"@itwin/core-common\";\nimport type { EC, ECClassHierarchyInspector, ECSchemaProvider, ECSqlQueryDef } from \"@itwin/presentation-shared\";\nimport type { NonGroupingHierarchyNode, ParentHierarchyNode } from \"../HierarchyNode.js\";\nimport type {\n ProcessedGenericHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n SourceGenericHierarchyNode,\n SourceInstanceHierarchyNode,\n} from \"./IModelHierarchyNode.js\";\n\n/**\n * A nodes definition that returns a single generic node.\n * @public\n */\nexport interface GenericHierarchyNodeDefinition {\n /** The node to be created in the hierarchy level */\n node: SourceGenericHierarchyNode;\n}\n\n/**\n * A nodes definition that returns an ECSQL query for selecting nodes from an iModel.\n * @public\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: EC.FullClassName;\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 * @public\n */\nexport type HierarchyNodesDefinition = GenericHierarchyNodeDefinition | InstanceNodesQueryDefinition;\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodesDefinition {\n export function isGenericNode(def: HierarchyNodesDefinition): def is GenericHierarchyNodeDefinition {\n return !!(def as GenericHierarchyNodeDefinition).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 * @public\n */\nexport type HierarchyLevelDefinition = HierarchyNodesDefinition[];\n\n/**\n * A type for a function that parses a `SourceInstanceHierarchyNode` from provided ECSQL `row` object.\n * @public\n */\nexport type NodeParser = (props: {\n /** The ECSQL row object to parse. Keys & value types depend on the executed query. */\n row: { [columnName: string]: any };\n\n /** The parent node whose child node is being parsed. */\n parentNode?: HierarchyDefinitionParentNode;\n\n /** The key of iModel which is used to run the query. */\n imodelKey: string;\n}) => SourceInstanceHierarchyNode | Promise<SourceInstanceHierarchyNode>;\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 * @public\n */\nexport type NodePreProcessor = <TNode extends ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode>(props: {\n /** Node to be pre-processed. */\n node: TNode;\n\n /** The parent node whose child node is being pre-processed. */\n parentNode?: ParentHierarchyNode;\n}) => 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 * @public\n */\nexport type NodePostProcessor = (props: {\n /** Node to be post-processed. */\n node: ProcessedHierarchyNode;\n\n /** The parent node whose child node is being post-processed. */\n parentNode?: ParentHierarchyNode;\n}) => 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 generic node (key is of `GenericNodeKey` type).\n * @public\n */\nexport type HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, \"children\">;\n\n/**\n * Props for `HierarchyDefinition.defineHierarchyLevel`.\n * @public\n */\nexport interface DefineHierarchyLevelProps {\n /** The iModel for which the hierarchy definition is being requested for. */\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector & { imodelKey: string };\n\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 * @public\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"]}
1
+ {"version":3,"file":"IModelHierarchyDefinition.js","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAqDhG,cAAc;AACd,2DAA2D;AAC3D,IAAiB,wBAAwB,CAOxC;AAPD,WAAiB,wBAAwB;IACvC,SAAgB,aAAa,CAAC,GAA6B;QACzD,OAAO,CAAC,CAAE,GAAsC,CAAC,IAAI,CAAC;IACxD,CAAC;IAFe,sCAAa,gBAE5B,CAAA;IACD,SAAgB,oBAAoB,CAAC,GAA6B;QAChE,OAAO,CAAC,CAAE,GAAoC,CAAC,KAAK,CAAC;IACvD,CAAC;IAFe,6CAAoB,uBAEnC,CAAA;AACH,CAAC,EAPgB,wBAAwB,wCAAxB,wBAAwB,QAOxC","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 type { GenericInstanceFilter } from \"@itwin/core-common\";\nimport type {\n EC,\n ECClassHierarchyInspector,\n ECSchemaProvider,\n ECSqlQueryDef,\n IInstanceLabelSelectClauseFactory,\n} from \"@itwin/presentation-shared\";\nimport type { NonGroupingHierarchyNode, ParentHierarchyNode } from \"../HierarchyNode.js\";\nimport type {\n ProcessedGenericHierarchyNode,\n ProcessedHierarchyNode,\n ProcessedInstanceHierarchyNode,\n SourceGenericHierarchyNode,\n SourceInstanceHierarchyNode,\n} from \"./IModelHierarchyNode.js\";\nimport type { LimitingECSqlQueryExecutor } from \"./LimitingECSqlQueryExecutor.js\";\nimport type { NodesQueryClauseFactory } from \"./NodeSelectQueryFactory.js\";\n\n/**\n * A nodes definition that returns a single generic node.\n * @public\n */\nexport interface GenericHierarchyNodeDefinition {\n /** The node to be created in the hierarchy level */\n node: SourceGenericHierarchyNode;\n}\n\n/**\n * A nodes definition that returns an ECSQL query for selecting nodes from an iModel.\n * @public\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: EC.FullClassName;\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 * @public\n */\nexport type HierarchyNodesDefinition = GenericHierarchyNodeDefinition | InstanceNodesQueryDefinition;\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodesDefinition {\n export function isGenericNode(def: HierarchyNodesDefinition): def is GenericHierarchyNodeDefinition {\n return !!(def as GenericHierarchyNodeDefinition).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 * @public\n */\nexport type HierarchyLevelDefinition = HierarchyNodesDefinition[];\n\n/**\n * A type for a function that parses a `SourceInstanceHierarchyNode` from provided ECSQL `row` object.\n * @public\n */\nexport type NodeParser = (props: {\n /** The ECSQL row object to parse. Keys & value types depend on the executed query. */\n row: { [columnName: string]: any };\n\n /** The parent node whose child node is being parsed. */\n parentNode?: HierarchyDefinitionParentNode;\n\n /** The key of iModel which is used to run the query. */\n imodelKey: string;\n}) => SourceInstanceHierarchyNode | Promise<SourceInstanceHierarchyNode>;\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 * @public\n */\nexport type NodePreProcessor = <TNode extends ProcessedGenericHierarchyNode | ProcessedInstanceHierarchyNode>(props: {\n /** Node to be pre-processed. */\n node: TNode;\n\n /** The parent node whose child node is being pre-processed. */\n parentNode?: ParentHierarchyNode;\n}) => 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 * @public\n */\nexport type NodePostProcessor = (props: {\n /** Node to be post-processed. */\n node: ProcessedHierarchyNode;\n\n /** The parent node whose child node is being post-processed. */\n parentNode?: ParentHierarchyNode;\n}) => 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 generic node (key is of `GenericNodeKey` type).\n * @public\n */\nexport type HierarchyDefinitionParentNode = Omit<NonGroupingHierarchyNode, \"children\">;\n\n/**\n * Props for `HierarchyDefinition.defineHierarchyLevel`.\n * @public\n */\nexport interface DefineHierarchyLevelProps {\n /** The iModel for which the hierarchy definition is being requested for. */\n imodelAccess: LimitingECSqlQueryExecutor & ECSchemaProvider & ECClassHierarchyInspector & { imodelKey: string };\n\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 * A factory for creating ECSQL select clauses for instance labels. Created using\n * `createIModelInstanceLabelSelectClauseFactory` from `@itwin/presentation-shared` and scoped\n * to the iModel identified by `imodelAccess`.\n *\n * Example:\n * ```ts\n * const labelClause = await instanceLabelSelectClauseFactory.createSelectClause({ classAlias: \"this\", className: \"SomeSchema.SomeClass\" });\n * ```\n *\n * Using this factory is optional — consumers may create their own `IInstanceLabelSelectClauseFactory`\n * and use it instead, or just define instance label select clauses manually without a factory.\n */\n instanceLabelSelectClauseFactory: IInstanceLabelSelectClauseFactory;\n\n /**\n * A factory for creating ECSQL select clauses for hierarchy nodes. Created using\n * `createNodesQueryClauseFactory` and scoped to the iModel identified by `imodelAccess`.\n *\n * Example:\n * ```ts\n * const selectClause = await nodeSelectClauseFactory.createSelectClause({\n * ecClassId: { selector: \"this.ECClassId\" },\n * ecInstanceId: { selector: \"this.ECInstanceId\" },\n * nodeLabel: { selector: \"this.UserLabel\" },\n * });\n * ```\n *\n * While using this factory is optional, and consumers may create their own `NodesQueryClauseFactory`,\n * it's strongly recommended to use it to ensure the select clause format is consistent with the parser.\n */\n nodeSelectClauseFactory: NodesQueryClauseFactory;\n}\n\n/**\n * An interface for a factory that knows how define a hierarchy based on a given parent node.\n * @public\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHierarchyNode.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/IModelHierarchyNode.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACpH,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/E;;;GAGG;AACH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