@itwin/grouping-mapping-widget 0.35.4 → 0.37.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 (598) hide show
  1. package/lib/cjs/GroupingMappingWidget.d.ts +28 -0
  2. package/lib/cjs/GroupingMappingWidget.js +58 -0
  3. package/lib/cjs/GroupingMappingWidget.js.map +1 -0
  4. package/lib/cjs/WidgetShell/GroupingMapping.d.ts +1 -2
  5. package/lib/cjs/WidgetShell/GroupingMapping.js +5 -4
  6. package/lib/cjs/WidgetShell/GroupingMapping.js.map +1 -1
  7. package/lib/cjs/WidgetShell/GroupingMappingContent.d.ts +2 -3
  8. package/lib/cjs/WidgetShell/GroupingMappingContent.js.map +1 -1
  9. package/lib/cjs/WidgetShell/GroupingMappingHeader.d.ts +0 -1
  10. package/lib/cjs/WidgetShell/GroupingMappingWidget.js +4 -2
  11. package/lib/cjs/WidgetShell/GroupingMappingWidget.js.map +1 -1
  12. package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.d.ts +2 -3
  13. package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js +6 -5
  14. package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
  15. package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.d.ts +0 -1
  16. package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js +3 -2
  17. package/lib/cjs/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -1
  18. package/lib/cjs/common/hooks/useIsMounted.d.ts +0 -1
  19. package/lib/cjs/common/hooks/useMemoizedCollectionPick.js +1 -2
  20. package/lib/cjs/common/hooks/useMemoizedCollectionPick.js.map +1 -1
  21. package/lib/cjs/common/utils.d.ts +1 -1
  22. package/lib/cjs/common/utils.js +22 -32
  23. package/lib/cjs/common/utils.js.map +1 -1
  24. package/lib/cjs/common/viewerUtils.js.map +1 -1
  25. package/lib/cjs/components/Constants.js +1 -1
  26. package/lib/cjs/components/Constants.js.map +1 -1
  27. package/lib/cjs/components/GroupingMappingContext.js +3 -2
  28. package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
  29. package/lib/cjs/components/Groups/Editing/GroupAction.d.ts +2 -3
  30. package/lib/cjs/components/Groups/Editing/GroupAction.js +16 -11
  31. package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
  32. package/lib/cjs/components/Groups/Editing/GroupDetails.d.ts +0 -1
  33. package/lib/cjs/components/Groups/Editing/GroupDetails.js +4 -3
  34. package/lib/cjs/components/Groups/Editing/GroupDetails.js.map +1 -1
  35. package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.d.ts +0 -1
  36. package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js +3 -2
  37. package/lib/cjs/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -1
  38. package/lib/cjs/components/Groups/Editing/GroupDetailsStep.d.ts +2 -3
  39. package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js +5 -4
  40. package/lib/cjs/components/Groups/Editing/GroupDetailsStep.js.map +1 -1
  41. package/lib/cjs/components/Groups/GroupColorLegend.d.ts +0 -1
  42. package/lib/cjs/components/Groups/GroupListItem.d.ts +0 -1
  43. package/lib/cjs/components/Groups/GroupListItem.js.map +1 -1
  44. package/lib/cjs/components/Groups/GroupMenuActions.d.ts +0 -1
  45. package/lib/cjs/components/Groups/GroupMenuActions.js +5 -4
  46. package/lib/cjs/components/Groups/GroupMenuActions.js.map +1 -1
  47. package/lib/cjs/components/Groups/GroupOverlapProgressBar.d.ts +0 -1
  48. package/lib/cjs/components/Groups/GroupOverlapProgressBar.js +2 -1
  49. package/lib/cjs/components/Groups/GroupOverlapProgressBar.js.map +1 -1
  50. package/lib/cjs/components/Groups/Groups.js.map +1 -1
  51. package/lib/cjs/components/Groups/GroupsAddButton.d.ts +0 -1
  52. package/lib/cjs/components/Groups/GroupsAddButton.js +2 -1
  53. package/lib/cjs/components/Groups/GroupsAddButton.js.map +1 -1
  54. package/lib/cjs/components/Groups/GroupsShowHideButtons.d.ts +0 -1
  55. package/lib/cjs/components/Groups/GroupsShowHideButtons.js +2 -1
  56. package/lib/cjs/components/Groups/GroupsShowHideButtons.js.map +1 -1
  57. package/lib/cjs/components/Groups/GroupsView.d.ts +1 -1
  58. package/lib/cjs/components/Groups/GroupsView.js +4 -3
  59. package/lib/cjs/components/Groups/GroupsView.js.map +1 -1
  60. package/lib/cjs/components/Groups/GroupsVisualization.d.ts +0 -1
  61. package/lib/cjs/components/Groups/GroupsVisualization.js +9 -6
  62. package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
  63. package/lib/cjs/components/Groups/GroupsVisualizationActions.d.ts +0 -1
  64. package/lib/cjs/components/Groups/GroupsVisualizationActions.js +3 -2
  65. package/lib/cjs/components/Groups/GroupsVisualizationActions.js.map +1 -1
  66. package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.d.ts +0 -1
  67. package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js +34 -14
  68. package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
  69. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js +40 -36
  70. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
  71. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.d.ts +0 -1
  72. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js +2 -1
  73. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -1
  74. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +0 -1
  75. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +2 -1
  76. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
  77. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.d.ts +2 -3
  78. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js +7 -6
  79. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -1
  80. package/lib/cjs/components/Groups/ToggleGroupVisibility.d.ts +0 -1
  81. package/lib/cjs/components/Groups/ToggleGroupVisibility.js +3 -2
  82. package/lib/cjs/components/Groups/ToggleGroupVisibility.js.map +1 -1
  83. package/lib/cjs/components/Groups/groupsHelpers.d.ts +1 -1
  84. package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
  85. package/lib/cjs/components/Groups/hooks/useGroupsOperations.d.ts +0 -1
  86. package/lib/cjs/components/Groups/hooks/useGroupsOperations.js.map +1 -1
  87. package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js +1 -2
  88. package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
  89. package/lib/cjs/components/Groups/hooks/useVisualization.d.ts +0 -1
  90. package/lib/cjs/components/Groups/hooks/useVisualization.js +2 -1
  91. package/lib/cjs/components/Groups/hooks/useVisualization.js.map +1 -1
  92. package/lib/cjs/components/Mappings/BlockingOverlay.d.ts +0 -1
  93. package/lib/cjs/components/Mappings/Editing/MappingAction.d.ts +2 -3
  94. package/lib/cjs/components/Mappings/Editing/MappingAction.js +9 -8
  95. package/lib/cjs/components/Mappings/Editing/MappingAction.js.map +1 -1
  96. package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js +18 -8
  97. package/lib/cjs/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
  98. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.d.ts +0 -1
  99. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +20 -11
  100. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
  101. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +0 -1
  102. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +2 -1
  103. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -1
  104. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +0 -1
  105. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +2 -1
  106. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -1
  107. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +0 -1
  108. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +2 -1
  109. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -1
  110. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +0 -1
  111. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +2 -1
  112. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -1
  113. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.d.ts +0 -1
  114. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js +1 -1
  115. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js.map +1 -1
  116. package/lib/cjs/components/Mappings/Extraction/ExtractionStatusIcon.d.ts +1 -2
  117. package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.d.ts +2 -2
  118. package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js +20 -19
  119. package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
  120. package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.d.ts +2 -3
  121. package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js +19 -19
  122. package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
  123. package/lib/cjs/components/Mappings/Import/SelectIModel.d.ts +2 -3
  124. package/lib/cjs/components/Mappings/Import/SelectIModel.js +9 -8
  125. package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -1
  126. package/lib/cjs/components/Mappings/Import/SelectITwin.d.ts +2 -3
  127. package/lib/cjs/components/Mappings/Import/SelectITwin.js +15 -14
  128. package/lib/cjs/components/Mappings/Import/SelectITwin.js.map +1 -1
  129. package/lib/cjs/components/Mappings/Import/SelectMappings.d.ts +2 -3
  130. package/lib/cjs/components/Mappings/Import/SelectMappings.js +10 -9
  131. package/lib/cjs/components/Mappings/Import/SelectMappings.js.map +1 -1
  132. package/lib/cjs/components/Mappings/MappingListItem.d.ts +0 -1
  133. package/lib/cjs/components/Mappings/MappingListItem.js +1 -2
  134. package/lib/cjs/components/Mappings/MappingListItem.js.map +1 -1
  135. package/lib/cjs/components/Mappings/MappingViewActionGroup.d.ts +0 -1
  136. package/lib/cjs/components/Mappings/MappingViewActionGroup.js +5 -4
  137. package/lib/cjs/components/Mappings/MappingViewActionGroup.js.map +1 -1
  138. package/lib/cjs/components/Mappings/Mappings.d.ts +3 -4
  139. package/lib/cjs/components/Mappings/Mappings.js.map +1 -1
  140. package/lib/cjs/components/Mappings/MappingsView.d.ts +2 -2
  141. package/lib/cjs/components/Mappings/MappingsView.js +18 -16
  142. package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
  143. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +4 -3
  144. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
  145. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +1 -2
  146. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +1 -1
  147. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
  148. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +0 -1
  149. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +2 -1
  150. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
  151. package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +0 -1
  152. package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -1
  153. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +2 -3
  154. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +4 -3
  155. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
  156. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +0 -1
  157. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +19 -5
  158. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
  159. package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.d.ts +0 -1
  160. package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js +3 -2
  161. package/lib/cjs/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
  162. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +0 -1
  163. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +4 -3
  164. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
  165. package/lib/cjs/components/Properties/GroupColorToggle.d.ts +1 -2
  166. package/lib/cjs/components/Properties/GroupColorToggle.js +3 -2
  167. package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
  168. package/lib/cjs/components/Properties/GroupInformationPanel.d.ts +0 -1
  169. package/lib/cjs/components/Properties/GroupInformationPanel.js +3 -2
  170. package/lib/cjs/components/Properties/GroupInformationPanel.js.map +1 -1
  171. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.d.ts +1 -2
  172. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +28 -26
  173. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
  174. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyListItem.d.ts +0 -1
  175. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.d.ts +0 -1
  176. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +5 -4
  177. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
  178. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
  179. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +0 -1
  180. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +16 -17
  181. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
  182. package/lib/cjs/components/Properties/GroupProperties/SaveModal.d.ts +0 -1
  183. package/lib/cjs/components/Properties/GroupProperties/SaveModal.js +5 -4
  184. package/lib/cjs/components/Properties/GroupProperties/SaveModal.js.map +1 -1
  185. package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.d.ts +0 -1
  186. package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js +2 -1
  187. package/lib/cjs/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
  188. package/lib/cjs/components/Properties/PropertyAction.d.ts +0 -1
  189. package/lib/cjs/components/Properties/PropertyAction.js +7 -3
  190. package/lib/cjs/components/Properties/PropertyAction.js.map +1 -1
  191. package/lib/cjs/components/Properties/PropertyMenu.d.ts +0 -1
  192. package/lib/cjs/components/Properties/PropertyMenuWithVisualization.d.ts +0 -1
  193. package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js +2 -1
  194. package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
  195. package/lib/cjs/components/Properties/PropertyNameCell.d.ts +0 -1
  196. package/lib/cjs/components/Properties/PropertyTable.d.ts +0 -1
  197. package/lib/cjs/components/Properties/PropertyTable.js +2 -1
  198. package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
  199. package/lib/cjs/components/Properties/PropertyTableToolbar.d.ts +0 -1
  200. package/lib/cjs/components/Properties/PropertyTableToolbar.js +3 -5
  201. package/lib/cjs/components/Properties/PropertyTableToolbar.js.map +1 -1
  202. package/lib/cjs/components/Properties/ScrollableExpandableBlock.js.map +1 -1
  203. package/lib/cjs/components/Properties/hooks/useFormulaValidation.js +2 -2
  204. package/lib/cjs/components/Properties/hooks/useFormulaValidation.js.map +1 -1
  205. package/lib/cjs/components/Properties/hooks/useForwardRef.js.map +1 -1
  206. package/lib/cjs/components/Properties/hooks/useValidator.d.ts +2 -2
  207. package/lib/cjs/components/Properties/hooks/useValidator.js +12 -9
  208. package/lib/cjs/components/Properties/hooks/useValidator.js.map +1 -1
  209. package/lib/cjs/components/SharedComponents/ActionPanel.d.ts +0 -1
  210. package/lib/cjs/components/SharedComponents/ActionPanel.js +3 -2
  211. package/lib/cjs/components/SharedComponents/ActionPanel.js.map +1 -1
  212. package/lib/cjs/components/SharedComponents/DeleteModal.d.ts +0 -1
  213. package/lib/cjs/components/SharedComponents/DeleteModal.js +5 -4
  214. package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -1
  215. package/lib/cjs/components/SharedComponents/EmptyMessage.d.ts +0 -1
  216. package/lib/cjs/components/SharedComponents/LoadingOverlay.d.ts +0 -1
  217. package/lib/cjs/components/SharedComponents/LoadingOverlay.js +3 -2
  218. package/lib/cjs/components/SharedComponents/LoadingOverlay.js.map +1 -1
  219. package/lib/cjs/components/SharedComponents/LoadingSpinner.d.ts +0 -1
  220. package/lib/cjs/components/SharedComponents/StatusIcon.d.ts +1 -1
  221. package/lib/cjs/components/context/ExtractionClientContext.d.ts +0 -1
  222. package/lib/cjs/components/context/ExtractionClientContext.js.map +1 -1
  223. package/lib/cjs/components/context/ExtractionStateJobContext.js.map +1 -1
  224. package/lib/cjs/components/context/GroupHilitedElementsContext.js.map +1 -1
  225. package/lib/cjs/components/context/GroupingApiConfigContext.d.ts +2 -2
  226. package/lib/cjs/components/context/GroupingApiConfigContext.js.map +1 -1
  227. package/lib/cjs/components/context/GroupingMappingCustomUIContext.d.ts +0 -1
  228. package/lib/cjs/components/context/GroupingMappingCustomUIContext.js.map +1 -1
  229. package/lib/cjs/components/context/GroupsClientContext.d.ts +0 -1
  230. package/lib/cjs/components/context/GroupsClientContext.js.map +1 -1
  231. package/lib/cjs/components/context/IModelsClientContext.d.ts +0 -1
  232. package/lib/cjs/components/context/IModelsClientContext.js.map +1 -1
  233. package/lib/cjs/components/context/ITwinsClientContext.d.ts +0 -1
  234. package/lib/cjs/components/context/ITwinsClientContext.js.map +1 -1
  235. package/lib/cjs/components/context/MappingClientContext.d.ts +0 -1
  236. package/lib/cjs/components/context/MappingClientContext.js.map +1 -1
  237. package/lib/cjs/components/context/PropertiesClientContext.d.ts +0 -1
  238. package/lib/cjs/components/context/PropertiesClientContext.js.map +1 -1
  239. package/lib/cjs/components/context/PropertiesGroupColorContext.js.map +1 -1
  240. package/lib/cjs/components/context/PropertyGridWrapperContext.d.ts +1 -0
  241. package/lib/cjs/components/context/PropertyGridWrapperContext.js.map +1 -1
  242. package/lib/cjs/components/customUI/DefaultGroupingUI.d.ts +1 -1
  243. package/lib/cjs/components/customUI/DefaultGroupingUI.js +7 -5
  244. package/lib/cjs/components/customUI/DefaultGroupingUI.js.map +1 -1
  245. package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.d.ts +0 -1
  246. package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js +5 -3
  247. package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  248. package/lib/cjs/components/customUI/GroupingMappingCustomUI.d.ts +1 -1
  249. package/lib/cjs/components/customUI/GroupingMappingCustomUI.js +1 -1
  250. package/lib/cjs/components/customUI/GroupingMappingCustomUI.js.map +1 -1
  251. package/lib/cjs/components/customUI/ManualGroupingCustomUI.d.ts +0 -1
  252. package/lib/cjs/components/customUI/ManualGroupingCustomUI.js +5 -4
  253. package/lib/cjs/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  254. package/lib/cjs/components/customUI/SearchGroupingCustomUI.d.ts +0 -1
  255. package/lib/cjs/components/customUI/SearchGroupingCustomUI.js +5 -4
  256. package/lib/cjs/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  257. package/lib/cjs/decorators/BboxDimensionsDecorator.d.ts +2 -0
  258. package/lib/cjs/decorators/BboxDimensionsDecorator.js +80 -29
  259. package/lib/cjs/decorators/BboxDimensionsDecorator.js.map +1 -1
  260. package/lib/cjs/formula/FormulaDataTypeResolver.js +1 -2
  261. package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -1
  262. package/lib/cjs/formula/FormulaFunctionProvider.js +3 -4
  263. package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
  264. package/lib/cjs/formula/FormulaOperatorsProvider.js +11 -11
  265. package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -1
  266. package/lib/cjs/formula/FormulaSplitter.js +1 -2
  267. package/lib/cjs/formula/FormulaSplitter.js.map +1 -1
  268. package/lib/cjs/formula/FormulaTokensDataTypeResolver.js +1 -2
  269. package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -1
  270. package/lib/cjs/formula/InfixToPostfixConverter.js +3 -3
  271. package/lib/cjs/formula/InfixToPostfixConverter.js.map +1 -1
  272. package/lib/cjs/formula/InputStream.js +3 -2
  273. package/lib/cjs/formula/InputStream.js.map +1 -1
  274. package/lib/cjs/formula/ParenthesisValidator.js +3 -3
  275. package/lib/cjs/formula/ParenthesisValidator.js.map +1 -1
  276. package/lib/cjs/formula/Queue.js +1 -0
  277. package/lib/cjs/formula/Queue.js.map +1 -1
  278. package/lib/cjs/formula/Stack.js +2 -3
  279. package/lib/cjs/formula/Stack.js.map +1 -1
  280. package/lib/cjs/formula/StringBuilder.js +1 -0
  281. package/lib/cjs/formula/StringBuilder.js.map +1 -1
  282. package/lib/cjs/formula/Types.d.ts +4 -4
  283. package/lib/cjs/formula/Utils.js +6 -7
  284. package/lib/cjs/formula/Utils.js.map +1 -1
  285. package/lib/cjs/grouping-mapping-widget.d.ts +3 -0
  286. package/lib/cjs/grouping-mapping-widget.js +4 -1
  287. package/lib/cjs/grouping-mapping-widget.js.map +1 -1
  288. package/lib/cjs/test/CalculatedPropertyActionWithVisuals.test.d.ts +2 -0
  289. package/lib/cjs/test/CalculatedPropertyActionWithVisuals.test.js +137 -0
  290. package/lib/cjs/test/CalculatedPropertyActionWithVisuals.test.js.map +1 -0
  291. package/lib/cjs/test/GroupingMappingCustomUI.test.d.ts +1 -1
  292. package/lib/cjs/test/GroupingMappingCustomUI.test.js +42 -33
  293. package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
  294. package/lib/cjs/test/MockFactory.d.ts +1 -1
  295. package/lib/cjs/test/MockFactory.js.map +1 -1
  296. package/lib/cjs/test/PropertyFieldsHelpers.d.ts +22 -20
  297. package/lib/cjs/test/QueryBuilder.test.js.map +1 -1
  298. package/lib/cjs/test/WidgetHeader.test.d.ts +1 -1
  299. package/lib/cjs/test/WidgetHeader.test.js +2 -2
  300. package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
  301. package/lib/cjs/test/setup.d.ts +2 -0
  302. package/lib/cjs/test/setup.js +11 -0
  303. package/lib/cjs/test/setup.js.map +1 -0
  304. package/lib/cjs/test/test-utils.d.ts +3 -3
  305. package/lib/cjs/test/test-utils.js +12 -6
  306. package/lib/cjs/test/test-utils.js.map +1 -1
  307. package/lib/esm/GroupingMappingWidget.d.ts +28 -0
  308. package/lib/esm/GroupingMappingWidget.js +54 -0
  309. package/lib/esm/GroupingMappingWidget.js.map +1 -0
  310. package/lib/esm/WidgetShell/GroupingMapping.d.ts +1 -2
  311. package/lib/esm/WidgetShell/GroupingMapping.js +5 -4
  312. package/lib/esm/WidgetShell/GroupingMapping.js.map +1 -1
  313. package/lib/esm/WidgetShell/GroupingMappingContent.d.ts +2 -3
  314. package/lib/esm/WidgetShell/GroupingMappingContent.js.map +1 -1
  315. package/lib/esm/WidgetShell/GroupingMappingHeader.d.ts +0 -1
  316. package/lib/esm/WidgetShell/GroupingMappingWidget.js +4 -2
  317. package/lib/esm/WidgetShell/GroupingMappingWidget.js.map +1 -1
  318. package/lib/esm/WidgetShell/Router/GroupingMappingRouter.d.ts +2 -3
  319. package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js +6 -5
  320. package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
  321. package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.d.ts +0 -1
  322. package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js +3 -2
  323. package/lib/esm/WidgetShell/WidgetHeader/WidgetHeader.js.map +1 -1
  324. package/lib/esm/common/hooks/useIsMounted.d.ts +0 -1
  325. package/lib/esm/common/hooks/useMemoizedCollectionPick.js.map +1 -1
  326. package/lib/esm/common/utils.d.ts +1 -1
  327. package/lib/esm/common/utils.js +20 -30
  328. package/lib/esm/common/utils.js.map +1 -1
  329. package/lib/esm/common/viewerUtils.js.map +1 -1
  330. package/lib/esm/components/GroupingMappingContext.js +3 -2
  331. package/lib/esm/components/GroupingMappingContext.js.map +1 -1
  332. package/lib/esm/components/Groups/Editing/GroupAction.d.ts +2 -3
  333. package/lib/esm/components/Groups/Editing/GroupAction.js +16 -11
  334. package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
  335. package/lib/esm/components/Groups/Editing/GroupDetails.d.ts +0 -1
  336. package/lib/esm/components/Groups/Editing/GroupDetails.js +4 -3
  337. package/lib/esm/components/Groups/Editing/GroupDetails.js.map +1 -1
  338. package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.d.ts +0 -1
  339. package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js +3 -2
  340. package/lib/esm/components/Groups/Editing/GroupDetailsActionPanel.js.map +1 -1
  341. package/lib/esm/components/Groups/Editing/GroupDetailsStep.d.ts +2 -3
  342. package/lib/esm/components/Groups/Editing/GroupDetailsStep.js +5 -4
  343. package/lib/esm/components/Groups/Editing/GroupDetailsStep.js.map +1 -1
  344. package/lib/esm/components/Groups/GroupColorLegend.d.ts +0 -1
  345. package/lib/esm/components/Groups/GroupListItem.d.ts +0 -1
  346. package/lib/esm/components/Groups/GroupListItem.js.map +1 -1
  347. package/lib/esm/components/Groups/GroupMenuActions.d.ts +0 -1
  348. package/lib/esm/components/Groups/GroupMenuActions.js +5 -4
  349. package/lib/esm/components/Groups/GroupMenuActions.js.map +1 -1
  350. package/lib/esm/components/Groups/GroupOverlapProgressBar.d.ts +0 -1
  351. package/lib/esm/components/Groups/GroupOverlapProgressBar.js +2 -1
  352. package/lib/esm/components/Groups/GroupOverlapProgressBar.js.map +1 -1
  353. package/lib/esm/components/Groups/Groups.js.map +1 -1
  354. package/lib/esm/components/Groups/GroupsAddButton.d.ts +0 -1
  355. package/lib/esm/components/Groups/GroupsAddButton.js +2 -1
  356. package/lib/esm/components/Groups/GroupsAddButton.js.map +1 -1
  357. package/lib/esm/components/Groups/GroupsShowHideButtons.d.ts +0 -1
  358. package/lib/esm/components/Groups/GroupsShowHideButtons.js +2 -1
  359. package/lib/esm/components/Groups/GroupsShowHideButtons.js.map +1 -1
  360. package/lib/esm/components/Groups/GroupsView.d.ts +1 -1
  361. package/lib/esm/components/Groups/GroupsView.js +4 -3
  362. package/lib/esm/components/Groups/GroupsView.js.map +1 -1
  363. package/lib/esm/components/Groups/GroupsVisualization.d.ts +0 -1
  364. package/lib/esm/components/Groups/GroupsVisualization.js +9 -6
  365. package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
  366. package/lib/esm/components/Groups/GroupsVisualizationActions.d.ts +0 -1
  367. package/lib/esm/components/Groups/GroupsVisualizationActions.js +3 -2
  368. package/lib/esm/components/Groups/GroupsVisualizationActions.js.map +1 -1
  369. package/lib/esm/components/Groups/OverlappedElementsInformationPanel.d.ts +0 -1
  370. package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js +7 -7
  371. package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
  372. package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js +40 -36
  373. package/lib/esm/components/Groups/QueryBuilder/QueryBuilder.js.map +1 -1
  374. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.d.ts +0 -1
  375. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js +2 -1
  376. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderActionPanel.js.map +1 -1
  377. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +0 -1
  378. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js +2 -1
  379. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
  380. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.d.ts +2 -3
  381. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js +7 -6
  382. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderStep.js.map +1 -1
  383. package/lib/esm/components/Groups/ToggleGroupVisibility.d.ts +0 -1
  384. package/lib/esm/components/Groups/ToggleGroupVisibility.js +3 -2
  385. package/lib/esm/components/Groups/ToggleGroupVisibility.js.map +1 -1
  386. package/lib/esm/components/Groups/groupsHelpers.d.ts +1 -1
  387. package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
  388. package/lib/esm/components/Groups/hooks/useGroupsOperations.d.ts +0 -1
  389. package/lib/esm/components/Groups/hooks/useGroupsOperations.js.map +1 -1
  390. package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js +1 -2
  391. package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
  392. package/lib/esm/components/Groups/hooks/useVisualization.d.ts +0 -1
  393. package/lib/esm/components/Groups/hooks/useVisualization.js +2 -1
  394. package/lib/esm/components/Groups/hooks/useVisualization.js.map +1 -1
  395. package/lib/esm/components/Mappings/BlockingOverlay.d.ts +0 -1
  396. package/lib/esm/components/Mappings/Editing/MappingAction.d.ts +2 -3
  397. package/lib/esm/components/Mappings/Editing/MappingAction.js +9 -8
  398. package/lib/esm/components/Mappings/Editing/MappingAction.js.map +1 -1
  399. package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js +17 -6
  400. package/lib/esm/components/Mappings/Extraction/ExtractionLogCustomFilter.js.map +1 -1
  401. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.d.ts +0 -1
  402. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +20 -11
  403. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
  404. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +0 -1
  405. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +2 -1
  406. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -1
  407. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +0 -1
  408. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +2 -1
  409. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -1
  410. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +0 -1
  411. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +2 -1
  412. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -1
  413. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +0 -1
  414. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +2 -1
  415. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -1
  416. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.d.ts +0 -1
  417. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js.map +1 -1
  418. package/lib/esm/components/Mappings/Extraction/ExtractionStatusIcon.d.ts +1 -2
  419. package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.d.ts +2 -2
  420. package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js +20 -19
  421. package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
  422. package/lib/esm/components/Mappings/Import/MappingImportWizardModal.d.ts +2 -3
  423. package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js +20 -20
  424. package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
  425. package/lib/esm/components/Mappings/Import/SelectIModel.d.ts +2 -3
  426. package/lib/esm/components/Mappings/Import/SelectIModel.js +9 -8
  427. package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -1
  428. package/lib/esm/components/Mappings/Import/SelectITwin.d.ts +2 -3
  429. package/lib/esm/components/Mappings/Import/SelectITwin.js +14 -13
  430. package/lib/esm/components/Mappings/Import/SelectITwin.js.map +1 -1
  431. package/lib/esm/components/Mappings/Import/SelectMappings.d.ts +2 -3
  432. package/lib/esm/components/Mappings/Import/SelectMappings.js +10 -9
  433. package/lib/esm/components/Mappings/Import/SelectMappings.js.map +1 -1
  434. package/lib/esm/components/Mappings/MappingListItem.d.ts +0 -1
  435. package/lib/esm/components/Mappings/MappingListItem.js +1 -2
  436. package/lib/esm/components/Mappings/MappingListItem.js.map +1 -1
  437. package/lib/esm/components/Mappings/MappingViewActionGroup.d.ts +0 -1
  438. package/lib/esm/components/Mappings/MappingViewActionGroup.js +5 -4
  439. package/lib/esm/components/Mappings/MappingViewActionGroup.js.map +1 -1
  440. package/lib/esm/components/Mappings/Mappings.d.ts +3 -4
  441. package/lib/esm/components/Mappings/Mappings.js.map +1 -1
  442. package/lib/esm/components/Mappings/MappingsView.d.ts +2 -2
  443. package/lib/esm/components/Mappings/MappingsView.js +16 -15
  444. package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
  445. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +4 -3
  446. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
  447. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +1 -2
  448. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +1 -1
  449. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
  450. package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +0 -1
  451. package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +2 -1
  452. package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
  453. package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +0 -1
  454. package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -1
  455. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +2 -3
  456. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +4 -3
  457. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
  458. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +0 -1
  459. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +19 -5
  460. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
  461. package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.d.ts +0 -1
  462. package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js +3 -2
  463. package/lib/esm/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.js.map +1 -1
  464. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +0 -1
  465. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +4 -3
  466. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
  467. package/lib/esm/components/Properties/GroupColorToggle.d.ts +1 -2
  468. package/lib/esm/components/Properties/GroupColorToggle.js +3 -2
  469. package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
  470. package/lib/esm/components/Properties/GroupInformationPanel.d.ts +0 -1
  471. package/lib/esm/components/Properties/GroupInformationPanel.js +3 -2
  472. package/lib/esm/components/Properties/GroupInformationPanel.js.map +1 -1
  473. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.d.ts +1 -2
  474. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +26 -25
  475. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
  476. package/lib/esm/components/Properties/GroupProperties/GroupPropertyListItem.d.ts +0 -1
  477. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.d.ts +0 -1
  478. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +5 -4
  479. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
  480. package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
  481. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +0 -1
  482. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +14 -15
  483. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
  484. package/lib/esm/components/Properties/GroupProperties/SaveModal.d.ts +0 -1
  485. package/lib/esm/components/Properties/GroupProperties/SaveModal.js +5 -4
  486. package/lib/esm/components/Properties/GroupProperties/SaveModal.js.map +1 -1
  487. package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.d.ts +0 -1
  488. package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js +2 -1
  489. package/lib/esm/components/Properties/GroupProperties/SortableHorizontalTile.js.map +1 -1
  490. package/lib/esm/components/Properties/PropertyAction.d.ts +0 -1
  491. package/lib/esm/components/Properties/PropertyAction.js +7 -3
  492. package/lib/esm/components/Properties/PropertyAction.js.map +1 -1
  493. package/lib/esm/components/Properties/PropertyMenu.d.ts +0 -1
  494. package/lib/esm/components/Properties/PropertyMenuWithVisualization.d.ts +0 -1
  495. package/lib/esm/components/Properties/PropertyMenuWithVisualization.js +2 -1
  496. package/lib/esm/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
  497. package/lib/esm/components/Properties/PropertyNameCell.d.ts +0 -1
  498. package/lib/esm/components/Properties/PropertyTable.d.ts +0 -1
  499. package/lib/esm/components/Properties/PropertyTable.js +2 -1
  500. package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
  501. package/lib/esm/components/Properties/PropertyTableToolbar.d.ts +0 -1
  502. package/lib/esm/components/Properties/PropertyTableToolbar.js +3 -5
  503. package/lib/esm/components/Properties/PropertyTableToolbar.js.map +1 -1
  504. package/lib/esm/components/Properties/ScrollableExpandableBlock.js.map +1 -1
  505. package/lib/esm/components/Properties/hooks/useFormulaValidation.js.map +1 -1
  506. package/lib/esm/components/Properties/hooks/useForwardRef.js.map +1 -1
  507. package/lib/esm/components/Properties/hooks/useValidator.d.ts +2 -2
  508. package/lib/esm/components/Properties/hooks/useValidator.js +9 -8
  509. package/lib/esm/components/Properties/hooks/useValidator.js.map +1 -1
  510. package/lib/esm/components/SharedComponents/ActionPanel.d.ts +0 -1
  511. package/lib/esm/components/SharedComponents/ActionPanel.js +3 -2
  512. package/lib/esm/components/SharedComponents/ActionPanel.js.map +1 -1
  513. package/lib/esm/components/SharedComponents/DeleteModal.d.ts +0 -1
  514. package/lib/esm/components/SharedComponents/DeleteModal.js +5 -4
  515. package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -1
  516. package/lib/esm/components/SharedComponents/EmptyMessage.d.ts +0 -1
  517. package/lib/esm/components/SharedComponents/LoadingOverlay.d.ts +0 -1
  518. package/lib/esm/components/SharedComponents/LoadingOverlay.js +3 -2
  519. package/lib/esm/components/SharedComponents/LoadingOverlay.js.map +1 -1
  520. package/lib/esm/components/SharedComponents/LoadingSpinner.d.ts +0 -1
  521. package/lib/esm/components/SharedComponents/StatusIcon.d.ts +1 -1
  522. package/lib/esm/components/context/ExtractionClientContext.d.ts +0 -1
  523. package/lib/esm/components/context/ExtractionClientContext.js.map +1 -1
  524. package/lib/esm/components/context/ExtractionStateJobContext.js.map +1 -1
  525. package/lib/esm/components/context/GroupHilitedElementsContext.js.map +1 -1
  526. package/lib/esm/components/context/GroupingApiConfigContext.d.ts +2 -2
  527. package/lib/esm/components/context/GroupingApiConfigContext.js.map +1 -1
  528. package/lib/esm/components/context/GroupingMappingCustomUIContext.d.ts +0 -1
  529. package/lib/esm/components/context/GroupingMappingCustomUIContext.js.map +1 -1
  530. package/lib/esm/components/context/GroupsClientContext.d.ts +0 -1
  531. package/lib/esm/components/context/GroupsClientContext.js.map +1 -1
  532. package/lib/esm/components/context/IModelsClientContext.d.ts +0 -1
  533. package/lib/esm/components/context/IModelsClientContext.js.map +1 -1
  534. package/lib/esm/components/context/ITwinsClientContext.d.ts +0 -1
  535. package/lib/esm/components/context/ITwinsClientContext.js.map +1 -1
  536. package/lib/esm/components/context/MappingClientContext.d.ts +0 -1
  537. package/lib/esm/components/context/MappingClientContext.js.map +1 -1
  538. package/lib/esm/components/context/PropertiesClientContext.d.ts +0 -1
  539. package/lib/esm/components/context/PropertiesClientContext.js.map +1 -1
  540. package/lib/esm/components/context/PropertiesGroupColorContext.js.map +1 -1
  541. package/lib/esm/components/context/PropertyGridWrapperContext.d.ts +1 -0
  542. package/lib/esm/components/context/PropertyGridWrapperContext.js.map +1 -1
  543. package/lib/esm/components/customUI/DefaultGroupingUI.d.ts +1 -1
  544. package/lib/esm/components/customUI/DefaultGroupingUI.js +5 -4
  545. package/lib/esm/components/customUI/DefaultGroupingUI.js.map +1 -1
  546. package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.d.ts +0 -1
  547. package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js +5 -3
  548. package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  549. package/lib/esm/components/customUI/GroupingMappingCustomUI.d.ts +1 -1
  550. package/lib/esm/components/customUI/ManualGroupingCustomUI.d.ts +0 -1
  551. package/lib/esm/components/customUI/ManualGroupingCustomUI.js +5 -4
  552. package/lib/esm/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  553. package/lib/esm/components/customUI/SearchGroupingCustomUI.d.ts +0 -1
  554. package/lib/esm/components/customUI/SearchGroupingCustomUI.js +5 -4
  555. package/lib/esm/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  556. package/lib/esm/decorators/BboxDimensionsDecorator.d.ts +2 -0
  557. package/lib/esm/decorators/BboxDimensionsDecorator.js +79 -28
  558. package/lib/esm/decorators/BboxDimensionsDecorator.js.map +1 -1
  559. package/lib/esm/formula/FormulaDataTypeResolver.js.map +1 -1
  560. package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -1
  561. package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -1
  562. package/lib/esm/formula/FormulaSplitter.js.map +1 -1
  563. package/lib/esm/formula/FormulaTokensDataTypeResolver.js.map +1 -1
  564. package/lib/esm/formula/InfixToPostfixConverter.js.map +1 -1
  565. package/lib/esm/formula/InputStream.js +3 -2
  566. package/lib/esm/formula/InputStream.js.map +1 -1
  567. package/lib/esm/formula/ParenthesisValidator.js.map +1 -1
  568. package/lib/esm/formula/Queue.js +1 -0
  569. package/lib/esm/formula/Queue.js.map +1 -1
  570. package/lib/esm/formula/Stack.js +2 -3
  571. package/lib/esm/formula/Stack.js.map +1 -1
  572. package/lib/esm/formula/StringBuilder.js +1 -0
  573. package/lib/esm/formula/StringBuilder.js.map +1 -1
  574. package/lib/esm/formula/Types.d.ts +4 -4
  575. package/lib/esm/grouping-mapping-widget.d.ts +3 -0
  576. package/lib/esm/grouping-mapping-widget.js +2 -0
  577. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  578. package/lib/esm/test/CalculatedPropertyActionWithVisuals.test.d.ts +2 -0
  579. package/lib/esm/test/CalculatedPropertyActionWithVisuals.test.js +132 -0
  580. package/lib/esm/test/CalculatedPropertyActionWithVisuals.test.js.map +1 -0
  581. package/lib/esm/test/GroupingMappingCustomUI.test.d.ts +1 -1
  582. package/lib/esm/test/GroupingMappingCustomUI.test.js +42 -33
  583. package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
  584. package/lib/esm/test/MockFactory.d.ts +1 -1
  585. package/lib/esm/test/MockFactory.js.map +1 -1
  586. package/lib/esm/test/PropertyFieldsHelpers.d.ts +22 -20
  587. package/lib/esm/test/QueryBuilder.test.js.map +1 -1
  588. package/lib/esm/test/WidgetHeader.test.d.ts +1 -1
  589. package/lib/esm/test/WidgetHeader.test.js +2 -2
  590. package/lib/esm/test/WidgetHeader.test.js.map +1 -1
  591. package/lib/esm/test/setup.d.ts +2 -0
  592. package/lib/esm/test/setup.js +9 -0
  593. package/lib/esm/test/setup.js.map +1 -0
  594. package/lib/esm/test/test-utils.d.ts +3 -3
  595. package/lib/esm/test/test-utils.js +3 -2
  596. package/lib/esm/test/test-utils.js.map +1 -1
  597. package/lib/public/locales/en/GroupingMappingWidget.json +220 -0
  598. package/package.json +45 -68
@@ -1,10 +1,6 @@
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 { QueryRowFormat } from "@itwin/core-common";
6
1
  import { IModelApp } from "@itwin/core-frontend";
7
2
  import { toaster } from "@itwin/itwinui-react";
3
+ import { GroupingMappingWidget } from "../GroupingMappingWidget";
8
4
  export function debounce(f, delay) {
9
5
  let timer;
10
6
  return (...args) => {
@@ -17,22 +13,16 @@ export const fetchIdsFromQuery = async (query, iModelConnection) => {
17
13
  return [];
18
14
  }
19
15
  const ids = [];
20
- const rowIterator = iModelConnection.query(query, undefined, {
21
- rowFormat: QueryRowFormat.UseJsPropertyNames,
22
- });
23
- while (true) {
24
- const { done, value } = await rowIterator.next();
25
- if (done) {
26
- break;
27
- }
28
- if (Object.keys(value).includes("id")) {
29
- ids.push(value.id);
16
+ const reader = iModelConnection.createQueryReader(query);
17
+ for await (const row of reader) {
18
+ if (Object.keys(row).includes("id")) {
19
+ ids.push(row.id);
30
20
  }
31
- else if (Object.keys(value).includes("element.id")) {
32
- ids.push(value["element.id"]);
21
+ else if (Object.keys(row).includes("element.id")) {
22
+ ids.push(row["element.id"]);
33
23
  }
34
- else if (Object.keys(value).includes("eCInstanceId")) {
35
- ids.push(value.eCInstanceId);
24
+ else if (Object.keys(row).includes("eCInstanceId")) {
25
+ ids.push(row.eCInstanceId);
36
26
  }
37
27
  }
38
28
  return ids;
@@ -40,29 +30,29 @@ export const fetchIdsFromQuery = async (query, iModelConnection) => {
40
30
  export const getErrorMessage = (errorStatus) => {
41
31
  switch (errorStatus) {
42
32
  case 401:
43
- return "You are unauthorized to do this operation.";
33
+ return GroupingMappingWidget.translate("errors.unauthorized");
44
34
  case 403:
45
- return "You don't have permission to access the requested resource.";
35
+ return GroupingMappingWidget.translate("errors.forbidden");
46
36
  case 404:
47
- return "The requested resource was not found.";
37
+ return GroupingMappingWidget.translate("errors.notFound");
48
38
  case 409:
49
- return "This property name is already being used.";
39
+ return GroupingMappingWidget.translate("errors.conflict");
50
40
  case 422:
51
- return "Unable to process the request.";
41
+ return GroupingMappingWidget.translate("errors.unprocessable");
52
42
  case 429:
53
- return "Too many requests.";
43
+ return GroupingMappingWidget.translate("errors.tooManyRequests");
54
44
  case 500:
55
- return "Internal server error.";
45
+ return GroupingMappingWidget.translate("errors.internalServerError");
56
46
  case 502:
57
- return "Bad gateway.";
47
+ return GroupingMappingWidget.translate("errors.badGateway");
58
48
  case 503:
59
- return "Service unavailable.";
49
+ return GroupingMappingWidget.translate("errors.serviceUnavailable");
60
50
  default:
61
- return "Something went wrong!";
51
+ return GroupingMappingWidget.translate("errors.generic");
62
52
  }
63
53
  };
64
54
  export const handleError = (errorStatus) => {
65
- const baseErrorMessage = "Error!";
55
+ const baseErrorMessage = GroupingMappingWidget.translate("errors.errorPrefix");
66
56
  const specificErrorMessage = getErrorMessage(errorStatus);
67
57
  const fullErrorMessage = `${baseErrorMessage} ${specificErrorMessage}`;
68
58
  toaster.negative(fullErrorMessage);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src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,SAAS,CAAC;QACR,GAAG,MAAM;QACT,CAAC,IAAI,CAAC,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,EAAE,gBAAkC,EAAE,EAAE;IACrF,MAAM,MAAM,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,2CAA2C,CAAC,CAAC;IAC/F,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAa,EAAU,EAAE;IACtE,8DAA8D;IAC9D,+CAA+C;IAC/C,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAChD,sDAAsD;QACtD,MAAM,aAAa,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAE3D,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;KACjE;IAED,OAAO,KAAK,CAAC;AACf,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 { QueryRowFormat } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { toaster } from \"@itwin/itwinui-react\";\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n\nexport function debounce<F extends (...args: any[]) => void>(f: F, delay: number) {\n let timer: number | undefined;\n return (...args: any[]) => {\n timer && window.clearTimeout(timer);\n timer = window.setTimeout(f, delay, ...args);\n };\n}\n\nexport const fetchIdsFromQuery = async (query: string, iModelConnection: IModelConnection) => {\n if (query === \"\") {\n return [];\n }\n const ids: string[] = [];\n const rowIterator = iModelConnection.query(query, undefined, {\n rowFormat: QueryRowFormat.UseJsPropertyNames,\n });\n while (true) {\n const { done, value } = await rowIterator.next();\n if (done) {\n break;\n }\n if (Object.keys(value).includes(\"id\")) {\n ids.push(value.id);\n } else if (Object.keys(value).includes(\"element.id\")) {\n ids.push(value[\"element.id\"]);\n } else if (Object.keys(value).includes(\"eCInstanceId\")) {\n ids.push(value.eCInstanceId);\n }\n }\n return ids;\n};\n\nexport const getErrorMessage = (errorStatus: number): string => {\n switch (errorStatus) {\n case 401:\n return \"You are unauthorized to do this operation.\";\n case 403:\n return \"You don't have permission to access the requested resource.\";\n case 404:\n return \"The requested resource was not found.\";\n case 409:\n return \"This property name is already being used.\";\n case 422:\n return \"Unable to process the request.\";\n case 429:\n return \"Too many requests.\";\n case 500:\n return \"Internal server error.\";\n case 502:\n return \"Bad gateway.\";\n case 503:\n return \"Service unavailable.\";\n default:\n return \"Something went wrong!\";\n }\n};\n\nexport const handleError = (errorStatus: number) => {\n const baseErrorMessage = \"Error!\";\n const specificErrorMessage = getErrorMessage(errorStatus);\n const fullErrorMessage = `${baseErrorMessage} ${specificErrorMessage}`;\n\n toaster.negative(fullErrorMessage);\n};\n\nexport const handleInputChange = <T>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: (newValues: T) => void) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const enableExperimentalFeatures = async (iModelConnection: IModelConnection) => {\n const reader = iModelConnection.createQueryReader(\"PRAGMA experimental_features_enabled=true\");\n await reader.step();\n};\n\nexport const getLocalizedStringPresentation = (input: string): string => {\n // https://www.itwinjs.org/presentation/advanced/localization/\n // Check if the string starts and ends with \"@\"\n if (input.startsWith(\"@\") && input.endsWith(\"@\")) {\n // Remove the leading and trailing \"@\" from the string\n const trimmedString = input.substring(1, input.length - 1);\n\n return IModelApp.localization.getLocalizedString(trimmedString);\n }\n\n return input;\n};\n"]}
1
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CAAC;IAC1D,MAAM,gBAAgB,GAAG,GAAG,gBAAgB,IAAI,oBAAoB,EAAE,CAAC;IAEvE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAI,CAAsC,EAAE,MAAS,EAAE,SAAiC,EAAE,EAAE;IAC3H,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;IAEjC,SAAS,CAAC;QACR,GAAG,MAAM;QACT,CAAC,IAAI,CAAC,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,EAAE,gBAAkC,EAAE,EAAE;IACrF,MAAM,MAAM,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,2CAA2C,CAAC,CAAC;IAC/F,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAa,EAAU,EAAE;IACtE,8DAA8D;IAC9D,+CAA+C;IAC/C,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,sDAAsD;QACtD,MAAM,aAAa,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAE3D,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,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 type { IModelConnection } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { GroupingMappingWidget } from \"../GroupingMappingWidget\";\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n\nexport function debounce<F extends (...args: any[]) => void>(f: F, delay: number) {\n let timer: number | undefined;\n return (...args: any[]) => {\n timer && window.clearTimeout(timer);\n timer = window.setTimeout(f, delay, ...args);\n };\n}\n\nexport const fetchIdsFromQuery = async (query: string, iModelConnection: IModelConnection) => {\n if (query === \"\") {\n return [];\n }\n const ids: string[] = [];\n const reader = iModelConnection.createQueryReader(query);\n for await (const row of reader) {\n if (Object.keys(row).includes(\"id\")) {\n ids.push(row.id);\n } else if (Object.keys(row).includes(\"element.id\")) {\n ids.push(row[\"element.id\"]);\n } else if (Object.keys(row).includes(\"eCInstanceId\")) {\n ids.push(row.eCInstanceId);\n }\n }\n return ids;\n};\n\nexport const getErrorMessage = (errorStatus: number): string => {\n switch (errorStatus) {\n case 401:\n return GroupingMappingWidget.translate(\"errors.unauthorized\");\n case 403:\n return GroupingMappingWidget.translate(\"errors.forbidden\");\n case 404:\n return GroupingMappingWidget.translate(\"errors.notFound\");\n case 409:\n return GroupingMappingWidget.translate(\"errors.conflict\");\n case 422:\n return GroupingMappingWidget.translate(\"errors.unprocessable\");\n case 429:\n return GroupingMappingWidget.translate(\"errors.tooManyRequests\");\n case 500:\n return GroupingMappingWidget.translate(\"errors.internalServerError\");\n case 502:\n return GroupingMappingWidget.translate(\"errors.badGateway\");\n case 503:\n return GroupingMappingWidget.translate(\"errors.serviceUnavailable\");\n default:\n return GroupingMappingWidget.translate(\"errors.generic\");\n }\n};\n\nexport const handleError = (errorStatus: number) => {\n const baseErrorMessage = GroupingMappingWidget.translate(\"errors.errorPrefix\");\n const specificErrorMessage = getErrorMessage(errorStatus);\n const fullErrorMessage = `${baseErrorMessage} ${specificErrorMessage}`;\n\n toaster.negative(fullErrorMessage);\n};\n\nexport const handleInputChange = <T>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: (newValues: T) => void) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const enableExperimentalFeatures = async (iModelConnection: IModelConnection) => {\n const reader = iModelConnection.createQueryReader(\"PRAGMA experimental_features_enabled=true\");\n await reader.step();\n};\n\nexport const getLocalizedStringPresentation = (input: string): string => {\n // https://www.itwinjs.org/presentation/advanced/localization/\n // Check if the string starts and ends with \"@\"\n if (input.startsWith(\"@\") && input.endsWith(\"@\")) {\n // Remove the leading and trailing \"@\" from the string\n const trimmedString = input.substring(1, input.length - 1);\n\n return IModelApp.localization.getLocalizedString(trimmedString);\n }\n\n return input;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"viewerUtils.js","sourceRoot":"","sources":["../../../src/common/viewerUtils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAE,MAAc,EAAE,OAAO,GAAG,KAAK,EAAE,EAAE;IAC7E,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,EAAE;QACvC,OAAO,EAAE,CAAC;KACX;IAED,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;IAE9C,MAAM,cAAc,GAAsB,iBAAiB,CAAC,MAAM,CAAC;QACjE,MAAM,EAAE,EAAE,CAAC,MAAM;KAClB,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,GAAG,CAAC,QAAQ,EAAE;QAChB,MAAM,G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,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,EAAE;QACvC,OAAO;KACR;IACD,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;IAC9C,MAAM,IAAI,GAAG,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC/C,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;AAC/B,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 type { IModelConnection, ViewChangeOptions } from \"@itwin/core-frontend\";\nimport { EmphasizeElements, IModelApp } from \"@itwin/core-frontend\";\nimport type { FeatureAppearance } from \"@itwin/core-common\";\nimport { ColorDef, FeatureOverrideType } from \"@itwin/core-common\";\nimport type { InstanceKey } from \"@itwin/presentation-common\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { HiliteSetProvider } from \"@itwin/presentation-frontend\";\n\nexport const isolateElementsByKeys = async (keySet: KeySet, replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n isolateElements(ids, replace);\n return ids;\n }\n return [];\n};\n\nexport const isolateElementsByQuery = async (query: string, iModelConnection: IModelConnection, replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n isolateElements(ids, replace);\n return ids;\n }\n return [];\n};\n\nexport const isolateElements = (hilitedIds: string[], replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.isolateElements(hilitedIds, vp, replace);\n};\n\nexport const clearIsolatedElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearIsolatedElements(vp);\n};\n\nexport const hideElements = (hilitedIds: string[], replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.hideElements(hilitedIds, vp, replace);\n};\n\nexport const clearHiddenElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearHiddenElements(vp);\n};\n\nexport const overrideElementsByQuery = async (\n iModelConnection: IModelConnection,\n query: string,\n color: string,\n overrideType = FeatureOverrideType.ColorOnly,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n overrideElements(ids, color, overrideType);\n return ids;\n }\n return [];\n};\n\nexport const overrideElements = (hilitedIds: string[], color: string, overrideType = FeatureOverrideType.ColorOnly, replace = true) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.overrideElements(hilitedIds, vp, ColorDef.fromString(color), overrideType, replace);\n};\n\nexport const clearOverriddenElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearOverriddenElements(vp);\n};\n\nexport const emphasizeElements = (hilitedIds: string[], defaultAppearance: FeatureAppearance | undefined = undefined, replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.wantEmphasis = true;\n emph.emphasizeElements(hilitedIds, vp, defaultAppearance, replace);\n};\n\nexport const emphasisElementsByQuery = async (\n iModelConnection: IModelConnection,\n query: string,\n defaultAppearance: FeatureAppearance | undefined = undefined,\n replace = false,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n emphasizeElements(ids, defaultAppearance, replace);\n return ids;\n }\n return [];\n};\n\nexport const emphasizeElementsByKeys = async (keySet: KeySet, defaultAppearance: FeatureAppearance | undefined = undefined, replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n emphasizeElements(ids, defaultAppearance, replace);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElementsByQuery = async (query: string, color: string, iModelConnection: IModelConnection, replace = false, wantEmphasis = true) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n visualizeElements(ids, color, replace, wantEmphasis);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElementsByKeys = async (keySet: KeySet, color: string, replace = false, wantEmphasis = true) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n visualizeElements(ids, color, replace, wantEmphasis);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElements = (elementIds: string[], color: string, replace = false, wantEmphasis = true) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.overrideElements(elementIds, vp, ColorDef.fromString(color), FeatureOverrideType.ColorAndAlpha, true);\n if (!wantEmphasis) {\n return;\n }\n emph.wantEmphasis = true;\n emph.emphasizeElements(elementIds, vp, undefined, replace);\n};\n\nexport const transparentOverriddenElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n const ids = emph.getOverriddenElements()?.values();\n if (ids) {\n const toOverride = new Set<string>();\n Array.from(ids).forEach((a) => a.forEach((id) => toOverride.add(id)));\n emph.overrideElements(toOverride, vp, ColorDef.red.withAlpha(50), FeatureOverrideType.AlphaOnly, true);\n }\n};\n\nexport const zoomToElements = async (elementIds: string[]) => {\n if (!IModelApp.viewManager.selectedView || elementIds.length === 0) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const viewChangeOpts: ViewChangeOptions = {};\n viewChangeOpts.animateFrustumChange = true;\n // It was removed. Should be a prop to be passed to lookAtViewAlignedVolume within the implementation.\n // viewChangeOpts.marginPercent = new MarginPercent(0.1, 0.1, 0.1, 0.1);\n await vp.zoomToElements(elementIds, { ...viewChangeOpts });\n};\n\nexport const getHiliteIds = async (query: string, iModelConnection: IModelConnection) => {\n if (!IModelApp.viewManager.selectedView) {\n return { keySet: new KeySet(), ids: [] };\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n return { keySet, ids: [...set.elements] };\n }\n return { keySet: new KeySet(), ids: [] };\n};\n\nexport const manufactureKeys = async (query: string, iModelConnection: IModelConnection): Promise<KeySet> => {\n if (query === \"\") {\n return new KeySet();\n }\n const queryWithIdAndECClassName = `SELECT q.ECInstanceId, ec_classname(e.ECClassId) FROM (${query}) q JOIN BisCore.Element e on e.ECInstanceId = q.ECInstanceId`;\n const keys: InstanceKey[] = [];\n\n for await (const row of iModelConnection.createQueryReader(queryWithIdAndECClassName)) {\n keys.push({ id: row[0], className: row[1] });\n }\n\n return new KeySet(keys);\n};\n\nexport const clearEmphasizedElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearEmphasizedElements(vp);\n};\n\nexport const clearEmphasizedOverriddenElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearEmphasizedElements(vp);\n emph.clearOverriddenElements(vp);\n};\n\nexport const clearAll = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearEmphasizedElements(vp);\n emph.clearOverriddenElements(vp);\n emph.clearHiddenElements(vp);\n};\n"]}
1
+ {"version":3,"file":"viewerUtils.js","sourceRoot":"","sources":["../../../src/common/viewerUtils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAE,MAAc,EAAE,OAAO,GAAG,KAAK,EAAE,EAAE;IAC7E,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;QACxC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;IAE9C,MAAM,cAAc,GAAsB,iBAAiB,CAAC,MAAM,CAAC;QACjE,MAAM,EAAE,EAAE,CAAC,MAAM;KAClB,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC9B,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAAE,KAAa,EAAE,gBA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AAW,CAAC,YAAY,CAAC;IAC9C,MAAM,IAAI,GAAG,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC/C,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;QACxC,OAAO;IACT,CAAC;IACD,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;IAC9C,MAAM,IAAI,GAAG,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC/C,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;AAC/B,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 type { IModelConnection, ViewChangeOptions } from \"@itwin/core-frontend\";\nimport { EmphasizeElements, IModelApp } from \"@itwin/core-frontend\";\nimport type { FeatureAppearance } from \"@itwin/core-common\";\nimport { ColorDef, FeatureOverrideType } from \"@itwin/core-common\";\nimport type { InstanceKey } from \"@itwin/presentation-common\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { HiliteSetProvider } from \"@itwin/presentation-frontend\";\n\nexport const isolateElementsByKeys = async (keySet: KeySet, replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n isolateElements(ids, replace);\n return ids;\n }\n return [];\n};\n\nexport const isolateElementsByQuery = async (query: string, iModelConnection: IModelConnection, replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n isolateElements(ids, replace);\n return ids;\n }\n return [];\n};\n\nexport const isolateElements = (hilitedIds: string[], replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.isolateElements(hilitedIds, vp, replace);\n};\n\nexport const clearIsolatedElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearIsolatedElements(vp);\n};\n\nexport const hideElements = (hilitedIds: string[], replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.hideElements(hilitedIds, vp, replace);\n};\n\nexport const clearHiddenElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearHiddenElements(vp);\n};\n\nexport const overrideElementsByQuery = async (\n iModelConnection: IModelConnection,\n query: string,\n color: string,\n overrideType = FeatureOverrideType.ColorOnly,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n overrideElements(ids, color, overrideType);\n return ids;\n }\n return [];\n};\n\nexport const overrideElements = (hilitedIds: string[], color: string, overrideType = FeatureOverrideType.ColorOnly, replace = true) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.overrideElements(hilitedIds, vp, ColorDef.fromString(color), overrideType, replace);\n};\n\nexport const clearOverriddenElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearOverriddenElements(vp);\n};\n\nexport const emphasizeElements = (hilitedIds: string[], defaultAppearance: FeatureAppearance | undefined = undefined, replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.wantEmphasis = true;\n emph.emphasizeElements(hilitedIds, vp, defaultAppearance, replace);\n};\n\nexport const emphasisElementsByQuery = async (\n iModelConnection: IModelConnection,\n query: string,\n defaultAppearance: FeatureAppearance | undefined = undefined,\n replace = false,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n emphasizeElements(ids, defaultAppearance, replace);\n return ids;\n }\n return [];\n};\n\nexport const emphasizeElementsByKeys = async (keySet: KeySet, defaultAppearance: FeatureAppearance | undefined = undefined, replace = false) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n emphasizeElements(ids, defaultAppearance, replace);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElementsByQuery = async (query: string, color: string, iModelConnection: IModelConnection, replace = false, wantEmphasis = true) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n visualizeElements(ids, color, replace, wantEmphasis);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElementsByKeys = async (keySet: KeySet, color: string, replace = false, wantEmphasis = true) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n visualizeElements(ids, color, replace, wantEmphasis);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElements = (elementIds: string[], color: string, replace = false, wantEmphasis = true) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.overrideElements(elementIds, vp, ColorDef.fromString(color), FeatureOverrideType.ColorAndAlpha, true);\n if (!wantEmphasis) {\n return;\n }\n emph.wantEmphasis = true;\n emph.emphasizeElements(elementIds, vp, undefined, replace);\n};\n\nexport const transparentOverriddenElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n const ids = emph.getOverriddenElements()?.values();\n if (ids) {\n const toOverride = new Set<string>();\n Array.from(ids).forEach((a) => a.forEach((id) => toOverride.add(id)));\n emph.overrideElements(toOverride, vp, ColorDef.red.withAlpha(50), FeatureOverrideType.AlphaOnly, true);\n }\n};\n\nexport const zoomToElements = async (elementIds: string[]) => {\n if (!IModelApp.viewManager.selectedView || elementIds.length === 0) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const viewChangeOpts: ViewChangeOptions = {};\n viewChangeOpts.animateFrustumChange = true;\n // It was removed. Should be a prop to be passed to lookAtViewAlignedVolume within the implementation.\n // viewChangeOpts.marginPercent = new MarginPercent(0.1, 0.1, 0.1, 0.1);\n await vp.zoomToElements(elementIds, { ...viewChangeOpts });\n};\n\nexport const getHiliteIds = async (query: string, iModelConnection: IModelConnection) => {\n if (!IModelApp.viewManager.selectedView) {\n return { keySet: new KeySet(), ids: [] };\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(query, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n return { keySet, ids: [...set.elements] };\n }\n return { keySet: new KeySet(), ids: [] };\n};\n\nexport const manufactureKeys = async (query: string, iModelConnection: IModelConnection): Promise<KeySet> => {\n if (query === \"\") {\n return new KeySet();\n }\n const queryWithIdAndECClassName = `SELECT q.ECInstanceId, ec_classname(e.ECClassId) FROM (${query}) q JOIN BisCore.Element e on e.ECInstanceId = q.ECInstanceId`;\n const keys: InstanceKey[] = [];\n\n for await (const row of iModelConnection.createQueryReader(queryWithIdAndECClassName)) {\n keys.push({ id: row[0], className: row[1] });\n }\n\n return new KeySet(keys);\n};\n\nexport const clearEmphasizedElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearEmphasizedElements(vp);\n};\n\nexport const clearEmphasizedOverriddenElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearEmphasizedElements(vp);\n emph.clearOverriddenElements(vp);\n};\n\nexport const clearAll = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearEmphasizedElements(vp);\n emph.clearOverriddenElements(vp);\n emph.clearHiddenElements(vp);\n};\n"]}
@@ -18,6 +18,7 @@ import { TErrCodes } from "./Constants";
18
18
  import { ExtractionStatusJobContext } from "./context/ExtractionStateJobContext";
19
19
  import { createGroupsClient, GroupsClientContext } from "./context/GroupsClientContext";
20
20
  import { createPropertiesClient, PropertiesClientContext } from "./context/PropertiesClientContext";
21
+ import { GroupingMappingWidget } from "../GroupingMappingWidget";
21
22
  const authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? "";
22
23
  const defaultQueryClient = new QueryClient({
23
24
  defaultOptions: {
@@ -36,7 +37,7 @@ const defaultQueryClient = new QueryClient({
36
37
  if (error.status)
37
38
  toaster.negative(getErrorMessage(error.status));
38
39
  else
39
- toaster.negative("An error occurred while fetching data.");
40
+ toaster.negative(GroupingMappingWidget.translate("errors.fetchError"));
40
41
  }
41
42
  }
42
43
  },
@@ -46,7 +47,7 @@ const defaultQueryClient = new QueryClient({
46
47
  if (error.status)
47
48
  toaster.negative(getErrorMessage(error.status));
48
49
  else
49
- toaster.negative("A network error occured while processing this action.");
50
+ toaster.negative(GroupingMappingWidget.translate("errors.networkError"));
50
51
  },
51
52
  }),
52
53
  });
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingMappingContext.js","sourceRoot":"","sources":["../../../src/components/GroupingMappingContext.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5D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;IAEF,MAAM,oBAAoB,GAAG,OAAO,CAClC,GAAG,EAAE,CAAC,CAAC;QACL,SAAS;QACT,YAAY;KACb,CAAC,EACF,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,MAAM,8BAA8B,GAAG,OAAO,CAC5C,GAAG,EAAE,CAAC,CAAC;QACL,gBAAgB;QAChB,mBAAmB;KACpB,CAAC,EACF,CAAC,gBAAgB,CAAC,CACnB,CAAC;IAEF,OAAO,CACL,oBAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW;QACtC,oBAAC,+BAA+B,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS;YACxD,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa;gBACjD,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;oBAC/C,oBAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB;wBACvD,oBAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB;4BACvD,oBAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,8BAA8B;gCACxE,oBAAC,8BAA8B,CAAC,QAAQ,IAAC,KAAK,EAAE,oBAAoB;oCAClE,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,2BAA2B;wCACtE,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,sBAAsB,IAAG,KAAK,CAAC,QAAQ,CAAwC,CACvF,CACC,CACN,CACL,CACF,CACN,CACD,CACS,CACvB,CACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { GroupingMappingApiConfigContext } from \"./context/GroupingApiConfigContext\";\nimport { createMappingClient, MappingClientContext } from \"./context/MappingClientContext\";\nimport type { Group, IExtractionClient, IGroupsClient, IMappingsClient, IPropertiesClient } from \"@itwin/insights-client\";\nimport { createGroupingMappingCustomUI, GroupingMappingCustomUIContext } from \"./context/GroupingMappingCustomUIContext\";\nimport type { GroupingMappingCustomUI } from \"./customUI/GroupingMappingCustomUI\";\nimport type { OverlappedElementsMetadata } from \"./context/GroupHilitedElementsContext\";\nimport { GroupHilitedElementsContext } from \"./context/GroupHilitedElementsContext\";\nimport { PropertiesGroupColorContext } from \"./context/PropertiesGroupColorContext\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { createExtractionClient, ExtractionClientContext } from \"./context/ExtractionClientContext\";\nimport type { Query } from \"@tanstack/react-query\";\nimport { MutationCache, QueryCache, QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { getErrorMessage } from \"../common/utils\";\nimport { TErrCodes } from \"./Constants\";\nimport { ExtractionStatusJobContext } from \"./context/ExtractionStateJobContext\";\nimport { createGroupsClient, GroupsClientContext } from \"./context/GroupsClientContext\";\nimport { createPropertiesClient, PropertiesClientContext } from \"./context/PropertiesClientContext\";\n\n/**\n * Props for the {@link GroupingMappingContext} component.\n * @public\n */\nexport interface GroupingMappingContextProps {\n /**\n * Custom callback to retrieve access token.\n */\n getAccessToken?: GetAccessTokenFn;\n /**\n * The iTwin iModel Id.\n */\n iModelId: string;\n /**\n * Used for iTwin and iModel APIs.\n * Also used for Mapping API if a custom IMappingsClient is not provided.\n */\n changeSetId?: string;\n prefix?: ClientPrefix;\n /**\n * A custom implementation of MappingClient.\n */\n mappingsClient?: IMappingsClient;\n /**\n * A custom implementation of GroupsClient.\n */\n groupsClient?: IGroupsClient;\n /**\n * A custom implementation of PropertiesClient.\n */\n propertiesClient?: IPropertiesClient;\n /**\n * A custom implementation of ExtractionClient.\n */\n extractionClient?: IExtractionClient;\n /**\n * Custom UI to add and update groups or provide additional group context capabilities.\n */\n customUIs?: GroupingMappingCustomUI[];\n /**\n * A custom iModelConnection to use instead of the active iModelConnection from UiFramework.\n */\n iModelConnection?: IModelConnection;\n /**\n * A custom QueryClient. If not provided, a default QueryClient will be used.\n */\n queryClient?: QueryClient;\n children?: React.ReactNode;\n}\n\nconst authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? \"\";\n\nconst defaultQueryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n staleTime: 20 * 60 * 1000, // 20 minutes\n },\n },\n queryCache: new QueryCache({\n onError: (error: any, query: Query) => {\n switch (query.meta?.errorCode) {\n case TErrCodes.QUERY_HILITE_FETCH_FAILED:\n toaster.negative(query.meta?.message as string);\n break;\n default: {\n if (error.status) toaster.negative(getErrorMessage(error.status));\n else toaster.negative(\"An error occurred while fetching data.\");\n }\n }\n },\n }),\n mutationCache: new MutationCache({\n onError: (error: any) => {\n if (error.status) toaster.negative(getErrorMessage(error.status));\n else toaster.negative(\"A network error occured while processing this action.\");\n },\n }),\n});\n\n/**\n * Grouping and Mapping Context providers required for all components.\n * @public\n */\nexport const GroupingMappingContext = (props: GroupingMappingContextProps) => {\n const activeIModelConnection = useActiveIModelConnection();\n const mappingsClientProp: IMappingsClient | ClientPrefix = props.mappingsClient ?? props.prefix;\n const groupsClientProp: IGroupsClient | ClientPrefix = props.groupsClient ?? props.prefix;\n const propertiesClientProp: IPropertiesClient | ClientPrefix = props.propertiesClient ?? props.prefix;\n const extractionClientProp: IExtractionClient | ClientPrefix = props.extractionClient ?? props.prefix;\n const [mappingClient, setMappingClient] = useState<IMappingsClient>(createMappingClient(mappingsClientProp));\n const [groupsClient, setGroupsClient] = useState<IGroupsClient>(createGroupsClient(groupsClientProp));\n const [propertiesClient, setPropertiesClient] = useState<IPropertiesClient>(createPropertiesClient(propertiesClientProp));\n const [extractionClient, setExtractionClient] = useState<IExtractionClient>(createExtractionClient(extractionClientProp));\n const [customUIs, setCustomUIs] = useState<GroupingMappingCustomUI[]>(createGroupingMappingCustomUI(props.customUIs));\n const [apiConfig, setApiConfig] = useState<GroupingMappingApiConfig>({\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n iModelId: props.iModelId,\n prefix: props.prefix,\n changeSetId: props.changeSetId,\n });\n const [hiddenGroupsIds, setHiddenGroupsIds] = useState<Set<string>>(new Set());\n const [showGroupColor, setShowGroupColor] = useState<boolean>(false);\n const [propertiesShowGroup, setPropertiesShowGroup] = useState<boolean>(false);\n const [groupColors, setGroupColors] = useState<Map<string, string>>(new Map());\n const [groups, setGroups] = useState<Group[]>([]);\n const [numberOfVisualizedGroups, setNumberOfVisualizedGroups] = useState(0);\n const [isOverlappedColored, setIsOverlappedColored] = useState<boolean>(false);\n const [currentHilitedGroups, setCurrentHilitedGroups] = useState<number>(1);\n const [isVisualizationsEnabled, setIsVisualizationsEnabled] = useState<boolean>(false);\n const [overlappedElementsMetadata, setOverlappedElementsMetadata] = useState<OverlappedElementsMetadata>({\n overlappedElementsInfo: new Map(),\n groupElementsInfo: new Map(),\n overlappedElementGroupPairs: [],\n });\n const queryClient = props.queryClient ?? defaultQueryClient;\n const [mappingIdJobInfo, setMappingIdJobInfo] = useState<Map<string, string>>(new Map());\n\n useEffect(() => {\n setApiConfig(() => ({\n prefix: props.prefix,\n iModelId: props.iModelId,\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n iModelConnection: props.iModelConnection ?? activeIModelConnection,\n changeSetId: props.changeSetId,\n }));\n }, [activeIModelConnection, props.changeSetId, props.getAccessToken, props.iModelConnection, props.iModelId, props.prefix]);\n\n useEffect(() => {\n setMappingClient(createMappingClient(mappingsClientProp));\n }, [mappingsClientProp]);\n\n useEffect(() => {\n setGroupsClient(createGroupsClient(groupsClientProp));\n }, [groupsClientProp]);\n\n useEffect(() => {\n setPropertiesClient(createPropertiesClient(propertiesClientProp));\n }, [propertiesClientProp]);\n\n useEffect(() => {\n setExtractionClient(createExtractionClient(extractionClientProp));\n }, [extractionClientProp]);\n\n useEffect(() => {\n setCustomUIs(createGroupingMappingCustomUI(props.customUIs));\n }, [props.customUIs]);\n\n const hilitedElementsContextValue = useMemo(\n () => ({\n showGroupColor,\n setShowGroupColor,\n hiddenGroupsIds,\n setHiddenGroupsIds,\n groups,\n setGroups,\n numberOfVisualizedGroups,\n setNumberOfVisualizedGroups,\n isOverlappedColored,\n setIsOverlappedColored,\n currentHilitedGroups,\n setCurrentHilitedGroups,\n isVisualizationsEnabled,\n setIsVisualizationsEnabled,\n overlappedElementsMetadata,\n setOverlappedElementsMetadata,\n groupColors,\n setGroupColors,\n }),\n [\n showGroupColor,\n hiddenGroupsIds,\n groups,\n numberOfVisualizedGroups,\n isOverlappedColored,\n currentHilitedGroups,\n isVisualizationsEnabled,\n overlappedElementsMetadata,\n groupColors,\n setGroupColors,\n ],\n );\n\n const propertiesContextValue = useMemo(\n () => ({\n showGroupColor: propertiesShowGroup,\n setShowGroupColor: setPropertiesShowGroup,\n }),\n [propertiesShowGroup],\n );\n\n const customUIContextValue = useMemo(\n () => ({\n customUIs,\n setCustomUIs,\n }),\n [customUIs],\n );\n\n const extractionStateJobContextValue = useMemo(\n () => ({\n mappingIdJobInfo,\n setMappingIdJobInfo,\n }),\n [mappingIdJobInfo],\n );\n\n return (\n <QueryClientProvider client={queryClient}>\n <GroupingMappingApiConfigContext.Provider value={apiConfig}>\n <MappingClientContext.Provider value={mappingClient}>\n <GroupsClientContext.Provider value={groupsClient}>\n <PropertiesClientContext.Provider value={propertiesClient}>\n <ExtractionClientContext.Provider value={extractionClient}>\n <ExtractionStatusJobContext.Provider value={extractionStateJobContextValue}>\n <GroupingMappingCustomUIContext.Provider value={customUIContextValue}>\n <GroupHilitedElementsContext.Provider value={hilitedElementsContextValue}>\n <PropertiesGroupColorContext.Provider value={propertiesContextValue}>{props.children}</PropertiesGroupColorContext.Provider>\n </GroupHilitedElementsContext.Provider>\n </GroupingMappingCustomUIContext.Provider>\n </ExtractionStatusJobContext.Provider>\n </ExtractionClientContext.Provider>\n </PropertiesClientContext.Provider>\n </GroupsClientContext.Provider>\n </MappingClientContext.Provider>\n </GroupingMappingApiConfigContext.Provider>\n </QueryClientProvider>\n );\n};\n"]}
1
+ {"version":3,"file":"GroupingMappingContext.js","sourceRoot":"","sources":["../../../src/components/GroupingMappingContext.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3F,OAAO,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAGzH,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAEpG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAA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C,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,8BAA8B;gCACxE,oBAAC,8BAA8B,CAAC,QAAQ,IAAC,KAAK,EAAE,oBAAoB;oCAClE,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,2BAA2B;wCACtE,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,sBAAsB,IAAG,KAAK,CAAC,QAAQ,CAAwC,CACvF,CACC,CACN,CACL,CACF,CACN,CACD,CACS,CACvB,CACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { GroupingMappingApiConfigContext } from \"./context/GroupingApiConfigContext\";\nimport { createMappingClient, MappingClientContext } from \"./context/MappingClientContext\";\nimport type { Group, IExtractionClient, IGroupsClient, IMappingsClient, IPropertiesClient } from \"@itwin/insights-client\";\nimport { createGroupingMappingCustomUI, GroupingMappingCustomUIContext } from \"./context/GroupingMappingCustomUIContext\";\nimport type { GroupingMappingCustomUI } from \"./customUI/GroupingMappingCustomUI\";\nimport type { OverlappedElementsMetadata } from \"./context/GroupHilitedElementsContext\";\nimport { GroupHilitedElementsContext } from \"./context/GroupHilitedElementsContext\";\nimport { PropertiesGroupColorContext } from \"./context/PropertiesGroupColorContext\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { createExtractionClient, ExtractionClientContext } from \"./context/ExtractionClientContext\";\nimport type { Query } from \"@tanstack/react-query\";\nimport { MutationCache, QueryCache, QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { getErrorMessage } from \"../common/utils\";\nimport { TErrCodes } from \"./Constants\";\nimport { ExtractionStatusJobContext } from \"./context/ExtractionStateJobContext\";\nimport { createGroupsClient, GroupsClientContext } from \"./context/GroupsClientContext\";\nimport { createPropertiesClient, PropertiesClientContext } from \"./context/PropertiesClientContext\";\nimport { GroupingMappingWidget } from \"../GroupingMappingWidget\";\n\n/**\n * Props for the {@link GroupingMappingContext} component.\n * @public\n */\nexport interface GroupingMappingContextProps {\n /**\n * Custom callback to retrieve access token.\n */\n getAccessToken?: GetAccessTokenFn;\n /**\n * The iTwin iModel Id.\n */\n iModelId: string;\n /**\n * Used for iTwin and iModel APIs.\n * Also used for Mapping API if a custom IMappingsClient is not provided.\n */\n changeSetId?: string;\n prefix?: ClientPrefix;\n /**\n * A custom implementation of MappingClient.\n */\n mappingsClient?: IMappingsClient;\n /**\n * A custom implementation of GroupsClient.\n */\n groupsClient?: IGroupsClient;\n /**\n * A custom implementation of PropertiesClient.\n */\n propertiesClient?: IPropertiesClient;\n /**\n * A custom implementation of ExtractionClient.\n */\n extractionClient?: IExtractionClient;\n /**\n * Custom UI to add and update groups or provide additional group context capabilities.\n */\n customUIs?: GroupingMappingCustomUI[];\n /**\n * A custom iModelConnection to use instead of the active iModelConnection from UiFramework.\n */\n iModelConnection?: IModelConnection;\n /**\n * A custom QueryClient. If not provided, a default QueryClient will be used.\n */\n queryClient?: QueryClient;\n children?: React.ReactNode;\n}\n\nconst authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? \"\";\n\nconst defaultQueryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n staleTime: 20 * 60 * 1000, // 20 minutes\n },\n },\n queryCache: new QueryCache({\n onError: (error: any, query: Query) => {\n switch (query.meta?.errorCode) {\n case TErrCodes.QUERY_HILITE_FETCH_FAILED:\n toaster.negative(query.meta?.message as string);\n break;\n default: {\n if (error.status) toaster.negative(getErrorMessage(error.status));\n else toaster.negative(GroupingMappingWidget.translate(\"errors.fetchError\"));\n }\n }\n },\n }),\n mutationCache: new MutationCache({\n onError: (error: any) => {\n if (error.status) toaster.negative(getErrorMessage(error.status));\n else toaster.negative(GroupingMappingWidget.translate(\"errors.networkError\"));\n },\n }),\n});\n\n/**\n * Grouping and Mapping Context providers required for all components.\n * @public\n */\nexport const GroupingMappingContext = (props: GroupingMappingContextProps) => {\n const activeIModelConnection = useActiveIModelConnection();\n const mappingsClientProp: IMappingsClient | ClientPrefix = props.mappingsClient ?? props.prefix;\n const groupsClientProp: IGroupsClient | ClientPrefix = props.groupsClient ?? props.prefix;\n const propertiesClientProp: IPropertiesClient | ClientPrefix = props.propertiesClient ?? props.prefix;\n const extractionClientProp: IExtractionClient | ClientPrefix = props.extractionClient ?? props.prefix;\n const [mappingClient, setMappingClient] = useState<IMappingsClient>(createMappingClient(mappingsClientProp));\n const [groupsClient, setGroupsClient] = useState<IGroupsClient>(createGroupsClient(groupsClientProp));\n const [propertiesClient, setPropertiesClient] = useState<IPropertiesClient>(createPropertiesClient(propertiesClientProp));\n const [extractionClient, setExtractionClient] = useState<IExtractionClient>(createExtractionClient(extractionClientProp));\n const [customUIs, setCustomUIs] = useState<GroupingMappingCustomUI[]>(createGroupingMappingCustomUI(props.customUIs));\n const [apiConfig, setApiConfig] = useState<GroupingMappingApiConfig>({\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n iModelId: props.iModelId,\n prefix: props.prefix,\n changeSetId: props.changeSetId,\n });\n const [hiddenGroupsIds, setHiddenGroupsIds] = useState<Set<string>>(new Set());\n const [showGroupColor, setShowGroupColor] = useState<boolean>(false);\n const [propertiesShowGroup, setPropertiesShowGroup] = useState<boolean>(false);\n const [groupColors, setGroupColors] = useState<Map<string, string>>(new Map());\n const [groups, setGroups] = useState<Group[]>([]);\n const [numberOfVisualizedGroups, setNumberOfVisualizedGroups] = useState(0);\n const [isOverlappedColored, setIsOverlappedColored] = useState<boolean>(false);\n const [currentHilitedGroups, setCurrentHilitedGroups] = useState<number>(1);\n const [isVisualizationsEnabled, setIsVisualizationsEnabled] = useState<boolean>(false);\n const [overlappedElementsMetadata, setOverlappedElementsMetadata] = useState<OverlappedElementsMetadata>({\n overlappedElementsInfo: new Map(),\n groupElementsInfo: new Map(),\n overlappedElementGroupPairs: [],\n });\n const queryClient = props.queryClient ?? defaultQueryClient;\n const [mappingIdJobInfo, setMappingIdJobInfo] = useState<Map<string, string>>(new Map());\n\n useEffect(() => {\n setApiConfig(() => ({\n prefix: props.prefix,\n iModelId: props.iModelId,\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n iModelConnection: props.iModelConnection ?? activeIModelConnection,\n changeSetId: props.changeSetId,\n }));\n }, [activeIModelConnection, props.changeSetId, props.getAccessToken, props.iModelConnection, props.iModelId, props.prefix]);\n\n useEffect(() => {\n setMappingClient(createMappingClient(mappingsClientProp));\n }, [mappingsClientProp]);\n\n useEffect(() => {\n setGroupsClient(createGroupsClient(groupsClientProp));\n }, [groupsClientProp]);\n\n useEffect(() => {\n setPropertiesClient(createPropertiesClient(propertiesClientProp));\n }, [propertiesClientProp]);\n\n useEffect(() => {\n setExtractionClient(createExtractionClient(extractionClientProp));\n }, [extractionClientProp]);\n\n useEffect(() => {\n setCustomUIs(createGroupingMappingCustomUI(props.customUIs));\n }, [props.customUIs]);\n\n const hilitedElementsContextValue = useMemo(\n () => ({\n showGroupColor,\n setShowGroupColor,\n hiddenGroupsIds,\n setHiddenGroupsIds,\n groups,\n setGroups,\n numberOfVisualizedGroups,\n setNumberOfVisualizedGroups,\n isOverlappedColored,\n setIsOverlappedColored,\n currentHilitedGroups,\n setCurrentHilitedGroups,\n isVisualizationsEnabled,\n setIsVisualizationsEnabled,\n overlappedElementsMetadata,\n setOverlappedElementsMetadata,\n groupColors,\n setGroupColors,\n }),\n [\n showGroupColor,\n hiddenGroupsIds,\n groups,\n numberOfVisualizedGroups,\n isOverlappedColored,\n currentHilitedGroups,\n isVisualizationsEnabled,\n overlappedElementsMetadata,\n groupColors,\n setGroupColors,\n ],\n );\n\n const propertiesContextValue = useMemo(\n () => ({\n showGroupColor: propertiesShowGroup,\n setShowGroupColor: setPropertiesShowGroup,\n }),\n [propertiesShowGroup],\n );\n\n const customUIContextValue = useMemo(\n () => ({\n customUIs,\n setCustomUIs,\n }),\n [customUIs],\n );\n\n const extractionStateJobContextValue = useMemo(\n () => ({\n mappingIdJobInfo,\n setMappingIdJobInfo,\n }),\n [mappingIdJobInfo],\n );\n\n return (\n <QueryClientProvider client={queryClient}>\n <GroupingMappingApiConfigContext.Provider value={apiConfig}>\n <MappingClientContext.Provider value={mappingClient}>\n <GroupsClientContext.Provider value={groupsClient}>\n <PropertiesClientContext.Provider value={propertiesClient}>\n <ExtractionClientContext.Provider value={extractionClient}>\n <ExtractionStatusJobContext.Provider value={extractionStateJobContextValue}>\n <GroupingMappingCustomUIContext.Provider value={customUIContextValue}>\n <GroupHilitedElementsContext.Provider value={hilitedElementsContextValue}>\n <PropertiesGroupColorContext.Provider value={propertiesContextValue}>{props.children}</PropertiesGroupColorContext.Provider>\n </GroupHilitedElementsContext.Provider>\n </GroupingMappingCustomUIContext.Provider>\n </ExtractionStatusJobContext.Provider>\n </ExtractionClientContext.Provider>\n </PropertiesClientContext.Provider>\n </GroupsClientContext.Provider>\n </MappingClientContext.Provider>\n </GroupingMappingApiConfigContext.Provider>\n </QueryClientProvider>\n );\n};\n"]}
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import "./GroupAction.scss";
3
2
  import type { GroupMinimal } from "@itwin/insights-client";
4
- declare const defaultDisplayStrings: {
3
+ declare const getDefaultDisplayStrings: () => {
5
4
  groupDetails: string;
6
5
  groupBy: string;
7
6
  };
@@ -16,7 +15,7 @@ export interface GroupActionProps {
16
15
  queryGenerationType: string;
17
16
  onSaveSuccess: () => void;
18
17
  onClickCancel?: () => void;
19
- displayStrings?: Partial<typeof defaultDisplayStrings>;
18
+ displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;
20
19
  }
21
20
  /**
22
21
  * Component to create or update a group.
@@ -1,5 +1,6 @@
1
1
  import { Button } from "@itwin/itwinui-react";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from "react";
3
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
3
4
  import { LoadingSpinner } from "../../SharedComponents/LoadingSpinner";
4
5
  import "./GroupAction.scss";
5
6
  import useValidator from "../../Properties/hooks/useValidator";
@@ -13,10 +14,10 @@ import { GroupDetailsActionPanel } from "./GroupDetailsActionPanel";
13
14
  import { useVisualization } from "../hooks/useVisualization";
14
15
  import { useMutation, useQueryClient } from "@tanstack/react-query";
15
16
  import { useGroupsClient } from "../../context/GroupsClientContext";
16
- const defaultDisplayStrings = {
17
- groupDetails: "Group Details",
18
- groupBy: "Group By",
19
- };
17
+ const getDefaultDisplayStrings = () => ({
18
+ groupDetails: GroupingMappingWidget.translate("groups.groupDetails"),
19
+ groupBy: GroupingMappingWidget.translate("groups.groupBy"),
20
+ });
20
21
  var GroupActionStep;
21
22
  (function (GroupActionStep) {
22
23
  GroupActionStep[GroupActionStep["QueryBuilder"] = 0] = "QueryBuilder";
@@ -27,9 +28,10 @@ var GroupActionStep;
27
28
  * @public
28
29
  */
29
30
  export const GroupAction = (props) => {
31
+ const { onClickCancel: onCancel } = props;
30
32
  const { getAccessToken, iModelConnection } = useGroupingMappingApiConfig();
31
33
  if (!iModelConnection) {
32
- throw new Error("This component requires an active iModelConnection.");
34
+ throw new Error(GroupingMappingWidget.translate("errors.requiresIModelConnection"));
33
35
  }
34
36
  const groupsClient = useGroupsClient();
35
37
  const groupUIs = useGroupingMappingCustomUI().customUIs.filter((p) => p.type === GroupingMappingCustomUIType.Grouping);
@@ -44,7 +46,7 @@ export const GroupAction = (props) => {
44
46
  const [queryGenerationType, setQueryGenerationType] = useState(props.queryGenerationType);
45
47
  const { isRendering, simpleSelectionQuery, setSimpleSelectionQuery, clearPresentationSelection, resetView } = useVisualization(props.shouldVisualize, iModelConnection, query, queryGenerationType);
46
48
  const [currentStep, setCurrentStep] = React.useState(GroupActionStep.QueryBuilder);
47
- const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...props.displayStrings }), [props.displayStrings]);
49
+ const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...props.displayStrings }), [props.displayStrings]);
48
50
  useEffect(() => setQueryGenerationType(props.queryGenerationType), [props.queryGenerationType]);
49
51
  const fetchQueryRowCount = async (query) => {
50
52
  const rowCount = (await iModelConnection.createQueryReader(`SELECT count(*) FROM (${query})`).next()).value[0];
@@ -110,12 +112,15 @@ export const GroupAction = (props) => {
110
112
  const onClickBack = useCallback(() => {
111
113
  setCurrentStep(GroupActionStep.QueryBuilder);
112
114
  }, []);
113
- const onClickCancel = useCallback(() => {
115
+ const onClickCancel = useCallback(async () => {
114
116
  clearPresentationSelection();
115
- if (props.onClickCancel) {
116
- props.onClickCancel();
117
+ try {
118
+ await resetView();
119
+ }
120
+ finally {
121
+ onCancel?.();
117
122
  }
118
- }, [clearPresentationSelection, props]);
123
+ }, [clearPresentationSelection, onCancel, resetView]);
119
124
  const onClickNext = useCallback(() => {
120
125
  setCurrentStep(GroupActionStep.GroupDetails);
121
126
  }, []);
@@ -127,6 +132,6 @@ export const GroupAction = (props) => {
127
132
  isLoading && React.createElement(LoadingSpinner, null),
128
133
  isQueryBuilderStep && React.createElement(QueryBuilderActionPanel, { onClickNext: onClickNext, isNextDisabled: !(simpleSelectionQuery || query) }),
129
134
  isGroupDetailsStep && React.createElement(GroupDetailsActionPanel, { isSaveDisabled: isBlockingActions, onClickSave: onClickSave, onClickBack: onClickBack }),
130
- props.onClickCancel && (React.createElement(Button, { type: "button", id: "cancel", onClick: onClickCancel }, "Cancel")))));
135
+ onCancel && (React.createElement(Button, { type: "button", id: "cancel", onClick: onClickCancel }, GroupingMappingWidget.translate("common.cancel"))))));
131
136
  };
132
137
  //# sourceMappingURL=GroupAction.js.map
@@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ACE,6BAAK,SAAS,EAAC,gCAAgC;YAC7C,oBAAC,gBAAgB,IACf,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,CAAC,kBAAkB,EAC7B,mBAAmB,EAAE,mBAAmB,EACxC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,EAAE,GAAG,cAAc,EAAE,EACrC,KAAK,EAAE,KAAK,CAAC,KAAK,GAClB;YACD,kBAAkB,IAAI,oBAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,GAAG,cAAc,EAAE,GAAI,CAC9I;QACN,6BAAK,SAAS,EAAC,kBAAkB;YAC9B,SAAS,IAAI,oBAAC,cAAc,OAAG;YAC/B,kBAAkB,IAAI,oBAAC,uBAAuB,IAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC,oBAAoB,IAAI,KAAK,CAAC,GAAI;YAC7H,kBAAkB,IAAI,oBAAC,uBAAuB,IAAC,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAI;YACxI,KAAK,CAAC,aAAa,IAAI,CACtB,oBAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,EAAE,EAAC,QAAQ,EAAC,OAAO,EAAE,aAAa,aAE/C,CACV,CACG,CACL,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 type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { LoadingSpinner } from \"../../SharedComponents/LoadingSpinner\";\nimport \"./GroupAction.scss\";\nimport useValidator from \"../../Properties/hooks/useValidator\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingCustomUI } from \"../../context/GroupingMappingCustomUIContext\";\nimport type { GroupingCustomUI } from \"../../customUI/GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"../../customUI/GroupingMappingCustomUI\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport { QueryBuilderStep } from \"../QueryBuilder/QueryBuilderStep\";\nimport { GroupDetailsStep } from \"./GroupDetailsStep\";\nimport { QueryBuilderActionPanel } from \"../QueryBuilder/QueryBuilderActionPanel\";\nimport { GroupDetailsActionPanel } from \"./GroupDetailsActionPanel\";\nimport { useVisualization } from \"../hooks/useVisualization\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useGroupsClient } from \"../../context/GroupsClientContext\";\n\nconst defaultDisplayStrings = {\n groupDetails: \"Group Details\",\n groupBy: \"Group By\",\n};\n\nenum GroupActionStep {\n QueryBuilder,\n GroupDetails,\n}\n\n/**\n * Props for the {@link GroupAction} component.\n * @public\n */\nexport interface GroupActionProps {\n mappingId: string;\n shouldVisualize: boolean;\n group?: GroupMinimal;\n queryGenerationType: string;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\n/**\n * Component to create or update a group.\n * @public\n */\nexport const GroupAction = (props: GroupActionProps) => {\n const { getAccessToken, iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const groupsClient = useGroupsClient();\n const groupUIs: GroupingCustomUI[] = useGroupingMappingCustomUI().customUIs.filter(\n (p) => p.type === GroupingMappingCustomUIType.Grouping,\n ) as GroupingCustomUI[];\n const [details, setDetails] = useState({\n groupName: props.group?.groupName ?? \"\",\n description: props.group?.description ?? \"\",\n });\n const [query, setQuery] = useState<string>(\"\");\n const [queryRowCount, setQueryRowCount] = useState<number>(0);\n\n const [validator, setShowValidationMessage] = useValidator();\n const queryClient = useQueryClient();\n\n const [queryGenerationType, setQueryGenerationType] = useState(props.queryGenerationType);\n const { isRendering, simpleSelectionQuery, setSimpleSelectionQuery, clearPresentationSelection, resetView } = useVisualization(\n props.shouldVisualize,\n iModelConnection,\n query,\n queryGenerationType,\n );\n\n const [currentStep, setCurrentStep] = React.useState(GroupActionStep.QueryBuilder);\n\n const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...props.displayStrings }), [props.displayStrings]);\n\n useEffect(() => setQueryGenerationType(props.queryGenerationType), [props.queryGenerationType]);\n\n const fetchQueryRowCount = async (query: string) => {\n const rowCount = (await iModelConnection.createQueryReader(`SELECT count(*) FROM (${query})`).next()).value[0];\n return rowCount as number;\n };\n\n const { mutate, isLoading: isQueryLoading } = useMutation(fetchQueryRowCount, {\n onSuccess: (result) => {\n setQueryRowCount(result);\n },\n });\n\n useEffect(() => {\n if (query) {\n mutate(query);\n } else {\n setQueryRowCount(0);\n }\n }, [iModelConnection, query, mutate]);\n\n const getOptions = useMemo(\n (): SelectOption<string>[] =>\n groupUIs.map((ui) => ({\n label: ui.displayLabel,\n value: ui.name,\n icon: ui.icon,\n })),\n [groupUIs],\n );\n\n const onChange = useCallback(\n async (value: string) => {\n setQueryGenerationType(value);\n clearPresentationSelection();\n setQuery(\"\");\n setSimpleSelectionQuery(\"\");\n await resetView();\n },\n [clearPresentationSelection, resetView, setSimpleSelectionQuery],\n );\n\n const saveGroup = async () => {\n const accessToken = await getAccessToken();\n const currentQuery = query || simpleSelectionQuery;\n\n return props.group\n ? groupsClient.updateGroup(accessToken, props.mappingId, props.group.id, { ...details, query: currentQuery })\n : groupsClient.createGroup(accessToken, props.mappingId, { ...details, query: currentQuery });\n };\n\n const { mutate: onSaveMutate, isLoading: isSaveLoading } = useMutation(saveGroup, {\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"groups\"] });\n clearPresentationSelection();\n setDetails({\n groupName: props.group?.groupName ?? \"\",\n description: props.group?.description ?? \"\",\n });\n setCurrentStep(GroupActionStep.QueryBuilder);\n setShowValidationMessage(false);\n props.onSaveSuccess();\n },\n });\n\n const isQueryBuilderStep = currentStep === GroupActionStep.QueryBuilder;\n const isGroupDetailsStep = currentStep === GroupActionStep.GroupDetails;\n\n const isLoading = isSaveLoading || isQueryLoading;\n\n const isUpdating = isLoading || isRendering;\n\n const isBlockingActions = !(details.groupName && (query || simpleSelectionQuery)) || isRendering || isLoading;\n\n const onClickSave = useCallback(() => {\n if (!validator.allValid()) {\n setShowValidationMessage(true);\n return;\n }\n onSaveMutate();\n }, [onSaveMutate, setShowValidationMessage, validator]);\n\n const onClickBack = useCallback(() => {\n setCurrentStep(GroupActionStep.QueryBuilder);\n }, []);\n\n const onClickCancel = useCallback(() => {\n clearPresentationSelection();\n if (props.onClickCancel) {\n props.onClickCancel();\n }\n }, [clearPresentationSelection, props]);\n\n const onClickNext = useCallback(() => {\n setCurrentStep(GroupActionStep.GroupDetails);\n }, []);\n\n return (\n <>\n <div className=\"gmw-group-add-modify-container\">\n <QueryBuilderStep\n queryRowCount={queryRowCount}\n isHidden={!isQueryBuilderStep}\n queryGenerationType={queryGenerationType}\n groupUIs={groupUIs}\n isUpdating={isUpdating}\n resetView={resetView}\n setQuery={setQuery}\n onChange={onChange}\n getOptions={getOptions}\n displayStrings={{ ...displayStrings }}\n group={props.group}\n />\n {isGroupDetailsStep && <GroupDetailsStep details={details} setDetails={setDetails} validator={validator} displayStrings={{ ...displayStrings }} />}\n </div>\n <div className=\"gmw-action-panel\">\n {isLoading && <LoadingSpinner />}\n {isQueryBuilderStep && <QueryBuilderActionPanel onClickNext={onClickNext} isNextDisabled={!(simpleSelectionQuery || query)} />}\n {isGroupDetailsStep && <GroupDetailsActionPanel isSaveDisabled={isBlockingActions} onClickSave={onClickSave} onClickBack={onClickBack} />}\n {props.onClickCancel && (\n <Button type=\"button\" id=\"cancel\" onClick={onClickCancel}>\n Cancel\n </Button>\n )}\n </div>\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"GroupAction.js","sourceRoot":"","sources":["../../../../../src/components/Groups/Editing/GroupAction.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAE1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAErF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAAC,CAAC;IACtC,YAAY,EAAE,qBAAqB,CAAC,SAAS,CAAC,qBAAqB,CAAC;IACpE,OAAO,EAAE,qBAAqB,CAAC,SAAS,CAAC,gBAAgB,CA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AAuB,IAAC,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAI;YACxI,QAAQ,IAAI,CACX,oBAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,EAAE,EAAC,QAAQ,EAAC,OAAO,EAAE,aAAa,IACrD,qBAAqB,CAAC,SAAS,CAAC,eAAe,CAAC,CAC1C,CACV,CACG,CACL,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 type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport { LoadingSpinner } from \"../../SharedComponents/LoadingSpinner\";\nimport \"./GroupAction.scss\";\nimport useValidator from \"../../Properties/hooks/useValidator\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingCustomUI } from \"../../context/GroupingMappingCustomUIContext\";\nimport type { GroupingCustomUI } from \"../../customUI/GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"../../customUI/GroupingMappingCustomUI\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport { QueryBuilderStep } from \"../QueryBuilder/QueryBuilderStep\";\nimport { GroupDetailsStep } from \"./GroupDetailsStep\";\nimport { QueryBuilderActionPanel } from \"../QueryBuilder/QueryBuilderActionPanel\";\nimport { GroupDetailsActionPanel } from \"./GroupDetailsActionPanel\";\nimport { useVisualization } from \"../hooks/useVisualization\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useGroupsClient } from \"../../context/GroupsClientContext\";\n\nconst getDefaultDisplayStrings = () => ({\n groupDetails: GroupingMappingWidget.translate(\"groups.groupDetails\"),\n groupBy: GroupingMappingWidget.translate(\"groups.groupBy\"),\n});\n\nenum GroupActionStep {\n QueryBuilder,\n GroupDetails,\n}\n\n/**\n * Props for the {@link GroupAction} component.\n * @public\n */\nexport interface GroupActionProps {\n mappingId: string;\n shouldVisualize: boolean;\n group?: GroupMinimal;\n queryGenerationType: string;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;\n}\n\n/**\n * Component to create or update a group.\n * @public\n */\nexport const GroupAction = (props: GroupActionProps) => {\n const { onClickCancel: onCancel } = props;\n const { getAccessToken, iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(GroupingMappingWidget.translate(\"errors.requiresIModelConnection\"));\n }\n const groupsClient = useGroupsClient();\n const groupUIs: GroupingCustomUI[] = useGroupingMappingCustomUI().customUIs.filter(\n (p) => p.type === GroupingMappingCustomUIType.Grouping,\n );\n const [details, setDetails] = useState({\n groupName: props.group?.groupName ?? \"\",\n description: props.group?.description ?? \"\",\n });\n const [query, setQuery] = useState<string>(\"\");\n const [queryRowCount, setQueryRowCount] = useState<number>(0);\n\n const [validator, setShowValidationMessage] = useValidator();\n const queryClient = useQueryClient();\n\n const [queryGenerationType, setQueryGenerationType] = useState(props.queryGenerationType);\n const { isRendering, simpleSelectionQuery, setSimpleSelectionQuery, clearPresentationSelection, resetView } = useVisualization(\n props.shouldVisualize,\n iModelConnection,\n query,\n queryGenerationType,\n );\n\n const [currentStep, setCurrentStep] = React.useState(GroupActionStep.QueryBuilder);\n\n const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...props.displayStrings }), [props.displayStrings]);\n\n useEffect(() => setQueryGenerationType(props.queryGenerationType), [props.queryGenerationType]);\n\n const fetchQueryRowCount = async (query: string) => {\n const rowCount = (await iModelConnection.createQueryReader(`SELECT count(*) FROM (${query})`).next()).value[0];\n return rowCount as number;\n };\n\n const { mutate, isLoading: isQueryLoading } = useMutation(fetchQueryRowCount, {\n onSuccess: (result) => {\n setQueryRowCount(result);\n },\n });\n\n useEffect(() => {\n if (query) {\n mutate(query);\n } else {\n setQueryRowCount(0);\n }\n }, [iModelConnection, query, mutate]);\n\n const getOptions = useMemo(\n (): SelectOption<string>[] =>\n groupUIs.map((ui) => ({\n label: ui.displayLabel,\n value: ui.name,\n icon: ui.icon,\n })),\n [groupUIs],\n );\n\n const onChange = useCallback(\n async (value: string) => {\n setQueryGenerationType(value);\n clearPresentationSelection();\n setQuery(\"\");\n setSimpleSelectionQuery(\"\");\n await resetView();\n },\n [clearPresentationSelection, resetView, setSimpleSelectionQuery],\n );\n\n const saveGroup = async () => {\n const accessToken = await getAccessToken();\n const currentQuery = query || simpleSelectionQuery;\n\n return props.group\n ? groupsClient.updateGroup(accessToken, props.mappingId, props.group.id, { ...details, query: currentQuery })\n : groupsClient.createGroup(accessToken, props.mappingId, { ...details, query: currentQuery });\n };\n\n const { mutate: onSaveMutate, isLoading: isSaveLoading } = useMutation(saveGroup, {\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"groups\"] });\n clearPresentationSelection();\n setDetails({\n groupName: props.group?.groupName ?? \"\",\n description: props.group?.description ?? \"\",\n });\n setCurrentStep(GroupActionStep.QueryBuilder);\n setShowValidationMessage(false);\n props.onSaveSuccess();\n },\n });\n\n const isQueryBuilderStep = currentStep === GroupActionStep.QueryBuilder;\n const isGroupDetailsStep = currentStep === GroupActionStep.GroupDetails;\n\n const isLoading = isSaveLoading || isQueryLoading;\n\n const isUpdating = isLoading || isRendering;\n\n const isBlockingActions = !(details.groupName && (query || simpleSelectionQuery)) || isRendering || isLoading;\n\n const onClickSave = useCallback(() => {\n if (!validator.allValid()) {\n setShowValidationMessage(true);\n return;\n }\n onSaveMutate();\n }, [onSaveMutate, setShowValidationMessage, validator]);\n\n const onClickBack = useCallback(() => {\n setCurrentStep(GroupActionStep.QueryBuilder);\n }, []);\n\n const onClickCancel = useCallback(async () => {\n clearPresentationSelection();\n try {\n await resetView();\n } finally {\n onCancel?.();\n }\n }, [clearPresentationSelection, onCancel, resetView]);\n\n const onClickNext = useCallback(() => {\n setCurrentStep(GroupActionStep.GroupDetails);\n }, []);\n\n return (\n <>\n <div className=\"gmw-group-add-modify-container\">\n <QueryBuilderStep\n queryRowCount={queryRowCount}\n isHidden={!isQueryBuilderStep}\n queryGenerationType={queryGenerationType}\n groupUIs={groupUIs}\n isUpdating={isUpdating}\n resetView={resetView}\n setQuery={setQuery}\n onChange={onChange}\n getOptions={getOptions}\n displayStrings={{ ...displayStrings }}\n group={props.group}\n />\n {isGroupDetailsStep && <GroupDetailsStep details={details} setDetails={setDetails} validator={validator} displayStrings={{ ...displayStrings }} />}\n </div>\n <div className=\"gmw-action-panel\">\n {isLoading && <LoadingSpinner />}\n {isQueryBuilderStep && <QueryBuilderActionPanel onClickNext={onClickNext} isNextDisabled={!(simpleSelectionQuery || query)} />}\n {isGroupDetailsStep && <GroupDetailsActionPanel isSaveDisabled={isBlockingActions} onClickSave={onClickSave} onClickBack={onClickBack} />}\n {onCancel && (\n <Button type=\"button\" id=\"cancel\" onClick={onClickCancel}>\n {GroupingMappingWidget.translate(\"common.cancel\")}\n </Button>\n )}\n </div>\n </>\n );\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type SimpleReactValidator from "simple-react-validator";
3
2
  export interface GroupDetailsType {
4
3
  groupName: string;
@@ -4,12 +4,13 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { LabeledInput, Text } from "@itwin/itwinui-react";
6
6
  import React from "react";
7
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
7
8
  import { handleInputChange } from "../../../common/utils";
8
9
  import { NAME_REQUIREMENTS } from "../../Properties/hooks/useValidator";
9
10
  export const GroupDetails = ({ details, setDetails, validator }) => {
10
11
  return (React.createElement(React.Fragment, null,
11
- React.createElement(Text, { variant: "small", as: "small", className: "gmw-field-legend" }, "Asterisk * indicates mandatory fields."),
12
- React.createElement(LabeledInput, { id: "groupName", name: "groupName", label: "Name", value: details.groupName, required: true, onChange: (event) => {
12
+ React.createElement(Text, { variant: "small", as: "small", className: "gmw-field-legend" }, GroupingMappingWidget.translate("common.mandatoryFields")),
13
+ React.createElement(LabeledInput, { id: "groupName", name: "groupName", label: GroupingMappingWidget.translate("common.name"), value: details.groupName, required: true, onChange: (event) => {
13
14
  handleInputChange(event, details, setDetails);
14
15
  validator.showMessageFor("groupName");
15
16
  }, message: validator.message("groupName", details.groupName, NAME_REQUIREMENTS), status: validator.message("groupName", details.groupName, NAME_REQUIREMENTS) ? "negative" : undefined, onBlur: () => {
@@ -18,7 +19,7 @@ export const GroupDetails = ({ details, setDetails, validator }) => {
18
19
  handleInputChange(event, details, setDetails);
19
20
  validator.showMessageFor("groupName");
20
21
  } }),
21
- React.createElement(LabeledInput, { id: "description", name: "description", label: "Description", value: details.description, onChange: (event) => {
22
+ React.createElement(LabeledInput, { id: "description", name: "description", label: GroupingMappingWidget.translate("common.description"), value: details.description, onChange: (event) => {
22
23
  handleInputChange(event, details, setDetails);
23
24
  } })));
24
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"GroupDetails.js","sourceRoot":"","sources":["../../../../../src/components/Groups/Editing/GroupDetails.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAaxE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAqB,EAAE,EAAE;IACpF,OAAO,CACL;QACE,oBAAC,IAAI,IAAC,OAAO,EAAC,OAAO,EAAC,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,kBAAkB,6CAEtD;QACP,oBAAC,YAAY,IACX,EAAE,EAAC,WAAW,EACd,IAAI,EAAC,WAAW,EAChB,KAAK,EAAC,MAAM,EACZ,KAAK,EAAE,OAAO,CAAC,SAAS,EACxB,QAAQ,QACR,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;gBAC9C,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACxC,CAAC,EACD,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAC7E,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACrG,MAAM,EAAE,GAAG,EAAE;gBACX,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACxC,CAAC,EACD,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;gBAC9C,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACxC,CAAC,GACD;QACF,oBAAC,YAAY,IACX,EAAE,EAAC,aAAa,EAChB,IAAI,EAAC,aAAa,EAClB,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,OAAO,CAAC,WAAW,EAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAChD,CAAC,GACD,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 { LabeledInput, Text } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport type SimpleReactValidator from \"simple-react-validator\";\nimport { handleInputChange } from \"../../../common/utils\";\nimport { NAME_REQUIREMENTS } from \"../../Properties/hooks/useValidator\";\n\nexport interface GroupDetailsType {\n groupName: string;\n description: string;\n}\n\nexport interface GroupDetailsProps {\n details: GroupDetailsType;\n setDetails: (newDetails: GroupDetailsType) => void;\n validator: SimpleReactValidator;\n}\n\nexport const GroupDetails = ({ details, setDetails, validator }: GroupDetailsProps) => {\n return (\n <>\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n Asterisk * indicates mandatory fields.\n </Text>\n <LabeledInput\n id=\"groupName\"\n name=\"groupName\"\n label=\"Name\"\n value={details.groupName}\n required\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n message={validator.message(\"groupName\", details.groupName, NAME_REQUIREMENTS)}\n status={validator.message(\"groupName\", details.groupName, NAME_REQUIREMENTS) ? \"negative\" : undefined}\n onBlur={() => {\n validator.showMessageFor(\"groupName\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n />\n <LabeledInput\n id=\"description\"\n name=\"description\"\n label=\"Description\"\n value={details.description}\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n }}\n />\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"GroupDetails.js","sourceRoot":"","sources":["../../../../../src/components/Groups/Editing/GroupDetails.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC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K,EAAE,OAAO,CAAC,WAAW,EAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAChD,CAAC,GACD,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 { LabeledInput, Text } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport type SimpleReactValidator from \"simple-react-validator\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport { handleInputChange } from \"../../../common/utils\";\nimport { NAME_REQUIREMENTS } from \"../../Properties/hooks/useValidator\";\n\nexport interface GroupDetailsType {\n groupName: string;\n description: string;\n}\n\nexport interface GroupDetailsProps {\n details: GroupDetailsType;\n setDetails: (newDetails: GroupDetailsType) => void;\n validator: SimpleReactValidator;\n}\n\nexport const GroupDetails = ({ details, setDetails, validator }: GroupDetailsProps) => {\n return (\n <>\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n {GroupingMappingWidget.translate(\"common.mandatoryFields\")}\n </Text>\n <LabeledInput\n id=\"groupName\"\n name=\"groupName\"\n label={GroupingMappingWidget.translate(\"common.name\")}\n value={details.groupName}\n required\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n message={validator.message(\"groupName\", details.groupName, NAME_REQUIREMENTS)}\n status={validator.message(\"groupName\", details.groupName, NAME_REQUIREMENTS) ? \"negative\" : undefined}\n onBlur={() => {\n validator.showMessageFor(\"groupName\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n />\n <LabeledInput\n id=\"description\"\n name=\"description\"\n label={GroupingMappingWidget.translate(\"common.description\")}\n value={details.description}\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n }}\n />\n </>\n );\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface GroupDetailsActionPanelProps {
3
2
  isSaveDisabled: boolean;
4
3
  onClickBack: () => void;
@@ -4,9 +4,10 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { Button } from "@itwin/itwinui-react";
6
6
  import React from "react";
7
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
7
8
  export const GroupDetailsActionPanel = ({ isSaveDisabled, onClickBack, onClickSave }) => {
8
9
  return (React.createElement(React.Fragment, null,
9
- React.createElement(Button, { onClick: onClickBack }, "Back"),
10
- React.createElement(Button, { disabled: isSaveDisabled, styleType: "high-visibility", onClick: onClickSave }, "Save")));
10
+ React.createElement(Button, { onClick: onClickBack }, GroupingMappingWidget.translate("common.back")),
11
+ React.createElement(Button, { disabled: isSaveDisabled, styleType: "high-visibility", onClick: onClickSave }, GroupingMappingWidget.translate("common.save"))));
11
12
  };
12
13
  //# sourceMappingURL=GroupDetailsActionPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupDetailsActionPanel.js","sourceRoot":"","sources":["../../../../../src/components/Groups/Editing/GroupDetailsActionPanel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAgC,EAAE,EAAE;IACpH,OAAO,CACL;QACE,oBAAC,MAAM,IAAC,OAAO,EAAE,WAAW,WAAe;QAC3C,oBAAC,MAAM,IAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,WAAW,WAEzE,CACR,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 { Button } from \"@itwin/itwinui-react\";\nimport React from \"react\";\n\nexport interface GroupDetailsActionPanelProps {\n isSaveDisabled: boolean;\n onClickBack: () => void;\n onClickSave: () => void;\n}\n\nexport const GroupDetailsActionPanel = ({ isSaveDisabled, onClickBack, onClickSave }: GroupDetailsActionPanelProps) => {\n return (\n <>\n <Button onClick={onClickBack}>Back</Button>\n <Button disabled={isSaveDisabled} styleType=\"high-visibility\" onClick={onClickSave}>\n Save\n </Button>\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"GroupDetailsActionPanel.js","sourceRoot":"","sources":["../../../../../src/components/Groups/Editing/GroupDetailsActionPanel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAQvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAgC,EAAE,EAAE;IACpH,OAAO,CACL;QACE,oBAAC,MAAM,IAAC,OAAO,EAAE,WAAW,IAAG,qBAAqB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAU;QACvF,oBAAC,MAAM,IAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,WAAW,IAC/E,qBAAqB,CAAC,SAAS,CAAC,aAAa,CAAC,CACxC,CACR,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 { Button } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\nexport interface GroupDetailsActionPanelProps {\n isSaveDisabled: boolean;\n onClickBack: () => void;\n onClickSave: () => void;\n}\n\nexport const GroupDetailsActionPanel = ({ isSaveDisabled, onClickBack, onClickSave }: GroupDetailsActionPanelProps) => {\n return (\n <>\n <Button onClick={onClickBack}>{GroupingMappingWidget.translate(\"common.back\")}</Button>\n <Button disabled={isSaveDisabled} styleType=\"high-visibility\" onClick={onClickSave}>\n {GroupingMappingWidget.translate(\"common.save\")}\n </Button>\n </>\n );\n};\n"]}