@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
@@ -1 +1 @@
1
- {"version":3,"file":"MappingAction.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingAction.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,O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,CAAC,KAAK,EAAE,EAAE;wBAClB,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;oBAC3E,CAAC,GACD,CACO,CACP;QACN,oBAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,CAAC,MAAM,CAAC,IAAI,EAC9B,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,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 { Fieldset, LabeledInput, Small, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError, handleInputChange } from \"./utils\";\nimport \"./MappingAction.scss\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\nconst defaultDisplayStrings = {\n mappingDetails: \"Mapping Details\",\n};\n\nexport interface MappingActionProps {\n mapping?: Mapping;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const MappingAction = ({ mapping, onSaveSuccess, onClickCancel, displayStrings: userDisplayStrings }: MappingActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [values, setValues] = useState({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n extractionEnabled: mapping?.extractionEnabled ?? true,\n });\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n const displayStrings = { ...defaultDisplayStrings, ...userDisplayStrings };\n\n const onSave = async () => {\n try {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n setIsLoading(true);\n const accessToken = await getAccessToken();\n mapping\n ? await mappingClient.updateMapping(accessToken, iModelId, mapping.id, {\n mappingName: values.name,\n description: values.description,\n extractionEnabled: values.extractionEnabled,\n })\n : await mappingClient.createMapping(accessToken, iModelId, {\n mappingName: values.name,\n description: values.description,\n extractionEnabled: values.extractionEnabled,\n });\n setValues({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n extractionEnabled: mapping?.extractionEnabled ?? true,\n });\n onSaveSuccess();\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <>\n <div className='gmw-details-form-container'>\n <Fieldset legend={displayStrings.mappingDetails} className='gmw-details-form'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='name'\n name='name'\n label='Name'\n value={values.name}\n required\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", values.name, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", values.name, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledInput\n id='description'\n name='description'\n label='Description'\n value={values.description}\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n }}\n />\n <ToggleSwitch\n id='extractionEnabled'\n name='extractionEnabled'\n label='Extract data from iModel'\n labelPosition=\"right\"\n checked={values.extractionEnabled}\n onChange={(event) => {\n setValues({ ...values, extractionEnabled: event.currentTarget.checked });\n }}\n />\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={onClickCancel}\n isSavingDisabled={!values.name}\n isLoading={isLoading}\n />\n </>\n );\n};\n"]}
1
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EAAC,aAAa,EAClB,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;wBAClB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;oBAC9C,CAAC,GACD;gBACF,oBAAC,YAAY,IACX,EAAE,EAAC,mBAAmB,EACtB,IAAI,EAAC,mBAAmB,EACxB,KAAK,EAAC,0BAA0B,EAChC,aAAa,EAAC,OAAO,EACrB,OAAO,EAAE,MAAM,CAAC,iBAAiB,EACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;wBAClB,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;oBAC3E,CAAC,GACD,CACO,CACP;QACN,oBAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,CAAC,MAAM,CAAC,IAAI,EAC9B,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,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 { Fieldset, LabeledInput, Small, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError, handleInputChange } from \"./utils\";\nimport \"./MappingAction.scss\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\nconst defaultDisplayStrings = {\n mappingDetails: \"Mapping Details\",\n};\n\nexport interface MappingActionProps {\n mapping?: Mapping;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const MappingAction = ({ mapping, onSaveSuccess, onClickCancel, displayStrings: userDisplayStrings }: MappingActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [values, setValues] = useState({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n extractionEnabled: mapping?.extractionEnabled ?? true,\n });\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n const onSave = async () => {\n try {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n setIsLoading(true);\n const accessToken = await getAccessToken();\n mapping\n ? await mappingClient.updateMapping(accessToken, iModelId, mapping.id, {\n mappingName: values.name,\n description: values.description,\n extractionEnabled: values.extractionEnabled,\n })\n : await mappingClient.createMapping(accessToken, iModelId, {\n mappingName: values.name,\n description: values.description,\n extractionEnabled: values.extractionEnabled,\n });\n setValues({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n extractionEnabled: mapping?.extractionEnabled ?? true,\n });\n onSaveSuccess();\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <>\n <div className='gmw-details-form-container'>\n <Fieldset legend={displayStrings.mappingDetails} className='gmw-details-form'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='name'\n name='name'\n label='Name'\n value={values.name}\n required\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", values.name, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", values.name, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledInput\n id='description'\n name='description'\n label='Description'\n value={values.description}\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n }}\n />\n <ToggleSwitch\n id='extractionEnabled'\n name='extractionEnabled'\n label='Extract data from iModel'\n labelPosition=\"right\"\n checked={values.extractionEnabled}\n onChange={(event) => {\n setValues({ ...values, extractionEnabled: event.currentTarget.checked });\n }}\n />\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={onClickCancel}\n isSavingDisabled={!values.name}\n isLoading={isLoading}\n />\n </>\n );\n};\n"]}
@@ -18,7 +18,7 @@ export const MappingImportWizardModal = ({ show, setShow, onFinish, displayStrin
18
18
  const [selectedIModelId, setSelectedIModelId] = useState("");
19
19
  const [selectedMappings, setSelectedMappings] = useState([]);
20
20
  const [importing, setImporting] = useState(false);
21
- const displayStrings = { ...defaultDisplayStrings, ...userDisplayStrings };
21
+ const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
22
22
  const steps = useRef([
23
23
  {
24
24
  name: "Select source project",
@@ -1 +1 @@
1
- {"version":3,"file":"MappingImportWizardModal.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingImportWizardModal.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iCAAiC,CAAC;AACzC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,MAAM,qBAAqB,GAAG;IAC5B,QAAQ,EAAE,UAAU;CACr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AAW,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EACvD,SAAS,EAAC,wBAAwB;gCAElC,oBAAC,cAAc,IACb,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,CAAC,gBAAgB,EAAE,EAAE;wCAC7B,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;wCACtC,cAAc,CAAC,CAAC,CAAC,CAAC;oCACpB,CAAC,EACD,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,cAAc,EAAE,cAAc,GAC9B,CACE;4BACL,WAAW,KAAK,CAAC,IAAI,CACpB,oBAAC,oBAAoB,IACnB,cAAc,EAAE,gBAAgB,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,KAAK,IAAI,EAAE;oCACnB,MAAM,OAAO,EAAE,CAAC;oCAChB,YAAY,CAAC,KAAK,CAAC,CAAC;gCACtB,CAAC,EACD,cAAc,EAAE,cAAc,GAC9B,CACH,CACA,CACJ,CAAC;oBACJ;wBACE,OAAO,IAAI,CAAC;iBACf;YACH,CAAC,CAAC,EAAE,CACA,CACA,CACT,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, { useRef, useState } from \"react\";\nimport type { StepProperties } from \"@itwin/itwinui-react\";\nimport { Modal, Wizard } from \"@itwin/itwinui-react\";\nimport SelectProject from \"./SelectProject\";\nimport \"./MappingImportWizardModal.scss\";\nimport SelectIModel from \"./SelectIModel\";\nimport SelectMappings from \"./SelectMappings\";\nimport type { IMappingTyped } from \"./Mapping\";\nimport ConfirmMappingImport from \"./ConfirmMappingsImport\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n};\ninterface MappingImportWizardModalProps {\n show: boolean;\n setShow: React.Dispatch<React.SetStateAction<boolean>>;\n onFinish: () => Promise<void>;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const MappingImportWizardModal = ({\n show,\n setShow,\n onFinish,\n displayStrings: userDisplayStrings,\n}: MappingImportWizardModalProps) => {\n const [currentStep, setCurrentStep] = useState<number>(0);\n const [selectedProjectId, setSelectedProjectId] = useState<string>(\"\");\n const [selectedIModelId, setSelectedIModelId] = useState<string>(\"\");\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [importing, setImporting] = useState<boolean>(false);\n\n const displayStrings = { ...defaultDisplayStrings, ...userDisplayStrings };\n\n const steps = useRef<StepProperties[]>([\n {\n name: \"Select source project\",\n description: `Select the source project to bring your ${displayStrings.mappings} from.`,\n },\n {\n name: \"Select iModel\",\n description: \"Select an iModel within the project you have selected.\",\n },\n {\n name: `Select ${displayStrings.mappings}`,\n description: `Select one or more ${displayStrings.mappings} to import.`,\n },\n {\n name: \"Rename & Confirm\",\n description:\n \"Rename and confirm your selections. Click import when finished.\",\n },\n ]);\n\n const onClose = async () => {\n setShow(false);\n setCurrentStep(0);\n await onFinish();\n };\n\n return (\n <Modal\n title={`Import ${displayStrings.mappings}`}\n modalRootId='grouping-mapping-widget'\n isOpen={show}\n closeOnEsc={false}\n closeOnExternalClick={false}\n isDismissible={!importing}\n styleType='fullPage'\n onClose={async () => {\n await onClose();\n }}\n >\n <div className='gmw-import-wizard-body-container'>\n <Wizard\n currentStep={currentStep}\n steps={steps.current}\n onStepClick={\n importing ? undefined : (index: number) => setCurrentStep(index)\n }\n />\n\n {(() => {\n switch (currentStep) {\n case 0:\n return (\n <SelectProject\n onSelect={(project) => {\n setSelectedProjectId(project.id);\n setCurrentStep(1);\n }}\n onCancel={onClose}\n />\n );\n case 1:\n return (\n <SelectIModel\n projectId={selectedProjectId}\n onSelect={(iModel) => {\n setSelectedIModelId(iModel.id);\n setCurrentStep(2);\n }}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n />\n );\n case 2:\n case 3:\n // Preserve table state within Select Mappings\n return (\n <>\n <div\n style={{ display: currentStep === 2 ? \"flex\" : \"none\" }}\n className=\"gmw-mappings-container\"\n >\n <SelectMappings\n iModelId={selectedIModelId}\n onSelect={(selectedMappings) => {\n setSelectedMappings(selectedMappings);\n setCurrentStep(3);\n }}\n onCancel={onClose}\n backFn={() => setCurrentStep(currentStep - 1)}\n displayStrings={displayStrings}\n />\n </div>\n {currentStep === 3 && (\n <ConfirmMappingImport\n sourceiModelId={selectedIModelId}\n selectedMappings={selectedMappings}\n importing={importing}\n setImporting={setImporting}\n setSelectedMappings={setSelectedMappings}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n onFinish={async () => {\n await onClose();\n setImporting(false);\n }}\n displayStrings={displayStrings}\n />\n )}\n </>\n );\n default:\n return null;\n }\n })()}\n </div>\n </Modal>\n );\n};\n"]}
1
+ {"version":3,"file":"MappingImportWizardModal.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingImportWizardModal.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iCAAiC,CAAC;AACzC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,MAAM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CACH,CAAC;oBACJ,KAAK,CAAC,CAAC;oBACP,KAAK,CAAC;wBACJ,8CAA8C;wBAC9C,OAAO,CACL;4BACE,6BACE,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EACvD,SAAS,EAAC,wBAAwB;gCAElC,oBAAC,cAAc,IACb,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,CAAC,gBAAgB,EAAE,EAAE;wCAC7B,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;wCACtC,cAAc,CAAC,CAAC,CAAC,CAAC;oCACpB,CAAC,EACD,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,cAAc,EAAE,cAAc,GAC9B,CACE;4BACL,WAAW,KAAK,CAAC,IAAI,CACpB,oBAAC,oBAAoB,IACnB,cAAc,EAAE,gBAAgB,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,KAAK,IAAI,EAAE;oCACnB,MAAM,OAAO,EAAE,CAAC;oCAChB,YAAY,CAAC,KAAK,CAAC,CAAC;gCACtB,CAAC,EACD,cAAc,EAAE,cAAc,GAC9B,CACH,CACA,CACJ,CAAC;oBACJ;wBACE,OAAO,IAAI,CAAC;iBACf;YACH,CAAC,CAAC,EAAE,CACA,CACA,CACT,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, { useRef, useState } from \"react\";\nimport type { StepProperties } from \"@itwin/itwinui-react\";\nimport { Modal, Wizard } from \"@itwin/itwinui-react\";\nimport SelectProject from \"./SelectProject\";\nimport \"./MappingImportWizardModal.scss\";\nimport SelectIModel from \"./SelectIModel\";\nimport SelectMappings from \"./SelectMappings\";\nimport type { IMappingTyped } from \"./Mapping\";\nimport ConfirmMappingImport from \"./ConfirmMappingsImport\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n};\ninterface MappingImportWizardModalProps {\n show: boolean;\n setShow: React.Dispatch<React.SetStateAction<boolean>>;\n onFinish: () => Promise<void>;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const MappingImportWizardModal = ({\n show,\n setShow,\n onFinish,\n displayStrings: userDisplayStrings,\n}: MappingImportWizardModalProps) => {\n const [currentStep, setCurrentStep] = useState<number>(0);\n const [selectedProjectId, setSelectedProjectId] = useState<string>(\"\");\n const [selectedIModelId, setSelectedIModelId] = useState<string>(\"\");\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [importing, setImporting] = useState<boolean>(false);\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n const steps = useRef<StepProperties[]>([\n {\n name: \"Select source project\",\n description: `Select the source project to bring your ${displayStrings.mappings} from.`,\n },\n {\n name: \"Select iModel\",\n description: \"Select an iModel within the project you have selected.\",\n },\n {\n name: `Select ${displayStrings.mappings}`,\n description: `Select one or more ${displayStrings.mappings} to import.`,\n },\n {\n name: \"Rename & Confirm\",\n description:\n \"Rename and confirm your selections. Click import when finished.\",\n },\n ]);\n\n const onClose = async () => {\n setShow(false);\n setCurrentStep(0);\n await onFinish();\n };\n\n return (\n <Modal\n title={`Import ${displayStrings.mappings}`}\n modalRootId='grouping-mapping-widget'\n isOpen={show}\n closeOnEsc={false}\n closeOnExternalClick={false}\n isDismissible={!importing}\n styleType='fullPage'\n onClose={async () => {\n await onClose();\n }}\n >\n <div className='gmw-import-wizard-body-container'>\n <Wizard\n currentStep={currentStep}\n steps={steps.current}\n onStepClick={\n importing ? undefined : (index: number) => setCurrentStep(index)\n }\n />\n\n {(() => {\n switch (currentStep) {\n case 0:\n return (\n <SelectProject\n onSelect={(project) => {\n setSelectedProjectId(project.id);\n setCurrentStep(1);\n }}\n onCancel={onClose}\n />\n );\n case 1:\n return (\n <SelectIModel\n projectId={selectedProjectId}\n onSelect={(iModel) => {\n setSelectedIModelId(iModel.id);\n setCurrentStep(2);\n }}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n />\n );\n case 2:\n case 3:\n // Preserve table state within Select Mappings\n return (\n <>\n <div\n style={{ display: currentStep === 2 ? \"flex\" : \"none\" }}\n className=\"gmw-mappings-container\"\n >\n <SelectMappings\n iModelId={selectedIModelId}\n onSelect={(selectedMappings) => {\n setSelectedMappings(selectedMappings);\n setCurrentStep(3);\n }}\n onCancel={onClose}\n backFn={() => setCurrentStep(currentStep - 1)}\n displayStrings={displayStrings}\n />\n </div>\n {currentStep === 3 && (\n <ConfirmMappingImport\n sourceiModelId={selectedIModelId}\n selectedMappings={selectedMappings}\n importing={importing}\n setImporting={setImporting}\n setSelectedMappings={setSelectedMappings}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n onFinish={async () => {\n await onClose();\n setImporting(false);\n }}\n displayStrings={displayStrings}\n />\n )}\n </>\n );\n default:\n return null;\n }\n })()}\n </div>\n </Modal>\n );\n};\n"]}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { PropertyRecord } from "@itwin/appui-abstract";
3
+ import "./PropertyAction.scss";
4
+ export interface PropertyActionProps {
5
+ property: PropertyRecord;
6
+ }
7
+ export declare const PropertyAction: ({ property }: PropertyActionProps) => JSX.Element;
8
+ //# sourceMappingURL=PropertyAction.d.ts.map
@@ -0,0 +1,77 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import React, { useCallback, useEffect, useState } from "react";
6
+ import { PropertyValueFormat } from "@itwin/appui-abstract";
7
+ import { usePropertyGridWrapper } from "./context/PropertyGridWrapperContext";
8
+ import { Checkbox } from "@itwin/itwinui-react";
9
+ import "./PropertyAction.scss";
10
+ const usePropertySelection = (property, currentPropertyList, queryBuilder) => {
11
+ const [isCheckboxLoading, setIsCheckboxLoading] = useState(false);
12
+ const checkIfPropertyIsSelected = useCallback((property) => {
13
+ if (property.value.valueFormat === PropertyValueFormat.Primitive) {
14
+ return currentPropertyList.includes(property);
15
+ }
16
+ if (property.value.valueFormat === PropertyValueFormat.Array) {
17
+ return (property.value.items.length === 0 &&
18
+ currentPropertyList.includes(property));
19
+ }
20
+ return Object.values(property.value.members).every((subProp) => checkIfPropertyIsSelected(subProp));
21
+ }, [currentPropertyList]);
22
+ const isPropertySelected = checkIfPropertyIsSelected(property);
23
+ const addProperty = useCallback(async (prop) => {
24
+ if (prop.value.valueFormat === PropertyValueFormat.Primitive &&
25
+ !currentPropertyList.includes(prop) &&
26
+ (await (queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.addProperty(prop)))) {
27
+ setIsCheckboxLoading(false);
28
+ return true;
29
+ }
30
+ return false;
31
+ }, [currentPropertyList, queryBuilder]);
32
+ const removeProperty = useCallback(async (prop) => {
33
+ if (currentPropertyList.includes(prop)) {
34
+ await (queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.removeProperty(prop));
35
+ setIsCheckboxLoading(false);
36
+ }
37
+ }, [currentPropertyList, queryBuilder]);
38
+ return {
39
+ isPropertySelected,
40
+ addProperty,
41
+ removeProperty,
42
+ isCheckboxLoading,
43
+ setIsCheckboxLoading,
44
+ };
45
+ };
46
+ export const PropertyAction = ({ property }) => {
47
+ const { currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery, isUpdating, } = usePropertyGridWrapper();
48
+ const { isPropertySelected, addProperty, removeProperty, isCheckboxLoading, setIsCheckboxLoading, } = usePropertySelection(property, currentPropertyList, queryBuilder);
49
+ useEffect(() => {
50
+ setIsCheckboxLoading(isPropertySelected && isUpdating);
51
+ }, [isPropertySelected, isUpdating, setIsCheckboxLoading]);
52
+ const onPropertySelectionChanged = useCallback(async () => {
53
+ var _a, _b;
54
+ if (isPropertySelected) {
55
+ await removeProperty(property);
56
+ setCurrentPropertyList((prevList) => prevList.filter((x) => x !== property));
57
+ setQuery((_a = queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.buildQueryString()) !== null && _a !== void 0 ? _a : "");
58
+ }
59
+ else {
60
+ if (await addProperty(property)) {
61
+ setCurrentPropertyList((prevList) => prevList.concat(property));
62
+ setQuery((_b = queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.buildQueryString()) !== null && _b !== void 0 ? _b : "");
63
+ }
64
+ }
65
+ }, [
66
+ addProperty,
67
+ isPropertySelected,
68
+ property,
69
+ removeProperty,
70
+ queryBuilder,
71
+ setCurrentPropertyList,
72
+ setQuery,
73
+ ]);
74
+ return (React.createElement("div", { className: "gmw-property-selection-checkbox" }, property.value.valueFormat === PropertyValueFormat.Primitive &&
75
+ property.value.value !== undefined && (React.createElement(Checkbox, { checked: isPropertySelected, onChange: onPropertySelectionChanged, disabled: isUpdating, isLoading: isCheckboxLoading }))));
76
+ };
77
+ //# sourceMappingURL=PropertyAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyAction.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCA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C,CAAC,QAAQ,EAAE,EAAE,CAClC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CACvC,CAAC;YACF,QAAQ,CAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,gBAAgB,EAAE,mCAAI,EAAE,CAAC,CAAC;SAClD;aAAM;YACL,IAAI,MAAM,WAAW,CAAC,QAAQ,CAAC,EAAE;gBAC/B,sBAAsB,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAChE,QAAQ,CAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,gBAAgB,EAAE,mCAAI,EAAE,CAAC,CAAC;aAClD;SACF;IACH,CAAC,EAAE;QACD,WAAW;QACX,kBAAkB;QAClB,QAAQ;QACR,cAAc;QACd,YAAY;QACZ,sBAAsB;QACtB,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC,IAC7C,QAAQ,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS;QAC3D,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,CACtC,oBAAC,QAAQ,IACP,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,iBAAiB,GAC5B,CACH,CACG,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, useState } from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { usePropertyGridWrapper } from \"./context/PropertyGridWrapperContext\";\nimport { Checkbox } from \"@itwin/itwinui-react\";\nimport \"./PropertyAction.scss\";\nimport type { QueryBuilder } from \"./QueryBuilder\";\n\nexport interface PropertyActionProps {\n property: PropertyRecord;\n}\n\nconst usePropertySelection = (\n property: PropertyRecord,\n currentPropertyList: PropertyRecord[],\n queryBuilder: QueryBuilder | undefined\n) => {\n const [isCheckboxLoading, setIsCheckboxLoading] = useState(false);\n\n const checkIfPropertyIsSelected = useCallback(\n (property: PropertyRecord): boolean => {\n if (property.value.valueFormat === PropertyValueFormat.Primitive) {\n return currentPropertyList.includes(property);\n }\n\n if (property.value.valueFormat === PropertyValueFormat.Array) {\n return (\n property.value.items.length === 0 &&\n currentPropertyList.includes(property)\n );\n }\n return Object.values(property.value.members).every(\n (subProp: PropertyRecord) => checkIfPropertyIsSelected(subProp)\n );\n },\n [currentPropertyList]\n );\n\n const isPropertySelected = checkIfPropertyIsSelected(property);\n\n const addProperty = useCallback(\n async (prop: PropertyRecord) => {\n if (\n prop.value.valueFormat === PropertyValueFormat.Primitive &&\n !currentPropertyList.includes(prop) &&\n (await queryBuilder?.addProperty(prop))\n ) {\n setIsCheckboxLoading(false);\n return true;\n }\n return false;\n },\n [currentPropertyList, queryBuilder]\n );\n\n const removeProperty = useCallback(\n async (prop: PropertyRecord) => {\n if (currentPropertyList.includes(prop)) {\n await queryBuilder?.removeProperty(prop);\n setIsCheckboxLoading(false);\n }\n },\n [currentPropertyList, queryBuilder]\n );\n\n return {\n isPropertySelected,\n addProperty,\n removeProperty,\n isCheckboxLoading,\n setIsCheckboxLoading,\n };\n};\n\nexport const PropertyAction = ({ property }: PropertyActionProps) => {\n const {\n currentPropertyList,\n queryBuilder,\n setCurrentPropertyList,\n setQuery,\n isUpdating,\n } = usePropertyGridWrapper();\n\n const {\n isPropertySelected,\n addProperty,\n removeProperty,\n isCheckboxLoading,\n setIsCheckboxLoading,\n } = usePropertySelection(property, currentPropertyList, queryBuilder);\n\n useEffect(() => {\n setIsCheckboxLoading(isPropertySelected && isUpdating);\n }, [isPropertySelected, isUpdating, setIsCheckboxLoading]);\n\n const onPropertySelectionChanged = useCallback(async () => {\n if (isPropertySelected) {\n await removeProperty(property);\n setCurrentPropertyList((prevList) =>\n prevList.filter((x) => x !== property)\n );\n setQuery(queryBuilder?.buildQueryString() ?? \"\");\n } else {\n if (await addProperty(property)) {\n setCurrentPropertyList((prevList) => prevList.concat(property));\n setQuery(queryBuilder?.buildQueryString() ?? \"\");\n }\n }\n }, [\n addProperty,\n isPropertySelected,\n property,\n removeProperty,\n queryBuilder,\n setCurrentPropertyList,\n setQuery,\n ]);\n\n return (\n <div className=\"gmw-property-selection-checkbox\">\n {property.value.valueFormat === PropertyValueFormat.Primitive &&\n property.value.value !== undefined && (\n <Checkbox\n checked={isPropertySelected}\n onChange={onPropertySelectionChanged}\n disabled={isUpdating}\n isLoading={isCheckboxLoading}\n />\n )}\n </div>\n );\n};\n"]}
@@ -0,0 +1,9 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ .gmw-property-selection-checkbox {
7
+ display: flex;
8
+ justify-content: center;
9
+ }
@@ -4,7 +4,6 @@ import type { CalculatedProperty, CustomCalculation, Group, GroupProperty, Mappi
4
4
  export interface PropertyMenuProps {
5
5
  mapping: Mapping;
6
6
  group: Group;
7
- color: string;
8
7
  onClickAddGroupProperty?: () => void;
9
8
  onClickModifyGroupProperty?: (groupProperty: GroupProperty) => void;
10
9
  onClickAddCalculatedProperty?: () => void;
@@ -15,5 +14,5 @@ export interface PropertyMenuProps {
15
14
  hideCalculatedProps?: boolean;
16
15
  hideCustomCalculationProps?: boolean;
17
16
  }
18
- export declare const PropertyMenu: ({ mapping, group, color, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps, hideCalculatedProps, hideCustomCalculationProps, }: PropertyMenuProps) => JSX.Element;
17
+ export declare const PropertyMenu: ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps, hideCalculatedProps, hideCustomCalculationProps, }: PropertyMenuProps) => JSX.Element;
19
18
  //# sourceMappingURL=PropertyMenu.d.ts.map
@@ -2,33 +2,21 @@
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 { Presentation } from "@itwin/presentation-frontend";
6
- import { useActiveIModelConnection } from "@itwin/appui-react";
7
- import React, { useEffect, useMemo, useState } from "react";
8
- import { clearEmphasizedOverriddenElements, visualizeElements, zoomToElements, } from "./viewerUtils";
5
+ import React, { useMemo } from "react";
9
6
  import "./PropertyMenu.scss";
10
7
  import { GroupPropertyTable } from "./GroupPropertyTable";
11
- import { IconButton, InformationPanelWrapper, toaster, ToggleSwitch, } from "@itwin/itwinui-react";
12
8
  import { useCombinedFetchRefresh } from "../hooks/useFetchData";
13
9
  import { useMappingClient } from "./context/MappingClientContext";
14
10
  import { useGroupingMappingApiConfig } from "./context/GroupingApiConfigContext";
15
- import { getHiliteIdsAndKeysetFromGroup } from "./groupsHelpers";
16
- import { useGroupHilitedElementsContext } from "./context/GroupHilitedElementsContext";
17
11
  import { usePropertiesContext } from "./context/PropertiesContext";
18
12
  import { CalculatedPropertyTable } from "./CalculatedPropertyTable";
19
13
  import { CustomCalculationTable } from "./CustomCalculationTable";
20
- import { SvgProperties } from "@itwin/itwinui-icons-react";
21
- import { GroupInformationPanel } from "./GroupInformationPanel";
22
- export const PropertyMenu = ({ mapping, group, color, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps = false, hideCalculatedProps = false, hideCustomCalculationProps = false, }) => {
14
+ export const PropertyMenu = ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps = false, hideCalculatedProps = false, hideCustomCalculationProps = false, }) => {
23
15
  const groupId = group.id;
24
16
  const mappingId = mapping.id;
25
17
  const { getAccessToken, iModelId } = useGroupingMappingApiConfig();
26
- const { hilitedElementsQueryCache } = useGroupHilitedElementsContext();
27
18
  const mappingClient = useMappingClient();
28
- const iModelConnection = useActiveIModelConnection();
29
- const { showGroupColor, setShowGroupColor, groupProperties, setGroupProperties, calculatedProperties, setCalculatedProperties, customCalculationProperties, setCustomCalculationProperties, } = usePropertiesContext();
30
- const [isInformationPanelOpen, setIsInformationPanelOpen] = useState(false);
31
- const [isLoading, setIsLoading] = useState(false);
19
+ const { groupProperties, setGroupProperties, calculatedProperties, setCalculatedProperties, customCalculationProperties, setCustomCalculationProperties, } = usePropertiesContext();
32
20
  const fetchGroupProperties = useMemo(() => {
33
21
  return async () => mappingClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId);
34
22
  }, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
@@ -41,40 +29,9 @@ export const PropertyMenu = ({ mapping, group, color, onClickAddGroupProperty, o
41
29
  return async () => mappingClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId);
42
30
  }, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
43
31
  const { isLoading: isLoadingCustomCalculations, refreshData: refreshCustomCalculations } = useCombinedFetchRefresh(fetchCustomCalculations, setCustomCalculationProperties);
44
- useEffect(() => {
45
- const initialize = async () => {
46
- if (!iModelConnection)
47
- return;
48
- try {
49
- setIsLoading(true);
50
- clearEmphasizedOverriddenElements();
51
- if (showGroupColor) {
52
- const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);
53
- Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection);
54
- visualizeElements(result.ids, color);
55
- await zoomToElements(result.ids);
56
- }
57
- }
58
- catch (error) {
59
- toaster.negative("There was an error visualizing group.");
60
- /* eslint-disable no-console */
61
- console.error(error);
62
- }
63
- finally {
64
- setIsLoading(false);
65
- }
66
- };
67
- void initialize();
68
- }, [iModelConnection, group.query, group.groupName, group, hilitedElementsQueryCache, showGroupColor, color]);
69
- return (React.createElement(InformationPanelWrapper, { className: 'gmw-property-menu-wrapper' },
70
- React.createElement("div", { className: 'gmw-property-menu-container' },
71
- React.createElement("div", { className: "gmw-property-menu-toolbar" },
72
- React.createElement(ToggleSwitch, { label: 'Color Group', labelPosition: 'left', disabled: isLoading, checked: showGroupColor, onChange: () => setShowGroupColor((b) => !b) }),
73
- React.createElement(IconButton, { styleType: 'borderless', onClick: () => setIsInformationPanelOpen(true) },
74
- React.createElement(SvgProperties, null))),
75
- !hideGroupProps && (React.createElement(GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties !== null && groupProperties !== void 0 ? groupProperties : [], refresh: refreshGroupProperties })),
76
- !hideCalculatedProps && (React.createElement(CalculatedPropertyTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCalculatedProperty, onClickModify: onClickModifyCalculatedProperty, isLoading: isLoadingCalculatedProperties, calculatedProperties: calculatedProperties !== null && calculatedProperties !== void 0 ? calculatedProperties : [], refresh: refreshCalculatedProperties })),
77
- !hideCustomCalculationProps && (React.createElement(CustomCalculationTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCustomCalculationProperty, onClickModify: onClickModifyCustomCalculation, isLoading: isLoadingCustomCalculations, customCalculations: customCalculationProperties !== null && customCalculationProperties !== void 0 ? customCalculationProperties : [], refresh: refreshCustomCalculations }))),
78
- React.createElement(GroupInformationPanel, { isOpen: isInformationPanelOpen, onClose: () => setIsInformationPanelOpen(false), query: group.query, groupName: group.groupName })));
32
+ return (React.createElement("div", { className: 'gmw-property-menu-wrapper' },
33
+ !hideGroupProps && (React.createElement(GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties !== null && groupProperties !== void 0 ? groupProperties : [], refresh: refreshGroupProperties })),
34
+ !hideCalculatedProps && (React.createElement(CalculatedPropertyTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCalculatedProperty, onClickModify: onClickModifyCalculatedProperty, isLoading: isLoadingCalculatedProperties, calculatedProperties: calculatedProperties !== null && calculatedProperties !== void 0 ? calculatedProperties : [], refresh: refreshCalculatedProperties })),
35
+ !hideCustomCalculationProps && (React.createElement(CustomCalculationTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCustomCalculationProperty, onClickModify: onClickModifyCustomCalculation, isLoading: isLoadingCustomCalculations, customCalculations: customCalculationProperties !== null && customCalculationProperties !== void 0 ? customCalculationProperties : [], refresh: refreshCustomCalculations }))));
79
36
  };
80
37
  //# sourceMappingURL=PropertyMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EACL,iCAAiC,EACjC,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,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BAA2B,EACtC,kBAAkB,EAAE,2BAA2B,aAA3B,2BAA2B,cAA3B,2BAA2B,GAAI,EAAE,EACrD,OAAO,EAAE,yBAAyB,GAClC,CACH,CACG;QACN,oBAAC,qBAAqB,IACpB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAC/C,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,GAC1B,CACsB,CAC3B,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 { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React, { useEffect, useMemo, useState } from \"react\";\n\nimport {\n clearEmphasizedOverriddenElements,\n visualizeElements,\n zoomToElements,\n} from \"./viewerUtils\";\nimport \"./PropertyMenu.scss\";\nimport { GroupPropertyTable } from \"./GroupPropertyTable\";\nimport {\n IconButton,\n InformationPanelWrapper,\n toaster,\n ToggleSwitch,\n} from \"@itwin/itwinui-react\";\nimport { useCombinedFetchRefresh } from \"../hooks/useFetchData\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport type { CalculatedProperty, CustomCalculation, Group, GroupProperty, Mapping } from \"@itwin/insights-client\";\nimport { getHiliteIdsAndKeysetFromGroup } from \"./groupsHelpers\";\nimport { useGroupHilitedElementsContext } from \"./context/GroupHilitedElementsContext\";\nimport { usePropertiesContext } from \"./context/PropertiesContext\";\nimport { CalculatedPropertyTable } from \"./CalculatedPropertyTable\";\nimport { CustomCalculationTable } from \"./CustomCalculationTable\";\nimport { SvgProperties } from \"@itwin/itwinui-icons-react\";\nimport { GroupInformationPanel } from \"./GroupInformationPanel\";\n\nexport interface PropertyMenuProps {\n mapping: Mapping;\n group: Group;\n color: string;\n onClickAddGroupProperty?: () => void;\n onClickModifyGroupProperty?: (groupProperty: GroupProperty) => void;\n onClickAddCalculatedProperty?: () => void;\n onClickModifyCalculatedProperty?: (calculatedProperty: CalculatedProperty) => void;\n onClickAddCustomCalculationProperty?: () => void;\n onClickModifyCustomCalculation?: (customCalculation: CustomCalculation) => void;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\nexport const PropertyMenu = ({\n mapping,\n group,\n color,\n onClickAddGroupProperty,\n onClickModifyGroupProperty,\n onClickAddCalculatedProperty,\n onClickModifyCalculatedProperty,\n onClickAddCustomCalculationProperty,\n onClickModifyCustomCalculation,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyMenuProps) => {\n const groupId = group.id;\n const mappingId = mapping.id;\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const { hilitedElementsQueryCache } = useGroupHilitedElementsContext();\n const mappingClient = useMappingClient();\n const iModelConnection = useActiveIModelConnection();\n const {\n showGroupColor,\n setShowGroupColor,\n groupProperties,\n setGroupProperties,\n calculatedProperties,\n setCalculatedProperties,\n customCalculationProperties,\n setCustomCalculationProperties,\n } = usePropertiesContext();\n const [isInformationPanelOpen, setIsInformationPanelOpen] =\n useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n const fetchGroupProperties = useMemo(\n () => {\n return async () => mappingClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingGroupProperties, refreshData: refreshGroupProperties } =\n useCombinedFetchRefresh<GroupProperty>(fetchGroupProperties, setGroupProperties);\n\n const fetchCalculatedProperties = useMemo(\n () => {\n return async () => mappingClient.getCalculatedProperties(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCalculatedProperties, refreshData: refreshCalculatedProperties } =\n useCombinedFetchRefresh<CalculatedProperty>(fetchCalculatedProperties, setCalculatedProperties);\n\n const fetchCustomCalculations = useMemo(\n () => {\n return async () => mappingClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCustomCalculations, refreshData: refreshCustomCalculations } =\n useCombinedFetchRefresh<CustomCalculation>(fetchCustomCalculations, setCustomCalculationProperties);\n\n useEffect(() => {\n const initialize = async () => {\n if (!iModelConnection) return;\n try {\n setIsLoading(true);\n clearEmphasizedOverriddenElements();\n if (showGroupColor) {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n visualizeElements(result.ids, color);\n await zoomToElements(result.ids);\n }\n } catch (error) {\n toaster.negative(\"There was an error visualizing group.\");\n /* eslint-disable no-console */\n console.error(error);\n } finally {\n setIsLoading(false);\n }\n };\n void initialize();\n }, [iModelConnection, group.query, group.groupName, group, hilitedElementsQueryCache, showGroupColor, color]);\n\n return (\n <InformationPanelWrapper className='gmw-property-menu-wrapper'>\n <div className='gmw-property-menu-container'>\n <div className=\"gmw-property-menu-toolbar\">\n <ToggleSwitch\n label='Color Group'\n labelPosition='left'\n disabled={isLoading}\n checked={showGroupColor}\n onChange={() => setShowGroupColor((b) => !b)}\n ></ToggleSwitch>\n <IconButton\n styleType='borderless'\n onClick={() => setIsInformationPanelOpen(true)}\n >\n <SvgProperties />\n </IconButton>\n </div>\n {!hideGroupProps && (\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddGroupProperty}\n onClickModify={onClickModifyGroupProperty}\n isLoading={isLoadingGroupProperties}\n groupProperties={groupProperties ?? []}\n refresh={refreshGroupProperties}\n />\n )}\n {!hideCalculatedProps && (\n <CalculatedPropertyTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCalculatedProperty}\n onClickModify={onClickModifyCalculatedProperty}\n isLoading={isLoadingCalculatedProperties}\n calculatedProperties={calculatedProperties ?? []}\n refresh={refreshCalculatedProperties}\n />\n )}\n {!hideCustomCalculationProps && (\n <CustomCalculationTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCustomCalculationProperty}\n onClickModify={onClickModifyCustomCalculation}\n isLoading={isLoadingCustomCalculations}\n customCalculations={customCalculationProperties ?? []}\n refresh={refreshCustomCalculations}\n />\n )}\n </div>\n <GroupInformationPanel\n isOpen={isInformationPanelOpen}\n onClose={() => setIsInformationPanelOpen(false)}\n query={group.query}\n groupName={group.groupName}\n />\n </InformationPanelWrapper>\n );\n};\n"]}
1
+ {"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAgBlE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,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AS,EAAE,2BAA2B,EACtC,kBAAkB,EAAE,2BAA2B,aAA3B,2BAA2B,cAA3B,2BAA2B,GAAI,EAAE,EACrD,OAAO,EAAE,yBAAyB,GAClC,CACH,CACG,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, { useMemo } from \"react\";\nimport \"./PropertyMenu.scss\";\nimport { GroupPropertyTable } from \"./GroupPropertyTable\";\nimport { useCombinedFetchRefresh } from \"../hooks/useFetchData\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport type { CalculatedProperty, CustomCalculation, Group, GroupProperty, Mapping } from \"@itwin/insights-client\";\nimport { usePropertiesContext } from \"./context/PropertiesContext\";\nimport { CalculatedPropertyTable } from \"./CalculatedPropertyTable\";\nimport { CustomCalculationTable } from \"./CustomCalculationTable\";\n\nexport interface PropertyMenuProps {\n mapping: Mapping;\n group: Group;\n onClickAddGroupProperty?: () => void;\n onClickModifyGroupProperty?: (groupProperty: GroupProperty) => void;\n onClickAddCalculatedProperty?: () => void;\n onClickModifyCalculatedProperty?: (calculatedProperty: CalculatedProperty) => void;\n onClickAddCustomCalculationProperty?: () => void;\n onClickModifyCustomCalculation?: (customCalculation: CustomCalculation) => void;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\nexport const PropertyMenu = ({\n mapping,\n group,\n onClickAddGroupProperty,\n onClickModifyGroupProperty,\n onClickAddCalculatedProperty,\n onClickModifyCalculatedProperty,\n onClickAddCustomCalculationProperty,\n onClickModifyCustomCalculation,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyMenuProps) => {\n const groupId = group.id;\n const mappingId = mapping.id;\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const {\n groupProperties,\n setGroupProperties,\n calculatedProperties,\n setCalculatedProperties,\n customCalculationProperties,\n setCustomCalculationProperties,\n } = usePropertiesContext();\n\n const fetchGroupProperties = useMemo(\n () => {\n return async () => mappingClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingGroupProperties, refreshData: refreshGroupProperties } =\n useCombinedFetchRefresh<GroupProperty>(fetchGroupProperties, setGroupProperties);\n\n const fetchCalculatedProperties = useMemo(\n () => {\n return async () => mappingClient.getCalculatedProperties(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCalculatedProperties, refreshData: refreshCalculatedProperties } =\n useCombinedFetchRefresh<CalculatedProperty>(fetchCalculatedProperties, setCalculatedProperties);\n\n const fetchCustomCalculations = useMemo(\n () => {\n return async () => mappingClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCustomCalculations, refreshData: refreshCustomCalculations } =\n useCombinedFetchRefresh<CustomCalculation>(fetchCustomCalculations, setCustomCalculationProperties);\n\n return (\n <div className='gmw-property-menu-wrapper'>\n {!hideGroupProps && (\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddGroupProperty}\n onClickModify={onClickModifyGroupProperty}\n isLoading={isLoadingGroupProperties}\n groupProperties={groupProperties ?? []}\n refresh={refreshGroupProperties}\n />\n )}\n {!hideCalculatedProps && (\n <CalculatedPropertyTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCalculatedProperty}\n onClickModify={onClickModifyCalculatedProperty}\n isLoading={isLoadingCalculatedProperties}\n calculatedProperties={calculatedProperties ?? []}\n refresh={refreshCalculatedProperties}\n />\n )}\n {!hideCustomCalculationProps && (\n <CustomCalculationTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCustomCalculationProperty}\n onClickModify={onClickModifyCustomCalculation}\n isLoading={isLoadingCustomCalculations}\n customCalculations={customCalculationProperties ?? []}\n refresh={refreshCustomCalculations}\n />\n )}\n </div>\n );\n};\n"]}
@@ -7,21 +7,6 @@
7
7
  .gmw-property-menu-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
10
- height: 100%;
11
-
12
- .gmw-property-header {
13
- display: flex;
14
- justify-content: space-between;
15
- }
16
-
17
- .gmw-property-menu-container {
18
- display: flex;
19
- flex-direction: column;
20
- overflow: auto;
21
- gap: $iui-baseline * 2;
22
- .gmw-property-menu-toolbar {
23
- display: flex;
24
- justify-content: space-between;
25
- }
26
- }
10
+ flex-grow: 1;
11
+ gap: $iui-baseline * 2;
27
12
  }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { PropertyMenuProps } from "./PropertyMenu";
3
+ import "./PropertyMenuWithVisualization.scss";
4
+ export interface PropertyMenuWithVisualizationProps extends PropertyMenuProps {
5
+ color: string;
6
+ }
7
+ export declare const PropertyMenuWithVisualization: ({ group, color, ...rest }: PropertyMenuWithVisualizationProps) => JSX.Element;
8
+ //# sourceMappingURL=PropertyMenuWithVisualization.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import React, { useState } from "react";
6
+ import { PropertyMenu } from "./PropertyMenu";
7
+ import { GroupColorToggle } from "./GroupColorToggle";
8
+ import { IconButton, InformationPanelWrapper } from "@itwin/itwinui-react";
9
+ import { GroupInformationPanel } from "./GroupInformationPanel";
10
+ import { SvgProperties } from "@itwin/itwinui-icons-react";
11
+ import "./PropertyMenuWithVisualization.scss";
12
+ export const PropertyMenuWithVisualization = ({ group, color, ...rest }) => {
13
+ const [isInformationPanelOpen, setIsInformationPanelOpen] = useState(false);
14
+ return (React.createElement(InformationPanelWrapper, { className: 'gmw-property-menu-vis-wrapper' },
15
+ React.createElement("div", { className: "gmw-property-menu-vis-toolbar" },
16
+ React.createElement(GroupColorToggle, { group: group, color: color, labelPosition: "left" }),
17
+ React.createElement(IconButton, { styleType: 'borderless', onClick: () => setIsInformationPanelOpen(true) },
18
+ React.createElement(SvgProperties, null))),
19
+ React.createElement(PropertyMenu, { group: group, ...rest }),
20
+ React.createElement(GroupInformationPanel, { isOpen: isInformationPanelOpen, onClose: () => setIsInformationPanelOpen(false), query: group.query, groupName: group.groupName })));
21
+ };
22
+ //# sourceMappingURL=PropertyMenuWithVisualization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyMenuWithVisualization.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenuWithVisualization.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,sCAAsC,CAAC;AAM9C,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,EAC5C,KAAK,EACL,KAAK,EACL,GAAG,IAAI,EAC4B,EAAE,EAAE;IACvC,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAErF,OAAO,CACL,oBAAC,uBAAuB,IAAC,SAAS,EAAC,+BAA+B;QAChE,6BAAK,SAAS,EAAC,+BAA+B;YAC5C,oBAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAC,MAAM,GAAG;YACrE,oBAAC,UAAU,IACT,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC;gBAE9C,oBAAC,aAAa,OAAG,CACN,CACT;QACN,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,KAAM,IAAI,GAAI;QACxC,oBAAC,qBAAqB,IACpB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAC/C,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,GAC1B,CACsB,CAC3B,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, { useState } from \"react\";\nimport type { PropertyMenuProps } from \"./PropertyMenu\";\nimport { PropertyMenu } from \"./PropertyMenu\";\nimport { GroupColorToggle } from \"./GroupColorToggle\";\nimport { IconButton, InformationPanelWrapper } from \"@itwin/itwinui-react\";\nimport { GroupInformationPanel } from \"./GroupInformationPanel\";\nimport { SvgProperties } from \"@itwin/itwinui-icons-react\";\nimport \"./PropertyMenuWithVisualization.scss\";\n\nexport interface PropertyMenuWithVisualizationProps extends PropertyMenuProps {\n color: string;\n}\n\nexport const PropertyMenuWithVisualization = ({\n group,\n color,\n ...rest\n}: PropertyMenuWithVisualizationProps) => {\n const [isInformationPanelOpen, setIsInformationPanelOpen] = useState<boolean>(false);\n\n return (\n <InformationPanelWrapper className='gmw-property-menu-vis-wrapper'>\n <div className=\"gmw-property-menu-vis-toolbar\">\n <GroupColorToggle group={group} color={color} labelPosition=\"left\" />\n <IconButton\n styleType='borderless'\n onClick={() => setIsInformationPanelOpen(true)}\n >\n <SvgProperties />\n </IconButton>\n </div>\n <PropertyMenu group={group} {...rest} />\n <GroupInformationPanel\n isOpen={isInformationPanelOpen}\n onClose={() => setIsInformationPanelOpen(false)}\n query={group.query}\n groupName={group.groupName}\n />\n </InformationPanelWrapper>\n );\n};\n"]}
@@ -0,0 +1,16 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "~@itwin/itwinui-css/scss/variables";
6
+
7
+ .gmw-property-menu-vis-wrapper {
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: $iui-baseline;
11
+ flex-grow: 1;
12
+ .gmw-property-menu-vis-toolbar {
13
+ display: flex;
14
+ justify-content: space-between;
15
+ }
16
+ }
@@ -39,9 +39,9 @@ export declare class QueryBuilder {
39
39
  private dataProvider;
40
40
  private query;
41
41
  constructor(provider: PresentationPropertyDataProvider);
42
- resetQuery: () => void;
43
42
  private isCategory;
44
43
  private _propertyMap;
44
+ resetQueryBuilder: () => void;
45
45
  private regenerateQuery;
46
46
  addProperty(prop: PropertyRecord): Promise<boolean>;
47
47
  removeProperty(prop: PropertyRecord): Promise<void>;
@@ -3,12 +3,12 @@ import { toaster } from "@itwin/itwinui-react";
3
3
  /* This class is to build adaptive and dynamic query for find similar property selections */
4
4
  export class QueryBuilder {
5
5
  constructor(provider) {
6
- this.resetQuery = () => {
7
- this.query = undefined;
8
- };
9
6
  this._propertyMap = new Map();
7
+ this.resetQueryBuilder = () => {
8
+ this._propertyMap = new Map();
9
+ };
10
10
  this.regenerateQuery = () => {
11
- this.resetQuery();
11
+ this.query = undefined;
12
12
  for (const property of this._propertyMap.values()) {
13
13
  this.buildProperty(property.propertyRecord, property.propertiesField);
14
14
  }