@itwin/grouping-mapping-widget 0.12.0 → 0.14.0

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 (329) hide show
  1. package/lib/cjs/grouping-mapping-widget.d.ts +3 -0
  2. package/lib/cjs/grouping-mapping-widget.js +7 -1
  3. package/lib/cjs/grouping-mapping-widget.js.map +1 -1
  4. package/lib/cjs/test/GroupingMappingCustomUI.test.js +2 -2
  5. package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
  6. package/lib/cjs/widget/components/CalculatedPropertyAction.js +7 -119
  7. package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
  8. package/lib/cjs/widget/components/CalculatedPropertyAction.scss +1 -12
  9. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.d.ts +12 -0
  10. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js +154 -0
  11. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -0
  12. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.scss +27 -0
  13. package/lib/cjs/widget/components/ConfirmMappingsImport.js +1 -1
  14. package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
  15. package/lib/cjs/widget/components/GroupAction.js +50 -66
  16. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  17. package/lib/cjs/widget/components/GroupAction.scss +0 -18
  18. package/lib/cjs/widget/components/GroupColorLegend.d.ts +10 -0
  19. package/lib/cjs/widget/components/GroupColorLegend.js +20 -0
  20. package/lib/cjs/widget/components/GroupColorLegend.js.map +1 -0
  21. package/lib/cjs/widget/components/GroupColorLegend.scss +9 -0
  22. package/lib/cjs/widget/components/GroupColorToggle.d.ts +9 -0
  23. package/lib/cjs/widget/components/GroupColorToggle.js +69 -0
  24. package/lib/cjs/widget/components/GroupColorToggle.js.map +1 -0
  25. package/lib/cjs/widget/components/GroupDetails.d.ts +13 -0
  26. package/lib/cjs/widget/components/GroupDetails.js +34 -0
  27. package/lib/cjs/widget/components/GroupDetails.js.map +1 -0
  28. package/lib/cjs/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  29. package/lib/cjs/widget/components/GroupDetailsActionPanel.js +19 -0
  30. package/lib/cjs/widget/components/GroupDetailsActionPanel.js.map +1 -0
  31. package/lib/cjs/widget/components/GroupDetailsStep.d.ts +13 -0
  32. package/lib/cjs/widget/components/GroupDetailsStep.js +25 -0
  33. package/lib/cjs/widget/components/GroupDetailsStep.js.map +1 -0
  34. package/lib/cjs/widget/components/GroupDetailsStep.scss +11 -0
  35. package/lib/cjs/widget/components/GroupItem.d.ts +12 -0
  36. package/lib/cjs/widget/components/GroupItem.js +19 -0
  37. package/lib/cjs/widget/components/GroupItem.js.map +1 -0
  38. package/lib/cjs/widget/components/GroupMenuActions.d.ts +13 -0
  39. package/lib/cjs/widget/components/GroupMenuActions.js +68 -0
  40. package/lib/cjs/widget/components/GroupMenuActions.js.map +1 -0
  41. package/lib/cjs/widget/components/GroupMenuActions.scss +13 -0
  42. package/lib/cjs/widget/components/Grouping.d.ts +9 -5
  43. package/lib/cjs/widget/components/Grouping.js +15 -144
  44. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  45. package/lib/cjs/widget/components/Grouping.scss +0 -16
  46. package/lib/cjs/widget/components/GroupingMapping.js +4 -6
  47. package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
  48. package/lib/cjs/widget/components/GroupingMappingContent.js +1 -1
  49. package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
  50. package/lib/cjs/widget/components/GroupingMappingContext.js +1 -1
  51. package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -1
  52. package/lib/cjs/widget/components/GroupingMappingHeader.d.ts +1 -2
  53. package/lib/cjs/widget/components/GroupingMappingHeader.js +9 -2
  54. package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -1
  55. package/lib/cjs/widget/components/GroupingMappingRouter.js +20 -21
  56. package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
  57. package/lib/cjs/widget/components/GroupsAddButton.d.ts +3 -2
  58. package/lib/cjs/widget/components/GroupsAddButton.js +4 -3
  59. package/lib/cjs/widget/components/GroupsAddButton.js.map +1 -1
  60. package/lib/cjs/widget/components/GroupsAddButton.scss +2 -0
  61. package/lib/cjs/widget/components/GroupsShowHideButtons.d.ts +11 -0
  62. package/lib/cjs/widget/components/GroupsShowHideButtons.js +45 -0
  63. package/lib/cjs/widget/components/GroupsShowHideButtons.js.map +1 -0
  64. package/lib/cjs/widget/components/GroupsVisualization.d.ts +9 -0
  65. package/lib/cjs/widget/components/GroupsVisualization.js +137 -0
  66. package/lib/cjs/widget/components/GroupsVisualization.js.map +1 -0
  67. package/lib/cjs/widget/components/GroupsVisualization.scss +12 -0
  68. package/lib/cjs/widget/components/GroupsVisualizationActions.d.ts +10 -0
  69. package/lib/cjs/widget/components/GroupsVisualizationActions.js +27 -0
  70. package/lib/cjs/widget/components/GroupsVisualizationActions.js.map +1 -0
  71. package/lib/cjs/widget/components/GroupsVisualizationActions.scss +9 -0
  72. package/lib/cjs/widget/components/Mapping.js +2 -3
  73. package/lib/cjs/widget/components/Mapping.js.map +1 -1
  74. package/lib/cjs/widget/components/MappingAction.js +1 -1
  75. package/lib/cjs/widget/components/MappingAction.js.map +1 -1
  76. package/lib/cjs/widget/components/MappingImportWizardModal.js +1 -1
  77. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
  78. package/lib/cjs/widget/components/PropertyAction.d.ts +8 -0
  79. package/lib/cjs/widget/components/PropertyAction.js +100 -0
  80. package/lib/cjs/widget/components/PropertyAction.js.map +1 -0
  81. package/lib/cjs/widget/components/PropertyAction.scss +9 -0
  82. package/lib/cjs/widget/components/PropertyMenu.d.ts +1 -2
  83. package/lib/cjs/widget/components/PropertyMenu.js +6 -49
  84. package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
  85. package/lib/cjs/widget/components/PropertyMenu.scss +2 -17
  86. package/lib/cjs/widget/components/PropertyMenuWithVisualization.d.ts +8 -0
  87. package/lib/cjs/widget/components/PropertyMenuWithVisualization.js +45 -0
  88. package/lib/cjs/widget/components/PropertyMenuWithVisualization.js.map +1 -0
  89. package/lib/cjs/widget/components/PropertyMenuWithVisualization.scss +16 -0
  90. package/lib/cjs/widget/components/QueryBuilder.d.ts +1 -1
  91. package/lib/cjs/widget/components/QueryBuilder.js +4 -4
  92. package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
  93. package/lib/cjs/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  94. package/lib/cjs/widget/components/QueryBuilderActionPanel.js +17 -0
  95. package/lib/cjs/widget/components/QueryBuilderActionPanel.js.map +1 -0
  96. package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +13 -0
  97. package/lib/cjs/widget/components/QueryBuilderCustomUI.js +28 -0
  98. package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +1 -0
  99. package/lib/cjs/widget/components/QueryBuilderStep.d.ts +16 -0
  100. package/lib/cjs/widget/components/QueryBuilderStep.js +30 -0
  101. package/lib/cjs/widget/components/QueryBuilderStep.js.map +1 -0
  102. package/lib/cjs/widget/components/QueryBuilderStep.scss +18 -0
  103. package/lib/cjs/widget/components/SelectMappings.js +1 -1
  104. package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
  105. package/lib/cjs/widget/components/SharedCalculatedPropertyForms.d.ts +16 -0
  106. package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js +62 -0
  107. package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js.map +1 -0
  108. package/lib/cjs/widget/components/StatusIcon.d.ts +15 -0
  109. package/lib/cjs/widget/components/StatusIcon.js +26 -0
  110. package/lib/cjs/widget/components/StatusIcon.js.map +1 -0
  111. package/lib/cjs/widget/components/StatusIcon.scss +26 -0
  112. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +2 -2
  113. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js +1 -1
  114. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  115. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  116. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js +0 -2
  117. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  118. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  119. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +51 -32
  120. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  121. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  122. package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.d.ts +4 -0
  123. package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
  124. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -1
  125. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +3 -3
  126. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  127. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  128. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +1 -1
  129. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  130. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  131. package/lib/cjs/widget/components/groupsHelpers.d.ts +1 -1
  132. package/lib/cjs/widget/components/groupsHelpers.js +11 -14
  133. package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
  134. package/lib/cjs/widget/components/utils.d.ts +1 -1
  135. package/lib/cjs/widget/components/utils.js.map +1 -1
  136. package/lib/esm/grouping-mapping-widget.d.ts +3 -0
  137. package/lib/esm/grouping-mapping-widget.js +3 -0
  138. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  139. package/lib/esm/test/GroupingMappingCustomUI.test.js +2 -2
  140. package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
  141. package/lib/esm/widget/components/CalculatedPropertyAction.js +9 -121
  142. package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
  143. package/lib/esm/widget/components/CalculatedPropertyAction.scss +1 -12
  144. package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.d.ts +12 -0
  145. package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js +128 -0
  146. package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -0
  147. package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.scss +27 -0
  148. package/lib/esm/widget/components/ConfirmMappingsImport.js +1 -1
  149. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
  150. package/lib/esm/widget/components/GroupAction.js +53 -69
  151. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  152. package/lib/esm/widget/components/GroupAction.scss +0 -18
  153. package/lib/esm/widget/components/GroupColorLegend.d.ts +10 -0
  154. package/lib/esm/widget/components/GroupColorLegend.js +13 -0
  155. package/lib/esm/widget/components/GroupColorLegend.js.map +1 -0
  156. package/lib/esm/widget/components/GroupColorLegend.scss +9 -0
  157. package/lib/esm/widget/components/GroupColorToggle.d.ts +9 -0
  158. package/lib/esm/widget/components/GroupColorToggle.js +46 -0
  159. package/lib/esm/widget/components/GroupColorToggle.js.map +1 -0
  160. package/lib/esm/widget/components/GroupDetails.d.ts +13 -0
  161. package/lib/esm/widget/components/GroupDetails.js +27 -0
  162. package/lib/esm/widget/components/GroupDetails.js.map +1 -0
  163. package/lib/esm/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  164. package/lib/esm/widget/components/GroupDetailsActionPanel.js +12 -0
  165. package/lib/esm/widget/components/GroupDetailsActionPanel.js.map +1 -0
  166. package/lib/esm/widget/components/GroupDetailsStep.d.ts +13 -0
  167. package/lib/esm/widget/components/GroupDetailsStep.js +18 -0
  168. package/lib/esm/widget/components/GroupDetailsStep.js.map +1 -0
  169. package/lib/esm/widget/components/GroupDetailsStep.scss +11 -0
  170. package/lib/esm/widget/components/GroupItem.d.ts +12 -0
  171. package/lib/esm/widget/components/GroupItem.js +12 -0
  172. package/lib/esm/widget/components/GroupItem.js.map +1 -0
  173. package/lib/esm/widget/components/GroupMenuActions.d.ts +13 -0
  174. package/lib/esm/widget/components/GroupMenuActions.js +45 -0
  175. package/lib/esm/widget/components/GroupMenuActions.js.map +1 -0
  176. package/lib/esm/widget/components/GroupMenuActions.scss +13 -0
  177. package/lib/esm/widget/components/Grouping.d.ts +9 -5
  178. package/lib/esm/widget/components/Grouping.js +18 -147
  179. package/lib/esm/widget/components/Grouping.js.map +1 -1
  180. package/lib/esm/widget/components/Grouping.scss +0 -16
  181. package/lib/esm/widget/components/GroupingMapping.js +4 -6
  182. package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
  183. package/lib/esm/widget/components/GroupingMappingContent.js +1 -1
  184. package/lib/esm/widget/components/GroupingMappingContent.js.map +1 -1
  185. package/lib/esm/widget/components/GroupingMappingContext.js +1 -1
  186. package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -1
  187. package/lib/esm/widget/components/GroupingMappingHeader.d.ts +1 -2
  188. package/lib/esm/widget/components/GroupingMappingHeader.js +9 -2
  189. package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -1
  190. package/lib/esm/widget/components/GroupingMappingRouter.js +20 -21
  191. package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
  192. package/lib/esm/widget/components/GroupsAddButton.d.ts +3 -2
  193. package/lib/esm/widget/components/GroupsAddButton.js +5 -4
  194. package/lib/esm/widget/components/GroupsAddButton.js.map +1 -1
  195. package/lib/esm/widget/components/GroupsAddButton.scss +2 -0
  196. package/lib/esm/widget/components/GroupsShowHideButtons.d.ts +11 -0
  197. package/lib/esm/widget/components/GroupsShowHideButtons.js +22 -0
  198. package/lib/esm/widget/components/GroupsShowHideButtons.js.map +1 -0
  199. package/lib/esm/widget/components/GroupsVisualization.d.ts +9 -0
  200. package/lib/esm/widget/components/GroupsVisualization.js +114 -0
  201. package/lib/esm/widget/components/GroupsVisualization.js.map +1 -0
  202. package/lib/esm/widget/components/GroupsVisualization.scss +12 -0
  203. package/lib/esm/widget/components/GroupsVisualizationActions.d.ts +10 -0
  204. package/lib/esm/widget/components/GroupsVisualizationActions.js +20 -0
  205. package/lib/esm/widget/components/GroupsVisualizationActions.js.map +1 -0
  206. package/lib/esm/widget/components/GroupsVisualizationActions.scss +9 -0
  207. package/lib/esm/widget/components/Mapping.js +2 -3
  208. package/lib/esm/widget/components/Mapping.js.map +1 -1
  209. package/lib/esm/widget/components/MappingAction.js +1 -1
  210. package/lib/esm/widget/components/MappingAction.js.map +1 -1
  211. package/lib/esm/widget/components/MappingImportWizardModal.js +1 -1
  212. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
  213. package/lib/esm/widget/components/PropertyAction.d.ts +8 -0
  214. package/lib/esm/widget/components/PropertyAction.js +77 -0
  215. package/lib/esm/widget/components/PropertyAction.js.map +1 -0
  216. package/lib/esm/widget/components/PropertyAction.scss +9 -0
  217. package/lib/esm/widget/components/PropertyMenu.d.ts +1 -2
  218. package/lib/esm/widget/components/PropertyMenu.js +7 -50
  219. package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
  220. package/lib/esm/widget/components/PropertyMenu.scss +2 -17
  221. package/lib/esm/widget/components/PropertyMenuWithVisualization.d.ts +8 -0
  222. package/lib/esm/widget/components/PropertyMenuWithVisualization.js +22 -0
  223. package/lib/esm/widget/components/PropertyMenuWithVisualization.js.map +1 -0
  224. package/lib/esm/widget/components/PropertyMenuWithVisualization.scss +16 -0
  225. package/lib/esm/widget/components/QueryBuilder.d.ts +1 -1
  226. package/lib/esm/widget/components/QueryBuilder.js +4 -4
  227. package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
  228. package/lib/esm/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  229. package/lib/esm/widget/components/QueryBuilderActionPanel.js +10 -0
  230. package/lib/esm/widget/components/QueryBuilderActionPanel.js.map +1 -0
  231. package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +13 -0
  232. package/lib/esm/widget/components/QueryBuilderCustomUI.js +21 -0
  233. package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +1 -0
  234. package/lib/esm/widget/components/QueryBuilderStep.d.ts +16 -0
  235. package/lib/esm/widget/components/QueryBuilderStep.js +23 -0
  236. package/lib/esm/widget/components/QueryBuilderStep.js.map +1 -0
  237. package/lib/esm/widget/components/QueryBuilderStep.scss +18 -0
  238. package/lib/esm/widget/components/SelectMappings.js +1 -1
  239. package/lib/esm/widget/components/SelectMappings.js.map +1 -1
  240. package/lib/esm/widget/components/SharedCalculatedPropertyForms.d.ts +16 -0
  241. package/lib/esm/widget/components/SharedCalculatedPropertyForms.js +39 -0
  242. package/lib/esm/widget/components/SharedCalculatedPropertyForms.js.map +1 -0
  243. package/lib/esm/widget/components/StatusIcon.d.ts +15 -0
  244. package/lib/esm/widget/components/StatusIcon.js +19 -0
  245. package/lib/esm/widget/components/StatusIcon.js.map +1 -0
  246. package/lib/esm/widget/components/StatusIcon.scss +26 -0
  247. package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +2 -2
  248. package/lib/esm/widget/components/context/GroupHilitedElementsContext.js +1 -1
  249. package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  250. package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  251. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js +0 -2
  252. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  253. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  254. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js +53 -34
  255. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  256. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  257. package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.d.ts +4 -0
  258. package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
  259. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -1
  260. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +4 -4
  261. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  262. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  263. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +2 -2
  264. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  265. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  266. package/lib/esm/widget/components/groupsHelpers.d.ts +1 -1
  267. package/lib/esm/widget/components/groupsHelpers.js +11 -14
  268. package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
  269. package/lib/esm/widget/components/utils.d.ts +1 -1
  270. package/lib/esm/widget/components/utils.js.map +1 -1
  271. package/package.json +1 -1
  272. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  273. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -91
  274. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  275. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  276. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -62
  277. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  278. package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  279. package/lib/cjs/widget/components/property-grid/PropertyGrid.js +0 -198
  280. package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +0 -1
  281. package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +0 -71
  282. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  283. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +0 -77
  284. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  285. package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +0 -69
  286. package/lib/cjs/widget/components/property-grid/PropertyList.js +0 -87
  287. package/lib/cjs/widget/components/property-grid/PropertyList.js.map +0 -1
  288. package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +0 -92
  289. package/lib/cjs/widget/components/property-grid/PropertyRender.js +0 -109
  290. package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +0 -1
  291. package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +0 -22
  292. package/lib/cjs/widget/components/property-grid/PropertyView.js +0 -232
  293. package/lib/cjs/widget/components/property-grid/PropertyView.js.map +0 -1
  294. package/lib/cjs/widget/components/property-grid/PropertyView.scss +0 -77
  295. package/lib/cjs/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  296. package/lib/cjs/widget/components/property-grid/countMatchesInString.js +0 -32
  297. package/lib/cjs/widget/components/property-grid/countMatchesInString.js.map +0 -1
  298. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  299. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js +0 -65
  300. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
  301. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  302. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -68
  303. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  304. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  305. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -39
  306. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  307. package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  308. package/lib/esm/widget/components/property-grid/PropertyGrid.js +0 -172
  309. package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +0 -1
  310. package/lib/esm/widget/components/property-grid/PropertyGrid.scss +0 -71
  311. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  312. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +0 -54
  313. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  314. package/lib/esm/widget/components/property-grid/PropertyList.d.ts +0 -69
  315. package/lib/esm/widget/components/property-grid/PropertyList.js +0 -60
  316. package/lib/esm/widget/components/property-grid/PropertyList.js.map +0 -1
  317. package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +0 -92
  318. package/lib/esm/widget/components/property-grid/PropertyRender.js +0 -86
  319. package/lib/esm/widget/components/property-grid/PropertyRender.js.map +0 -1
  320. package/lib/esm/widget/components/property-grid/PropertyView.d.ts +0 -22
  321. package/lib/esm/widget/components/property-grid/PropertyView.js +0 -209
  322. package/lib/esm/widget/components/property-grid/PropertyView.js.map +0 -1
  323. package/lib/esm/widget/components/property-grid/PropertyView.scss +0 -77
  324. package/lib/esm/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  325. package/lib/esm/widget/components/property-grid/countMatchesInString.js +0 -28
  326. package/lib/esm/widget/components/property-grid/countMatchesInString.js.map +0 -1
  327. package/lib/esm/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  328. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js +0 -42
  329. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
@@ -2,58 +2,77 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- import React, { useEffect, useState } from "react";
5
+ import React, { useCallback, useEffect, useMemo, useState } from "react";
6
6
  import { useActiveIModelConnection } from "@itwin/appui-react";
7
7
  import { Presentation } from "@itwin/presentation-frontend";
8
8
  import { KeySet } from "@itwin/presentation-common";
9
- import { PropertyGridWrapper } from "../property-grid/PropertyGridWrapper";
10
- import { PropertyGridWrapperContext } from "../context/PropertyGridWrapperContext";
11
- import { Button } from "@itwin/itwinui-react";
12
9
  import "./GroupQueryBuilderCustomUI.scss";
13
- export const GroupQueryBuilderCustomUI = ({ isUpdating, resetView, updateQuery }) => {
10
+ import { QueryBuilder } from "../QueryBuilder";
11
+ import { DEFAULT_PROPERTY_GRID_RULESET, PresentationPropertyDataProvider, } from "@itwin/presentation-components";
12
+ import { VirtualizedPropertyGridWithDataProvider } from "@itwin/components-react";
13
+ import { ResizableContainerObserver } from "@itwin/core-react";
14
+ import { PropertyGridWrapperContext } from "../context/PropertyGridWrapperContext";
15
+ import { PropertyAction } from "../PropertyAction";
16
+ import { Alert, Button } from "@itwin/itwinui-react";
17
+ const createPropertyDataProvider = (keys, iModelConnection) => {
18
+ const dataProvider = new PresentationPropertyDataProvider({
19
+ imodel: iModelConnection,
20
+ ruleset: DEFAULT_PROPERTY_GRID_RULESET,
21
+ });
22
+ dataProvider.keys = keys;
23
+ dataProvider.isNestedPropertyCategoryGroupingEnabled = true;
24
+ return dataProvider;
25
+ };
26
+ export const GroupQueryBuilderCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
14
27
  const iModelConnection = useActiveIModelConnection();
15
- const [keysState, setKeysState] = useState(new KeySet());
16
- const [selected, setSelected] = useState(false);
17
- const [queryBuilder, setQueryBuilder] = useState();
28
+ if (!iModelConnection) {
29
+ throw new Error("This component requires an active iModelConnection.");
30
+ }
31
+ const [size, setSize] = useState({ width: 0, height: 0 });
32
+ const [dataProvider, setDataProvider] = useState(undefined);
18
33
  const [currentPropertyList, setCurrentPropertyList] = useState([]);
34
+ const [selectionKeySet, setSelectionKeyset] = useState(new KeySet());
35
+ const [queryBuilder, setQueryBuilder] = useState();
19
36
  useEffect(() => {
20
- if (!iModelConnection) {
21
- throw new Error("This component requires an active iModelConnection.");
22
- }
23
- }, [iModelConnection]);
24
- useEffect(() => {
25
- const _onSelectionChanged = async (evt, selectionProvider) => {
26
- setSelected(true);
27
- setCurrentPropertyList([]);
37
+ const onSelectionChanged = async (evt, selectionProvider) => {
28
38
  const selection = selectionProvider.getSelection(evt.imodel, evt.level);
29
39
  const keys = new KeySet(selection);
30
- setKeysState(keys);
40
+ setSelectionKeyset(keys);
41
+ const dataProvider = createPropertyDataProvider(keys, iModelConnection);
42
+ setDataProvider(dataProvider);
43
+ setQueryBuilder(new QueryBuilder(dataProvider));
31
44
  };
32
45
  return iModelConnection
33
- ? Presentation.selection.selectionChange.addListener(_onSelectionChanged) :
34
- () => { };
46
+ ? Presentation.selection.selectionChange.addListener(onSelectionChanged)
47
+ : () => { };
35
48
  }, [iModelConnection]);
36
- const _onClickResetButton = async () => {
49
+ const onClickResetButton = async () => {
50
+ queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.resetQueryBuilder();
37
51
  updateQuery("");
38
- queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.resetQuery();
39
52
  setCurrentPropertyList([]);
40
53
  if (resetView)
41
54
  await resetView().catch((e) =>
42
55
  /* eslint-disable no-console */
43
56
  console.error(e));
44
57
  };
45
- return (React.createElement("div", { className: "gmw-find-similar-container" },
46
- React.createElement(PropertyGridWrapperContext.Provider, { value: {
47
- currentPropertyList,
48
- setCurrentPropertyList,
49
- queryBuilder,
50
- setQueryBuilder,
51
- resetView: resetView !== null && resetView !== void 0 ? resetView : (async () => { }),
52
- setQuery: updateQuery,
53
- isUpdating: isUpdating !== null && isUpdating !== void 0 ? isUpdating : false,
54
- } },
55
- React.createElement(PropertyGridWrapper, { keys: keysState, imodel: iModelConnection })),
56
- selected && (React.createElement("div", { className: "gmw-button-container" },
57
- React.createElement(Button, { styleType: "default", size: "small", className: "gmw-reset-button", onClick: _onClickResetButton }, "Reset")))));
58
+ const resize = useCallback((width, height) => setSize({ width, height }), []);
59
+ const propertyContextValues = useMemo(() => ({
60
+ currentPropertyList,
61
+ setCurrentPropertyList,
62
+ queryBuilder,
63
+ setQuery: updateQuery,
64
+ isUpdating: isUpdating !== null && isUpdating !== void 0 ? isUpdating : false,
65
+ }), [currentPropertyList, isUpdating, queryBuilder, updateQuery]);
66
+ const actionButtonRenderers = useMemo(() => [
67
+ ({ property }) => (React.createElement(PropertyAction, { property: property })),
68
+ ], []);
69
+ return (React.createElement("div", { className: "gmw-select-query-generator-container" }, !dataProvider || selectionKeySet.size === 0 ? (React.createElement(Alert, { type: 'informational' }, "Please select on an element within the viewer first, then select properties to generate a group query.")) :
70
+ React.createElement(React.Fragment, null,
71
+ React.createElement("div", { className: "gmw-select-property-grid-container" },
72
+ React.createElement(ResizableContainerObserver, { onResize: resize }),
73
+ React.createElement(PropertyGridWrapperContext.Provider, { value: propertyContextValues },
74
+ React.createElement(VirtualizedPropertyGridWithDataProvider, { dataProvider: dataProvider, width: size.width, height: size.height, actionButtonRenderers: actionButtonRenderers }))),
75
+ React.createElement("div", { className: "gmw-select-reset-button" },
76
+ React.createElement(Button, { styleType: "default", size: "small", onClick: onClickResetButton }, "Reset")))));
58
77
  };
59
78
  //# sourceMappingURL=GroupQueryBuilderCustomUI.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupQueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupQueryBuilderCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OA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,gBAAgB,CAAC,CAAC,CAAC;IAEvB,MAAM,mBAAmB,GAAG,KAAK,IAAI,EAAE;QACrC,WAAW,CAAC,EAAE,CAAC,CAAC;QAChB,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,EAAE,CAAC;QAC3B,sBAAsB,CAAC,EAAE,CAAC,CAAC;QAC3B,IAAI,SAAS;YACX,MAAM,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YAC5B,+BAA+B;YAC/B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CACjB,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B;QACzC,oBAAC,0BAA0B,CAAC,QAAQ,IAClC,KAAK,EAAE;gBACL,mBAAmB;gBACnB,sBAAsB;gBACtB,YAAY;gBACZ,eAAe;gBACf,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,CAAC,KAAK,IAAI,EAAE,GAAG,CAAC,CAAC;gBACzC,QAAQ,EAAE,WAAW;gBACrB,UAAU,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,KAAK;aAChC;YACD,oBAAC,mBAAmB,IAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,GAAI,CAC9B;QAEpC,QAAQ,IAAI,CACV,6BAAK,SAAS,EAAC,sBAAsB;YACnC,oBAAC,MAAM,IACL,SAAS,EAAC,SAAS,EACnB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAE,mBAAmB,YAGrB,CACL,CACP,CAEE,CACR,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport React, { useEffect, useState } from \"react\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport type { ISelectionProvider, SelectionChangeEventArgs } from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { PropertyGridWrapper } from \"../property-grid/PropertyGridWrapper\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport \"./GroupQueryBuilderCustomUI.scss\";\nimport type { QueryBuilder } from \"../QueryBuilder\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\n\nexport const GroupQueryBuilderCustomUI = ({ isUpdating, resetView, updateQuery }: GroupingCustomUIProps) => {\n const iModelConnection = useActiveIModelConnection();\n\n const [keysState, setKeysState] = useState<KeySet>(new KeySet());\n const [selected, setSelected] = useState<boolean>(false);\n\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder | undefined>();\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n\n useEffect(() => {\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n }, [iModelConnection]);\n\n useEffect(() => {\n const _onSelectionChanged = async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider\n ) => {\n setSelected(true);\n setCurrentPropertyList([]);\n\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setKeysState(keys);\n };\n\n return iModelConnection\n ? Presentation.selection.selectionChange.addListener(_onSelectionChanged) :\n () => { };\n }, [iModelConnection]);\n\n const _onClickResetButton = async () => {\n updateQuery(\"\");\n queryBuilder?.resetQuery();\n setCurrentPropertyList([]);\n if (resetView)\n await resetView().catch((e) =>\n /* eslint-disable no-console */\n console.error(e)\n );\n };\n\n return (\n <div className=\"gmw-find-similar-container\">\n <PropertyGridWrapperContext.Provider\n value={{\n currentPropertyList,\n setCurrentPropertyList,\n queryBuilder,\n setQueryBuilder,\n resetView: resetView ?? (async () => { }),\n setQuery: updateQuery,\n isUpdating: isUpdating ?? false,\n }}>\n <PropertyGridWrapper keys={keysState} imodel={iModelConnection} />\n </PropertyGridWrapperContext.Provider>\n {\n selected && (\n <div className=\"gmw-button-container\">\n <Button\n styleType=\"default\"\n size=\"small\"\n className=\"gmw-reset-button\"\n onClick={_onClickResetButton}\n >\n Reset\n </Button>\n </div>\n )\n }\n </div >\n );\n};\n"]}
1
+ {"version":3,"file":"GroupQueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupQueryBuilderCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAK5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,uCAAuC,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,0BAA0B,GAAG,CACjC,IAAY,EACZ,gBAAkC,EACA,EAAE;IACpC,MAAM,YAAY,GAAG,IAAI,gCAAgC,CAAC;QACxD,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,6BAA6B;KACvC,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AAI,CACvC;KACF,EACD,EAAE,CACH,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,sCAAsC,IAClD,CAAC,YAAY,IAAI,eAAe,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAC7C,oBAAC,KAAK,IAAC,IAAI,EAAC,eAAe,6GAEnB,CACT,CAAC,CAAC;QACD;YACE,6BAAK,SAAS,EAAC,oCAAoC;gBACjD,oBAAC,0BAA0B,IAAC,QAAQ,EAAE,MAAM,GAAI;gBAChD,oBAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,qBAAqB;oBAC/D,oBAAC,uCAAuC,IACtC,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,qBAAqB,EAAE,qBAAqB,GAC5C,CACkC,CAClC;YACN,6BAAK,SAAS,EAAC,yBAAyB;gBACtC,oBAAC,MAAM,IACL,SAAS,EAAC,SAAS,EACnB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,kBAAkB,YAGpB,CACL,CACL,CAED,CACP,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport \"./GroupQueryBuilderCustomUI.scss\";\nimport { QueryBuilder } from \"../QueryBuilder\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport {\n DEFAULT_PROPERTY_GRID_RULESET,\n PresentationPropertyDataProvider,\n} from \"@itwin/presentation-components\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ActionButtonRendererProps } from \"@itwin/components-react\";\nimport { VirtualizedPropertyGridWithDataProvider } from \"@itwin/components-react\";\nimport { ResizableContainerObserver } from \"@itwin/core-react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { PropertyAction } from \"../PropertyAction\";\nimport { Alert, Button } from \"@itwin/itwinui-react\";\n\nconst createPropertyDataProvider = (\n keys: KeySet,\n iModelConnection: IModelConnection\n): PresentationPropertyDataProvider => {\n const dataProvider = new PresentationPropertyDataProvider({\n imodel: iModelConnection,\n ruleset: DEFAULT_PROPERTY_GRID_RULESET,\n });\n dataProvider.keys = keys;\n dataProvider.isNestedPropertyCategoryGroupingEnabled = true;\n return dataProvider;\n};\n\ninterface ContainerDimensions {\n width: number;\n height: number;\n}\n\nexport const GroupQueryBuilderCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const iModelConnection = useActiveIModelConnection();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [size, setSize] = useState<ContainerDimensions>({ width: 0, height: 0 });\n const [dataProvider, setDataProvider] =\n useState<PresentationPropertyDataProvider | undefined>(undefined);\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n const [selectionKeySet, setSelectionKeyset] = useState<KeySet>(new KeySet());\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder | undefined>();\n\n useEffect(() => {\n const onSelectionChanged = async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider\n ) => {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setSelectionKeyset(keys);\n const dataProvider = createPropertyDataProvider(keys, iModelConnection);\n setDataProvider(dataProvider);\n setQueryBuilder(new QueryBuilder(dataProvider));\n };\n\n return iModelConnection\n ? Presentation.selection.selectionChange.addListener(onSelectionChanged)\n : () => { };\n }, [iModelConnection]);\n\n const onClickResetButton = async () => {\n queryBuilder?.resetQueryBuilder();\n updateQuery(\"\");\n setCurrentPropertyList([]);\n if (resetView)\n await resetView().catch((e) =>\n /* eslint-disable no-console */\n console.error(e)\n );\n };\n\n const resize = useCallback((width, height) => setSize({ width, height }), []);\n\n const propertyContextValues = useMemo(\n () => ({\n currentPropertyList,\n setCurrentPropertyList,\n queryBuilder,\n setQuery: updateQuery,\n isUpdating: isUpdating ?? false,\n }),\n [currentPropertyList, isUpdating, queryBuilder, updateQuery]\n );\n\n const actionButtonRenderers = useMemo(\n () => [\n ({ property }: ActionButtonRendererProps) => (\n <PropertyAction property={property} />\n ),\n ],\n []\n );\n\n return (\n <div className=\"gmw-select-query-generator-container\">\n {!dataProvider || selectionKeySet.size === 0 ? (\n <Alert type='informational'>\n Please select on an element within the viewer first, then select properties to generate a group query.\n </Alert>\n ) :\n <>\n <div className=\"gmw-select-property-grid-container\">\n <ResizableContainerObserver onResize={resize} />\n <PropertyGridWrapperContext.Provider value={propertyContextValues}>\n <VirtualizedPropertyGridWithDataProvider\n dataProvider={dataProvider}\n width={size.width}\n height={size.height}\n actionButtonRenderers={actionButtonRenderers}\n />\n </PropertyGridWrapperContext.Provider>\n </div>\n <div className=\"gmw-select-reset-button\">\n <Button\n styleType=\"default\"\n size=\"small\"\n onClick={onClickResetButton}\n >\n Reset\n </Button>\n </div>\n </>\n }\n </div>\n );\n};\n\n"]}
@@ -2,23 +2,31 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import '~@itwin/itwinui-css/scss/variables';
5
+ @import "~@itwin/itwinui-css/scss/variables";
6
6
 
7
- .gmw-find-similar-container {
8
- color: var(--buic-foreground-body);
9
- }
10
-
11
- .gmw-button-container {
12
- text-align: right;
13
- }
14
-
15
- .gmw-reset-button {
16
- margin-left: 10px;
17
- }
18
-
19
- .gmw-select-element-hint {
7
+ .gmw-select-query-generator-container {
20
8
  display: flex;
21
- height: 300px;
22
- justify-content: center;
23
- align-items: center;
9
+ flex-grow: 1;
10
+ flex-direction: column;
11
+ min-height: 0;
12
+ overflow: auto;
13
+ .gmw-select-element-hint {
14
+ display: flex;
15
+ justify-content: center;
16
+ align-items: center;
17
+ flex-grow: 1;
18
+ }
19
+ .gmw-select-property-grid-container {
20
+ display: flex;
21
+ flex: 1 1;
22
+ min-width: 0;
23
+ min-height: 0;
24
+ justify-content: center;
25
+ align-items: center;
26
+ }
27
+ .gmw-select-reset-button {
28
+ display: flex;
29
+ justify-content: right;
30
+ margin-top: $iui-baseline;
31
+ }
24
32
  }
@@ -88,5 +88,9 @@ export interface GroupingCustomUIProps {
88
88
  * To reset the viewer.
89
89
  */
90
90
  resetView?: () => Promise<void>;
91
+ /**
92
+ * The initial query for the Group being edited.
93
+ */
94
+ initialEditModeQuery?: string;
91
95
  }
92
96
  //# sourceMappingURL=GroupingMappingCustomUI.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingMappingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupingMappingCustomUI.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,qFAAQ,CAAA;IACR,mFAAO,CAAA;AACT,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC","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*--------------------------------------------------------------------------------------------*/\nimport type { Group, Mapping } from \"@itwin/insights-client\";\nimport type { ReactElement } from \"react\";\n\nexport enum GroupingMappingCustomUIType {\n Grouping,\n Context,\n}\n\nexport type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;\n\n/** Custom UI Definitions. */\n\nexport interface IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType;\n /**\n * Unique identifier of the custom UI.\n */\n name: string;\n /**\n * Display label in the widget.\n */\n displayLabel: string;\n /**\n * Optional icon, will be shown before display label in widget.\n */\n icon?: ReactElement;\n}\n\n/**\n * Context custom UI type definition.\n */\nexport interface ContextCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Context;\n /**\n * User defined component for UI interaction with grouping mapping widget.\n */\n uiComponent?: React.ComponentType<ContextCustomUIProps>;\n /**\n * Callback function for context custom UI menu item click event.\n */\n onClick?: (group: Group, mapping: Mapping, iModelId: string) => void;\n}\n\n/**\n * Group custom UI type definition.\n */\nexport interface GroupingCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Grouping;\n /**\n * Custom UI Component to build query interactively. Refer to SearchGroupingCustomUI/ManualGroupingCustomUI.\n */\n uiComponent: (props: GroupingCustomUIProps) => JSX.Element;\n}\n\n/** Custom UI Component props definitions. */\n\n/**\n * Context custom UI component arguments definition.\n */\nexport interface ContextCustomUIProps {\n /**\n * IModel Id.\n */\n iModelId: string;\n /**\n * Mapping Id.\n */\n mappingId: string;\n /**\n * Group Id.\n */\n groupId: string;\n}\n\n/**\n * Group custom UI component arguments definition.\n */\nexport interface GroupingCustomUIProps {\n /**\n * To validate and update current query.\n */\n updateQuery: (query: string) => void;\n /**\n * To get the query loading status.\n */\n isUpdating?: boolean;\n /**\n * To reset the viewer.\n */\n resetView?: () => Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"GroupingMappingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupingMappingCustomUI.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,qFAAQ,CAAA;IACR,mFAAO,CAAA;AACT,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC","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*--------------------------------------------------------------------------------------------*/\nimport type { Group, Mapping } from \"@itwin/insights-client\";\nimport type { ReactElement } from \"react\";\n\nexport enum GroupingMappingCustomUIType {\n Grouping,\n Context,\n}\n\nexport type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;\n\n/** Custom UI Definitions. */\n\nexport interface IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType;\n /**\n * Unique identifier of the custom UI.\n */\n name: string;\n /**\n * Display label in the widget.\n */\n displayLabel: string;\n /**\n * Optional icon, will be shown before display label in widget.\n */\n icon?: ReactElement;\n}\n\n/**\n * Context custom UI type definition.\n */\nexport interface ContextCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Context;\n /**\n * User defined component for UI interaction with grouping mapping widget.\n */\n uiComponent?: React.ComponentType<ContextCustomUIProps>;\n /**\n * Callback function for context custom UI menu item click event.\n */\n onClick?: (group: Group, mapping: Mapping, iModelId: string) => void;\n}\n\n/**\n * Group custom UI type definition.\n */\nexport interface GroupingCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Grouping;\n /**\n * Custom UI Component to build query interactively. Refer to SearchGroupingCustomUI/ManualGroupingCustomUI.\n */\n uiComponent: (props: GroupingCustomUIProps) => JSX.Element;\n}\n\n/** Custom UI Component props definitions. */\n\n/**\n * Context custom UI component arguments definition.\n */\nexport interface ContextCustomUIProps {\n /**\n * IModel Id.\n */\n iModelId: string;\n /**\n * Mapping Id.\n */\n mappingId: string;\n /**\n * Group Id.\n */\n groupId: string;\n}\n\n/**\n * Group custom UI component arguments definition.\n */\nexport interface GroupingCustomUIProps {\n /**\n * To validate and update current query.\n */\n updateQuery: (query: string) => void;\n /**\n * To get the query loading status.\n */\n isUpdating?: boolean;\n /**\n * To reset the viewer.\n */\n resetView?: () => Promise<void>;\n /**\n * The initial query for the Group being edited.\n */\n initialEditModeQuery?: string;\n\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import "./ManualGroupingCustomUI.scss";
3
3
  import type { GroupingCustomUIProps } from "./GroupingMappingCustomUI";
4
- export declare const ManualGroupingCustomUI: ({ updateQuery, isUpdating, resetView, }: GroupingCustomUIProps) => JSX.Element;
4
+ export declare const ManualGroupingCustomUI: ({ updateQuery, isUpdating, resetView, initialEditModeQuery, }: GroupingCustomUIProps) => JSX.Element;
5
5
  //# sourceMappingURL=ManualGroupingCustomUI.d.ts.map
@@ -3,13 +3,13 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import React from "react";
6
- import { Button, LabeledTextarea, Text } from "@itwin/itwinui-react";
6
+ import { Alert, Button, LabeledTextarea } from "@itwin/itwinui-react";
7
7
  import { LoadingSpinner } from "../utils";
8
8
  import "./ManualGroupingCustomUI.scss";
9
- export const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
10
- const [manualInput, setManualInput] = React.useState("");
9
+ export const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, initialEditModeQuery, }) => {
10
+ const [manualInput, setManualInput] = React.useState(initialEditModeQuery !== null && initialEditModeQuery !== void 0 ? initialEditModeQuery : "");
11
11
  return (React.createElement("div", { className: 'gmw-manual-form' },
12
- React.createElement(Text, null, "Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query."),
12
+ React.createElement(Alert, { type: 'informational' }, "Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query."),
13
13
  React.createElement(LabeledTextarea, { label: 'Query', required: true, value: manualInput, onChange: (event) => setManualInput(event.target.value), disabled: isUpdating, placeholder: `E.g. "SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement"` }),
14
14
  React.createElement("div", { className: 'gmw-manual-actions' },
15
15
  isUpdating && React.createElement(LoadingSpinner, null),
@@ -1 +1 @@
1
- {"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,+BAA+B,CAAC;AAGvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,GACa,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEzD,OAAO,CACL,6BAAK,SAAS,EAAC,iBAAiB;QAC9B,oBAAC,IAAI,8GAEE;QACP,oBAAC,eAAe,IACd,KAAK,EAAC,OAAO,EACb,QAAQ,QACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,oEAAoE,GACjF;QACF,6BAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,IAAI,oBAAC,cAAc,OAAG;YACjC,oBAAC,MAAM,IAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,YAE5D;YACT,oBAAC,MAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { Button, LabeledTextarea, Text } from \"@itwin/itwinui-react\";\nimport { LoadingSpinner } from \"../utils\";\nimport \"./ManualGroupingCustomUI.scss\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\n\nexport const ManualGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const [manualInput, setManualInput] = React.useState(\"\");\n\n return (\n <div className='gmw-manual-form'>\n <Text>\n Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query.\n </Text>\n <LabeledTextarea\n label='Query'\n required\n value={manualInput}\n onChange={(event) => setManualInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement\"`}\n />\n <div className='gmw-manual-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button disabled={isUpdating} onClick={() => updateQuery(manualInput)}>\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setManualInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,+BAA+B,CAAC;AAGvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,EACT,oBAAoB,GACE,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,EAAE,CAAC,CAAC;IAEjF,OAAO,CACL,6BAAK,SAAS,EAAC,iBAAiB;QAC9B,oBAAC,KAAK,IAAC,IAAI,EAAC,eAAe,0GAEnB;QACR,oBAAC,eAAe,IACd,KAAK,EAAC,OAAO,EACb,QAAQ,QACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,oEAAoE,GACjF;QACF,6BAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,IAAI,oBAAC,cAAc,OAAG;YACjC,oBAAC,MAAM,IAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,YAE5D;YACT,oBAAC,MAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport { LoadingSpinner } from \"../utils\";\nimport \"./ManualGroupingCustomUI.scss\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\n\nexport const ManualGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n initialEditModeQuery,\n}: GroupingCustomUIProps) => {\n const [manualInput, setManualInput] = React.useState(initialEditModeQuery ?? \"\");\n\n return (\n <div className='gmw-manual-form'>\n <Alert type='informational'>\n Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query.\n </Alert>\n <LabeledTextarea\n label='Query'\n required\n value={manualInput}\n onChange={(event) => setManualInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement\"`}\n />\n <div className='gmw-manual-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button disabled={isUpdating} onClick={() => updateQuery(manualInput)}>\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setManualInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n"]}
@@ -8,6 +8,7 @@
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  gap: $iui-baseline;
11
+ overflow: auto;
11
12
  margin-top: $iui-baseline;
12
13
  > .gmw-manual-actions {
13
14
  display: flex;
@@ -3,7 +3,7 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import React from "react";
6
- import { Button, LabeledTextarea, Text } from "@itwin/itwinui-react";
6
+ import { Alert, Button, LabeledTextarea } from "@itwin/itwinui-react";
7
7
  import { LoadingSpinner } from "../utils";
8
8
  import "./SearchGroupingCustomUI.scss";
9
9
  export const SearchGroupingCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
@@ -70,7 +70,7 @@ export const SearchGroupingCustomUI = ({ updateQuery, isUpdating, resetView, })
70
70
  updateQuery(generatedSearchQuery);
71
71
  };
72
72
  return (React.createElement("div", { className: 'gmw-search-form' },
73
- React.createElement(Text, null, "Generate a query by keywords. Keywords wrapped in double quotes will be considered a required criteria."),
73
+ React.createElement(Alert, { type: 'informational' }, "Generate a query by keywords. Keywords wrapped in double quotes will be considered a required criteria."),
74
74
  React.createElement(LabeledTextarea, { label: 'Query Keywords', required: true, value: searchInput, onChange: (event) => setSearchInput(event.target.value), disabled: isUpdating, placeholder: `E.g. "red" chair` }),
75
75
  React.createElement("div", { className: 'gmw-search-actions' },
76
76
  isUpdating && React.createElement(LoadingSpinner, null),
@@ -1 +1 @@
1
- {"version":3,"file":"SearchGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/SearchGroupingCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,GACa,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzD,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,CACvB,KAAa,EACb,KAAa,EACb,WAAqB,EACrB,EAAE,CACF,iBAAiB,CAAC,KAAK,CAAC;QACxB,CAAC,KAAK,KAAK,CAAC,IAAI,iBAAiB,CAAC,WAAW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AG;YACjC,oBAAC,MAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,GAAG,EAAE,CACZ,mBAAmB,CACjB,WAAW;oBACT,CAAC,CAAC,WAAW;yBACV,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;yBAC7B,IAAI,EAAE;yBACN,KAAK,CAAC,GAAG,CAAC;oBACb,CAAC,CAAC,EAAE,CACP,YAII;YACT,oBAAC,MAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { Button, LabeledTextarea, Text } from \"@itwin/itwinui-react\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport { LoadingSpinner } from \"../utils\";\nimport \"./SearchGroupingCustomUI.scss\";\n\nexport const SearchGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const [searchInput, setSearchInput] = React.useState(\"\");\n const isWrappedInQuotes = (text: string) => {\n return text.startsWith(`\"`) && text.endsWith(`\"`);\n };\n\n const needsAndOperator = (\n token: string,\n index: number,\n searchQuery: string[],\n ) =>\n isWrappedInQuotes(token) ||\n (index === 1 && isWrappedInQuotes(searchQuery[0]));\n\n const generateSearchQuery = (searchQuery: string[]) => {\n if (searchQuery.length === 0) {\n updateQuery(\"\");\n return;\n }\n\n let generatedSearchQuery = `SELECT be.ECInstanceId, be.ECClassId FROM bis.geometricelement3d be `;\n generatedSearchQuery += `LEFT JOIN bis.SpatialCategory cat ON be.Category.Id = cat.ECInstanceID LEFT JOIN ecdbmeta.ECClassDef ecc ON be.ECClassId = ecc.ECInstanceId `;\n generatedSearchQuery += `LEFT JOIN bis.PhysicalType pt ON be.TypeDefinition.Id = pt.ECInstanceID`;\n generatedSearchQuery += ` WHERE `;\n generatedSearchQuery += `((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } be.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } be.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } cat.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } cat.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } ecc.name LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})`;\n // Physical Types\n generatedSearchQuery += ` OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } pt.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } pt.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) `;\n\n updateQuery(generatedSearchQuery);\n };\n\n return (\n <div className='gmw-search-form'>\n <Text>\n Generate a query by keywords. Keywords wrapped in double quotes will be\n considered a required criteria.\n </Text>\n <LabeledTextarea\n label='Query Keywords'\n required\n value={searchInput}\n onChange={(event) => setSearchInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"red\" chair`}\n />\n <div className='gmw-search-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button\n disabled={isUpdating}\n onClick={() =>\n generateSearchQuery(\n searchInput\n ? searchInput\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .trim()\n .split(\" \")\n : [],\n )\n }\n >\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setSearchInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n\n"]}
1
+ {"version":3,"file":"SearchGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/SearchGroupingCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,GACa,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,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;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,iBAAiB;QAC9B,oBAAC,KAAK,IAAC,IAAI,EAAC,eAAe,8GAGnB;QACR,oBAAC,eAAe,IACd,KAAK,EAAC,gBAAgB,EACtB,QAAQ,QACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,kBAAkB,GAC/B;QACF,6BAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,IAAI,oBAAC,cAAc,OAAG;YACjC,oBAAC,MAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,GAAG,EAAE,CACZ,mBAAmB,CACjB,WAAW;oBACT,CAAC,CAAC,WAAW;yBACV,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;yBAC7B,IAAI,EAAE;yBACN,KAAK,CAAC,GAAG,CAAC;oBACb,CAAC,CAAC,EAAE,CACP,YAII;YACT,oBAAC,MAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport { LoadingSpinner } from \"../utils\";\nimport \"./SearchGroupingCustomUI.scss\";\n\nexport const SearchGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const [searchInput, setSearchInput] = React.useState(\"\");\n const isWrappedInQuotes = (text: string) => {\n return text.startsWith(`\"`) && text.endsWith(`\"`);\n };\n\n const needsAndOperator = (\n token: string,\n index: number,\n searchQuery: string[],\n ) =>\n isWrappedInQuotes(token) ||\n (index === 1 && isWrappedInQuotes(searchQuery[0]));\n\n const generateSearchQuery = (searchQuery: string[]) => {\n if (searchQuery.length === 0) {\n updateQuery(\"\");\n return;\n }\n\n let generatedSearchQuery = `SELECT be.ECInstanceId, be.ECClassId FROM bis.geometricelement3d be `;\n generatedSearchQuery += `LEFT JOIN bis.SpatialCategory cat ON be.Category.Id = cat.ECInstanceID LEFT JOIN ecdbmeta.ECClassDef ecc ON be.ECClassId = ecc.ECInstanceId `;\n generatedSearchQuery += `LEFT JOIN bis.PhysicalType pt ON be.TypeDefinition.Id = pt.ECInstanceID`;\n generatedSearchQuery += ` WHERE `;\n generatedSearchQuery += `((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } be.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } be.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } cat.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } cat.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } ecc.name LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})`;\n // Physical Types\n generatedSearchQuery += ` OR ((${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } pt.codevalue LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")}) OR (${searchQuery\n .map(\n (token, index) =>\n `${index === 0\n ? \"\"\n : needsAndOperator(token, index, searchQuery)\n ? \"AND\"\n : \"OR\"\n } pt.userlabel LIKE '%${isWrappedInQuotes(token) ? token.slice(1, -1) : token\n }%'`,\n )\n .join(\" \")})) `;\n\n updateQuery(generatedSearchQuery);\n };\n\n return (\n <div className='gmw-search-form'>\n <Alert type='informational'>\n Generate a query by keywords. Keywords wrapped in double quotes will be\n considered a required criteria.\n </Alert>\n <LabeledTextarea\n label='Query Keywords'\n required\n value={searchInput}\n onChange={(event) => setSearchInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"red\" chair`}\n />\n <div className='gmw-search-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button\n disabled={isUpdating}\n onClick={() =>\n generateSearchQuery(\n searchInput\n ? searchInput\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .trim()\n .split(\" \")\n : [],\n )\n }\n >\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setSearchInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n\n"]}
@@ -8,6 +8,7 @@
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  gap: $iui-baseline;
11
+ overflow: auto;
11
12
  margin-top: $iui-baseline;
12
13
  > .gmw-search-actions {
13
14
  display: flex;
@@ -5,6 +5,6 @@ export declare const getGroupColor: (index: number) => string;
5
5
  export declare const getHiliteIdsFromGroups: (iModelConnection: IModelConnection, groups: Group[], hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<string[]>;
6
6
  export declare const hideGroups: (iModelConnection: IModelConnection, viewGroups: Group[], hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<void>;
7
7
  export declare const hideGroup: (iModelConnection: IModelConnection, viewGroup: Group, hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<void>;
8
- export declare const visualizeGroupColors: (iModelConnection: IModelConnection, groups: Group[], viewGroups: Group[], hiddenGroupsIds: string[], hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>, doEmphasizeElements?: boolean) => Promise<void>;
8
+ export declare const visualizeGroupColors: (iModelConnection: IModelConnection, groups: Group[], hiddenGroupsIds: Set<string>, hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>, doEmphasizeElements?: boolean) => Promise<void>;
9
9
  export declare const getHiliteIdsAndKeysetFromGroup: (iModelConnection: IModelConnection, group: Group, hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<QueryCacheItem>;
10
10
  //# sourceMappingURL=groupsHelpers.d.ts.map
@@ -38,21 +38,18 @@ export const hideGroup = async (iModelConnection, viewGroup, hilitedElementsQuer
38
38
  const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, viewGroup, hilitedElementsQueryCache);
39
39
  hideElements(result.ids);
40
40
  };
41
- export const visualizeGroupColors = async (iModelConnection, groups, viewGroups, hiddenGroupsIds, hilitedElementsQueryCache, doEmphasizeElements = true) => {
41
+ const processGroupVisualization = async (iModelConnection, group, hiddenGroupsIds, hilitedElementsQueryCache, doEmphasizeElements, groupColor) => {
42
+ const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);
43
+ const hilitedIds = result.ids;
44
+ overrideElements(hilitedIds, groupColor, FeatureOverrideType.ColorAndAlpha);
45
+ doEmphasizeElements && emphasizeElements(hilitedIds, undefined);
46
+ return hiddenGroupsIds.has(group.id) ? [] : hilitedIds;
47
+ };
48
+ export const visualizeGroupColors = async (iModelConnection, groups, hiddenGroupsIds, hilitedElementsQueryCache, doEmphasizeElements = true) => {
42
49
  clearEmphasizedOverriddenElements();
43
- let allIds = [];
44
- for (const group of viewGroups) {
45
- const index = viewGroups.length > groups.length
46
- ? viewGroups.findIndex((g) => g.id === group.id)
47
- : groups.findIndex((g) => g.id === group.id);
48
- const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);
49
- const hilitedIds = result.ids;
50
- overrideElements(hilitedIds, getGroupColor(index), FeatureOverrideType.ColorAndAlpha);
51
- doEmphasizeElements && emphasizeElements(hilitedIds, undefined);
52
- if (!hiddenGroupsIds.includes(group.id)) {
53
- allIds = allIds.concat(hilitedIds);
54
- }
55
- }
50
+ const allIdsPromises = groups.map(async (group, index) => processGroupVisualization(iModelConnection, group, hiddenGroupsIds, hilitedElementsQueryCache, doEmphasizeElements, getGroupColor(index)));
51
+ const allIdsArrays = await Promise.all(allIdsPromises);
52
+ const allIds = allIdsArrays.flat();
56
53
  await zoomToElements(allIds);
57
54
  };
58
55
  export const getHiliteIdsAndKeysetFromGroup = async (iModelConnection, group, hilitedElementsQueryCache) => {
@@ -1 +1 @@
1
- {"version":3,"file":"groupsHelpers.js","sourceRoot":"","sources":["../../../../src/widget/components/groupsHelpers.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM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N,OAAO,CAAC,QAAQ,CACd,8BAA8B,CAC/B,CAAC;QACF,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;KAC5C;AAEH,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport { FeatureOverrideType } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { Group } from \"@itwin/insights-client\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport type { QueryCacheItem } from \"./context/GroupHilitedElementsContext\";\nimport { clearEmphasizedOverriddenElements, emphasizeElements, getHiliteIds, hideElements, overrideElements, zoomToElements } from \"./viewerUtils\";\n\nconst goldenAngle = 180 * (3 - Math.sqrt(5));\n\nexport const getGroupColor = function (index: number) {\n return `hsl(${index * goldenAngle + 60}, 100%, 50%)`;\n};\n\nexport const getHiliteIdsFromGroups = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<{ ids: string[] }>[] = [];\n for (const group of groups) {\n if (!distinctQueries.has(group.query)) {\n distinctQueries.add(group.query);\n promises.push(getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache));\n }\n }\n const results = await Promise.all(promises);\n const allIds = results.flatMap((result) => result.ids);\n return allIds;\n};\n\nexport const hideGroups = async (\n iModelConnection: IModelConnection,\n viewGroups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<void>[] = [];\n\n for (const viewGroup of viewGroups) {\n if (!distinctQueries.has(viewGroup.query)) {\n distinctQueries.add(viewGroup.query);\n promises.push(hideGroup(iModelConnection, viewGroup, hilitedElementsQueryCache));\n }\n }\n await Promise.all(promises);\n};\n\nexport const hideGroup = async (\n iModelConnection: IModelConnection,\n viewGroup: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, viewGroup, hilitedElementsQueryCache);\n hideElements(result.ids);\n};\n\nexport const visualizeGroupColors = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n viewGroups: Group[],\n hiddenGroupsIds: string[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n doEmphasizeElements: boolean = true\n) => {\n clearEmphasizedOverriddenElements();\n let allIds: string[] = [];\n for (const group of viewGroups) {\n const index =\n viewGroups.length > groups.length\n ? viewGroups.findIndex((g) => g.id === group.id)\n : groups.findIndex((g) => g.id === group.id);\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);\n const hilitedIds = result.ids;\n overrideElements(\n hilitedIds,\n getGroupColor(index),\n FeatureOverrideType.ColorAndAlpha,\n );\n doEmphasizeElements && emphasizeElements(hilitedIds, undefined);\n if (!hiddenGroupsIds.includes(group.id)) {\n allIds = allIds.concat(hilitedIds);\n }\n }\n\n await zoomToElements(allIds);\n};\n\nexport const getHiliteIdsAndKeysetFromGroup = async (\n iModelConnection: IModelConnection,\n group: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const query = group.query;\n if (hilitedElementsQueryCache.current.has(query)) {\n return hilitedElementsQueryCache.current.get(query) ?? ({ keySet: new KeySet(), ids: [] });\n }\n try {\n const queryRowCount = await iModelConnection.queryRowCount(query);\n if (queryRowCount === 0) {\n toaster.warning(\n `${group.groupName}'s query is valid but produced no results.`\n );\n }\n const result = await getHiliteIds(query, iModelConnection);\n hilitedElementsQueryCache.current.set(query, result);\n return result;\n } catch {\n toaster.negative(\n `Query could not be resolved.`\n );\n return ({ keySet: new KeySet(), ids: [] });\n }\n\n};\n"]}
1
+ {"version":3,"file":"groupsHelpers.js","sourceRoot":"","sources":["../../../../src/widget/components/groupsHelpers.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,iCAAiC,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnJ,MAAM,WAAW,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,KAAa;IAClD,OAAO,OAAO,KAAK,GAAG,WAAW,GAAG,EAAE,cAAc,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,gBAAkC,EAClC,MAAe,EACf,yBAA8E,EAC9E,EAAE;IACF,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAC1C,MAAM,QAAQ,GAAiC,EAAE,CAAC;IAClD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACrC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjC,QAAQ,CAAC,IAAI,CAAC,8BAA8B,CAAC,gBAAgB,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC;SACnG;KACF;IACD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,OAAO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AC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClE,IAAI,aAAa,KAAK,CAAC,EAAE;YACvB,OAAO,CAAC,OAAO,CACb,GAAG,KAAK,CAAC,SAAS,4CAA4C,CAC/D,CAAC;SACH;QACD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;QAC3D,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrD,OAAO,MAAM,CAAC;KACf;IAAC,MAAM;QACN,OAAO,CAAC,QAAQ,CACd,8BAA8B,CAC/B,CAAC;QACF,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;KAC5C;AAEH,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport { FeatureOverrideType } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { Group } from \"@itwin/insights-client\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport type { QueryCacheItem } from \"./context/GroupHilitedElementsContext\";\nimport { clearEmphasizedOverriddenElements, emphasizeElements, getHiliteIds, hideElements, overrideElements, zoomToElements } from \"./viewerUtils\";\n\nconst goldenAngle = 180 * (3 - Math.sqrt(5));\n\nexport const getGroupColor = function (index: number) {\n return `hsl(${index * goldenAngle + 60}, 100%, 50%)`;\n};\n\nexport const getHiliteIdsFromGroups = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<{ ids: string[] }>[] = [];\n for (const group of groups) {\n if (!distinctQueries.has(group.query)) {\n distinctQueries.add(group.query);\n promises.push(getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache));\n }\n }\n const results = await Promise.all(promises);\n const allIds = results.flatMap((result) => result.ids);\n return allIds;\n};\n\nexport const hideGroups = async (\n iModelConnection: IModelConnection,\n viewGroups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<void>[] = [];\n\n for (const viewGroup of viewGroups) {\n if (!distinctQueries.has(viewGroup.query)) {\n distinctQueries.add(viewGroup.query);\n promises.push(hideGroup(iModelConnection, viewGroup, hilitedElementsQueryCache));\n }\n }\n await Promise.all(promises);\n};\n\nexport const hideGroup = async (\n iModelConnection: IModelConnection,\n viewGroup: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, viewGroup, hilitedElementsQueryCache);\n hideElements(result.ids);\n};\n\nconst processGroupVisualization = async (\n iModelConnection: IModelConnection,\n group: Group,\n hiddenGroupsIds: Set<string>,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n doEmphasizeElements: boolean,\n groupColor: string\n) => {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);\n const hilitedIds = result.ids;\n overrideElements(hilitedIds, groupColor, FeatureOverrideType.ColorAndAlpha);\n\n doEmphasizeElements && emphasizeElements(hilitedIds, undefined);\n\n return hiddenGroupsIds.has(group.id) ? [] : hilitedIds;\n};\n\nexport const visualizeGroupColors = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n hiddenGroupsIds: Set<string>,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n doEmphasizeElements: boolean = true\n) => {\n clearEmphasizedOverriddenElements();\n\n const allIdsPromises = groups.map(async (group, index) =>\n processGroupVisualization(\n iModelConnection,\n group,\n hiddenGroupsIds,\n hilitedElementsQueryCache,\n doEmphasizeElements,\n getGroupColor(index)\n )\n );\n\n const allIdsArrays = await Promise.all(allIdsPromises);\n const allIds = allIdsArrays.flat();\n\n await zoomToElements(allIds);\n};\n\nexport const getHiliteIdsAndKeysetFromGroup = async (\n iModelConnection: IModelConnection,\n group: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const query = group.query;\n if (hilitedElementsQueryCache.current.has(query)) {\n return hilitedElementsQueryCache.current.get(query) ?? ({ keySet: new KeySet(), ids: [] });\n }\n try {\n const queryRowCount = await iModelConnection.queryRowCount(query);\n if (queryRowCount === 0) {\n toaster.warning(\n `${group.groupName}'s query is valid but produced no results.`\n );\n }\n const result = await getHiliteIds(query, iModelConnection);\n hilitedElementsQueryCache.current.set(query, result);\n return result;\n } catch {\n toaster.negative(\n `Query could not be resolved.`\n );\n return ({ keySet: new KeySet(), ids: [] });\n }\n\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import "./utils.scss";
2
2
  import React from "react";
3
3
  import type { IModelConnection } from "@itwin/core-frontend";
4
- export declare const handleInputChange: <T>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: React.Dispatch<React.SetStateAction<T>>) => void;
4
+ export declare const handleInputChange: <T>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: (newValues: T) => void) => void;
5
5
  export declare const fetchIdsFromQuery: (query: string, iModelConnection: IModelConnection) => Promise<string[]>;
6
6
  export declare const handleError: (errorStatus: number) => void;
7
7
  export declare const LoadingOverlay: () => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM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,SAAS,EAAC,qBAAqB;QAClC,oBAAC,cAAc,IAAC,IAAI,EAAC,OAAO,EAAC,aAAa,SAAG,CACzC,CACP,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport { ProgressRadial, Text, toaster } from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { QueryRowFormat } from \"@itwin/core-common\";\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: React.Dispatch<React.SetStateAction<T>>,\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const fetchIdsFromQuery = async (\n query: string,\n iModelConnection: IModelConnection,\n) => {\n if (query === \"\") {\n return [];\n }\n const ids: string[] = [];\n const rowIterator = iModelConnection.query(query, undefined, {\n rowFormat: QueryRowFormat.UseJsPropertyNames,\n });\n while (true) {\n const { done, value } = await rowIterator.next();\n if (done) {\n break;\n }\n if (Object.keys(value).includes(\"id\")) {\n ids.push(value.id);\n } else if (Object.keys(value).includes(\"element.id\")) {\n ids.push(value[\"element.id\"]);\n } else if (Object.keys(value).includes(\"eCInstanceId\")) {\n ids.push(value.eCInstanceId);\n }\n }\n return ids;\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = \"Error! \";\n switch (errorStatus) {\n case 401:\n errorMessage += `You are unauthorized to do this operation.`;\n break;\n case 403:\n errorMessage += `You don't have permission to access the requested resource.`;\n break;\n case 404:\n errorMessage += `The requested resource was not found.`;\n break;\n case 409:\n errorMessage += `This property name is already being used.`;\n break;\n case 422:\n errorMessage += `Unable to process the request.`;\n break;\n case 429:\n errorMessage += `Too many requests.`;\n break;\n case 500:\n errorMessage += `Internal server error.`;\n break;\n case 502:\n errorMessage += `Bad gateway.`;\n break;\n case 503:\n errorMessage += `Service unavailable.`;\n break;\n default:\n errorMessage += `Something went wrong!`;\n }\n toaster.negative(errorMessage);\n\n};\n\nexport const LoadingOverlay = () => (\n <div className='gmw-center-overlay'>\n <Text>Loading</Text>\n <ProgressRadial indeterminate />\n <Text>Please wait...</Text>\n </div>\n);\n\ninterface EmptyMessageProps {\n message: string;\n}\n\nexport const EmptyMessage = ({ message }: EmptyMessageProps) => (\n <div className='gmw-center-overlay'>\n <Text>{message}</Text>\n </div>\n);\n\nexport const LoadingSpinner = () => {\n return (\n <div className=\"gmw-loading-spinner\">\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,CAAsC,EACtC,MAAS,EACT,SAAiC,EACjC,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;IAEjC,SAAS,CAAC;QACR,GAAG,MAAM;QACT,CAAC,IAAI,CAAC,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACpC,KAAa,EACb,gBAAkC,EAClC,EAAE;IACF,IAAI,KAAK,KAAK,EAAE,EAAE;QAChB,OAAO,EAAE,CAAC;KACX;IACD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE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AI,wBAAwB,CAAC;YACzC,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,cAAc,CAAC;YAC/B,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,sBAAsB,CAAC;YACvC,MAAM;QACR;YACE,YAAY,IAAI,uBAAuB,CAAC;KAC3C;IACD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAEjC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAClC,6BAAK,SAAS,EAAC,oBAAoB;IACjC,oBAAC,IAAI,kBAAe;IACpB,oBAAC,cAAc,IAAC,aAAa,SAAG;IAChC,oBAAC,IAAI,yBAAsB,CACvB,CACP,CAAC;AAMF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,OAAO,EAAqB,EAAE,EAAE,CAAC,CAC9D,6BAAK,SAAS,EAAC,oBAAoB;IACjC,oBAAC,IAAI,QAAE,OAAO,CAAQ,CAClB,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CACL,6BAAK,SAAS,EAAC,qBAAqB;QAClC,oBAAC,cAAc,IAAC,IAAI,EAAC,OAAO,EAAC,aAAa,SAAG,CACzC,CACP,CAAC;AACJ,CAAC,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*--------------------------------------------------------------------------------------------*/\nimport { ProgressRadial, Text, toaster } from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { QueryRowFormat } from \"@itwin/core-common\";\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: (newValues: T) => void,\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const fetchIdsFromQuery = async (\n query: string,\n iModelConnection: IModelConnection,\n) => {\n if (query === \"\") {\n return [];\n }\n const ids: string[] = [];\n const rowIterator = iModelConnection.query(query, undefined, {\n rowFormat: QueryRowFormat.UseJsPropertyNames,\n });\n while (true) {\n const { done, value } = await rowIterator.next();\n if (done) {\n break;\n }\n if (Object.keys(value).includes(\"id\")) {\n ids.push(value.id);\n } else if (Object.keys(value).includes(\"element.id\")) {\n ids.push(value[\"element.id\"]);\n } else if (Object.keys(value).includes(\"eCInstanceId\")) {\n ids.push(value.eCInstanceId);\n }\n }\n return ids;\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = \"Error! \";\n switch (errorStatus) {\n case 401:\n errorMessage += `You are unauthorized to do this operation.`;\n break;\n case 403:\n errorMessage += `You don't have permission to access the requested resource.`;\n break;\n case 404:\n errorMessage += `The requested resource was not found.`;\n break;\n case 409:\n errorMessage += `This property name is already being used.`;\n break;\n case 422:\n errorMessage += `Unable to process the request.`;\n break;\n case 429:\n errorMessage += `Too many requests.`;\n break;\n case 500:\n errorMessage += `Internal server error.`;\n break;\n case 502:\n errorMessage += `Bad gateway.`;\n break;\n case 503:\n errorMessage += `Service unavailable.`;\n break;\n default:\n errorMessage += `Something went wrong!`;\n }\n toaster.negative(errorMessage);\n\n};\n\nexport const LoadingOverlay = () => (\n <div className='gmw-center-overlay'>\n <Text>Loading</Text>\n <ProgressRadial indeterminate />\n <Text>Please wait...</Text>\n </div>\n);\n\ninterface EmptyMessageProps {\n message: string;\n}\n\nexport const EmptyMessage = ({ message }: EmptyMessageProps) => (\n <div className='gmw-center-overlay'>\n <Text>{message}</Text>\n </div>\n);\n\nexport const LoadingSpinner = () => {\n return (\n <div className=\"gmw-loading-spinner\">\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/grouping-mapping-widget",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
5
5
  "keywords": [
6
6
  "Bentley",
@@ -1,32 +0,0 @@
1
- import * as React from "react";
2
- import type { PrimitiveRendererProps } from "./PrimitivePropertyRenderer";
3
- /** Properties of [[NonPrimitivePropertyRenderer]] React component
4
- * @public
5
- */
6
- export interface NonPrimitivePropertyRendererProps extends PrimitiveRendererProps {
7
- /** Can struct/array property be collapsed */
8
- isCollapsible?: boolean;
9
- }
10
- /** State of [[NonPrimitivePropertyRenderer]] React component
11
- * @internal
12
- */
13
- interface NonPrimitivePropertyRendererState {
14
- /** Is struct/array property expanded */
15
- isExpanded?: boolean;
16
- }
17
- /** React Component that renders struct and array properties
18
- * @public
19
- */
20
- export declare class NonPrimitivePropertyRenderer extends React.Component<NonPrimitivePropertyRendererProps, NonPrimitivePropertyRendererState> {
21
- /** @internal */
22
- readonly state: NonPrimitivePropertyRendererState;
23
- private _onExpanded;
24
- private _onCollapsed;
25
- private getLabel;
26
- private overrideArrayChildrenNames;
27
- private _renderPropertyForItem;
28
- /** @internal */
29
- render(): JSX.Element;
30
- }
31
- export {};
32
- //# sourceMappingURL=NonPrimitivePropertyRenderer.d.ts.map