@itwin/presentation-hierarchies 2.0.0-alpha.16 → 2.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/README.md +4 -6
  3. package/lib/hierarchies/HierarchyErrors.d.ts.map +1 -0
  4. package/lib/hierarchies/HierarchyErrors.js.map +1 -0
  5. package/lib/hierarchies/HierarchyMerge.d.ts.map +1 -0
  6. package/lib/{esm/hierarchies → hierarchies}/HierarchyMerge.js +1 -1
  7. package/lib/hierarchies/HierarchyMerge.js.map +1 -0
  8. package/lib/hierarchies/HierarchyNode.d.ts.map +1 -0
  9. package/lib/hierarchies/HierarchyNode.js.map +1 -0
  10. package/lib/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
  11. package/lib/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
  12. package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.d.ts +4 -4
  13. package/lib/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
  14. package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.js +8 -8
  15. package/lib/hierarchies/HierarchyNodeKey.js.map +1 -0
  16. package/lib/hierarchies/HierarchyProvider.d.ts.map +1 -0
  17. package/lib/hierarchies/HierarchyProvider.js.map +1 -0
  18. package/lib/hierarchies/HierarchySearch.d.ts.map +1 -0
  19. package/lib/hierarchies/HierarchySearch.js.map +1 -0
  20. package/lib/hierarchies/Logging.d.ts.map +1 -0
  21. package/lib/hierarchies/Logging.js.map +1 -0
  22. package/lib/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
  23. package/lib/hierarchies/imodel/HierarchyCache.js.map +1 -0
  24. package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.d.ts +3 -3
  25. package/lib/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
  26. package/lib/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
  27. package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.d.ts +2 -2
  28. package/lib/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
  29. package/lib/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
  30. package/lib/{cjs/hierarchies → hierarchies}/imodel/IModelHierarchyProvider.d.ts +2 -4
  31. package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
  32. package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyProvider.js +15 -12
  33. package/lib/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
  34. package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
  35. package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
  36. package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.d.ts +10 -6
  37. package/lib/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
  38. package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.js +80 -43
  39. package/lib/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
  40. package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.d.ts +4 -4
  41. package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
  42. package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.js +1 -1
  43. package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
  44. package/lib/{cjs/hierarchies → hierarchies}/imodel/SearchHierarchyDefinition.d.ts +2 -2
  45. package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -0
  46. package/lib/{esm/hierarchies → hierarchies}/imodel/SearchHierarchyDefinition.js +3 -4
  47. package/lib/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -0
  48. package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.d.ts +1 -1
  49. package/lib/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
  50. package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.js +2 -5
  51. package/lib/hierarchies/imodel/TreeNodesReader.js.map +1 -0
  52. package/lib/hierarchies/imodel/Utils.d.ts.map +1 -0
  53. package/lib/hierarchies/imodel/Utils.js.map +1 -0
  54. package/lib/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
  55. package/lib/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
  56. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.d.ts +2 -2
  57. package/lib/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
  58. package/lib/hierarchies/imodel/operators/Grouping.js.map +1 -0
  59. package/lib/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
  60. package/lib/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
  61. package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
  62. package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
  63. package/lib/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
  64. package/lib/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
  65. package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.d.ts +3 -3
  66. package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
  67. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.js +9 -10
  68. package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
  69. package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
  70. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.js +4 -6
  71. package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
  72. package/lib/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
  73. package/lib/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
  74. package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
  75. package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
  76. package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.d.ts +4 -4
  77. package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
  78. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.js +38 -30
  79. package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
  80. package/lib/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
  81. package/lib/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
  82. package/lib/hierarchies/internal/Common.d.ts.map +1 -0
  83. package/lib/hierarchies/internal/Common.js.map +1 -0
  84. package/lib/hierarchies/internal/DisposePolyfill.d.ts.map +1 -0
  85. package/lib/hierarchies/internal/DisposePolyfill.js.map +1 -0
  86. package/lib/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
  87. package/lib/hierarchies/internal/LoggingUtils.js.map +1 -0
  88. package/lib/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -0
  89. package/lib/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -0
  90. package/lib/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
  91. package/lib/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
  92. package/lib/hierarchies/internal/operators/Partition.d.ts.map +1 -0
  93. package/lib/hierarchies/internal/operators/Partition.js.map +1 -0
  94. package/lib/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
  95. package/lib/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
  96. package/lib/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
  97. package/lib/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
  98. package/lib/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
  99. package/lib/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
  100. package/lib/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
  101. package/lib/hierarchies/internal/operators/Sorting.js.map +1 -0
  102. package/lib/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
  103. package/lib/hierarchies/internal/operators/TapOnce.js.map +1 -0
  104. package/lib/presentation-hierarchies.d.ts.map +1 -0
  105. package/lib/{cjs/presentation-hierarchies.js.map → presentation-hierarchies.js.map} +1 -1
  106. package/package.json +19 -21
  107. package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +0 -1
  108. package/lib/cjs/hierarchies/HierarchyErrors.js +0 -20
  109. package/lib/cjs/hierarchies/HierarchyErrors.js.map +0 -1
  110. package/lib/cjs/hierarchies/HierarchyMerge.d.ts.map +0 -1
  111. package/lib/cjs/hierarchies/HierarchyMerge.js +0 -43
  112. package/lib/cjs/hierarchies/HierarchyMerge.js.map +0 -1
  113. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +0 -1
  114. package/lib/cjs/hierarchies/HierarchyNode.js +0 -82
  115. package/lib/cjs/hierarchies/HierarchyNode.js.map +0 -1
  116. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
  117. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +0 -52
  118. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
  119. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +0 -162
  120. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
  121. package/lib/cjs/hierarchies/HierarchyNodeKey.js +0 -166
  122. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +0 -1
  123. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +0 -1
  124. package/lib/cjs/hierarchies/HierarchyProvider.js +0 -64
  125. package/lib/cjs/hierarchies/HierarchyProvider.js.map +0 -1
  126. package/lib/cjs/hierarchies/HierarchySearch.d.ts.map +0 -1
  127. package/lib/cjs/hierarchies/HierarchySearch.js +0 -468
  128. package/lib/cjs/hierarchies/HierarchySearch.js.map +0 -1
  129. package/lib/cjs/hierarchies/Logging.d.ts.map +0 -1
  130. package/lib/cjs/hierarchies/Logging.js +0 -27
  131. package/lib/cjs/hierarchies/Logging.js.map +0 -1
  132. package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
  133. package/lib/cjs/hierarchies/imodel/HierarchyCache.js +0 -81
  134. package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +0 -1
  135. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +0 -144
  136. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
  137. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +0 -21
  138. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
  139. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +0 -234
  140. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
  141. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +0 -29
  142. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
  143. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
  144. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +0 -657
  145. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
  146. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
  147. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +0 -126
  148. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
  149. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +0 -231
  150. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
  151. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +0 -629
  152. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
  153. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +0 -140
  154. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
  155. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +0 -94
  156. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
  157. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +0 -1
  158. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js +0 -268
  159. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js.map +0 -1
  160. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +0 -35
  161. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
  162. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +0 -51
  163. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +0 -1
  164. package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +0 -1
  165. package/lib/cjs/hierarchies/imodel/Utils.js +0 -73
  166. package/lib/cjs/hierarchies/imodel/Utils.js.map +0 -1
  167. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
  168. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +0 -40
  169. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
  170. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts +0 -26
  171. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
  172. package/lib/cjs/hierarchies/imodel/operators/Grouping.js +0 -176
  173. package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +0 -1
  174. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
  175. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +0 -75
  176. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
  177. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
  178. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +0 -84
  179. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
  180. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
  181. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js +0 -26
  182. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
  183. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
  184. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +0 -113
  185. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
  186. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
  187. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +0 -54
  188. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
  189. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
  190. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +0 -49
  191. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
  192. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
  193. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +0 -52
  194. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
  195. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
  196. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +0 -310
  197. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
  198. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
  199. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js +0 -31
  200. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
  201. package/lib/cjs/hierarchies/internal/Common.d.ts.map +0 -1
  202. package/lib/cjs/hierarchies/internal/Common.js +0 -91
  203. package/lib/cjs/hierarchies/internal/Common.js.map +0 -1
  204. package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts +0 -1
  205. package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
  206. package/lib/cjs/hierarchies/internal/DisposePolyfill.js +0 -11
  207. package/lib/cjs/hierarchies/internal/DisposePolyfill.js.map +0 -1
  208. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +0 -12
  209. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
  210. package/lib/cjs/hierarchies/internal/EachValueFrom.js +0 -111
  211. package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +0 -1
  212. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
  213. package/lib/cjs/hierarchies/internal/LoggingUtils.js +0 -37
  214. package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +0 -1
  215. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
  216. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +0 -28
  217. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
  218. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
  219. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +0 -54
  220. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
  221. package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +0 -1
  222. package/lib/cjs/hierarchies/internal/operators/Partition.js +0 -60
  223. package/lib/cjs/hierarchies/internal/operators/Partition.js.map +0 -1
  224. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
  225. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +0 -50
  226. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
  227. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
  228. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +0 -24
  229. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
  230. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
  231. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +0 -23
  232. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
  233. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
  234. package/lib/cjs/hierarchies/internal/operators/Sorting.js +0 -25
  235. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +0 -1
  236. package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
  237. package/lib/cjs/hierarchies/internal/operators/TapOnce.js +0 -19
  238. package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +0 -1
  239. package/lib/cjs/package.json +0 -1
  240. package/lib/cjs/presentation-hierarchies.d.ts.map +0 -1
  241. package/lib/cjs/presentation-hierarchies.js +0 -40
  242. package/lib/esm/hierarchies/HierarchyErrors.d.ts +0 -9
  243. package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +0 -1
  244. package/lib/esm/hierarchies/HierarchyErrors.js.map +0 -1
  245. package/lib/esm/hierarchies/HierarchyMerge.d.ts +0 -19
  246. package/lib/esm/hierarchies/HierarchyMerge.d.ts.map +0 -1
  247. package/lib/esm/hierarchies/HierarchyMerge.js.map +0 -1
  248. package/lib/esm/hierarchies/HierarchyNode.d.ts +0 -149
  249. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +0 -1
  250. package/lib/esm/hierarchies/HierarchyNode.js.map +0 -1
  251. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +0 -31
  252. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
  253. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
  254. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
  255. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +0 -1
  256. package/lib/esm/hierarchies/HierarchyProvider.d.ts +0 -134
  257. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +0 -1
  258. package/lib/esm/hierarchies/HierarchyProvider.js.map +0 -1
  259. package/lib/esm/hierarchies/HierarchySearch.d.ts +0 -297
  260. package/lib/esm/hierarchies/HierarchySearch.d.ts.map +0 -1
  261. package/lib/esm/hierarchies/HierarchySearch.js.map +0 -1
  262. package/lib/esm/hierarchies/Logging.d.ts +0 -13
  263. package/lib/esm/hierarchies/Logging.d.ts.map +0 -1
  264. package/lib/esm/hierarchies/Logging.js.map +0 -1
  265. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +0 -18
  266. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
  267. package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +0 -1
  268. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
  269. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
  270. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
  271. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
  272. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -138
  273. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
  274. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
  275. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +0 -21
  276. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
  277. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
  278. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
  279. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
  280. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
  281. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
  282. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts +0 -35
  283. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +0 -1
  284. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js.map +0 -1
  285. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
  286. package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +0 -1
  287. package/lib/esm/hierarchies/imodel/Utils.d.ts +0 -5
  288. package/lib/esm/hierarchies/imodel/Utils.d.ts.map +0 -1
  289. package/lib/esm/hierarchies/imodel/Utils.js.map +0 -1
  290. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts +0 -11
  291. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
  292. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
  293. package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
  294. package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +0 -1
  295. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +0 -11
  296. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
  297. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
  298. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +0 -11
  299. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
  300. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
  301. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +0 -4
  302. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
  303. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
  304. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
  305. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
  306. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
  307. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
  308. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
  309. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
  310. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +0 -4
  311. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
  312. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
  313. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
  314. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
  315. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
  316. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +0 -32
  317. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
  318. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
  319. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts +0 -5
  320. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
  321. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
  322. package/lib/esm/hierarchies/internal/Common.d.ts +0 -61
  323. package/lib/esm/hierarchies/internal/Common.d.ts.map +0 -1
  324. package/lib/esm/hierarchies/internal/Common.js.map +0 -1
  325. package/lib/esm/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
  326. package/lib/esm/hierarchies/internal/DisposePolyfill.js.map +0 -1
  327. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +0 -12
  328. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
  329. package/lib/esm/hierarchies/internal/EachValueFrom.js +0 -108
  330. package/lib/esm/hierarchies/internal/EachValueFrom.js.map +0 -1
  331. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +0 -12
  332. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
  333. package/lib/esm/hierarchies/internal/LoggingUtils.js.map +0 -1
  334. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts +0 -75
  335. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
  336. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
  337. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +0 -17
  338. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
  339. package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
  340. package/lib/esm/hierarchies/internal/operators/Partition.d.ts +0 -7
  341. package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +0 -1
  342. package/lib/esm/hierarchies/internal/operators/Partition.js.map +0 -1
  343. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts +0 -22
  344. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
  345. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
  346. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +0 -7
  347. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
  348. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
  349. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +0 -9
  350. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
  351. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
  352. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +0 -13
  353. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
  354. package/lib/esm/hierarchies/internal/operators/Sorting.js.map +0 -1
  355. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts +0 -4
  356. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
  357. package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +0 -1
  358. package/lib/esm/presentation-hierarchies.d.ts +0 -24
  359. package/lib/esm/presentation-hierarchies.d.ts.map +0 -1
  360. package/lib/esm/presentation-hierarchies.js.map +0 -1
  361. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyErrors.d.ts +0 -0
  362. /package/lib/{esm/hierarchies → hierarchies}/HierarchyErrors.js +0 -0
  363. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyMerge.d.ts +0 -0
  364. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyNode.d.ts +0 -0
  365. /package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.js +0 -0
  366. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyNodeIdentifier.d.ts +0 -0
  367. /package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeIdentifier.js +0 -0
  368. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyProvider.d.ts +0 -0
  369. /package/lib/{esm/hierarchies → hierarchies}/HierarchyProvider.js +0 -0
  370. /package/lib/{cjs/hierarchies → hierarchies}/HierarchySearch.d.ts +0 -0
  371. /package/lib/{esm/hierarchies → hierarchies}/HierarchySearch.js +0 -0
  372. /package/lib/{cjs/hierarchies → hierarchies}/Logging.d.ts +0 -0
  373. /package/lib/{esm/hierarchies → hierarchies}/Logging.js +0 -0
  374. /package/lib/{cjs/hierarchies → hierarchies}/imodel/HierarchyCache.d.ts +0 -0
  375. /package/lib/{esm/hierarchies → hierarchies}/imodel/HierarchyCache.js +0 -0
  376. /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.js +0 -0
  377. /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.js +0 -0
  378. /package/lib/{cjs/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.d.ts +0 -0
  379. /package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.js +0 -0
  380. /package/lib/{cjs/hierarchies → hierarchies}/imodel/Utils.d.ts +0 -0
  381. /package/lib/{esm/hierarchies → hierarchies}/imodel/Utils.js +0 -0
  382. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/DetermineChildren.d.ts +0 -0
  383. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/DetermineChildren.js +0 -0
  384. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.js +0 -0
  385. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.d.ts +0 -0
  386. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.js +0 -0
  387. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.d.ts +0 -0
  388. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.js +0 -0
  389. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.d.ts +0 -0
  390. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.js +0 -0
  391. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.d.ts +0 -0
  392. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.d.ts +0 -0
  393. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.js +0 -0
  394. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.d.ts +0 -0
  395. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.js +0 -0
  396. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/Shared.d.ts +0 -0
  397. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.js +0 -0
  398. /package/lib/{cjs/hierarchies → hierarchies}/internal/Common.d.ts +0 -0
  399. /package/lib/{esm/hierarchies → hierarchies}/internal/Common.js +0 -0
  400. /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.d.ts +0 -0
  401. /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.js +0 -0
  402. /package/lib/{cjs/hierarchies → hierarchies}/internal/LoggingUtils.d.ts +0 -0
  403. /package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.js +0 -0
  404. /package/lib/{cjs/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.d.ts +0 -0
  405. /package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.js +0 -0
  406. /package/lib/{cjs/hierarchies → hierarchies}/internal/SubscriptionScheduler.d.ts +0 -0
  407. /package/lib/{esm/hierarchies → hierarchies}/internal/SubscriptionScheduler.js +0 -0
  408. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Partition.d.ts +0 -0
  409. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Partition.js +0 -0
  410. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.d.ts +0 -0
  411. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.js +0 -0
  412. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.d.ts +0 -0
  413. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.js +0 -0
  414. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.d.ts +0 -0
  415. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.js +0 -0
  416. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Sorting.d.ts +0 -0
  417. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Sorting.js +0 -0
  418. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/TapOnce.d.ts +0 -0
  419. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.js +0 -0
  420. /package/lib/{cjs/presentation-hierarchies.d.ts → presentation-hierarchies.d.ts} +0 -0
  421. /package/lib/{esm/presentation-hierarchies.js → presentation-hierarchies.js} +0 -0
@@ -1,134 +0,0 @@
1
- import type { GenericInstanceFilter } from "@itwin/core-common";
2
- import type { Event, EventListener, InstanceKey, IPrimitiveValueFormatter, Props, RaisableEvent } from "@itwin/presentation-shared";
3
- import type { HierarchyNode, ParentHierarchyNode } from "./HierarchyNode.js";
4
- import type { HierarchySearchTree } from "./HierarchySearch.js";
5
- /**
6
- * Props for the `HierarchyProvider.getNodes` call.
7
- * @public
8
- */
9
- export interface GetHierarchyNodesProps {
10
- /** Parent node to get children for. Pass `undefined` to get root nodes. */
11
- parentNode: ParentHierarchyNode | undefined;
12
- /** Optional hierarchy level filter. Has no effect if `parentNode` is a `GroupingNode`. */
13
- instanceFilter?: GenericInstanceFilter;
14
- /**
15
- * Optional hierarchy level size limit override. This value is passed to `LimitingECSqlQueryExecutor` used
16
- * by this provider to override query rows limit per hierarchy level. If not provided, defaults to whatever
17
- * is used by the limiting query executor.
18
- *
19
- * Has no effect if `parentNode` is a `GroupingNode`.
20
- */
21
- hierarchyLevelSizeLimit?: number | "unbounded";
22
- /** When set to `true` ignores the cache and fetches the nodes again. */
23
- ignoreCache?: boolean;
24
- }
25
- /**
26
- * Event arguments for `HierarchyProvider.hierarchyChanged` event.
27
- * @public
28
- */
29
- interface HierarchyChangedEventArgs {
30
- /** Set when the hierarchy change was caused by a formatter change. */
31
- formatterChange?: {
32
- newFormatter: IPrimitiveValueFormatter | undefined;
33
- };
34
- /** Set when the hierarchy change was caused by a hierarchy search change. */
35
- searchChange?: {
36
- newSearch: Props<HierarchyProvider["setHierarchySearch"]>;
37
- };
38
- }
39
- /**
40
- * An interface for a hierarchy provider that knows how to create child nodes for a given parent node.
41
- * @public
42
- */
43
- export interface HierarchyProvider {
44
- /**
45
- * An event that provider raises due to a hierarchy change that requires a reload.
46
- *
47
- * Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.
48
- * Implementations may provide additional details on what caused the change through the
49
- * event arguments.
50
- */
51
- readonly hierarchyChanged: Event<(args: HierarchyChangedEventArgs) => void>;
52
- /**
53
- * Gets nodes for the specified parent node. This is **the method to implement**, otherwise
54
- * the provider doesn't return any nodes.
55
- */
56
- getNodes(props: GetHierarchyNodesProps): AsyncIterableIterator<HierarchyNode>;
57
- /**
58
- * Gets instance keys for the specified parent node.
59
- *
60
- * The result of this method may be used to determine instances whose nodes would be displayed as children
61
- * of the specified parent node. For such use cases calling this method should be more efficient compared
62
- * to calling `getNodes`.
63
- */
64
- getNodeInstanceKeys(props: Omit<GetHierarchyNodesProps, "ignoreCache">): AsyncIterableIterator<InstanceKey>;
65
- /**
66
- * Overrides the property value formatter used by the hierarchy provider. Setting to `undefined`
67
- * resets the formatter, but what that means depends on the provider implementation - it could just
68
- * use unformatted values, or use some default formatter, e.g. the on created by `createDefaultValueFormatter`
69
- * from `@itwin/presentation-shared` package.
70
- *
71
- * @note Changing formatter is expected to trigger the `hierarchyChanged` event with `formatterChange` arg.
72
- */
73
- setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;
74
- /**
75
- * Sets the hierarchy search used by this hierarchy provider. Setting to `undefined`
76
- * removes the search.
77
- *
78
- * @note There's a difference between `undefined` search and search with empty paths list. The
79
- * former means no search is applied, while the latter means the search is applied and it filters-out
80
- * all hierarchy.
81
- *
82
- * @note Changing search is expected to trigger the `hierarchyChanged` event with `searchChange` arg.
83
- */
84
- setHierarchySearch(props: {
85
- /** A list of search trees that define paths from root to search target nodes. */
86
- paths: HierarchySearchTree[];
87
- } | undefined): void;
88
- }
89
- /**
90
- * An utility to create a `HierarchyProvider` from a partial implementation.
91
- *
92
- * Creating a `HierarchyProvider` directly requires implementing all its methods:
93
- * ```ts
94
- * {
95
- * hierarchyChanged: new BeEvent(),
96
- * async *getNodes({ parentNode }) {
97
- * // yield nodes...
98
- * },
99
- * async *getNodeInstanceKeys() {},
100
- * setFormatter() {},
101
- * setHierarchySearch() {},
102
- * }
103
- * ```
104
- *
105
- * However, in many cases you may only need to implement the `getNodes` method and
106
- * can rely on default implementations for other methods.
107
- *
108
- * With this utility you can implement only part of it, e.g. just the `getNodes` method:
109
- * ```ts
110
- * // provide implementation as a javascript object
111
- * createHierarchyProvider(({ hierarchyChanged }) => ({
112
- * async *getNodes({ parentNode }) {
113
- * // yield nodes...
114
- * },
115
- * }));
116
- *
117
- * // or, provide implementation as a class instance:
118
- * createHierarchyProvider(
119
- * ({ hierarchyChanged }) =>
120
- * new (class implements Pick<HierarchyProvider, "getNodes"> {
121
- * public async *getNodes({ parentNode }): ReturnType<HierarchyProvider["getNodes"]> {
122
- * // yield nodes...
123
- * }
124
- * })(),
125
- * );
126
- * ```
127
- *
128
- * @public
129
- */
130
- export declare function createHierarchyProvider<TPartialProvider extends Partial<Omit<HierarchyProvider, "hierarchyChanged">> & Pick<HierarchyProvider, "getNodes">>(partialFactory: (props: {
131
- hierarchyChanged: RaisableEvent<EventListener<HierarchyProvider["hierarchyChanged"]>>;
132
- }) => TPartialProvider): TPartialProvider & HierarchyProvider;
133
- export {};
134
- //# sourceMappingURL=HierarchyProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HierarchyProvider.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAA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,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,EAAE,YAAY,KAAI,CAAC,EAAE,CAAC;QACzG,GAAG,CAAC,IAAI,CAAC,kBAAkB;YACzB,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE;YACjD,CAAC,CAAC,oBAAoB,CAAC,EAAE,kBAAkB,KAAI,CAAC,EAAE,CAAC;KACtD,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { BeEvent } from \"@itwin/core-bentley\";\n\nimport type { GenericInstanceFilter } from \"@itwin/core-common\";\nimport type {\n Event,\n EventListener,\n InstanceKey,\n IPrimitiveValueFormatter,\n Props,\n RaisableEvent,\n} from \"@itwin/presentation-shared\";\nimport type { HierarchyNode, ParentHierarchyNode } from \"./HierarchyNode.js\";\nimport type { HierarchySearchTree } from \"./HierarchySearch.js\";\n\n/**\n * Props for the `HierarchyProvider.getNodes` call.\n * @public\n */\nexport interface GetHierarchyNodesProps {\n /** Parent node to get children for. Pass `undefined` to get root nodes. */\n parentNode: ParentHierarchyNode | undefined;\n\n /** Optional hierarchy level filter. Has no effect if `parentNode` is a `GroupingNode`. */\n instanceFilter?: GenericInstanceFilter;\n\n /**\n * Optional hierarchy level size limit override. This value is passed to `LimitingECSqlQueryExecutor` used\n * by this provider to override query rows limit per hierarchy level. If not provided, defaults to whatever\n * is used by the limiting query executor.\n *\n * Has no effect if `parentNode` is a `GroupingNode`.\n */\n hierarchyLevelSizeLimit?: number | \"unbounded\";\n\n /** When set to `true` ignores the cache and fetches the nodes again. */\n ignoreCache?: boolean;\n}\n\n/**\n * Event arguments for `HierarchyProvider.hierarchyChanged` event.\n * @public\n */\ninterface HierarchyChangedEventArgs {\n /** Set when the hierarchy change was caused by a formatter change. */\n formatterChange?: { newFormatter: IPrimitiveValueFormatter | undefined };\n\n /** Set when the hierarchy change was caused by a hierarchy search change. */\n searchChange?: { newSearch: Props<HierarchyProvider[\"setHierarchySearch\"]> };\n}\n\n/**\n * An interface for a hierarchy provider that knows how to create child nodes for a given parent node.\n * @public\n */\nexport interface HierarchyProvider {\n /**\n * An event that provider raises due to a hierarchy change that requires a reload.\n *\n * Consumers are expected to subscribe to this event and reload the hierarchy when it's raised.\n * Implementations may provide additional details on what caused the change through the\n * event arguments.\n */\n readonly hierarchyChanged: Event<(args: HierarchyChangedEventArgs) => void>;\n\n /**\n * Gets nodes for the specified parent node. This is **the method to implement**, otherwise\n * the provider doesn't return any nodes.\n */\n getNodes(props: GetHierarchyNodesProps): AsyncIterableIterator<HierarchyNode>;\n\n /**\n * Gets instance keys for the specified parent node.\n *\n * The result of this method may be used to determine instances whose nodes would be displayed as children\n * of the specified parent node. For such use cases calling this method should be more efficient compared\n * to calling `getNodes`.\n */\n getNodeInstanceKeys(props: Omit<GetHierarchyNodesProps, \"ignoreCache\">): AsyncIterableIterator<InstanceKey>;\n\n /**\n * Overrides the property value formatter used by the hierarchy provider. Setting to `undefined`\n * resets the formatter, but what that means depends on the provider implementation - it could just\n * use unformatted values, or use some default formatter, e.g. the on created by `createDefaultValueFormatter`\n * from `@itwin/presentation-shared` package.\n *\n * @note Changing formatter is expected to trigger the `hierarchyChanged` event with `formatterChange` arg.\n */\n setFormatter(formatter: IPrimitiveValueFormatter | undefined): void;\n\n /**\n * Sets the hierarchy search used by this hierarchy provider. Setting to `undefined`\n * removes the search.\n *\n * @note There's a difference between `undefined` search and search with empty paths list. The\n * former means no search is applied, while the latter means the search is applied and it filters-out\n * all hierarchy.\n *\n * @note Changing search is expected to trigger the `hierarchyChanged` event with `searchChange` arg.\n */\n setHierarchySearch(\n props:\n | {\n /** A list of search trees that define paths from root to search target nodes. */\n paths: HierarchySearchTree[];\n }\n | undefined,\n ): void;\n}\n\n/**\n * An utility to create a `HierarchyProvider` from a partial implementation.\n *\n * Creating a `HierarchyProvider` directly requires implementing all its methods:\n * ```ts\n * {\n * hierarchyChanged: new BeEvent(),\n * async *getNodes({ parentNode }) {\n * // yield nodes...\n * },\n * async *getNodeInstanceKeys() {},\n * setFormatter() {},\n * setHierarchySearch() {},\n * }\n * ```\n *\n * However, in many cases you may only need to implement the `getNodes` method and\n * can rely on default implementations for other methods.\n *\n * With this utility you can implement only part of it, e.g. just the `getNodes` method:\n * ```ts\n * // provide implementation as a javascript object\n * createHierarchyProvider(({ hierarchyChanged }) => ({\n * async *getNodes({ parentNode }) {\n * // yield nodes...\n * },\n * }));\n *\n * // or, provide implementation as a class instance:\n * createHierarchyProvider(\n * ({ hierarchyChanged }) =>\n * new (class implements Pick<HierarchyProvider, \"getNodes\"> {\n * public async *getNodes({ parentNode }): ReturnType<HierarchyProvider[\"getNodes\"]> {\n * // yield nodes...\n * }\n * })(),\n * );\n * ```\n *\n * @public\n */\nexport function createHierarchyProvider<\n TPartialProvider extends Partial<Omit<HierarchyProvider, \"hierarchyChanged\">> & Pick<HierarchyProvider, \"getNodes\">,\n>(\n partialFactory: (props: {\n hierarchyChanged: RaisableEvent<EventListener<HierarchyProvider[\"hierarchyChanged\"]>>;\n }) => TPartialProvider,\n): TPartialProvider & HierarchyProvider {\n const hierarchyChanged: Props<typeof partialFactory>[\"hierarchyChanged\"] = new BeEvent();\n const impl = partialFactory({ hierarchyChanged });\n return Object.assign(impl, {\n hierarchyChanged,\n ...(impl.getNodeInstanceKeys\n ? { getNodeInstanceKeys: impl.getNodeInstanceKeys }\n : /* v8 ignore next */ { async *getNodeInstanceKeys() {} }),\n ...(impl.setFormatter ? { setFormatter: impl.setFormatter } : /* v8 ignore next */ { setFormatter() {} }),\n ...(impl.setHierarchySearch\n ? { setHierarchySearch: impl.setHierarchySearch }\n : /* v8 ignore next */ { setHierarchySearch() {} }),\n });\n}\n"]}
@@ -1,297 +0,0 @@
1
- import { HierarchyNodeIdentifier } from "./HierarchyNodeIdentifier.js";
2
- import type { NonGroupingHierarchyNode } from "./HierarchyNode.js";
3
- import type { HierarchyNodeIdentifiersPath } from "./HierarchyNodeIdentifier.js";
4
- import type { GenericNodeKey, InstancesNodeKey } from "./HierarchyNodeKey.js";
5
- /** @public */
6
- export interface HierarchySearchPathOptions {
7
- /**
8
- * This option specifies the way `autoExpand` flag should be assigned to nodes in the searched hierarchy.
9
- * - If it's `false` or `undefined`, nodes have no 'autoExpand' flag.
10
- * - If it's `true`, then all nodes up to the search target will have `autoExpand` flag.
11
- * - If it's a object with `groupingLevel` then `groupingLevel` determines the number of grouping levels to expand for
12
- * the search target.
13
- */
14
- reveal?: boolean | {
15
- /**
16
- * Index of the node in search path should be revealed in hierarchy by auto-expanding its ancestors.
17
- *
18
- * Use when you want to expand up to specific instance node and don't care about grouping nodes.
19
- *
20
- * **Use case example:**
21
- *
22
- * All nodes up to `Element1` should be expanded in the following hierarchy:
23
- * - Node1
24
- * - GroupingNode1
25
- * - GroupingNode2
26
- * - Element1
27
- * - Element2
28
- *
29
- * Provide `{ path: [Node1, Element1], reveal: { depthInPath: 1 } }`
30
- *
31
- * **NOTE**: All nodes that are up to `depthInPath` will be expanded **except** search targets.
32
- */
33
- depthInPath: number;
34
- } | {
35
- /**
36
- * The number of grouping levels to expand for the search target. For example, if `groupingLevel` is set to `2`, then all grouping nodes up to the second level
37
- * will have the `autoExpand` flag.
38
- *
39
- * **Note:** if search target has less grouping levels than specified by this attribute, then all grouping nodes up to the search target will have
40
- * the `autoExpand` flag, but the search target itself won't have the `autoExpand` flag.
41
- */
42
- groupingLevel: number;
43
- };
44
- /**
45
- * This option specifies whether or not search target should be expanded.
46
- * - If it's `false` or `undefined`, search target won't have 'autoExpand' flag.
47
- * - If it's `true`, search target will have `autoExpand` flag.
48
- *
49
- * **Note:** this attribute does not set `autoExpand` flag on nodes up to the search target. For that use `reveal`.
50
- */
51
- autoExpand?: boolean;
52
- }
53
- /**
54
- * A path of hierarchy node identifiers for search the hierarchy with additional options.
55
- * @public
56
- */
57
- export type HierarchySearchPath = HierarchyNodeIdentifiersPath | {
58
- path: HierarchyNodeIdentifiersPath;
59
- options?: HierarchySearchPathOptions;
60
- };
61
- /** @public */
62
- export declare namespace HierarchySearchPath {
63
- /**
64
- * Normalizes the hierarchy search path to the object form.
65
- * @public
66
- */
67
- function normalize(source: HierarchySearchPath): Exclude<HierarchySearchPath, HierarchyNodeIdentifiersPath>;
68
- /**
69
- * Merges two given `HierarchySearchPathOptions` objects.
70
- *
71
- * For the `reveal` attribute, the merge chooses to `reveal` as deep as the deepest input:
72
- * - if any one of the inputs is `true`, return `true`,
73
- * - else if only one of the inputs is an object, return it,
74
- * - else if both inputs are falsy, return `false` or `undefined`,
75
- * - else:
76
- * - if only one of the inputs has `groupingLevel` set, return that one,
77
- * - else compare by matching reveal type (`groupingLevel` or `depthInPath`) and return the deeper one.
78
- *
79
- * @public
80
- */
81
- function mergeOptions(lhs: HierarchySearchPathOptions | undefined, rhs: HierarchySearchPathOptions | undefined): HierarchySearchPathOptions | undefined;
82
- }
83
- /**
84
- * A tree structure representing hierarchy search paths. Each node in the tree corresponds
85
- * to a hierarchy node identifier and may have children that represent deeper levels in the
86
- * hierarchy.
87
- *
88
- * The `HierarchySearchTree.createBuilder` or `HierarchySearchTree.createFromPathsList` are
89
- * typically used create this tree from a flat list of search paths.
90
- *
91
- * @public
92
- */
93
- export interface HierarchySearchTree {
94
- /** Identifier of the hierarchy node this tree entry represents. */
95
- identifier: HierarchyNodeIdentifier;
96
- /**
97
- * When `true`, indicates that this node is a search target.
98
- *
99
- * Note: A `HierarchySearchTree` node is considered a search target if it has no children, even if `isTarget` is not explicitly set to `true`. This
100
- * is because a node with no children represents the end of a search path.
101
- */
102
- isTarget?: boolean;
103
- /** Provides options for handling this search tree entry, such as auto-expansion behavior. */
104
- options?: {
105
- /**
106
- * - `true` to expand the node and its grouping nodes,
107
- * - `{ groupingLevel: number }` to expand ancestor grouping nodes, e.g. for the following hierarchy:
108
- * ```
109
- * - Grouping node A
110
- * - Instance node A
111
- * - Grouping node B1
112
- * - Grouping node B2
113
- * - ...
114
- * - Grouping node Bn
115
- * - Instance node B
116
- * ```
117
- *
118
- * For "Instance node B" search tree entry:
119
- * - `{ groupingLevel: 1 }` expands its first grouping node "Grouping node B1",
120
- * - `{ groupingLevel: 2 }` expands two levels to "Grouping node B2".
121
- * - `{ groupingLevel: Number.MAX_SAFE_INTEGER }` expands all grouping nodes of that instance node.
122
- *
123
- * Note that there's a slight difference between `HierarchySearchTree.options.autoExpand` and
124
- * `HierarchySearchPath.options.reveal`. The latter option reveals the search target node by expanding its ancestors,
125
- * while the `HierarchySearchTree.options.autoExpand` also expands the target node itself.
126
- */
127
- autoExpand?: boolean | {
128
- groupingLevel: number;
129
- };
130
- };
131
- /** Child search tree entries representing the next level(s) in the hierarchy search paths. */
132
- children?: HierarchySearchTree[];
133
- }
134
- /** @public */
135
- export declare namespace HierarchySearchTree {
136
- /** @public */
137
- type HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras extends Record<string, unknown>> = Readonly<Pick<HierarchySearchTree, "identifier" | "options"> & {
138
- extras: TExtras;
139
- }> & Pick<HierarchySearchTree, "isTarget">;
140
- /** @public */
141
- type HierarchySearchTreeBuilderAcceptHandlerTreeInput = Readonly<Pick<HierarchySearchTree, "identifier" | "isTarget" | "options"> & {
142
- hasChildren: boolean;
143
- }>;
144
- /** @public */
145
- interface HierarchySearchTreeBuilderAcceptHandler<TExtras extends Record<string, unknown>> {
146
- /**
147
- * Called when a new entry is added to the tree. Return `true` to accept the entry, `false` to reject it and all its children, if any.
148
- */
149
- onNewEntry?: (props: {
150
- /** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */
151
- parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;
152
- /** The new entry being added to the tree. */
153
- inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;
154
- }) => boolean;
155
- /**
156
- * Called when a new entry is added to the tree and accepted (either it's a new entry or it merges with an existing entry). This can be used to perform
157
- * side effects such as assigning extra information to the tree entry.
158
- */
159
- onEntryHandled?: (props: {
160
- /** The parent entries of the new entry being added, from root to immediate parent. It's allowed to mutate these entries. */
161
- parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>>;
162
- /** The tree entry that has been handled. It's allowed to mutate this entry. */
163
- treeEntry: HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TExtras>;
164
- /** The input entry being added to the tree. */
165
- inputEntry: HierarchySearchTreeBuilderAcceptHandlerTreeInput;
166
- }) => void;
167
- }
168
- /**
169
- * Props supplied to HierarchySearchTreeBuilder.accept() method for accepting a hierarchy search path or tree with an optional handler for customizing
170
- * the behavior of the builder when accepting new entries.
171
- * @public
172
- */
173
- type HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras extends Record<string, unknown>> = ({
174
- path: HierarchySearchPath;
175
- } | {
176
- tree: HierarchySearchTree;
177
- }) & {
178
- /** An optional handler for customizing the behavior of the builder when accepting new entries. */
179
- handler?: HierarchySearchTreeBuilderAcceptHandler<TAcceptHandlerExtras>;
180
- };
181
- /**
182
- * Props supplied to HierarchySearchTreeBuilder.getTree() method for customizing the resulting tree entries, e.g. by omitting some of them or
183
- * assigning extra information to them.
184
- * @public
185
- */
186
- interface HierarchySearchTreeBuilderFinalizeTreeProps<TAcceptHandlerExtras extends Record<string, unknown>> {
187
- /**
188
- * A function that can be used to process each tree entry before it's added to the final tree.
189
- *
190
- * Return `undefined` to omit the entry and its entire branch from the resulting tree.
191
- */
192
- processEntry?: (props: {
193
- treeEntry: HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TAcceptHandlerExtras>;
194
- parentEntries: Array<HierarchySearchTreeBuilderAcceptHandlerTreeEntry<TAcceptHandlerExtras>>;
195
- }) => (Omit<HierarchySearchTree, "children"> & {
196
- extras: TAcceptHandlerExtras;
197
- }) | undefined;
198
- }
199
- /**
200
- * An utility that accepts hierarchy search paths or search trees one by one and builds a `HierarchySearchTree` structure based on them.
201
- * @public
202
- */
203
- interface HierarchySearchTreeBuilder<TAcceptHandlerExtras extends Record<string, unknown>> {
204
- /**
205
- * Accepts a hierarchy search path or paths' tree and adds it to the builder's internal tree structure. Use `getTree()` to create
206
- * a `HierarchySearchTree[]` from the added paths.
207
- */
208
- accept(props: HierarchySearchTreeBuilderAcceptProps<TAcceptHandlerExtras>): HierarchySearchTreeBuilder<TAcceptHandlerExtras>;
209
- /**
210
- * Create `HierarchySearchTree[]` from currently added search paths.
211
- */
212
- getTree(props?: HierarchySearchTreeBuilderFinalizeTreeProps<TAcceptHandlerExtras>): HierarchySearchTree[];
213
- }
214
- /**
215
- * Create a `HierarchySearchTree` builder utility that accepts hierarchy search paths or search trees one by one and builds
216
- * a `HierarchySearchTree` structure based on them.
217
- *
218
- * Usage example:
219
- *
220
- * ```ts
221
- * const builder = HierarchySearchTree.createBuilder();
222
- * for (const path of searchPaths) {
223
- * builder.accept({ path });
224
- * }
225
- * const searchTree = builder.getTree();
226
- * ```
227
- *
228
- * @public
229
- */
230
- export function createBuilder<TAcceptHandlerExtras extends Record<string, unknown> = Record<string, unknown>>(): HierarchySearchTreeBuilder<TAcceptHandlerExtras>;
231
- /**
232
- * Builds a list of `HierarchySearchTree` nodes from an iterable of search paths. Shared
233
- * path prefixes are merged so that each unique hierarchy node identifier appears only once
234
- * per level. The resulting trees carry `isTarget`, `options`, and `children` attributes
235
- * derived from the paths and their options (`autoExpand`, `reveal`).
236
- *
237
- * @public
238
- */
239
- export function createFromPathsList(paths: Iterable<HierarchySearchPath>): Promise<HierarchySearchTree[]>;
240
- /**
241
- * Merges two `HierarchySearchTree` option objects. For the `autoExpand` attribute,
242
- * `true` takes precedence over `{ groupingLevel }`, and when both sides are
243
- * `{ groupingLevel }` objects the larger value wins.
244
- * @public
245
- */
246
- export function mergeOptions(lhs: HierarchySearchTree["options"] | undefined, rhs: HierarchySearchTree["options"] | undefined): HierarchySearchTree["options"] | undefined;
247
- export {};
248
- }
249
- /**
250
- * Creates a set of utilities for making it easier to search the given hierarchy
251
- * level.
252
- *
253
- * @public
254
- */
255
- export declare function createHierarchySearchHelper(rootLevelSearchProps: HierarchySearchTree[] | undefined, parentNode: Pick<NonGroupingHierarchyNode, "search"> | undefined): {
256
- /** Returns a flag indicating if the hierarchy level is filtered. */
257
- hasSearch: boolean;
258
- /**
259
- * Returns a flag indicating whether this hierarchy level has an ancestor node
260
- * that is a search target. That generally means that this and all downstream hierarchy
261
- * levels should be displayed without search being applied to them, even if search paths
262
- * say otherwise.
263
- */
264
- hasSearchTargetAncestor: boolean;
265
- /**
266
- * Returns a list of hierarchy node identifiers that apply specifically for this
267
- * hierarchy level. Returns `undefined` if search is not applied to this level.
268
- */
269
- getChildNodeSearchIdentifiers: () => HierarchyNodeIdentifier[] | undefined;
270
- /**
271
- * When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `search`
272
- * and `autoExpand`) to be set based on the search paths and search options. This function calculates
273
- * these props for a child node based on its key or path matcher.
274
- *
275
- * When using `pathMatcher` or `asyncPathMatcher` prop, callers have more flexibility to decide whether the given `HierarchyNodeIdentifier` applies
276
- * to their node. For example, only some parts of the identifier can be checked for improved performance. Otherwise, the
277
- * `nodeKey` prop can be used to check the whole identifier.
278
- *
279
- * There are multiple overloads of `createChildNodeProps`: depending on props type it returns different values:
280
- * - `asyncPathMatcher` is provided - returns either Promise or the regular return value based on whether or not `asyncPathMatcher` returns a `Promise`.
281
- * - `pathMatcher` or only `nodeKey` is provided - returns undefined **or** `search` and `autoExpand` prop from `HierarchyNode`;
282
- */
283
- createChildNodeProps: {
284
- (props: {
285
- nodeKey: InstancesNodeKey | GenericNodeKey;
286
- }): Pick<NonGroupingHierarchyNode, "search" | "autoExpand"> | undefined;
287
- (props: {
288
- nodeKey: InstancesNodeKey | GenericNodeKey;
289
- pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;
290
- }): Pick<NonGroupingHierarchyNode, "search" | "autoExpand"> | undefined;
291
- (props: {
292
- nodeKey: InstancesNodeKey | GenericNodeKey;
293
- asyncPathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;
294
- }): Promise<Pick<NonGroupingHierarchyNode, "search" | "autoExpand"> | undefined> | Pick<NonGroupingHierarchyNode, "search" | "autoExpand"> | undefined;
295
- };
296
- };
297
- //# sourceMappingURL=HierarchySearch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HierarchySearch.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchySearch.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAIvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,cAAc;AACd,MAAM,WAAW,0BAA0B;IACzC;;;;;;OAMG;IACH,MAAM,CAAC,EACH,OAAO,GACP;QACE;;;;;;;;;;;;;;;;;WAiBG;QACH,WAAW,EAAE,MAAM,CAAC;KACrB,GACD;QACE;;;;;;WAMG;QACH,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACN;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B,4BAA4B,GAC5B;IAAE,IAAI,EAAE,4BAA4B,CAAC;IAAC,OAAO,CAAC,EAAE,0BAA0B,CAAA;CAAE,CAAC;AACjF,cAAc;AAEd,yBAAiB,mBAAmB,CAAC;IACnC;;;OAGG;IACH,SAAgB,SAAS,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,EAAE,4BAA4B,CAAC,CAKjH;IAED;;;;;;;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,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"]}
@@ -1,13 +0,0 @@
1
- import type { ILogger } from "@itwin/presentation-shared";
2
- /**
3
- * Set logger to use by this package. By default the package uses a no-op logger.
4
- * @public
5
- */
6
- export declare function setLogger(logger: ILogger | undefined): void;
7
- /**
8
- * Get logger used by this package.
9
- * @see `setLogger`
10
- * @public
11
- */
12
- export declare function getLogger(): ILogger;
13
- //# sourceMappingURL=Logging.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logging.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/Logging.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAK1D;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,QAEpD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/hierarchies/Logging.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIzD,gEAAgE;AAChE,IAAI,QAAQ,GAAY,WAAW,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAA2B;IACnD,QAAQ,GAAG,MAAM,IAAI,iCAAiC,CAAC,WAAW,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,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,18 +0,0 @@
1
- import type { GetHierarchyNodesProps } from "../HierarchyProvider.js";
2
- interface ChildNodeObservablesCacheProps {
3
- size: number;
4
- variationsCount?: number;
5
- }
6
- /** @internal */
7
- export declare class HierarchyCache<T> {
8
- private _map;
9
- private _props;
10
- constructor(props: ChildNodeObservablesCacheProps);
11
- private createCacheKeys;
12
- private getCacheAccessors;
13
- set(requestProps: GetHierarchyNodesProps, value: T): void;
14
- get(requestProps: GetHierarchyNodesProps): T | undefined;
15
- clear(): void;
16
- }
17
- export {};
18
- //# sourceMappingURL=HierarchyCache.d.ts.map
@@ -1 +0,0 @@
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"}