@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,64 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createHierarchyProvider = createHierarchyProvider;
8
- const core_bentley_1 = require("@itwin/core-bentley");
9
- /**
10
- * An utility to create a `HierarchyProvider` from a partial implementation.
11
- *
12
- * Creating a `HierarchyProvider` directly requires implementing all its methods:
13
- * ```ts
14
- * {
15
- * hierarchyChanged: new BeEvent(),
16
- * async *getNodes({ parentNode }) {
17
- * // yield nodes...
18
- * },
19
- * async *getNodeInstanceKeys() {},
20
- * setFormatter() {},
21
- * setHierarchySearch() {},
22
- * }
23
- * ```
24
- *
25
- * However, in many cases you may only need to implement the `getNodes` method and
26
- * can rely on default implementations for other methods.
27
- *
28
- * With this utility you can implement only part of it, e.g. just the `getNodes` method:
29
- * ```ts
30
- * // provide implementation as a javascript object
31
- * createHierarchyProvider(({ hierarchyChanged }) => ({
32
- * async *getNodes({ parentNode }) {
33
- * // yield nodes...
34
- * },
35
- * }));
36
- *
37
- * // or, provide implementation as a class instance:
38
- * createHierarchyProvider(
39
- * ({ hierarchyChanged }) =>
40
- * new (class implements Pick<HierarchyProvider, "getNodes"> {
41
- * public async *getNodes({ parentNode }): ReturnType<HierarchyProvider["getNodes"]> {
42
- * // yield nodes...
43
- * }
44
- * })(),
45
- * );
46
- * ```
47
- *
48
- * @public
49
- */
50
- function createHierarchyProvider(partialFactory) {
51
- const hierarchyChanged = new core_bentley_1.BeEvent();
52
- const impl = partialFactory({ hierarchyChanged });
53
- return Object.assign(impl, {
54
- hierarchyChanged,
55
- ...(impl.getNodeInstanceKeys
56
- ? { getNodeInstanceKeys: impl.getNodeInstanceKeys }
57
- : /* v8 ignore next */ { async *getNodeInstanceKeys() { } }),
58
- ...(impl.setFormatter ? { setFormatter: impl.setFormatter } : /* v8 ignore next */ { setFormatter() { } }),
59
- ...(impl.setHierarchySearch
60
- ? { setHierarchySearch: impl.setHierarchySearch }
61
- : /* v8 ignore next */ { setHierarchySearch() { } }),
62
- });
63
- }
64
- //# sourceMappingURL=HierarchyProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HierarchyProvider.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAwJhG,0DAmBC;AAzKD,sDAA8C;AA6G9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,SAAgB,uBAAuB,CAGrC,cAEsB;IAEtB,MAAM,gBAAgB,GAAqD,IAAI,sBAAO,EAAE,CAAC;IACzF,MAAM,IAAI,GAAG,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QACzB,gBAAgB;QAChB,GAAG,CAAC,IAAI,CAAC,mBAAmB;YAC1B,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE;YACnD,CAAC,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,CAAC,mBAAmB,KAAI,CAAC,EAAE,CAAC;QAC7D,GAAG,CAAC,IAAI,CAAC,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 +0,0 @@
1
- {"version":3,"file":"HierarchySearch.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchySearch.ts"],"names":[],"mappings":"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"}
@@ -1,468 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.HierarchySearchTree = exports.HierarchySearchPath = void 0;
8
- exports.createHierarchySearchHelper = createHierarchySearchHelper;
9
- const rxjs_1 = require("rxjs");
10
- const core_bentley_1 = require("@itwin/core-bentley");
11
- const HierarchyNodeIdentifier_js_1 = require("./HierarchyNodeIdentifier.js");
12
- const HierarchyNodeKey_js_1 = require("./HierarchyNodeKey.js");
13
- const ReleaseMainThread_js_1 = require("./internal/operators/ReleaseMainThread.js");
14
- /** @public */
15
- // eslint-disable-next-line @typescript-eslint/no-redeclare
16
- var HierarchySearchPath;
17
- (function (HierarchySearchPath) {
18
- /**
19
- * Normalizes the hierarchy search path to the object form.
20
- * @public
21
- */
22
- function normalize(source) {
23
- if (Array.isArray(source)) {
24
- return { path: source };
25
- }
26
- return source;
27
- }
28
- HierarchySearchPath.normalize = normalize;
29
- /**
30
- * Merges two given `HierarchySearchPathOptions` objects.
31
- *
32
- * For the `reveal` attribute, the merge chooses to `reveal` as deep as the deepest input:
33
- * - if any one of the inputs is `true`, return `true`,
34
- * - else if only one of the inputs is an object, return it,
35
- * - else if both inputs are falsy, return `false` or `undefined`,
36
- * - else:
37
- * - if only one of the inputs has `groupingLevel` set, return that one,
38
- * - else compare by matching reveal type (`groupingLevel` or `depthInPath`) and return the deeper one.
39
- *
40
- * @public
41
- */
42
- function mergeOptions(lhs, rhs) {
43
- const reveal = mergeRevealOptions(lhs?.reveal, rhs?.reveal);
44
- const autoExpand = mergeAutoExpandOption(lhs?.autoExpand, rhs?.autoExpand);
45
- return reveal || autoExpand
46
- ? {
47
- ...(reveal !== undefined ? { reveal } : undefined),
48
- ...(autoExpand !== undefined ? { autoExpand } : undefined),
49
- }
50
- : undefined;
51
- }
52
- HierarchySearchPath.mergeOptions = mergeOptions;
53
- function mergeRevealOptions(lhs, rhs) {
54
- if (rhs === true || lhs === true) {
55
- return true;
56
- }
57
- if (!rhs || !lhs) {
58
- return !!rhs ? rhs : lhs;
59
- }
60
- if ("groupingLevel" in lhs) {
61
- if ("groupingLevel" in rhs) {
62
- return lhs.groupingLevel > rhs.groupingLevel ? lhs : rhs;
63
- }
64
- return lhs;
65
- }
66
- else if ("groupingLevel" in rhs) {
67
- return rhs;
68
- }
69
- return lhs.depthInPath > rhs.depthInPath ? lhs : rhs;
70
- }
71
- function mergeAutoExpandOption(lhs, rhs) {
72
- return lhs || rhs ? true : undefined;
73
- }
74
- })(HierarchySearchPath || (exports.HierarchySearchPath = HierarchySearchPath = {}));
75
- /** @public */
76
- var HierarchySearchTree;
77
- (function (HierarchySearchTree) {
78
- /**
79
- * Create a `HierarchySearchTree` builder utility that accepts hierarchy search paths or search trees one by one and builds
80
- * a `HierarchySearchTree` structure based on them.
81
- *
82
- * Usage example:
83
- *
84
- * ```ts
85
- * const builder = HierarchySearchTree.createBuilder();
86
- * for (const path of searchPaths) {
87
- * builder.accept({ path });
88
- * }
89
- * const searchTree = builder.getTree();
90
- * ```
91
- *
92
- * @public
93
- */
94
- function createBuilder() {
95
- var _a;
96
- return new (class Impl {
97
- #rootsDictionary = new core_bentley_1.Dictionary(HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.compare);
98
- static #mapDictionaryToTree(dictionary, parentEntries, props) {
99
- const list = [];
100
- for (const { children, ...entry } of dictionary.values()) {
101
- let processedEntry = entry;
102
- if (props?.processEntry) {
103
- processedEntry = props.processEntry({ treeEntry: entry, parentEntries });
104
- }
105
- if (!processedEntry) {
106
- continue;
107
- }
108
- const { extras: _, ...entryWithoutExtras } = processedEntry;
109
- parentEntries.push(processedEntry);
110
- list.push({
111
- ...entryWithoutExtras,
112
- ...(children ? { children: Impl.#mapDictionaryToTree(children, parentEntries, props) } : undefined),
113
- });
114
- parentEntries.pop();
115
- }
116
- return list;
117
- }
118
- static #assignAutoExpandOptionsBasedOnReveal(treePath, revealOption) {
119
- if (revealOption === true) {
120
- Impl.#assignOptionsOnTreePath({
121
- treePath,
122
- targetEntryIndex: treePath.length - 1,
123
- getEntryOptions: (index, targetEntryIndex) => {
124
- if (index === targetEntryIndex) {
125
- // auto-expand all grouping nodes of the revealed node
126
- return { autoExpand: { groupingLevel: Number.MAX_SAFE_INTEGER } };
127
- }
128
- // auto-expand all parent nodes
129
- return { autoExpand: true };
130
- },
131
- });
132
- }
133
- else if (revealOption && "groupingLevel" in revealOption) {
134
- Impl.#assignOptionsOnTreePath({
135
- treePath,
136
- targetEntryIndex: treePath.length - 1,
137
- getEntryOptions: (index, targetEntryIndex) => {
138
- if (index === targetEntryIndex) {
139
- // the last entry should have `autoExpand` with `groupingLevel` set to the value based on `reveal.groupingLevel`
140
- return { autoExpand: { groupingLevel: Math.max(revealOption.groupingLevel - 1, 0) } };
141
- }
142
- // auto-expand all parent nodes
143
- return { autoExpand: true };
144
- },
145
- });
146
- }
147
- else if (revealOption && "depthInPath" in revealOption) {
148
- Impl.#assignOptionsOnTreePath({
149
- treePath,
150
- targetEntryIndex: Math.min(revealOption.depthInPath, treePath.length - 1),
151
- getEntryOptions: (index, targetEntryIndex) => {
152
- if (index === targetEntryIndex) {
153
- // auto-expand all grouping nodes of the revealed node
154
- return { autoExpand: { groupingLevel: Number.MAX_SAFE_INTEGER } };
155
- }
156
- // auto-expand all parent nodes
157
- return { autoExpand: true };
158
- },
159
- });
160
- }
161
- }
162
- static #assignOptionsOnTreePath({ treePath, targetEntryIndex, getEntryOptions, }) {
163
- // set all parent entries to auto-expand
164
- for (let i = 0; i <= targetEntryIndex; i++) {
165
- const options = mergeOptions(treePath[i].options, getEntryOptions(i, targetEntryIndex));
166
- if (options) {
167
- treePath[i].options = options;
168
- }
169
- }
170
- }
171
- #acceptNode({ parentEntries, level, node, handler, }) {
172
- let entry = level.get(node.identifier);
173
- if (!entry) {
174
- if (handler?.onNewEntry && !handler.onNewEntry({ parentEntries, inputEntry: node })) {
175
- return undefined;
176
- }
177
- entry = {
178
- identifier: node.identifier,
179
- children: node.hasChildren ? new core_bentley_1.Dictionary(HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.compare) : undefined,
180
- extras: {},
181
- };
182
- level.set(node.identifier, entry);
183
- }
184
- const isNodeSearchTarget = node.isTarget || !node.hasChildren;
185
- if (isNodeSearchTarget && entry.children) {
186
- entry.isTarget = true;
187
- }
188
- if (!entry.children && node.hasChildren) {
189
- // Existing leaf nodes are implied targets. Preserve that status when adding children.
190
- entry.isTarget = true;
191
- entry.children = new core_bentley_1.Dictionary(HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.compare);
192
- }
193
- handler?.onEntryHandled?.({ parentEntries, treeEntry: entry, inputEntry: node });
194
- return entry;
195
- }
196
- #acceptPath({ path, handler }) {
197
- const normalized = HierarchySearchPath.normalize(path);
198
- const treePath = [];
199
- let currentLevel = this.#rootsDictionary;
200
- for (let i = 0; i < normalized.path.length; i++) {
201
- const identifier = normalized.path[i];
202
- const acceptedNode = this.#acceptNode({
203
- parentEntries: treePath,
204
- node: { identifier, hasChildren: i < normalized.path.length - 1 },
205
- level: currentLevel,
206
- handler,
207
- });
208
- if (!acceptedNode) {
209
- break;
210
- }
211
- treePath.push(acceptedNode);
212
- if (!acceptedNode.children) {
213
- break;
214
- }
215
- currentLevel = acceptedNode.children;
216
- }
217
- if (treePath.length === 0) {
218
- return;
219
- }
220
- // handle auto-expand
221
- const lastNode = treePath[treePath.length - 1];
222
- if (normalized.options?.autoExpand) {
223
- (lastNode.options ??= {}).autoExpand = true;
224
- }
225
- // handle auto-reveal
226
- Impl.#assignAutoExpandOptionsBasedOnReveal(treePath, normalized.options?.reveal);
227
- }
228
- #acceptTree({ tree, handler }) {
229
- const acceptTreeNode = (parentEntries, parentInputs, level, node) => {
230
- const acceptedNode = this.#acceptNode({
231
- parentEntries,
232
- node: { ...node, hasChildren: node.children !== undefined },
233
- level,
234
- handler,
235
- });
236
- if (!acceptedNode) {
237
- // It was decided to reject this node and its children, if any
238
- return;
239
- }
240
- const treePath = [...parentEntries, acceptedNode];
241
- const inputsPath = [...parentInputs, node];
242
- if (!node.children || node.isTarget) {
243
- // Found an effective search target - merge options from its path
244
- Impl.#assignOptionsOnTreePath({
245
- treePath,
246
- targetEntryIndex: treePath.length - 1,
247
- getEntryOptions: (index) => inputsPath[index].options,
248
- });
249
- }
250
- const currentLevel = acceptedNode.children;
251
- if (currentLevel) {
252
- node.children?.forEach((child) => acceptTreeNode(treePath, inputsPath, currentLevel, child));
253
- }
254
- };
255
- acceptTreeNode([], [], this.#rootsDictionary, tree);
256
- }
257
- accept(props) {
258
- if ("path" in props) {
259
- this.#acceptPath(props);
260
- }
261
- else {
262
- this.#acceptTree(props);
263
- }
264
- return this;
265
- }
266
- getTree(props) {
267
- return Impl.#mapDictionaryToTree(this.#rootsDictionary, [], props);
268
- }
269
- })();
270
- }
271
- HierarchySearchTree.createBuilder = createBuilder;
272
- /**
273
- * Builds a list of `HierarchySearchTree` nodes from an iterable of search paths. Shared
274
- * path prefixes are merged so that each unique hierarchy node identifier appears only once
275
- * per level. The resulting trees carry `isTarget`, `options`, and `children` attributes
276
- * derived from the paths and their options (`autoExpand`, `reveal`).
277
- *
278
- * @public
279
- */
280
- async function createFromPathsList(paths) {
281
- return (0, rxjs_1.firstValueFrom)((0, rxjs_1.from)(paths).pipe((0, ReleaseMainThread_js_1.releaseMainThreadOnItemsCount)(1000), (0, rxjs_1.reduce)((builder, path) => builder.accept({ path }), createBuilder()), (0, rxjs_1.map)((builder) => builder.getTree())));
282
- }
283
- HierarchySearchTree.createFromPathsList = createFromPathsList;
284
- /**
285
- * Merges two `HierarchySearchTree` option objects. For the `autoExpand` attribute,
286
- * `true` takes precedence over `{ groupingLevel }`, and when both sides are
287
- * `{ groupingLevel }` objects the larger value wins.
288
- * @public
289
- */
290
- function mergeOptions(lhs, rhs) {
291
- if (!lhs) {
292
- return rhs;
293
- }
294
- if (!rhs) {
295
- return lhs;
296
- }
297
- const autoExpand = mergeSearchTreeAutoExpandOption(lhs.autoExpand, rhs.autoExpand);
298
- const options = { ...(autoExpand ? { autoExpand } : undefined) };
299
- return Object.keys(options).length > 0 ? options : undefined;
300
- }
301
- HierarchySearchTree.mergeOptions = mergeOptions;
302
- function mergeSearchTreeAutoExpandOption(lhs, rhs) {
303
- if (!lhs) {
304
- return rhs;
305
- }
306
- if (!rhs) {
307
- return lhs;
308
- }
309
- return lhs === true || rhs === true ? true : { groupingLevel: Math.max(lhs.groupingLevel, rhs.groupingLevel) };
310
- }
311
- })(HierarchySearchTree || (exports.HierarchySearchTree = HierarchySearchTree = {}));
312
- function extractSearchPropsInternal(rootLevelSearchProps, parentNode) {
313
- if (!parentNode) {
314
- return rootLevelSearchProps
315
- ? { childrenTargetPaths: rootLevelSearchProps, hasSearchTargetAncestor: false }
316
- : undefined;
317
- }
318
- const searchProps = {
319
- ...(parentNode.search?.childrenTargetPaths
320
- ? { childrenTargetPaths: parentNode.search.childrenTargetPaths }
321
- : undefined),
322
- hasSearchTargetAncestor: !!parentNode.search?.hasSearchTargetAncestor || !!parentNode.search?.isSearchTarget,
323
- };
324
- return searchProps.childrenTargetPaths || searchProps.hasSearchTargetAncestor ? searchProps : undefined;
325
- }
326
- /**
327
- * Creates a set of utilities for making it easier to search the given hierarchy
328
- * level.
329
- *
330
- * @public
331
- */
332
- function createHierarchySearchHelper(rootLevelSearchProps, parentNode) {
333
- const searchProps = extractSearchPropsInternal(rootLevelSearchProps, parentNode);
334
- const hasSearch = !!searchProps;
335
- function saveSearchPropsFromPathsIntoReducer(extractionProps) {
336
- // Passes down matching hierarchy search trees to the reducer.
337
- // It uses `nodeKey`, `pathMatcher` or `asyncPathMatcher` to check if `HierarchyNodeIdentifier` in the search tree item's identifier matches the node
338
- // and if it does, the path is passed down to the reducer.
339
- // This function returns a promise only if `asyncPathMatcher` returns a promise.
340
- if (!searchProps?.childrenTargetPaths) {
341
- return;
342
- }
343
- const matchedTreePromises = new Array();
344
- for (const childrenSearchTree of searchProps.childrenTargetPaths) {
345
- if ("asyncPathMatcher" in extractionProps) {
346
- const matchesPossiblyPromise = extractionProps.asyncPathMatcher(childrenSearchTree.identifier);
347
- if (matchesPossiblyPromise instanceof Promise) {
348
- matchedTreePromises.push(matchesPossiblyPromise.then((matches) => (matches ? childrenSearchTree : undefined)));
349
- }
350
- else if (matchesPossiblyPromise) {
351
- extractionProps.pathsReducer.accept(childrenSearchTree);
352
- }
353
- }
354
- else {
355
- const matches = "pathMatcher" in extractionProps
356
- ? extractionProps.pathMatcher(childrenSearchTree.identifier)
357
- : nodeKeyMatchesIdentifier(extractionProps.nodeKey, childrenSearchTree.identifier);
358
- if (matches) {
359
- extractionProps.pathsReducer.accept(childrenSearchTree);
360
- }
361
- }
362
- }
363
- if (matchedTreePromises.length === 0) {
364
- return;
365
- }
366
- return Promise.all(matchedTreePromises).then((matchedTrees) => matchedTrees.forEach((matchedTree) => matchedTree && extractionProps.pathsReducer.accept(matchedTree)));
367
- }
368
- function createChildNodeProps(props) {
369
- if (!hasSearch) {
370
- return undefined;
371
- }
372
- const reducer = new MatchingSearchPathsReducer(searchProps.hasSearchTargetAncestor);
373
- if ("asyncPathMatcher" in props) {
374
- const extractResult = saveSearchPropsFromPathsIntoReducer({
375
- pathsReducer: reducer,
376
- nodeKey: props.nodeKey,
377
- asyncPathMatcher: props.asyncPathMatcher,
378
- });
379
- if (extractResult instanceof Promise) {
380
- return extractResult.then(() => reducer.aggregatedOptions);
381
- }
382
- }
383
- else {
384
- saveSearchPropsFromPathsIntoReducer({ pathsReducer: reducer, ...props });
385
- }
386
- return reducer.aggregatedOptions;
387
- }
388
- return {
389
- /** Returns a flag indicating if the hierarchy level is filtered. */
390
- hasSearch,
391
- /**
392
- * Returns a flag indicating whether this hierarchy level has an ancestor node
393
- * that is a search target. That generally means that this and all downstream hierarchy
394
- * levels should be displayed without search being applied to them, even if search paths
395
- * say otherwise.
396
- */
397
- hasSearchTargetAncestor: searchProps?.hasSearchTargetAncestor ?? false,
398
- /**
399
- * Returns a list of hierarchy node identifiers that apply specifically for this
400
- * hierarchy level. Returns `undefined` if search is not applied to this level.
401
- */
402
- getChildNodeSearchIdentifiers: () => {
403
- if (!searchProps?.childrenTargetPaths) {
404
- return undefined;
405
- }
406
- return searchProps.childrenTargetPaths.map(({ identifier }) => identifier);
407
- },
408
- /**
409
- * When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `search`
410
- * and `autoExpand`) to be set based on the search paths and search options. This function calculates
411
- * these props for a child node based on its key or path matcher.
412
- *
413
- * When using `pathMatcher` or `asyncPathMatcher` prop, callers have more flexibility to decide whether the given `HierarchyNodeIdentifier` applies
414
- * to their node. For example, only some parts of the identifier can be checked for improved performance. Otherwise, the
415
- * `nodeKey` prop can be used to check the whole identifier.
416
- *
417
- * There are multiple overloads of `createChildNodeProps`: depending on props type it returns different values:
418
- * - `asyncPathMatcher` is provided - returns either Promise or the regular return value based on whether or not `asyncPathMatcher` returns a `Promise`.
419
- * - `pathMatcher` or only `nodeKey` is provided - returns undefined **or** `search` and `autoExpand` prop from `HierarchyNode`;
420
- */
421
- createChildNodeProps,
422
- };
423
- }
424
- function nodeKeyMatchesIdentifier(nodeKey, identifier) {
425
- return ((HierarchyNodeKey_js_1.HierarchyNodeKey.isGeneric(nodeKey) && HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.equal(identifier, nodeKey)) ||
426
- (HierarchyNodeKey_js_1.HierarchyNodeKey.isInstances(nodeKey) &&
427
- nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier_js_1.HierarchyNodeIdentifier.equal(identifier, ik))));
428
- }
429
- /**
430
- * Extracts information from search paths and later returns `search` and `autoExpand` values from `HierarchyNode`.
431
- *
432
- * 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`.
433
- *
434
- * Extracts information using `accept` function:
435
- * - Determines if node is search target, and if it is saves the options as `searchTargetOptions`
436
- * - Saves `HierarchySearchPathOptions` and `childrenTargetPaths`
437
- */
438
- class MatchingSearchPathsReducer {
439
- _hasSearchTargetAncestor;
440
- _childrenTargetPaths = new Array();
441
- _isSearchTarget = false;
442
- _options = undefined;
443
- constructor(_hasSearchTargetAncestor) {
444
- this._hasSearchTargetAncestor = _hasSearchTargetAncestor;
445
- }
446
- accept(tree) {
447
- if (tree.isTarget || tree.children === undefined) {
448
- this._isSearchTarget = true;
449
- }
450
- if (tree.children && tree.children.length > 0) {
451
- this._childrenTargetPaths.push(...tree.children);
452
- }
453
- this._options = HierarchySearchTree.mergeOptions(this._options, tree.options);
454
- }
455
- get aggregatedOptions() {
456
- const search = this._hasSearchTargetAncestor || this._isSearchTarget || this._childrenTargetPaths.length > 0 || this._options
457
- ? {
458
- ...(this._hasSearchTargetAncestor ? { hasSearchTargetAncestor: true } : undefined),
459
- ...(this._isSearchTarget ? { isSearchTarget: true } : undefined),
460
- ...(this._childrenTargetPaths.length > 0 ? { childrenTargetPaths: this._childrenTargetPaths } : undefined),
461
- ...(this._options ? { options: this._options } : undefined),
462
- }
463
- : undefined;
464
- const autoExpand = this._options?.autoExpand === true;
465
- return { ...(search ? { search } : undefined), ...(autoExpand ? { autoExpand } : undefined) };
466
- }
467
- }
468
- //# sourceMappingURL=HierarchySearch.js.map