@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,55 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createClassGroups = createClassGroups;
8
- const presentation_shared_1 = require("@itwin/presentation-shared");
9
- const HierarchyNode_js_1 = require("../../../HierarchyNode.js");
10
- /** @internal */
11
- async function createClassGroups(schemaProvider, parentNode, nodes) {
12
- const parentNodeClass = parentNode && HierarchyNode_js_1.HierarchyNode.isClassGroupingNode(parentNode) ? parentNode.key.className : undefined;
13
- const groupings = { ungrouped: [], grouped: new Map() };
14
- const releaseMainThread = (0, presentation_shared_1.createMainThreadReleaseOnTimePassedHandler)();
15
- for (const node of nodes) {
16
- await releaseMainThread();
17
- const nodeClassName = node.key.instanceKeys[0].className;
18
- if (node.processingParams?.grouping?.byClass && nodeClassName !== parentNodeClass) {
19
- let groupingInfo = groupings.grouped.get(nodeClassName);
20
- if (!groupingInfo) {
21
- const nodeClass = await (0, presentation_shared_1.getClass)(schemaProvider, nodeClassName);
22
- groupingInfo = {
23
- class: nodeClass,
24
- groupedNodes: [],
25
- };
26
- groupings.grouped.set(nodeClassName, groupingInfo);
27
- }
28
- groupingInfo.groupedNodes.push(node);
29
- continue;
30
- }
31
- groupings.ungrouped.push(node);
32
- }
33
- return createGroupingNodes(groupings);
34
- }
35
- async function createGroupingNodes(groupings) {
36
- const groupedNodes = new Array();
37
- const releaseMainThread = (0, presentation_shared_1.createMainThreadReleaseOnTimePassedHandler)();
38
- for (const [, entry] of groupings.grouped) {
39
- await releaseMainThread();
40
- const groupingNodeKey = {
41
- type: "class-grouping",
42
- className: entry.class.fullName,
43
- };
44
- const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;
45
- groupedNodes.push({
46
- label: entry.class.label ?? entry.class.name,
47
- key: groupingNodeKey,
48
- parentKeys: groupedNodeParentKeys,
49
- groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),
50
- children: entry.groupedNodes.map((gn) => Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] })),
51
- });
52
- }
53
- return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: "class" };
54
- }
55
- //# sourceMappingURL=ClassGrouping.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClassGrouping.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/ClassGrouping.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAoBhG,8CA2BC;AA7CD,oEAAoH;AACpH,gEAA+E;AAgB/E,gBAAgB;AACT,KAAK,UAAU,iBAAiB,CACrC,cAAgC,EAChC,UAA2C,EAC3C,KAAuC;IAEvC,MAAM,eAAe,GAAG,UAAU,IAAI,gCAAa,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3H,MAAM,SAA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MAAM,eAAe,GAAyB;YAC5C,IAAI,EAAE,gBAAgB;YACtB,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ;SAChC,CAAC;QACF,MAAM,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAC/D,YAAY,CAAC,IAAI,CAAC;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI;YAC5C,GAAG,EAAE,eAAe;YACpB,UAAU,EAAE,qBAAqB;YACjC,mBAAmB,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,mBAAmB,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC;YAC9G,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,qBAAqB,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;SACzH,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAC1F,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 { createMainThreadReleaseOnTimePassedHandler, ECSchemaProvider, getClass } from \"@itwin/presentation-shared\";\nimport { HierarchyNode, ParentHierarchyNode } from \"../../../HierarchyNode.js\";\nimport { ClassGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport { ProcessedInstanceHierarchyNode } from \"../../IModelHierarchyNode.js\";\nimport { GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\ninterface ClassInfo {\n fullName: string;\n name: string;\n label?: string;\n}\n\ninterface ClassGroupingInformation {\n ungrouped: ProcessedInstanceHierarchyNode[];\n grouped: Map<string, { class: ClassInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }>;\n}\n\n/** @internal */\nexport async function createClassGroups(\n schemaProvider: ECSchemaProvider,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n): Promise<GroupingHandlerResult> {\n const parentNodeClass = parentNode && HierarchyNode.isClassGroupingNode(parentNode) ? parentNode.key.className : undefined;\n const groupings: ClassGroupingInformation = { ungrouped: [], grouped: new Map() };\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n for (const node of nodes) {\n await releaseMainThread();\n const nodeClassName = node.key.instanceKeys[0].className;\n if (node.processingParams?.grouping?.byClass && nodeClassName !== parentNodeClass) {\n let groupingInfo = groupings.grouped.get(nodeClassName);\n if (!groupingInfo) {\n const nodeClass = await getClass(schemaProvider, nodeClassName);\n groupingInfo = {\n class: nodeClass,\n groupedNodes: [],\n };\n groupings.grouped.set(nodeClassName, groupingInfo);\n }\n groupingInfo.groupedNodes.push(node);\n continue;\n }\n groupings.ungrouped.push(node);\n }\n return createGroupingNodes(groupings);\n}\n\nasync function createGroupingNodes(groupings: ClassGroupingInformation): Promise<GroupingHandlerResult> {\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n for (const [, entry] of groupings.grouped) {\n await releaseMainThread();\n const groupingNodeKey: ClassGroupingNodeKey = {\n type: \"class-grouping\",\n className: entry.class.fullName,\n };\n const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;\n groupedNodes.push({\n label: entry.class.label ?? entry.class.name,\n key: groupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.groupedNodes.map((gn) => Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] })),\n });\n }\n return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: \"class\" };\n}\n"]}
@@ -1,4 +0,0 @@
1
- import { GroupingHandlerResult } from "../Grouping.js";
2
- /** @internal */
3
- export declare function applyGroupHidingParams(props: GroupingHandlerResult, extraSiblings: number): GroupingHandlerResult;
4
- //# sourceMappingURL=GroupHiding.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupHiding.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/GroupHiding.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAyD,MAAM,gBAAgB,CAAC;AAG9G,gBAAgB;AAChB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,GAAG,qBAAqB,CA+BjH"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.applyGroupHidingParams = applyGroupHidingParams;
8
- const Shared_js_1 = require("./Shared.js");
9
- /** @internal */
10
- function applyGroupHidingParams(props, extraSiblings) {
11
- const { grouped, ungrouped, groupingType } = props;
12
- if (grouped.length === 0) {
13
- return props;
14
- }
15
- // handle the "no siblings" case
16
- if (grouped.length === 1 && ungrouped.length === 0 && extraSiblings === 0) {
17
- const hideParams = getHideOptionsFromNodeProcessingParams(grouped[0], groupingType);
18
- if (hideParams.hideIfNoSiblings) {
19
- return { groupingType, grouped: [], ungrouped: grouped[0].children };
20
- }
21
- }
22
- // handle the "no children" case
23
- const filteredGrouped = new Array();
24
- for (const node of grouped) {
25
- if (node.children.length === 1) {
26
- const hideParams = getHideOptionsFromNodeProcessingParams(node, groupingType);
27
- if (hideParams.hideIfOneGroupedNode) {
28
- ungrouped.push(node.children[0]);
29
- continue;
30
- }
31
- }
32
- filteredGrouped.push(node);
33
- }
34
- return {
35
- groupingType,
36
- grouped: filteredGrouped,
37
- ungrouped,
38
- };
39
- }
40
- function getHideOptionsFromNodeProcessingParams(groupingNode, groupingType) {
41
- let hideIfNoSiblings = false;
42
- let hideIfOneGroupedNode = false;
43
- (0, Shared_js_1.iterateChildNodeGroupingParams)(groupingNode, groupingType, (groupingProps) => {
44
- if (hideIfNoSiblings && hideIfOneGroupedNode) {
45
- return true;
46
- }
47
- hideIfNoSiblings ||= !!groupingProps?.hideIfNoSiblings;
48
- hideIfOneGroupedNode ||= !!groupingProps?.hideIfOneGroupedNode;
49
- return;
50
- });
51
- return { hideIfNoSiblings, hideIfOneGroupedNode };
52
- }
53
- //# sourceMappingURL=GroupHiding.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupHiding.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/GroupHiding.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAMhG,wDA+BC;AAlCD,2CAA6D;AAE7D,gBAAgB;AAChB,SAAgB,sBAAsB,CAAC,KAA4B,EAAE,aAAqB;IACxF,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gCAAgC;IAChC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;QAC1E,MAAM,UAAU,GAAG,sCAAsC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QACpF,IAAI,UAAU,CAAC,gBAAgB,EAAE,CAAC;YAChC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACvE,CAAC;IACH,CAAC;IAED,gCAAgC;IAChC,MAAM,eAAe,GAAG,IAAI,KAAK,EAA2C,CAAC;IAC7E,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,UAAU,GAAG,sCAAsC,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAC9E,IAAI,UAAU,CAAC,oBAAoB,EAAE,CAAC;gBACpC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,SAAS;YACX,CAAC;QACH,CAAC;QACD,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO;QACL,YAAY;QACZ,OAAO,EAAE,eAAe;QACxB,SAAS;KACV,CAAC;AACJ,CAAC;AAED,SAAS,sCAAsC,CAC7C,YAAqD,EACrD,YAA0B;IAE1B,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,oBAAoB,GAAG,KAAK,CAAC;IACjC,IAAA,0CAA8B,EAAC,YAAY,EAAE,YAAY,EAAE,CAAC,aAAa,EAAE,EAAE;QAC3E,IAAI,gBAAgB,IAAI,oBAAoB,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,gBAAgB,KAAK,CAAC,CAAC,aAAa,EAAE,gBAAgB,CAAC;QACvD,oBAAoB,KAAK,CAAC,CAAC,aAAa,EAAE,oBAAoB,CAAC;QAC/D,OAAO;IACT,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;AACpD,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 { GroupingHandlerResult, GroupingType, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\nimport { iterateChildNodeGroupingParams } from \"./Shared.js\";\n\n/** @internal */\nexport function applyGroupHidingParams(props: GroupingHandlerResult, extraSiblings: number): GroupingHandlerResult {\n const { grouped, ungrouped, groupingType } = props;\n if (grouped.length === 0) {\n return props;\n }\n\n // handle the \"no siblings\" case\n if (grouped.length === 1 && ungrouped.length === 0 && extraSiblings === 0) {\n const hideParams = getHideOptionsFromNodeProcessingParams(grouped[0], groupingType);\n if (hideParams.hideIfNoSiblings) {\n return { groupingType, grouped: [], ungrouped: grouped[0].children };\n }\n }\n\n // handle the \"no children\" case\n const filteredGrouped = new Array<ProcessedInstancesGroupingHierarchyNode>();\n for (const node of grouped) {\n if (node.children.length === 1) {\n const hideParams = getHideOptionsFromNodeProcessingParams(node, groupingType);\n if (hideParams.hideIfOneGroupedNode) {\n ungrouped.push(node.children[0]);\n continue;\n }\n }\n filteredGrouped.push(node);\n }\n return {\n groupingType,\n grouped: filteredGrouped,\n ungrouped,\n };\n}\n\nfunction getHideOptionsFromNodeProcessingParams(\n groupingNode: ProcessedInstancesGroupingHierarchyNode,\n groupingType: GroupingType,\n): { hideIfNoSiblings: boolean; hideIfOneGroupedNode: boolean } {\n let hideIfNoSiblings = false;\n let hideIfOneGroupedNode = false;\n iterateChildNodeGroupingParams(groupingNode, groupingType, (groupingProps) => {\n if (hideIfNoSiblings && hideIfOneGroupedNode) {\n return true;\n }\n hideIfNoSiblings ||= !!groupingProps?.hideIfNoSiblings;\n hideIfOneGroupedNode ||= !!groupingProps?.hideIfOneGroupedNode;\n return;\n });\n return { hideIfNoSiblings, hideIfOneGroupedNode };\n}\n"]}
@@ -1,5 +0,0 @@
1
- import { ProcessedInstanceHierarchyNode } from "../../IModelHierarchyNode.js";
2
- import { GroupingHandlerResult } from "../Grouping.js";
3
- /** @internal */
4
- export declare function createLabelGroups(nodes: ProcessedInstanceHierarchyNode[]): Promise<GroupingHandlerResult>;
5
- //# sourceMappingURL=LabelGrouping.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LabelGrouping.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/LabelGrouping.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,qBAAqB,EAA2C,MAAM,gBAAgB,CAAC;AAEhG,gBAAgB;AAChB,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,8BAA8B,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAoD/G"}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createLabelGroups = createLabelGroups;
8
- const Utils_js_1 = require("../../Utils.js");
9
- /** @internal */
10
- async function createLabelGroups(nodes) {
11
- const ungrouped = new Array();
12
- const nodesToMergeMap = new Map();
13
- const nodesToGroupMap = new Map();
14
- for (const node of nodes) {
15
- const byLabel = node.processingParams?.grouping?.byLabel;
16
- if (!byLabel) {
17
- ungrouped.push(node);
18
- continue;
19
- }
20
- const nodeMapKeyIdentifier = `label:"${node.label}";groupId:${JSON.stringify(typeof byLabel === "object" ? byLabel.groupId : undefined)}`;
21
- const map = typeof byLabel === "object" && byLabel.action === "merge" ? nodesToMergeMap : nodesToGroupMap;
22
- let list = map.get(nodeMapKeyIdentifier);
23
- if (!list) {
24
- list = [];
25
- map.set(nodeMapKeyIdentifier, list);
26
- }
27
- list.push(node);
28
- }
29
- nodesToMergeMap.forEach((entry) => {
30
- let finalNode = entry[0];
31
- for (let i = 1; i < entry.length; ++i) {
32
- finalNode = (0, Utils_js_1.mergeInstanceNodes)(finalNode, entry[i]);
33
- }
34
- ungrouped.push(finalNode);
35
- });
36
- const groupedNodes = new Array();
37
- nodesToGroupMap.forEach((entry) => {
38
- const byLabel = entry[0].processingParams?.grouping?.byLabel;
39
- const groupId = typeof byLabel === "object" ? byLabel.groupId : undefined;
40
- const groupingNodeKey = {
41
- type: "label-grouping",
42
- label: entry[0].label,
43
- groupId,
44
- };
45
- const groupedNodeParentKeys = entry[0].parentKeys;
46
- groupedNodes.push({
47
- label: entry[0].label,
48
- key: groupingNodeKey,
49
- parentKeys: groupedNodeParentKeys,
50
- groupedInstanceKeys: entry.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),
51
- children: entry.map((gn) => Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] })),
52
- });
53
- });
54
- return {
55
- groupingType: "label",
56
- grouped: groupedNodes,
57
- ungrouped,
58
- };
59
- }
60
- //# sourceMappingURL=LabelGrouping.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LabelGrouping.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/LabelGrouping.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAQhG,8CAoDC;AAxDD,6CAAoD;AAGpD,gBAAgB;AACT,KAAK,UAAU,iBAAiB,CAAC,KAAuC;IAC7E,MAAM,SAAS,GAAG,IAAI,KAAK,EAAkC,CAAC;IAC9D,MAAM,eAAe,GAAG,IAAI,GAAG,EAA4C,CAAC;IAC5E,MAAM,eAAe,GAAG,IAAI,GAAG,EAA4C,CAAC;IAC5E,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC;QACzD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QACD,MAAM,oBAAoB,GAAG,UAAU,I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AC,CAAC,SAAS,CAAC;QAC1E,MAAM,eAAe,GAAyB;YAC5C,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;YACrB,OAAO;SACR,CAAC;QACF,MAAM,qBAAqB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAClD,YAAY,CAAC,IAAI,CAAC;YAChB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;YACrB,GAAG,EAAE,eAAe;YACpB,UAAU,EAAE,qBAAqB;YACjC,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,mBAAmB,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC;YACjG,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,qBAAqB,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;SAC5G,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,YAAY,EAAE,OAAO;QACrB,OAAO,EAAE,YAAY;QACrB,SAAS;KACV,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 { LabelGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport { ProcessedInstanceHierarchyNode } from \"../../IModelHierarchyNode.js\";\nimport { mergeInstanceNodes } from \"../../Utils.js\";\nimport { GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\n/** @internal */\nexport async function createLabelGroups(nodes: ProcessedInstanceHierarchyNode[]): Promise<GroupingHandlerResult> {\n const ungrouped = new Array<ProcessedInstanceHierarchyNode>();\n const nodesToMergeMap = new Map<string, ProcessedInstanceHierarchyNode[]>();\n const nodesToGroupMap = new Map<string, ProcessedInstanceHierarchyNode[]>();\n for (const node of nodes) {\n const byLabel = node.processingParams?.grouping?.byLabel;\n if (!byLabel) {\n ungrouped.push(node);\n continue;\n }\n const nodeMapKeyIdentifier = `label:\"${node.label}\";groupId:${JSON.stringify(typeof byLabel === \"object\" ? byLabel.groupId : undefined)}`;\n const map = typeof byLabel === \"object\" && byLabel.action === \"merge\" ? nodesToMergeMap : nodesToGroupMap;\n let list = map.get(nodeMapKeyIdentifier);\n if (!list) {\n list = [];\n map.set(nodeMapKeyIdentifier, list);\n }\n list.push(node);\n }\n\n nodesToMergeMap.forEach((entry) => {\n let finalNode = entry[0];\n for (let i = 1; i < entry.length; ++i) {\n finalNode = mergeInstanceNodes(finalNode, entry[i]);\n }\n ungrouped.push(finalNode);\n });\n\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n nodesToGroupMap.forEach((entry) => {\n const byLabel = entry[0].processingParams?.grouping?.byLabel;\n const groupId = typeof byLabel === \"object\" ? byLabel.groupId : undefined;\n const groupingNodeKey: LabelGroupingNodeKey = {\n type: \"label-grouping\",\n label: entry[0].label,\n groupId,\n };\n const groupedNodeParentKeys = entry[0].parentKeys;\n groupedNodes.push({\n label: entry[0].label,\n key: groupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.map((gn) => Object.assign(gn, { parentKeys: [...groupedNodeParentKeys, groupingNodeKey] })),\n });\n });\n\n return {\n groupingType: \"label\",\n grouped: groupedNodes,\n ungrouped,\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertiesGrouping.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/PropertiesGrouping.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,EAAE,EACF,yBAAyB,EACzB,gBAAgB,EAGhB,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,CACvC,8BAA8B,EAAE,8BAA8B,EAC9D,eAAe,EAAE,qCAAqC,GACrD,OAAO,CAUT;AAED,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,OAAO,EAAE,+BAA+B,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,+BAA+B,EAAE,GAAG,SAAS,GAAG,OAAO,CAwBrJ;AAED,gBAAgB;AAChB,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,gBAAgB,GAAG,yBAAyB,EAC1D,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAC3C,KAAK,EAAE,8BAA8B,EAAE,EACvC,cAAc,EAAE,wBAAwB,EACxC,gBAAgB,EAAE,kCAAkC,GACnD,OAAO,CAAC,eAAe,EAAE,CAAC,CAM5B"}
@@ -1,309 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createPropertyGroups = createPropertyGroups;
8
- exports.getUniquePropertiesGroupInfo = getUniquePropertiesGroupInfo;
9
- exports.doPreviousPropertiesMatch = doPreviousPropertiesMatch;
10
- exports.doRangesMatch = doRangesMatch;
11
- exports.createPropertiesGroupingHandlers = createPropertiesGroupingHandlers;
12
- const core_bentley_1 = require("@itwin/core-bentley");
13
- const presentation_shared_1 = require("@itwin/presentation-shared");
14
- const HierarchyNode_js_1 = require("../../../HierarchyNode.js");
15
- const HierarchyNodeKey_js_1 = require("../../../HierarchyNodeKey.js");
16
- /** @internal */
17
- async function createPropertyGroups(nodesToGroup, nodesAlreadyGrouped, handlerGroupingParams, valueFormatter, localizedStrings, classHierarchyInspector) {
18
- let otherValuesGrouping;
19
- const getOtherValuesGroupingNode = () => {
20
- if (!otherValuesGrouping) {
21
- const node = nodesAlreadyGrouped.find((n) => HierarchyNodeKey_js_1.HierarchyNodeKey.isPropertyOtherValuesGrouping(n.key));
22
- if (node) {
23
- otherValuesGrouping = { node, new: false };
24
- }
25
- }
26
- otherValuesGrouping ??= {
27
- node: {
28
- key: {
29
- type: "property-grouping:other",
30
- properties: [],
31
- },
32
- parentKeys: [],
33
- groupedInstanceKeys: [],
34
- label: localizedStrings.other,
35
- children: [],
36
- },
37
- new: true,
38
- };
39
- return otherValuesGrouping.node;
40
- };
41
- const releaseMainThread = (0, presentation_shared_1.createMainThreadReleaseOnTimePassedHandler)();
42
- const groupings = { ungrouped: [], grouped: new Map() };
43
- for (const node of nodesToGroup) {
44
- await releaseMainThread();
45
- const byProperties = node.processingParams?.grouping?.byProperties;
46
- if (!byProperties) {
47
- groupings.ungrouped.push(node);
48
- continue;
49
- }
50
- if (!(await shouldCreatePropertyGroup(handlerGroupingParams, byProperties, node.key.instanceKeys[0].className, classHierarchyInspector))) {
51
- groupings.ungrouped.push(node);
52
- continue;
53
- }
54
- const currentProperty = byProperties.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];
55
- const propertyIdentifier = {
56
- propertyName: currentProperty.propertyName,
57
- propertyClassName: byProperties.propertiesClassName,
58
- };
59
- const propertyClass = handlerGroupingParams.ecClass;
60
- const property = await propertyClass.getProperty(currentProperty.propertyName);
61
- if (!property?.isNavigation() && (!property?.isPrimitive() || property.primitiveType === "Binary" || property.primitiveType === "IGeometry")) {
62
- groupings.ungrouped.push(node);
63
- continue;
64
- }
65
- const extendedTypeName = "extendedTypeName" in property ? property.extendedTypeName : undefined;
66
- const primitiveType = "primitiveType" in property ? property.primitiveType : "String";
67
- (0, core_bentley_1.assert)(primitiveType !== "Binary" && primitiveType !== "IGeometry");
68
- if (!currentProperty.propertyValue) {
69
- if (byProperties.createGroupForUnspecifiedValues) {
70
- addGroupingToMap(groupings.grouped, `${currentProperty.propertyName}:Unspecified`, {
71
- label: localizedStrings.unspecified,
72
- propertyGroupingNodeKey: {
73
- type: "property-grouping:value",
74
- ...propertyIdentifier,
75
- formattedPropertyValue: "",
76
- },
77
- }, node);
78
- continue;
79
- }
80
- groupings.ungrouped.push(node);
81
- continue;
82
- }
83
- const koqName = (await property.kindOfQuantity)?.fullName;
84
- if (currentProperty.ranges) {
85
- if (typeof currentProperty.propertyValue === "number") {
86
- const propValue = currentProperty.propertyValue;
87
- const matchingRange = currentProperty.ranges.find((range) => propValue >= range.fromValue && propValue <= range.toValue);
88
- if (matchingRange) {
89
- const fromValueTypedPrimitive = {
90
- type: Number.isInteger(matchingRange.fromValue) ? "Integer" : "Double",
91
- extendedType: extendedTypeName,
92
- koqName,
93
- value: matchingRange.fromValue,
94
- };
95
- const toValueTypedPrimitive = {
96
- type: Number.isInteger(matchingRange.toValue) ? "Integer" : "Double",
97
- extendedType: extendedTypeName,
98
- koqName,
99
- value: matchingRange.toValue,
100
- };
101
- const rangeLabel = matchingRange.rangeLabel ?? `${await valueFormatter(fromValueTypedPrimitive)} - ${await valueFormatter(toValueTypedPrimitive)}`;
102
- addGroupingToMap(groupings.grouped, `${currentProperty.propertyName}:[${matchingRange.fromValue}-${matchingRange.toValue}]${matchingRange.rangeLabel ? `(${matchingRange.rangeLabel})` : ""}`, {
103
- label: rangeLabel,
104
- propertyGroupingNodeKey: {
105
- ...propertyIdentifier,
106
- type: "property-grouping:range",
107
- fromValue: matchingRange.fromValue,
108
- toValue: matchingRange.toValue,
109
- },
110
- }, node);
111
- continue;
112
- }
113
- }
114
- if (byProperties.createGroupForOutOfRangeValues) {
115
- const groupingNode = getOtherValuesGroupingNode();
116
- (0, core_bentley_1.assert)(HierarchyNodeKey_js_1.HierarchyNodeKey.isPropertyOtherValuesGrouping(groupingNode.key));
117
- const thisPropertyIdentifier = {
118
- className: propertyIdentifier.propertyClassName,
119
- propertyName: propertyIdentifier.propertyName,
120
- };
121
- const hasPropertyIdentifier = groupingNode.key.properties.find((x) => x.className === thisPropertyIdentifier.className && x.propertyName === thisPropertyIdentifier.propertyName);
122
- if (!hasPropertyIdentifier) {
123
- groupingNode.key.properties.push(thisPropertyIdentifier);
124
- }
125
- node.key.instanceKeys.forEach((k) => groupingNode.groupedInstanceKeys.push(k));
126
- groupingNode.parentKeys = node.parentKeys;
127
- groupingNode.children.push(Object.assign(node, { parentKeys: [...node.parentKeys, groupingNode.key] }));
128
- continue;
129
- }
130
- groupings.ungrouped.push(node);
131
- continue;
132
- }
133
- const formattedValue = currentProperty.propertyValue instanceof Array
134
- ? await (0, presentation_shared_1.formatConcatenatedValue)({ value: currentProperty.propertyValue, valueFormatter })
135
- : await valueFormatter(presentation_shared_1.TypedPrimitiveValue.create(currentProperty.propertyValue, primitiveType, koqName, extendedTypeName));
136
- addGroupingToMap(groupings.grouped, `${currentProperty.propertyName}:${formattedValue}`, {
137
- label: formattedValue,
138
- propertyGroupingNodeKey: {
139
- ...propertyIdentifier,
140
- type: "property-grouping:value",
141
- formattedPropertyValue: formattedValue,
142
- },
143
- }, node);
144
- }
145
- return createGroupingNodes(groupings, otherValuesGrouping?.new ? otherValuesGrouping.node : undefined);
146
- }
147
- function addGroupingToMap(groupingMap, mapKey, propertyToAdd, node) {
148
- let groupingInfo = groupingMap.get(mapKey);
149
- if (!groupingInfo) {
150
- groupingInfo = {
151
- displayablePropertyGroupingInfo: propertyToAdd,
152
- groupedNodes: [node],
153
- };
154
- groupingMap.set(mapKey, groupingInfo);
155
- return;
156
- }
157
- groupingInfo.groupedNodes.push(node);
158
- }
159
- function createGroupingNodes(groupings, otherValuesGroupingNode) {
160
- const groupedNodes = new Array();
161
- groupings.grouped.forEach((entry) => {
162
- const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;
163
- groupedNodes.push({
164
- label: entry.displayablePropertyGroupingInfo.label,
165
- key: entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey,
166
- parentKeys: groupedNodeParentKeys,
167
- groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),
168
- children: entry.groupedNodes.map((gn) => ({
169
- ...gn,
170
- parentKeys: [...groupedNodeParentKeys, entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey],
171
- })),
172
- });
173
- });
174
- if (otherValuesGroupingNode) {
175
- groupedNodes.push(otherValuesGroupingNode);
176
- }
177
- return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: "property" };
178
- }
179
- function createNodePropertyGroupPathMatchers(node) {
180
- if (!HierarchyNode_js_1.HierarchyNode.isPropertyGroupingNode(node)) {
181
- return [];
182
- }
183
- const keys = [...node.parentKeys, node.key];
184
- const propertyGroupingNodeKeys = [];
185
- for (let i = keys.length - 1; i >= 0; --i) {
186
- const key = keys[i];
187
- if (HierarchyNodeKey_js_1.HierarchyNodeKey.isPropertyGrouping(key)) {
188
- propertyGroupingNodeKeys.push(key);
189
- }
190
- else {
191
- break;
192
- }
193
- }
194
- propertyGroupingNodeKeys.reverse();
195
- return propertyGroupingNodeKeys.map((key) => {
196
- switch (key.type) {
197
- case "property-grouping:other":
198
- return (x) => key.properties.some((p) => p.className === x.propertiesClassName && p.propertyName === x.propertyName && !!x.isRange);
199
- case "property-grouping:range":
200
- return (x) => key.propertyClassName === x.propertiesClassName && key.propertyName === x.propertyName;
201
- case "property-grouping:value":
202
- return (x) => key.propertyClassName === x.propertiesClassName && key.propertyName === x.propertyName;
203
- }
204
- });
205
- }
206
- /** @internal */
207
- async function getUniquePropertiesGroupInfo(schemaProvider, parentNode, nodes) {
208
- const releaseMainThread = (0, presentation_shared_1.createMainThreadReleaseOnTimePassedHandler)();
209
- const parentPropertyGroupPath = parentNode ? createNodePropertyGroupPathMatchers(parentNode) : [];
210
- const uniqueProperties = new Map();
211
- for (const node of nodes) {
212
- await releaseMainThread();
213
- const byProperties = node.processingParams?.grouping?.byProperties;
214
- if (!byProperties) {
215
- continue;
216
- }
217
- let propertyGroupIndex = 0;
218
- const previousPropertiesInfo = new Array();
219
- for (const propertyGroup of byProperties.propertyGroups) {
220
- const mapKeyRanges = getRangesAsString(propertyGroup.ranges);
221
- const lastKey = previousPropertiesInfo.length > 0 ? previousPropertiesInfo[previousPropertiesInfo.length - 1].propertyGroupKey : "";
222
- const propertyGroupKey = `${lastKey}:${propertyGroup.propertyName}(${mapKeyRanges})`;
223
- const mapKey = `${byProperties.propertiesClassName}:${propertyGroupKey}`;
224
- let isAlreadyGrouped = false;
225
- if (!isAlreadyGrouped && parentPropertyGroupPath.length > 0 && propertyGroupIndex < parentPropertyGroupPath.length) {
226
- const groupMatcher = parentPropertyGroupPath[propertyGroupIndex];
227
- isAlreadyGrouped = groupMatcher({
228
- propertiesClassName: byProperties.propertiesClassName,
229
- propertyName: propertyGroup.propertyName,
230
- isRange: !!propertyGroup.ranges,
231
- });
232
- }
233
- if (!isAlreadyGrouped && !uniqueProperties.get(mapKey)) {
234
- uniqueProperties.set(mapKey, {
235
- ecClass: await (0, presentation_shared_1.getClass)(schemaProvider, byProperties.propertiesClassName),
236
- propertyGroup: {
237
- propertyName: propertyGroup.propertyName,
238
- ranges: propertyGroup.ranges,
239
- },
240
- previousPropertiesGroupingInfo: previousPropertiesInfo.map((groupingInfo) => ({
241
- propertiesClassName: byProperties.propertiesClassName,
242
- propertyName: groupingInfo.propertyGroup.propertyName,
243
- isRange: !!groupingInfo.propertyGroup.ranges,
244
- })),
245
- });
246
- }
247
- previousPropertiesInfo.push({
248
- propertyGroup,
249
- propertyGroupKey,
250
- });
251
- ++propertyGroupIndex;
252
- }
253
- }
254
- // Order might change in uniqueProperties, resorting to make sure that properties with fewer previous properties are returned first.
255
- return [...uniqueProperties.values()].sort((lhs, rhs) => lhs.previousPropertiesGroupingInfo.length - rhs.previousPropertiesGroupingInfo.length);
256
- }
257
- function getRangesAsString(ranges) {
258
- return ranges
259
- ? ranges
260
- .map((range) => `${range.fromValue}-${range.toValue}(${range.rangeLabel ?? ""})`)
261
- .sort()
262
- .join(";")
263
- : "";
264
- }
265
- async function shouldCreatePropertyGroup(handlerGroupingParams, nodePropertyGroupingParams, nodeFullClassName, classHierarchyInspector) {
266
- if (nodePropertyGroupingParams.propertiesClassName !== handlerGroupingParams.ecClass.fullName ||
267
- nodePropertyGroupingParams.propertyGroups.length < handlerGroupingParams.previousPropertiesGroupingInfo.length + 1) {
268
- return false;
269
- }
270
- const currentProperty = nodePropertyGroupingParams.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];
271
- if (currentProperty.propertyName !== handlerGroupingParams.propertyGroup.propertyName ||
272
- !doRangesMatch(currentProperty.ranges, handlerGroupingParams.propertyGroup.ranges)) {
273
- return false;
274
- }
275
- if (!doPreviousPropertiesMatch(handlerGroupingParams.previousPropertiesGroupingInfo, nodePropertyGroupingParams)) {
276
- return false;
277
- }
278
- return classHierarchyInspector.classDerivesFrom(nodeFullClassName, handlerGroupingParams.ecClass.fullName);
279
- }
280
- /** @internal */
281
- function doPreviousPropertiesMatch(previousPropertiesGroupingInfo, nodesProperties) {
282
- return (previousPropertiesGroupingInfo.length <= nodesProperties.propertyGroups.length &&
283
- previousPropertiesGroupingInfo.every((groupingInfo, index) => groupingInfo.propertiesClassName === nodesProperties.propertiesClassName &&
284
- groupingInfo.propertyName === nodesProperties.propertyGroups[index].propertyName &&
285
- !!groupingInfo.isRange === !!nodesProperties.propertyGroups[index].ranges));
286
- }
287
- /** @internal */
288
- function doRangesMatch(ranges1, ranges2) {
289
- if (typeof ranges1 !== typeof ranges2) {
290
- return false;
291
- }
292
- if (!ranges1) {
293
- return true;
294
- }
295
- (0, core_bentley_1.assert)(Array.isArray(ranges2));
296
- if (ranges1.length !== ranges2.length) {
297
- return false;
298
- }
299
- return (
300
- // Check twice, to validate if both ranges have the same elements (elements can be in a different order)
301
- ranges1.every((lhsRange) => ranges2.some((rhsRange) => lhsRange.fromValue === rhsRange.fromValue && lhsRange.toValue === rhsRange.toValue && lhsRange.rangeLabel === rhsRange.rangeLabel)) &&
302
- ranges2.every((lhsRange) => ranges1.some((rhsRange) => lhsRange.fromValue === rhsRange.fromValue && lhsRange.toValue === rhsRange.toValue && lhsRange.rangeLabel === rhsRange.rangeLabel)));
303
- }
304
- /** @internal */
305
- async function createPropertiesGroupingHandlers(imodelAccess, parentNode, nodes, valueFormatter, localizedStrings) {
306
- const propertiesGroupInfo = await getUniquePropertiesGroupInfo(imodelAccess, parentNode, nodes);
307
- return propertiesGroupInfo.map((propertyInfo) => async (nodesToGroup, nodesAlreadyGrouped) => createPropertyGroups(nodesToGroup, nodesAlreadyGrouped, propertyInfo, valueFormatter, localizedStrings, imodelAccess));
308
- }
309
- //# sourceMappingURL=PropertiesGrouping.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertiesGrouping.js","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/PropertiesGrouping.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAmDhG,oDAqKC;AA0ED,oEAyDC;AAqCD,8DAaC;AAGD,sCAwBC;AAGD,4EAYC;AArbD,sDAA6C;AAC7C,oEAUoC;AACpC,gEAA+E;AAC/E,sEAAyF;AAmCzF,gBAAgB;AACT,KAAK,UAAU,oBAAoB,CACxC,YAA8C,EAC9C,mBAA8D,EAC9D,qBAAwC,EACxC,cAAwC,EACxC,gBAAoD,EACpD,uBAAkD;IAElD,IAAI,mBAAgG,CAAC;IACrG,MAAM,0BAA0B,GAAG,GAAG,EAAE;QACtC,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,sCAAgB,CAAC,6BAA6B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACpG,IAAI,IAAI,EAAE,CAAC;gBACT,mBAAmB,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;YAC7C,CAAC;QACH,CAAC;QACD,mBAAmB,KAAK;YACtB,IAAI,EAAE;gBACJ,GAAG,EAAE;oBACH,IAAI,EAAE,yBAAkC;oBACxC,UAAU,EAAE,EAAE;iBACf;gBACD,UAAU,EAAE,EAAE;g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EACvC,cAAwC,EACxC,gBAAoD;IAEpD,MAAM,mBAAmB,GAAG,MAAM,4BAA4B,CAAC,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAChG,OAAO,mBAAmB,CAAC,GAAG,CAC5B,CAAC,YAAY,EAAE,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,CAC5D,oBAAoB,CAAC,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,CAAC,CACxH,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 { assert } from \"@itwin/core-bentley\";\nimport {\n ArrayElement,\n createMainThreadReleaseOnTimePassedHandler,\n EC,\n ECClassHierarchyInspector,\n ECSchemaProvider,\n formatConcatenatedValue,\n getClass,\n IPrimitiveValueFormatter,\n TypedPrimitiveValue,\n} from \"@itwin/presentation-shared\";\nimport { HierarchyNode, ParentHierarchyNode } from \"../../../HierarchyNode.js\";\nimport { HierarchyNodeKey, PropertyGroupingNodeKey } from \"../../../HierarchyNodeKey.js\";\nimport {\n HierarchyNodePropertiesGroupingParams,\n HierarchyNodePropertyGroup,\n HierarchyNodePropertyValueRange,\n ProcessedInstanceHierarchyNode,\n} from \"../../IModelHierarchyNode.js\";\nimport { GroupingHandler, GroupingHandlerResult, ProcessedInstancesGroupingHierarchyNode } from \"../Grouping.js\";\n\ninterface DisplayablePropertyGroupingInfo {\n label: string;\n propertyGroupingNodeKey: PropertyGroupingNodeKey;\n}\n\ninterface PropertyGroupingInformation {\n ungrouped: ProcessedInstanceHierarchyNode[];\n grouped: Map<string, { displayablePropertyGroupingInfo: DisplayablePropertyGroupingInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }>;\n}\n\n/** @internal */\nexport interface PropertiesGroupingLocalizedStrings {\n other: string;\n unspecified: string;\n}\n\n/** @internal */\nexport interface PropertyGroupInfo {\n ecClass: EC.Class;\n previousPropertiesGroupingInfo: PreviousPropertiesGroupingInfo;\n propertyGroup: Omit<HierarchyNodePropertyGroup, \"propertyValue\">;\n}\n\n/** @internal */\nexport type PreviousPropertiesGroupingInfo = Array<{ propertiesClassName: string; propertyName: string; isRange?: boolean }>;\n\n/** @internal */\nexport async function createPropertyGroups(\n nodesToGroup: ProcessedInstanceHierarchyNode[],\n nodesAlreadyGrouped: ProcessedInstancesGroupingHierarchyNode[],\n handlerGroupingParams: PropertyGroupInfo,\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n classHierarchyInspector: ECClassHierarchyInspector,\n): Promise<GroupingHandlerResult> {\n let otherValuesGrouping: { node: ProcessedInstancesGroupingHierarchyNode; new: boolean } | undefined;\n const getOtherValuesGroupingNode = () => {\n if (!otherValuesGrouping) {\n const node = nodesAlreadyGrouped.find((n) => HierarchyNodeKey.isPropertyOtherValuesGrouping(n.key));\n if (node) {\n otherValuesGrouping = { node, new: false };\n }\n }\n otherValuesGrouping ??= {\n node: {\n key: {\n type: \"property-grouping:other\" as const,\n properties: [],\n },\n parentKeys: [],\n groupedInstanceKeys: [],\n label: localizedStrings.other,\n children: [],\n },\n new: true,\n };\n return otherValuesGrouping.node;\n };\n\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const groupings: PropertyGroupingInformation = { ungrouped: [], grouped: new Map() };\n for (const node of nodesToGroup) {\n await releaseMainThread();\n\n const byProperties = node.processingParams?.grouping?.byProperties;\n if (!byProperties) {\n groupings.ungrouped.push(node);\n continue;\n }\n if (!(await shouldCreatePropertyGroup(handlerGroupingParams, byProperties, node.key.instanceKeys[0].className, classHierarchyInspector))) {\n groupings.ungrouped.push(node);\n continue;\n }\n const currentProperty = byProperties.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];\n const propertyIdentifier = {\n propertyName: currentProperty.propertyName,\n propertyClassName: byProperties.propertiesClassName,\n };\n\n const propertyClass = handlerGroupingParams.ecClass;\n const property = await propertyClass.getProperty(currentProperty.propertyName);\n\n if (!property?.isNavigation() && (!property?.isPrimitive() || property.primitiveType === \"Binary\" || property.primitiveType === \"IGeometry\")) {\n groupings.ungrouped.push(node);\n continue;\n }\n\n const extendedTypeName = \"extendedTypeName\" in property ? property.extendedTypeName : undefined;\n const primitiveType = \"primitiveType\" in property ? property.primitiveType : \"String\";\n assert(primitiveType !== \"Binary\" && primitiveType !== \"IGeometry\");\n\n if (!currentProperty.propertyValue) {\n if (byProperties.createGroupForUnspecifiedValues) {\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName}:Unspecified`,\n {\n label: localizedStrings.unspecified,\n propertyGroupingNodeKey: {\n type: \"property-grouping:value\",\n ...propertyIdentifier,\n formattedPropertyValue: \"\",\n },\n },\n node,\n );\n continue;\n }\n groupings.ungrouped.push(node);\n continue;\n }\n\n const koqName = (await property.kindOfQuantity)?.fullName;\n if (currentProperty.ranges) {\n if (typeof currentProperty.propertyValue === \"number\") {\n const propValue = currentProperty.propertyValue;\n const matchingRange = currentProperty.ranges.find((range) => propValue >= range.fromValue && propValue <= range.toValue);\n\n if (matchingRange) {\n const fromValueTypedPrimitive: TypedPrimitiveValue = {\n type: Number.isInteger(matchingRange.fromValue) ? \"Integer\" : \"Double\",\n extendedType: extendedTypeName,\n koqName,\n value: matchingRange.fromValue,\n };\n const toValueTypedPrimitive: TypedPrimitiveValue = {\n type: Number.isInteger(matchingRange.toValue) ? \"Integer\" : \"Double\",\n extendedType: extendedTypeName,\n koqName,\n value: matchingRange.toValue,\n };\n\n const rangeLabel = matchingRange.rangeLabel ?? `${await valueFormatter(fromValueTypedPrimitive)} - ${await valueFormatter(toValueTypedPrimitive)}`;\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName}:[${matchingRange.fromValue}-${matchingRange.toValue}]${matchingRange.rangeLabel ? `(${matchingRange.rangeLabel})` : \"\"}`,\n {\n label: rangeLabel,\n propertyGroupingNodeKey: {\n ...propertyIdentifier,\n type: \"property-grouping:range\",\n fromValue: matchingRange.fromValue,\n toValue: matchingRange.toValue,\n },\n },\n node,\n );\n continue;\n }\n }\n if (byProperties.createGroupForOutOfRangeValues) {\n const groupingNode = getOtherValuesGroupingNode();\n assert(HierarchyNodeKey.isPropertyOtherValuesGrouping(groupingNode.key));\n const thisPropertyIdentifier = {\n className: propertyIdentifier.propertyClassName,\n propertyName: propertyIdentifier.propertyName,\n };\n const hasPropertyIdentifier = groupingNode.key.properties.find(\n (x) => x.className === thisPropertyIdentifier.className && x.propertyName === thisPropertyIdentifier.propertyName,\n );\n if (!hasPropertyIdentifier) {\n groupingNode.key.properties.push(thisPropertyIdentifier);\n }\n node.key.instanceKeys.forEach((k) => groupingNode.groupedInstanceKeys.push(k));\n groupingNode.parentKeys = node.parentKeys;\n groupingNode.children.push(Object.assign(node, { parentKeys: [...node.parentKeys, groupingNode.key] }));\n continue;\n }\n groupings.ungrouped.push(node);\n continue;\n }\n\n const formattedValue =\n currentProperty.propertyValue instanceof Array\n ? await formatConcatenatedValue({ value: currentProperty.propertyValue, valueFormatter })\n : await valueFormatter(TypedPrimitiveValue.create(currentProperty.propertyValue, primitiveType, koqName, extendedTypeName));\n\n addGroupingToMap(\n groupings.grouped,\n `${currentProperty.propertyName}:${formattedValue}`,\n {\n label: formattedValue,\n propertyGroupingNodeKey: {\n ...propertyIdentifier,\n type: \"property-grouping:value\",\n formattedPropertyValue: formattedValue,\n },\n },\n node,\n );\n }\n return createGroupingNodes(groupings, otherValuesGrouping?.new ? otherValuesGrouping.node : undefined);\n}\n\nfunction addGroupingToMap(\n groupingMap: Map<string, { displayablePropertyGroupingInfo: DisplayablePropertyGroupingInfo; groupedNodes: ProcessedInstanceHierarchyNode[] }>,\n mapKey: string,\n propertyToAdd: DisplayablePropertyGroupingInfo,\n node: ProcessedInstanceHierarchyNode,\n): void {\n let groupingInfo = groupingMap.get(mapKey);\n if (!groupingInfo) {\n groupingInfo = {\n displayablePropertyGroupingInfo: propertyToAdd,\n groupedNodes: [node],\n };\n groupingMap.set(mapKey, groupingInfo);\n return;\n }\n groupingInfo.groupedNodes.push(node);\n}\n\nfunction createGroupingNodes(\n groupings: PropertyGroupingInformation,\n otherValuesGroupingNode: ProcessedInstancesGroupingHierarchyNode | undefined,\n): GroupingHandlerResult {\n const groupedNodes = new Array<ProcessedInstancesGroupingHierarchyNode>();\n groupings.grouped.forEach((entry) => {\n const groupedNodeParentKeys = entry.groupedNodes[0].parentKeys;\n groupedNodes.push({\n label: entry.displayablePropertyGroupingInfo.label,\n key: entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey,\n parentKeys: groupedNodeParentKeys,\n groupedInstanceKeys: entry.groupedNodes.flatMap((groupedInstanceNode) => groupedInstanceNode.key.instanceKeys),\n children: entry.groupedNodes.map((gn) => ({\n ...gn,\n parentKeys: [...groupedNodeParentKeys, entry.displayablePropertyGroupingInfo.propertyGroupingNodeKey],\n })),\n });\n });\n if (otherValuesGroupingNode) {\n groupedNodes.push(otherValuesGroupingNode);\n }\n return { grouped: groupedNodes, ungrouped: groupings.ungrouped, groupingType: \"property\" };\n}\n\nfunction createNodePropertyGroupPathMatchers(node: ParentHierarchyNode): Array<(x: ArrayElement<PreviousPropertiesGroupingInfo>) => boolean> {\n if (!HierarchyNode.isPropertyGroupingNode(node)) {\n return [];\n }\n\n const keys = [...node.parentKeys, node.key];\n const propertyGroupingNodeKeys: PropertyGroupingNodeKey[] = [];\n for (let i = keys.length - 1; i >= 0; --i) {\n const key = keys[i];\n if (HierarchyNodeKey.isPropertyGrouping(key)) {\n propertyGroupingNodeKeys.push(key);\n } else {\n break;\n }\n }\n propertyGroupingNodeKeys.reverse();\n\n return propertyGroupingNodeKeys.map((key): ((x: ArrayElement<PreviousPropertiesGroupingInfo>) => boolean) => {\n switch (key.type) {\n case \"property-grouping:other\":\n return (x) => key.properties.some((p) => p.className === x.propertiesClassName && p.propertyName === x.propertyName && !!x.isRange);\n case \"property-grouping:range\":\n return (x) => key.propertyClassName === x.propertiesClassName && key.propertyName === x.propertyName;\n case \"property-grouping:value\":\n return (x) => key.propertyClassName === x.propertiesClassName && key.propertyName === x.propertyName;\n }\n });\n}\n\n/** @internal */\nexport async function getUniquePropertiesGroupInfo(\n schemaProvider: ECSchemaProvider,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n): Promise<Array<PropertyGroupInfo>> {\n const releaseMainThread = createMainThreadReleaseOnTimePassedHandler();\n const parentPropertyGroupPath = parentNode ? createNodePropertyGroupPathMatchers(parentNode) : [];\n const uniqueProperties = new Map<string, PropertyGroupInfo>();\n for (const node of nodes) {\n await releaseMainThread();\n\n const byProperties = node.processingParams?.grouping?.byProperties;\n if (!byProperties) {\n continue;\n }\n\n let propertyGroupIndex = 0;\n const previousPropertiesInfo = new Array<{ propertyGroup: HierarchyNodePropertyGroup; propertyGroupKey: string }>();\n for (const propertyGroup of byProperties.propertyGroups) {\n const mapKeyRanges = getRangesAsString(propertyGroup.ranges);\n const lastKey = previousPropertiesInfo.length > 0 ? previousPropertiesInfo[previousPropertiesInfo.length - 1].propertyGroupKey : \"\";\n const propertyGroupKey = `${lastKey}:${propertyGroup.propertyName}(${mapKeyRanges})`;\n const mapKey = `${byProperties.propertiesClassName}:${propertyGroupKey}`;\n\n let isAlreadyGrouped = false;\n if (!isAlreadyGrouped && parentPropertyGroupPath.length > 0 && propertyGroupIndex < parentPropertyGroupPath.length) {\n const groupMatcher = parentPropertyGroupPath[propertyGroupIndex];\n isAlreadyGrouped = groupMatcher({\n propertiesClassName: byProperties.propertiesClassName,\n propertyName: propertyGroup.propertyName,\n isRange: !!propertyGroup.ranges,\n });\n }\n if (!isAlreadyGrouped && !uniqueProperties.get(mapKey)) {\n uniqueProperties.set(mapKey, {\n ecClass: await getClass(schemaProvider, byProperties.propertiesClassName),\n propertyGroup: {\n propertyName: propertyGroup.propertyName,\n ranges: propertyGroup.ranges,\n },\n previousPropertiesGroupingInfo: previousPropertiesInfo.map((groupingInfo) => ({\n propertiesClassName: byProperties.propertiesClassName,\n propertyName: groupingInfo.propertyGroup.propertyName,\n isRange: !!groupingInfo.propertyGroup.ranges,\n })),\n });\n }\n\n previousPropertiesInfo.push({\n propertyGroup,\n propertyGroupKey,\n });\n ++propertyGroupIndex;\n }\n }\n // Order might change in uniqueProperties, resorting to make sure that properties with fewer previous properties are returned first.\n return [...uniqueProperties.values()].sort((lhs, rhs) => lhs.previousPropertiesGroupingInfo.length - rhs.previousPropertiesGroupingInfo.length);\n}\n\nfunction getRangesAsString(ranges?: HierarchyNodePropertyValueRange[]): string {\n return ranges\n ? ranges\n .map((range) => `${range.fromValue}-${range.toValue}(${range.rangeLabel ?? \"\"})`)\n .sort()\n .join(\";\")\n : \"\";\n}\n\nasync function shouldCreatePropertyGroup(\n handlerGroupingParams: PropertyGroupInfo,\n nodePropertyGroupingParams: HierarchyNodePropertiesGroupingParams,\n nodeFullClassName: string,\n classHierarchyInspector: ECClassHierarchyInspector,\n): Promise<boolean> {\n if (\n nodePropertyGroupingParams.propertiesClassName !== handlerGroupingParams.ecClass.fullName ||\n nodePropertyGroupingParams.propertyGroups.length < handlerGroupingParams.previousPropertiesGroupingInfo.length + 1\n ) {\n return false;\n }\n const currentProperty = nodePropertyGroupingParams.propertyGroups[handlerGroupingParams.previousPropertiesGroupingInfo.length];\n if (\n currentProperty.propertyName !== handlerGroupingParams.propertyGroup.propertyName ||\n !doRangesMatch(currentProperty.ranges, handlerGroupingParams.propertyGroup.ranges)\n ) {\n return false;\n }\n if (!doPreviousPropertiesMatch(handlerGroupingParams.previousPropertiesGroupingInfo, nodePropertyGroupingParams)) {\n return false;\n }\n return classHierarchyInspector.classDerivesFrom(nodeFullClassName, handlerGroupingParams.ecClass.fullName);\n}\n\n/** @internal */\nexport function doPreviousPropertiesMatch(\n previousPropertiesGroupingInfo: PreviousPropertiesGroupingInfo,\n nodesProperties: HierarchyNodePropertiesGroupingParams,\n): boolean {\n return (\n previousPropertiesGroupingInfo.length <= nodesProperties.propertyGroups.length &&\n previousPropertiesGroupingInfo.every(\n (groupingInfo, index) =>\n groupingInfo.propertiesClassName === nodesProperties.propertiesClassName &&\n groupingInfo.propertyName === nodesProperties.propertyGroups[index].propertyName &&\n !!groupingInfo.isRange === !!nodesProperties.propertyGroups[index].ranges,\n )\n );\n}\n\n/** @internal */\nexport function doRangesMatch(ranges1: HierarchyNodePropertyValueRange[] | undefined, ranges2: HierarchyNodePropertyValueRange[] | undefined): boolean {\n if (typeof ranges1 !== typeof ranges2) {\n return false;\n }\n if (!ranges1) {\n return true;\n }\n assert(Array.isArray(ranges2));\n if (ranges1.length !== ranges2.length) {\n return false;\n }\n return (\n // Check twice, to validate if both ranges have the same elements (elements can be in a different order)\n ranges1.every((lhsRange) =>\n ranges2.some(\n (rhsRange) => lhsRange.fromValue === rhsRange.fromValue && lhsRange.toValue === rhsRange.toValue && lhsRange.rangeLabel === rhsRange.rangeLabel,\n ),\n ) &&\n ranges2.every((lhsRange) =>\n ranges1.some(\n (rhsRange) => lhsRange.fromValue === rhsRange.fromValue && lhsRange.toValue === rhsRange.toValue && lhsRange.rangeLabel === rhsRange.rangeLabel,\n ),\n )\n );\n}\n\n/** @internal */\nexport async function createPropertiesGroupingHandlers(\n imodelAccess: ECSchemaProvider & ECClassHierarchyInspector,\n parentNode: ParentHierarchyNode | undefined,\n nodes: ProcessedInstanceHierarchyNode[],\n valueFormatter: IPrimitiveValueFormatter,\n localizedStrings: PropertiesGroupingLocalizedStrings,\n): Promise<GroupingHandler[]> {\n const propertiesGroupInfo = await getUniquePropertiesGroupInfo(imodelAccess, parentNode, nodes);\n return propertiesGroupInfo.map(\n (propertyInfo) => async (nodesToGroup, nodesAlreadyGrouped) =>\n createPropertyGroups(nodesToGroup, nodesAlreadyGrouped, propertyInfo, valueFormatter, localizedStrings, imodelAccess),\n );\n}\n"]}
@@ -1,5 +0,0 @@
1
- import { HierarchyNodeGroupingParamsBase } from "../../IModelHierarchyNode.js";
2
- import { GroupingType, ProcessedInstancesGroupingHierarchyNode } from "../Grouping.js";
3
- /** @internal */
4
- export declare function iterateChildNodeGroupingParams(parentNode: ProcessedInstancesGroupingHierarchyNode, groupingType: GroupingType, cb: (groupingParams: HierarchyNodeGroupingParamsBase | undefined) => boolean | undefined): void;
5
- //# sourceMappingURL=Shared.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Shared.d.ts","sourceRoot":"","sources":["../../../../../../src/hierarchies/imodel/operators/grouping/Shared.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,+BAA+B,EAAyC,MAAM,8BAA8B,CAAC;AACtH,OAAO,EAAE,YAAY,EAAE,uCAAuC,EAAE,MAAM,gBAAgB,CAAC;AAEvF,gBAAgB;AAChB,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,uCAAuC,EACnD,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,CAAC,cAAc,EAAE,+BAA+B,GAAG,SAAS,KAAK,OAAO,GAAG,SAAS,GACvF,IAAI,CAmBN"}