@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 +1 @@
1
- {"version":3,"file":"MappingsView.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAA8D;AAE9D,wDAAgE;AAChE,oEAAoF;AACpF,mEAAgE;AAChE,uEAAoE;AACpE,+BAA6B;AAC7B,kFAA0D;AAC1D,gFAA6E;AAE7E,uDAAoD;AAEpD,4EAAyE;AACzE,uDAAoD;AAEpD,gFAA6E;AAC7E,sDAA8C;AAC9C,oFAAoF;AACpF,kFAAkF;AAClF,+DAA4D;AAE/C,QAAA,gCAAgC,GAAG;IAC9C,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,MAAM;IAClB,iBAAiB,EAAE,aAAa;CACjC,CAAC;AA+BF;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,E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C,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,CAAC,EAC/E,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC,CACG,CACR,CACG;QACL,0BAA0B,IAAI,CAC7B,8BAAC,+CAAsB,IACrB,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,6BAA6B,CAAC,KAAK,CAAC,EACnD,qBAAqB,EAAE,qBAAqB,EAC5C,SAAS,EAAE,qBAAqB,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,GAClF,CACH;QACA,eAAe,IAAI,CAClB,8BAAC,qBAAW,IACV,UAAU,EAAE,eAAe,EAAE,WAAW,EACxC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAC5C,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACnB,MAAM,QAAQ,CAAC,eAAe,CAAC,CAAC;YAClC,CAAC,GACD,CACH;QACA,eAAe,IAAI,kBAAkB,IAAI,CACxC,8BAAC,mDAAwB,IAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,GAAI,CAC9I,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAxIW,QAAA,YAAY,gBAwIvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { Alert } from \"@itwin/itwinui-react\";\nimport { Button, IconButton, List } from \"@itwin/itwinui-react\";\nimport { SvgAdd, SvgImport, SvgPlay, SvgRefresh } from \"@itwin/itwinui-icons-react\";\nimport { EmptyMessage } from \"../SharedComponents/EmptyMessage\";\nimport { LoadingOverlay } from \"../SharedComponents/LoadingOverlay\";\nimport \"./MappingsView.scss\";\nimport DeleteModal from \"../SharedComponents/DeleteModal\";\nimport { MappingImportWizardModal } from \"./Import/MappingImportWizardModal\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { BlockingOverlay } from \"./BlockingOverlay\";\nimport type { ExtractionStatusData } from \"./Extraction/ExtractionStatusIcon\";\nimport { ExtractionStatusIcon } from \"./Extraction/ExtractionStatusIcon\";\nimport { MappingListItem } from \"./MappingListItem\";\nimport type { ExtractionMessageData } from \"./Extraction/ExtractionMessageModal\";\nimport { ExtractionMessageModal } from \"./Extraction/ExtractionMessageModal\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { useExtractionStateJobContext } from \"../context/ExtractionStateJobContext\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { useRunExtraction } from \"./hooks/useRunExtraction\";\n\nexport const mappingViewDefaultDisplayStrings = {\n mappings: \"Mappings\",\n iTwins: \"iTwins\",\n iTwinNumber: \"Number\",\n iTwinName: \"Name\",\n iTwinStatus: \"Status\",\n iModels: \"iModels\",\n iModelName: \"Name\",\n iModelDescription: \"Description\",\n};\n\n/**\n * @internal\n */\nexport interface MappingsViewProps {\n mappings: Mapping[];\n isLoading: boolean;\n extractionStatusData: ExtractionStatusData;\n showExtractionMessageModal: boolean;\n extractionMessageData: ExtractionMessageData[];\n setShowExtractionMessageModal: (show: boolean) => void;\n isTogglingExtraction: boolean;\n onRefreshMappings: () => Promise<void>;\n onRefreshExtractionStatus: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n onDelete: (mapping: Mapping) => Promise<void>;\n showDeleteModal: Mapping | undefined;\n setShowDeleteModal: (mapping?: Mapping) => void;\n displayStrings?: Partial<typeof mappingViewDefaultDisplayStrings>;\n showImportModal?: boolean;\n setShowImportModal?: (show: boolean) => void;\n onClickAddMapping?: () => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n alert?: React.ReactElement<typeof Alert>;\n initialStateExtractionFlag?: boolean;\n setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;\n hideRefreshIcon?: boolean;\n}\n\n/**\n * UI Component to list mappings and handle extraction.\n * @internal\n */\nexport const MappingsView = ({\n mappings,\n isLoading,\n extractionStatusData,\n showExtractionMessageModal,\n extractionMessageData,\n setShowExtractionMessageModal,\n isTogglingExtraction,\n onRefreshMappings,\n onRefreshExtractionStatus,\n onToggleExtraction,\n onDelete,\n showDeleteModal,\n setShowDeleteModal,\n displayStrings: userDisplayStrings,\n showImportModal,\n setShowImportModal,\n onClickAddMapping,\n onClickMappingTitle,\n onClickMappingModify,\n alert,\n hideRefreshIcon,\n}: MappingsViewProps) => {\n const displayStrings = React.useMemo(() => ({ ...mappingViewDefaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);\n const [selectedMappings, setSelectedMappings] = useState<Mapping[]>([]);\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const { mappingIdJobInfo } = useExtractionStateJobContext();\n const { runExtraction } = useRunExtraction(groupingMappingApiConfig);\n\n const jobStartEvent = useMemo(() => new BeEvent<(mappingId: string) => void>(), []);\n\n const refreshAll = useCallback(async () => {\n await Promise.all([onRefreshMappings(), onRefreshExtractionStatus()]);\n }, [onRefreshMappings, onRefreshExtractionStatus]);\n\n const onSelectionChange = (mapping: Mapping) => {\n setSelectedMappings((mappingIdList) => {\n return mappingIdList.some((eachId) => mapping.id === eachId.id)\n ? mappingIdList.filter((eachId) => mapping.id !== eachId.id)\n : [...mappingIdList, mapping];\n });\n };\n\n const onRunExtraction = useCallback(async () => {\n await runExtraction(selectedMappings);\n selectedMappings.map((mapping) => {\n jobStartEvent.raiseEvent(mapping.id);\n });\n setSelectedMappings([]);\n }, [selectedMappings, jobStartEvent, runExtraction]);\n\n return (\n <>\n <BlockingOverlay isVisible={isTogglingExtraction} />\n <div className=\"gmw-mappings-view-container\">\n <div className=\"gmw-table-toolbar\">\n <div className=\"gmw-button-spacing\">\n {onClickAddMapping && (\n <Button startIcon={<SvgAdd />} onClick={onClickAddMapping} styleType=\"high-visibility\" title=\"New Mapping\">\n New\n </Button>\n )}\n {showImportModal !== undefined && setShowImportModal && (\n <IconButton title={`Import ${displayStrings.mappings}`} onClick={() => setShowImportModal(true)}>\n <SvgImport />\n </IconButton>\n )}\n <IconButton title=\"Run extraction\" onClick={onRunExtraction} disabled={selectedMappings.length === 0}>\n <SvgPlay />\n </IconButton>\n </div>\n <div className=\"gmw-button-spacing\">\n <ExtractionStatusIcon\n iconStatus={extractionStatusData.iconStatus}\n onClick={() => {\n if (extractionStatusData.iconStatus === \"negative\") {\n setShowExtractionMessageModal(true);\n }\n }}\n iconMessage={extractionStatusData.iconMessage}\n />\n {!hideRefreshIcon && (\n <IconButton title=\"Refresh\" onClick={refreshAll} disabled={isLoading} styleType=\"borderless\">\n <SvgRefresh />\n </IconButton>\n )}\n </div>\n </div>\n {alert}\n <div className=\"gmw-mappings-border\" />\n {isLoading && !isTogglingExtraction ? (\n <LoadingOverlay />\n ) : mappings.length === 0 ? (\n <EmptyMessage message={`No ${displayStrings.mappings} available.`} />\n ) : (\n <List className=\"gmw-mappings-list\">\n {mappings.map((mapping) => (\n <MappingListItem\n key={mapping.id}\n mapping={mapping}\n jobId={mappingIdJobInfo?.get(mapping.id) ?? \"\"}\n jobStartEvent={jobStartEvent}\n onClickMappingTitle={onClickMappingTitle}\n onSelectionChange={onSelectionChange}\n selected={selectedMappings.some((eachMapping) => mapping.id === eachMapping.id)}\n onToggleExtraction={onToggleExtraction}\n onRefreshMappings={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n ))}\n </List>\n )}\n </div>\n {showExtractionMessageModal && (\n <ExtractionMessageModal\n isOpen={showExtractionMessageModal}\n onClose={() => setShowExtractionMessageModal(false)}\n extractionMessageData={extractionMessageData}\n timestamp={extractionMessageData.length === 0 ? \"\" : extractionMessageData[0].date}\n />\n )}\n {showDeleteModal && (\n <DeleteModal\n entityName={showDeleteModal?.mappingName}\n onClose={() => setShowDeleteModal(undefined)}\n onDelete={async () => {\n await onDelete(showDeleteModal);\n }}\n />\n )}\n {showImportModal && setShowImportModal && (\n <MappingImportWizardModal show={showImportModal} setShow={setShowImportModal} onFinish={onRefreshMappings} displayStrings={displayStrings} />\n )}\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"MappingsView.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAA8D;AAE9D,wDAAgE;AAChE,oEAAoF;AACpF,uEAAoE;AACpE,mEAAgE;AAChE,uEAAoE;AACpE,+BAA6B;AAC7B,kFAA0D;AAC1D,gFAA6E;AAE7E,uDAAoD;AAEpD,4EAAyE;AACzE,uDAAoD;AAEpD,gFAA6E;AAC7E,sDAA8C;AAC9C,oFAAoF;AACpF,kFAAkF;AAClF,+DAA4D;AAErD,MAAM,mCAAmC,GAAG,GAAG,EAAE,CAAC,CAAC;IACxD,QAAQ,EAAE,6CAAqB,CAAC,SAAS,CAAC,mBAAmB,CAAC;IAC9D,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,eAAe,CAAC;IAC7D,SAAS,EAAE,6CAAqB,CAAC,SAAS,CAAC,aAAa,CAAC;IACzD,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,eAAe,CAAC;IAC7D,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,6CAAqB,CAAC,SAAS,CAAC,aAAa,CAAC;IAC1D,iBAAiB,EAAE,6CAAqB,CAAC,SAAS,CAAC,oBAAoB,CAAC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AAe,CAAC,CAAC;YAClC,CAAC,GACD,CACH;QACA,eAAe,IAAI,kBAAkB,IAAI,CACxC,8BAAC,mDAAwB,IAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,GAAI,CAC9I,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAxIW,QAAA,YAAY,gBAwIvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { Alert } from \"@itwin/itwinui-react\";\nimport { Button, IconButton, List } from \"@itwin/itwinui-react\";\nimport { SvgAdd, SvgImport, SvgPlay, SvgRefresh } from \"@itwin/itwinui-icons-react\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\nimport { EmptyMessage } from \"../SharedComponents/EmptyMessage\";\nimport { LoadingOverlay } from \"../SharedComponents/LoadingOverlay\";\nimport \"./MappingsView.scss\";\nimport DeleteModal from \"../SharedComponents/DeleteModal\";\nimport { MappingImportWizardModal } from \"./Import/MappingImportWizardModal\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { BlockingOverlay } from \"./BlockingOverlay\";\nimport type { ExtractionStatusData } from \"./Extraction/ExtractionStatusIcon\";\nimport { ExtractionStatusIcon } from \"./Extraction/ExtractionStatusIcon\";\nimport { MappingListItem } from \"./MappingListItem\";\nimport type { ExtractionMessageData } from \"./Extraction/ExtractionMessageModal\";\nimport { ExtractionMessageModal } from \"./Extraction/ExtractionMessageModal\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { useExtractionStateJobContext } from \"../context/ExtractionStateJobContext\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { useRunExtraction } from \"./hooks/useRunExtraction\";\n\nexport const getMappingViewDefaultDisplayStrings = () => ({\n mappings: GroupingMappingWidget.translate(\"mappings.mappings\"),\n iTwins: \"iTwins\",\n iTwinNumber: GroupingMappingWidget.translate(\"common.number\"),\n iTwinName: GroupingMappingWidget.translate(\"common.name\"),\n iTwinStatus: GroupingMappingWidget.translate(\"common.status\"),\n iModels: \"iModels\",\n iModelName: GroupingMappingWidget.translate(\"common.name\"),\n iModelDescription: GroupingMappingWidget.translate(\"common.description\"),\n});\n\n/**\n * @internal\n */\nexport interface MappingsViewProps {\n mappings: Mapping[];\n isLoading: boolean;\n extractionStatusData: ExtractionStatusData;\n showExtractionMessageModal: boolean;\n extractionMessageData: ExtractionMessageData[];\n setShowExtractionMessageModal: (show: boolean) => void;\n isTogglingExtraction: boolean;\n onRefreshMappings: () => Promise<void>;\n onRefreshExtractionStatus: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n onDelete: (mapping: Mapping) => Promise<void>;\n showDeleteModal: Mapping | undefined;\n setShowDeleteModal: (mapping?: Mapping) => void;\n displayStrings?: Partial<ReturnType<typeof getMappingViewDefaultDisplayStrings>>;\n showImportModal?: boolean;\n setShowImportModal?: (show: boolean) => void;\n onClickAddMapping?: () => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n alert?: React.ReactElement<typeof Alert>;\n initialStateExtractionFlag?: boolean;\n setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;\n hideRefreshIcon?: boolean;\n}\n\n/**\n * UI Component to list mappings and handle extraction.\n * @internal\n */\nexport const MappingsView = ({\n mappings,\n isLoading,\n extractionStatusData,\n showExtractionMessageModal,\n extractionMessageData,\n setShowExtractionMessageModal,\n isTogglingExtraction,\n onRefreshMappings,\n onRefreshExtractionStatus,\n onToggleExtraction,\n onDelete,\n showDeleteModal,\n setShowDeleteModal,\n displayStrings: userDisplayStrings,\n showImportModal,\n setShowImportModal,\n onClickAddMapping,\n onClickMappingTitle,\n onClickMappingModify,\n alert,\n hideRefreshIcon,\n}: MappingsViewProps) => {\n const displayStrings = React.useMemo(() => ({ ...getMappingViewDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n const [selectedMappings, setSelectedMappings] = useState<Mapping[]>([]);\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const { mappingIdJobInfo } = useExtractionStateJobContext();\n const { runExtraction } = useRunExtraction(groupingMappingApiConfig);\n\n const jobStartEvent = useMemo(() => new BeEvent<(mappingId: string) => void>(), []);\n\n const refreshAll = useCallback(async () => {\n await Promise.all([onRefreshMappings(), onRefreshExtractionStatus()]);\n }, [onRefreshMappings, onRefreshExtractionStatus]);\n\n const onSelectionChange = (mapping: Mapping) => {\n setSelectedMappings((mappingIdList) => {\n return mappingIdList.some((eachId) => mapping.id === eachId.id)\n ? mappingIdList.filter((eachId) => mapping.id !== eachId.id)\n : [...mappingIdList, mapping];\n });\n };\n\n const onRunExtraction = useCallback(async () => {\n await runExtraction(selectedMappings);\n selectedMappings.map((mapping) => {\n jobStartEvent.raiseEvent(mapping.id);\n });\n setSelectedMappings([]);\n }, [selectedMappings, jobStartEvent, runExtraction]);\n\n return (\n <>\n <BlockingOverlay isVisible={isTogglingExtraction} />\n <div className=\"gmw-mappings-view-container\">\n <div className=\"gmw-table-toolbar\">\n <div className=\"gmw-button-spacing\">\n {onClickAddMapping && (\n <Button startIcon={<SvgAdd />} onClick={onClickAddMapping} styleType=\"high-visibility\" title={GroupingMappingWidget.translate(\"mappings.newMapping\")}>\n {GroupingMappingWidget.translate(\"common.new\")}\n </Button>\n )}\n {showImportModal !== undefined && setShowImportModal && (\n <IconButton title={GroupingMappingWidget.translate(\"mappings.importMappings\", { mappings: displayStrings.mappings })} onClick={() => setShowImportModal(true)}>\n <SvgImport />\n </IconButton>\n )}\n <IconButton title={GroupingMappingWidget.translate(\"mappings.runExtraction\")} onClick={onRunExtraction} disabled={selectedMappings.length === 0}>\n <SvgPlay />\n </IconButton>\n </div>\n <div className=\"gmw-button-spacing\">\n <ExtractionStatusIcon\n iconStatus={extractionStatusData.iconStatus}\n onClick={() => {\n if (extractionStatusData.iconStatus === \"negative\") {\n setShowExtractionMessageModal(true);\n }\n }}\n iconMessage={extractionStatusData.iconMessage}\n />\n {!hideRefreshIcon && (\n <IconButton title={GroupingMappingWidget.translate(\"common.refresh\")} onClick={refreshAll} disabled={isLoading} styleType=\"borderless\">\n <SvgRefresh />\n </IconButton>\n )}\n </div>\n </div>\n {alert}\n <div className=\"gmw-mappings-border\" />\n {isLoading && !isTogglingExtraction ? (\n <LoadingOverlay />\n ) : mappings.length === 0 ? (\n <EmptyMessage message={GroupingMappingWidget.translate(\"mappings.noMappings\", { mappings: displayStrings.mappings })} />\n ) : (\n <List className=\"gmw-mappings-list\">\n {mappings.map((mapping) => (\n <MappingListItem\n key={mapping.id}\n mapping={mapping}\n jobId={mappingIdJobInfo?.get(mapping.id) ?? \"\"}\n jobStartEvent={jobStartEvent}\n onClickMappingTitle={onClickMappingTitle}\n onSelectionChange={onSelectionChange}\n selected={selectedMappings.some((eachMapping) => mapping.id === eachMapping.id)}\n onToggleExtraction={onToggleExtraction}\n onRefreshMappings={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n ))}\n </List>\n )}\n </div>\n {showExtractionMessageModal && (\n <ExtractionMessageModal\n isOpen={showExtractionMessageModal}\n onClose={() => setShowExtractionMessageModal(false)}\n extractionMessageData={extractionMessageData}\n timestamp={extractionMessageData.find((data) => data.date?.trim().length > 0)?.date ?? \"\"}\n />\n )}\n {showDeleteModal && (\n <DeleteModal\n entityName={showDeleteModal?.mappingName}\n onClose={() => setShowDeleteModal(undefined)}\n onDelete={async () => {\n await onDelete(showDeleteModal);\n }}\n />\n )}\n {showImportModal && setShowImportModal && (\n <MappingImportWizardModal show={showImportModal} setShow={setShowImportModal} onFinish={onRefreshMappings} displayStrings={displayStrings} />\n )}\n </>\n );\n};\n"]}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useFetchExtractionStatus = void 0;
4
4
  const insights_client_1 = require("@itwin/insights-client");
5
5
  const react_query_1 = require("@tanstack/react-query");
6
+ const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
6
7
  const useFetchExtractionStatus = ({ iModelId, getAccessToken, extractionClient, }) => {
7
8
  return (0, react_query_1.useQuery)({
8
9
  queryKey: ["iModelExtractionStatus", iModelId],
@@ -22,7 +23,7 @@ const useFetchExtractionStatus = ({ iModelId, getAccessToken, extractionClient,
22
23
  if (latestExtractionResult.done) {
23
24
  extractionStatusIcon = {
24
25
  iconStatus: "negative",
25
- iconMessage: "No extraction found.",
26
+ iconMessage: GroupingMappingWidget_1.GroupingMappingWidget.translate("extraction.noExtraction"),
26
27
  };
27
28
  }
28
29
  else {
@@ -38,13 +39,13 @@ const useFetchExtractionStatus = ({ iModelId, getAccessToken, extractionClient,
38
39
  }));
39
40
  extractionStatusIcon = {
40
41
  iconStatus: "negative",
41
- iconMessage: "Extraction contains issues. Click to view extraction logs.",
42
+ iconMessage: GroupingMappingWidget_1.GroupingMappingWidget.translate("extraction.extractionIssues"),
42
43
  };
43
44
  }
44
45
  else {
45
46
  extractionStatusIcon = {
46
47
  iconStatus: "positive",
47
- iconMessage: "Extraction successful.",
48
+ iconMessage: GroupingMappingWidget_1.GroupingMappingWidget.translate("extraction.extractionSuccessful"),
48
49
  };
49
50
  }
50
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useFetchExtractionStatus.ts"],"names":[],"mappings":";;;AAKA,4DAAyD;AACzD,uDAAiD;AAK1C,MAAM,wBAAwB,GAAG,CAAC,EACvC,QAAQ,EACR,cAAc,EACd,gBAAgB,GAKjB,EAAE,EAAE;IACH,OAAO,IAAA,sBAAQ,EAAC;QACd,QAAQ,EAAE,CAAC,wBAAwB,EAAE,QAAQ,CAAC;QAC9C,SAAS,EAAE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C;oBACN,oBAAoB,GAAG;wBACrB,UAAU,EAAE,UAAU;wBACtB,WAAW,EAAE,4DAA4D;qBAC1E,CAAC;iBACH;qBAAM;oBACL,oBAAoB,GAAG;wBACrB,UAAU,EAAE,UAAU;wBACtB,WAAW,EAAE,wBAAwB;qBACtC,CAAC;iBACH;aACF;YAED,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,CAAC;QACjF,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AA1DW,QAAA,wBAAwB,4BA0DnC","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 { ExtractionStatus, IExtractionClient } from \"@itwin/insights-client\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\nimport type { ExtractionMessageData } from \"../Extraction/ExtractionMessageModal\";\nimport type { ExtractionStatusData } from \"../Extraction/ExtractionStatusIcon\";\n\nexport const useFetchExtractionStatus = ({\n iModelId,\n getAccessToken,\n extractionClient,\n}: {\n iModelId: string;\n getAccessToken: GetAccessTokenFn;\n extractionClient: IExtractionClient;\n}) => {\n return useQuery({\n queryKey: [\"iModelExtractionStatus\", iModelId],\n staleTime: Infinity,\n placeholderData: undefined,\n queryFn: async () => {\n const accessToken = await getAccessToken();\n const extraction = extractionClient.getIModelExtractionsIterator(accessToken, iModelId, 1);\n const latestExtractionResult = await extraction.next();\n\n let extractionStatusIcon: ExtractionStatusData;\n let extractionMessageData: ExtractionMessageData[] = [];\n\n const latestExtractionResultId = latestExtractionResult.value?.id;\n let latestJobStatus: ExtractionStatus | undefined;\n if (latestExtractionResultId) {\n latestJobStatus = latestExtractionResult.value;\n }\n\n if (latestExtractionResult.done) {\n extractionStatusIcon = {\n iconStatus: \"negative\",\n iconMessage: \"No extraction found.\",\n };\n } else {\n if (latestJobStatus?.state === ExtractionState.PartiallySucceeded || latestJobStatus?.state === ExtractionState.Failed) {\n const logs = await extractionClient.getExtractionLogs(accessToken, latestExtractionResultId);\n extractionMessageData = logs.logs\n .filter((log) => log.message !== null)\n .map((log) => ({\n date: log.dateTime,\n category: log.category,\n level: log.level,\n message: log.message ?? \"\",\n }));\n extractionStatusIcon = {\n iconStatus: \"negative\",\n iconMessage: \"Extraction contains issues. Click to view extraction logs.\",\n };\n } else {\n extractionStatusIcon = {\n iconStatus: \"positive\",\n iconMessage: \"Extraction successful.\",\n };\n }\n }\n\n return { extractionStatusIcon, extractionMessageData, latestExtractionResult };\n },\n });\n};\n"]}
1
+ {"version":3,"file":"useFetchExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useFetchExtractionStatus.ts"],"names":[],"mappings":";;;AAKA,4DAAyD;AACzD,uDAAiD;AAIjD,0EAAuE;AAEhE,MAAM,wBAAwB,GAAG,CAAC,EACvC,QAAQ,EACR,cAAc,EACd,gBAAgB,GAKjB,EAAE,EAAE;IACH,OAAO,IAAA,sBAAQ,EAAC;QACd,QAAQ,EAAE,CAAC,wBAAwB,EAAE,QAAQ,CAAC;QAC9C,SAAS,EAAE,QAAQ;QACnB,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;YAC3C,MAAM,UAAU,GAAG,gBAAgB,CAAC,4BAA4B,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC3F,MAAM,sBAAsB,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;YAEvD,IAAI,oBAA0C,CAAC;YAC/C,IAAI,qBAAqB,GAA4B,EAAE,CAAC;YAExD,MAAM,wBAAwB,GAAG,sBAAsB,CAAC,KAAK,EAAE,EAAE,CAAC;YAClE,IAAI,eAA6C,CAAC;YAClD,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CAAC,CAAC;AACL,CAAC,CAAC;AA1DW,QAAA,wBAAwB,4BA0DnC","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 { ExtractionStatus, IExtractionClient } from \"@itwin/insights-client\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\nimport type { ExtractionMessageData } from \"../Extraction/ExtractionMessageModal\";\nimport type { ExtractionStatusData } from \"../Extraction/ExtractionStatusIcon\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\nexport const useFetchExtractionStatus = ({\n iModelId,\n getAccessToken,\n extractionClient,\n}: {\n iModelId: string;\n getAccessToken: GetAccessTokenFn;\n extractionClient: IExtractionClient;\n}) => {\n return useQuery({\n queryKey: [\"iModelExtractionStatus\", iModelId],\n staleTime: Infinity,\n placeholderData: undefined,\n queryFn: async () => {\n const accessToken = await getAccessToken();\n const extraction = extractionClient.getIModelExtractionsIterator(accessToken, iModelId, 1);\n const latestExtractionResult = await extraction.next();\n\n let extractionStatusIcon: ExtractionStatusData;\n let extractionMessageData: ExtractionMessageData[] = [];\n\n const latestExtractionResultId = latestExtractionResult.value?.id;\n let latestJobStatus: ExtractionStatus | undefined;\n if (latestExtractionResultId) {\n latestJobStatus = latestExtractionResult.value;\n }\n\n if (latestExtractionResult.done) {\n extractionStatusIcon = {\n iconStatus: \"negative\",\n iconMessage: GroupingMappingWidget.translate(\"extraction.noExtraction\"),\n };\n } else {\n if (latestJobStatus?.state === ExtractionState.PartiallySucceeded || latestJobStatus?.state === ExtractionState.Failed) {\n const logs = await extractionClient.getExtractionLogs(accessToken, latestExtractionResultId);\n extractionMessageData = logs.logs\n .filter((log) => log.message !== null)\n .map((log) => ({\n date: log.dateTime,\n category: log.category,\n level: log.level,\n message: log.message ?? \"\",\n }));\n extractionStatusIcon = {\n iconStatus: \"negative\",\n iconMessage: GroupingMappingWidget.translate(\"extraction.extractionIssues\"),\n };\n } else {\n extractionStatusIcon = {\n iconStatus: \"positive\",\n iconMessage: GroupingMappingWidget.translate(\"extraction.extractionSuccessful\"),\n };\n }\n }\n\n return { extractionStatusIcon, extractionMessageData, latestExtractionResult };\n },\n });\n};\n"]}
@@ -1,6 +1,5 @@
1
1
  import type { QueryClient } from "@tanstack/react-query";
2
- import type { IExtractionClient } from "@itwin/insights-client";
3
- import type { Mapping } from "@itwin/insights-client";
2
+ import type { IExtractionClient, Mapping } from "@itwin/insights-client";
4
3
  import { ExtractionStates } from "../Extraction/ExtractionStatus";
5
4
  import type { GetAccessTokenFn, GroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
6
5
  export interface MappingExtractionStatusProps extends GroupingMappingApiConfig {
@@ -47,7 +47,7 @@ const useFetchMappingExtractionStatus = ({ getAccessToken, mapping, enabled }) =
47
47
  // This should not happen as jobId should be defined if enabled is true
48
48
  throw new Error("Job ID is undefined");
49
49
  },
50
- enabled: enabled && Boolean(jobId),
50
+ enabled: enabled && Boolean(jobId), // Only enable the query if enabled is true and jobId is defined
51
51
  refetchInterval: Constants_1.STATUS_CHECK_INTERVAL,
52
52
  });
53
53
  return statusQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchMappingExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useFetchMappingExtractionStatus.ts"],"names":[],"mappings":";;;AAKA,uDAAiD;AAEjD,4DAAyD;AAEzD,+CAAwD;AACxD,qEAAkE;AAElE,mFAA4E;AAC5E,uFAAuF;AAYhF,MAAM,kBAAkB,GAAG,KAAK,EAAE,SAAiB,EAAE,KAAa,EAAE,cAAgC,EAAE,gBAAmC,EAAE,EAAE;IAClJ,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAE3C,MAAM,wBAAwB,GAAG,CAAC,wBAA0C,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,gBAAgB,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC/C,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,wDAA4B,GAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAG,IAAA,sBAAQ,EAAqB;QAC/C,QAAQ,EAAE,CAAC,iBAAiB,EAAE,KAAK,CAAC;QACpC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,KAAK,EAAE;gBACT,OAAO,IAAA,0BAAkB,EAAC,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAC;aAChF;YACD,uEAAuE;YACvE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC;QAClC,eAAe,EAAE,iCAAqB;KACvC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAnBW,QAAA,+BAA+B,mCAmB1C","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 { QueryClient } from \"@tanstack/react-query\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ExtractionStatus, IExtractionClient } from \"@itwin/insights-client\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport type { Mapping } from \"@itwin/insights-client\";\nimport { STATUS_CHECK_INTERVAL } from \"../../Constants\";\nimport { ExtractionStates } from \"../Extraction/ExtractionStatus\";\nimport type { GetAccessTokenFn, GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\n\nexport interface MappingExtractionStatusProps extends GroupingMappingApiConfig {\n mapping: Mapping;\n enabled: boolean;\n}\n\nexport interface MappingQueryResult {\n mappingId: string;\n finalExtractionStateValue: ExtractionStates;\n}\n\nexport const fetchMappingStatus = async (mappingId: string, jobId: string, getAccessToken: GetAccessTokenFn, extractionClient: IExtractionClient) => {\n const accessToken = await getAccessToken();\n\n const getFinalExtractionStatus = (extractionStatusResponse: ExtractionStatus) => {\n switch (extractionStatusResponse.state) {\n case undefined:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Starting };\n case ExtractionState.Running:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Running };\n case ExtractionState.Failed:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Failed };\n case ExtractionState.Queued:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Queued };\n case ExtractionState.Succeeded:\n case ExtractionState.PartiallySucceeded:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Succeeded };\n default:\n return { mappingId, finalExtractionStateValue: ExtractionStates.None };\n }\n };\n const extractionStatusResponse = await extractionClient.getExtractionStatus(accessToken, jobId);\n return getFinalExtractionStatus(extractionStatusResponse);\n};\n\nexport const resetMappingExtractionStatus = async (queryClient: QueryClient) => {\n await queryClient.invalidateQueries({ queryKey: [\"extractionState\"] });\n};\n\nexport const useFetchMappingExtractionStatus = ({ getAccessToken, mapping, enabled }: MappingExtractionStatusProps) => {\n const extractionClient = useExtractionClient();\n const { mappingIdJobInfo } = useExtractionStateJobContext();\n const jobId = mappingIdJobInfo.get(mapping.id);\n\n const statusQuery = useQuery<MappingQueryResult>({\n queryKey: [\"extractionState\", jobId],\n queryFn: async () => {\n if (jobId) {\n return fetchMappingStatus(mapping.id, jobId, getAccessToken, extractionClient);\n }\n // This should not happen as jobId should be defined if enabled is true\n throw new Error(\"Job ID is undefined\");\n },\n enabled: enabled && Boolean(jobId), // Only enable the query if enabled is true and jobId is defined\n refetchInterval: STATUS_CHECK_INTERVAL,\n });\n\n return statusQuery;\n};\n"]}
1
+ {"version":3,"file":"useFetchMappingExtractionStatus.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useFetchMappingExtractionStatus.ts"],"names":[],"mappings":";;;AAKA,uDAAiD;AAEjD,4DAAyD;AACzD,+CAAwD;AACxD,qEAAkE;AAElE,mFAA4E;AAC5E,uFAAuF;AAYhF,MAAM,kBAAkB,GAAG,KAAK,EAAE,SAAiB,EAAE,KAAa,EAAE,cAAgC,EAAE,gBAAmC,EAAE,EAAE;IAClJ,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAE3C,MAAM,wBAAwB,GAAG,CAAC,wBAA0C,EAAE,EAAE;QAC9E,QAAQ,wBAAwB,CAAC,KAAK,EAAE,CAAC;YACvC,KAAK,SAAS;gBACZ,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,QAAQ,EAAE,CAAC;YAC7E,KAAK,iCAAe,CAAC,OAAO;gBAC1B,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,OAAO,EAAE,CAAC;YAC5E,KAAK,iCAAe,CAAC,MAAM;gBACzB,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,MAAM,EAAE,CAAC;YAC3E,KAAK,iCAAe,CAAC,MAAM;gBACzB,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,MAAM,EAAE,CAAC;YAC3E,KAAK,iCAAe,CAAC,SAAS,CAAC;YAC/B,KAAK,iCAAe,CAAC,kBAAkB;gBACrC,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,SAAS,EAAE,CAAC;YAC9E;gBACE,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mCAAgB,CAAC,IAAI,EAAE,CAAC;QAC3E,CAAC;IACH,CAAC,CAAC;IACF,MAAM,wBAAwB,GAAG,MAAM,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAChG,OAAO,wBAAwB,CAAC,wBAAwB,CAAC,CAAC;AAC5D,CAAC,CAAC;AAtBW,QAAA,kBAAkB,sBAsB7B;AAEK,MAAM,4BAA4B,GAAG,KAAK,EAAE,WAAwB,EAAE,EAAE;IAC7E,MAAM,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;AACzE,CAAC,CAAC;AAFW,QAAA,4BAA4B,gCAEvC;AAEK,MAAM,+BAA+B,GAAG,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAgC,EAAE,EAAE;IACpH,MAAM,gBAAgB,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC/C,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,wDAA4B,GAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAG,IAAA,sBAAQ,EAAqB;QAC/C,QAAQ,EAAE,CAAC,iBAAiB,EAAE,KAAK,CAAC;QACpC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,IAAA,0BAAkB,EAAC,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAC;YACjF,CAAC;YACD,uEAAuE;YACvE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,gEAAgE;QACpG,eAAe,EAAE,iCAAqB;KACvC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAnBW,QAAA,+BAA+B,mCAmB1C","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 { QueryClient } from \"@tanstack/react-query\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ExtractionStatus, IExtractionClient , Mapping } from \"@itwin/insights-client\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport { STATUS_CHECK_INTERVAL } from \"../../Constants\";\nimport { ExtractionStates } from \"../Extraction/ExtractionStatus\";\nimport type { GetAccessTokenFn, GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\n\nexport interface MappingExtractionStatusProps extends GroupingMappingApiConfig {\n mapping: Mapping;\n enabled: boolean;\n}\n\nexport interface MappingQueryResult {\n mappingId: string;\n finalExtractionStateValue: ExtractionStates;\n}\n\nexport const fetchMappingStatus = async (mappingId: string, jobId: string, getAccessToken: GetAccessTokenFn, extractionClient: IExtractionClient) => {\n const accessToken = await getAccessToken();\n\n const getFinalExtractionStatus = (extractionStatusResponse: ExtractionStatus) => {\n switch (extractionStatusResponse.state) {\n case undefined:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Starting };\n case ExtractionState.Running:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Running };\n case ExtractionState.Failed:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Failed };\n case ExtractionState.Queued:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Queued };\n case ExtractionState.Succeeded:\n case ExtractionState.PartiallySucceeded:\n return { mappingId, finalExtractionStateValue: ExtractionStates.Succeeded };\n default:\n return { mappingId, finalExtractionStateValue: ExtractionStates.None };\n }\n };\n const extractionStatusResponse = await extractionClient.getExtractionStatus(accessToken, jobId);\n return getFinalExtractionStatus(extractionStatusResponse);\n};\n\nexport const resetMappingExtractionStatus = async (queryClient: QueryClient) => {\n await queryClient.invalidateQueries({ queryKey: [\"extractionState\"] });\n};\n\nexport const useFetchMappingExtractionStatus = ({ getAccessToken, mapping, enabled }: MappingExtractionStatusProps) => {\n const extractionClient = useExtractionClient();\n const { mappingIdJobInfo } = useExtractionStateJobContext();\n const jobId = mappingIdJobInfo.get(mapping.id);\n\n const statusQuery = useQuery<MappingQueryResult>({\n queryKey: [\"extractionState\", jobId],\n queryFn: async () => {\n if (jobId) {\n return fetchMappingStatus(mapping.id, jobId, getAccessToken, extractionClient);\n }\n // This should not happen as jobId should be defined if enabled is true\n throw new Error(\"Job ID is undefined\");\n },\n enabled: enabled && Boolean(jobId), // Only enable the query if enabled is true and jobId is defined\n refetchInterval: STATUS_CHECK_INTERVAL,\n });\n\n return statusQuery;\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { IMappingsClient, Mapping } from "@itwin/insights-client";
3
2
  import type { GroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
4
3
  /**
@@ -12,6 +12,7 @@ const react_query_1 = require("@tanstack/react-query");
12
12
  const useFetchMappings_1 = require("./useFetchMappings");
13
13
  const useFetchExtractionStatus_1 = require("./useFetchExtractionStatus");
14
14
  const ExtractionStateJobContext_1 = require("../../context/ExtractionStateJobContext");
15
+ const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
15
16
  /**
16
17
  * Custom hook to handle mapping operations.
17
18
  * @internal
@@ -74,7 +75,7 @@ const useMappingsOperations = ({ iModelId, getAccessToken, mappingClient }) => {
74
75
  ? {
75
76
  extractionStatusIcon: {
76
77
  iconStatus: undefined,
77
- iconMessage: "Loading...",
78
+ iconMessage: GroupingMappingWidget_1.GroupingMappingWidget.translate("common.loading"),
78
79
  },
79
80
  extractionMessageData: [],
80
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useMappingsOperations.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useMappingsOperations.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,iCAAyD;AACzD,4DAAyD;AAGzD,mFAA4E;AAC5E,uDAAoE;AACpE,yDAAsD;AACtD,yEAAs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BAA0B;QAC1B,gBAAgB,EAAE,qBAAqB;QACvC,6BAA6B;QAC7B,eAAe;QACf,uBAAuB;QACvB,gBAAgB;QAChB,QAAQ;QACR,kBAAkB;QAClB,eAAe;QACf,kBAAkB;QAClB,eAAe;QACf,oBAAoB;KACrB,CAAC;AACJ,CAAC,CAAC;AA5FW,QAAA,qBAAqB,yBA4FhC","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 { useCallback, useEffect, useState } from \"react\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport type { IMappingsClient, Mapping } from \"@itwin/insights-client\";\nimport type { GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useFetchMappings } from \"./useFetchMappings\";\nimport { useFetchExtractionStatus } from \"./useFetchExtractionStatus\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\n\n/**\n * Props for the {@link useMappingsOperations} hook.\n * @internal\n */\nexport interface MappingsOperationsProps extends GroupingMappingApiConfig {\n mappingClient: IMappingsClient;\n}\n\n/**\n * Custom hook to handle mapping operations.\n * @internal\n */\nexport const useMappingsOperations = ({ iModelId, getAccessToken, mappingClient }: MappingsOperationsProps) => {\n const [showImportModal, setShowImportModal] = useState<boolean | undefined>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<Mapping | undefined>(undefined);\n const extractionClient = useExtractionClient();\n const [showExtractionMessageModal, setShowExtractionMessageModal] = useState<boolean>(false);\n const queryClient = useQueryClient();\n const [initialStateExtractionFlag, setInitialExtractionStateFlag] = useState<boolean>(true);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n\n const { data: mappings, isFetched: isMappingsFetched, isFetching: isLoadingMappings } = useFetchMappings(iModelId, getAccessToken, mappingClient);\n\n const {\n data: extractionStatus,\n isFetched: isExtractionStatusFetched,\n isFetching: isLoadingExtractionStatus,\n } = useFetchExtractionStatus({ iModelId, getAccessToken, extractionClient });\n\n const refreshExtractionStatus = useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey: [\"iModelExtractionStatus\"] });\n setInitialExtractionStateFlag(false);\n }, [queryClient]);\n\n useEffect(() => {\n if (initialStateExtractionFlag && isMappingsFetched && isExtractionStatusFetched && mappings && extractionStatus && !mappingIdJobInfo.size) {\n const newMappingIdJobInfo = new Map<string, string>();\n const latestExtractionResultId = extractionStatus.latestExtractionResult.value?.id;\n const state = extractionStatus.latestExtractionResult.value?.state;\n if (state === ExtractionState.Failed || state === ExtractionState.Succeeded || state === ExtractionState.PartiallySucceeded) return;\n !!latestExtractionResultId &&\n mappings.forEach((mapping) => {\n const mappingId = mapping.id;\n const latestExtractionResultId = extractionStatus.latestExtractionResult.value.id;\n newMappingIdJobInfo.set(mappingId, latestExtractionResultId);\n });\n setMappingIdJobInfo(newMappingIdJobInfo);\n setInitialExtractionStateFlag(false);\n }\n }, [extractionStatus, initialStateExtractionFlag, isExtractionStatusFetched, isMappingsFetched, mappingIdJobInfo.size, mappings, setMappingIdJobInfo]);\n\n const refreshMappings = useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey: [\"mappings\"] });\n }, [queryClient]);\n\n const { mutateAsync: toggleExtraction, isLoading: isTogglingExtraction } = useMutation({\n mutationFn: async (mapping: Mapping) => {\n const accessToken = await getAccessToken();\n const newState = !mapping.extractionEnabled;\n await mappingClient.updateMapping(accessToken, mapping.id, { extractionEnabled: newState });\n },\n onSuccess: async () => {\n await refreshMappings();\n },\n });\n\n const { mutateAsync: onDelete, isLoading: isDeletingMapping } = useMutation({\n mutationFn: async (mapping: Mapping) => {\n const accessToken = await getAccessToken();\n await mappingClient.deleteMapping(accessToken, mapping.id);\n },\n onSuccess: async () => {\n await refreshMappings();\n },\n });\n\n const isLoading = isLoadingMappings || isTogglingExtraction || isDeletingMapping;\n const extractionStatusGated =\n !extractionStatus || isLoadingExtractionStatus\n ? {\n extractionStatusIcon: {\n iconStatus: undefined,\n iconMessage: \"Loading...\",\n },\n extractionMessageData: [],\n }\n : extractionStatus;\n\n return {\n mappings,\n isLoading,\n showExtractionMessageModal,\n extractionStatus: extractionStatusGated,\n setShowExtractionMessageModal,\n refreshMappings,\n refreshExtractionStatus,\n toggleExtraction,\n onDelete,\n setShowImportModal,\n showImportModal,\n setShowDeleteModal,\n showDeleteModal,\n isTogglingExtraction,\n };\n};\n"]}
1
+ {"version":3,"file":"useMappingsOperations.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useMappingsOperations.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,iCAAyD;AACzD,4DAAyD;AAGzD,mFAA4E;AAC5E,uDAAoE;AACpE,yDAAsD;AACtD,yEAAsE;AACtE,uFAAuF;AACvF,0EAAuE;AAUvE;;;GAGG;AACI,MAAM,qBAAqB,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAA2B,EAAE,EAAE;IAC5G,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAsB,KAAK,CAAC,CAAC;IACnF,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAsB,SAAS,CAAC,CAAC;IACvF,MAAM,gBAAgB,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC/C,MAAM,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAC7F,MAAM,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC;IACrC,MAAM,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,GAAG,IAAA,gBAAQ,EAAU,IAAI,CAAC,CAAC;IAC5F,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,IAAA,wDAA4B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,EAAE,OAAgB,EAAE,EAAE;YACrC,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;YAC3C,MAAM,aAAa,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7D,CAAC;QACD,SAAS,EAAE,KAAK,IAAI,EAAE;YACpB,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,iBAAiB,IAAI,oBAAoB,IAAI,iBAAiB,CAAC;IACjF,MAAM,qBAAqB,GACzB,CAAC,gBAAgB,IAAI,yBAAyB;QAC5C,CAAC,CAAC;YACE,oBAAoB,EAAE;gBACpB,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,gBAAgB,CAAC;aAC/D;YACD,qBAAqB,EAAE,EAAE;SAC1B;QACH,CAAC,CAAC,gBAAgB,CAAC;IAEvB,OAAO;QACL,QAAQ;QACR,SAAS;QACT,0BAA0B;QAC1B,gBAAgB,EAAE,qBAAqB;QACvC,6BAA6B;QAC7B,eAAe;QACf,uBAAuB;QACvB,gBAAgB;QAChB,QAAQ;QACR,kBAAkB;QAClB,eAAe;QACf,kBAAkB;QAClB,eAAe;QACf,oBAAoB;KACrB,CAAC;AACJ,CAAC,CAAC;AA5FW,QAAA,qBAAqB,yBA4FhC","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 { useCallback, useEffect, useState } from \"react\";\nimport { ExtractionState } from \"@itwin/insights-client\";\nimport type { IMappingsClient, Mapping } from \"@itwin/insights-client\";\nimport type { GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useFetchMappings } from \"./useFetchMappings\";\nimport { useFetchExtractionStatus } from \"./useFetchExtractionStatus\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\n/**\n * Props for the {@link useMappingsOperations} hook.\n * @internal\n */\nexport interface MappingsOperationsProps extends GroupingMappingApiConfig {\n mappingClient: IMappingsClient;\n}\n\n/**\n * Custom hook to handle mapping operations.\n * @internal\n */\nexport const useMappingsOperations = ({ iModelId, getAccessToken, mappingClient }: MappingsOperationsProps) => {\n const [showImportModal, setShowImportModal] = useState<boolean | undefined>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<Mapping | undefined>(undefined);\n const extractionClient = useExtractionClient();\n const [showExtractionMessageModal, setShowExtractionMessageModal] = useState<boolean>(false);\n const queryClient = useQueryClient();\n const [initialStateExtractionFlag, setInitialExtractionStateFlag] = useState<boolean>(true);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n\n const { data: mappings, isFetched: isMappingsFetched, isFetching: isLoadingMappings } = useFetchMappings(iModelId, getAccessToken, mappingClient);\n\n const {\n data: extractionStatus,\n isFetched: isExtractionStatusFetched,\n isFetching: isLoadingExtractionStatus,\n } = useFetchExtractionStatus({ iModelId, getAccessToken, extractionClient });\n\n const refreshExtractionStatus = useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey: [\"iModelExtractionStatus\"] });\n setInitialExtractionStateFlag(false);\n }, [queryClient]);\n\n useEffect(() => {\n if (initialStateExtractionFlag && isMappingsFetched && isExtractionStatusFetched && mappings && extractionStatus && !mappingIdJobInfo.size) {\n const newMappingIdJobInfo = new Map<string, string>();\n const latestExtractionResultId = extractionStatus.latestExtractionResult.value?.id;\n const state = extractionStatus.latestExtractionResult.value?.state;\n if (state === ExtractionState.Failed || state === ExtractionState.Succeeded || state === ExtractionState.PartiallySucceeded) return;\n !!latestExtractionResultId &&\n mappings.forEach((mapping) => {\n const mappingId = mapping.id;\n const latestExtractionResultId = extractionStatus.latestExtractionResult.value.id;\n newMappingIdJobInfo.set(mappingId, latestExtractionResultId);\n });\n setMappingIdJobInfo(newMappingIdJobInfo);\n setInitialExtractionStateFlag(false);\n }\n }, [extractionStatus, initialStateExtractionFlag, isExtractionStatusFetched, isMappingsFetched, mappingIdJobInfo.size, mappings, setMappingIdJobInfo]);\n\n const refreshMappings = useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey: [\"mappings\"] });\n }, [queryClient]);\n\n const { mutateAsync: toggleExtraction, isLoading: isTogglingExtraction } = useMutation({\n mutationFn: async (mapping: Mapping) => {\n const accessToken = await getAccessToken();\n const newState = !mapping.extractionEnabled;\n await mappingClient.updateMapping(accessToken, mapping.id, { extractionEnabled: newState });\n },\n onSuccess: async () => {\n await refreshMappings();\n },\n });\n\n const { mutateAsync: onDelete, isLoading: isDeletingMapping } = useMutation({\n mutationFn: async (mapping: Mapping) => {\n const accessToken = await getAccessToken();\n await mappingClient.deleteMapping(accessToken, mapping.id);\n },\n onSuccess: async () => {\n await refreshMappings();\n },\n });\n\n const isLoading = isLoadingMappings || isTogglingExtraction || isDeletingMapping;\n const extractionStatusGated =\n !extractionStatus || isLoadingExtractionStatus\n ? {\n extractionStatusIcon: {\n iconStatus: undefined,\n iconMessage: GroupingMappingWidget.translate(\"common.loading\"),\n },\n extractionMessageData: [],\n }\n : extractionStatus;\n\n return {\n mappings,\n isLoading,\n showExtractionMessageModal,\n extractionStatus: extractionStatusGated,\n setShowExtractionMessageModal,\n refreshMappings,\n refreshExtractionStatus,\n toggleExtraction,\n onDelete,\n setShowImportModal,\n showImportModal,\n setShowDeleteModal,\n showDeleteModal,\n isTogglingExtraction,\n };\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { GroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
3
2
  import type { Mapping } from "@itwin/insights-client";
4
3
  export interface FetchExtractionStatesProps extends GroupingMappingApiConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"useRun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9B;YACD,OAAO;QACT,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,EAAE;YACnD,IAAI,qBAAqB,EAAE;gBACzB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;oBAC9B,IAAI,gBAAgB,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,SAAS,EAAE;wBACnD,mBAAmB,CAAC,CAAC,OAA4B,EAAE,EAAE;4BACnD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;4BAChC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAC;4BACjD,OAAO,MAAM,CAAC;wBAChB,CAAC,CAAC,CAAC;qBACJ;iBACF;aACF;QACH,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAC1G,CAAC,CAAC;AA7CW,QAAA,gBAAgB,oBA6C3B","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 { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { ExtractionMapping, ExtractionRequestDetails, Mapping } from \"@itwin/insights-client\";\nimport { useState } from \"react\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\n\nexport interface FetchExtractionStatesProps extends GroupingMappingApiConfig {\n jobId?: string;\n}\n\nexport const useRunExtraction = ({ iModelId, getAccessToken }: FetchExtractionStatesProps) => {\n const extractionClient = useExtractionClient();\n const [isJobStarted, setIsJobStarted] = useState<boolean>(false);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n const { changeSetId } = useGroupingMappingApiConfig();\n\n const {\n mutateAsync: runExtraction,\n isLoading: isRunExtractionLoading,\n isSuccess: isRunExtractionSuccess,\n } = useMutation({\n mutationKey: [\"runExtraction\"],\n mutationFn: async (mappings: Mapping[]) => {\n if (mappings.length > 0) {\n const accessToken = await getAccessToken();\n const mappingIds: ExtractionMapping[] = mappings.map((mapping) => {\n return { id: mapping.id };\n });\n const extractionRequest: ExtractionRequestDetails = {\n mappings: mappingIds,\n iModelId,\n changesetId: changeSetId,\n };\n\n const runExtractionResponse = await extractionClient.runExtraction(accessToken, extractionRequest);\n return runExtractionResponse;\n }\n return;\n },\n onSuccess: async (runExtractionResponse, mappings) => {\n if (runExtractionResponse) {\n for (const mapping of mappings) {\n if (mappingIdJobInfo?.get(mapping.id) === undefined) {\n setMappingIdJobInfo((prevMap: Map<string, string>) => {\n const newMap = new Map(prevMap);\n newMap.set(mapping.id, runExtractionResponse.id);\n return newMap;\n });\n }\n }\n }\n },\n });\n\n return { isRunExtractionLoading, isRunExtractionSuccess, isJobStarted, setIsJobStarted, runExtraction };\n};\n"]}
1
+ {"version":3,"file":"useRunExtraction.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/hooks/useRunExtraction.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,mFAA4E;AAC5E,uDAAoD;AAEpD,qFAAqF;AAErF,iCAAiC;AACjC,uFAAuF;AAMhF,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAA8B,EAAE,EAAE;IAC3F,MAAM,gBAAgB,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC/C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACjE,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,IAAA,wDAA4B,GAAE,CAA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AAC;4BACjD,OAAO,MAAM,CAAC;wBAChB,CAAC,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAC1G,CAAC,CAAC;AA7CW,QAAA,gBAAgB,oBA6C3B","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 { useExtractionClient } from \"../../context/ExtractionClientContext\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { GroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { ExtractionMapping, ExtractionRequestDetails, Mapping } from \"@itwin/insights-client\";\nimport { useState } from \"react\";\nimport { useExtractionStateJobContext } from \"../../context/ExtractionStateJobContext\";\n\nexport interface FetchExtractionStatesProps extends GroupingMappingApiConfig {\n jobId?: string;\n}\n\nexport const useRunExtraction = ({ iModelId, getAccessToken }: FetchExtractionStatesProps) => {\n const extractionClient = useExtractionClient();\n const [isJobStarted, setIsJobStarted] = useState<boolean>(false);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n const { changeSetId } = useGroupingMappingApiConfig();\n\n const {\n mutateAsync: runExtraction,\n isLoading: isRunExtractionLoading,\n isSuccess: isRunExtractionSuccess,\n } = useMutation({\n mutationKey: [\"runExtraction\"],\n mutationFn: async (mappings: Mapping[]) => {\n if (mappings.length > 0) {\n const accessToken = await getAccessToken();\n const mappingIds: ExtractionMapping[] = mappings.map((mapping) => {\n return { id: mapping.id };\n });\n const extractionRequest: ExtractionRequestDetails = {\n mappings: mappingIds,\n iModelId,\n changesetId: changeSetId,\n };\n\n const runExtractionResponse = await extractionClient.runExtraction(accessToken, extractionRequest);\n return runExtractionResponse;\n }\n return;\n },\n onSuccess: async (runExtractionResponse, mappings) => {\n if (runExtractionResponse) {\n for (const mapping of mappings) {\n if (mappingIdJobInfo?.get(mapping.id) === undefined) {\n setMappingIdJobInfo((prevMap: Map<string, string>) => {\n const newMap = new Map(prevMap);\n newMap.set(mapping.id, runExtractionResponse.id);\n return newMap;\n });\n }\n }\n }\n },\n });\n\n return { isRunExtractionLoading, isRunExtractionSuccess, isJobStarted, setIsJobStarted, runExtraction };\n};\n"]}
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import "./CalculatedPropertyAction.scss";
3
2
  import type { Group, Property } from "@itwin/insights-client";
4
3
  /**
5
- * @deprecated in 0.27.0 The CalculatedPropertyActionProps has been superseded by the CalculatedPropertyActionWithVisualsProps and should not be used, use GroupPropertyActionProps and GroupPropertyAction component instead.
4
+ * @deprecated in 0.27.0. The CalculatedPropertyActionProps has been superseded by the CalculatedPropertyActionWithVisualsProps and should not be used, use GroupPropertyActionProps and GroupPropertyAction component instead.
6
5
  * Props for the {@link CalculatedPropertyAction} component.
7
6
  * @public
8
7
  */
@@ -14,7 +13,7 @@ export interface CalculatedPropertyActionProps {
14
13
  onClickCancel?: () => void;
15
14
  }
16
15
  /**
17
- * @deprecated in 0.27.0 The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.
16
+ * @deprecated in 0.27.0. The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.
18
17
  * Component to create or update a calculated property.
19
18
  * @public
20
19
  */
@@ -41,8 +41,9 @@ const SharedCalculatedPropertyForms_1 = require("./SharedCalculatedPropertyForms
41
41
  const GroupingApiConfigContext_1 = require("../../context/GroupingApiConfigContext");
42
42
  const react_query_1 = require("@tanstack/react-query");
43
43
  const PropertiesClientContext_1 = require("../../context/PropertiesClientContext");
44
+ const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
44
45
  /**
45
- * @deprecated in 0.27.0 The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.
46
+ * @deprecated in 0.27.0. The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.
46
47
  * Component to create or update a calculated property.
47
48
  * @public
48
49
  */
@@ -84,9 +85,9 @@ const CalculatedPropertyAction = ({ mappingId, group, calculatedProperty, onSave
84
85
  };
85
86
  return (react_1.default.createElement(react_1.default.Fragment, null,
86
87
  react_1.default.createElement("div", { className: "gmw-calculated-properties-action-container" },
87
- react_1.default.createElement(itwinui_react_1.Fieldset, { legend: "Calculated Property Details", className: "gmw-details-form" },
88
+ react_1.default.createElement(itwinui_react_1.Fieldset, { legend: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.calculatedPropertyDetails"), className: "gmw-details-form" },
88
89
  react_1.default.createElement("div", { className: "gmw-field-legend-container" },
89
- react_1.default.createElement(itwinui_react_1.Text, { variant: "small", as: "small", className: "gmw-field-legend" }, "Asterisk * indicates mandatory fields.")),
90
+ react_1.default.createElement(itwinui_react_1.Text, { variant: "small", as: "small", className: "gmw-field-legend" }, GroupingMappingWidget_1.GroupingMappingWidget.translate("common.mandatoryFields"))),
90
91
  react_1.default.createElement(SharedCalculatedPropertyForms_1.SharedCalculatedPropertyForms, { calculatedPropertyType: type, setCalculatedPropertyType: setType }))),
91
92
  react_1.default.createElement(ActionPanel_1.default, { onSave: onSave, onCancel: onClickCancel, isSavingDisabled: !(type && propertyName), isLoading: isLoading })));
92
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CalculatedPropertyAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAsD;AACtD,+CAAwC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ourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { Fieldset, Text } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator from \"../hooks/useValidator\";\nimport \"./CalculatedPropertyAction.scss\";\nimport type { CalculatedPropertyType, Group, Property } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport { SharedCalculatedPropertyForms } from \"./SharedCalculatedPropertyForms\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { usePropertiesClient } from \"../../context/PropertiesClientContext\";\n\n/**\n * @deprecated in 0.27.0 The CalculatedPropertyActionProps has been superseded by the CalculatedPropertyActionWithVisualsProps and should not be used, use GroupPropertyActionProps and GroupPropertyAction component instead.\n * Props for the {@link CalculatedPropertyAction} component.\n * @public\n */\nexport interface CalculatedPropertyActionProps {\n mappingId: string;\n group: Group;\n calculatedProperty?: Property;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\n/**\n * @deprecated in 0.27.0 The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.\n * Component to create or update a calculated property.\n * @public\n */\nexport const CalculatedPropertyAction = ({ mappingId, group, calculatedProperty, onSaveSuccess, onClickCancel }: CalculatedPropertyActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const propertiesClient = usePropertiesClient();\n const [propertyName, setPropertyName] = useState<string>(calculatedProperty?.propertyName ?? \"\");\n const [type, setType] = useState<CalculatedPropertyType | undefined>(calculatedProperty?.calculatedPropertyType ?? undefined);\n const [validator, showValidationMessage] = useValidator();\n const queryClient = useQueryClient();\n\n const { mutate: saveMutation, isLoading } = useMutation(\n async (type: CalculatedPropertyType) => {\n const accessToken = await getAccessToken();\n\n return calculatedProperty\n ? propertiesClient.updateProperty(accessToken, mappingId, group.id, calculatedProperty.id, {\n ...calculatedProperty,\n propertyName,\n dataType: calculatedProperty.dataType,\n calculatedPropertyType: type,\n })\n : propertiesClient.createProperty(accessToken, mappingId, group.id, {\n propertyName,\n dataType: DataType.Double,\n calculatedPropertyType: type,\n });\n },\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"properties\", iModelId, mappingId, group.id] });\n onSaveSuccess();\n setPropertyName(\"\");\n setType(undefined);\n },\n },\n );\n\n const onSave = () => {\n if (!validator.allValid() || !type) {\n showValidationMessage(true);\n return;\n }\n\n saveMutation(type);\n };\n\n return (\n <>\n <div className=\"gmw-calculated-properties-action-container\">\n <Fieldset legend=\"Calculated Property Details\" className=\"gmw-details-form\">\n <div className=\"gmw-field-legend-container\">\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n Asterisk * indicates mandatory fields.\n </Text>\n </div>\n <SharedCalculatedPropertyForms calculatedPropertyType={type} setCalculatedPropertyType={setType} />\n </Fieldset>\n </div>\n <ActionPanel onSave={onSave} onCancel={onClickCancel} isSavingDisabled={!(type && propertyName)} isLoading={isLoading} />\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"CalculatedPropertyAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAsD;AACtD,+CAAwC;AACxC,qFAA6D;AAC7D,yEAAiD;AACjD,2CAAyC;AAEzC,4DAAkD;AAClD,mFAAgF;AAChF,qFAAqF;AACrF,uDAAoE;AACpE,mFAA4E;AAC5E,0EAAuE;AAevE;;;;GAIG;AACI,MAAM,wBAAwB,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAi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Y,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACjG,aAAa,EAAE,CAAC;YAChB,eAAe,CAAC,EAAE,CAAC,CAAC;YACpB,OAAO,CAAC,SAAS,CAAC,CAAC;QACrB,CAAC;KACF,CACF,CAAC;IAEF,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;YACnC,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,YAAY,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,CACL;QACE,uCAAK,SAAS,EAAC,4CAA4C;YACzD,8BAAC,wBAAQ,IAAC,MAAM,EAAE,6CAAqB,CAAC,SAAS,CAAC,sCAAsC,CAAC,EAAE,SAAS,EAAC,kBAAkB;gBACrH,uCAAK,SAAS,EAAC,4BAA4B;oBACzC,8BAAC,oBAAI,IAAC,OAAO,EAAC,OAAO,EAAC,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,kBAAkB,IAC1D,6CAAqB,CAAC,SAAS,CAAC,wBAAwB,CAAC,CACrD,CACH;gBACN,8BAAC,6DAA6B,IAAC,sBAAsB,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,GAAI,CAC1F,CACP;QACN,8BAAC,qBAAW,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,CAAC,IAAI,IAAI,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI,CACxH,CACJ,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,wBAAwB,4BA2DnC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { Fieldset, Text } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator from \"../hooks/useValidator\";\nimport \"./CalculatedPropertyAction.scss\";\nimport type { CalculatedPropertyType, Group, Property } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport { SharedCalculatedPropertyForms } from \"./SharedCalculatedPropertyForms\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { usePropertiesClient } from \"../../context/PropertiesClientContext\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\n/**\n * @deprecated in 0.27.0. The CalculatedPropertyActionProps has been superseded by the CalculatedPropertyActionWithVisualsProps and should not be used, use GroupPropertyActionProps and GroupPropertyAction component instead.\n * Props for the {@link CalculatedPropertyAction} component.\n * @public\n */\nexport interface CalculatedPropertyActionProps {\n mappingId: string;\n group: Group;\n calculatedProperty?: Property;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n}\n\n/**\n * @deprecated in 0.27.0. The CalculatedPropertyAction has been superseded by the CalculatedPropertyActionWithVisuals and should not be used as a stand alone component, use GroupPropertyAction component instead.\n * Component to create or update a calculated property.\n * @public\n */\nexport const CalculatedPropertyAction = ({ mappingId, group, calculatedProperty, onSaveSuccess, onClickCancel }: CalculatedPropertyActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const propertiesClient = usePropertiesClient();\n const [propertyName, setPropertyName] = useState<string>(calculatedProperty?.propertyName ?? \"\");\n const [type, setType] = useState<CalculatedPropertyType | undefined>(calculatedProperty?.calculatedPropertyType ?? undefined);\n const [validator, showValidationMessage] = useValidator();\n const queryClient = useQueryClient();\n\n const { mutate: saveMutation, isLoading } = useMutation(\n async (type: CalculatedPropertyType) => {\n const accessToken = await getAccessToken();\n\n return calculatedProperty\n ? propertiesClient.updateProperty(accessToken, mappingId, group.id, calculatedProperty.id, {\n ...calculatedProperty,\n propertyName,\n dataType: calculatedProperty.dataType,\n calculatedPropertyType: type,\n })\n : propertiesClient.createProperty(accessToken, mappingId, group.id, {\n propertyName,\n dataType: DataType.Double,\n calculatedPropertyType: type,\n });\n },\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"properties\", iModelId, mappingId, group.id] });\n onSaveSuccess();\n setPropertyName(\"\");\n setType(undefined);\n },\n },\n );\n\n const onSave = () => {\n if (!validator.allValid() || !type) {\n showValidationMessage(true);\n return;\n }\n\n saveMutation(type);\n };\n\n return (\n <>\n <div className=\"gmw-calculated-properties-action-container\">\n <Fieldset legend={GroupingMappingWidget.translate(\"properties.calculatedPropertyDetails\")} className=\"gmw-details-form\">\n <div className=\"gmw-field-legend-container\">\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n {GroupingMappingWidget.translate(\"common.mandatoryFields\")}\n </Text>\n </div>\n <SharedCalculatedPropertyForms calculatedPropertyType={type} setCalculatedPropertyType={setType} />\n </Fieldset>\n </div>\n <ActionPanel onSave={onSave} onCancel={onClickCancel} isSavingDisabled={!(type && propertyName)} isLoading={isLoading} />\n </>\n );\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./CalculatedPropertyActionWithVisuals.scss";
3
2
  import type { CalculatedPropertyType, GroupMinimal } from "@itwin/insights-client";
4
3
  /**
@@ -37,6 +37,8 @@ require("./CalculatedPropertyActionWithVisuals.scss");
37
37
  const GroupingApiConfigContext_1 = require("../../context/GroupingApiConfigContext");
38
38
  const SharedCalculatedPropertyForms_1 = require("./SharedCalculatedPropertyForms");
39
39
  const useKeySetHiliteQueries_1 = require("../../Groups/hooks/useKeySetHiliteQueries");
40
+ const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
41
+ const MAX_CONTEXT_CANDIDATES = 25;
40
42
  /**
41
43
  * Component to create or update a calculated property with visualizations.
42
44
  * @internal
@@ -71,16 +73,28 @@ const CalculatedPropertyActionWithVisuals = ({ group, calculatedPropertyType, is
71
73
  void (0, viewerUtils_1.zoomToElements)([resolvedHiliteIds[0]]);
72
74
  }, [colorProperty, resolvedHiliteIds]);
73
75
  (0, react_1.useEffect)(() => {
74
- if (!colorProperty || resolvedHiliteIds.length === 0) {
76
+ if (!colorProperty || resolvedHiliteIds.length === 0 || !bboxDecorator) {
77
+ setInferredSpatialData(undefined);
75
78
  return;
76
79
  }
80
+ let disposed = false;
77
81
  const setContext = async () => {
78
- if (bboxDecorator) {
79
- await bboxDecorator.setContext(resolvedHiliteIds[0]);
80
- setInferredSpatialData(bboxDecorator.getInferredSpatialData());
82
+ const candidateIds = resolvedHiliteIds.slice(0, MAX_CONTEXT_CANDIDATES);
83
+ let contextSet = false;
84
+ for (const instanceId of candidateIds) {
85
+ contextSet = await bboxDecorator.setContext(instanceId);
86
+ if (contextSet) {
87
+ break;
88
+ }
89
+ }
90
+ if (!disposed) {
91
+ setInferredSpatialData(contextSet ? bboxDecorator.getInferredSpatialData() : undefined);
81
92
  }
82
93
  };
83
94
  void setContext();
95
+ return () => {
96
+ disposed = true;
97
+ };
84
98
  }, [bboxDecorator, colorProperty, resolvedHiliteIds]);
85
99
  (0, react_1.useEffect)(() => {
86
100
  if (bboxDecorator && calculatedPropertyType && inferredSpatialData) {
@@ -96,7 +110,7 @@ const CalculatedPropertyActionWithVisuals = ({ group, calculatedPropertyType, is
96
110
  inferredSpatialData?.has(BboxDimensionsDecorator_1.BboxDimension[value]) && (react_1.default.createElement("div", null, `${inferredSpatialData?.get(BboxDimensionsDecorator_1.BboxDimension[value])?.toPrecision(4)}m`));
97
111
  return (react_1.default.createElement("div", { className: "gmw-calculated-properties-action-container" },
98
112
  react_1.default.createElement(itwinui_react_1.InputGroup, { className: "gmw-details-form" },
99
- react_1.default.createElement(itwinui_react_1.ToggleSwitch, { className: "gmw-field-legend-container", label: "Visualize Dimensions", labelPosition: "left", disabled: isLoading, checked: colorProperty, onChange: () => setColorProperty((b) => !b) }),
113
+ react_1.default.createElement(itwinui_react_1.ToggleSwitch, { className: "gmw-field-legend-container", label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.visualizeDimensions"), labelPosition: "left", disabled: isLoading, checked: colorProperty, onChange: () => setColorProperty((b) => !b) }),
100
114
  react_1.default.createElement(SharedCalculatedPropertyForms_1.SharedCalculatedPropertyForms, { calculatedPropertyType: calculatedPropertyType, setCalculatedPropertyType: setCalculatedPropertyType, itemRenderer: (option) => (react_1.default.createElement(itwinui_react_1.MenuItem, null,
101
115
  react_1.default.createElement("div", { className: "gmw-gr-cp-menu-item" },
102
116
  react_1.default.createElement("div", null, option.label),
@@ -1 +1 @@
1
- {"version":3,"file":"CalculatedPropertyActionWithVisuals.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAiD;AAEjD,wDAA0E;AAC1E,+CAA4D;AAC5D,yFAAqG;AACrG,6DAA0F;AAC1F,sDAAoD;AACpD,qFAAqF;AAErF,mFAAgF;AAChF,sFAAgF;AAahF;;;GAGG;AACI,MAAM,mCAAmC,GAAG,CAAC,EAClD,KAAK,EACL,sBAAsB,EACtB,SAAS,EACT,yBAAyB,GACgB,EAAE,EAAE;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IAC3D,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KACxE;IACD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,GAAuC,CAAC;IAC1F,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,GAA0C,CAAC;IACzG,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;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AC,CAAC,CAAC,CAAC,GAC7B;YAChB,8BAAC,6DAA6B,IAC5B,sBAAsB,EAAE,sBAAsB,EAC9C,yBAAyB,EAAE,yBAAyB,EACpD,YAAY,EAAE,CAAC,MAAwC,EAAE,EAAE,CAAC,CAC1D,8BAAC,wBAAQ;oBACP,uCAAK,SAAS,EAAC,qBAAqB;wBAClC,2CAAM,MAAM,CAAC,KAAK,CAAO;wBACxB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CACzB,CACG,CACZ,EACD,oBAAoB,EAAE,CAAC,MAAwC,EAAE,EAAE,CAAC,CAClE,uCAAK,SAAS,EAAC,iBAAiB;oBAC9B,2CAAM,MAAM,CAAC,KAAK,CAAO;oBACxB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CACzB,CACP,GACD,CACS,CACT,CACP,CAAC;AACJ,CAAC,CAAC;AAnGW,QAAA,mCAAmC,uCAmG9C","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 { IModelApp } from \"@itwin/core-frontend\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { InputGroup, MenuItem, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { BboxDimension, BboxDimensionsDecorator } from \"../../../decorators/BboxDimensionsDecorator\";\nimport { clearAll, visualizeElements, zoomToElements } from \"../../../common/viewerUtils\";\nimport \"./CalculatedPropertyActionWithVisuals.scss\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { CalculatedPropertyType, GroupMinimal } from \"@itwin/insights-client\";\nimport { SharedCalculatedPropertyForms } from \"./SharedCalculatedPropertyForms\";\nimport { useGroupKeySetQuery } from \"../../Groups/hooks/useKeySetHiliteQueries\";\n\n/**\n * Props for the {@link CalculatedPropertyActionWithVisuals} component.\n * @internal\n */\nexport interface CalculatedPropertyActionWithVisualsProps {\n group: GroupMinimal;\n calculatedPropertyType?: CalculatedPropertyType;\n isLoading?: boolean;\n setCalculatedPropertyType: (calculatedPropertyType: CalculatedPropertyType | undefined) => void;\n}\n\n/**\n * Component to create or update a calculated property with visualizations.\n * @internal\n */\nexport const CalculatedPropertyActionWithVisuals = ({\n group,\n calculatedPropertyType,\n isLoading,\n setCalculatedPropertyType,\n}: CalculatedPropertyActionWithVisualsProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [bboxDecorator, setBboxDecorator] = useState<BboxDimensionsDecorator | undefined>();\n const [inferredSpatialData, setInferredSpatialData] = useState<Map<BboxDimension, number> | undefined>();\n const [colorProperty, setColorProperty] = useState<boolean>(false);\n const { data } = useGroupKeySetQuery(group, iModelConnection, true);\n\n const resolvedHiliteIds = useMemo(() => {\n // Resolved ids, default to an empty array if not available\n return data?.result?.ids ?? [];\n }, [data?.result?.ids]);\n\n useEffect(() => {\n const decorator = new BboxDimensionsDecorator();\n IModelApp.viewManager.addDecorator(decorator);\n setBboxDecorator(decorator);\n return () => {\n IModelApp.viewManager.dropDecorator(decorator);\n };\n }, []);\n\n useEffect(() => {\n if (!colorProperty || resolvedHiliteIds.length === 0) {\n clearAll();\n return;\n }\n visualizeElements(resolvedHiliteIds, \"red\");\n void zoomToElements([resolvedHiliteIds[0]]);\n }, [colorProperty, resolvedHiliteIds]);\n\n useEffect(() => {\n if (!colorProperty || resolvedHiliteIds.length === 0) {\n return;\n }\n const setContext = async () => {\n if (bboxDecorator) {\n await bboxDecorator.setContext(resolvedHiliteIds[0]);\n setInferredSpatialData(bboxDecorator.getInferredSpatialData());\n }\n };\n void setContext();\n }, [bboxDecorator, colorProperty, resolvedHiliteIds]);\n\n useEffect(() => {\n if (bboxDecorator && calculatedPropertyType && inferredSpatialData) {\n inferredSpatialData.has(BboxDimension[calculatedPropertyType as keyof typeof BboxDimension]) && colorProperty\n ? bboxDecorator.drawContext(BboxDimension[calculatedPropertyType as keyof typeof BboxDimension])\n : bboxDecorator.clearContext();\n } else {\n bboxDecorator?.clearContext();\n }\n }, [bboxDecorator, colorProperty, inferredSpatialData, calculatedPropertyType]);\n\n const getSpatialData = (value: string | undefined) =>\n value &&\n inferredSpatialData?.has(BboxDimension[value as keyof typeof BboxDimension]) && (\n <div>{`${inferredSpatialData?.get(BboxDimension[value as keyof typeof BboxDimension])?.toPrecision(4)}m`}</div>\n );\n\n return (\n <div className=\"gmw-calculated-properties-action-container\">\n <InputGroup className=\"gmw-details-form\">\n <ToggleSwitch\n className=\"gmw-field-legend-container\"\n label=\"Visualize Dimensions\"\n labelPosition=\"left\"\n disabled={isLoading}\n checked={colorProperty}\n onChange={() => setColorProperty((b) => !b)}\n ></ToggleSwitch>\n <SharedCalculatedPropertyForms\n calculatedPropertyType={calculatedPropertyType}\n setCalculatedPropertyType={setCalculatedPropertyType}\n itemRenderer={(option: SelectOption<string | undefined>) => (\n <MenuItem>\n <div className=\"gmw-gr-cp-menu-item\">\n <div>{option.label}</div>\n {getSpatialData(option.value)}\n </div>\n </MenuItem>\n )}\n selectedItemRenderer={(option: SelectOption<string | undefined>) => (\n <div className=\"gmw-select-item\">\n <div>{option.label}</div>\n {getSpatialData(option.value)}\n </div>\n )}\n />\n </InputGroup>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"CalculatedPropertyActionWithVisuals.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAiD;AAEjD,wDAA0E;AAC1E,+CAA4D;AAC5D,yFAAqG;AACrG,6DAA0F;AAC1F,sDAAoD;AACpD,qFAAqF;AAErF,mFAAgF;AAChF,sFAAgF;AAChF,0EAAuE;AAEvE,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAalC;;;G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BAAQ;oBACP,uCAAK,SAAS,EAAC,qBAAqB;wBAClC,2CAAM,MAAM,CAAC,KAAK,CAAO;wBACxB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CACzB,CACG,CACZ,EACD,oBAAoB,EAAE,CAAC,MAAwC,EAAE,EAAE,CAAC,CAClE,uCAAK,SAAS,EAAC,iBAAiB;oBAC9B,2CAAM,MAAM,CAAC,KAAK,CAAO;oBACxB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CACzB,CACP,GACD,CACS,CACT,CACP,CAAC;AACJ,CAAC,CAAC;AA/GW,QAAA,mCAAmC,uCA+G9C","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 { IModelApp } from \"@itwin/core-frontend\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { InputGroup, MenuItem, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { BboxDimension, BboxDimensionsDecorator } from \"../../../decorators/BboxDimensionsDecorator\";\nimport { clearAll, visualizeElements, zoomToElements } from \"../../../common/viewerUtils\";\nimport \"./CalculatedPropertyActionWithVisuals.scss\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { CalculatedPropertyType, GroupMinimal } from \"@itwin/insights-client\";\nimport { SharedCalculatedPropertyForms } from \"./SharedCalculatedPropertyForms\";\nimport { useGroupKeySetQuery } from \"../../Groups/hooks/useKeySetHiliteQueries\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\nconst MAX_CONTEXT_CANDIDATES = 25;\n\n/**\n * Props for the {@link CalculatedPropertyActionWithVisuals} component.\n * @internal\n */\nexport interface CalculatedPropertyActionWithVisualsProps {\n group: GroupMinimal;\n calculatedPropertyType?: CalculatedPropertyType;\n isLoading?: boolean;\n setCalculatedPropertyType: (calculatedPropertyType: CalculatedPropertyType | undefined) => void;\n}\n\n/**\n * Component to create or update a calculated property with visualizations.\n * @internal\n */\nexport const CalculatedPropertyActionWithVisuals = ({\n group,\n calculatedPropertyType,\n isLoading,\n setCalculatedPropertyType,\n}: CalculatedPropertyActionWithVisualsProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [bboxDecorator, setBboxDecorator] = useState<BboxDimensionsDecorator | undefined>();\n const [inferredSpatialData, setInferredSpatialData] = useState<Map<BboxDimension, number> | undefined>();\n const [colorProperty, setColorProperty] = useState<boolean>(false);\n const { data } = useGroupKeySetQuery(group, iModelConnection, true);\n\n const resolvedHiliteIds = useMemo(() => {\n // Resolved ids, default to an empty array if not available\n return data?.result?.ids ?? [];\n }, [data?.result?.ids]);\n\n useEffect(() => {\n const decorator = new BboxDimensionsDecorator();\n IModelApp.viewManager.addDecorator(decorator);\n setBboxDecorator(decorator);\n return () => {\n IModelApp.viewManager.dropDecorator(decorator);\n };\n }, []);\n\n useEffect(() => {\n if (!colorProperty || resolvedHiliteIds.length === 0) {\n clearAll();\n return;\n }\n visualizeElements(resolvedHiliteIds, \"red\");\n void zoomToElements([resolvedHiliteIds[0]]);\n }, [colorProperty, resolvedHiliteIds]);\n\n useEffect(() => {\n if (!colorProperty || resolvedHiliteIds.length === 0 || !bboxDecorator) {\n setInferredSpatialData(undefined);\n return;\n }\n let disposed = false;\n const setContext = async () => {\n const candidateIds = resolvedHiliteIds.slice(0, MAX_CONTEXT_CANDIDATES);\n let contextSet = false;\n for (const instanceId of candidateIds) {\n contextSet = await bboxDecorator.setContext(instanceId);\n if (contextSet) {\n break;\n }\n }\n if (!disposed) {\n setInferredSpatialData(contextSet ? bboxDecorator.getInferredSpatialData() : undefined);\n }\n };\n void setContext();\n return () => {\n disposed = true;\n };\n }, [bboxDecorator, colorProperty, resolvedHiliteIds]);\n\n useEffect(() => {\n if (bboxDecorator && calculatedPropertyType && inferredSpatialData) {\n inferredSpatialData.has(BboxDimension[calculatedPropertyType as keyof typeof BboxDimension]) && colorProperty\n ? bboxDecorator.drawContext(BboxDimension[calculatedPropertyType as keyof typeof BboxDimension])\n : bboxDecorator.clearContext();\n } else {\n bboxDecorator?.clearContext();\n }\n }, [bboxDecorator, colorProperty, inferredSpatialData, calculatedPropertyType]);\n\n const getSpatialData = (value: string | undefined) =>\n value &&\n inferredSpatialData?.has(BboxDimension[value as keyof typeof BboxDimension]) && (\n <div>{`${inferredSpatialData?.get(BboxDimension[value as keyof typeof BboxDimension])?.toPrecision(4)}m`}</div>\n );\n\n return (\n <div className=\"gmw-calculated-properties-action-container\">\n <InputGroup className=\"gmw-details-form\">\n <ToggleSwitch\n className=\"gmw-field-legend-container\"\n label={GroupingMappingWidget.translate(\"properties.visualizeDimensions\")}\n labelPosition=\"left\"\n disabled={isLoading}\n checked={colorProperty}\n onChange={() => setColorProperty((b) => !b)}\n ></ToggleSwitch>\n <SharedCalculatedPropertyForms\n calculatedPropertyType={calculatedPropertyType}\n setCalculatedPropertyType={setCalculatedPropertyType}\n itemRenderer={(option: SelectOption<string | undefined>) => (\n <MenuItem>\n <div className=\"gmw-gr-cp-menu-item\">\n <div>{option.label}</div>\n {getSpatialData(option.value)}\n </div>\n </MenuItem>\n )}\n selectedItemRenderer={(option: SelectOption<string | undefined>) => (\n <div className=\"gmw-select-item\">\n <div>{option.label}</div>\n {getSpatialData(option.value)}\n </div>\n )}\n />\n </InputGroup>\n </div>\n );\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalculatedPropertyType } from "@itwin/insights-client";
3
2
  import type { SelectOption } from "@itwin/itwinui-react";
4
3
  interface SharedCalculatedPropertyFormsProps {
@@ -31,11 +31,12 @@ exports.SharedCalculatedPropertyForms = void 0;
31
31
  const insights_client_1 = require("@itwin/insights-client");
32
32
  const react_1 = __importStar(require("react"));
33
33
  const itwinui_react_1 = require("@itwin/itwinui-react");
34
+ const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
34
35
  const SharedCalculatedPropertyForms = ({ calculatedPropertyType, setCalculatedPropertyType, itemRenderer, selectedItemRenderer, }) => {
35
36
  const generateOptionsFromCalculatedPropertyType = (0, react_1.useCallback)(() => {
36
37
  const options = [];
37
38
  const indexableEnum = insights_client_1.CalculatedPropertyType;
38
- options.push({ value: undefined, label: "No Calculated Property Type" });
39
+ options.push({ value: undefined, label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.noCalculatedPropertyType") });
39
40
  for (const key in indexableEnum) {
40
41
  if (typeof indexableEnum[key] === "string" && key !== "Undefined") {
41
42
  // Generate labels by adding space between capitals
@@ -49,7 +50,7 @@ const SharedCalculatedPropertyForms = ({ calculatedPropertyType, setCalculatedPr
49
50
  return options;
50
51
  }, []);
51
52
  return (react_1.default.createElement(react_1.default.Fragment, null,
52
- react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: "Calculated Property Type", options: generateOptionsFromCalculatedPropertyType(), value: calculatedPropertyType, onChange: setCalculatedPropertyType, itemRenderer: itemRenderer, selectedItemRenderer: selectedItemRenderer, placeholder: 'No Calculated Property Type', onShow: () => { }, onHide: () => { } })));
53
+ react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.calculatedPropertyType"), options: generateOptionsFromCalculatedPropertyType(), value: calculatedPropertyType, onChange: setCalculatedPropertyType, itemRenderer: itemRenderer, selectedItemRenderer: selectedItemRenderer, placeholder: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.noCalculatedPropertyType"), onShow: () => { }, onHide: () => { } })));
53
54
  };
54
55
  exports.SharedCalculatedPropertyForms = SharedCalculatedPropertyForms;
55
56
  //# sourceMappingURL=SharedCalculatedPropertyForms.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/SharedCalculatedProp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AAG,CAAC,EACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,GACjB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,6BAA6B,iCAuCxC","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 { CalculatedPropertyType } from \"@itwin/insights-client\";\nimport React, { useCallback } from \"react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledSelect } from \"@itwin/itwinui-react\";\n\ninterface SharedCalculatedPropertyFormsProps {\n calculatedPropertyType: CalculatedPropertyType | undefined;\n setCalculatedPropertyType: (value: CalculatedPropertyType | undefined) => void;\n itemRenderer?: (option: SelectOption<string | undefined>) => JSX.Element;\n selectedItemRenderer?: (option: SelectOption<string | undefined>) => JSX.Element;\n}\n\nexport const SharedCalculatedPropertyForms = ({\n calculatedPropertyType,\n setCalculatedPropertyType,\n itemRenderer,\n selectedItemRenderer,\n}: SharedCalculatedPropertyFormsProps) => {\n const generateOptionsFromCalculatedPropertyType = useCallback(() => {\n const options: SelectOption<CalculatedPropertyType | undefined>[] = [];\n const indexableEnum = CalculatedPropertyType as unknown as { [key: string]: string };\n \n options.push({value: undefined, label: \"No Calculated Property Type\"});\n for (const key in indexableEnum) {\n if (typeof indexableEnum[key] === \"string\" && key !== \"Undefined\") {\n // Generate labels by adding space between capitals\n const label = key\n .replace(/([A-Z])/g, \" $1\")\n .trim()\n .replace(/^\\w/, (c) => c.toUpperCase());\n options.push({ value: indexableEnum[key] as CalculatedPropertyType, label });\n }\n }\n return options;\n }, []);\n\n return (\n <>\n <LabeledSelect<CalculatedPropertyType | undefined>\n label=\"Calculated Property Type\"\n options={generateOptionsFromCalculatedPropertyType()}\n value={calculatedPropertyType}\n onChange={setCalculatedPropertyType}\n itemRenderer={itemRenderer}\n selectedItemRenderer={selectedItemRenderer}\n placeholder = 'No Calculated Property Type'\n onShow={() => { }}\n onHide={() => { }}\n />\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CalculatedProperties/SharedCalculatedPropertyForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,4DAAgE;AAChE,+CAA2C;AAE3C,wDAAqD;AACrD,0EAAuE;AAShE,MAAM,6BAA6B,GAAG,CAAC,EAC5C,sBAAsB,EACtB,yBAAyB,EACzB,YAAY,EACZ,oBAAoB,GACe,EAAE,EAAE;IACvC,MAAM,yCAAyC,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACjE,MAAM,OAAO,GAAuD,EAAE,CAAC;QACvE,MAAM,aAAa,GAAG,wCAA8D,CAAC;QAErF,OAAO,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,qCAAqC,CAAC,EAAC,CAAC,CAAC;QAChH,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;YAChC,IAAI,OAAO,aAAa,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;gBAClE,mDAAmD;gBACnD,MAAM,KAAK,GAAG,GAAG;qBACd,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;qBAC1B,IAAI,EAAE;qBACN,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC1C,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAA2B,EAAE,KAAK,EAAE,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL;QACE,8BAAC,6BAAa,IACZ,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,mCAAmC,CAAC,EAC3E,OAAO,EAAE,yCAAyC,EAAE,EACpD,KAAK,EAAE,sBAAsB,EAC7B,QAAQ,EAAE,yBAAyB,EACnC,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,WAAW,EAAE,6CAAqB,CAAC,SAAS,CAAC,qCAAqC,CAAC,EACnF,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,GACjB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,6BAA6B,iCAuCxC","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 { CalculatedPropertyType } from \"@itwin/insights-client\";\nimport React, { useCallback } from \"react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledSelect } from \"@itwin/itwinui-react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\ninterface SharedCalculatedPropertyFormsProps {\n calculatedPropertyType: CalculatedPropertyType | undefined;\n setCalculatedPropertyType: (value: CalculatedPropertyType | undefined) => void;\n itemRenderer?: (option: SelectOption<string | undefined>) => JSX.Element;\n selectedItemRenderer?: (option: SelectOption<string | undefined>) => JSX.Element;\n}\n\nexport const SharedCalculatedPropertyForms = ({\n calculatedPropertyType,\n setCalculatedPropertyType,\n itemRenderer,\n selectedItemRenderer,\n}: SharedCalculatedPropertyFormsProps) => {\n const generateOptionsFromCalculatedPropertyType = useCallback(() => {\n const options: SelectOption<CalculatedPropertyType | undefined>[] = [];\n const indexableEnum = CalculatedPropertyType as unknown as { [key: string]: string };\n \n options.push({value: undefined, label: GroupingMappingWidget.translate(\"properties.noCalculatedPropertyType\")});\n for (const key in indexableEnum) {\n if (typeof indexableEnum[key] === \"string\" && key !== \"Undefined\") {\n // Generate labels by adding space between capitals\n const label = key\n .replace(/([A-Z])/g, \" $1\")\n .trim()\n .replace(/^\\w/, (c) => c.toUpperCase());\n options.push({ value: indexableEnum[key] as CalculatedPropertyType, label });\n }\n }\n return options;\n }, []);\n\n return (\n <>\n <LabeledSelect<CalculatedPropertyType | undefined>\n label={GroupingMappingWidget.translate(\"properties.calculatedPropertyType\")}\n options={generateOptionsFromCalculatedPropertyType()}\n value={calculatedPropertyType}\n onChange={setCalculatedPropertyType}\n itemRenderer={itemRenderer}\n selectedItemRenderer={selectedItemRenderer}\n placeholder={GroupingMappingWidget.translate(\"properties.noCalculatedPropertyType\")}\n onShow={() => { }}\n onHide={() => { }}\n />\n </>\n );\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./CustomCalculationAction.scss";
3
2
  /**
4
3
  * Props for the {@link CustomCalculationAction} component.
@@ -11,18 +11,19 @@ exports.CustomCalculationAction = void 0;
11
11
  const itwinui_react_1 = require("@itwin/itwinui-react");
12
12
  const react_1 = __importDefault(require("react"));
13
13
  require("./CustomCalculationAction.scss");
14
+ const GroupingMappingWidget_1 = require("../../../GroupingMappingWidget");
14
15
  /**
15
16
  * Component to create or update a custom calculation property.
16
17
  * @internal
17
18
  */
18
19
  const CustomCalculationAction = ({ formula, setFormula, formulaErrorMessage, forceValidation, disabled }) => {
19
20
  return (react_1.default.createElement(itwinui_react_1.InputGroup, { className: "gmw-custom-calculation-action-container" },
20
- react_1.default.createElement(itwinui_react_1.Alert, { type: "informational", clickableText: "Click here.", clickableTextProps: {
21
+ react_1.default.createElement(itwinui_react_1.Alert, { type: "informational", clickableText: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.formulaDocLink"), clickableTextProps: {
21
22
  href: "https://developer.bentley.com/apis/grouping-and-mapping/operations/create-property/#customcalculations",
22
23
  target: "_blank",
23
24
  rel: "noreferrer",
24
- } }, "To learn more about creating custom calculation formulas, view the documentation."),
25
- react_1.default.createElement(itwinui_react_1.LabeledTextarea, { className: "gmw-details-form", value: formula, name: "formula", label: "Formula", disabled: disabled, onChange: (event) => {
25
+ } }, GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.formulaDocMessage")),
26
+ react_1.default.createElement(itwinui_react_1.LabeledTextarea, { className: "gmw-details-form", value: formula, name: "formula", label: GroupingMappingWidget_1.GroupingMappingWidget.translate("properties.formula"), disabled: disabled, onChange: (event) => {
26
27
  setFormula(event.target.value);
27
28
  }, message: formulaErrorMessage, status: formulaErrorMessage ? "negative" : undefined, onBlur: (event) => {
28
29
  if (event.target.textLength === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"CustomCalculationAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CustomCalculations/CustomCalculationAction.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,wDAA0E;AAC1E,kDAA0B;AAC1B,0CAAwC;AAcxC;;;GAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,EAAgC,EAAE,EAAE;IAC/I,OAAO,CACL,8BAAC,0BAAU,IAAC,SAAS,EAAC,yCAAyC;QAC7D,8BAAC,qBAAK,IACJ,IAAI,EAAC,eAAe,EACpB,aAAa,EAAC,aAAa,EAC3B,kBAAkB,EAAE;gBAClB,IAAI,EAAE,wGAAwG;gBAC9G,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,YAAY;aAClB,wFAGK;QACR,8BAAC,+BAAe,IACd,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,OAAO,EACd,IAAI,EAAC,SAAS,EACd,KAAK,EAAC,SAAS,EACf,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC,EACD,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACpD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,KAAK,CAAC;oBAAE,UAAU,CAAC,SAAS,CAAC,CAAC;YAC3D,CAAC,EACD,aAAa,EAAE,GAAG,EAAE;gBAClB,eAAe,EAAE,CAAC;YACpB,CAAC,GACD,CACS,CACd,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,uBAAuB,2BAkClC","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 { Alert, InputGroup, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport \"./CustomCalculationAction.scss\";\n\n/**\n * Props for the {@link CustomCalculationAction} component.\n * @internal\n */\nexport interface CustomCalculationActionProps {\n formula?: string;\n setFormula: (formula: string | undefined) => void;\n formulaErrorMessage?: string;\n forceValidation: () => void;\n disabled?: boolean;\n}\n\n/**\n * Component to create or update a custom calculation property.\n * @internal\n */\nexport const CustomCalculationAction = ({ formula, setFormula, formulaErrorMessage, forceValidation, disabled }: CustomCalculationActionProps) => {\n return (\n <InputGroup className=\"gmw-custom-calculation-action-container\">\n <Alert\n type=\"informational\"\n clickableText=\"Click here.\"\n clickableTextProps={{\n href: \"https://developer.bentley.com/apis/grouping-and-mapping/operations/create-property/#customcalculations\",\n target: \"_blank\",\n rel: \"noreferrer\",\n }}\n >\n To learn more about creating custom calculation formulas, view the documentation.\n </Alert>\n <LabeledTextarea\n className=\"gmw-details-form\"\n value={formula}\n name=\"formula\"\n label=\"Formula\"\n disabled={disabled}\n onChange={(event) => {\n setFormula(event.target.value);\n }}\n message={formulaErrorMessage}\n status={formulaErrorMessage ? \"negative\" : undefined}\n onBlur={(event) => {\n if (event.target.textLength === 0) setFormula(undefined);\n }}\n onBlurCapture={() => {\n forceValidation();\n }}\n />\n </InputGroup>\n );\n};\n"]}
1
+ {"version":3,"file":"CustomCalculationAction.js","sourceRoot":"","sources":["../../../../../src/components/Properties/CustomCalculations/CustomCalculationAction.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,wDAA0E;AAC1E,kDAA0B;AAC1B,0CAAwC;AACxC,0EAAuE;AAcvE;;;GAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,EAAgC,EAAE,EAAE;IAC/I,OAAO,CACL,8BAAC,0BAAU,IAAC,SAAS,EAAC,yCAAyC;QAC7D,8BAAC,qBAAK,IACJ,IAAI,EAAC,eAAe,EACpB,aAAa,EAAE,6CAAqB,CAAC,SAAS,CAAC,2BAA2B,CAAC,EAC3E,kBAAkB,EAAE;gBAClB,IAAI,EAAE,wGAAwG;gBAC9G,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,YAAY;aAClB,IAEA,6CAAqB,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAC1D;QACR,8BAAC,+BAAe,IACd,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,OAAO,EACd,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,6CAAqB,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAC5D,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC,EACD,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACpD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,KAAK,CAAC;oBAAE,UAAU,CAAC,SAAS,CAAC,CAAC;YAC3D,CAAC,EACD,aAAa,EAAE,GAAG,EAAE;gBAClB,eAAe,EAAE,CAAC;YACpB,CAAC,GACD,CACS,CACd,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,uBAAuB,2BAkClC","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 { Alert, InputGroup, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport \"./CustomCalculationAction.scss\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\n/**\n * Props for the {@link CustomCalculationAction} component.\n * @internal\n */\nexport interface CustomCalculationActionProps {\n formula?: string;\n setFormula: (formula: string | undefined) => void;\n formulaErrorMessage?: string;\n forceValidation: () => void;\n disabled?: boolean;\n}\n\n/**\n * Component to create or update a custom calculation property.\n * @internal\n */\nexport const CustomCalculationAction = ({ formula, setFormula, formulaErrorMessage, forceValidation, disabled }: CustomCalculationActionProps) => {\n return (\n <InputGroup className=\"gmw-custom-calculation-action-container\">\n <Alert\n type=\"informational\"\n clickableText={GroupingMappingWidget.translate(\"properties.formulaDocLink\")}\n clickableTextProps={{\n href: \"https://developer.bentley.com/apis/grouping-and-mapping/operations/create-property/#customcalculations\",\n target: \"_blank\",\n rel: \"noreferrer\",\n }}\n >\n {GroupingMappingWidget.translate(\"properties.formulaDocMessage\")}\n </Alert>\n <LabeledTextarea\n className=\"gmw-details-form\"\n value={formula}\n name=\"formula\"\n label={GroupingMappingWidget.translate(\"properties.formula\")}\n disabled={disabled}\n onChange={(event) => {\n setFormula(event.target.value);\n }}\n message={formulaErrorMessage}\n status={formulaErrorMessage ? \"negative\" : undefined}\n onBlur={(event) => {\n if (event.target.textLength === 0) setFormula(undefined);\n }}\n onBlurCapture={() => {\n forceValidation();\n }}\n />\n </InputGroup>\n );\n};\n"]}