@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,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import type { SelectOption } from "@itwin/itwinui-react";
3
2
  import type { QueryBuilderCustomUIProps } from "./QueryBuilderCustomUI";
4
3
  import "./QueryBuilderStep.scss";
5
- declare const defaultDisplayStrings: {
4
+ declare const getDefaultDisplayStrings: () => {
6
5
  groupBy: string;
7
6
  };
8
7
  export interface QueryBuilderStepProps extends QueryBuilderCustomUIProps {
@@ -10,7 +9,7 @@ export interface QueryBuilderStepProps extends QueryBuilderCustomUIProps {
10
9
  isHidden: boolean;
11
10
  onChange: (value: string) => Promise<void>;
12
11
  getOptions: SelectOption<string>[];
13
- displayStrings?: Partial<typeof defaultDisplayStrings>;
12
+ displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;
14
13
  }
15
14
  export declare const QueryBuilderStep: ({ queryRowCount, isHidden, onChange, getOptions, displayStrings: userDisplayStrings, ...rest }: QueryBuilderStepProps) => JSX.Element;
16
15
  export {};
@@ -4,21 +4,22 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import React from "react";
6
6
  import { ComboBox, Fieldset, Label, Text } from "@itwin/itwinui-react";
7
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
7
8
  import { QueryBuilderCustomUI } from "./QueryBuilderCustomUI";
8
9
  import "./QueryBuilderStep.scss";
9
- const defaultDisplayStrings = {
10
- groupBy: "Group By",
11
- };
10
+ const getDefaultDisplayStrings = () => ({
11
+ groupBy: GroupingMappingWidget.translate("groups.groupBy"),
12
+ });
12
13
  export const QueryBuilderStep = ({ queryRowCount, isHidden, onChange, getOptions, displayStrings: userDisplayStrings, ...rest }) => {
13
14
  const containerClassName = isHidden ? "gmw-hide" : "gmw-query-builder-container";
14
- const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
15
+ const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);
15
16
  return (React.createElement(Fieldset, { legend: displayStrings.groupBy, className: containerClassName },
16
17
  React.createElement("span", null,
17
- React.createElement(Label, { htmlFor: "query-combo-input" }, "Query Generation Tool"),
18
+ React.createElement(Label, { htmlFor: "query-combo-input" }, GroupingMappingWidget.translate("groups.queryGenerationTool")),
18
19
  React.createElement(ComboBox, { value: rest.queryGenerationType, inputProps: {
19
20
  id: "query-combo-input",
20
21
  }, options: getOptions, onChange: onChange })),
21
- React.createElement(Text, null, `Row Count: ${queryRowCount}`),
22
+ React.createElement(Text, null, GroupingMappingWidget.translate("groups.rowCount", { queryRowCount: queryRowCount.toString() })),
22
23
  React.createElement(QueryBuilderCustomUI, { ...rest })));
23
24
  };
24
25
  //# sourceMappingURL=QueryBuilderStep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderStep.js","sourceRoot":"","sources":["../../../../../src/components/Groups/QueryBuilder/QueryBuilderStep.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,yBAAyB,CAAC;AAEjC,MAAM,qBAAqB,GAAG;IAC5B,OAAO,EAAE,UAAU;CACpB,CAAC;AAUF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAyB,EAAE,EAAE;IACxJ,MAAM,kBAAkB,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,6BAA6B,CAAC;IAEjF,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,qBAAqB,EAAE,GAAG,kBAAkB,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAExH,OAAO,CACL,oBAAC,QAAQ,IAAC,MAAM,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,kBAAkB;QACrE;YACE,oBAAC,KAAK,IAAC,OAAO,EAAC,mBAAmB,4BAA8B;YAChE,oBAAC,QAAQ,IACP,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAC/B,UAAU,EAAE;oBACV,EAAE,EAAE,mBAAmB;iBACxB,EACD,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,GAClB,CACG;QACP,oBAAC,IAAI,QAAE,cAAc,aAAa,EAAE,CAAQ;QAC5C,oBAAC,oBAAoB,OAAK,IAAI,GAAI,CACzB,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { ComboBox, Fieldset, Label, Text } from \"@itwin/itwinui-react\";\nimport type { QueryBuilderCustomUIProps } from \"./QueryBuilderCustomUI\";\nimport { QueryBuilderCustomUI } from \"./QueryBuilderCustomUI\";\nimport \"./QueryBuilderStep.scss\";\n\nconst defaultDisplayStrings = {\n groupBy: \"Group By\",\n};\n\nexport interface QueryBuilderStepProps extends QueryBuilderCustomUIProps {\n queryRowCount: number;\n isHidden: boolean;\n onChange: (value: string) => Promise<void>;\n getOptions: SelectOption<string>[];\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const QueryBuilderStep = ({ queryRowCount, isHidden, onChange, getOptions, displayStrings: userDisplayStrings, ...rest }: QueryBuilderStepProps) => {\n const containerClassName = isHidden ? \"gmw-hide\" : \"gmw-query-builder-container\";\n\n const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);\n\n return (\n <Fieldset legend={displayStrings.groupBy} className={containerClassName}>\n <span>\n <Label htmlFor=\"query-combo-input\">Query Generation Tool</Label>\n <ComboBox\n value={rest.queryGenerationType}\n inputProps={{\n id: \"query-combo-input\",\n }}\n options={getOptions}\n onChange={onChange}\n />\n </span>\n <Text>{`Row Count: ${queryRowCount}`}</Text>\n <QueryBuilderCustomUI {...rest} />\n </Fieldset>\n );\n};\n"]}
1
+ {"version":3,"file":"QueryBuilderStep.js","sourceRoot":"","sources":["../../../../../src/components/Groups/QueryBuilder/QueryBuilderStep.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,yBAAyB,CAAC;AAEjC,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE,qBAAqB,CAAC,SAAS,CAAC,gBAAgB,CAAC;CAC3D,CAAC,CAAC;AAUH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAyB,EAAE,EAAE;IACxJ,MAAM,kBAAkB,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,6BAA6B,CAAC;IAEjF,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,wBAAwB,EAAE,EAAE,GAAG,kBAAkB,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAE7H,OAAO,CACL,oBAAC,QAAQ,IAAC,MAAM,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,kBAAkB;QACrE;YACE,oBAAC,KAAK,IAAC,OAAO,EAAC,mBAAmB,IAAE,qBAAqB,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAS;YAC1G,oBAAC,QAAQ,IACP,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAC/B,UAAU,EAAE;oBACV,EAAE,EAAE,mBAAmB;iBACxB,EACD,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,GAClB,CACG;QACP,oBAAC,IAAI,QAAE,qBAAqB,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAQ;QAC9G,oBAAC,oBAAoB,OAAK,IAAI,GAAI,CACzB,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { ComboBox, Fieldset, Label, Text } from \"@itwin/itwinui-react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport type { QueryBuilderCustomUIProps } from \"./QueryBuilderCustomUI\";\nimport { QueryBuilderCustomUI } from \"./QueryBuilderCustomUI\";\nimport \"./QueryBuilderStep.scss\";\n\nconst getDefaultDisplayStrings = () => ({\n groupBy: GroupingMappingWidget.translate(\"groups.groupBy\"),\n});\n\nexport interface QueryBuilderStepProps extends QueryBuilderCustomUIProps {\n queryRowCount: number;\n isHidden: boolean;\n onChange: (value: string) => Promise<void>;\n getOptions: SelectOption<string>[];\n displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;\n}\n\nexport const QueryBuilderStep = ({ queryRowCount, isHidden, onChange, getOptions, displayStrings: userDisplayStrings, ...rest }: QueryBuilderStepProps) => {\n const containerClassName = isHidden ? \"gmw-hide\" : \"gmw-query-builder-container\";\n\n const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n\n return (\n <Fieldset legend={displayStrings.groupBy} className={containerClassName}>\n <span>\n <Label htmlFor=\"query-combo-input\">{GroupingMappingWidget.translate(\"groups.queryGenerationTool\")}</Label>\n <ComboBox\n value={rest.queryGenerationType}\n inputProps={{\n id: \"query-combo-input\",\n }}\n options={getOptions}\n onChange={onChange}\n />\n </span>\n <Text>{GroupingMappingWidget.translate(\"groups.rowCount\", { queryRowCount: queryRowCount.toString() })}</Text>\n <QueryBuilderCustomUI {...rest} />\n </Fieldset>\n );\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToggleGroupVisibility.scss";
3
2
  export interface ToggleGroupVisibilityProps {
4
3
  isLoadingQuery: boolean;
@@ -3,7 +3,8 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { ToggleSwitch } from "@itwin/itwinui-react";
6
- import "./ToggleGroupVisibility.scss";
7
6
  import React from "react";
8
- export const ToggleGroupVisibility = ({ isLoadingQuery, showGroupColor, setShowGroupColor }) => (React.createElement(ToggleSwitch, { label: "Color by Group", labelPosition: "left", className: "gmw-toggle", disabled: isLoadingQuery, checked: showGroupColor, onChange: () => setShowGroupColor((b) => !b) }));
7
+ import { GroupingMappingWidget } from "../../GroupingMappingWidget";
8
+ import "./ToggleGroupVisibility.scss";
9
+ export const ToggleGroupVisibility = ({ isLoadingQuery, showGroupColor, setShowGroupColor }) => (React.createElement(ToggleSwitch, { label: GroupingMappingWidget.translate("groups.colorByGroup"), labelPosition: "left", className: "gmw-toggle", disabled: isLoadingQuery, checked: showGroupColor, onChange: () => setShowGroupColor((b) => !b) }));
9
10
  //# sourceMappingURL=ToggleGroupVisibility.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleGroupVisibility.js","sourceRoot":"","sources":["../../../../src/components/Groups/ToggleGroupVisibility.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAA8B,EAAE,EAAE,CAAC,CAC1H,oBAAC,YAAY,IACX,KAAK,EAAC,gBAAgB,EACtB,aAAa,EAAC,MAAM,EACpB,SAAS,EAAC,YAAY,EACtB,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAC5C,CACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { ToggleSwitch } from \"@itwin/itwinui-react\";\nimport \"./ToggleGroupVisibility.scss\";\nimport React from \"react\";\n\nexport interface ToggleGroupVisibilityProps {\n isLoadingQuery: boolean;\n showGroupColor: boolean;\n setShowGroupColor: (value: ((prevState: boolean) => boolean) | boolean) => void;\n}\n\nexport const ToggleGroupVisibility = ({ isLoadingQuery, showGroupColor, setShowGroupColor }: ToggleGroupVisibilityProps) => (\n <ToggleSwitch\n label=\"Color by Group\"\n labelPosition=\"left\"\n className=\"gmw-toggle\"\n disabled={isLoadingQuery}\n checked={showGroupColor}\n onChange={() => setShowGroupColor((b) => !b)}\n />\n);\n"]}
1
+ {"version":3,"file":"ToggleGroupVisibility.js","sourceRoot":"","sources":["../../../../src/components/Groups/ToggleGroupVisibility.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,8BAA8B,CAAC;AAQtC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAA8B,EAAE,EAAE,CAAC,CAC1H,oBAAC,YAAY,IACX,KAAK,EAAE,qBAAqB,CAAC,SAAS,CAAC,qBAAqB,CAAC,EAC7D,aAAa,EAAC,MAAM,EACpB,SAAS,EAAC,YAAY,EACtB,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAC5C,CACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React from \"react\";\nimport { GroupingMappingWidget } from \"../../GroupingMappingWidget\";\nimport \"./ToggleGroupVisibility.scss\";\n\nexport interface ToggleGroupVisibilityProps {\n isLoadingQuery: boolean;\n showGroupColor: boolean;\n setShowGroupColor: (value: ((prevState: boolean) => boolean) | boolean) => void;\n}\n\nexport const ToggleGroupVisibility = ({ isLoadingQuery, showGroupColor, setShowGroupColor }: ToggleGroupVisibilityProps) => (\n <ToggleSwitch\n label={GroupingMappingWidget.translate(\"groups.colorByGroup\")}\n labelPosition=\"left\"\n className=\"gmw-toggle\"\n disabled={isLoadingQuery}\n checked={showGroupColor}\n onChange={() => setShowGroupColor((b) => !b)}\n />\n);\n"]}
@@ -2,7 +2,7 @@ import type { IModelConnection } from "@itwin/core-frontend";
2
2
  import type { GroupMinimal } from "@itwin/insights-client";
3
3
  import type { OverlappedElementGroupPairs, OverlappedInfo } from "../context/GroupHilitedElementsContext";
4
4
  export declare const getGroupColor: (index: number) => string;
5
- export declare type GroupsElementIds = {
5
+ export type GroupsElementIds = {
6
6
  groupId: string;
7
7
  elementIds: string[];
8
8
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"groupsHelpers.js","sourceRoot":"","sources":["../../../../src/components/Groups/groupsHelpers.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EACL,iCAAiC,EACjC,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,MAAM,uBAAuB,GAAG,GAAG,CAAC,CAAC,8CAA8C;AACnF,MAAM,eAAe,GAAG,EAAE,CAAC,CAAC,gFAAgF;AAC5G,MAAM,mBAAmB,GAAG,EAAE,CAAC,CAAC,oDAAoD;AACpF,MAAM,mBAAmB,GAAG,GAAG,CAAC,CAAC,gDAAgD;AACjF,MAAM,mBAAmB,GAAG,EAAE,CAAC,CAAC,gDAAg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AC3C,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;YACrC,4FAA4F;YAC5F,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE;gBAC7B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;oBACnC,yBAAyB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;iBACrC;aACF;iBAAM;gBACL,wEAAwE;gBACxE,MAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,aAAa,IAAI,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;gBACtI,IAAI,oBAAoB,EAAE;oBACxB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;wBACnC,yBAAyB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;qBACrC;iBACF;aACF;SACF;KACF;IAED,qDAAqD;IACrD,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { FeatureOverrideType } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport type { OverlappedElementGroupPairs, OverlappedInfo } from \"../context/GroupHilitedElementsContext\";\nimport {\n clearEmphasizedOverriddenElements,\n clearHiddenElements,\n emphasizeElements,\n getHiliteIds,\n hideElements,\n overrideElements,\n} from \"../../common/viewerUtils\";\n\nconst GOLDEN_ANGLE_MULTIPLIER = 1.5; // Multiplier to spread colors more uniformly.\nconst BASE_HUE_OFFSET = 60; // Initial hue offset to avoid certain colors e.g 0 offset would begin with red.\nconst HUE_ADJUSTMENT_STEP = 15; // Step to adjust the hue to avoid the red spectrum.\nconst RED_HUE_LOWER_BOUND = 330; // Lower bound of the red hue spectrum to avoid.\nconst RED_HUE_UPPER_BOUND = 30; // Upper bound of the red hue spectrum to avoid.\nconst GOLDENANGLE = 180 * (3 - Math.sqrt(5));\n\nconst generateHSL = (hue: number, saturation: number = 100, lightness: number = 50) => {\n return `hsl(${hue}, ${saturation}%, ${lightness}%)`;\n};\n\nexport const getGroupColor = (index: number) => {\n let hue = (index * GOLDENANGLE * GOLDEN_ANGLE_MULTIPLIER + BASE_HUE_OFFSET) % 360;\n\n while (hue >= RED_HUE_LOWER_BOUND || hue <= RED_HUE_UPPER_BOUND) {\n hue = (hue + HUE_ADJUSTMENT_STEP) % 360;\n }\n\n return generateHSL(hue);\n};\n\nconst processGroupVisualization = async (\n overlappedElementGroupPairs: OverlappedElementGroupPairs,\n hiddenGroupsIds: Set<string>,\n doEmphasizeElements: boolean,\n color: string,\n replace: boolean,\n setNumberOfVisualizedGroups: (numberOfVisualizedGroups: number | ((numberOfVisualizedGroups: number) => number)) => void,\n) => {\n const hilitedIds = Array.from(overlappedElementGroupPairs.elementIds);\n\n overrideElements(hilitedIds, color, FeatureOverrideType.ColorAndAlpha, replace);\n setNumberOfVisualizedGroups((numberOfVisualizedGroups) => numberOfVisualizedGroups + 1);\n\n doEmphasizeElements && emphasizeElements(hilitedIds, undefined);\n\n for (const id of overlappedElementGroupPairs.groupIds) {\n if (hiddenGroupsIds.has(id)) {\n return [];\n }\n }\n return hilitedIds;\n};\n\nexport type GroupsElementIds = {\n groupId: string;\n elementIds: string[];\n}[];\n\nexport const hideGroupIds = (hiddenGroupIds: Set<string>, groupsWithGroupedOverlaps: OverlappedElementGroupPairs[]) => {\n hiddenGroupIds.forEach((groupId) => {\n hideGroupConsideringOverlaps(groupsWithGroupedOverlaps, groupId, hiddenGroupIds);\n });\n};\n\nexport const visualizeGroupColors = async (\n hiddenGroupsIds: Set<string>,\n groupsWithGroupedOverlaps: OverlappedElementGroupPairs[],\n setNumberOfVisualizedGroups: (numberOfVisualizedGroups: number | ((numberOfVisualizedGroups: number) => number)) => void,\n doEmphasizeElements: boolean = true,\n) => {\n clearEmphasizedOverriddenElements();\n\n const singleGroupPromises = groupsWithGroupedOverlaps\n .filter((group) => group.groupIds.size === 1)\n .map(async (group, index) =>\n processGroupVisualization(\n group,\n hiddenGroupsIds,\n doEmphasizeElements,\n getGroupColor(index), // color for single group\n false, // Shouldn't matter as replacement only accounts for same colored overrides.\n setNumberOfVisualizedGroups,\n ),\n );\n\n const overlappedGroupPromises = groupsWithGroupedOverlaps\n .filter((group) => group.groupIds.size !== 1)\n .map(async (group) =>\n processGroupVisualization(\n group,\n hiddenGroupsIds,\n doEmphasizeElements,\n generateHSL(0), // color for group of overlapped elements\n false,\n setNumberOfVisualizedGroups,\n ),\n );\n\n clearHiddenElements();\n\n const allPromises = [...singleGroupPromises, ...overlappedGroupPromises];\n\n const allIds = (await Promise.all(allPromises)).flat();\n return allIds;\n};\n\nexport const getHiliteIdsAndKeysetFromGroup = async (iModelConnection: IModelConnection, group: GroupMinimal) => {\n const query = group.query;\n const result = await getHiliteIds(query, iModelConnection);\n return { query, result };\n};\n\nconst getOverlappedElementsInfo = (overlappedElements: OverlappedElementGroupPairs[]) => {\n const overlappedElementsInfo: Map<string, OverlappedInfo[]> = new Map();\n\n overlappedElements.forEach((elementGroup) => {\n const { elementIds, groupIds } = elementGroup;\n\n groupIds.forEach((group) => {\n const otherGroups = Array.from(groupIds).filter((grp) => grp !== group);\n const overlappedInfoArray = overlappedElementsInfo.get(group) ?? [];\n overlappedInfoArray.push({ groupIds: otherGroups, elements: Array.from(elementIds) });\n overlappedElementsInfo.set(group, overlappedInfoArray);\n });\n });\n return overlappedElementsInfo;\n};\n\nconst mergeElementsByGroup = (elems: Map<string, Set<string>>) => {\n const mergedList: Map<string, OverlappedElementGroupPairs> = new Map();\n elems.forEach((groupIds, elementId) => {\n const sortedGroups = Array.from(groupIds).sort();\n const key = sortedGroups.join(\"-\");\n const overlap = mergedList.get(key);\n if (overlap) {\n overlap.elementIds.add(elementId);\n } else {\n mergedList.set(key, { elementIds: new Set([elementId]), groupIds });\n }\n });\n return mergedList;\n};\n\nexport const generateOverlappedGroups = (groupsElementIds: GroupsElementIds) => {\n const elems: Map<string, Set<string>> = new Map();\n const groupElementCount: Map<string, number> = new Map();\n\n // Build the elems map for associations between elements and their groups.\n for (const groupInfo of groupsElementIds) {\n for (const elem of groupInfo.elementIds) {\n const elemGroups = elems.get(elem) || new Set<string>();\n elemGroups.add(groupInfo.groupId);\n elems.set(elem, elemGroups);\n }\n groupElementCount.set(groupInfo.groupId, groupInfo.elementIds.length);\n }\n\n // Construct the unique list of all groups and their overlapped groups combinations\n const allGroups: OverlappedElementGroupPairs[] = groupsElementIds.map((groupInfo) => {\n const nonOverlappingElements = Array.from(new Set(groupInfo.elementIds)).filter((elem) => elems.get(elem)!.size === 1);\n groupElementCount.set(groupInfo.groupId, groupInfo.elementIds.length);\n return { elementIds: new Set(nonOverlappingElements), groupIds: new Set([groupInfo.groupId]) };\n });\n\n const mergedList = mergeElementsByGroup(elems);\n const overlappedGroupsInformation: OverlappedElementGroupPairs[] = Array.from(mergedList.values()).filter((value) => value.groupIds.size > 1);\n\n return {\n groupsWithGroupedOverlaps: [...allGroups, ...overlappedGroupsInformation],\n overlappedElementsInfo: getOverlappedElementsInfo(overlappedGroupsInformation),\n numberOfElementsInGroups: groupElementCount,\n };\n};\n\nexport const hideGroupConsideringOverlaps = (\n overlappedElementGroupPairs: OverlappedElementGroupPairs[],\n groupIdToHide: string,\n hiddenGroupsIds: Set<string>,\n) => {\n const elementsToPotentiallyHide = new Set<string>();\n\n // Check each entry in overlappedElementGroupPairs\n for (const entry of overlappedElementGroupPairs) {\n // If the groupToHide is part of this entry\n if (entry.groupIds.has(groupIdToHide)) {\n // If this is a unique entry (no overlaps for this group), add all its elements to hide list\n if (entry.groupIds.size === 1) {\n for (const elem of entry.elementIds) {\n elementsToPotentiallyHide.add(elem);\n }\n } else {\n // If there are overlaps, only hide if all overlapping groups are hidden\n const allOtherGroupsHidden = Array.from(entry.groupIds).every((groupId) => groupId === groupIdToHide || hiddenGroupsIds.has(groupId));\n if (allOtherGroupsHidden) {\n for (const elem of entry.elementIds) {\n elementsToPotentiallyHide.add(elem);\n }\n }\n }\n }\n }\n\n // Now hide all elements in elementsToPotentiallyHide\n hideElements(Array.from(elementsToPotentiallyHide));\n};\n"]}
1
+ {"version":3,"file":"groupsHelpers.js","sourceRoot":"","sources":["../../../../src/components/Groups/groupsHelpers.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EACL,iCAAiC,EACjC,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,MAAM,uBAAuB,GAAG,GAAG,CAAC,CAAC,8CAA8C;AACnF,MAAM,eAAe,GAAG,EAAE,CAAC,CAAC,gFAAgF;AAC5G,MAAM,mBAAmB,GAAG,EAAE,CAAC,CAAC,oDAAoD;AACpF,MAAM,mBAAmB,GAAG,GAAG,CAAC,CAAC,gDAAgD;AACjF,MAAM,mBAAmB,GAAG,EAAE,CAAC,CAAC,gDAAgD;AAChF,MAAM,WAAW,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7C,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,aAAqB,GAAG,EAAE,YAAoB,EAAE,EAAE,EAAE;IACpF,OAAO,OAAO,GAAG,KAAK,UAAU,MAAM,SAAS,IAAI,CAAC;AACtD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,EAAE;IAC7C,IAAI,GAAG,GAAG,CA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AC;gBACtC,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,wEAAwE;gBACxE,MAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,aAAa,IAAI,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;gBACtI,IAAI,oBAAoB,EAAE,CAAC;oBACzB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;wBACpC,yBAAyB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBACtC,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,qDAAqD;IACrD,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { FeatureOverrideType } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport type { OverlappedElementGroupPairs, OverlappedInfo } from \"../context/GroupHilitedElementsContext\";\nimport {\n clearEmphasizedOverriddenElements,\n clearHiddenElements,\n emphasizeElements,\n getHiliteIds,\n hideElements,\n overrideElements,\n} from \"../../common/viewerUtils\";\n\nconst GOLDEN_ANGLE_MULTIPLIER = 1.5; // Multiplier to spread colors more uniformly.\nconst BASE_HUE_OFFSET = 60; // Initial hue offset to avoid certain colors e.g 0 offset would begin with red.\nconst HUE_ADJUSTMENT_STEP = 15; // Step to adjust the hue to avoid the red spectrum.\nconst RED_HUE_LOWER_BOUND = 330; // Lower bound of the red hue spectrum to avoid.\nconst RED_HUE_UPPER_BOUND = 30; // Upper bound of the red hue spectrum to avoid.\nconst GOLDENANGLE = 180 * (3 - Math.sqrt(5));\n\nconst generateHSL = (hue: number, saturation: number = 100, lightness: number = 50) => {\n return `hsl(${hue}, ${saturation}%, ${lightness}%)`;\n};\n\nexport const getGroupColor = (index: number) => {\n let hue = (index * GOLDENANGLE * GOLDEN_ANGLE_MULTIPLIER + BASE_HUE_OFFSET) % 360;\n\n while (hue >= RED_HUE_LOWER_BOUND || hue <= RED_HUE_UPPER_BOUND) {\n hue = (hue + HUE_ADJUSTMENT_STEP) % 360;\n }\n\n return generateHSL(hue);\n};\n\nconst processGroupVisualization = async (\n overlappedElementGroupPairs: OverlappedElementGroupPairs,\n hiddenGroupsIds: Set<string>,\n doEmphasizeElements: boolean,\n color: string,\n replace: boolean,\n setNumberOfVisualizedGroups: (numberOfVisualizedGroups: number | ((numberOfVisualizedGroups: number) => number)) => void,\n) => {\n const hilitedIds = Array.from(overlappedElementGroupPairs.elementIds);\n\n overrideElements(hilitedIds, color, FeatureOverrideType.ColorAndAlpha, replace);\n setNumberOfVisualizedGroups((numberOfVisualizedGroups) => numberOfVisualizedGroups + 1);\n\n doEmphasizeElements && emphasizeElements(hilitedIds, undefined);\n\n for (const id of overlappedElementGroupPairs.groupIds) {\n if (hiddenGroupsIds.has(id)) {\n return [];\n }\n }\n return hilitedIds;\n};\n\nexport type GroupsElementIds = {\n groupId: string;\n elementIds: string[];\n}[];\n\nexport const hideGroupIds = (hiddenGroupIds: Set<string>, groupsWithGroupedOverlaps: OverlappedElementGroupPairs[]) => {\n hiddenGroupIds.forEach((groupId) => {\n hideGroupConsideringOverlaps(groupsWithGroupedOverlaps, groupId, hiddenGroupIds);\n });\n};\n\nexport const visualizeGroupColors = async (\n hiddenGroupsIds: Set<string>,\n groupsWithGroupedOverlaps: OverlappedElementGroupPairs[],\n setNumberOfVisualizedGroups: (numberOfVisualizedGroups: number | ((numberOfVisualizedGroups: number) => number)) => void,\n doEmphasizeElements: boolean = true,\n) => {\n clearEmphasizedOverriddenElements();\n\n const singleGroupPromises = groupsWithGroupedOverlaps\n .filter((group) => group.groupIds.size === 1)\n .map(async (group, index) =>\n processGroupVisualization(\n group,\n hiddenGroupsIds,\n doEmphasizeElements,\n getGroupColor(index), // color for single group\n false, // Shouldn't matter as replacement only accounts for same colored overrides.\n setNumberOfVisualizedGroups,\n ),\n );\n\n const overlappedGroupPromises = groupsWithGroupedOverlaps\n .filter((group) => group.groupIds.size !== 1)\n .map(async (group) =>\n processGroupVisualization(\n group,\n hiddenGroupsIds,\n doEmphasizeElements,\n generateHSL(0), // color for group of overlapped elements\n false,\n setNumberOfVisualizedGroups,\n ),\n );\n\n clearHiddenElements();\n\n const allPromises = [...singleGroupPromises, ...overlappedGroupPromises];\n\n const allIds = (await Promise.all(allPromises)).flat();\n return allIds;\n};\n\nexport const getHiliteIdsAndKeysetFromGroup = async (iModelConnection: IModelConnection, group: GroupMinimal) => {\n const query = group.query;\n const result = await getHiliteIds(query, iModelConnection);\n return { query, result };\n};\n\nconst getOverlappedElementsInfo = (overlappedElements: OverlappedElementGroupPairs[]) => {\n const overlappedElementsInfo: Map<string, OverlappedInfo[]> = new Map();\n\n overlappedElements.forEach((elementGroup) => {\n const { elementIds, groupIds } = elementGroup;\n\n groupIds.forEach((group) => {\n const otherGroups = Array.from(groupIds).filter((grp) => grp !== group);\n const overlappedInfoArray = overlappedElementsInfo.get(group) ?? [];\n overlappedInfoArray.push({ groupIds: otherGroups, elements: Array.from(elementIds) });\n overlappedElementsInfo.set(group, overlappedInfoArray);\n });\n });\n return overlappedElementsInfo;\n};\n\nconst mergeElementsByGroup = (elems: Map<string, Set<string>>) => {\n const mergedList: Map<string, OverlappedElementGroupPairs> = new Map();\n elems.forEach((groupIds, elementId) => {\n const sortedGroups = Array.from(groupIds).sort();\n const key = sortedGroups.join(\"-\");\n const overlap = mergedList.get(key);\n if (overlap) {\n overlap.elementIds.add(elementId);\n } else {\n mergedList.set(key, { elementIds: new Set([elementId]), groupIds });\n }\n });\n return mergedList;\n};\n\nexport const generateOverlappedGroups = (groupsElementIds: GroupsElementIds) => {\n const elems: Map<string, Set<string>> = new Map();\n const groupElementCount: Map<string, number> = new Map();\n\n // Build the elems map for associations between elements and their groups.\n for (const groupInfo of groupsElementIds) {\n for (const elem of groupInfo.elementIds) {\n const elemGroups = elems.get(elem) || new Set<string>();\n elemGroups.add(groupInfo.groupId);\n elems.set(elem, elemGroups);\n }\n groupElementCount.set(groupInfo.groupId, groupInfo.elementIds.length);\n }\n\n // Construct the unique list of all groups and their overlapped groups combinations\n const allGroups: OverlappedElementGroupPairs[] = groupsElementIds.map((groupInfo) => {\n const nonOverlappingElements = Array.from(new Set(groupInfo.elementIds)).filter((elem) => elems.get(elem)!.size === 1);\n groupElementCount.set(groupInfo.groupId, groupInfo.elementIds.length);\n return { elementIds: new Set(nonOverlappingElements), groupIds: new Set([groupInfo.groupId]) };\n });\n\n const mergedList = mergeElementsByGroup(elems);\n const overlappedGroupsInformation: OverlappedElementGroupPairs[] = Array.from(mergedList.values()).filter((value) => value.groupIds.size > 1);\n\n return {\n groupsWithGroupedOverlaps: [...allGroups, ...overlappedGroupsInformation],\n overlappedElementsInfo: getOverlappedElementsInfo(overlappedGroupsInformation),\n numberOfElementsInGroups: groupElementCount,\n };\n};\n\nexport const hideGroupConsideringOverlaps = (\n overlappedElementGroupPairs: OverlappedElementGroupPairs[],\n groupIdToHide: string,\n hiddenGroupsIds: Set<string>,\n) => {\n const elementsToPotentiallyHide = new Set<string>();\n\n // Check each entry in overlappedElementGroupPairs\n for (const entry of overlappedElementGroupPairs) {\n // If the groupToHide is part of this entry\n if (entry.groupIds.has(groupIdToHide)) {\n // If this is a unique entry (no overlaps for this group), add all its elements to hide list\n if (entry.groupIds.size === 1) {\n for (const elem of entry.elementIds) {\n elementsToPotentiallyHide.add(elem);\n }\n } else {\n // If there are overlaps, only hide if all overlapping groups are hidden\n const allOtherGroupsHidden = Array.from(entry.groupIds).every((groupId) => groupId === groupIdToHide || hiddenGroupsIds.has(groupId));\n if (allOtherGroupsHidden) {\n for (const elem of entry.elementIds) {\n elementsToPotentiallyHide.add(elem);\n }\n }\n }\n }\n }\n\n // Now hide all elements in elementsToPotentiallyHide\n hideElements(Array.from(elementsToPotentiallyHide));\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { GroupMinimal } from "@itwin/insights-client";
3
2
  import type { ContextCustomUI, GroupingCustomUI } from "../../customUI/GroupingMappingCustomUI";
4
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useGroupsOperations.js","sourceRoot":"","sources":["../../../../../src/components/Groups/hooks/useGroupsOperations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAErF,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAUpE;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAE,SAAS,EAAyB,EAAE,EAAE;IAC1E,MAAM,EAAE,cAAc,EAAE,GAAG,2BAA2B,EAAE,CAAC;IACzD,MAAM,EACJ,0BAA0B,EAAE,EAAE,sBAAsB,EAAE,GACvD,GAAG,8BAA8B,EAAE,CAAC;IAErC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAuB,0BAA0B,EAAE,CAAC,SAAS,CAAC,MAAM,CAChF,CAAC,CAAC,EAAE,EAAE,CAAC,CAA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C,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,SAAS;QACT,OAAO;QACP,aAAa;QACb,kBAAkB;QAClB,eAAe;QACf,QAAQ;QACR,UAAU;QACV,YAAY;QACZ,eAAe;QACf,2BAA2B;QAC3B,8BAA8B;QAC9B,sBAAsB;KACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { useCallback, useState } from \"react\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { ContextCustomUI, GroupingCustomUI } from \"../../customUI/GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"../../customUI/GroupingMappingCustomUI\";\nimport { useGroupingMappingCustomUI } from \"../../context/GroupingMappingCustomUIContext\";\nimport { useGroupHilitedElementsContext } from \"../../context/GroupHilitedElementsContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useFetchGroups } from \"./useFetchGroups\";\nimport { useGroupsClient } from \"../../context/GroupsClientContext\";\n\n/**\n * Props for the {@link useGroupsOperations} hook.\n * @internal\n */\nexport interface GroupsOperationsProps {\n mappingId: string;\n}\n\n/**\n * Custom hook to handle group operations.\n * @internal\n */\nexport const useGroupsOperations = ({ mappingId }: GroupsOperationsProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const {\n overlappedElementsMetadata: { overlappedElementsInfo },\n } = useGroupHilitedElementsContext();\n\n const groupsClient = useGroupsClient();\n const groupUIs: GroupingCustomUI[] = useGroupingMappingCustomUI().customUIs.filter(\n (p) => p.type === GroupingMappingCustomUIType.Grouping,\n ) as GroupingCustomUI[];\n const contextUIs: ContextCustomUI[] = useGroupingMappingCustomUI().customUIs.filter(\n (p) => p.type === GroupingMappingCustomUIType.Context,\n ) as ContextCustomUI[];\n const [showDeleteModal, setShowDeleteModal] = useState<GroupMinimal | undefined>(undefined);\n const [errorMessage, setErrorMessage] = useState<string | undefined>(undefined);\n const [activeOverlapInfoPanelGroup, setActiveOverlapInfoPanelGroup] = useState<GroupMinimal | undefined>(undefined);\n const queryClient = useQueryClient();\n\n const { data: groups, isLoading } = useFetchGroups(mappingId, getAccessToken, groupsClient);\n\n const refresh = useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey: [\"groups\", mappingId] });\n }, [mappingId, queryClient]);\n\n const deleteGroupMutation = useMutation({\n mutationFn: async (group: GroupMinimal) => {\n const accessToken = await getAccessToken();\n await groupsClient.deleteGroup(accessToken, mappingId, group.id);\n },\n onSuccess: refresh,\n });\n\n const onDeleteGroup = async (group: GroupMinimal) => {\n deleteGroupMutation.mutate(group);\n };\n\n return {\n groups,\n isLoading,\n refresh,\n onDeleteGroup,\n setShowDeleteModal,\n showDeleteModal,\n groupUIs,\n contextUIs,\n errorMessage,\n setErrorMessage,\n activeOverlapInfoPanelGroup,\n setActiveOverlapInfoPanelGroup,\n overlappedElementsInfo,\n };\n};\n"]}
1
+ {"version":3,"file":"useGroupsOperations.js","sourceRoot":"","sources":["../../../../../src/components/Groups/hooks/useGroupsOperations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAErF,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAA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7B,MAAM,mBAAmB,GAAG,WAAW,CAAC;QACtC,UAAU,EAAE,KAAK,EAAE,KAAmB,EAAE,EAAE;YACxC,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;YAC3C,MAAM,YAAY,CAAC,WAAW,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QACnE,CAAC;QACD,SAAS,EAAE,OAAO;KACnB,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,KAAK,EAAE,KAAmB,EAAE,EAAE;QAClD,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,SAAS;QACT,OAAO;QACP,aAAa;QACb,kBAAkB;QAClB,eAAe;QACf,QAAQ;QACR,UAAU;QACV,YAAY;QACZ,eAAe;QACf,2BAA2B;QAC3B,8BAA8B;QAC9B,sBAAsB;KACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { useCallback, useState } from \"react\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport type { ContextCustomUI, GroupingCustomUI } from \"../../customUI/GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"../../customUI/GroupingMappingCustomUI\";\nimport { useGroupingMappingCustomUI } from \"../../context/GroupingMappingCustomUIContext\";\nimport { useGroupHilitedElementsContext } from \"../../context/GroupHilitedElementsContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useFetchGroups } from \"./useFetchGroups\";\nimport { useGroupsClient } from \"../../context/GroupsClientContext\";\n\n/**\n * Props for the {@link useGroupsOperations} hook.\n * @internal\n */\nexport interface GroupsOperationsProps {\n mappingId: string;\n}\n\n/**\n * Custom hook to handle group operations.\n * @internal\n */\nexport const useGroupsOperations = ({ mappingId }: GroupsOperationsProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const {\n overlappedElementsMetadata: { overlappedElementsInfo },\n } = useGroupHilitedElementsContext();\n\n const groupsClient = useGroupsClient();\n const groupUIs: GroupingCustomUI[] = useGroupingMappingCustomUI().customUIs.filter(\n (p) => p.type === GroupingMappingCustomUIType.Grouping,\n );\n const contextUIs: ContextCustomUI[] = useGroupingMappingCustomUI().customUIs.filter(\n (p) => p.type === GroupingMappingCustomUIType.Context,\n );\n const [showDeleteModal, setShowDeleteModal] = useState<GroupMinimal | undefined>(undefined);\n const [errorMessage, setErrorMessage] = useState<string | undefined>(undefined);\n const [activeOverlapInfoPanelGroup, setActiveOverlapInfoPanelGroup] = useState<GroupMinimal | undefined>(undefined);\n const queryClient = useQueryClient();\n\n const { data: groups, isLoading } = useFetchGroups(mappingId, getAccessToken, groupsClient);\n\n const refresh = useCallback(async () => {\n await queryClient.invalidateQueries({ queryKey: [\"groups\", mappingId] });\n }, [mappingId, queryClient]);\n\n const deleteGroupMutation = useMutation({\n mutationFn: async (group: GroupMinimal) => {\n const accessToken = await getAccessToken();\n await groupsClient.deleteGroup(accessToken, mappingId, group.id);\n },\n onSuccess: refresh,\n });\n\n const onDeleteGroup = async (group: GroupMinimal) => {\n deleteGroupMutation.mutate(group);\n };\n\n return {\n groups,\n isLoading,\n refresh,\n onDeleteGroup,\n setShowDeleteModal,\n showDeleteModal,\n groupUIs,\n contextUIs,\n errorMessage,\n setErrorMessage,\n activeOverlapInfoPanelGroup,\n setActiveOverlapInfoPanelGroup,\n overlappedElementsInfo,\n };\n};\n"]}
@@ -1,5 +1,4 @@
1
- import { useQuery } from "@tanstack/react-query";
2
- import { useQueries } from "@tanstack/react-query";
1
+ import { useQueries, useQuery } from "@tanstack/react-query";
3
2
  import { useMemo } from "react";
4
3
  import { useMemoizedCollectionPick } from "../../../common/hooks/useMemoizedCollectionPick";
5
4
  import { TErrCodes } from "../../Constants";
@@ -1 +1 @@
1
- {"version":3,"file":"useKeySetHiliteQueries.js","sourceRoot":"","sources":["../../../../../src/components/Groups/hooks/useKeySetHiliteQueries.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AASlE,EAAE,CAAC;AAIH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,KAAmB,EAAE,gBAAkC,EAAE,OAAgB,EAAE,EAAE,CAAC,CAAC;IAC9H,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC;IAC7C,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,8BAA8B,CAAC,gBAAgB,EAAE,KAAK,CAAC;IAC5E,OAAO;IACP,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,yBAAyB,EAAE,OAAO,EAAE,qBAAqB,KAAK,CAAC,SAAS,GAAG,EAAE;CAC3G,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAmB,EAAE,gBAAkC,EAAE,OAAgB,EAAE,EAAE;IAC/G,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,gCAAgC,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEpI,OAAO,QAAQ,CAAe,KAAK,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAsB,EAAE,OAAgB,EAAE,gBAAkC,EAAE,EAAE;IACrH,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gCAAgC,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;IAE9J,MAAM,cAAc,GAAG,UAAU,CAAW,EAAE,OAAO,EAAE,CAAC,CAAC;IAEzD,MAAM,YAAY,GAAG,yBAAyB,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IAE/G,OAAO,EAAE,YAAY,EAAE,CAAC;AAC1B,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nimport type { UseQueryOptions } from \"@tanstack/react-query\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { useMemo } from \"react\";\nimport { useMemoizedCollectionPick } from \"../../../common/hooks/useMemoizedCollectionPick\";\nimport { TErrCodes } from \"../../Constants\";\nimport { getHiliteIdsAndKeysetFromGroup } from \"../groupsHelpers\";\n\nexport interface QueryResults {\n query: string;\n result: {\n keySet: KeySet;\n ids: string[];\n };\n}\n[];\n\ntype TQueries = UseQueryOptions<QueryResults>[];\n\nexport const createQueryForHiliteIdsAndKeyset = (group: GroupMinimal, iModelConnection: IModelConnection, enabled: boolean) => ({\n queryKey: [\"group\", \"hiliteids\", group.query],\n queryFn: async () => getHiliteIdsAndKeysetFromGroup(iModelConnection, group),\n enabled,\n staleTime: Infinity,\n meta: { errorCode: TErrCodes.QUERY_HILITE_FETCH_FAILED, message: `Failed to resolve ${group.groupName}.` },\n});\n\nexport const useGroupKeySetQuery = (group: GroupMinimal, iModelConnection: IModelConnection, enabled: boolean) => {\n const query = useMemo(() => createQueryForHiliteIdsAndKeyset(group, iModelConnection, enabled), [enabled, group, iModelConnection]);\n\n return useQuery<QueryResults>(query);\n};\n\nexport const useKeySetHiliteQueries = (groups: GroupMinimal[], enabled: boolean, iModelConnection: IModelConnection) => {\n const queries = useMemo(() => groups.map((group) => createQueryForHiliteIdsAndKeyset(group, iModelConnection, enabled)), [groups, iModelConnection, enabled]);\n\n const useQueriesHook = useQueries<TQueries>({ queries });\n\n const groupQueries = useMemoizedCollectionPick(useQueriesHook, [\"data\", \"isFetching\", \"isFetched\", \"refetch\"]);\n\n return { groupQueries };\n};\n"]}
1
+ {"version":3,"file":"useKeySetHiliteQueries.js","sourceRoot":"","sources":["../../../../../src/components/Groups/hooks/useKeySetHiliteQueries.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAG,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AASlE,EAAE,CAAC;AAIH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,KAAmB,EAAE,gBAAkC,EAAE,OAAgB,EAAE,EAAE,CAAC,CAAC;IAC9H,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC;IAC7C,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,8BAA8B,CAAC,gBAAgB,EAAE,KAAK,CAAC;IAC5E,OAAO;IACP,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,yBAAyB,EAAE,OAAO,EAAE,qBAAqB,KAAK,CAAC,SAAS,GAAG,EAAE;CAC3G,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAmB,EAAE,gBAAkC,EAAE,OAAgB,EAAE,EAAE;IAC/G,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,gCAAgC,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEpI,OAAO,QAAQ,CAAe,KAAK,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAsB,EAAE,OAAgB,EAAE,gBAAkC,EAAE,EAAE;IACrH,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gCAAgC,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;IAE9J,MAAM,cAAc,GAAG,UAAU,CAAW,EAAE,OAAO,EAAE,CAAC,CAAC;IAEzD,MAAM,YAAY,GAAG,yBAAyB,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IAE/G,OAAO,EAAE,YAAY,EAAE,CAAC;AAC1B,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nimport type { UseQueryOptions } from \"@tanstack/react-query\";\nimport { useQueries , useQuery } from \"@tanstack/react-query\";\nimport { useMemo } from \"react\";\nimport { useMemoizedCollectionPick } from \"../../../common/hooks/useMemoizedCollectionPick\";\nimport { TErrCodes } from \"../../Constants\";\nimport { getHiliteIdsAndKeysetFromGroup } from \"../groupsHelpers\";\n\nexport interface QueryResults {\n query: string;\n result: {\n keySet: KeySet;\n ids: string[];\n };\n}\n[];\n\ntype TQueries = UseQueryOptions<QueryResults>[];\n\nexport const createQueryForHiliteIdsAndKeyset = (group: GroupMinimal, iModelConnection: IModelConnection, enabled: boolean) => ({\n queryKey: [\"group\", \"hiliteids\", group.query],\n queryFn: async () => getHiliteIdsAndKeysetFromGroup(iModelConnection, group),\n enabled,\n staleTime: Infinity,\n meta: { errorCode: TErrCodes.QUERY_HILITE_FETCH_FAILED, message: `Failed to resolve ${group.groupName}.` },\n});\n\nexport const useGroupKeySetQuery = (group: GroupMinimal, iModelConnection: IModelConnection, enabled: boolean) => {\n const query = useMemo(() => createQueryForHiliteIdsAndKeyset(group, iModelConnection, enabled), [enabled, group, iModelConnection]);\n\n return useQuery<QueryResults>(query);\n};\n\nexport const useKeySetHiliteQueries = (groups: GroupMinimal[], enabled: boolean, iModelConnection: IModelConnection) => {\n const queries = useMemo(() => groups.map((group) => createQueryForHiliteIdsAndKeyset(group, iModelConnection, enabled)), [groups, iModelConnection, enabled]);\n\n const useQueriesHook = useQueries<TQueries>({ queries });\n\n const groupQueries = useMemoizedCollectionPick(useQueriesHook, [\"data\", \"isFetching\", \"isFetched\", \"refetch\"]);\n\n return { groupQueries };\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { IModelConnection } from "@itwin/core-frontend";
3
2
  export declare const useVisualization: (shouldVisualize: boolean, iModelConnection: IModelConnection, query: string, queryGenerationType: string) => {
4
3
  isRendering: boolean;
@@ -1,6 +1,7 @@
1
1
  import { toaster } from "@itwin/itwinui-react";
2
2
  import { Presentation } from "@itwin/presentation-frontend";
3
3
  import { useCallback, useEffect, useState } from "react";
4
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
4
5
  import { useGroupHilitedElementsContext } from "../../context/GroupHilitedElementsContext";
5
6
  import { visualizeGroupColors } from "../groupsHelpers";
6
7
  import { clearEmphasizedElements, clearOverriddenElements, transparentOverriddenElements, visualizeElementsByQuery, zoomToElements, } from "../../../common/viewerUtils";
@@ -45,7 +46,7 @@ export const useVisualization = (shouldVisualize, iModelConnection, query, query
45
46
  await zoomToElements(resolvedHiliteIds);
46
47
  }
47
48
  catch {
48
- toaster.negative("Sorry, we have failed to generate a valid query.");
49
+ toaster.negative(GroupingMappingWidget.translate("errors.invalidQuery"));
49
50
  }
50
51
  finally {
51
52
  setIsRendering(false);
@@ -1 +1 @@
1
- {"version":3,"file":"useVisualization.js","sourceRoot":"","sources":["../../../../../src/components/Groups/hooks/useVisualization.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,GACf,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,eAAwB,EAAE,gBAAkC,EAAE,KAAa,EAAE,mBAA2B,EAAE,EAAE;IAC3I,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/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,EAAE,eAAe,CAAC,CAAC,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,eAAe;YAAE,OAAO;QAC7B,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;YAC7B,IAAI;gBACF,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,EAAE;oBAC1B,OAAO;iBACR;gBACD,cAAc,CAAC,IAAI,CAAC,CAAC;gBACrB,6BAA6B,EAAE,CAAC;gBAChC,MAAM,iBAAiB,GAAG,MAAM,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;gBACzF,MAAM,cAAc,CAAC,iBAAiB,CAAC,CAAC;aACzC;YAAC,MAAM;gBACN,OAAO,CAAC,QAAQ,CAAC,kDAAkD,CAAC,CAAC;aACtE;oBAAS;gBACR,cAAc,CAAC,KAAK,CAAC,CAAC;aACvB;QACH,CAAC,CAAC;QAEF,KAAK,WAAW,EAAE,CAAC;IACrB,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;IAE/C,MAAM,0BAA0B,GAAG,WAAW,CAC5C,GAAG,EAAE,CAAC,eAAe,IAAI,YAAY,CAAC,SAAS,CAAC,cAAc,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,EACzG,CAAC,gBAAgB,EAAE,eAAe,CAAC,CACpC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,0BAA0B,EAAE,CAAC;IAC/B,CAAC,EAAE,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,SAAS,EAAE,CAAC;AAC/H,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport type { ISelectionProvider, SelectionChangeEventArgs } from \"@itwin/presentation-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { useGroupHilitedElementsContext } from \"../../context/GroupHilitedElementsContext\";\nimport { visualizeGroupColors } from \"../groupsHelpers\";\nimport {\n clearEmphasizedElements,\n clearOverriddenElements,\n transparentOverriddenElements,\n visualizeElementsByQuery,\n zoomToElements,\n} from \"../../../common/viewerUtils\";\n\nexport const useVisualization = (shouldVisualize: boolean, iModelConnection: IModelConnection, query: string, queryGenerationType: string) => {\n const [isRendering, setIsRendering] = useState<boolean>(false);\n const {\n showGroupColor,\n hiddenGroupsIds,\n overlappedElementsMetadata: { overlappedElementGroupPairs },\n setNumberOfVisualizedGroups,\n } = useGroupHilitedElementsContext();\n const [simpleSelectionQuery, setSimpleSelectionQuery] = useState<string>(\"\");\n\n const resetView = useCallback(async () => {\n if (!shouldVisualize) return;\n if (showGroupColor) {\n await visualizeGroupColors(hiddenGroupsIds, overlappedElementGroupPairs, setNumberOfVisualizedGroups);\n } else {\n clearOverriddenElements();\n }\n clearEmphasizedElements();\n }, [hiddenGroupsIds, overlappedElementGroupPairs, setNumberOfVisualizedGroups, shouldVisualize, showGroupColor]);\n\n useEffect(() => {\n if (!shouldVisualize) return;\n const removeListener = Presentation.selection.selectionChange.addListener(async (evt: SelectionChangeEventArgs, selectionProvider: ISelectionProvider) => {\n if (queryGenerationType === \"Selection\") {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const query = selection.instanceKeys.size > 0 ? `SELECT ECInstanceId FROM ${selection.instanceKeys.keys().next().value}` : \"\";\n setSimpleSelectionQuery(query);\n }\n });\n return removeListener;\n }, [iModelConnection, queryGenerationType, shouldVisualize]);\n\n useEffect(() => {\n if (!shouldVisualize) return;\n const reemphasize = async () => {\n try {\n if (!query || query === \"\") {\n return;\n }\n setIsRendering(true);\n transparentOverriddenElements();\n const resolvedHiliteIds = await visualizeElementsByQuery(query, \"red\", iModelConnection);\n await zoomToElements(resolvedHiliteIds);\n } catch {\n toaster.negative(\"Sorry, we have failed to generate a valid query.\");\n } finally {\n setIsRendering(false);\n }\n };\n\n void reemphasize();\n }, [iModelConnection, query, shouldVisualize]);\n\n const clearPresentationSelection = useCallback(\n () => shouldVisualize && Presentation.selection.clearSelection(\"GroupingMappingWidget\", iModelConnection),\n [iModelConnection, shouldVisualize],\n );\n\n useEffect(() => {\n clearPresentationSelection();\n }, [clearPresentationSelection, iModelConnection]);\n\n return { isRendering, setIsRendering, simpleSelectionQuery, setSimpleSelectionQuery, clearPresentationSelection, resetView };\n};\n"]}
1
+ {"version":3,"file":"useVisualization.js","sourceRoot":"","sources":["../../../../../src/components/Groups/hooks/useVisualization.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,GACf,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,eAAwB,EAAE,gBAAkC,EAAE,KAAa,EAAE,mBAA2B,EAAE,EAAE;IAC3I,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,EACJ,cAAc,EACd,eAAe,EACf,0BAA0B,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AAe,CAAC,CAAC,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,eAAe;YAAE,OAAO;QAC7B,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;YAC7B,IAAI,CAAC;gBACH,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;oBAC3B,OAAO;gBACT,CAAC;gBACD,cAAc,CAAC,IAAI,CAAC,CAAC;gBACrB,6BAA6B,EAAE,CAAC;gBAChC,MAAM,iBAAiB,GAAG,MAAM,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;gBACzF,MAAM,cAAc,CAAC,iBAAiB,CAAC,CAAC;YAC1C,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC;YAC3E,CAAC;oBAAS,CAAC;gBACT,cAAc,CAAC,KAAK,CAAC,CAAC;YACxB,CAAC;QACH,CAAC,CAAC;QAEF,KAAK,WAAW,EAAE,CAAC;IACrB,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;IAE/C,MAAM,0BAA0B,GAAG,WAAW,CAC5C,GAAG,EAAE,CAAC,eAAe,IAAI,YAAY,CAAC,SAAS,CAAC,cAAc,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,EACzG,CAAC,gBAAgB,EAAE,eAAe,CAAC,CACpC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,0BAA0B,EAAE,CAAC;IAC/B,CAAC,EAAE,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,SAAS,EAAE,CAAC;AAC/H,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport type { ISelectionProvider, SelectionChangeEventArgs } from \"@itwin/presentation-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport { useGroupHilitedElementsContext } from \"../../context/GroupHilitedElementsContext\";\nimport { visualizeGroupColors } from \"../groupsHelpers\";\nimport {\n clearEmphasizedElements,\n clearOverriddenElements,\n transparentOverriddenElements,\n visualizeElementsByQuery,\n zoomToElements,\n} from \"../../../common/viewerUtils\";\n\nexport const useVisualization = (shouldVisualize: boolean, iModelConnection: IModelConnection, query: string, queryGenerationType: string) => {\n const [isRendering, setIsRendering] = useState<boolean>(false);\n const {\n showGroupColor,\n hiddenGroupsIds,\n overlappedElementsMetadata: { overlappedElementGroupPairs },\n setNumberOfVisualizedGroups,\n } = useGroupHilitedElementsContext();\n const [simpleSelectionQuery, setSimpleSelectionQuery] = useState<string>(\"\");\n\n const resetView = useCallback(async () => {\n if (!shouldVisualize) return;\n if (showGroupColor) {\n await visualizeGroupColors(hiddenGroupsIds, overlappedElementGroupPairs, setNumberOfVisualizedGroups);\n } else {\n clearOverriddenElements();\n }\n clearEmphasizedElements();\n }, [hiddenGroupsIds, overlappedElementGroupPairs, setNumberOfVisualizedGroups, shouldVisualize, showGroupColor]);\n\n useEffect(() => {\n if (!shouldVisualize) return;\n const removeListener = Presentation.selection.selectionChange.addListener(async (evt: SelectionChangeEventArgs, selectionProvider: ISelectionProvider) => {\n if (queryGenerationType === \"Selection\") {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const query = selection.instanceKeys.size > 0 ? `SELECT ECInstanceId FROM ${selection.instanceKeys.keys().next().value}` : \"\";\n setSimpleSelectionQuery(query);\n }\n });\n return removeListener;\n }, [iModelConnection, queryGenerationType, shouldVisualize]);\n\n useEffect(() => {\n if (!shouldVisualize) return;\n const reemphasize = async () => {\n try {\n if (!query || query === \"\") {\n return;\n }\n setIsRendering(true);\n transparentOverriddenElements();\n const resolvedHiliteIds = await visualizeElementsByQuery(query, \"red\", iModelConnection);\n await zoomToElements(resolvedHiliteIds);\n } catch {\n toaster.negative(GroupingMappingWidget.translate(\"errors.invalidQuery\"));\n } finally {\n setIsRendering(false);\n }\n };\n\n void reemphasize();\n }, [iModelConnection, query, shouldVisualize]);\n\n const clearPresentationSelection = useCallback(\n () => shouldVisualize && Presentation.selection.clearSelection(\"GroupingMappingWidget\", iModelConnection),\n [iModelConnection, shouldVisualize],\n );\n\n useEffect(() => {\n clearPresentationSelection();\n }, [clearPresentationSelection, iModelConnection]);\n\n return { isRendering, setIsRendering, simpleSelectionQuery, setSimpleSelectionQuery, clearPresentationSelection, resetView };\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./BlockingOverlay.scss";
3
2
  export interface BlockingOverlayProps {
4
3
  isVisible: boolean;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import "./MappingAction.scss";
3
2
  import type { Mapping } from "@itwin/insights-client";
4
- declare const defaultDisplayStrings: {
3
+ declare const getDefaultDisplayStrings: () => {
5
4
  mappingDetails: string;
6
5
  };
7
6
  /**
@@ -12,7 +11,7 @@ export interface MappingActionProps {
12
11
  mapping?: Mapping;
13
12
  onSaveSuccess: () => void;
14
13
  onClickCancel?: () => void;
15
- displayStrings?: Partial<typeof defaultDisplayStrings>;
14
+ displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;
16
15
  }
17
16
  /**
18
17
  * Component to create or update a mapping.
@@ -4,6 +4,7 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { Fieldset, LabeledInput, Text, ToggleSwitch } from "@itwin/itwinui-react";
6
6
  import React, { useState } from "react";
7
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
7
8
  import ActionPanel from "../../SharedComponents/ActionPanel";
8
9
  import useValidator, { NAME_REQUIREMENTS } from "../../Properties/hooks/useValidator";
9
10
  import "./MappingAction.scss";
@@ -11,9 +12,9 @@ import { useMappingClient } from "../../context/MappingClientContext";
11
12
  import { useGroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
12
13
  import { handleInputChange } from "../../../common/utils";
13
14
  import { useMutation, useQueryClient } from "@tanstack/react-query";
14
- const defaultDisplayStrings = {
15
- mappingDetails: "Mapping Details",
16
- };
15
+ const getDefaultDisplayStrings = () => ({
16
+ mappingDetails: GroupingMappingWidget.translate("mappings.mappingDetails"),
17
+ });
17
18
  /**
18
19
  * Component to create or update a mapping.
19
20
  * @public
@@ -28,7 +29,7 @@ export const MappingAction = ({ mapping, onSaveSuccess, onClickCancel, displaySt
28
29
  });
29
30
  const [validator, showValidationMessage] = useValidator();
30
31
  const queryClient = useQueryClient();
31
- const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
32
+ const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);
32
33
  const { mutate: saveMutation, isLoading } = useMutation({
33
34
  mutationFn: async (newMapping) => {
34
35
  const accessToken = await getAccessToken();
@@ -54,8 +55,8 @@ export const MappingAction = ({ mapping, onSaveSuccess, onClickCancel, displaySt
54
55
  return (React.createElement(React.Fragment, null,
55
56
  React.createElement("div", { className: "gmw-details-form-container" },
56
57
  React.createElement(Fieldset, { legend: displayStrings.mappingDetails, className: "gmw-details-form" },
57
- React.createElement(Text, { variant: "small", as: "small", className: "gmw-field-legend" }, "Asterisk * indicates mandatory fields."),
58
- React.createElement(LabeledInput, { id: "name", name: "name", label: "Name", value: values.name, required: true, onChange: (event) => {
58
+ React.createElement(Text, { variant: "small", as: "small", className: "gmw-field-legend" }, GroupingMappingWidget.translate("common.mandatoryFields")),
59
+ React.createElement(LabeledInput, { id: "name", name: "name", label: GroupingMappingWidget.translate("common.name"), value: values.name, required: true, onChange: (event) => {
59
60
  handleInputChange(event, values, setValues);
60
61
  validator.showMessageFor("name");
61
62
  }, message: validator.message("name", values.name, NAME_REQUIREMENTS), status: validator.message("name", values.name, NAME_REQUIREMENTS) ? "negative" : undefined, onBlur: () => {
@@ -64,10 +65,10 @@ export const MappingAction = ({ mapping, onSaveSuccess, onClickCancel, displaySt
64
65
  handleInputChange(event, values, setValues);
65
66
  validator.showMessageFor("name");
66
67
  } }),
67
- React.createElement(LabeledInput, { id: "description", name: "description", label: "Description", value: values.description, onChange: (event) => {
68
+ React.createElement(LabeledInput, { id: "description", name: "description", label: GroupingMappingWidget.translate("common.description"), value: values.description, onChange: (event) => {
68
69
  handleInputChange(event, values, setValues);
69
70
  } }),
70
- React.createElement(ToggleSwitch, { id: "extractionEnabled", name: "extractionEnabled", label: "Extract data from iModel", labelPosition: "right", checked: values.extractionEnabled, onChange: (event) => {
71
+ React.createElement(ToggleSwitch, { id: "extractionEnabled", name: "extractionEnabled", label: GroupingMappingWidget.translate("mappings.extractDataFromIModel"), labelPosition: "right", checked: values.extractionEnabled, onChange: (event) => {
71
72
  setValues({ ...values, extractionEnabled: event.currentTarget.checked });
72
73
  } }))),
73
74
  React.createElement(ActionPanel, { onSave: onSave, onCancel: onClickCancel, isSavingDisabled: !values.name, isLoading: isLoading })));
@@ -1 +1 @@
1
- {"version":3,"file":"MappingAction.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Editing/MappingAction.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAC7D,OAAO,YAAY,EAAE,EAAE,iBAAiB,EAAE,MAAM,q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C,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAC7G,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { Fieldset, LabeledInput, Text, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../../Properties/hooks/useValidator\";\nimport \"./MappingAction.scss\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport type { Mapping, MappingCreate } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { handleInputChange } from \"../../../common/utils\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\n\nconst defaultDisplayStrings = {\n mappingDetails: \"Mapping Details\",\n};\n\n/**\n * Props for the {@link MappingAction} component.\n * @public\n */\nexport interface MappingActionProps {\n mapping?: Mapping;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\n/**\n * Component to create or update a mapping.\n * @public\n */\nexport const MappingAction = ({ mapping, onSaveSuccess, onClickCancel, displayStrings: userDisplayStrings }: MappingActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [values, setValues] = useState({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n extractionEnabled: mapping?.extractionEnabled ?? true,\n });\n const [validator, showValidationMessage] = useValidator();\n const queryClient = useQueryClient();\n\n const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);\n\n const { mutate: saveMutation, isLoading } = useMutation({\n mutationFn: async (newMapping: MappingCreate) => {\n const accessToken = await getAccessToken();\n return mapping ? mappingClient.updateMapping(accessToken, mapping.id, newMapping) : mappingClient.createMapping(accessToken, newMapping);\n },\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"mappings\"] });\n onSaveSuccess();\n },\n });\n\n const onSave = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n saveMutation({\n iModelId,\n mappingName: values.name,\n description: values.description,\n extractionEnabled: values.extractionEnabled,\n });\n };\n\n return (\n <>\n <div className=\"gmw-details-form-container\">\n <Fieldset legend={displayStrings.mappingDetails} className=\"gmw-details-form\">\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n Asterisk * indicates mandatory fields.\n </Text>\n <LabeledInput\n id=\"name\"\n name=\"name\"\n label=\"Name\"\n value={values.name}\n required\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", values.name, NAME_REQUIREMENTS)}\n status={validator.message(\"name\", values.name, NAME_REQUIREMENTS) ? \"negative\" : undefined}\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledInput\n id=\"description\"\n name=\"description\"\n label=\"Description\"\n value={values.description}\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n }}\n />\n <ToggleSwitch\n id=\"extractionEnabled\"\n name=\"extractionEnabled\"\n label=\"Extract data from iModel\"\n labelPosition=\"right\"\n checked={values.extractionEnabled}\n onChange={(event) => {\n setValues({ ...values, extractionEnabled: event.currentTarget.checked });\n }}\n />\n </Fieldset>\n </div>\n <ActionPanel onSave={onSave} onCancel={onClickCancel} isSavingDisabled={!values.name} isLoading={isLoading} />\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"MappingAction.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Editing/MappingAction.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IA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ACD;gBACF,oBAAC,YAAY,IACX,EAAE,EAAC,mBAAmB,EACtB,IAAI,EAAC,mBAAmB,EACxB,KAAK,EAAE,qBAAqB,CAAC,SAAS,CAAC,gCAAgC,CAAC,EACxE,aAAa,EAAC,OAAO,EACrB,OAAO,EAAE,MAAM,CAAC,iBAAiB,EACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;wBAClB,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;oBAC3E,CAAC,GACD,CACO,CACP;QACN,oBAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAC7G,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { Fieldset, LabeledInput, Text, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport ActionPanel from \"../../SharedComponents/ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../../Properties/hooks/useValidator\";\nimport \"./MappingAction.scss\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport type { Mapping, MappingCreate } from \"@itwin/insights-client\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { handleInputChange } from \"../../../common/utils\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\n\nconst getDefaultDisplayStrings = () => ({\n mappingDetails: GroupingMappingWidget.translate(\"mappings.mappingDetails\"),\n});\n\n/**\n * Props for the {@link MappingAction} component.\n * @public\n */\nexport interface MappingActionProps {\n mapping?: Mapping;\n onSaveSuccess: () => void;\n onClickCancel?: () => void;\n displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;\n}\n\n/**\n * Component to create or update a mapping.\n * @public\n */\nexport const MappingAction = ({ mapping, onSaveSuccess, onClickCancel, displayStrings: userDisplayStrings }: MappingActionProps) => {\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [values, setValues] = useState({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n extractionEnabled: mapping?.extractionEnabled ?? true,\n });\n const [validator, showValidationMessage] = useValidator();\n const queryClient = useQueryClient();\n\n const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n\n const { mutate: saveMutation, isLoading } = useMutation({\n mutationFn: async (newMapping: MappingCreate) => {\n const accessToken = await getAccessToken();\n return mapping ? mappingClient.updateMapping(accessToken, mapping.id, newMapping) : mappingClient.createMapping(accessToken, newMapping);\n },\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"mappings\"] });\n onSaveSuccess();\n },\n });\n\n const onSave = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n saveMutation({\n iModelId,\n mappingName: values.name,\n description: values.description,\n extractionEnabled: values.extractionEnabled,\n });\n };\n\n return (\n <>\n <div className=\"gmw-details-form-container\">\n <Fieldset legend={displayStrings.mappingDetails} className=\"gmw-details-form\">\n <Text variant=\"small\" as=\"small\" className=\"gmw-field-legend\">\n {GroupingMappingWidget.translate(\"common.mandatoryFields\")}\n </Text>\n <LabeledInput\n id=\"name\"\n name=\"name\"\n label={GroupingMappingWidget.translate(\"common.name\")}\n value={values.name}\n required\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", values.name, NAME_REQUIREMENTS)}\n status={validator.message(\"name\", values.name, NAME_REQUIREMENTS) ? \"negative\" : undefined}\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledInput\n id=\"description\"\n name=\"description\"\n label={GroupingMappingWidget.translate(\"common.description\")}\n value={values.description}\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n }}\n />\n <ToggleSwitch\n id=\"extractionEnabled\"\n name=\"extractionEnabled\"\n label={GroupingMappingWidget.translate(\"mappings.extractDataFromIModel\")}\n labelPosition=\"right\"\n checked={values.extractionEnabled}\n onChange={(event) => {\n setValues({ ...values, extractionEnabled: event.currentTarget.checked });\n }}\n />\n </Fieldset>\n </div>\n <ActionPanel onSave={onSave} onCancel={onClickCancel} isSavingDisabled={!values.name} isLoading={isLoading} />\n </>\n );\n};\n"]}
@@ -1,19 +1,30 @@
1
1
  import { BaseFilter, FilterButtonBar, InputGroup, Radio } from "@itwin/itwinui-react";
2
2
  import React, { useMemo, useState } from "react";
3
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
3
4
  export function ExtractionLogCustomFilter({ column, clearFilter, setFilter }) {
4
5
  const [value, setValue] = useState(column.filterValue);
5
6
  const translatedLabels = useMemo(() => ({
6
- filter: "Filter",
7
- clear: "Clear",
7
+ filter: GroupingMappingWidget.translate("extraction.filter"),
8
+ clear: GroupingMappingWidget.translate("common.clear"),
8
9
  }), []);
9
10
  const filterOptionList = useMemo(() => {
10
- if (column.Header === "Category") {
11
- return ["GroupQuery", "NoMatchesForECProperties", "QueryTranslation", "QueryExecution"];
11
+ if (column.id === "category") {
12
+ return [
13
+ { value: "GroupQuery", label: "GroupQuery" },
14
+ { value: "NoMatchesForECProperties", label: "NoMatchesForECProperties" },
15
+ { value: "QueryTranslation", label: "QueryTranslation" },
16
+ { value: "QueryExecution", label: "QueryExecution" },
17
+ ];
12
18
  }
13
- return ["Info", "Warning", "Error", "Trace"];
19
+ return [
20
+ { value: "Info", label: GroupingMappingWidget.translate("extraction.info") },
21
+ { value: "Warning", label: GroupingMappingWidget.translate("extraction.warning") },
22
+ { value: "Error", label: GroupingMappingWidget.translate("extraction.error") },
23
+ { value: "Trace", label: GroupingMappingWidget.translate("extraction.trace") },
24
+ ];
14
25
  }, [column]);
15
26
  return (React.createElement(BaseFilter, null,
16
- React.createElement(InputGroup, { displayStyle: "default" }, filterOptionList.map((option, id) => (React.createElement(Radio, { name: "filterOption", key: id, label: option, defaultChecked: option === value, onChange: () => setValue(option) })))),
27
+ React.createElement(InputGroup, { displayStyle: "default" }, filterOptionList.map((option, id) => (React.createElement(Radio, { name: "filterOption", key: id, label: option.label, defaultChecked: option.value === value, onChange: () => setValue(option.value) })))),
17
28
  React.createElement(FilterButtonBar, { setFilter: () => setFilter(value), clearFilter: clearFilter, translatedLabels: translatedLabels })));
18
29
  }
19
30
  //# sourceMappingURL=ExtractionLogCustomFilter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExtractionLogCustomFilter.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Extraction/ExtractionLogCustomFilter.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,UAAU,yBAAyB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAA6C;IACrH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,MAAM,CAAC,WAAiC,CAAC,CAAC;IACjG,MAAM,gBAAgB,GAAG,OAAO,CAC9B,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,OAAO;KACf,CAAC,EACF,EAAE,CACH,CAAC;IACF,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE;QACpC,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE;YAChC,OAAO,CAAC,YAAY,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;SACzF;QACD,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACb,OAAO,CACL,oBAAC,UAAU;QACT,oBAAC,UAAU,IAAC,YAAY,EAAC,SAAS,IAC/B,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CACpC,oBAAC,KAAK,IAAC,IAAI,EAAC,cAAc,EAAC,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAI,CAC1H,CAAC,CACS;QACb,oBAAC,eAAe,IAAC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,GAAI,CACzG,CACd,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { TableFilterProps } from \"@itwin/itwinui-react\";\nimport { BaseFilter, FilterButtonBar, InputGroup, Radio } from \"@itwin/itwinui-react\";\nimport React, { useMemo, useState } from \"react\";\n\nexport function ExtractionLogCustomFilter({ column, clearFilter, setFilter }: TableFilterProps<Record<string, unknown>>): React.ReactElement {\n const [value, setValue] = useState<string | undefined>(column.filterValue as string | undefined);\n const translatedLabels = useMemo(\n () => ({\n filter: \"Filter\",\n clear: \"Clear\",\n }),\n [],\n );\n const filterOptionList = useMemo(() => {\n if (column.Header === \"Category\") {\n return [\"GroupQuery\", \"NoMatchesForECProperties\", \"QueryTranslation\", \"QueryExecution\"];\n }\n return [\"Info\", \"Warning\", \"Error\", \"Trace\"];\n }, [column]);\n return (\n <BaseFilter>\n <InputGroup displayStyle=\"default\">\n {filterOptionList.map((option, id) => (\n <Radio name=\"filterOption\" key={id} label={option} defaultChecked={option === value} onChange={() => setValue(option)} />\n ))}\n </InputGroup>\n <FilterButtonBar setFilter={() => setFilter(value)} clearFilter={clearFilter} translatedLabels={translatedLabels} />\n </BaseFilter>\n );\n}\n"]}
1
+ {"version":3,"file":"ExtractionLogCustomFilter.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Extraction/ExtractionLogCustomFilter.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,UAAU,yBAAyB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAA6C;IACrH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,MAAM,CAAC,WAAiC,CAAC,CAAC;IACjG,MAAM,gBAAgB,GAAG,OAAO,CAC9B,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,qBAAqB,CAAC,SAAS,CAAC,mBAAmB,CAAC;QAC5D,KAAK,EAAE,qBAAqB,CAAC,SAAS,CAAC,cAAc,CAAC;KACvD,CAAC,EACF,EAAE,CACH,CAAC;IACF,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE;QACpC,IAAI,MAAM,CAAC,EAAE,KAAK,UAAU,EAAE,CAAC;YAC7B,OAAO;gBACL,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;gBAC5C,EAAE,KAAK,EAAE,0BAA0B,EAAE,KA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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 { TableFilterProps } from \"@itwin/itwinui-react\";\nimport { BaseFilter, FilterButtonBar, InputGroup, Radio } from \"@itwin/itwinui-react\";\nimport React, { useMemo, useState } from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\n\nexport function ExtractionLogCustomFilter({ column, clearFilter, setFilter }: TableFilterProps<Record<string, unknown>>): React.ReactElement {\n const [value, setValue] = useState<string | undefined>(column.filterValue as string | undefined);\n const translatedLabels = useMemo(\n () => ({\n filter: GroupingMappingWidget.translate(\"extraction.filter\"),\n clear: GroupingMappingWidget.translate(\"common.clear\"),\n }),\n [],\n );\n const filterOptionList = useMemo(() => {\n if (column.id === \"category\") {\n return [\n { value: \"GroupQuery\", label: \"GroupQuery\" },\n { value: \"NoMatchesForECProperties\", label: \"NoMatchesForECProperties\" },\n { value: \"QueryTranslation\", label: \"QueryTranslation\" },\n { value: \"QueryExecution\", label: \"QueryExecution\" },\n ];\n }\n return [\n { value: \"Info\", label: GroupingMappingWidget.translate(\"extraction.info\") },\n { value: \"Warning\", label: GroupingMappingWidget.translate(\"extraction.warning\") },\n { value: \"Error\", label: GroupingMappingWidget.translate(\"extraction.error\") },\n { value: \"Trace\", label: GroupingMappingWidget.translate(\"extraction.trace\") },\n ];\n }, [column]);\n return (\n <BaseFilter>\n <InputGroup displayStyle=\"default\">\n {filterOptionList.map((option, id) => (\n <Radio name=\"filterOption\" key={id} label={option.label} defaultChecked={option.value === value} onChange={() => setValue(option.value)} />\n ))}\n </InputGroup>\n <FilterButtonBar setFilter={() => setFilter(value)} clearFilter={clearFilter} translatedLabels={translatedLabels} />\n </BaseFilter>\n );\n}\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ExtractionMessageModal.scss";
3
2
  export interface ExtractionMessageData {
4
3
  date: string;