@itwin/grouping-mapping-widget 0.11.1 → 0.13.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 (355) hide show
  1. package/lib/cjs/grouping-mapping-widget.d.ts +4 -1
  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/WidgetHeader.test.js +3 -3
  5. package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
  6. package/lib/cjs/widget/components/CalculatedPropertyAction.d.ts +7 -9
  7. package/lib/cjs/widget/components/CalculatedPropertyAction.js +49 -24
  8. package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
  9. package/lib/cjs/widget/components/CalculatedPropertyTable.d.ts +9 -16
  10. package/lib/cjs/widget/components/CalculatedPropertyTable.js +29 -31
  11. package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
  12. package/lib/cjs/widget/components/CalculatedPropertyTable.scss +9 -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/CustomCalculationAction.d.ts +6 -9
  16. package/lib/cjs/widget/components/CustomCalculationAction.js +79 -9
  17. package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
  18. package/lib/cjs/widget/components/CustomCalculationTable.d.ts +8 -16
  19. package/lib/cjs/widget/components/CustomCalculationTable.js +22 -29
  20. package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
  21. package/lib/cjs/widget/components/DeleteModal.d.ts +4 -5
  22. package/lib/cjs/widget/components/DeleteModal.js +9 -13
  23. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  24. package/lib/cjs/widget/components/GroupAction.js +51 -66
  25. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  26. package/lib/cjs/widget/components/GroupAction.scss +0 -18
  27. package/lib/cjs/widget/components/GroupDetails.d.ts +13 -0
  28. package/lib/cjs/widget/components/GroupDetails.js +34 -0
  29. package/lib/cjs/widget/components/GroupDetails.js.map +1 -0
  30. package/lib/cjs/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  31. package/lib/cjs/widget/components/GroupDetailsActionPanel.js +19 -0
  32. package/lib/cjs/widget/components/GroupDetailsActionPanel.js.map +1 -0
  33. package/lib/cjs/widget/components/GroupDetailsStep.d.ts +13 -0
  34. package/lib/cjs/widget/components/GroupDetailsStep.js +25 -0
  35. package/lib/cjs/widget/components/GroupDetailsStep.js.map +1 -0
  36. package/lib/cjs/widget/components/GroupDetailsStep.scss +11 -0
  37. package/lib/cjs/widget/components/GroupInformationPanel.d.ts +10 -0
  38. package/lib/cjs/widget/components/GroupInformationPanel.js +23 -0
  39. package/lib/cjs/widget/components/GroupInformationPanel.js.map +1 -0
  40. package/lib/cjs/widget/components/GroupInformationPanel.scss +13 -0
  41. package/lib/cjs/widget/components/GroupPropertyAction.d.ts +6 -9
  42. package/lib/cjs/widget/components/GroupPropertyAction.js +26 -15
  43. package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
  44. package/lib/cjs/widget/components/GroupPropertyTable.d.ts +8 -15
  45. package/lib/cjs/widget/components/GroupPropertyTable.js +23 -28
  46. package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
  47. package/lib/cjs/widget/components/Grouping.d.ts +2 -1
  48. package/lib/cjs/widget/components/Grouping.js +13 -17
  49. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  50. package/lib/cjs/widget/components/Grouping.scss +2 -9
  51. package/lib/cjs/widget/components/GroupingMapping.js +1 -2
  52. package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
  53. package/lib/cjs/widget/components/GroupingMappingContent.js +8 -4
  54. package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
  55. package/lib/cjs/widget/components/GroupingMappingContext.js +17 -1
  56. package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -1
  57. package/lib/cjs/widget/components/GroupingMappingHeader.d.ts +1 -2
  58. package/lib/cjs/widget/components/GroupingMappingHeader.js +10 -3
  59. package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -1
  60. package/lib/cjs/widget/components/GroupingMappingRouter.js +23 -2
  61. package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
  62. package/lib/cjs/widget/components/GroupsAddButton.d.ts +9 -0
  63. package/lib/cjs/widget/components/GroupsAddButton.js +17 -0
  64. package/lib/cjs/widget/components/GroupsAddButton.js.map +1 -0
  65. package/lib/cjs/widget/components/GroupsAddButton.scss +7 -0
  66. package/lib/cjs/widget/components/Mapping.js +7 -14
  67. package/lib/cjs/widget/components/Mapping.js.map +1 -1
  68. package/lib/cjs/widget/components/MappingAction.js +1 -1
  69. package/lib/cjs/widget/components/MappingAction.js.map +1 -1
  70. package/lib/cjs/widget/components/MappingImportWizardModal.js +1 -1
  71. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
  72. package/lib/cjs/widget/components/PropertyAction.d.ts +8 -0
  73. package/lib/cjs/widget/components/PropertyAction.js +100 -0
  74. package/lib/cjs/widget/components/PropertyAction.js.map +1 -0
  75. package/lib/cjs/widget/components/PropertyAction.scss +9 -0
  76. package/lib/cjs/widget/components/PropertyMenu.d.ts +12 -17
  77. package/lib/cjs/widget/components/PropertyMenu.js +52 -155
  78. package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
  79. package/lib/cjs/widget/components/PropertyMenu.scss +4 -28
  80. package/lib/cjs/widget/components/PropertyNameCell.d.ts +11 -0
  81. package/lib/cjs/widget/components/PropertyNameCell.js +15 -0
  82. package/lib/cjs/widget/components/PropertyNameCell.js.map +1 -0
  83. package/lib/cjs/widget/components/PropertyTable.d.ts +18 -0
  84. package/lib/cjs/widget/components/PropertyTable.js +54 -0
  85. package/lib/cjs/widget/components/PropertyTable.js.map +1 -0
  86. package/lib/cjs/widget/components/PropertyTable.scss +11 -0
  87. package/lib/cjs/widget/components/PropertyTableToolbar.d.ts +10 -0
  88. package/lib/cjs/widget/components/PropertyTableToolbar.js +23 -0
  89. package/lib/cjs/widget/components/PropertyTableToolbar.js.map +1 -0
  90. package/lib/cjs/widget/components/PropertyTableToolbar.scss +12 -0
  91. package/lib/cjs/widget/components/QueryBuilder.d.ts +1 -1
  92. package/lib/cjs/widget/components/QueryBuilder.js +4 -4
  93. package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
  94. package/lib/cjs/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  95. package/lib/cjs/widget/components/QueryBuilderActionPanel.js +17 -0
  96. package/lib/cjs/widget/components/QueryBuilderActionPanel.js.map +1 -0
  97. package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +11 -0
  98. package/lib/cjs/widget/components/QueryBuilderCustomUI.js +27 -0
  99. package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +1 -0
  100. package/lib/cjs/widget/components/QueryBuilderStep.d.ts +16 -0
  101. package/lib/cjs/widget/components/QueryBuilderStep.js +30 -0
  102. package/lib/cjs/widget/components/QueryBuilderStep.js.map +1 -0
  103. package/lib/cjs/widget/components/QueryBuilderStep.scss +18 -0
  104. package/lib/cjs/widget/components/SelectMappings.js +1 -1
  105. package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
  106. package/lib/cjs/widget/components/StatusIcon.d.ts +15 -0
  107. package/lib/cjs/widget/components/StatusIcon.js +26 -0
  108. package/lib/cjs/widget/components/StatusIcon.js.map +1 -0
  109. package/lib/cjs/widget/components/StatusIcon.scss +26 -0
  110. package/lib/cjs/widget/components/ToggleGroupVisibility.d.ts +9 -0
  111. package/lib/cjs/widget/components/ToggleGroupVisibility.js +16 -0
  112. package/lib/cjs/widget/components/ToggleGroupVisibility.js.map +1 -0
  113. package/lib/cjs/widget/components/ToggleGroupVisibility.scss +9 -0
  114. package/lib/cjs/widget/components/WidgetHeader.d.ts +9 -0
  115. package/lib/cjs/widget/components/WidgetHeader.js +22 -0
  116. package/lib/cjs/widget/components/WidgetHeader.js.map +1 -0
  117. package/lib/cjs/widget/components/WidgetHeader.scss +36 -0
  118. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +6 -1
  119. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  120. package/lib/cjs/widget/components/context/PropertiesContext.d.ts +15 -0
  121. package/lib/cjs/widget/components/context/PropertiesContext.js +43 -0
  122. package/lib/cjs/widget/components/context/PropertiesContext.js.map +1 -0
  123. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  124. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js +0 -2
  125. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  126. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  127. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +51 -32
  128. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  129. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  130. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +1 -1
  131. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  132. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  133. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +1 -1
  134. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  135. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  136. package/lib/cjs/widget/components/groupsHelpers.d.ts +6 -3
  137. package/lib/cjs/widget/components/groupsHelpers.js +43 -40
  138. package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
  139. package/lib/cjs/widget/components/utils.d.ts +1 -7
  140. package/lib/cjs/widget/components/utils.js +1 -9
  141. package/lib/cjs/widget/components/utils.js.map +1 -1
  142. package/lib/cjs/widget/components/utils.scss +0 -29
  143. package/lib/cjs/widget/components/viewerUtils.d.ts +4 -2
  144. package/lib/cjs/widget/components/viewerUtils.js +4 -22
  145. package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
  146. package/lib/cjs/widget/hooks/useFetchData.d.ts +3 -5
  147. package/lib/cjs/widget/hooks/useFetchData.js +9 -7
  148. package/lib/cjs/widget/hooks/useFetchData.js.map +1 -1
  149. package/lib/esm/grouping-mapping-widget.d.ts +4 -1
  150. package/lib/esm/grouping-mapping-widget.js +3 -0
  151. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  152. package/lib/esm/test/WidgetHeader.test.js +1 -1
  153. package/lib/esm/test/WidgetHeader.test.js.map +1 -1
  154. package/lib/esm/widget/components/CalculatedPropertyAction.d.ts +7 -9
  155. package/lib/esm/widget/components/CalculatedPropertyAction.js +50 -27
  156. package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
  157. package/lib/esm/widget/components/CalculatedPropertyTable.d.ts +9 -16
  158. package/lib/esm/widget/components/CalculatedPropertyTable.js +30 -31
  159. package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -1
  160. package/lib/esm/widget/components/CalculatedPropertyTable.scss +9 -0
  161. package/lib/esm/widget/components/ConfirmMappingsImport.js +1 -1
  162. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
  163. package/lib/esm/widget/components/CustomCalculationAction.d.ts +6 -9
  164. package/lib/esm/widget/components/CustomCalculationAction.js +79 -11
  165. package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
  166. package/lib/esm/widget/components/CustomCalculationTable.d.ts +8 -16
  167. package/lib/esm/widget/components/CustomCalculationTable.js +23 -29
  168. package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -1
  169. package/lib/esm/widget/components/DeleteModal.d.ts +4 -5
  170. package/lib/esm/widget/components/DeleteModal.js +9 -13
  171. package/lib/esm/widget/components/DeleteModal.js.map +1 -1
  172. package/lib/esm/widget/components/GroupAction.js +54 -69
  173. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  174. package/lib/esm/widget/components/GroupAction.scss +0 -18
  175. package/lib/esm/widget/components/GroupDetails.d.ts +13 -0
  176. package/lib/esm/widget/components/GroupDetails.js +27 -0
  177. package/lib/esm/widget/components/GroupDetails.js.map +1 -0
  178. package/lib/esm/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  179. package/lib/esm/widget/components/GroupDetailsActionPanel.js +12 -0
  180. package/lib/esm/widget/components/GroupDetailsActionPanel.js.map +1 -0
  181. package/lib/esm/widget/components/GroupDetailsStep.d.ts +13 -0
  182. package/lib/esm/widget/components/GroupDetailsStep.js +18 -0
  183. package/lib/esm/widget/components/GroupDetailsStep.js.map +1 -0
  184. package/lib/esm/widget/components/GroupDetailsStep.scss +11 -0
  185. package/lib/esm/widget/components/GroupInformationPanel.d.ts +10 -0
  186. package/lib/esm/widget/components/GroupInformationPanel.js +16 -0
  187. package/lib/esm/widget/components/GroupInformationPanel.js.map +1 -0
  188. package/lib/esm/widget/components/GroupInformationPanel.scss +13 -0
  189. package/lib/esm/widget/components/GroupPropertyAction.d.ts +6 -9
  190. package/lib/esm/widget/components/GroupPropertyAction.js +25 -15
  191. package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
  192. package/lib/esm/widget/components/GroupPropertyTable.d.ts +8 -15
  193. package/lib/esm/widget/components/GroupPropertyTable.js +24 -28
  194. package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -1
  195. package/lib/esm/widget/components/Grouping.d.ts +2 -1
  196. package/lib/esm/widget/components/Grouping.js +15 -19
  197. package/lib/esm/widget/components/Grouping.js.map +1 -1
  198. package/lib/esm/widget/components/Grouping.scss +2 -9
  199. package/lib/esm/widget/components/GroupingMapping.js +1 -2
  200. package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
  201. package/lib/esm/widget/components/GroupingMappingContent.js +9 -5
  202. package/lib/esm/widget/components/GroupingMappingContent.js.map +1 -1
  203. package/lib/esm/widget/components/GroupingMappingContext.js +17 -1
  204. package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -1
  205. package/lib/esm/widget/components/GroupingMappingHeader.d.ts +1 -2
  206. package/lib/esm/widget/components/GroupingMappingHeader.js +10 -3
  207. package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -1
  208. package/lib/esm/widget/components/GroupingMappingRouter.js +23 -2
  209. package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
  210. package/lib/esm/widget/components/GroupsAddButton.d.ts +9 -0
  211. package/lib/esm/widget/components/GroupsAddButton.js +10 -0
  212. package/lib/esm/widget/components/GroupsAddButton.js.map +1 -0
  213. package/lib/esm/widget/components/GroupsAddButton.scss +7 -0
  214. package/lib/esm/widget/components/Mapping.js +7 -14
  215. package/lib/esm/widget/components/Mapping.js.map +1 -1
  216. package/lib/esm/widget/components/MappingAction.js +1 -1
  217. package/lib/esm/widget/components/MappingAction.js.map +1 -1
  218. package/lib/esm/widget/components/MappingImportWizardModal.js +1 -1
  219. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
  220. package/lib/esm/widget/components/PropertyAction.d.ts +8 -0
  221. package/lib/esm/widget/components/PropertyAction.js +77 -0
  222. package/lib/esm/widget/components/PropertyAction.js.map +1 -0
  223. package/lib/esm/widget/components/PropertyAction.scss +9 -0
  224. package/lib/esm/widget/components/PropertyMenu.d.ts +12 -17
  225. package/lib/esm/widget/components/PropertyMenu.js +54 -154
  226. package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
  227. package/lib/esm/widget/components/PropertyMenu.scss +4 -28
  228. package/lib/esm/widget/components/PropertyNameCell.d.ts +11 -0
  229. package/lib/esm/widget/components/PropertyNameCell.js +8 -0
  230. package/lib/esm/widget/components/PropertyNameCell.js.map +1 -0
  231. package/lib/esm/widget/components/PropertyTable.d.ts +18 -0
  232. package/lib/esm/widget/components/PropertyTable.js +28 -0
  233. package/lib/esm/widget/components/PropertyTable.js.map +1 -0
  234. package/lib/esm/widget/components/PropertyTable.scss +11 -0
  235. package/lib/esm/widget/components/PropertyTableToolbar.d.ts +10 -0
  236. package/lib/esm/widget/components/PropertyTableToolbar.js +16 -0
  237. package/lib/esm/widget/components/PropertyTableToolbar.js.map +1 -0
  238. package/lib/esm/widget/components/PropertyTableToolbar.scss +12 -0
  239. package/lib/esm/widget/components/QueryBuilder.d.ts +1 -1
  240. package/lib/esm/widget/components/QueryBuilder.js +4 -4
  241. package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
  242. package/lib/esm/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  243. package/lib/esm/widget/components/QueryBuilderActionPanel.js +10 -0
  244. package/lib/esm/widget/components/QueryBuilderActionPanel.js.map +1 -0
  245. package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +11 -0
  246. package/lib/esm/widget/components/QueryBuilderCustomUI.js +20 -0
  247. package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +1 -0
  248. package/lib/esm/widget/components/QueryBuilderStep.d.ts +16 -0
  249. package/lib/esm/widget/components/QueryBuilderStep.js +23 -0
  250. package/lib/esm/widget/components/QueryBuilderStep.js.map +1 -0
  251. package/lib/esm/widget/components/QueryBuilderStep.scss +18 -0
  252. package/lib/esm/widget/components/SelectMappings.js +1 -1
  253. package/lib/esm/widget/components/SelectMappings.js.map +1 -1
  254. package/lib/esm/widget/components/StatusIcon.d.ts +15 -0
  255. package/lib/esm/widget/components/StatusIcon.js +19 -0
  256. package/lib/esm/widget/components/StatusIcon.js.map +1 -0
  257. package/lib/esm/widget/components/StatusIcon.scss +26 -0
  258. package/lib/esm/widget/components/ToggleGroupVisibility.d.ts +9 -0
  259. package/lib/esm/widget/components/ToggleGroupVisibility.js +9 -0
  260. package/lib/esm/widget/components/ToggleGroupVisibility.js.map +1 -0
  261. package/lib/esm/widget/components/ToggleGroupVisibility.scss +9 -0
  262. package/lib/esm/widget/components/WidgetHeader.d.ts +9 -0
  263. package/lib/esm/widget/components/WidgetHeader.js +15 -0
  264. package/lib/esm/widget/components/WidgetHeader.js.map +1 -0
  265. package/lib/esm/widget/components/WidgetHeader.scss +36 -0
  266. package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +6 -1
  267. package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  268. package/lib/esm/widget/components/context/PropertiesContext.d.ts +15 -0
  269. package/lib/esm/widget/components/context/PropertiesContext.js +20 -0
  270. package/lib/esm/widget/components/context/PropertiesContext.js.map +1 -0
  271. package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  272. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js +0 -2
  273. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  274. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  275. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js +53 -34
  276. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  277. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  278. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +2 -2
  279. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  280. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  281. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +2 -2
  282. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  283. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  284. package/lib/esm/widget/components/groupsHelpers.d.ts +6 -3
  285. package/lib/esm/widget/components/groupsHelpers.js +41 -40
  286. package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
  287. package/lib/esm/widget/components/utils.d.ts +1 -7
  288. package/lib/esm/widget/components/utils.js +0 -7
  289. package/lib/esm/widget/components/utils.js.map +1 -1
  290. package/lib/esm/widget/components/utils.scss +0 -29
  291. package/lib/esm/widget/components/viewerUtils.d.ts +4 -2
  292. package/lib/esm/widget/components/viewerUtils.js +3 -20
  293. package/lib/esm/widget/components/viewerUtils.js.map +1 -1
  294. package/lib/esm/widget/hooks/useFetchData.d.ts +3 -5
  295. package/lib/esm/widget/hooks/useFetchData.js +9 -7
  296. package/lib/esm/widget/hooks/useFetchData.js.map +1 -1
  297. package/package.json +1 -1
  298. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  299. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -91
  300. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  301. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  302. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -62
  303. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  304. package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  305. package/lib/cjs/widget/components/property-grid/PropertyGrid.js +0 -198
  306. package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +0 -1
  307. package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +0 -71
  308. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  309. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +0 -77
  310. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  311. package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +0 -69
  312. package/lib/cjs/widget/components/property-grid/PropertyList.js +0 -87
  313. package/lib/cjs/widget/components/property-grid/PropertyList.js.map +0 -1
  314. package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +0 -92
  315. package/lib/cjs/widget/components/property-grid/PropertyRender.js +0 -109
  316. package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +0 -1
  317. package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +0 -22
  318. package/lib/cjs/widget/components/property-grid/PropertyView.js +0 -232
  319. package/lib/cjs/widget/components/property-grid/PropertyView.js.map +0 -1
  320. package/lib/cjs/widget/components/property-grid/PropertyView.scss +0 -77
  321. package/lib/cjs/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  322. package/lib/cjs/widget/components/property-grid/countMatchesInString.js +0 -32
  323. package/lib/cjs/widget/components/property-grid/countMatchesInString.js.map +0 -1
  324. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  325. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js +0 -65
  326. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
  327. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  328. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -68
  329. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  330. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  331. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -39
  332. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  333. package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  334. package/lib/esm/widget/components/property-grid/PropertyGrid.js +0 -172
  335. package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +0 -1
  336. package/lib/esm/widget/components/property-grid/PropertyGrid.scss +0 -71
  337. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  338. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +0 -54
  339. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  340. package/lib/esm/widget/components/property-grid/PropertyList.d.ts +0 -69
  341. package/lib/esm/widget/components/property-grid/PropertyList.js +0 -60
  342. package/lib/esm/widget/components/property-grid/PropertyList.js.map +0 -1
  343. package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +0 -92
  344. package/lib/esm/widget/components/property-grid/PropertyRender.js +0 -86
  345. package/lib/esm/widget/components/property-grid/PropertyRender.js.map +0 -1
  346. package/lib/esm/widget/components/property-grid/PropertyView.d.ts +0 -22
  347. package/lib/esm/widget/components/property-grid/PropertyView.js +0 -209
  348. package/lib/esm/widget/components/property-grid/PropertyView.js.map +0 -1
  349. package/lib/esm/widget/components/property-grid/PropertyView.scss +0 -77
  350. package/lib/esm/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  351. package/lib/esm/widget/components/property-grid/countMatchesInString.js +0 -28
  352. package/lib/esm/widget/components/property-grid/countMatchesInString.js.map +0 -1
  353. package/lib/esm/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  354. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js +0 -42
  355. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
@@ -18,189 +18,86 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
21
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.PropertyMenu = exports.PropertyMenuView = void 0;
22
+ exports.PropertyMenu = void 0;
23
+ /*---------------------------------------------------------------------------------------------
24
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
25
+ * See LICENSE.md in the project root for license terms and full copyright notice.
26
+ *--------------------------------------------------------------------------------------------*/
26
27
  const presentation_frontend_1 = require("@itwin/presentation-frontend");
27
28
  const appui_react_1 = require("@itwin/appui-react");
28
29
  const react_1 = __importStar(require("react"));
29
- const utils_1 = require("./utils");
30
30
  const viewerUtils_1 = require("./viewerUtils");
31
31
  require("./PropertyMenu.scss");
32
- const GroupPropertyAction_1 = __importDefault(require("./GroupPropertyAction"));
33
- const CalculatedPropertyAction_1 = __importDefault(require("./CalculatedPropertyAction"));
34
- const GroupPropertyTable_1 = __importDefault(require("./GroupPropertyTable"));
35
- const CalculatedPropertyTable_1 = __importDefault(require("./CalculatedPropertyTable"));
32
+ const GroupPropertyTable_1 = require("./GroupPropertyTable");
36
33
  const itwinui_react_1 = require("@itwin/itwinui-react");
37
- const CustomCalculationTable_1 = __importDefault(require("./CustomCalculationTable"));
38
- const CustomCalculationAction_1 = __importDefault(require("./CustomCalculationAction"));
39
- const presentation_common_1 = require("@itwin/presentation-common");
40
- const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
41
34
  const useFetchData_1 = require("../hooks/useFetchData");
42
35
  const MappingClientContext_1 = require("./context/MappingClientContext");
43
36
  const GroupingApiConfigContext_1 = require("./context/GroupingApiConfigContext");
44
- var PropertyMenuView;
45
- (function (PropertyMenuView) {
46
- PropertyMenuView["DEFAULT"] = "default";
47
- PropertyMenuView["ADD_GROUP_PROPERTY"] = "add_group_property";
48
- PropertyMenuView["MODIFY_GROUP_PROPERTY"] = "modify_group_property";
49
- PropertyMenuView["ADD_CALCULATED_PROPERTY"] = "add_calculated_property";
50
- PropertyMenuView["MODIFY_CALCULATED_PROPERTY"] = "modify_calculated_property";
51
- PropertyMenuView["ADD_CUSTOM_CALCULATION"] = "add_custom_calculation";
52
- PropertyMenuView["MODIFY_CUSTOM_CALCULATION"] = "modify_custom_calculation";
53
- })(PropertyMenuView = exports.PropertyMenuView || (exports.PropertyMenuView = {}));
54
- const stringToPossibleDataType = (str) => {
55
- if (!str)
56
- return "Undefined";
57
- switch (str.toLowerCase()) {
58
- case "double":
59
- case "number": return "Number";
60
- case "string": return "String";
61
- case "boolean": return "Boolean";
62
- default: return "Undefined";
63
- }
64
- };
65
- const convertToPropertyMap = (groupProperties, calculatedProperties, customCalculations, selectedPropertyName) => {
66
- const map = {};
67
- const selectedLowerName = selectedPropertyName === null || selectedPropertyName === void 0 ? void 0 : selectedPropertyName.toLowerCase();
68
- groupProperties.forEach((p) => {
69
- var _a;
70
- const lowerName = (_a = p.propertyName) === null || _a === void 0 ? void 0 : _a.toLowerCase();
71
- if (lowerName && lowerName !== selectedLowerName)
72
- map[lowerName] = stringToPossibleDataType(p.dataType);
73
- });
74
- calculatedProperties.forEach((p) => {
75
- var _a;
76
- const lowerName = (_a = p.propertyName) === null || _a === void 0 ? void 0 : _a.toLowerCase();
77
- if (lowerName)
78
- map[lowerName] = "Number";
79
- });
80
- customCalculations.forEach((p) => {
81
- var _a;
82
- const lowerName = (_a = p.propertyName) === null || _a === void 0 ? void 0 : _a.toLowerCase();
83
- if (lowerName && lowerName !== selectedLowerName)
84
- map[lowerName] = stringToPossibleDataType(p.dataType);
85
- });
86
- return map;
87
- };
88
- const PropertyMenu = ({ iModelId, mappingId, group, goBack, hideGroupProps = false, hideCalculatedProps = false, hideCustomCalculationProps = false, }) => {
89
- var _a, _b;
37
+ const groupsHelpers_1 = require("./groupsHelpers");
38
+ const GroupHilitedElementsContext_1 = require("./context/GroupHilitedElementsContext");
39
+ const PropertiesContext_1 = require("./context/PropertiesContext");
40
+ const CalculatedPropertyTable_1 = require("./CalculatedPropertyTable");
41
+ const CustomCalculationTable_1 = require("./CustomCalculationTable");
42
+ const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
43
+ const GroupInformationPanel_1 = require("./GroupInformationPanel");
44
+ const PropertyMenu = ({ mapping, group, color, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps = false, hideCalculatedProps = false, hideCustomCalculationProps = false, }) => {
90
45
  const groupId = group.id;
91
- const { getAccessToken } = GroupingApiConfigContext_1.useGroupingMappingApiConfig();
46
+ const mappingId = mapping.id;
47
+ const { getAccessToken, iModelId } = GroupingApiConfigContext_1.useGroupingMappingApiConfig();
48
+ const { hilitedElementsQueryCache } = GroupHilitedElementsContext_1.useGroupHilitedElementsContext();
92
49
  const mappingClient = MappingClientContext_1.useMappingClient();
93
50
  const iModelConnection = appui_react_1.useActiveIModelConnection();
94
- const [propertyMenuView, setPropertyMenuView] = react_1.useState(PropertyMenuView.DEFAULT);
95
- const [selectedGroupProperty, setSelectedGroupProperty] = react_1.useState(undefined);
96
- const [selectedCalculatedProperty, setSelectedCalculatedProperty] = react_1.useState(undefined);
97
- const [selectedCustomCalculation, setSelectedCustomCalculation] = react_1.useState(undefined);
51
+ const { showGroupColor, setShowGroupColor, groupProperties, setGroupProperties, calculatedProperties, setCalculatedProperties, customCalculationProperties, setCustomCalculationProperties, } = PropertiesContext_1.usePropertiesContext();
98
52
  const [isInformationPanelOpen, setIsInformationPanelOpen] = react_1.useState(false);
99
- const [resolvedHiliteIds, setResolvedHiliteIds] = react_1.useState([]);
100
- const [keySet, setKeySet] = react_1.useState();
101
- const [isLoading, setIsLoading] = react_1.useState(true);
53
+ const [isLoading, setIsLoading] = react_1.useState(false);
102
54
  const fetchGroupProperties = react_1.useMemo(() => {
103
- return async () => mappingClient.getGroupProperties((await getAccessToken()), iModelId, mappingId, groupId);
55
+ return async () => mappingClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId);
104
56
  }, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
105
- const { isLoading: isLoadingGroupProperties, data: groupProperties, refreshData: refreshGroupProperties } = useFetchData_1.useCombinedFetchRefresh(fetchGroupProperties);
57
+ const { isLoading: isLoadingGroupProperties, refreshData: refreshGroupProperties } = useFetchData_1.useCombinedFetchRefresh(fetchGroupProperties, setGroupProperties);
106
58
  const fetchCalculatedProperties = react_1.useMemo(() => {
107
- return async () => mappingClient.getCalculatedProperties((await getAccessToken()), iModelId, mappingId, groupId);
59
+ return async () => mappingClient.getCalculatedProperties(await getAccessToken(), iModelId, mappingId, groupId);
108
60
  }, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
109
- const { isLoading: isLoadingCalculatedProperties, data: calculatedProperties, refreshData: refreshCalculatedProperties } = useFetchData_1.useCombinedFetchRefresh(fetchCalculatedProperties);
61
+ const { isLoading: isLoadingCalculatedProperties, refreshData: refreshCalculatedProperties } = useFetchData_1.useCombinedFetchRefresh(fetchCalculatedProperties, setCalculatedProperties);
110
62
  const fetchCustomCalculations = react_1.useMemo(() => {
111
- return async () => mappingClient.getCustomCalculations((await getAccessToken()), iModelId, mappingId, groupId);
63
+ return async () => mappingClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId);
112
64
  }, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
113
- const { isLoading: isLoadingCustomCalculations, data: customCalculations, refreshData: refreshCustomCalculations } = useFetchData_1.useCombinedFetchRefresh(fetchCustomCalculations);
65
+ const { isLoading: isLoadingCustomCalculations, refreshData: refreshCustomCalculations } = useFetchData_1.useCombinedFetchRefresh(fetchCustomCalculations, setCustomCalculationProperties);
114
66
  react_1.useEffect(() => {
115
67
  const initialize = async () => {
68
+ if (!iModelConnection)
69
+ return;
116
70
  try {
117
- const query = group.query;
118
- const queryRowCount = await iModelConnection.queryRowCount(query);
119
- if (queryRowCount === 0) {
120
- itwinui_react_1.toaster.warning("The query is valid but produced no results.");
121
- await goBack();
122
- }
123
- const keys = await viewerUtils_1.manufactureKeys(query, iModelConnection);
124
- setKeySet(keys);
125
- presentation_frontend_1.Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection);
71
+ setIsLoading(true);
126
72
  viewerUtils_1.clearEmphasizedOverriddenElements();
127
- const resolvedIds = await viewerUtils_1.visualizeElementsByKeys(keys, "red");
128
- await viewerUtils_1.zoomToElements(resolvedIds);
129
- setResolvedHiliteIds(resolvedIds);
130
- setIsLoading(false);
73
+ if (showGroupColor) {
74
+ const result = await groupsHelpers_1.getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);
75
+ presentation_frontend_1.Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection);
76
+ viewerUtils_1.visualizeElements(result.ids, color);
77
+ await viewerUtils_1.zoomToElements(result.ids);
78
+ }
131
79
  }
132
- catch {
133
- itwinui_react_1.toaster.negative(`Could not load ${group.groupName}.`);
134
- await goBack();
80
+ catch (error) {
81
+ itwinui_react_1.toaster.negative("There was an error visualizing group.");
82
+ /* eslint-disable no-console */
83
+ console.error(error);
84
+ }
85
+ finally {
86
+ setIsLoading(false);
135
87
  }
136
88
  };
137
89
  void initialize();
138
- }, [iModelConnection, group.query, goBack, group.groupName]);
139
- const onGroupPropertyModify = react_1.useCallback((value) => {
140
- setSelectedGroupProperty(value.row.original);
141
- setPropertyMenuView(PropertyMenuView.MODIFY_GROUP_PROPERTY);
142
- }, []);
143
- const onCalculatedPropertyModify = react_1.useCallback((value) => {
144
- setSelectedCalculatedProperty(value.row.original);
145
- setPropertyMenuView(PropertyMenuView.MODIFY_CALCULATED_PROPERTY);
146
- }, []);
147
- const onCustomCalculationModify = react_1.useCallback((value) => {
148
- setSelectedCustomCalculation(value.row.original);
149
- setPropertyMenuView(PropertyMenuView.MODIFY_CUSTOM_CALCULATION);
150
- }, []);
151
- const groupPropertyReturn = react_1.useCallback(async (modified) => {
152
- setPropertyMenuView(PropertyMenuView.DEFAULT);
153
- modified && await refreshGroupProperties();
154
- }, [refreshGroupProperties]);
155
- const calculatedPropertyReturn = react_1.useCallback(async (modified) => {
156
- viewerUtils_1.visualizeElements(resolvedHiliteIds, "red");
157
- await viewerUtils_1.zoomToElements(resolvedHiliteIds);
158
- setPropertyMenuView(PropertyMenuView.DEFAULT);
159
- modified && await refreshCalculatedProperties();
160
- }, [resolvedHiliteIds, refreshCalculatedProperties]);
161
- const customCalculationReturn = react_1.useCallback(async (modified) => {
162
- setPropertyMenuView(PropertyMenuView.DEFAULT);
163
- modified && await refreshCustomCalculations();
164
- }, [refreshCustomCalculations]);
165
- if (isLoading) {
166
- return (react_1.default.createElement("div", { className: 'gmw-loading-overlay' },
167
- react_1.default.createElement(itwinui_react_1.Text, null, "Loading Group"),
168
- react_1.default.createElement(itwinui_react_1.ProgressRadial, { indeterminate: true }),
169
- react_1.default.createElement(itwinui_react_1.Text, null, "Please wait...")));
170
- }
171
- switch (propertyMenuView) {
172
- case PropertyMenuView.ADD_GROUP_PROPERTY:
173
- return (react_1.default.createElement(GroupPropertyAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, keySet: keySet !== null && keySet !== void 0 ? keySet : new presentation_common_1.KeySet(), returnFn: groupPropertyReturn }));
174
- case PropertyMenuView.MODIFY_GROUP_PROPERTY:
175
- return (react_1.default.createElement(GroupPropertyAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, keySet: keySet !== null && keySet !== void 0 ? keySet : new presentation_common_1.KeySet(), groupPropertyId: (_a = selectedGroupProperty === null || selectedGroupProperty === void 0 ? void 0 : selectedGroupProperty.id) !== null && _a !== void 0 ? _a : "", groupPropertyName: (_b = selectedGroupProperty === null || selectedGroupProperty === void 0 ? void 0 : selectedGroupProperty.propertyName) !== null && _b !== void 0 ? _b : "", returnFn: groupPropertyReturn }));
176
- case PropertyMenuView.ADD_CALCULATED_PROPERTY:
177
- return (react_1.default.createElement(CalculatedPropertyAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, ids: resolvedHiliteIds, returnFn: calculatedPropertyReturn }));
178
- case PropertyMenuView.MODIFY_CALCULATED_PROPERTY:
179
- return (react_1.default.createElement(CalculatedPropertyAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, property: selectedCalculatedProperty, ids: resolvedHiliteIds, returnFn: calculatedPropertyReturn }));
180
- case PropertyMenuView.ADD_CUSTOM_CALCULATION:
181
- return (react_1.default.createElement(CustomCalculationAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, properties: convertToPropertyMap(groupProperties, calculatedProperties, customCalculations), returnFn: customCalculationReturn }));
182
- case PropertyMenuView.MODIFY_CUSTOM_CALCULATION:
183
- return (react_1.default.createElement(CustomCalculationAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, properties: convertToPropertyMap(groupProperties, calculatedProperties, customCalculations, selectedCustomCalculation === null || selectedCustomCalculation === void 0 ? void 0 : selectedCustomCalculation.propertyName), customCalculation: selectedCustomCalculation, returnFn: customCalculationReturn }));
184
- default:
185
- return (react_1.default.createElement(itwinui_react_1.InformationPanelWrapper, { className: 'gmw-property-menu-wrapper' },
186
- react_1.default.createElement("div", { className: 'gmw-property-header' },
187
- react_1.default.createElement(utils_1.WidgetHeader, { title: `${group.groupName}`, returnFn: goBack }),
188
- react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless', onClick: () => setIsInformationPanelOpen(true) },
189
- react_1.default.createElement(itwinui_icons_react_1.SvgProperties, null))),
190
- react_1.default.createElement("div", { className: 'gmw-property-menu-container' },
191
- !hideGroupProps && (react_1.default.createElement("div", { className: 'gmw-property-table' },
192
- react_1.default.createElement(GroupPropertyTable_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onGroupPropertyModify: onGroupPropertyModify, setSelectedGroupProperty: setSelectedGroupProperty, setGroupModifyView: setPropertyMenuView, isLoadingGroupProperties: isLoadingGroupProperties, groupProperties: groupProperties, refreshGroupProperties: refreshGroupProperties, selectedGroupProperty: selectedGroupProperty }))),
193
- !hideCalculatedProps && (react_1.default.createElement("div", { className: 'gmw-property-table' },
194
- react_1.default.createElement(CalculatedPropertyTable_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onCalculatedPropertyModify: onCalculatedPropertyModify, setSelectedCalculatedProperty: setSelectedCalculatedProperty, setGroupModifyView: setPropertyMenuView, isLoadingCalculatedProperties: isLoadingCalculatedProperties, calculatedProperties: calculatedProperties, refreshCalculatedProperties: refreshCalculatedProperties, selectedCalculatedProperty: selectedCalculatedProperty }))),
195
- !hideCustomCalculationProps && (react_1.default.createElement("div", { className: 'gmw-property-table' },
196
- react_1.default.createElement(CustomCalculationTable_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onCustomCalculationModify: onCustomCalculationModify, setSelectedCustomCalculation: setSelectedCustomCalculation, setGroupModifyView: setPropertyMenuView, isLoadingCustomCalculations: isLoadingCustomCalculations, customCalculations: customCalculations, refreshCustomCalculations: refreshCustomCalculations, selectedCustomCalculation: selectedCustomCalculation })))),
197
- react_1.default.createElement(itwinui_react_1.InformationPanel, { className: 'gmw-information-panel', isOpen: isInformationPanelOpen },
198
- react_1.default.createElement(itwinui_react_1.InformationPanelHeader, { onClose: () => setIsInformationPanelOpen(false) },
199
- react_1.default.createElement(itwinui_react_1.Text, { variant: 'subheading' }, `${group.groupName} Information`)),
200
- react_1.default.createElement(itwinui_react_1.InformationPanelBody, null,
201
- react_1.default.createElement("div", { className: 'gmw-information-body' },
202
- react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: 'Query', rows: 15, readOnly: true, defaultValue: group.query }))))));
203
- }
90
+ }, [iModelConnection, group.query, group.groupName, group, hilitedElementsQueryCache, showGroupColor, color]);
91
+ return (react_1.default.createElement(itwinui_react_1.InformationPanelWrapper, { className: 'gmw-property-menu-wrapper' },
92
+ react_1.default.createElement("div", { className: 'gmw-property-menu-container' },
93
+ react_1.default.createElement("div", { className: "gmw-property-menu-toolbar" },
94
+ react_1.default.createElement(itwinui_react_1.ToggleSwitch, { label: 'Color Group', labelPosition: 'left', disabled: isLoading, checked: showGroupColor, onChange: () => setShowGroupColor((b) => !b) }),
95
+ react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless', onClick: () => setIsInformationPanelOpen(true) },
96
+ react_1.default.createElement(itwinui_icons_react_1.SvgProperties, null))),
97
+ !hideGroupProps && (react_1.default.createElement(GroupPropertyTable_1.GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties !== null && groupProperties !== void 0 ? groupProperties : [], refresh: refreshGroupProperties })),
98
+ !hideCalculatedProps && (react_1.default.createElement(CalculatedPropertyTable_1.CalculatedPropertyTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCalculatedProperty, onClickModify: onClickModifyCalculatedProperty, isLoading: isLoadingCalculatedProperties, calculatedProperties: calculatedProperties !== null && calculatedProperties !== void 0 ? calculatedProperties : [], refresh: refreshCalculatedProperties })),
99
+ !hideCustomCalculationProps && (react_1.default.createElement(CustomCalculationTable_1.CustomCalculationTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCustomCalculationProperty, onClickModify: onClickModifyCustomCalculation, isLoading: isLoadingCustomCalculations, customCalculations: customCalculationProperties !== null && customCalculationProperties !== void 0 ? customCalculationProperties : [], refresh: refreshCustomCalculations }))),
100
+ react_1.default.createElement(GroupInformationPanel_1.GroupInformationPanel, { isOpen: isInformationPanelOpen, onClose: () => setIsInformationPanelOpen(false), query: group.query, groupName: group.groupName })));
204
101
  };
205
102
  exports.PropertyMenu = PropertyMenu;
206
103
  //# sourceMappingURL=PropertyMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wEAA4D;AAC5D,oDAA+D;AAC/D,+CAAyE;AAEzE,mCAAuC;AACvC,+CAMuB;AAEvB,+BAA6B;AAC7B,gFAAwD;AACxD,0FAAkE;AAElE,8EAAsD;AAItD,wFAAgE;AAChE,wDAU8B;AAK9B,sFAA8D;AAC9D,wFAAgE;AAChE,oEAAoD;AACpD,oEAA2D;AAE3D,wDAAgE;AAChE,yEAAkE;AAClE,iFAAiF;AAYjF,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,6DAAyC,CAAA;IACzC,mEAA+C,CAAA;IAC/C,uEAAmD,CAAA;IACnD,6EAAyD,CAAA;IACzD,qEAAiD,CAAA;IACjD,2EAAuD,CAAA;AACzD,CAAC,EARW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAQ3B;AAED,MAAM,wBAAwB,GAAG,CAAC,GAAY,EAAoB,EAAE;IAClE,IAAI,CAAC,GAAG;QACN,OAAO,WAAW,CAAC;IAErB,QAAQ,GAAG,CAAC,WAA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E,GAAG,KAAK,CAAC,SAAS,cAAc,CAAQ,CAC7C;oBACzB,8BAAC,oCAAoB;wBACnB,uCAAK,SAAS,EAAC,sBAAsB;4BACnC,8BAAC,+BAAe,IACd,KAAK,EAAC,OAAO,EACb,IAAI,EAAE,EAAE,EACR,QAAQ,QACR,YAAY,EAAE,KAAK,CAAC,KAAK,GACzB,CACE,CACe,CACN,CACK,CAC3B,CAAC;KACL;AACH,CAAC,CAAC;AAlSW,QAAA,YAAY,gBAkSvB","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 { IModelConnection } from \"@itwin/core-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\n\nimport { WidgetHeader } from \"./utils\";\nimport {\n clearEmphasizedOverriddenElements,\n manufactureKeys,\n visualizeElements,\n visualizeElementsByKeys,\n zoomToElements,\n} from \"./viewerUtils\";\nimport type { IGroupTyped } from \"./Grouping\";\nimport \"./PropertyMenu.scss\";\nimport GroupPropertyAction from \"./GroupPropertyAction\";\nimport CalculatedPropertyAction from \"./CalculatedPropertyAction\";\nimport type { IGroupPropertyTyped } from \"./GroupPropertyTable\";\nimport GroupPropertyTable from \"./GroupPropertyTable\";\nimport type {\n ICalculatedPropertyTyped,\n} from \"./CalculatedPropertyTable\";\nimport CalculatedPropertyTable from \"./CalculatedPropertyTable\";\nimport {\n IconButton,\n InformationPanel,\n InformationPanelBody,\n InformationPanelHeader,\n InformationPanelWrapper,\n LabeledTextarea,\n ProgressRadial,\n Text,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport type { CellProps } from \"react-table\";\nimport type {\n ICustomCalculationTyped,\n} from \"./CustomCalculationTable\";\nimport CustomCalculationTable from \"./CustomCalculationTable\";\nimport CustomCalculationAction from \"./CustomCalculationAction\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { SvgProperties } from \"@itwin/itwinui-icons-react\";\nimport type { PossibleDataType, PropertyMap } from \"../../formula/Types\";\nimport { useCombinedFetchRefresh } from \"../hooks/useFetchData\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\ninterface PropertyModifyProps {\n iModelId: string;\n mappingId: string;\n group: IGroupTyped;\n goBack: () => Promise<void>;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\nexport enum PropertyMenuView {\n DEFAULT = \"default\",\n ADD_GROUP_PROPERTY = \"add_group_property\",\n MODIFY_GROUP_PROPERTY = \"modify_group_property\",\n ADD_CALCULATED_PROPERTY = \"add_calculated_property\",\n MODIFY_CALCULATED_PROPERTY = \"modify_calculated_property\",\n ADD_CUSTOM_CALCULATION = \"add_custom_calculation\",\n MODIFY_CUSTOM_CALCULATION = \"modify_custom_calculation\",\n}\n\nconst stringToPossibleDataType = (str?: string): PossibleDataType => {\n if (!str)\n return \"Undefined\";\n\n switch (str.toLowerCase()) {\n case \"double\":\n case \"number\": return \"Number\";\n case \"string\": return \"String\";\n case \"boolean\": return \"Boolean\";\n default: return \"Undefined\";\n }\n};\n\nconst convertToPropertyMap = (\n groupProperties: IGroupPropertyTyped[],\n calculatedProperties: ICalculatedPropertyTyped[],\n customCalculations: ICustomCalculationTyped[],\n selectedPropertyName?: string\n): PropertyMap => {\n const map: PropertyMap = {};\n const selectedLowerName = selectedPropertyName?.toLowerCase();\n\n groupProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n calculatedProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName)\n map[lowerName] = \"Number\";\n });\n\n customCalculations.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n return map;\n};\n\nexport const PropertyMenu = ({\n iModelId,\n mappingId,\n group,\n goBack,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyModifyProps) => {\n const groupId = group.id;\n\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const [propertyMenuView, setPropertyMenuView] = useState<PropertyMenuView>(\n PropertyMenuView.DEFAULT,\n );\n const [selectedGroupProperty, setSelectedGroupProperty] =\n useState<IGroupPropertyTyped | undefined>(undefined);\n const [selectedCalculatedProperty, setSelectedCalculatedProperty] =\n useState<ICalculatedPropertyTyped | undefined>(undefined);\n const [selectedCustomCalculation, setSelectedCustomCalculation] =\n useState<ICustomCalculationTyped | undefined>(undefined);\n const [isInformationPanelOpen, setIsInformationPanelOpen] =\n useState<boolean>(false);\n const [resolvedHiliteIds, setResolvedHiliteIds] = useState<string[]>([]);\n const [keySet, setKeySet] = useState<KeySet>();\n const [isLoading, setIsLoading] = useState<boolean>(true);\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, data: groupProperties, refreshData: refreshGroupProperties } =\n useCombinedFetchRefresh<IGroupPropertyTyped>(fetchGroupProperties);\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, data: calculatedProperties, refreshData: refreshCalculatedProperties } =\n useCombinedFetchRefresh<ICalculatedPropertyTyped>(fetchCalculatedProperties);\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, data: customCalculations, refreshData: refreshCustomCalculations } =\n useCombinedFetchRefresh<ICustomCalculationTyped>(fetchCustomCalculations);\n\n useEffect(() => {\n const initialize = async () => {\n try {\n const query = group.query;\n const queryRowCount = await iModelConnection.queryRowCount(query);\n if (queryRowCount === 0) {\n toaster.warning(\"The query is valid but produced no results.\");\n await goBack();\n }\n const keys = await manufactureKeys(query, iModelConnection);\n setKeySet(keys);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n clearEmphasizedOverriddenElements();\n const resolvedIds = await visualizeElementsByKeys(keys, \"red\");\n await zoomToElements(resolvedIds);\n setResolvedHiliteIds(resolvedIds);\n setIsLoading(false);\n } catch {\n toaster.negative(`Could not load ${group.groupName}.`);\n await goBack();\n }\n };\n void initialize();\n }, [iModelConnection, group.query, goBack, group.groupName]);\n\n const onGroupPropertyModify = useCallback(\n (value: CellProps<IGroupPropertyTyped>) => {\n setSelectedGroupProperty(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_GROUP_PROPERTY);\n },\n [],\n );\n\n const onCalculatedPropertyModify = useCallback(\n (value: CellProps<ICalculatedPropertyTyped>) => {\n setSelectedCalculatedProperty(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_CALCULATED_PROPERTY);\n },\n [],\n );\n\n const onCustomCalculationModify = useCallback(\n (value: CellProps<ICustomCalculationTyped>) => {\n setSelectedCustomCalculation(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_CUSTOM_CALCULATION);\n },\n [],\n );\n\n const groupPropertyReturn = useCallback(async (modified: boolean) => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshGroupProperties();\n }, [refreshGroupProperties]);\n\n const calculatedPropertyReturn = useCallback(async (modified: boolean) => {\n visualizeElements(resolvedHiliteIds, \"red\");\n await zoomToElements(resolvedHiliteIds);\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshCalculatedProperties();\n }, [resolvedHiliteIds, refreshCalculatedProperties]);\n\n const customCalculationReturn = useCallback(async (modified: boolean) => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshCustomCalculations();\n }, [refreshCustomCalculations]);\n\n if (isLoading) {\n return (\n <div className='gmw-loading-overlay'>\n <Text>Loading Group</Text>\n <ProgressRadial indeterminate />\n <Text>Please wait...</Text>\n </div>\n );\n }\n\n switch (propertyMenuView) {\n case PropertyMenuView.ADD_GROUP_PROPERTY:\n return (\n <GroupPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n keySet={keySet ?? new KeySet()}\n returnFn={groupPropertyReturn}\n />\n );\n case PropertyMenuView.MODIFY_GROUP_PROPERTY:\n return (\n <GroupPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n keySet={keySet ?? new KeySet()}\n groupPropertyId={selectedGroupProperty?.id ?? \"\"}\n groupPropertyName={selectedGroupProperty?.propertyName ?? \"\"}\n returnFn={groupPropertyReturn}\n />\n );\n case PropertyMenuView.ADD_CALCULATED_PROPERTY:\n return (\n <CalculatedPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n ids={resolvedHiliteIds}\n returnFn={calculatedPropertyReturn}\n />\n );\n case PropertyMenuView.MODIFY_CALCULATED_PROPERTY:\n return (\n <CalculatedPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n property={selectedCalculatedProperty}\n ids={resolvedHiliteIds}\n returnFn={calculatedPropertyReturn}\n />\n );\n case PropertyMenuView.ADD_CUSTOM_CALCULATION:\n return (\n <CustomCalculationAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n properties={convertToPropertyMap(groupProperties, calculatedProperties, customCalculations)}\n returnFn={customCalculationReturn}\n />\n );\n case PropertyMenuView.MODIFY_CUSTOM_CALCULATION:\n return (\n <CustomCalculationAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n properties={convertToPropertyMap(groupProperties, calculatedProperties, customCalculations, selectedCustomCalculation?.propertyName)}\n customCalculation={selectedCustomCalculation}\n returnFn={customCalculationReturn}\n />\n );\n default:\n return (\n <InformationPanelWrapper className='gmw-property-menu-wrapper'>\n <div className='gmw-property-header'>\n <WidgetHeader\n title={`${group.groupName}`}\n returnFn={goBack}\n />\n <IconButton\n styleType='borderless'\n onClick={() => setIsInformationPanelOpen(true)}\n >\n <SvgProperties />\n </IconButton>\n </div>\n <div className='gmw-property-menu-container'>\n {!hideGroupProps && (\n <div className='gmw-property-table'>\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onGroupPropertyModify={onGroupPropertyModify}\n setSelectedGroupProperty={setSelectedGroupProperty}\n setGroupModifyView={setPropertyMenuView}\n isLoadingGroupProperties={isLoadingGroupProperties}\n groupProperties={groupProperties}\n refreshGroupProperties={refreshGroupProperties}\n selectedGroupProperty={selectedGroupProperty}\n />\n </div>\n )}\n\n {!hideCalculatedProps && (\n <div className='gmw-property-table'>\n <CalculatedPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onCalculatedPropertyModify={onCalculatedPropertyModify}\n setSelectedCalculatedProperty={setSelectedCalculatedProperty}\n setGroupModifyView={setPropertyMenuView}\n isLoadingCalculatedProperties={isLoadingCalculatedProperties}\n calculatedProperties={calculatedProperties}\n refreshCalculatedProperties={refreshCalculatedProperties}\n selectedCalculatedProperty={selectedCalculatedProperty}\n />\n </div>\n )}\n {!hideCustomCalculationProps && (\n <div className='gmw-property-table'>\n <CustomCalculationTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onCustomCalculationModify={onCustomCalculationModify}\n setSelectedCustomCalculation={setSelectedCustomCalculation}\n setGroupModifyView={setPropertyMenuView}\n isLoadingCustomCalculations={isLoadingCustomCalculations}\n customCalculations={customCalculations}\n refreshCustomCalculations={refreshCustomCalculations}\n selectedCustomCalculation={selectedCustomCalculation}\n />\n </div>\n )}\n </div>\n <InformationPanel\n className='gmw-information-panel'\n isOpen={isInformationPanelOpen}\n >\n <InformationPanelHeader\n onClose={() => setIsInformationPanelOpen(false)}\n >\n <Text variant='subheading'>{`${group.groupName} Information`}</Text>\n </InformationPanelHeader>\n <InformationPanelBody>\n <div className='gmw-information-body'>\n <LabeledTextarea\n label='Query'\n rows={15}\n readOnly\n defaultValue={group.query}\n />\n </div>\n </InformationPanelBody>\n </InformationPanel>\n </InformationPanelWrapper>\n );\n }\n};\n"]}
1
+ {"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wEAA4D;AAC5D,oDAA+D;AAC/D,+CAA4D;AAE5D,+CAIuB;AACvB,+BAA6B;AAC7B,6DAA0D;AAC1D,wDAK8B;AAC9B,wDAAgE;AAChE,yEAAkE;AAClE,iFAAiF;AAEjF,mDAAiE;AACjE,uFAAuF;AACvF,mEAAmE;AACnE,uEAAoE;AACpE,qEAAkE;AAClE,oEAA2D;AAC3D,mEAAgE;AAiBzD,MAAM,YAAY,GAAG,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,KAAK,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,mCAAmC,EACnC,8BAA8B,EAC9B,cAAc,GAAG,KAAK,EACtB,mBAAmB,GAAG,KAAK,EAC3B,0BAA0B,GAAG,KAAK,GAChB,EAAE,EAAE;IACtB,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7B,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,sDAA2B,EAAE,CAAC;IAC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A0B,IAAI,CAC9B,8BAAC,+CAAsB,IACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,mCAAmC,EAC/C,aAAa,EAAE,8BAA8B,EAC7C,SAAS,EAAE,2BAA2B,EACtC,kBAAkB,EAAE,2BAA2B,aAA3B,2BAA2B,cAA3B,2BAA2B,GAAI,EAAE,EACrD,OAAO,EAAE,yBAAyB,GAClC,CACH,CACG;QACN,8BAAC,6CAAqB,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;AApJW,QAAA,YAAY,gBAoJvB","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"]}
@@ -2,33 +2,13 @@
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';
6
-
7
- .gmw-loading-overlay {
8
- display: flex;
9
- justify-content: center;
10
- align-items: center;
11
- flex-direction: column;
12
- gap: $iui-baseline;
13
- height: 100%;
14
- }
5
+ @import "~@itwin/itwinui-css/scss/variables";
15
6
 
16
7
  .gmw-property-menu-wrapper {
17
8
  display: flex;
18
9
  flex-direction: column;
19
10
  height: 100%;
20
11
 
21
- .gmw-information-panel {
22
- max-width: 100%;
23
- width: 100%;
24
-
25
- .gmw-information-body {
26
- textarea {
27
- resize: vertical;
28
- }
29
- }
30
- }
31
-
32
12
  .gmw-property-header {
33
13
  display: flex;
34
14
  justify-content: space-between;
@@ -38,14 +18,10 @@
38
18
  display: flex;
39
19
  flex-direction: column;
40
20
  overflow: auto;
41
- gap: $iui-baseline * 3;
42
- .gmw-property-table {
21
+ gap: $iui-baseline * 2;
22
+ .gmw-property-menu-toolbar {
43
23
  display: flex;
44
- flex-direction: column;
45
- gap: $iui-baseline;
46
- button {
47
- align-self: flex-start;
48
- }
24
+ justify-content: space-between;
49
25
  }
50
26
  }
51
27
  }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export interface PropertyNameCellProps<T extends {
3
+ propertyName: string;
4
+ }> {
5
+ property: T;
6
+ onClickModify?: (value: T) => void;
7
+ }
8
+ export declare const PropertyNameCell: <T extends {
9
+ propertyName: string;
10
+ }>({ property, onClickModify, }: PropertyNameCellProps<T>) => JSX.Element;
11
+ //# sourceMappingURL=PropertyNameCell.d.ts.map
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PropertyNameCell = void 0;
7
+ /*---------------------------------------------------------------------------------------------
8
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
9
+ * See LICENSE.md in the project root for license terms and full copyright notice.
10
+ *--------------------------------------------------------------------------------------------*/
11
+ const react_1 = __importDefault(require("react"));
12
+ const itwinui_react_1 = require("@itwin/itwinui-react");
13
+ const PropertyNameCell = ({ property, onClickModify, }) => onClickModify ? (react_1.default.createElement("div", { className: "iui-anchor", onClick: () => onClickModify(property) }, property.propertyName)) : (react_1.default.createElement(itwinui_react_1.Text, null, property.propertyName));
14
+ exports.PropertyNameCell = PropertyNameCell;
15
+ //# sourceMappingURL=PropertyNameCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyNameCell.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyNameCell.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,wDAA4C;AAOrC,MAAM,gBAAgB,GAAG,CAAsC,EACpE,QAAQ,EACR,aAAa,GACY,EAAE,EAAE,CAC7B,aAAa,CAAC,CAAC,CAAC,CACd,uCAAK,SAAS,EAAC,YAAY,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,IAC/D,QAAQ,CAAC,YAAY,CAClB,CACP,CAAC,CAAC,CAAC,CACF,8BAAC,oBAAI,QAAE,QAAQ,CAAC,YAAY,CAAQ,CACrC,CAAC;AAVS,QAAA,gBAAgB,oBAUzB","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 { Text } from \"@itwin/itwinui-react\";\n\nexport interface PropertyNameCellProps<T extends { propertyName: string }> {\n property: T;\n onClickModify?: (value: T) => void;\n}\n\nexport const PropertyNameCell = <T extends { propertyName: string },>({\n property,\n onClickModify,\n}: PropertyNameCellProps<T>) =>\n onClickModify ? (\n <div className=\"iui-anchor\" onClick={() => onClickModify(property)}>\n {property.propertyName}\n </div>\n ) : (\n <Text>{property.propertyName}</Text>\n );\n"]}
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import type { Column } from "react-table";
3
+ import "./PropertyTable.scss";
4
+ export interface PropertyTableItem {
5
+ propertyName: string;
6
+ id: string;
7
+ }
8
+ export interface PropertyTableProps<T extends PropertyTableItem> {
9
+ propertyType: string;
10
+ columnsFactory: (handleShowDeleteModal: (value: T) => void) => ReadonlyArray<Column<T>>;
11
+ data: T[];
12
+ isLoading: boolean;
13
+ onClickAdd?: () => void;
14
+ refreshProperties: () => Promise<void>;
15
+ deleteProperty: (propertyId: string) => Promise<void>;
16
+ }
17
+ export declare const PropertyTable: <T extends PropertyTableItem>({ propertyType, columnsFactory, data, isLoading, onClickAdd, refreshProperties, deleteProperty, }: PropertyTableProps<T>) => JSX.Element;
18
+ //# sourceMappingURL=PropertyTable.d.ts.map
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.PropertyTable = void 0;
26
+ /*---------------------------------------------------------------------------------------------
27
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
28
+ * See LICENSE.md in the project root for license terms and full copyright notice.
29
+ *--------------------------------------------------------------------------------------------*/
30
+ const itwinui_react_1 = require("@itwin/itwinui-react");
31
+ const react_1 = __importStar(require("react"));
32
+ const DeleteModal_1 = __importDefault(require("./DeleteModal"));
33
+ const PropertyTableToolbar_1 = require("./PropertyTableToolbar");
34
+ require("./PropertyTable.scss");
35
+ const PropertyTable = ({ propertyType, columnsFactory, data, isLoading, onClickAdd, refreshProperties, deleteProperty, }) => {
36
+ const [showDeleteModal, setShowDeleteModal] = react_1.useState(undefined);
37
+ const handleDeleteProperty = react_1.useCallback(async () => {
38
+ var _a;
39
+ await deleteProperty((_a = showDeleteModal === null || showDeleteModal === void 0 ? void 0 : showDeleteModal.id) !== null && _a !== void 0 ? _a : "");
40
+ }, [deleteProperty, showDeleteModal === null || showDeleteModal === void 0 ? void 0 : showDeleteModal.id]);
41
+ const handleShowDeleteModal = react_1.useCallback((property) => {
42
+ setShowDeleteModal(property);
43
+ }, []);
44
+ const handleCloseDeleteModal = () => {
45
+ setShowDeleteModal(undefined);
46
+ };
47
+ const memoizedColumns = react_1.useMemo(() => columnsFactory(handleShowDeleteModal), [columnsFactory, handleShowDeleteModal]);
48
+ return (react_1.default.createElement("div", { className: "gmw-property-table-container" },
49
+ react_1.default.createElement(PropertyTableToolbar_1.PropertyTableToolbar, { propertyType: propertyType, onClickAddProperty: onClickAdd, refreshProperties: refreshProperties, isLoading: isLoading }),
50
+ react_1.default.createElement(itwinui_react_1.Table, { data: isLoading ? [] : data, density: 'extra-condensed', columns: memoizedColumns, emptyTableContent: `No ${propertyType} Properties`, isSortable: true, isLoading: isLoading }),
51
+ react_1.default.createElement(DeleteModal_1.default, { entityName: showDeleteModal === null || showDeleteModal === void 0 ? void 0 : showDeleteModal.propertyName, onClose: handleCloseDeleteModal, onDelete: handleDeleteProperty, refresh: refreshProperties })));
52
+ };
53
+ exports.PropertyTable = PropertyTable;
54
+ //# sourceMappingURL=PropertyTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyTable.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAA6C;AAC7C,+CAA8D;AAG9D,gEAAwC;AACxC,iEAA8D;AAC9D,gCAA8B;AAiBvB,MAAM,aAAa,GAAG,CAA8B,EACzD,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,cAAc,GACQ,EAAE,EAAE;IAE1B,MAAM,CAAC,eAAe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AO,EAAE,iBAAiB,GAC1B,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAnDW,QAAA,aAAa,iBAmDxB","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 { Table } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { Column } from \"react-table\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport DeleteModal from \"./DeleteModal\";\nimport { PropertyTableToolbar } from \"./PropertyTableToolbar\";\nimport \"./PropertyTable.scss\";\n\nexport interface PropertyTableItem {\n propertyName: string;\n id: string;\n}\n\nexport interface PropertyTableProps<T extends PropertyTableItem> {\n propertyType: string;\n columnsFactory: (handleShowDeleteModal: (value: T) => void) => ReadonlyArray<Column<T>>;\n data: T[];\n isLoading: boolean;\n onClickAdd?: () => void;\n refreshProperties: () => Promise<void>;\n deleteProperty: (propertyId: string) => Promise<void>;\n}\n\nexport const PropertyTable = <T extends PropertyTableItem>({\n propertyType,\n columnsFactory,\n data,\n isLoading,\n onClickAdd,\n refreshProperties,\n deleteProperty,\n}: PropertyTableProps<T>) => {\n\n const [showDeleteModal, setShowDeleteModal] = useState<T | undefined>(undefined);\n\n const handleDeleteProperty = useCallback(async () => {\n await deleteProperty(showDeleteModal?.id ?? \"\");\n }, [deleteProperty, showDeleteModal?.id]);\n\n const handleShowDeleteModal = useCallback((property: T) => {\n setShowDeleteModal(property);\n }, []);\n\n const handleCloseDeleteModal = () => {\n setShowDeleteModal(undefined);\n };\n\n const memoizedColumns = useMemo(() =>\n columnsFactory(handleShowDeleteModal), [columnsFactory, handleShowDeleteModal]);\n\n return (\n <div className=\"gmw-property-table-container\">\n <PropertyTableToolbar\n propertyType={propertyType}\n onClickAddProperty={onClickAdd}\n refreshProperties={refreshProperties}\n isLoading={isLoading}\n />\n <Table<CreateTypeFromInterface<T>>\n data={isLoading ? [] : data}\n density='extra-condensed'\n columns={memoizedColumns}\n emptyTableContent={`No ${propertyType} Properties`}\n isSortable\n isLoading={isLoading}\n />\n <DeleteModal\n entityName={showDeleteModal?.propertyName}\n onClose={handleCloseDeleteModal}\n onDelete={handleDeleteProperty}\n refresh={refreshProperties}\n />\n </div>\n );\n};\n"]}
@@ -0,0 +1,11 @@
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-table-container {
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: $iui-baseline;
11
+ }
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import "./PropertyTableToolbar.scss";
3
+ export interface PropertyTableToolbarProps {
4
+ propertyType: string;
5
+ onClickAddProperty?: () => void;
6
+ refreshProperties: () => void;
7
+ isLoading: boolean;
8
+ }
9
+ export declare const PropertyTableToolbar: ({ propertyType, onClickAddProperty, refreshProperties, isLoading, }: PropertyTableToolbarProps) => JSX.Element;
10
+ //# sourceMappingURL=PropertyTableToolbar.d.ts.map
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PropertyTableToolbar = void 0;
7
+ /*---------------------------------------------------------------------------------------------
8
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
9
+ * See LICENSE.md in the project root for license terms and full copyright notice.
10
+ *--------------------------------------------------------------------------------------------*/
11
+ const react_1 = __importDefault(require("react"));
12
+ const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
13
+ const itwinui_react_1 = require("@itwin/itwinui-react");
14
+ require("./PropertyTableToolbar.scss");
15
+ const PropertyTableToolbar = ({ propertyType, onClickAddProperty, refreshProperties, isLoading, }) => (react_1.default.createElement("div", { className: "gmw-property-table-toolbar" },
16
+ onClickAddProperty && (react_1.default.createElement(itwinui_react_1.Button, { startIcon: react_1.default.createElement(itwinui_icons_react_1.SvgAdd, null), styleType: "high-visibility", onClick: onClickAddProperty },
17
+ "Add ",
18
+ propertyType,
19
+ " Property")),
20
+ react_1.default.createElement(itwinui_react_1.IconButton, { title: "Refresh", className: "gmw-property-table-refresh-button", onClick: refreshProperties, disabled: isLoading, styleType: "borderless" },
21
+ react_1.default.createElement(itwinui_icons_react_1.SvgRefresh, null))));
22
+ exports.PropertyTableToolbar = PropertyTableToolbar;
23
+ //# sourceMappingURL=PropertyTableToolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyTableToolbar.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyTableToolbar.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,oEAAgE;AAChE,wDAA0D;AAC1D,uCAAqC;AAS9B,MAAM,oBAAoB,GAAG,CAAC,EACnC,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,GACiB,EAAE,EAAE,CAAC,CAC/B,uCAAK,SAAS,EAAC,4BAA4B;IACxC,kBAAkB,IAAI,CACrB,8BAAC,sBAAM,IACL,SAAS,EAAE,8BAAC,4BAAM,OAAG,EACrB,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,kBAAkB;;QAEtB,YAAY;oBACV,CACV;IACD,8BAAC,0BAAU,IACT,KAAK,EAAC,SAAS,EACf,SAAS,EAAC,mCAAmC,EAC7C,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAC,YAAY;QAEtB,8BAAC,gCAAU,OAAG,CACH,CACT,CACP,CAAC;AA1BW,QAAA,oBAAoB,wBA0B/B","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 { SvgAdd, SvgRefresh } from \"@itwin/itwinui-icons-react\";\nimport { Button, IconButton } from \"@itwin/itwinui-react\";\nimport \"./PropertyTableToolbar.scss\";\n\nexport interface PropertyTableToolbarProps {\n propertyType: string;\n onClickAddProperty?: () => void;\n refreshProperties: () => void;\n isLoading: boolean;\n}\n\nexport const PropertyTableToolbar = ({\n propertyType,\n onClickAddProperty,\n refreshProperties,\n isLoading,\n}: PropertyTableToolbarProps) => (\n <div className=\"gmw-property-table-toolbar\">\n {onClickAddProperty && (\n <Button\n startIcon={<SvgAdd />}\n styleType=\"high-visibility\"\n onClick={onClickAddProperty}\n >\n Add {propertyType} Property\n </Button>\n )}\n <IconButton\n title=\"Refresh\"\n className=\"gmw-property-table-refresh-button\"\n onClick={refreshProperties}\n disabled={isLoading}\n styleType=\"borderless\"\n >\n <SvgRefresh />\n </IconButton>\n </div>\n);\n"]}
@@ -0,0 +1,12 @@
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-table-toolbar {
7
+ display: flex;
8
+ justify-content: space-between;
9
+ .gmw-property-table-refresh-button {
10
+ margin-left: auto;
11
+ }
12
+ }
@@ -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>;