@itwin/presentation-hierarchies 2.0.0-alpha.2 → 2.0.0-alpha.20

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 (427) hide show
  1. package/CHANGELOG.md +929 -12
  2. package/README.md +20 -50
  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 +19 -0
  6. package/lib/hierarchies/HierarchyMerge.d.ts.map +1 -0
  7. package/lib/{esm/hierarchies/HierarchyProvider.js → hierarchies/HierarchyMerge.js} +5 -6
  8. package/lib/hierarchies/HierarchyMerge.js.map +1 -0
  9. package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.d.ts +21 -28
  10. package/lib/hierarchies/HierarchyNode.d.ts.map +1 -0
  11. package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.js +19 -21
  12. package/lib/hierarchies/HierarchyNode.js.map +1 -0
  13. package/lib/{cjs/hierarchies → hierarchies}/HierarchyNodeIdentifier.d.ts +3 -1
  14. package/lib/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
  15. package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeIdentifier.js +23 -6
  16. package/lib/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
  17. package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.d.ts +5 -4
  18. package/lib/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
  19. package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.js +1 -1
  20. package/lib/hierarchies/HierarchyNodeKey.js.map +1 -0
  21. package/lib/{esm/hierarchies → hierarchies}/HierarchyProvider.d.ts +59 -34
  22. package/lib/hierarchies/HierarchyProvider.d.ts.map +1 -0
  23. package/lib/hierarchies/HierarchyProvider.js +61 -0
  24. package/lib/hierarchies/HierarchyProvider.js.map +1 -0
  25. package/lib/hierarchies/HierarchySearch.d.ts +297 -0
  26. package/lib/hierarchies/HierarchySearch.d.ts.map +1 -0
  27. package/lib/hierarchies/HierarchySearch.js +464 -0
  28. package/lib/hierarchies/HierarchySearch.js.map +1 -0
  29. package/lib/{cjs/hierarchies → hierarchies}/Logging.d.ts +1 -1
  30. package/lib/hierarchies/Logging.d.ts.map +1 -0
  31. package/lib/{esm/hierarchies → hierarchies}/Logging.js +1 -1
  32. package/lib/hierarchies/Logging.js.map +1 -0
  33. package/lib/{cjs/hierarchies → hierarchies}/imodel/HierarchyCache.d.ts +1 -1
  34. package/lib/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
  35. package/lib/{esm/hierarchies → hierarchies}/imodel/HierarchyCache.js +4 -7
  36. package/lib/hierarchies/imodel/HierarchyCache.js.map +1 -0
  37. package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.d.ts +34 -11
  38. package/lib/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
  39. package/lib/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
  40. package/lib/{cjs/hierarchies → hierarchies}/imodel/IModelHierarchyNode.d.ts +5 -5
  41. package/lib/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
  42. package/lib/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
  43. package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts +136 -0
  44. package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
  45. package/lib/hierarchies/imodel/IModelHierarchyProvider.js +656 -0
  46. package/lib/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
  47. package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.d.ts +1 -1
  48. package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
  49. package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.js +14 -11
  50. package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
  51. package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.d.ts +17 -12
  52. package/lib/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
  53. package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.js +214 -139
  54. package/lib/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
  55. package/lib/{cjs/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.d.ts +7 -7
  56. package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
  57. package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.js +3 -2
  58. package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
  59. package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts +35 -0
  60. package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -0
  61. package/lib/hierarchies/imodel/SearchHierarchyDefinition.js +261 -0
  62. package/lib/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -0
  63. package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.d.ts +10 -12
  64. package/lib/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
  65. package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.js +12 -9
  66. package/lib/hierarchies/imodel/TreeNodesReader.js.map +1 -0
  67. package/lib/{cjs/hierarchies → hierarchies}/imodel/Utils.d.ts +2 -1
  68. package/lib/hierarchies/imodel/Utils.d.ts.map +1 -0
  69. package/lib/{esm/hierarchies → hierarchies}/imodel/Utils.js +20 -7
  70. package/lib/hierarchies/imodel/Utils.js.map +1 -0
  71. package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/DetermineChildren.d.ts +2 -2
  72. package/lib/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
  73. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/DetermineChildren.js +11 -5
  74. package/lib/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
  75. package/lib/hierarchies/imodel/operators/Grouping.d.ts +26 -0
  76. package/lib/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
  77. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.js +33 -19
  78. package/lib/hierarchies/imodel/operators/Grouping.js.map +1 -0
  79. package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.d.ts +1 -1
  80. package/lib/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
  81. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.js +33 -10
  82. package/lib/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
  83. package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.d.ts +1 -1
  84. package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
  85. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.js +31 -15
  86. package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
  87. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.d.ts +1 -1
  88. package/lib/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
  89. package/lib/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
  90. package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +11 -0
  91. package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
  92. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.js +10 -12
  93. package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
  94. package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +7 -0
  95. package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
  96. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.js +8 -11
  97. package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
  98. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.d.ts +1 -1
  99. package/lib/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
  100. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.js +1 -5
  101. package/lib/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
  102. package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +5 -0
  103. package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
  104. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.js +2 -10
  105. package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
  106. package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.d.ts +7 -7
  107. package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
  108. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.js +46 -37
  109. package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
  110. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.d.ts +2 -2
  111. package/lib/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
  112. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.js +3 -1
  113. package/lib/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
  114. package/lib/{esm/hierarchies → hierarchies}/internal/Common.d.ts +5 -2
  115. package/lib/hierarchies/internal/Common.d.ts.map +1 -0
  116. package/lib/{esm/hierarchies → hierarchies}/internal/Common.js +13 -3
  117. package/lib/hierarchies/internal/Common.js.map +1 -0
  118. package/lib/hierarchies/internal/DisposePolyfill.d.ts.map +1 -0
  119. package/lib/hierarchies/internal/DisposePolyfill.js.map +1 -0
  120. package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.d.ts +1 -1
  121. package/lib/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
  122. package/lib/hierarchies/internal/LoggingUtils.js.map +1 -0
  123. package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.d.ts +19 -8
  124. package/lib/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -0
  125. package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.js +9 -6
  126. package/lib/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -0
  127. package/lib/{cjs/hierarchies → hierarchies}/internal/SubscriptionScheduler.d.ts +1 -1
  128. package/lib/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
  129. package/lib/{esm/hierarchies → hierarchies}/internal/SubscriptionScheduler.js +1 -4
  130. package/lib/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
  131. package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Partition.d.ts +2 -1
  132. package/lib/hierarchies/internal/operators/Partition.d.ts.map +1 -0
  133. package/lib/hierarchies/internal/operators/Partition.js.map +1 -0
  134. package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.d.ts +3 -3
  135. package/lib/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
  136. package/lib/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
  137. package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.d.ts +1 -1
  138. package/lib/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
  139. package/lib/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
  140. package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.d.ts +1 -1
  141. package/lib/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
  142. package/lib/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
  143. package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Sorting.d.ts +1 -1
  144. package/lib/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
  145. package/lib/hierarchies/internal/operators/Sorting.js.map +1 -0
  146. package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.d.ts +1 -1
  147. package/lib/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
  148. package/lib/hierarchies/internal/operators/TapOnce.js.map +1 -0
  149. package/lib/presentation-hierarchies.d.ts +24 -0
  150. package/lib/presentation-hierarchies.d.ts.map +1 -0
  151. package/lib/{esm/presentation-hierarchies.js → presentation-hierarchies.js} +7 -7
  152. package/lib/presentation-hierarchies.js.map +1 -0
  153. package/package.json +29 -39
  154. package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +0 -1
  155. package/lib/cjs/hierarchies/HierarchyErrors.js +0 -20
  156. package/lib/cjs/hierarchies/HierarchyErrors.js.map +0 -1
  157. package/lib/cjs/hierarchies/HierarchyFiltering.d.ts +0 -133
  158. package/lib/cjs/hierarchies/HierarchyFiltering.d.ts.map +0 -1
  159. package/lib/cjs/hierarchies/HierarchyFiltering.js +0 -232
  160. package/lib/cjs/hierarchies/HierarchyFiltering.js.map +0 -1
  161. package/lib/cjs/hierarchies/HierarchyNode.d.ts +0 -156
  162. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +0 -1
  163. package/lib/cjs/hierarchies/HierarchyNode.js +0 -84
  164. package/lib/cjs/hierarchies/HierarchyNode.js.map +0 -1
  165. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
  166. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +0 -35
  167. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
  168. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +0 -161
  169. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
  170. package/lib/cjs/hierarchies/HierarchyNodeKey.js +0 -166
  171. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +0 -1
  172. package/lib/cjs/hierarchies/HierarchyProvider.d.ts +0 -109
  173. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +0 -1
  174. package/lib/cjs/hierarchies/HierarchyProvider.js +0 -44
  175. package/lib/cjs/hierarchies/HierarchyProvider.js.map +0 -1
  176. package/lib/cjs/hierarchies/Logging.d.ts.map +0 -1
  177. package/lib/cjs/hierarchies/Logging.js +0 -27
  178. package/lib/cjs/hierarchies/Logging.js.map +0 -1
  179. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +0 -36
  180. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +0 -1
  181. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js +0 -283
  182. package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js.map +0 -1
  183. package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
  184. package/lib/cjs/hierarchies/imodel/HierarchyCache.js +0 -84
  185. package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +0 -1
  186. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +0 -121
  187. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
  188. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +0 -21
  189. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
  190. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
  191. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +0 -29
  192. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
  193. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -80
  194. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
  195. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +0 -449
  196. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
  197. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +0 -21
  198. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
  199. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +0 -123
  200. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
  201. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +0 -230
  202. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
  203. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +0 -591
  204. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
  205. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
  206. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +0 -93
  207. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
  208. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +0 -37
  209. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
  210. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +0 -44
  211. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +0 -1
  212. package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +0 -1
  213. package/lib/cjs/hierarchies/imodel/Utils.js +0 -59
  214. package/lib/cjs/hierarchies/imodel/Utils.js.map +0 -1
  215. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
  216. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +0 -34
  217. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
  218. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts +0 -26
  219. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
  220. package/lib/cjs/hierarchies/imodel/operators/Grouping.js +0 -162
  221. package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +0 -1
  222. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
  223. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +0 -52
  224. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
  225. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
  226. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +0 -68
  227. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
  228. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +0 -4
  229. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
  230. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js +0 -26
  231. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
  232. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
  233. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
  234. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +0 -114
  235. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
  236. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
  237. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
  238. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +0 -55
  239. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
  240. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +0 -4
  241. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
  242. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +0 -53
  243. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
  244. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
  245. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
  246. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +0 -60
  247. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
  248. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
  249. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +0 -309
  250. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
  251. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts +0 -5
  252. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
  253. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js +0 -29
  254. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
  255. package/lib/cjs/hierarchies/internal/Common.d.ts +0 -58
  256. package/lib/cjs/hierarchies/internal/Common.d.ts.map +0 -1
  257. package/lib/cjs/hierarchies/internal/Common.js +0 -80
  258. package/lib/cjs/hierarchies/internal/Common.js.map +0 -1
  259. package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts +0 -1
  260. package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
  261. package/lib/cjs/hierarchies/internal/DisposePolyfill.js +0 -11
  262. package/lib/cjs/hierarchies/internal/DisposePolyfill.js.map +0 -1
  263. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +0 -12
  264. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
  265. package/lib/cjs/hierarchies/internal/EachValueFrom.js +0 -110
  266. package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +0 -1
  267. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts +0 -12
  268. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
  269. package/lib/cjs/hierarchies/internal/LoggingUtils.js +0 -37
  270. package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +0 -1
  271. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts +0 -64
  272. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
  273. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +0 -25
  274. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
  275. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
  276. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +0 -57
  277. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
  278. package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +0 -1
  279. package/lib/cjs/hierarchies/internal/operators/Partition.js +0 -60
  280. package/lib/cjs/hierarchies/internal/operators/Partition.js.map +0 -1
  281. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts +0 -22
  282. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
  283. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +0 -50
  284. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
  285. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
  286. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +0 -24
  287. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
  288. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
  289. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +0 -23
  290. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
  291. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
  292. package/lib/cjs/hierarchies/internal/operators/Sorting.js +0 -25
  293. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +0 -1
  294. package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts +0 -4
  295. package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
  296. package/lib/cjs/hierarchies/internal/operators/TapOnce.js +0 -19
  297. package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +0 -1
  298. package/lib/cjs/package.json +0 -1
  299. package/lib/cjs/presentation-hierarchies.d.ts +0 -15
  300. package/lib/cjs/presentation-hierarchies.d.ts.map +0 -1
  301. package/lib/cjs/presentation-hierarchies.js +0 -40
  302. package/lib/cjs/presentation-hierarchies.js.map +0 -1
  303. package/lib/esm/hierarchies/HierarchyErrors.d.ts +0 -9
  304. package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +0 -1
  305. package/lib/esm/hierarchies/HierarchyErrors.js.map +0 -1
  306. package/lib/esm/hierarchies/HierarchyFiltering.d.ts +0 -133
  307. package/lib/esm/hierarchies/HierarchyFiltering.d.ts.map +0 -1
  308. package/lib/esm/hierarchies/HierarchyFiltering.js +0 -227
  309. package/lib/esm/hierarchies/HierarchyFiltering.js.map +0 -1
  310. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +0 -1
  311. package/lib/esm/hierarchies/HierarchyNode.js.map +0 -1
  312. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +0 -29
  313. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
  314. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
  315. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
  316. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +0 -1
  317. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +0 -1
  318. package/lib/esm/hierarchies/HierarchyProvider.js.map +0 -1
  319. package/lib/esm/hierarchies/Logging.d.ts +0 -13
  320. package/lib/esm/hierarchies/Logging.d.ts.map +0 -1
  321. package/lib/esm/hierarchies/Logging.js.map +0 -1
  322. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +0 -36
  323. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +0 -1
  324. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js +0 -277
  325. package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js.map +0 -1
  326. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +0 -18
  327. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
  328. package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +0 -1
  329. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
  330. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
  331. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts +0 -234
  332. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
  333. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
  334. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -80
  335. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
  336. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +0 -446
  337. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
  338. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
  339. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
  340. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
  341. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
  342. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +0 -140
  343. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
  344. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
  345. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
  346. package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +0 -1
  347. package/lib/esm/hierarchies/imodel/Utils.d.ts +0 -4
  348. package/lib/esm/hierarchies/imodel/Utils.d.ts.map +0 -1
  349. package/lib/esm/hierarchies/imodel/Utils.js.map +0 -1
  350. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts +0 -11
  351. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
  352. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
  353. package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts +0 -26
  354. package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
  355. package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +0 -1
  356. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +0 -11
  357. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
  358. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
  359. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +0 -11
  360. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
  361. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
  362. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
  363. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
  364. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
  365. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
  366. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
  367. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
  368. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
  369. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
  370. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
  371. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
  372. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
  373. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
  374. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
  375. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +0 -32
  376. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
  377. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
  378. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
  379. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
  380. package/lib/esm/hierarchies/internal/Common.d.ts.map +0 -1
  381. package/lib/esm/hierarchies/internal/Common.js.map +0 -1
  382. package/lib/esm/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
  383. package/lib/esm/hierarchies/internal/DisposePolyfill.js.map +0 -1
  384. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +0 -12
  385. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
  386. package/lib/esm/hierarchies/internal/EachValueFrom.js +0 -107
  387. package/lib/esm/hierarchies/internal/EachValueFrom.js.map +0 -1
  388. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
  389. package/lib/esm/hierarchies/internal/LoggingUtils.js.map +0 -1
  390. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
  391. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
  392. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +0 -17
  393. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
  394. package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
  395. package/lib/esm/hierarchies/internal/operators/Partition.d.ts +0 -6
  396. package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +0 -1
  397. package/lib/esm/hierarchies/internal/operators/Partition.js.map +0 -1
  398. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
  399. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
  400. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +0 -7
  401. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
  402. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
  403. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +0 -9
  404. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
  405. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
  406. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +0 -13
  407. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
  408. package/lib/esm/hierarchies/internal/operators/Sorting.js.map +0 -1
  409. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
  410. package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +0 -1
  411. package/lib/esm/presentation-hierarchies.d.ts +0 -15
  412. package/lib/esm/presentation-hierarchies.d.ts.map +0 -1
  413. package/lib/esm/presentation-hierarchies.js.map +0 -1
  414. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyErrors.d.ts +0 -0
  415. /package/lib/{esm/hierarchies → hierarchies}/HierarchyErrors.js +0 -0
  416. /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.js +0 -0
  417. /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.js +0 -0
  418. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.js +0 -0
  419. /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.d.ts +0 -0
  420. /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.js +0 -0
  421. /package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.js +0 -0
  422. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Partition.js +0 -0
  423. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.js +0 -0
  424. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.js +0 -0
  425. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.js +0 -0
  426. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Sorting.js +0 -0
  427. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.js +0 -0
@@ -1,227 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- import { HierarchyNodeIdentifier } from "./HierarchyNodeIdentifier.js";
6
- import { HierarchyNodeKey } from "./HierarchyNodeKey.js";
7
- var HierarchyFilteringPathOptions;
8
- (function (HierarchyFilteringPathOptions) {
9
- function mergeAutoExpandOptions(lhs, rhs) {
10
- if (rhs === true || lhs === true) {
11
- return true;
12
- }
13
- if (!rhs || !lhs) {
14
- return !!rhs ? rhs : lhs;
15
- }
16
- if (!lhs.includeGroupingNodes) {
17
- if (!rhs.includeGroupingNodes) {
18
- return lhs.depth > rhs.depth ? lhs : rhs;
19
- }
20
- return lhs;
21
- }
22
- if (!rhs.includeGroupingNodes) {
23
- return rhs;
24
- }
25
- return lhs.depth > rhs.depth ? lhs : rhs;
26
- }
27
- HierarchyFilteringPathOptions.mergeAutoExpandOptions = mergeAutoExpandOptions;
28
- })(HierarchyFilteringPathOptions || (HierarchyFilteringPathOptions = {}));
29
- /** @public */
30
- // eslint-disable-next-line @typescript-eslint/no-redeclare
31
- export var HierarchyFilteringPath;
32
- (function (HierarchyFilteringPath) {
33
- /**
34
- * Normalizes the hierarchy filtering path to the object form.
35
- * @public
36
- */
37
- function normalize(source) {
38
- if (Array.isArray(source)) {
39
- return { path: source };
40
- }
41
- return source;
42
- }
43
- HierarchyFilteringPath.normalize = normalize;
44
- /**
45
- * Merges two given `HierarchyFilteringPathOptions` objects.
46
- * - if both inputs are `undefined`, `undefined` is returned,
47
- * - else if one of the inputs is `undefined`, the other one is returned.
48
- * - else, merge each option individually.
49
- *
50
- * For the `autoExpand` attribute, the merge chooses to auto-expand as deep as the deepest input:
51
- * - if any one of the inputs is `true`, return `true`,
52
- * - else if only one of the inputs is an object, return it,
53
- * - else if both inputs are falsy, return `false` or `undefined`,
54
- * - else:
55
- * - if only one of the inputs has `includeGroupingNodes` set to `true` or `key` defined, return the one that has only `depth` set,
56
- * - else return the one with greater `depth`.
57
- *
58
- * @public
59
- */
60
- function mergeOptions(lhs, rhs) {
61
- if (!lhs || !rhs) {
62
- return lhs ?? rhs;
63
- }
64
- return {
65
- autoExpand: HierarchyFilteringPathOptions.mergeAutoExpandOptions(lhs.autoExpand, rhs.autoExpand),
66
- };
67
- }
68
- HierarchyFilteringPath.mergeOptions = mergeOptions;
69
- })(HierarchyFilteringPath || (HierarchyFilteringPath = {}));
70
- /**
71
- * An utility that extracts filtering properties from given root level filtering props or
72
- * the parent node. Returns `undefined` if filtering props are not present.
73
- * @public
74
- * @deprecated in 1.3. Use `createHierarchyFilteringHelper` instead.
75
- */
76
- /* c8 ignore start */
77
- export function extractFilteringProps(rootLevelFilteringProps, parentNode) {
78
- return extractFilteringPropsInternal(rootLevelFilteringProps, parentNode);
79
- }
80
- /* c8 ignore end */
81
- function extractFilteringPropsInternal(rootLevelFilteringProps, parentNode) {
82
- if (!parentNode) {
83
- return rootLevelFilteringProps ? { filteredNodePaths: rootLevelFilteringProps, hasFilterTargetAncestor: false } : undefined;
84
- }
85
- return parentNode.filtering?.filteredChildrenIdentifierPaths
86
- ? {
87
- filteredNodePaths: parentNode.filtering.filteredChildrenIdentifierPaths,
88
- hasFilterTargetAncestor: !!parentNode.filtering.hasFilterTargetAncestor || !!parentNode.filtering.isFilterTarget,
89
- }
90
- : undefined;
91
- }
92
- /**
93
- * Creates a set of utilities for making it easier to filter the given hierarchy
94
- * level.
95
- *
96
- * @public
97
- */
98
- export function createHierarchyFilteringHelper(rootLevelFilteringProps, parentNode) {
99
- const filteringProps = extractFilteringPropsInternal(rootLevelFilteringProps, parentNode);
100
- const hasFilter = !!filteringProps;
101
- return {
102
- /**
103
- * Returns a flag indicating if the hierarchy level is filtered.
104
- */
105
- hasFilter,
106
- /**
107
- * Returns a flag indicating whether this hierarchy level has an ancestor node
108
- * that is a filter target. That generally means that this and all downstream hierarchy
109
- * levels should be displayed without filter being applied to them, even if filter paths
110
- * say otherwise.
111
- */
112
- hasFilterTargetAncestor: filteringProps?.hasFilterTargetAncestor ?? false,
113
- /**
114
- * Returns a list of hierarchy node identifiers that apply specifically for this
115
- * hierarchy level. Returns `undefined` if filtering is not applied to this level.
116
- */
117
- getChildNodeFilteringIdentifiers: () => {
118
- if (!hasFilter) {
119
- return undefined;
120
- }
121
- return filteringProps.filteredNodePaths
122
- .map(HierarchyFilteringPath.normalize)
123
- .filter(({ path }) => path.length > 0)
124
- .map(({ path }) => path[0]);
125
- },
126
- /**
127
- * When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `filtering`
128
- * and `autoExpand`) to be set based on the filter paths and filtering options. This function calculates
129
- * these props for a child node based on its key or path matcher.
130
- *
131
- * When using `pathMatcher` prop, callers have more flexibility to decide whether the given `HierarchyNodeIdentifier` applies
132
- * to their node. For example, only some parts of the identifier can be checked for improved performance. Otherwise, the
133
- * `nodeKey` prop can be used to check the whole identifier.
134
- */
135
- createChildNodeProps: (props) => {
136
- if (!hasFilter) {
137
- return undefined;
138
- }
139
- const reducer = new MatchingFilteringPathsReducer(filteringProps?.hasFilterTargetAncestor);
140
- filteringProps.filteredNodePaths.forEach((filteredPath) => {
141
- const normalizedPath = HierarchyFilteringPath.normalize(filteredPath);
142
- if ("nodeKey" in props &&
143
- ((HierarchyNodeKey.isGeneric(props.nodeKey) && HierarchyNodeIdentifier.equal(normalizedPath.path[0], props.nodeKey)) ||
144
- (HierarchyNodeKey.isInstances(props.nodeKey) && props.nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier.equal(normalizedPath.path[0], ik))))) {
145
- reducer.accept(normalizedPath);
146
- }
147
- else if ("pathMatcher" in props && props.pathMatcher(normalizedPath.path[0])) {
148
- reducer.accept(normalizedPath);
149
- }
150
- });
151
- return reducer.getNodeProps();
152
- },
153
- /**
154
- * Similar to `createChildNodeProps`, but takes an async `pathMatcher` prop.
155
- */
156
- createChildNodePropsAsync: (props) => {
157
- if (!hasFilter) {
158
- return undefined;
159
- }
160
- const reducer = new MatchingFilteringPathsReducer(filteringProps?.hasFilterTargetAncestor);
161
- const matchedPathPromises = new Array();
162
- for (const filteredChildrenNodeIdentifierPath of filteringProps.filteredNodePaths) {
163
- const normalizedPath = HierarchyFilteringPath.normalize(filteredChildrenNodeIdentifierPath);
164
- /* c8 ignore next 3 */
165
- if (normalizedPath.path.length === 0) {
166
- continue;
167
- }
168
- const matchesPossiblyPromise = props.pathMatcher(normalizedPath.path[0]);
169
- if (matchesPossiblyPromise instanceof Promise) {
170
- matchedPathPromises.push(matchesPossiblyPromise.then((matches) => (matches ? normalizedPath : undefined)));
171
- continue;
172
- }
173
- if (!matchesPossiblyPromise) {
174
- continue;
175
- }
176
- reducer.accept(normalizedPath);
177
- }
178
- if (matchedPathPromises.length === 0) {
179
- return reducer.getNodeProps();
180
- }
181
- return Promise.all(matchedPathPromises)
182
- .then((matchedPath) => matchedPath.forEach((normalizedPath) => normalizedPath && reducer.accept(normalizedPath)))
183
- .then(() => reducer.getNodeProps());
184
- },
185
- };
186
- }
187
- class MatchingFilteringPathsReducer {
188
- _hasFilterTargetAncestor;
189
- _filteredChildrenIdentifierPaths = new Array();
190
- _isFilterTarget = false;
191
- _filterTargetOptions = undefined;
192
- _needsAutoExpand = false;
193
- constructor(_hasFilterTargetAncestor) {
194
- this._hasFilterTargetAncestor = _hasFilterTargetAncestor;
195
- }
196
- accept({ path, options }) {
197
- if (path.length === 1) {
198
- this._isFilterTarget = true;
199
- this._filterTargetOptions = HierarchyFilteringPath.mergeOptions(this._filterTargetOptions, options);
200
- }
201
- else if (path.length > 1) {
202
- this._filteredChildrenIdentifierPaths.push({ path: path.slice(1), options });
203
- this._needsAutoExpand = HierarchyFilteringPathOptions.mergeAutoExpandOptions(options?.autoExpand, this._needsAutoExpand);
204
- }
205
- }
206
- getNodeProps() {
207
- return {
208
- ...(this._hasFilterTargetAncestor || this._isFilterTarget || this._filteredChildrenIdentifierPaths.length > 0
209
- ? {
210
- filtering: {
211
- ...(this._hasFilterTargetAncestor ? { hasFilterTargetAncestor: true } : undefined),
212
- ...(this._isFilterTarget ? { isFilterTarget: true, filterTargetOptions: this._filterTargetOptions } : undefined),
213
- ...(this._filteredChildrenIdentifierPaths.length > 0 ? { filteredChildrenIdentifierPaths: this._filteredChildrenIdentifierPaths } : undefined),
214
- ...(this._needsAutoExpand && this._needsAutoExpand !== true
215
- ? {
216
- autoExpandDepth: this._needsAutoExpand.depth,
217
- includeGroupingNodes: this._needsAutoExpand.includeGroupingNodes ? true : false,
218
- }
219
- : undefined),
220
- },
221
- }
222
- : undefined),
223
- ...(this._needsAutoExpand ? { autoExpand: !!this._needsAutoExpand } : undefined),
224
- };
225
- }
226
- }
227
- //# sourceMappingURL=HierarchyFiltering.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HierarchyFiltering.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyFiltering.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,uBAAuB,EAAgC,MAAM,8BAA8B,CAAC;AACrG,OAAO,E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AU,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;SACjF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { HierarchyNode, NonGroupingHierarchyNode } from \"./HierarchyNode.js\";\nimport { HierarchyNodeIdentifier, HierarchyNodeIdentifiersPath } from \"./HierarchyNodeIdentifier.js\";\nimport { GenericNodeKey, HierarchyNodeKey, InstancesNodeKey } from \"./HierarchyNodeKey.js\";\n\n/** @public */\nexport interface FilteringPathAutoExpandOption {\n /**\n * Depth up to which nodes in the hierarchy should be expanded.\n *\n * If `includeGroupingNodes` is set to true, then depth should take into account the number of grouping nodes in hierarchy.\n */\n depth: number;\n /**\n * Whether or not `depth` includes grouping nodes.\n *\n * Use when you want to autoExpand only some of the grouping nodes.\n *\n * **Use case example:**\n *\n * You want to `autoExpand` only `Node1` and `GroupingNode1` in the following hierarchy:\n * - Node1\n * - GroupingNode1\n * - GroupingNode2\n * - Element1\n * - Element2\n * Then you provide `autoExpand: { depth: 2, includeGroupingNodes: true }`\n */\n includeGroupingNodes?: boolean;\n}\n\n/** @public */\nexport interface HierarchyFilteringPathOptions {\n /**\n * This option specifies the way `autoExpand` flag should be assigned to nodes in the filtered hierarchy.\n * - If it's `false` or `undefined`, nodes have no 'autoExpand' flag.\n * - If it's `true`, then all nodes up to the filter target will have `autoExpand` flag.\n * - If it's an instance of `FilteringPathAutoExpandOption`, then all nodes up to and including `depth` will have `autoExpand` flag.\n */\n autoExpand?: boolean | FilteringPathAutoExpandOption;\n}\n\nnamespace HierarchyFilteringPathOptions {\n export function mergeAutoExpandOptions(\n lhs: HierarchyFilteringPathOptions[\"autoExpand\"],\n rhs: HierarchyFilteringPathOptions[\"autoExpand\"],\n ): HierarchyFilteringPathOptions[\"autoExpand\"] {\n if (rhs === true || lhs === true) {\n return true;\n }\n if (!rhs || !lhs) {\n return !!rhs ? rhs : lhs;\n }\n\n if (!lhs.includeGroupingNodes) {\n if (!rhs.includeGroupingNodes) {\n return lhs.depth > rhs.depth ? lhs : rhs;\n }\n return lhs;\n }\n if (!rhs.includeGroupingNodes) {\n return rhs;\n }\n return lhs.depth > rhs.depth ? lhs : rhs;\n }\n}\n\n/**\n * A path of hierarchy node identifiers for filtering the hierarchy with additional options.\n * @public\n */\nexport type HierarchyFilteringPath = HierarchyNodeIdentifiersPath | { path: HierarchyNodeIdentifiersPath; options?: HierarchyFilteringPathOptions };\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyFilteringPath {\n /**\n * Normalizes the hierarchy filtering path to the object form.\n * @public\n */\n export function normalize(source: HierarchyFilteringPath): Exclude<HierarchyFilteringPath, HierarchyNodeIdentifiersPath> {\n if (Array.isArray(source)) {\n return { path: source };\n }\n return source;\n }\n\n /**\n * Merges two given `HierarchyFilteringPathOptions` objects.\n * - if both inputs are `undefined`, `undefined` is returned,\n * - else if one of the inputs is `undefined`, the other one is returned.\n * - else, merge each option individually.\n *\n * For the `autoExpand` attribute, the merge chooses to auto-expand 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 `includeGroupingNodes` set to `true` or `key` defined, return the one that has only `depth` set,\n * - else return the one with greater `depth`.\n *\n * @public\n */\n export function mergeOptions(\n lhs: HierarchyFilteringPathOptions | undefined,\n rhs: HierarchyFilteringPathOptions | undefined,\n ): HierarchyFilteringPathOptions | undefined {\n if (!lhs || !rhs) {\n return lhs ?? rhs;\n }\n\n return {\n autoExpand: HierarchyFilteringPathOptions.mergeAutoExpandOptions(lhs.autoExpand, rhs.autoExpand),\n };\n }\n}\n\n/**\n * An utility that extracts filtering properties from given root level filtering props or\n * the parent node. Returns `undefined` if filtering props are not present.\n * @public\n * @deprecated in 1.3. Use `createHierarchyFilteringHelper` instead.\n */\n/* c8 ignore start */\nexport function extractFilteringProps(\n rootLevelFilteringProps: HierarchyFilteringPath[],\n parentNode: Pick<NonGroupingHierarchyNode, \"filtering\"> | undefined,\n):\n | {\n filteredNodePaths: HierarchyFilteringPath[];\n hasFilterTargetAncestor: boolean;\n }\n | undefined {\n return extractFilteringPropsInternal(rootLevelFilteringProps, parentNode);\n}\n/* c8 ignore end */\n\nfunction extractFilteringPropsInternal(\n rootLevelFilteringProps: HierarchyFilteringPath[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"filtering\"> | undefined,\n):\n | {\n filteredNodePaths: HierarchyFilteringPath[];\n hasFilterTargetAncestor: boolean;\n }\n | undefined {\n if (!parentNode) {\n return rootLevelFilteringProps ? { filteredNodePaths: rootLevelFilteringProps, hasFilterTargetAncestor: false } : undefined;\n }\n return parentNode.filtering?.filteredChildrenIdentifierPaths\n ? {\n filteredNodePaths: parentNode.filtering.filteredChildrenIdentifierPaths,\n hasFilterTargetAncestor: !!parentNode.filtering.hasFilterTargetAncestor || !!parentNode.filtering.isFilterTarget,\n }\n : undefined;\n}\n\n/**\n * Creates a set of utilities for making it easier to filter the given hierarchy\n * level.\n *\n * @public\n */\nexport function createHierarchyFilteringHelper(\n rootLevelFilteringProps: HierarchyFilteringPath[] | undefined,\n parentNode: Pick<NonGroupingHierarchyNode, \"filtering\"> | undefined,\n) {\n const filteringProps = extractFilteringPropsInternal(rootLevelFilteringProps, parentNode);\n const hasFilter = !!filteringProps;\n return {\n /**\n * Returns a flag indicating if the hierarchy level is filtered.\n */\n hasFilter,\n\n /**\n * Returns a flag indicating whether this hierarchy level has an ancestor node\n * that is a filter target. That generally means that this and all downstream hierarchy\n * levels should be displayed without filter being applied to them, even if filter paths\n * say otherwise.\n */\n hasFilterTargetAncestor: filteringProps?.hasFilterTargetAncestor ?? false,\n\n /**\n * Returns a list of hierarchy node identifiers that apply specifically for this\n * hierarchy level. Returns `undefined` if filtering is not applied to this level.\n */\n getChildNodeFilteringIdentifiers: () => {\n if (!hasFilter) {\n return undefined;\n }\n return filteringProps.filteredNodePaths\n .map(HierarchyFilteringPath.normalize)\n .filter(({ path }) => path.length > 0)\n .map(({ path }) => path[0]);\n },\n\n /**\n * When a hierarchy node is created for a filtered hierarchy level, it needs some attributes (e.g. `filtering`\n * and `autoExpand`) to be set based on the filter paths and filtering options. This function calculates\n * these props for a child node based on its key or path matcher.\n *\n * When using `pathMatcher` 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 createChildNodeProps: (\n props:\n | {\n nodeKey: InstancesNodeKey | GenericNodeKey;\n }\n | {\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean;\n },\n ): NodeProps | undefined => {\n if (!hasFilter) {\n return undefined;\n }\n const reducer = new MatchingFilteringPathsReducer(filteringProps?.hasFilterTargetAncestor);\n filteringProps.filteredNodePaths.forEach((filteredPath) => {\n const normalizedPath = HierarchyFilteringPath.normalize(filteredPath);\n if (\n \"nodeKey\" in props &&\n ((HierarchyNodeKey.isGeneric(props.nodeKey) && HierarchyNodeIdentifier.equal(normalizedPath.path[0], props.nodeKey)) ||\n (HierarchyNodeKey.isInstances(props.nodeKey) && props.nodeKey.instanceKeys.some((ik) => HierarchyNodeIdentifier.equal(normalizedPath.path[0], ik))))\n ) {\n reducer.accept(normalizedPath);\n } else if (\"pathMatcher\" in props && props.pathMatcher(normalizedPath.path[0])) {\n reducer.accept(normalizedPath);\n }\n });\n return reducer.getNodeProps();\n },\n\n /**\n * Similar to `createChildNodeProps`, but takes an async `pathMatcher` prop.\n */\n createChildNodePropsAsync: (props: {\n pathMatcher: (identifier: HierarchyNodeIdentifier) => boolean | Promise<boolean>;\n }): Promise<NodeProps | undefined> | NodeProps | undefined => {\n if (!hasFilter) {\n return undefined;\n }\n const reducer = new MatchingFilteringPathsReducer(filteringProps?.hasFilterTargetAncestor);\n const matchedPathPromises = new Array<Promise<NormalizedFilteringPath | undefined>>();\n for (const filteredChildrenNodeIdentifierPath of filteringProps.filteredNodePaths) {\n const normalizedPath = HierarchyFilteringPath.normalize(filteredChildrenNodeIdentifierPath);\n /* c8 ignore next 3 */\n if (normalizedPath.path.length === 0) {\n continue;\n }\n\n const matchesPossiblyPromise = props.pathMatcher(normalizedPath.path[0]);\n if (matchesPossiblyPromise instanceof Promise) {\n matchedPathPromises.push(matchesPossiblyPromise.then((matches) => (matches ? normalizedPath : undefined)));\n continue;\n }\n if (!matchesPossiblyPromise) {\n continue;\n }\n\n reducer.accept(normalizedPath);\n }\n if (matchedPathPromises.length === 0) {\n return reducer.getNodeProps();\n }\n return Promise.all(matchedPathPromises)\n .then((matchedPath) => matchedPath.forEach((normalizedPath) => normalizedPath && reducer.accept(normalizedPath)))\n .then(() => reducer.getNodeProps());\n },\n };\n}\n\n/** @public */\nexport type NodeProps = Pick<HierarchyNode, \"autoExpand\" | \"filtering\"> & { filtering?: { autoExpandDepth?: number; includeGroupingNodes?: boolean } };\n\ntype NormalizedFilteringPath = ReturnType<(typeof HierarchyFilteringPath)[\"normalize\"]>;\n\nclass MatchingFilteringPathsReducer {\n private _filteredChildrenIdentifierPaths = new Array<NormalizedFilteringPath>();\n private _isFilterTarget = false;\n private _filterTargetOptions = undefined as HierarchyFilteringPathOptions | undefined;\n private _needsAutoExpand: HierarchyFilteringPathOptions[\"autoExpand\"] = false;\n\n public constructor(private _hasFilterTargetAncestor: boolean) {}\n\n public accept({ path, options }: NormalizedFilteringPath) {\n if (path.length === 1) {\n this._isFilterTarget = true;\n this._filterTargetOptions = HierarchyFilteringPath.mergeOptions(this._filterTargetOptions, options);\n } else if (path.length > 1) {\n this._filteredChildrenIdentifierPaths.push({ path: path.slice(1), options });\n this._needsAutoExpand = HierarchyFilteringPathOptions.mergeAutoExpandOptions(options?.autoExpand, this._needsAutoExpand);\n }\n }\n public getNodeProps(): NodeProps {\n return {\n ...(this._hasFilterTargetAncestor || this._isFilterTarget || this._filteredChildrenIdentifierPaths.length > 0\n ? {\n filtering: {\n ...(this._hasFilterTargetAncestor ? { hasFilterTargetAncestor: true } : undefined),\n ...(this._isFilterTarget ? { isFilterTarget: true, filterTargetOptions: this._filterTargetOptions } : undefined),\n ...(this._filteredChildrenIdentifierPaths.length > 0 ? { filteredChildrenIdentifierPaths: this._filteredChildrenIdentifierPaths } : undefined),\n ...(this._needsAutoExpand && this._needsAutoExpand !== true\n ? {\n autoExpandDepth: this._needsAutoExpand.depth,\n includeGroupingNodes: this._needsAutoExpand.includeGroupingNodes ? true : false,\n }\n : undefined),\n },\n }\n : undefined),\n ...(this._needsAutoExpand ? { autoExpand: !!this._needsAutoExpand } : undefined),\n };\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"HierarchyNode.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNode.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,4BAA4B,EAC5B,iCAAiC,EAClC,MAAM,uBAAuB,CAAC;AAE/B,cAAc;AACd,MAAM,MAAM,2BAA2B,GAAG;IACxC,4FAA4F;IAC5F,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,wDAAwD;IACxD,+BAA+B,CAAC,EAAE,sBAAsB,EAAE,CAAC;CAC5D,GAAG,CACA;IACE,mDAAmD;IACnD,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB,GACD;IACE,mDAAmD;IACnD,cAAc,EAAE,IAAI,CAAC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,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IAJe,oCAAsB,yBAIrC,CAAA;AACH,CAAC,EArDgB,aAAa,KAAb,aAAa,QAqD7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { OmitOverUnion } from \"@itwin/presentation-shared\";\nimport { HierarchyFilteringPath, HierarchyFilteringPathOptions } from \"./HierarchyFiltering.js\";\nimport {\n ClassGroupingNodeKey,\n GenericNodeKey,\n GroupingNodeKey,\n HierarchyNodeKey,\n IModelHierarchyNodeKey,\n IModelInstanceKey,\n InstancesNodeKey,\n LabelGroupingNodeKey,\n PropertyGroupingNodeKey,\n PropertyOtherValuesGroupingNodeKey,\n PropertyValueGroupingNodeKey,\n PropertyValueRangeGroupingNodeKey,\n} from \"./HierarchyNodeKey.js\";\n\n/** @public */\nexport type HierarchyNodeFilteringProps = {\n /** If set to true, then one of the ancestor nodes in the hierarchy is the filter target. */\n hasFilterTargetAncestor?: boolean;\n /** Paths to node's children that are filter targets. */\n filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];\n} & (\n | {\n /** Whether or not this node is a filter target. */\n isFilterTarget?: false;\n }\n | {\n /** Whether or not this node is a filter target. */\n isFilterTarget: true;\n /** Options that were used to filter the node. */\n filterTargetOptions?: HierarchyFilteringPathOptions;\n }\n);\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeFilteringProps {\n /** @deprecated in 1.3. Use `createHierarchyFilteringHelper` and its `createChildNodeProps` function to create filtering props for nodes. */\n /* c8 ignore start */\n export function create(props: {\n hasFilterTargetAncestor?: boolean;\n filteredChildrenIdentifierPaths?: HierarchyFilteringPath[];\n isFilterTarget?: boolean;\n filterTargetOptions?: HierarchyFilteringPathOptions;\n }): HierarchyNodeFilteringProps | undefined {\n const { hasFilterTargetAncestor, filteredChildrenIdentifierPaths, isFilterTarget, filterTargetOptions } = props;\n if (isFilterTarget || hasFilterTargetAncestor || filteredChildrenIdentifierPaths?.length) {\n return {\n ...(isFilterTarget ? { isFilterTarget, filterTargetOptions } : undefined),\n ...(hasFilterTargetAncestor ? { hasFilterTargetAncestor } : undefined),\n ...(!!filteredChildrenIdentifierPaths?.length ? { filteredChildrenIdentifierPaths } : undefined),\n };\n }\n return undefined;\n }\n /* c8 ignore end */\n}\n\n/**\n * A data structure that defines attributes that are common to all types of hierarchy nodes.\n * @public\n */\ninterface BaseHierarchyNode {\n /** Identifiers of all node ancestors. Can be used to identify a node in the hierarchy. */\n parentKeys: HierarchyNodeKey[];\n /** Node's display label. */\n label: string;\n /** A flag indicating whether the node has children or not. */\n children: boolean;\n /** A flag indicating whether this node should be auto-expanded in the UI. */\n autoExpand?: boolean;\n /** Additional data that may be assigned to this node. */\n extendedData?: { [key: string]: any };\n /** Data that may be assigned to the node if filtering is enabled */\n filtering?: HierarchyNodeFilteringProps;\n}\n\n/**\n * A data structure that represents a single non-grouping hierarchy node.\n * @public\n */\nexport interface NonGroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify the node in its hierarchy level. */\n key: GenericNodeKey | InstancesNodeKey;\n /**\n * Identifies whether the hierarchy level below this node supports filtering. If not, supplying an instance\n * filter when requesting child hierarchy level will have no effect.\n */\n supportsFiltering?: boolean;\n}\n\n/**\n * A data structure that represents a grouping node that groups other nodes.\n * @public\n */\nexport interface GroupingHierarchyNode extends BaseHierarchyNode {\n /** An identifier to identify this grouping node in its hierarchy level. */\n key: GroupingNodeKey;\n\n /**\n * Keys of all instances grouped by this node, including deeply nested under\n * other grouping nodes.\n */\n groupedInstanceKeys: IModelInstanceKey[];\n\n /** The closest ancestor node that is not a grouping node. May be `undefined` if the grouping node grouped root level nodes. */\n nonGroupingAncestor?: ParentHierarchyNode<NonGroupingHierarchyNode>;\n}\n\n/**\n * A data structure that represents a single hierarchy node.\n * @public\n */\nexport type HierarchyNode = NonGroupingHierarchyNode | GroupingHierarchyNode;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNode {\n /** Checks whether the given node is a generic node */\n export function isGeneric<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & NonGroupingHierarchyNode & { key: GenericNodeKey } {\n return HierarchyNodeKey.isGeneric(node.key);\n }\n /** Checks whether the given node is a standard (iModel content based) node */\n export function isIModelNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & { key: IModelHierarchyNodeKey } {\n return HierarchyNodeKey.isIModelNodeKey(node.key);\n }\n /** Checks whether the given node is an ECInstances-based node */\n export function isInstancesNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & NonGroupingHierarchyNode & { key: InstancesNodeKey } {\n return HierarchyNodeKey.isInstances(node.key);\n }\n /** Checks whether the given node is a grouping node */\n export function isGroupingNode<TNode extends { key: HierarchyNodeKey }>(node: TNode): node is TNode & GroupingHierarchyNode {\n return HierarchyNodeKey.isGrouping(node.key);\n }\n /** Checks whether the given node is a class grouping node */\n export function isClassGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: ClassGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isClassGrouping(node.key);\n }\n /** Checks whether the given node is a label grouping node */\n export function isLabelGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: LabelGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isLabelGrouping(node.key);\n }\n /** Checks whether the given node is property grouping node for other values */\n export function isPropertyOtherValuesGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyOtherValuesGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isPropertyOtherValuesGrouping(node.key);\n }\n /** Checks whether the given node is a property value grouping node */\n export function isPropertyValueGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyValueGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isPropertyValueGrouping(node.key);\n }\n /** Checks whether the given node is a property value range grouping node */\n export function isPropertyValueRangeGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyValueRangeGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isPropertyValueRangeGrouping(node.key);\n }\n /** Checks whether the given node is a property grouping node */\n export function isPropertyGroupingNode<TNode extends { key: HierarchyNodeKey }>(\n node: TNode,\n ): node is TNode & { key: PropertyGroupingNodeKey; supportsFiltering?: undefined } & GroupingHierarchyNode {\n return HierarchyNodeKey.isPropertyGrouping(node.key);\n }\n}\n\n/**\n * A type of `HierarchyNode` that doesn't know about its children and is an input when requesting\n * them using `HierarchyProvider.getNodes`.\n * @public\n */\nexport type ParentHierarchyNode<TBase = HierarchyNode> = OmitOverUnion<TBase, \"children\">;\n"]}
@@ -1,29 +0,0 @@
1
- import { GenericNodeKey, IModelInstanceKey } from "./HierarchyNodeKey.js";
2
- /**
3
- * An identifier that can be used to identify either an ECInstance or a generic node.
4
- *
5
- * This is different from `HierarchyNodeKey` - the key can represent more types of nodes and,
6
- * in case of `InstancesNodeKey`, contains information about all instances the node represents.
7
- * `HierarchyNodeIdentifier`, on the other hand, is used for matching a node, so it only needs
8
- * to contain information about a single instance.
9
- *
10
- * @public
11
- */
12
- export type HierarchyNodeIdentifier = IModelInstanceKey | GenericNodeKey;
13
- /** @public */
14
- export declare namespace HierarchyNodeIdentifier {
15
- /** Checks whether the given identifier is an instance node identifier */
16
- function isInstanceNodeIdentifier(id: HierarchyNodeIdentifier): id is IModelInstanceKey;
17
- /** Checks whether the given identifier is a generic node identifier */
18
- function isGenericNodeIdentifier(id: HierarchyNodeIdentifier): id is GenericNodeKey;
19
- /** Checks two identifiers for equality */
20
- function equal(lhs: HierarchyNodeIdentifier, rhs: HierarchyNodeIdentifier): boolean;
21
- }
22
- /**
23
- * A path of hierarchy node identifiers, typically used to describe a path from root down
24
- * to specific node deep in the hierarchy.
25
- *
26
- * @public
27
- */
28
- export type HierarchyNodeIdentifiersPath = HierarchyNodeIdentifier[];
29
- //# sourceMappingURL=HierarchyNodeIdentifier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HierarchyNodeIdentifier.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1E;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAEzE,cAAc;AAEd,yBAAiB,uBAAuB,CAAC;IACvC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,iBAAiB,CAE7F;IAED,uEAAuE;IACvE,SAAgB,uBAAuB,CAAC,EAAE,EAAE,uBAAuB,GAAG,EAAE,IAAI,cAAc,CAEzF;IAED,0CAA0C;IAC1C,SAAgB,KAAK,CAAC,GAAG,EAAE,uBAAuB,EAAE,GAAG,EAAE,uBAAuB,WAQ/E;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"HierarchyNodeIdentifier.js","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeIdentifier.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAezD,cAAc;AACd,2DAA2D;AAC3D,MAAM,KAAW,uBAAuB,CAqBvC;AArBD,WAAiB,uBAAuB;IACtC,yEAAyE;IACzE,SAAgB,wBAAwB,CAAC,EAA2B;QAClE,OAAO,WAAW,IAAI,EAAE,CAAC;IAC3B,CAAC;IAFe,gDAAwB,2BAEvC,CAAA;IAED,uEAAuE;IACvE,SAAgB,uBAAuB,CAAC,EAA2B;QACjE,OAAO,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAFe,+CAAuB,0BAEtC,CAAA;IAED,0CAA0C;IAC1C,SAAgB,KAAK,CAAC,GAA4B,EAAE,GAA4B;QAC9E,IAAI,wBAAwB,CAAC,GAAG,CAAC,IAAI,wBAAwB,CAAC,GAAG,CAAC,EAAE,CAAC;YACnE,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,CAAC;QACzE,CAAC;QACD,IAAI,uBAAuB,CAAC,GAAG,CAAC,IAAI,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC;YACjE,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IARe,6BAAK,QAQpB,CAAA;AACH,CAAC,EArBgB,uBAAuB,KAAvB,uBAAuB,QAqBvC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstanceKey } from \"@itwin/presentation-shared\";\nimport { GenericNodeKey, IModelInstanceKey } from \"./HierarchyNodeKey.js\";\n\n/**\n * An identifier that can be used to identify either an ECInstance or a generic node.\n *\n * This is different from `HierarchyNodeKey` - the key can represent more types of nodes and,\n * in case of `InstancesNodeKey`, contains information about all instances the node represents.\n * `HierarchyNodeIdentifier`, on the other hand, is used for matching a node, so it only needs\n * to contain information about a single instance.\n *\n * @public\n */\nexport type HierarchyNodeIdentifier = IModelInstanceKey | GenericNodeKey;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeIdentifier {\n /** Checks whether the given identifier is an instance node identifier */\n export function isInstanceNodeIdentifier(id: HierarchyNodeIdentifier): id is IModelInstanceKey {\n return \"className\" in id;\n }\n\n /** Checks whether the given identifier is a generic node identifier */\n export function isGenericNodeIdentifier(id: HierarchyNodeIdentifier): id is GenericNodeKey {\n return !isInstanceNodeIdentifier(id);\n }\n\n /** Checks two identifiers for equality */\n export function equal(lhs: HierarchyNodeIdentifier, rhs: HierarchyNodeIdentifier) {\n if (isInstanceNodeIdentifier(lhs) && isInstanceNodeIdentifier(rhs)) {\n return InstanceKey.equals(lhs, rhs) && lhs.imodelKey === rhs.imodelKey;\n }\n if (isGenericNodeIdentifier(lhs) && isGenericNodeIdentifier(rhs)) {\n return lhs.source === rhs.source && lhs.id === rhs.id;\n }\n return false;\n }\n}\n\n/**\n * A path of hierarchy node identifiers, typically used to describe a path from root down\n * to specific node deep in the hierarchy.\n *\n * @public\n */\nexport type HierarchyNodeIdentifiersPath = HierarchyNodeIdentifier[];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"HierarchyNodeKey.d.ts","sourceRoot":"","sources":["../../../src/hierarchies/HierarchyNodeKey.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,IAAI,EAAE,SAAS,CAAC;IAEhB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,IAAI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AAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,EAAE,CAAC;oBACpC,OAAO,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChD,CAAC;gBACD,OAAO,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAxFe,wBAAO,UAwFtB,CAAA;IAED,mDAAmD;IACnD,SAAgB,MAAM,CAAC,GAAqB,EAAE,GAAqB;QACjE,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAFe,uBAAM,SAErB,CAAA;AACH,CAAC,EAvJgB,gBAAgB,KAAhB,gBAAgB,QAuJhC","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 { assert, compareStrings, compareStringsOrUndefined } from \"@itwin/core-bentley\";\nimport { InstanceKey } from \"@itwin/presentation-shared\";\n\n/**\n * An instance key that may be associated with specific iModel.\n * @public\n */\nexport interface IModelInstanceKey extends InstanceKey {\n imodelKey?: string;\n}\n\n/**\n * A key for a generic node.\n * @public\n */\nexport interface GenericNodeKey {\n /** Type of the node */\n type: \"generic\";\n\n /**\n * Node key identifier, which uniquely identifies the node within the hierarchy level the node is used.\n * The format of the identifier is not specified and is up to the data source.\n */\n id: string;\n\n /**\n * Optional data source identifier. Useful when a hierarchy is built using multiple hierarchy providers - in that\n * case each provider can assign a unique source identifier to its nodes.\n */\n source?: string;\n}\n\n/**\n * A key for a node that represents one or more ECInstances.\n * @public\n */\nexport interface InstancesNodeKey {\n /** Type of the node */\n type: \"instances\";\n\n /**\n * Keys of ECInstances that are represented by the node. Generally, one node represents a single\n * ECInstance, but in some cases (e.g. node merging) there could be more.\n */\n instanceKeys: IModelInstanceKey[];\n}\n\n/**\n * A key for a class-grouping node.\n * @public\n */\nexport interface ClassGroupingNodeKey {\n /** Type of the node */\n type: \"class-grouping\";\n\n /** Full name of the ECClass that this grouping node is grouping by. */\n className: string;\n}\n\n/**\n * A key for a label-grouping node.\n * @public\n */\nexport interface LabelGroupingNodeKey {\n /** Type of the node */\n type: \"label-grouping\";\n\n /** Node label that this grouping node is grouping by. */\n label: string;\n\n /**\n * Optional group identifier that is assigned to the node key when multiple nodes\n * with the same label shouldn't be grouped together.\n */\n groupId?: string;\n}\n\n/**\n * A key property grouping node that groups nodes whose values don't fall into any other\n * property group in the hierarchy level.\n * @public\n */\nexport interface PropertyOtherValuesGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:other\";\n /** Identifiers of properties whose values are grouped under this node. */\n properties: Array<{\n className: string;\n propertyName: string;\n }>;\n}\n\n/**\n * A key for a property grouping node that groups nodes by formatted property value.\n * @public\n */\nexport interface PropertyValueGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:value\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Formatted property value that this node is grouping by. */\n formattedPropertyValue: string;\n}\n\n/**\n * A key for a property grouping node that groups nodes by a range of property values.\n * @public\n */\nexport interface PropertyValueRangeGroupingNodeKey {\n /** Type of the node */\n type: \"property-grouping:range\";\n\n /** Name of the property that is used for grouping nodes. */\n propertyName: string;\n\n /** Full name of the ECClass containing the property. */\n propertyClassName: string;\n\n /** Defines the start of the values' range that this node is grouping by. */\n fromValue: number;\n\n /** Defines the end of the values' range that this node is grouping by. */\n toValue: number;\n}\n\n/**\n * A key for a property grouping node.\n * @public\n */\nexport type PropertyGroupingNodeKey = PropertyValueRangeGroupingNodeKey | PropertyValueGroupingNodeKey | PropertyOtherValuesGroupingNodeKey;\n\n/**\n * A key for one of the instance grouping nodes.\n * @public\n */\nexport type GroupingNodeKey = ClassGroupingNodeKey | LabelGroupingNodeKey | PropertyGroupingNodeKey;\n\n/**\n * A key for either an instance node or one of the instance grouping nodes.\n * @public\n */\nexport type IModelHierarchyNodeKey = InstancesNodeKey | GroupingNodeKey;\n\n/**\n * A key that uniquely identifies a node in a hierarchy level.\n * @public\n */\nexport type HierarchyNodeKey = IModelHierarchyNodeKey | GenericNodeKey;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace HierarchyNodeKey {\n /** Checks whether the given node key is a generic node key. */\n export function isGeneric(key: HierarchyNodeKey): key is GenericNodeKey {\n return key.type === \"generic\";\n }\n\n /** Checks whether the given node key is a `StandardHierarchyNodeKey`. */\n export function isIModelNodeKey(key: HierarchyNodeKey): key is IModelHierarchyNodeKey {\n return !isGeneric(key);\n }\n\n /** Checks whether the given node key is an `InstancesNodeKey`. */\n export function isInstances(key: HierarchyNodeKey): key is InstancesNodeKey {\n return key.type === \"instances\";\n }\n\n /** Checks whether the given node key is a `GroupingNodeKey`. */\n export function isGrouping(key: HierarchyNodeKey): key is GroupingNodeKey {\n return !isGeneric(key) && !isInstances(key);\n }\n\n /** Checks whether the given node key is a `ClassGroupingNodeKey`. */\n export function isClassGrouping(key: HierarchyNodeKey): key is ClassGroupingNodeKey {\n return key.type === \"class-grouping\";\n }\n\n /** Checks whether the given node key is a `LabelGroupingNodeKey`. */\n export function isLabelGrouping(key: HierarchyNodeKey): key is LabelGroupingNodeKey {\n return key.type === \"label-grouping\";\n }\n\n /** Checks whether the given node key is a `PropertyOtherValuesGroupingNodeKey`. */\n export function isPropertyOtherValuesGrouping(key: HierarchyNodeKey): key is PropertyOtherValuesGroupingNodeKey {\n return key.type === \"property-grouping:other\";\n }\n\n /** Checks whether the given node key is a `PropertyValueRangeGroupingNodeKey`. */\n export function isPropertyValueRangeGrouping(key: HierarchyNodeKey): key is PropertyValueRangeGroupingNodeKey {\n return key.type === \"property-grouping:range\";\n }\n\n /** Checks whether the given node key is a `PropertyValueGroupingNodeKey`. */\n export function isPropertyValueGrouping(key: HierarchyNodeKey): key is PropertyValueGroupingNodeKey {\n return key.type === \"property-grouping:value\";\n }\n\n /** Checks whether the given node key is a `PropertyGroupingNodeKey`. */\n export function isPropertyGrouping(key: HierarchyNodeKey): key is PropertyGroupingNodeKey {\n return isPropertyOtherValuesGrouping(key) || isPropertyValueRangeGrouping(key) || isPropertyValueGrouping(key);\n }\n\n /**\n * Compares two given keys. Returns:\n * - `0` if they are equal,\n * - `negative value` if lhs key is less than rhs key,\n * - `positive value` if lhs key is more than rhs key.\n */\n export function compare(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): number {\n const typeCompareResult = compareStrings(lhs.type, rhs.type);\n if (typeCompareResult !== 0) {\n return typeCompareResult;\n }\n switch (lhs.type) {\n case \"generic\": {\n assert(rhs.type === \"generic\");\n const idCompareResult = compareStrings(lhs.id, rhs.id);\n if (idCompareResult !== 0) {\n return idCompareResult;\n }\n return compareStringsOrUndefined(lhs.source, rhs.source);\n }\n case \"instances\": {\n assert(rhs.type === \"instances\");\n if (lhs.instanceKeys.length !== rhs.instanceKeys.length) {\n return lhs.instanceKeys.length > rhs.instanceKeys.length ? 1 : -1;\n }\n for (let i = 0; i < lhs.instanceKeys.length; ++i) {\n const instanceKeyCompareResult = InstanceKey.compare(lhs.instanceKeys[i], rhs.instanceKeys[i]);\n if (instanceKeyCompareResult !== 0) {\n return instanceKeyCompareResult;\n }\n const imodelKeyCompareResult = compareStringsOrUndefined(lhs.instanceKeys[0].imodelKey, rhs.instanceKeys[0].imodelKey);\n if (imodelKeyCompareResult !== 0) {\n return imodelKeyCompareResult;\n }\n }\n return 0;\n }\n case \"class-grouping\": {\n assert(rhs.type === \"class-grouping\");\n return compareStrings(lhs.className, rhs.className);\n }\n case \"label-grouping\": {\n assert(rhs.type === \"label-grouping\");\n const labelCompareResult = compareStrings(lhs.label, rhs.label);\n if (labelCompareResult !== 0) {\n return labelCompareResult;\n }\n return compareStringsOrUndefined(lhs.groupId, rhs.groupId);\n }\n case \"property-grouping:other\": {\n assert(rhs.type === \"property-grouping:other\");\n if (lhs.properties.length !== rhs.properties.length) {\n return lhs.properties.length - rhs.properties.length;\n }\n for (let i = 0; i < lhs.properties.length; ++i) {\n const classCompareResult = compareStrings(lhs.properties[i].className, rhs.properties[i].className);\n if (classCompareResult !== 0) {\n return classCompareResult;\n }\n const nameCompareResult = compareStrings(lhs.properties[i].propertyName, rhs.properties[i].propertyName);\n if (nameCompareResult !== 0) {\n return nameCompareResult;\n }\n }\n return 0;\n }\n case \"property-grouping:value\": {\n assert(rhs.type === \"property-grouping:value\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n return compareStrings(lhs.formattedPropertyValue, rhs.formattedPropertyValue);\n }\n case \"property-grouping:range\": {\n assert(rhs.type === \"property-grouping:range\");\n const propertyClassNameCompareResult = compareStrings(lhs.propertyClassName, rhs.propertyClassName);\n if (propertyClassNameCompareResult !== 0) {\n return propertyClassNameCompareResult;\n }\n const propertyNameCompareResult = compareStrings(lhs.propertyName, rhs.propertyName);\n if (propertyNameCompareResult !== 0) {\n return propertyNameCompareResult;\n }\n if (lhs.fromValue !== rhs.fromValue) {\n return lhs.fromValue > rhs.fromValue ? 1 : -1;\n }\n return lhs.toValue > rhs.toValue ? 1 : lhs.toValue < rhs.toValue ? -1 : 0;\n }\n }\n }\n\n /** Checks whether the two given keys are equal. */\n export function equals(lhs: HierarchyNodeKey, rhs: HierarchyNodeKey): boolean {\n return compare(lhs, rhs) === 0;\n }\n}\n"]}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,CACH,CACF,EACD,wBAAwB,CAEzB,CACF;QACH,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClH,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAChF,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpF,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;QACzB,OAAO;KACR,CAAC;AACJ,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 \"./internal/DisposePolyfill.js\";\nimport { filter, first, from, map, mergeMap, of } from \"rxjs\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { GenericInstanceFilter } from \"@itwin/core-common\";\nimport { Event, InstanceKey, IPrimitiveValueFormatter, Props } from \"@itwin/presentation-shared\";\nimport { HierarchyFilteringPath } from \"./HierarchyFiltering.js\";\nimport { HierarchyNode, ParentHierarchyNode } from \"./HierarchyNode.js\";\nimport { safeDispose } from \"./internal/Common.js\";\nimport { eachValueFrom } from \"./internal/EachValueFrom.js\";\nimport { sortNodesByLabelOperator } from \"./internal/operators/Sorting.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?: {\n newFormatter: IPrimitiveValueFormatter | undefined;\n };\n\n /** Set when the hierarchy change was caused by a hierarchy filter change. */\n filterChange?: {\n newFilter: Props<HierarchyProvider[\"setHierarchyFilter\"]>;\n };\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. Provider may\n * set additional event arguments to provide extra information about what caused the change.\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 optional\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 filter used by this hierarchy provider. Setting to `undefined`\n * removes the filter.\n *\n * @note There's a difference between `undefined` filter and filter with empty paths list. The\n * former means no filter is applied, while the latter means the filter is applied and it filters-out\n * all hierarchy.\n *\n * @note Changing filter is expected to trigger the `hierarchyChanged` event with `filterChange` arg.\n */\n setHierarchyFilter(\n props:\n | {\n /** A list of node identifiers from root to target node. */\n paths: HierarchyFilteringPath[];\n }\n | undefined,\n ): void;\n}\n\n/**\n * Props for `mergeProviders` function.\n * @public\n */\ninterface MergeHierarchyProvidersProps {\n /** List of providers to merge. */\n providers: HierarchyProvider[];\n}\n\n/**\n * Creates a single, merged, hierarchy provider from multiple given providers.\n * @public\n */\nexport function mergeProviders({ providers }: MergeHierarchyProvidersProps): HierarchyProvider & {\n /** @deprecated in 1.4. Use `[Symbol.dispose]` instead. */\n dispose: () => void;\n [Symbol.dispose]: () => void;\n} {\n const hierarchyChanged = new BeEvent<() => void>();\n providers.forEach((p) => {\n p.hierarchyChanged.addListener(() => hierarchyChanged.raiseEvent());\n });\n const dispose = () => {\n hierarchyChanged.clear();\n providers.forEach((p) => safeDispose(p));\n };\n\n return {\n hierarchyChanged,\n getNodes: (props) =>\n eachValueFrom(\n from(providers).pipe(\n mergeMap((provider) =>\n from(provider.getNodes(props)).pipe(\n mergeMap((node) => {\n if (node.children) {\n return of(node);\n }\n // each provider only considers its own data when determining node's children - in case it says\n // the node has no children, we have to check against the other providers too\n return from(providers).pipe(\n filter((p) => p !== provider),\n mergeMap((p) => p.getNodes({ parentNode: node })),\n map(() => true),\n first(undefined, false),\n map((hasChildren) => ({ ...node, children: hasChildren })),\n );\n }),\n ),\n ),\n sortNodesByLabelOperator,\n // TODO: consider merging similar nodes\n ),\n ),\n getNodeInstanceKeys: (props) => eachValueFrom(from(providers).pipe(mergeMap((p) => p.getNodeInstanceKeys(props)))),\n setFormatter: (formatter) => providers.forEach((p) => p.setFormatter(formatter)),\n setHierarchyFilter: (props) => providers.forEach((p) => p.setHierarchyFilter(props)),\n [Symbol.dispose]: dispose,\n dispose,\n };\n}\n"]}
@@ -1,13 +0,0 @@
1
- import { 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":"AAKA,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAC;AAKlE;;;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,EAAW,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAElE,gEAAgE;AAChE,IAAI,QAAQ,GAAY,WAAW,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAA2B;IACnD,QAAQ,GAAG,MAAM,IAAI,oBAAoB,CAAC,WAAW,CAAC;AACxD,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 { ILogger, NOOP_LOGGER } from \"@itwin/presentation-shared\";\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet g_logger: ILogger = NOOP_LOGGER;\n\n/**\n * Set logger to use by this package. By default the package uses a no-op logger.\n * @public\n */\nexport function setLogger(logger: ILogger | undefined) {\n g_logger = logger ?? /* c8 ignore next */ NOOP_LOGGER;\n}\n\n/**\n * Get logger used by this package.\n * @see `setLogger`\n * @public\n */\nexport function getLogger(): ILogger {\n return g_logger;\n}\n"]}
@@ -1,36 +0,0 @@
1
- import { Observable } from "rxjs";
2
- import { ECClassHierarchyInspector, InstanceKey } from "@itwin/presentation-shared";
3
- import { HierarchyFilteringPath } from "../HierarchyFiltering.js";
4
- import { DefineHierarchyLevelProps, HierarchyLevelDefinition, InstanceNodesQueryDefinition } from "../imodel/IModelHierarchyDefinition.js";
5
- import { RxjsHierarchyDefinition, RxjsNodeParser, RxjsNodePostProcessor, RxjsNodePreProcessor } from "../internal/RxjsHierarchyDefinition.js";
6
- interface FilteringHierarchyDefinitionProps {
7
- imodelAccess: ECClassHierarchyInspector & {
8
- imodelKey: string;
9
- };
10
- source: RxjsHierarchyDefinition;
11
- nodeIdentifierPaths: HierarchyFilteringPath[];
12
- nodesParser?: RxjsNodeParser;
13
- }
14
- /** @internal */
15
- export declare class FilteringHierarchyDefinition implements RxjsHierarchyDefinition {
16
- private _imodelAccess;
17
- private _source;
18
- private _nodeIdentifierPaths;
19
- private _nodesParser;
20
- constructor(props: FilteringHierarchyDefinitionProps);
21
- get preProcessNode(): RxjsNodePreProcessor;
22
- private shouldExpandGroupingNode;
23
- get postProcessNode(): RxjsNodePostProcessor;
24
- get parseNode(): RxjsNodeParser;
25
- defineHierarchyLevel(props: DefineHierarchyLevelProps): Observable<HierarchyLevelDefinition>;
26
- }
27
- /** @internal */
28
- export declare const ECSQL_COLUMN_NAME_FilterECInstanceId = "FilterECInstanceId";
29
- /** @internal */
30
- export declare const ECSQL_COLUMN_NAME_FilterClassName = "FilterClassName";
31
- /** @internal */
32
- export declare function applyECInstanceIdsFilter(def: InstanceNodesQueryDefinition, filteredInstanceKeys: InstanceKey[]): InstanceNodesQueryDefinition;
33
- /** @internal */
34
- export declare function applyECInstanceIdsSelector(def: InstanceNodesQueryDefinition): InstanceNodesQueryDefinition;
35
- export {};
36
- //# sourceMappingURL=FilteringHierarchyDefinition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FilteringHierarchyDefinition.d.ts","sourceRoot":"","sources":["../../../../src/hierarchies/imodel/FilteringHierarchyDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuD,UAAU,EAAe,MAAM,MAAM,CAAC;AAEpG,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAkC,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlG,OAAO,EACL,yBAAyB,EAEzB,wBAAwB,EAExB,4BAA4B,EAC7B,MAAM,wCAAwC,CAAC;AAKhD,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9I,UAAU,iCAAiC;IACzC,YAAY,EAAE,yBAAyB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,MAAM,EAAE,uBAAuB,CAAC;IAChC,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;IAC9C,WAAW,CAAC,EAAE,cAAc,CAAC;CAC9B;AAED,gBAAgB;AAChB,qBAAa,4BAA6B,YAAW,uBAAuB;IAC1E,OAAO,CAAC,aAAa,CAAoD;IACzE,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,oBAAoB,CAA2B;IACvD,OAAO,CAAC,YAAY,CAAiB;gBAElB,KAAK,EAAE,iCAAiC;IAO3D,IAAW,cAAc,IA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