@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,6 +1,6 @@
1
- import { Stepper } from "@itwin/itwinui-react";
2
- import { Modal } from "@itwin/itwinui-react";
1
+ import { Modal, Stepper } from "@itwin/itwinui-react";
3
2
  import React, { useEffect, useRef, useState } from "react";
3
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
4
4
  import ConfirmMappingImport from "./ConfirmMappingsImport";
5
5
  import "./MappingImportWizardModal.scss";
6
6
  import SelectIModel from "./SelectIModel";
@@ -9,16 +9,16 @@ import SelectMappings from "./SelectMappings";
9
9
  import { useGroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
10
10
  import { createIModelsClient, IModelsClientContext } from "../../context/IModelsClientContext";
11
11
  import { createITwinsClient, ITwinsClientContext } from "../../context/ITwinsClientContext";
12
- const defaultDisplayStrings = {
13
- mappings: "Mappings",
12
+ const getDefaultDisplayStrings = () => ({
13
+ mappings: GroupingMappingWidget.translate("mappings.mappings"),
14
14
  iTwins: "iTwins",
15
- iTwinNumber: "Number",
16
- iTwinName: "Name",
17
- iTwinStatus: "Status",
15
+ iTwinNumber: GroupingMappingWidget.translate("common.number"),
16
+ iTwinName: GroupingMappingWidget.translate("common.name"),
17
+ iTwinStatus: GroupingMappingWidget.translate("common.status"),
18
18
  iModels: "iModels",
19
- iModelName: "Name",
20
- iModelDescription: "Description",
21
- };
19
+ iModelName: GroupingMappingWidget.translate("common.name"),
20
+ iModelDescription: GroupingMappingWidget.translate("common.description"),
21
+ });
22
22
  export const MappingImportWizardModal = ({ show, setShow, onFinish, displayStrings: userDisplayStrings }) => {
23
23
  const { prefix } = useGroupingMappingApiConfig();
24
24
  const [currentStep, setCurrentStep] = useState(0);
@@ -33,23 +33,23 @@ export const MappingImportWizardModal = ({ show, setShow, onFinish, displayStrin
33
33
  setITwinsClient(createITwinsClient(prefix));
34
34
  setIModelsClient(createIModelsClient(prefix));
35
35
  }, [prefix]);
36
- const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
36
+ const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);
37
37
  const steps = useRef([
38
38
  {
39
- name: "Select iTwin",
40
- description: `Select the source iTwin to bring your ${displayStrings.mappings} from.`,
39
+ name: GroupingMappingWidget.translate("import.selectITwin"),
40
+ description: GroupingMappingWidget.translate("import.selectITwinDescription", { mappings: displayStrings.mappings }),
41
41
  },
42
42
  {
43
- name: "Select iModel",
44
- description: "Select an iModel within the iTwin you have selected.",
43
+ name: GroupingMappingWidget.translate("import.selectIModel"),
44
+ description: GroupingMappingWidget.translate("import.selectIModelDescription"),
45
45
  },
46
46
  {
47
- name: `Select ${displayStrings.mappings}`,
48
- description: `Select one or more ${displayStrings.mappings} to import.`,
47
+ name: GroupingMappingWidget.translate("import.selectMappings", { mappings: displayStrings.mappings }),
48
+ description: GroupingMappingWidget.translate("import.selectMappingsDescription", { mappings: displayStrings.mappings }),
49
49
  },
50
50
  {
51
- name: "Rename & Confirm",
52
- description: "Rename and confirm your selections. Click import when finished.",
51
+ name: GroupingMappingWidget.translate("import.renameAndConfirm"),
52
+ description: GroupingMappingWidget.translate("import.renameAndConfirmDescription"),
53
53
  },
54
54
  ]);
55
55
  const onClose = async () => {
@@ -57,7 +57,7 @@ export const MappingImportWizardModal = ({ show, setShow, onFinish, displayStrin
57
57
  setCurrentStep(0);
58
58
  await onFinish();
59
59
  };
60
- return (React.createElement(Modal, { title: `Import ${displayStrings.mappings}`, modalRootId: "grouping-mapping-widget", isOpen: show, closeOnEsc: false, closeOnExternalClick: false, isDismissible: !importing, styleType: "fullPage", onClose: async () => {
60
+ return (React.createElement(Modal, { title: GroupingMappingWidget.translate("mappings.importMappings", { mappings: displayStrings.mappings }), modalRootId: "grouping-mapping-widget", isOpen: show, closeOnEsc: false, closeOnExternalClick: false, isDismissible: !importing, styleType: "fullPage", onClose: async () => {
61
61
  await onClose();
62
62
  } },
63
63
  React.createElement("div", { className: "gmw-import-wizard-body-container" },
@@ -1 +1 @@
1
- {"version":3,"file":"MappingImportWizardModal.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Import/MappingImportWizardModal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,OAAO,iCAAiC,CAAC;AACzC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,WAAW,EAAE,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE5F,MAAM,qBAAqB,GAAG;IAC5B,QAAQ,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,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,CAAC,gBAAgB,EAAE,EAAE;wCAC7B,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;wCACtC,cAAc,CAAC,CAAC,CAAC,CAAC;oCACpB,CAAC,EACD,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,cAAc,EAAE,cAAc,GAC9B,CACE;4BACL,WAAW,KAAK,CAAC,IAAI,CACpB,oBAAC,oBAAoB,IACnB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,cAAc,GAC9B,CACH,CACA,CACJ,CAAC;oBACJ;wBACE,OAAO,IAAI,CAAC;iBACf;YACH,CAAC,CAAC,EAAE,CACA,CACA,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { IModelsClient } from \"@itwin/imodels-client-management\";\nimport type { ITwinsAccessClient } from \"@itwin/itwins-client\";\nimport type { StepProperties } from \"@itwin/itwinui-react\";\nimport { Stepper } from \"@itwin/itwinui-react\";\nimport { Modal } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport ConfirmMappingImport from \"./ConfirmMappingsImport\";\nimport type { IMappingTyped } from \"../Mappings\";\nimport \"./MappingImportWizardModal.scss\";\nimport SelectIModel from \"./SelectIModel\";\nimport SelectITwin, { ITwinType } from \"./SelectITwin\";\nimport SelectMappings from \"./SelectMappings\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { createIModelsClient, IModelsClientContext } from \"../../context/IModelsClientContext\";\nimport { createITwinsClient, ITwinsClientContext } from \"../../context/ITwinsClientContext\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n iTwins: \"iTwins\",\n iTwinNumber: \"Number\",\n iTwinName: \"Name\",\n iTwinStatus: \"Status\",\n iModels: \"iModels\",\n iModelName: \"Name\",\n iModelDescription: \"Description\",\n};\ninterface MappingImportWizardModalProps {\n show: boolean;\n setShow: (show: boolean) => void;\n onFinish: () => Promise<void>;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const MappingImportWizardModal = ({ show, setShow, onFinish, displayStrings: userDisplayStrings }: MappingImportWizardModalProps) => {\n const { prefix } = useGroupingMappingApiConfig();\n const [currentStep, setCurrentStep] = useState<number>(0);\n const [iTwinType, setITwinType] = useState<ITwinType>(ITwinType.Favorite);\n const [selectedITwinId, setSelectedITwinId] = useState<string>(\"\");\n const [selectedIModelId, setSelectedIModelId] = useState<string>(\"\");\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [importing, setImporting] = useState<boolean>(false);\n const [iTwinsClient, setITwinsClient] = useState<ITwinsAccessClient>(createITwinsClient(prefix));\n const [iModelsClient, setIModelsClient] = useState<IModelsClient>(createIModelsClient(prefix));\n\n useEffect(() => {\n setITwinsClient(createITwinsClient(prefix));\n setIModelsClient(createIModelsClient(prefix));\n }, [prefix]);\n\n const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);\n\n const steps = useRef<StepProperties[]>([\n {\n name: \"Select iTwin\",\n description: `Select the source iTwin to bring your ${displayStrings.mappings} from.`,\n },\n {\n name: \"Select iModel\",\n description: \"Select an iModel within the iTwin you have selected.\",\n },\n {\n name: `Select ${displayStrings.mappings}`,\n description: `Select one or more ${displayStrings.mappings} to import.`,\n },\n {\n name: \"Rename & Confirm\",\n description: \"Rename and confirm your selections. Click import when finished.\",\n },\n ]);\n\n const onClose = async () => {\n setShow(false);\n setCurrentStep(0);\n await onFinish();\n };\n\n return (\n <Modal\n title={`Import ${displayStrings.mappings}`}\n modalRootId=\"grouping-mapping-widget\"\n isOpen={show}\n closeOnEsc={false}\n closeOnExternalClick={false}\n isDismissible={!importing}\n styleType=\"fullPage\"\n onClose={async () => {\n await onClose();\n }}\n >\n <div className=\"gmw-import-wizard-body-container\">\n <Stepper currentStep={currentStep} steps={steps.current} onStepClick={importing ? undefined : (index: number) => setCurrentStep(index)} />\n\n {(() => {\n switch (currentStep) {\n case 0:\n return (\n <ITwinsClientContext.Provider value={iTwinsClient}>\n <div className=\"gmw-table-container\">\n <SelectITwin\n onSelect={(iTwinId) => {\n setSelectedITwinId(iTwinId);\n setCurrentStep(1);\n }}\n onCancel={onClose}\n onChangeITwinType={setITwinType}\n displayStrings={displayStrings}\n defaultITwinType={iTwinType}\n />\n </div>\n </ITwinsClientContext.Provider>\n );\n case 1:\n return (\n <IModelsClientContext.Provider value={iModelsClient}>\n <div className=\"gmw-table-container\">\n <SelectIModel\n iTwinId={selectedITwinId}\n onSelect={(iModelId) => {\n setSelectedIModelId(iModelId);\n setCurrentStep(2);\n }}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n />\n </div>\n </IModelsClientContext.Provider>\n );\n case 2:\n case 3:\n // Preserve table state within Select Mappings\n return (\n <>\n <div style={{ display: currentStep === 2 ? \"flex\" : \"none\" }} className=\"gmw-mapping-container\">\n <SelectMappings\n iModelId={selectedIModelId}\n onSelect={(selectedMappings) => {\n setSelectedMappings(selectedMappings);\n setCurrentStep(3);\n }}\n onCancel={onClose}\n backFn={() => setCurrentStep(currentStep - 1)}\n displayStrings={displayStrings}\n />\n </div>\n {currentStep === 3 && (\n <ConfirmMappingImport\n selectedMappings={selectedMappings}\n importing={importing}\n setImporting={setImporting}\n setSelectedMappings={setSelectedMappings}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n onFinish={onClose}\n displayStrings={displayStrings}\n />\n )}\n </>\n );\n default:\n return null;\n }\n })()}\n </div>\n </Modal>\n );\n};\n"]}
1
+ {"version":3,"file":"MappingImportWizardModal.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Import/MappingImportWizardModal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAG,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,OAAO,iCAAiC,CAAC;AACzC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,WAAW,EAAE,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE5F,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAAC,CAAC;IACtC,QAAQ,EAAE,qBAAqB,CAAC,SAAS,CAAC,mBAAmB,CAAC;IAC9D,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,qBAAqB,CAAC,SAAS,CAAC,eAAe,CAAC;IAC7D,SAAS,EAAE,qBAAqB,CAAC,SAAS,CAAC,aAAa,CAAC;IACzD,WAAW,EAAE,qBAAqB,CAAC,SAAS,CAAC,eAAe,CAAC;IAC7D,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,qBAAqB,CAAC,SAAS,CAAC,aAAa,CAAC;IAC1D,iBAAiB,EAA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jB,CACE,CACwB,CACjC,CAAC;oBACJ,KAAK,CAAC,CAAC;oBACP,KAAK,CAAC;wBACJ,8CAA8C;wBAC9C,OAAO,CACL;4BACE,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAC,uBAAuB;gCAC7F,oBAAC,cAAc,IACb,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,CAAC,gBAAgB,EAAE,EAAE;wCAC7B,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;wCACtC,cAAc,CAAC,CAAC,CAAC,CAAC;oCACpB,CAAC,EACD,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,cAAc,EAAE,cAAc,GAC9B,CACE;4BACL,WAAW,KAAK,CAAC,IAAI,CACpB,oBAAC,oBAAoB,IACnB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,EAC7C,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,cAAc,GAC9B,CACH,CACA,CACJ,CAAC;oBACJ;wBACE,OAAO,IAAI,CAAC;gBAChB,CAAC;YACH,CAAC,CAAC,EAAE,CACA,CACA,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { IModelsClient } from \"@itwin/imodels-client-management\";\nimport type { ITwinsAccessClient } from \"@itwin/itwins-client\";\nimport type { StepProperties } from \"@itwin/itwinui-react\";\nimport { Modal , Stepper } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport ConfirmMappingImport from \"./ConfirmMappingsImport\";\nimport type { IMappingTyped } from \"../Mappings\";\nimport \"./MappingImportWizardModal.scss\";\nimport SelectIModel from \"./SelectIModel\";\nimport SelectITwin, { ITwinType } from \"./SelectITwin\";\nimport SelectMappings from \"./SelectMappings\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { createIModelsClient, IModelsClientContext } from \"../../context/IModelsClientContext\";\nimport { createITwinsClient, ITwinsClientContext } from \"../../context/ITwinsClientContext\";\n\nconst getDefaultDisplayStrings = () => ({\n mappings: GroupingMappingWidget.translate(\"mappings.mappings\"),\n iTwins: \"iTwins\",\n iTwinNumber: GroupingMappingWidget.translate(\"common.number\"),\n iTwinName: GroupingMappingWidget.translate(\"common.name\"),\n iTwinStatus: GroupingMappingWidget.translate(\"common.status\"),\n iModels: \"iModels\",\n iModelName: GroupingMappingWidget.translate(\"common.name\"),\n iModelDescription: GroupingMappingWidget.translate(\"common.description\"),\n});\ninterface MappingImportWizardModalProps {\n show: boolean;\n setShow: (show: boolean) => void;\n onFinish: () => Promise<void>;\n displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;\n}\n\nexport const MappingImportWizardModal = ({ show, setShow, onFinish, displayStrings: userDisplayStrings }: MappingImportWizardModalProps) => {\n const { prefix } = useGroupingMappingApiConfig();\n const [currentStep, setCurrentStep] = useState<number>(0);\n const [iTwinType, setITwinType] = useState<ITwinType>(ITwinType.Favorite);\n const [selectedITwinId, setSelectedITwinId] = useState<string>(\"\");\n const [selectedIModelId, setSelectedIModelId] = useState<string>(\"\");\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [importing, setImporting] = useState<boolean>(false);\n const [iTwinsClient, setITwinsClient] = useState<ITwinsAccessClient>(createITwinsClient(prefix));\n const [iModelsClient, setIModelsClient] = useState<IModelsClient>(createIModelsClient(prefix));\n\n useEffect(() => {\n setITwinsClient(createITwinsClient(prefix));\n setIModelsClient(createIModelsClient(prefix));\n }, [prefix]);\n\n const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n\n const steps = useRef<StepProperties[]>([\n {\n name: GroupingMappingWidget.translate(\"import.selectITwin\"),\n description: GroupingMappingWidget.translate(\"import.selectITwinDescription\", { mappings: displayStrings.mappings }),\n },\n {\n name: GroupingMappingWidget.translate(\"import.selectIModel\"),\n description: GroupingMappingWidget.translate(\"import.selectIModelDescription\"),\n },\n {\n name: GroupingMappingWidget.translate(\"import.selectMappings\", { mappings: displayStrings.mappings }),\n description: GroupingMappingWidget.translate(\"import.selectMappingsDescription\", { mappings: displayStrings.mappings }),\n },\n {\n name: GroupingMappingWidget.translate(\"import.renameAndConfirm\"),\n description: GroupingMappingWidget.translate(\"import.renameAndConfirmDescription\"),\n },\n ]);\n\n const onClose = async () => {\n setShow(false);\n setCurrentStep(0);\n await onFinish();\n };\n\n return (\n <Modal\n title={GroupingMappingWidget.translate(\"mappings.importMappings\", { mappings: displayStrings.mappings })}\n modalRootId=\"grouping-mapping-widget\"\n isOpen={show}\n closeOnEsc={false}\n closeOnExternalClick={false}\n isDismissible={!importing}\n styleType=\"fullPage\"\n onClose={async () => {\n await onClose();\n }}\n >\n <div className=\"gmw-import-wizard-body-container\">\n <Stepper currentStep={currentStep} steps={steps.current} onStepClick={importing ? undefined : (index: number) => setCurrentStep(index)} />\n\n {(() => {\n switch (currentStep) {\n case 0:\n return (\n <ITwinsClientContext.Provider value={iTwinsClient}>\n <div className=\"gmw-table-container\">\n <SelectITwin\n onSelect={(iTwinId) => {\n setSelectedITwinId(iTwinId);\n setCurrentStep(1);\n }}\n onCancel={onClose}\n onChangeITwinType={setITwinType}\n displayStrings={displayStrings}\n defaultITwinType={iTwinType}\n />\n </div>\n </ITwinsClientContext.Provider>\n );\n case 1:\n return (\n <IModelsClientContext.Provider value={iModelsClient}>\n <div className=\"gmw-table-container\">\n <SelectIModel\n iTwinId={selectedITwinId}\n onSelect={(iModelId) => {\n setSelectedIModelId(iModelId);\n setCurrentStep(2);\n }}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n />\n </div>\n </IModelsClientContext.Provider>\n );\n case 2:\n case 3:\n // Preserve table state within Select Mappings\n return (\n <>\n <div style={{ display: currentStep === 2 ? \"flex\" : \"none\" }} className=\"gmw-mapping-container\">\n <SelectMappings\n iModelId={selectedIModelId}\n onSelect={(selectedMappings) => {\n setSelectedMappings(selectedMappings);\n setCurrentStep(3);\n }}\n onCancel={onClose}\n backFn={() => setCurrentStep(currentStep - 1)}\n displayStrings={displayStrings}\n />\n </div>\n {currentStep === 3 && (\n <ConfirmMappingImport\n selectedMappings={selectedMappings}\n importing={importing}\n setImporting={setImporting}\n setSelectedMappings={setSelectedMappings}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n onFinish={onClose}\n displayStrings={displayStrings}\n />\n )}\n </>\n );\n default:\n return null;\n }\n })()}\n </div>\n </Modal>\n );\n};\n"]}
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import "./SelectIModel.scss";
3
- declare const defaultDisplayStrings: {
2
+ declare const getDefaultDisplayStrings: () => {
4
3
  iModels: string;
5
4
  iModelName: string;
6
5
  iModelDescription: string;
@@ -10,7 +9,7 @@ interface SelectIModelProps {
10
9
  onSelect: (iModelId: string) => void;
11
10
  onCancel: () => void;
12
11
  backFn: () => void;
13
- displayStrings?: Partial<typeof defaultDisplayStrings>;
12
+ displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;
14
13
  }
15
14
  declare const SelectIModel: ({ iTwinId: iTwinId, onSelect, onCancel, backFn, displayStrings: userDisplayStrings }: SelectIModelProps) => JSX.Element;
16
15
  export default SelectIModel;
@@ -1,15 +1,16 @@
1
1
  import { Button, Table, tableFilters, TablePaginator } from "@itwin/itwinui-react";
2
2
  import React, { useCallback, useMemo } from "react";
3
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
3
4
  import "./SelectIModel.scss";
4
5
  import { useGroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
5
6
  import { useIModelsClient } from "../../context/IModelsClientContext";
6
7
  import { useQuery } from "@tanstack/react-query";
7
8
  import { AccessTokenAdapter } from "@itwin/imodels-access-frontend";
8
- const defaultDisplayStrings = {
9
+ const getDefaultDisplayStrings = () => ({
9
10
  iModels: "iModels",
10
- iModelName: "Name",
11
- iModelDescription: "Description",
12
- };
11
+ iModelName: GroupingMappingWidget.translate("common.name"),
12
+ iModelDescription: GroupingMappingWidget.translate("common.description"),
13
+ });
13
14
  const fetchIModels = async (getAccessToken, iTwinId, iModelsClient) => {
14
15
  const accessToken = await getAccessToken();
15
16
  const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);
@@ -32,7 +33,7 @@ const SelectIModel = ({ iTwinId: iTwinId, onSelect, onCancel, backFn, displayStr
32
33
  queryKey: ["iModels", iTwinId],
33
34
  queryFn: async () => fetchIModels(getAccessToken, iTwinId, iModelsClient),
34
35
  });
35
- const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
36
+ const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);
36
37
  const iModelsColumns = useMemo(() => [
37
38
  {
38
39
  id: "iModelName",
@@ -50,12 +51,12 @@ const SelectIModel = ({ iTwinId: iTwinId, onSelect, onCancel, backFn, displayStr
50
51
  const pageSizeList = useMemo(() => [10, 25, 50], []);
51
52
  const paginator = useCallback((props) => React.createElement(TablePaginator, { ...props, pageSizeList: pageSizeList }), [pageSizeList]);
52
53
  return (React.createElement("div", { className: "gmw-select-imodel-table-container" },
53
- React.createElement(Table, { data: iModels ?? [], columns: iModelsColumns, className: "gmw-select-imodel-table", emptyTableContent: `No ${displayStrings.iModels} available.`, isSortable: true, isLoading: isLoading, onRowClick: (_, row) => {
54
+ React.createElement(Table, { data: iModels ?? [], columns: iModelsColumns, className: "gmw-select-imodel-table", emptyTableContent: GroupingMappingWidget.translate("import.noIModels", { iModels: displayStrings.iModels }), isSortable: true, isLoading: isLoading, onRowClick: (_, row) => {
54
55
  onSelect(row.original.id);
55
56
  }, paginatorRenderer: paginator }),
56
57
  React.createElement("div", { className: "gmw-import-action-panel" },
57
- React.createElement(Button, { onClick: backFn }, "Back"),
58
- React.createElement(Button, { onClick: onCancel }, "Cancel"))));
58
+ React.createElement(Button, { onClick: backFn }, GroupingMappingWidget.translate("common.back")),
59
+ React.createElement(Button, { onClick: onCancel }, GroupingMappingWidget.translate("common.cancel")))));
59
60
  };
60
61
  export default SelectIModel;
61
62
  //# sourceMappingURL=SelectIModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Import/SelectIModel.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIpE,MAAM,qBAAqB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,MAAM;IAClB,iBAAiB,EAAE,aAAa;CACjC,CAAC;AAEF,MAAM,YAAY,GAAG,KAAK,EAAE,cAAgC,EAAE,OAAe,EAAE,aAA4B,E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AAQ,EAAE,MAAM;YAChB,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE;SAClC;QACD;YACE,EAAE,EAAE,mBAAmB;YACvB,MAAM,EAAE,GAAG,cAAc,CAAC,iBAAiB,EAAE;YAC7C,QAAQ,EAAE,aAAa;YACvB,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE;SAClC;KACF,EACD,CAAC,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAC9D,CAAC;IAEF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,KAAkC,EAAE,EAAE,CAAC,oBAAC,cAAc,OAAK,KAAK,EAAE,YAAY,EAAE,YAAY,GAAI,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEjJ,OAAO,CACL,6BAAK,SAAS,EAAC,mCAAmC;QAChD,oBAAC,KAAK,IACJ,IAAI,EAAE,OAAO,IAAI,EAAE,EACnB,OAAO,EAAE,cAAc,EACvB,SAAS,EAAC,yBAAyB,EACnC,iBAAiB,EAAE,MAAM,cAAc,CAAC,OAAO,aAAa,EAC5D,UAAU,QACV,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;gBACrB,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC5B,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B;QACF,6BAAK,SAAS,EAAC,yBAAyB;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,MAAM,WAAe;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,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 { IModel, IModelsClient } from \"@itwin/imodels-client-management\";\nimport type { TablePaginatorRendererProps } from \"@itwin/itwinui-react\";\nimport { Button, Table, tableFilters, TablePaginator } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo } from \"react\";\nimport type { CreateTypeFromInterface } from \"../../../common/utils\";\nimport \"./SelectIModel.scss\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useIModelsClient } from \"../../context/IModelsClientContext\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Column } from \"react-table\";\nimport { AccessTokenAdapter } from \"@itwin/imodels-access-frontend\";\n\ntype IIModelTyped = CreateTypeFromInterface<IModel>;\n\nconst defaultDisplayStrings = {\n iModels: \"iModels\",\n iModelName: \"Name\",\n iModelDescription: \"Description\",\n};\n\nconst fetchIModels = async (getAccessToken: GetAccessTokenFn, iTwinId: string, iModelsClient: IModelsClient) => {\n const accessToken = await getAccessToken();\n const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);\n const iModelIterator = iModelsClient.iModels.getRepresentationList({\n authorization,\n urlParams: {\n iTwinId,\n },\n });\n\n const iModels = [];\n for await (const iModel of iModelIterator) {\n iModels.push(iModel);\n }\n return iModels;\n};\n\ninterface SelectIModelProps {\n iTwinId: string;\n onSelect: (iModelId: string) => void;\n onCancel: () => void;\n backFn: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\nconst SelectIModel = ({ iTwinId: iTwinId, onSelect, onCancel, backFn, displayStrings: userDisplayStrings }: SelectIModelProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const iModelsClient = useIModelsClient();\n\n const { data: iModels, isFetching: isLoading } = useQuery({\n queryKey: [\"iModels\", iTwinId],\n queryFn: async () => fetchIModels(getAccessToken, iTwinId, iModelsClient),\n });\n\n const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);\n\n const iModelsColumns = useMemo<Column<IIModelTyped>[]>(\n () => [\n {\n id: \"iModelName\",\n Header: `${displayStrings.iModelName}`,\n accessor: \"name\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"iModelDescription\",\n Header: `${displayStrings.iModelDescription}`,\n accessor: \"description\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n [displayStrings.iModelName, displayStrings.iModelDescription],\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback((props: TablePaginatorRendererProps) => <TablePaginator {...props} pageSizeList={pageSizeList} />, [pageSizeList]);\n\n return (\n <div className=\"gmw-select-imodel-table-container\">\n <Table<IIModelTyped>\n data={iModels ?? []}\n columns={iModelsColumns}\n className=\"gmw-select-imodel-table\"\n emptyTableContent={`No ${displayStrings.iModels} available.`}\n isSortable\n isLoading={isLoading}\n onRowClick={(_, row) => {\n onSelect(row.original.id);\n }}\n paginatorRenderer={paginator}\n />\n <div className=\"gmw-import-action-panel\">\n <Button onClick={backFn}>Back</Button>\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectIModel;\n"]}
1
+ {"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Import/SelectIModel.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,O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EAAE,CAAC,EAC3G,UAAU,QACV,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;gBACrB,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC5B,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B;QACF,6BAAK,SAAS,EAAC,yBAAyB;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,MAAM,IAAG,qBAAqB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAU;YAClF,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,IAAG,qBAAqB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAU,CAClF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,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 { IModel, IModelsClient } from \"@itwin/imodels-client-management\";\nimport type { TablePaginatorRendererProps } from \"@itwin/itwinui-react\";\nimport { Button, Table, tableFilters, TablePaginator } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo } from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport type { CreateTypeFromInterface } from \"../../../common/utils\";\nimport \"./SelectIModel.scss\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useIModelsClient } from \"../../context/IModelsClientContext\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Column } from \"react-table\";\nimport { AccessTokenAdapter } from \"@itwin/imodels-access-frontend\";\n\ntype IIModelTyped = CreateTypeFromInterface<IModel>;\n\nconst getDefaultDisplayStrings = () => ({\n iModels: \"iModels\",\n iModelName: GroupingMappingWidget.translate(\"common.name\"),\n iModelDescription: GroupingMappingWidget.translate(\"common.description\"),\n});\n\nconst fetchIModels = async (getAccessToken: GetAccessTokenFn, iTwinId: string, iModelsClient: IModelsClient) => {\n const accessToken = await getAccessToken();\n const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);\n const iModelIterator = iModelsClient.iModels.getRepresentationList({\n authorization,\n urlParams: {\n iTwinId,\n },\n });\n\n const iModels = [];\n for await (const iModel of iModelIterator) {\n iModels.push(iModel);\n }\n return iModels;\n};\n\ninterface SelectIModelProps {\n iTwinId: string;\n onSelect: (iModelId: string) => void;\n onCancel: () => void;\n backFn: () => void;\n displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;\n}\nconst SelectIModel = ({ iTwinId: iTwinId, onSelect, onCancel, backFn, displayStrings: userDisplayStrings }: SelectIModelProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const iModelsClient = useIModelsClient();\n\n const { data: iModels, isFetching: isLoading } = useQuery({\n queryKey: [\"iModels\", iTwinId],\n queryFn: async () => fetchIModels(getAccessToken, iTwinId, iModelsClient),\n });\n\n const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n\n const iModelsColumns = useMemo<Column<IIModelTyped>[]>(\n () => [\n {\n id: \"iModelName\",\n Header: `${displayStrings.iModelName}`,\n accessor: \"name\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"iModelDescription\",\n Header: `${displayStrings.iModelDescription}`,\n accessor: \"description\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n [displayStrings.iModelName, displayStrings.iModelDescription],\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback((props: TablePaginatorRendererProps) => <TablePaginator {...props} pageSizeList={pageSizeList} />, [pageSizeList]);\n\n return (\n <div className=\"gmw-select-imodel-table-container\">\n <Table<IIModelTyped>\n data={iModels ?? []}\n columns={iModelsColumns}\n className=\"gmw-select-imodel-table\"\n emptyTableContent={GroupingMappingWidget.translate(\"import.noIModels\", { iModels: displayStrings.iModels })}\n isSortable\n isLoading={isLoading}\n onRowClick={(_, row) => {\n onSelect(row.original.id);\n }}\n paginatorRenderer={paginator}\n />\n <div className=\"gmw-import-action-panel\">\n <Button onClick={backFn}>{GroupingMappingWidget.translate(\"common.back\")}</Button>\n <Button onClick={onCancel}>{GroupingMappingWidget.translate(\"common.cancel\")}</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectIModel;\n"]}
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import "./SelectITwin.scss";
3
- declare const defaultDisplayStrings: {
2
+ declare const getDefaultDisplayStrings: () => {
4
3
  iTwins: string;
5
4
  iTwinNumber: string;
6
5
  iTwinName: string;
@@ -15,7 +14,7 @@ interface SelectITwinProps {
15
14
  onSelect: (iTwinId: string) => void;
16
15
  onCancel: () => void;
17
16
  onChangeITwinType: (iTwinType: number) => void;
18
- displayStrings?: Partial<typeof defaultDisplayStrings>;
17
+ displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;
19
18
  defaultITwinType?: ITwinType;
20
19
  }
21
20
  declare const SelectITwin: ({ onSelect, onCancel, onChangeITwinType, displayStrings: userDisplayStrings, defaultITwinType, }: SelectITwinProps) => JSX.Element;
@@ -2,26 +2,27 @@ import { ITwinSubClass } from "@itwin/itwins-client";
2
2
  import { SvgCalendar, SvgList, SvgStarHollow } from "@itwin/itwinui-icons-react";
3
3
  import { Button, Tab, Table, tableFilters, TablePaginator, Tabs } from "@itwin/itwinui-react";
4
4
  import React, { useCallback, useMemo, useState } from "react";
5
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
5
6
  import "./SelectITwin.scss";
6
7
  import { useGroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
7
8
  import { useITwinsClient } from "../../context/ITwinsClientContext";
8
9
  import { useQuery } from "@tanstack/react-query";
9
- const defaultDisplayStrings = {
10
+ const getDefaultDisplayStrings = () => ({
10
11
  iTwins: "iTwins",
11
- iTwinNumber: "Number",
12
- iTwinName: "Name",
13
- iTwinStatus: "Status",
14
- };
12
+ iTwinNumber: GroupingMappingWidget.translate("common.number"),
13
+ iTwinName: GroupingMappingWidget.translate("common.name"),
14
+ iTwinStatus: GroupingMappingWidget.translate("common.status"),
15
+ });
15
16
  export var ITwinType;
16
17
  (function (ITwinType) {
17
18
  ITwinType[ITwinType["Favorite"] = 0] = "Favorite";
18
19
  ITwinType[ITwinType["Recent"] = 1] = "Recent";
19
20
  ITwinType[ITwinType["All"] = 2] = "All";
20
21
  })(ITwinType || (ITwinType = {}));
21
- const tabsWithIcons = [
22
- React.createElement(Tab, { key: "favorite", label: "Favorite iTwins", startIcon: React.createElement(SvgStarHollow, null) }),
23
- React.createElement(Tab, { key: "recents", label: "Recent iTwins", startIcon: React.createElement(SvgCalendar, null) }),
24
- React.createElement(Tab, { key: "all", label: "My iTwins", startIcon: React.createElement(SvgList, null) }),
22
+ const getTabsWithIcons = () => [
23
+ React.createElement(Tab, { key: "favorite", label: GroupingMappingWidget.translate("import.favoriteITwins"), startIcon: React.createElement(SvgStarHollow, null) }),
24
+ React.createElement(Tab, { key: "recents", label: GroupingMappingWidget.translate("import.recentITwins"), startIcon: React.createElement(SvgCalendar, null) }),
25
+ React.createElement(Tab, { key: "all", label: GroupingMappingWidget.translate("import.myITwins"), startIcon: React.createElement(SvgList, null) }),
25
26
  ];
26
27
  const fetchITwins = async (getAccessToken, iTwinsClient, iTwinType) => {
27
28
  const accessToken = await getAccessToken();
@@ -42,7 +43,7 @@ const SelectITwin = ({ onSelect, onCancel, onChangeITwinType, displayStrings: us
42
43
  queryKey: ["iTwinsByType", iTwinType],
43
44
  queryFn: async () => (await fetchITwins(getAccessToken, iTwinsClient, iTwinType)).data,
44
45
  });
45
- const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
46
+ const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);
46
47
  const iTwinsColumns = useMemo(() => [
47
48
  {
48
49
  id: "iTwinNumber",
@@ -66,15 +67,15 @@ const SelectITwin = ({ onSelect, onCancel, onChangeITwinType, displayStrings: us
66
67
  const pageSizeList = useMemo(() => [10, 25, 50], []);
67
68
  const paginator = useCallback((props) => React.createElement(TablePaginator, { ...props, pageSizeList: pageSizeList }), [pageSizeList]);
68
69
  return (React.createElement("div", { className: "gmw-select-itwin-table-container" },
69
- React.createElement(Tabs, { orientation: "horizontal", labels: tabsWithIcons, onTabSelected: (type) => {
70
+ React.createElement(Tabs, { orientation: "horizontal", labels: getTabsWithIcons(), onTabSelected: (type) => {
70
71
  onChangeITwinType(type);
71
72
  setITwinType(type);
72
73
  }, activeIndex: iTwinType, type: "borderless", contentClassName: "gmw-table-holding-tab" }),
73
- React.createElement(Table, { data: iTwins ?? [], columns: iTwinsColumns, className: "gmw-select-itwin-table", emptyTableContent: `No ${displayStrings.iTwins} available.`, isSortable: true, isLoading: isLoading, onRowClick: (_, row) => {
74
+ React.createElement(Table, { data: iTwins ?? [], columns: iTwinsColumns, className: "gmw-select-itwin-table", emptyTableContent: GroupingMappingWidget.translate("import.noITwins", { iTwins: displayStrings.iTwins }), isSortable: true, isLoading: isLoading, onRowClick: (_, row) => {
74
75
  onSelect(row.original.id);
75
76
  }, paginatorRenderer: paginator }),
76
77
  React.createElement("div", { className: "gmw-import-action-panel" },
77
- React.createElement(Button, { onClick: onCancel }, "Cancel"))));
78
+ React.createElement(Button, { onClick: onCancel }, GroupingMappingWidget.translate("common.cancel")))));
78
79
  };
79
80
  export default SelectITwin;
80
81
  //# sourceMappingURL=SelectITwin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectITwin.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Import/SelectITwin.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,4BA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AAS,EAAE,SAAS,EACpB,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;gBACrB,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAG,CAAC,CAAC;YAC7B,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B;QACF,6BAAK,SAAS,EAAC,yBAAyB;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,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 { ITwin, ITwinsAccessClient } from \"@itwin/itwins-client\";\nimport { ITwinSubClass } from \"@itwin/itwins-client\";\nimport { SvgCalendar, SvgList, SvgStarHollow } from \"@itwin/itwinui-icons-react\";\nimport type { TablePaginatorRendererProps } from \"@itwin/itwinui-react\";\nimport { Button, Tab, Table, tableFilters, TablePaginator, Tabs } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { CreateTypeFromInterface } from \"../../../common/utils\";\nimport \"./SelectITwin.scss\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useITwinsClient } from \"../../context/ITwinsClientContext\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Column } from \"react-table\";\n\ntype IITwinTyped = CreateTypeFromInterface<ITwin>;\n\nconst defaultDisplayStrings = {\n iTwins: \"iTwins\",\n iTwinNumber: \"Number\",\n iTwinName: \"Name\",\n iTwinStatus: \"Status\",\n};\n\nexport enum ITwinType {\n Favorite = 0,\n Recent = 1,\n All = 2,\n}\n\nconst tabsWithIcons = [\n <Tab key=\"favorite\" label=\"Favorite iTwins\" startIcon={<SvgStarHollow />} />,\n <Tab key=\"recents\" label=\"Recent iTwins\" startIcon={<SvgCalendar />} />,\n <Tab key=\"all\" label=\"My iTwins\" startIcon={<SvgList />} />,\n];\n\nconst fetchITwins = async (getAccessToken: GetAccessTokenFn, iTwinsClient: ITwinsAccessClient, iTwinType: ITwinType) => {\n const accessToken = await getAccessToken();\n switch (iTwinType) {\n case ITwinType.Favorite:\n return iTwinsClient.queryFavoritesAsync(accessToken, ITwinSubClass.Project);\n case ITwinType.Recent:\n return iTwinsClient.queryRecentsAsync(accessToken, ITwinSubClass.Project);\n default:\n return iTwinsClient.queryAsync(accessToken, ITwinSubClass.Project);\n }\n};\n\ninterface SelectITwinProps {\n onSelect: (iTwinId: string) => void;\n onCancel: () => void;\n onChangeITwinType: (iTwinType: number) => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n defaultITwinType?: ITwinType;\n}\n\nconst SelectITwin = ({\n onSelect,\n onCancel,\n onChangeITwinType,\n displayStrings: userDisplayStrings,\n defaultITwinType = ITwinType.Favorite,\n}: SelectITwinProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const iTwinsClient = useITwinsClient();\n const [iTwinType, setITwinType] = useState<number>(defaultITwinType);\n\n const { data: iTwins, isFetching: isLoading } = useQuery({\n queryKey: [\"iTwinsByType\", iTwinType],\n queryFn: async () => (await fetchITwins(getAccessToken, iTwinsClient, iTwinType)).data!,\n });\n\n const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);\n\n const iTwinsColumns = useMemo<Column<IITwinTyped>[]>(\n () => [\n {\n id: \"iTwinNumber\",\n Header: `${displayStrings.iTwinNumber}`,\n accessor: \"number\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"iTwinName\",\n Header: `${displayStrings.iTwinName}`,\n accessor: \"displayName\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"iTwinStatus\",\n Header: `${displayStrings.iTwinStatus}`,\n accessor: \"status\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n [displayStrings.iTwinNumber, displayStrings.iTwinName, displayStrings.iTwinStatus],\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback((props: TablePaginatorRendererProps) => <TablePaginator {...props} pageSizeList={pageSizeList} />, [pageSizeList]);\n\n return (\n <div className=\"gmw-select-itwin-table-container\">\n <Tabs\n orientation=\"horizontal\"\n labels={tabsWithIcons}\n onTabSelected={(type) => {\n onChangeITwinType(type);\n setITwinType(type);\n }}\n activeIndex={iTwinType}\n type={\"borderless\"}\n contentClassName=\"gmw-table-holding-tab\"\n ></Tabs>\n <Table<IITwinTyped>\n data={iTwins ?? []}\n columns={iTwinsColumns}\n className=\"gmw-select-itwin-table\"\n emptyTableContent={`No ${displayStrings.iTwins} available.`}\n isSortable\n isLoading={isLoading}\n onRowClick={(_, row) => {\n onSelect(row.original.id!);\n }}\n paginatorRenderer={paginator}\n />\n <div className=\"gmw-import-action-panel\">\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectITwin;\n"]}
1
+ {"version":3,"file":"SelectITwin.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Import/SelectITwin.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEjF,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,eAAe,EA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ACxG,UAAU,QACV,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;gBACrB,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAG,CAAC,CAAC;YAC7B,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B;QACF,6BAAK,SAAS,EAAC,yBAAyB;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,IAAG,qBAAqB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAU,CAClF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,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 { ITwin, ITwinsAccessClient } from \"@itwin/itwins-client\";\nimport { ITwinSubClass } from \"@itwin/itwins-client\";\nimport { SvgCalendar, SvgList, SvgStarHollow } from \"@itwin/itwinui-icons-react\";\nimport type { TablePaginatorRendererProps } from \"@itwin/itwinui-react\";\nimport { Button, Tab, Table, tableFilters, TablePaginator, Tabs } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport type { CreateTypeFromInterface } from \"../../../common/utils\";\nimport \"./SelectITwin.scss\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useITwinsClient } from \"../../context/ITwinsClientContext\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { Column } from \"react-table\";\n\ntype IITwinTyped = CreateTypeFromInterface<ITwin>;\n\nconst getDefaultDisplayStrings = () => ({\n iTwins: \"iTwins\",\n iTwinNumber: GroupingMappingWidget.translate(\"common.number\"),\n iTwinName: GroupingMappingWidget.translate(\"common.name\"),\n iTwinStatus: GroupingMappingWidget.translate(\"common.status\"),\n});\n\nexport enum ITwinType {\n Favorite = 0,\n Recent = 1,\n All = 2,\n}\n\nconst getTabsWithIcons = () => [\n <Tab key=\"favorite\" label={GroupingMappingWidget.translate(\"import.favoriteITwins\")} startIcon={<SvgStarHollow />} />,\n <Tab key=\"recents\" label={GroupingMappingWidget.translate(\"import.recentITwins\")} startIcon={<SvgCalendar />} />,\n <Tab key=\"all\" label={GroupingMappingWidget.translate(\"import.myITwins\")} startIcon={<SvgList />} />,\n];\n\nconst fetchITwins = async (getAccessToken: GetAccessTokenFn, iTwinsClient: ITwinsAccessClient, iTwinType: ITwinType) => {\n const accessToken = await getAccessToken();\n switch (iTwinType) {\n case ITwinType.Favorite:\n return iTwinsClient.queryFavoritesAsync(accessToken, ITwinSubClass.Project);\n case ITwinType.Recent:\n return iTwinsClient.queryRecentsAsync(accessToken, ITwinSubClass.Project);\n default:\n return iTwinsClient.queryAsync(accessToken, ITwinSubClass.Project);\n }\n};\n\ninterface SelectITwinProps {\n onSelect: (iTwinId: string) => void;\n onCancel: () => void;\n onChangeITwinType: (iTwinType: number) => void;\n displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;\n defaultITwinType?: ITwinType;\n}\n\nconst SelectITwin = ({\n onSelect,\n onCancel,\n onChangeITwinType,\n displayStrings: userDisplayStrings,\n defaultITwinType = ITwinType.Favorite,\n}: SelectITwinProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const iTwinsClient = useITwinsClient();\n const [iTwinType, setITwinType] = useState<number>(defaultITwinType);\n\n const { data: iTwins, isFetching: isLoading } = useQuery({\n queryKey: [\"iTwinsByType\", iTwinType],\n queryFn: async () => (await fetchITwins(getAccessToken, iTwinsClient, iTwinType)).data!,\n });\n\n const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n\n const iTwinsColumns = useMemo<Column<IITwinTyped>[]>(\n () => [\n {\n id: \"iTwinNumber\",\n Header: `${displayStrings.iTwinNumber}`,\n accessor: \"number\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"iTwinName\",\n Header: `${displayStrings.iTwinName}`,\n accessor: \"displayName\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"iTwinStatus\",\n Header: `${displayStrings.iTwinStatus}`,\n accessor: \"status\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n [displayStrings.iTwinNumber, displayStrings.iTwinName, displayStrings.iTwinStatus],\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback((props: TablePaginatorRendererProps) => <TablePaginator {...props} pageSizeList={pageSizeList} />, [pageSizeList]);\n\n return (\n <div className=\"gmw-select-itwin-table-container\">\n <Tabs\n orientation=\"horizontal\"\n labels={getTabsWithIcons()}\n onTabSelected={(type) => {\n onChangeITwinType(type);\n setITwinType(type);\n }}\n activeIndex={iTwinType}\n type={\"borderless\"}\n contentClassName=\"gmw-table-holding-tab\"\n ></Tabs>\n <Table<IITwinTyped>\n data={iTwins ?? []}\n columns={iTwinsColumns}\n className=\"gmw-select-itwin-table\"\n emptyTableContent={GroupingMappingWidget.translate(\"import.noITwins\", { iTwins: displayStrings.iTwins })}\n isSortable\n isLoading={isLoading}\n onRowClick={(_, row) => {\n onSelect(row.original.id!);\n }}\n paginatorRenderer={paginator}\n />\n <div className=\"gmw-import-action-panel\">\n <Button onClick={onCancel}>{GroupingMappingWidget.translate(\"common.cancel\")}</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectITwin;\n"]}
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import type { IMappingTyped } from "../Mappings";
3
2
  import "./SelectMapping.scss";
4
- declare const defaultDisplayStrings: {
3
+ declare const getDefaultDisplayStrings: () => {
5
4
  mappings: string;
6
5
  };
7
6
  interface SelectMappingsProps {
@@ -9,7 +8,7 @@ interface SelectMappingsProps {
9
8
  onSelect: (selectedMappings: IMappingTyped[]) => void;
10
9
  onCancel: () => void;
11
10
  backFn: () => void;
12
- displayStrings?: Partial<typeof defaultDisplayStrings>;
11
+ displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;
13
12
  }
14
13
  declare const SelectMappings: ({ iModelId, onSelect, onCancel, backFn, displayStrings: userDisplayStrings }: SelectMappingsProps) => JSX.Element;
15
14
  export default SelectMappings;
@@ -1,18 +1,19 @@
1
1
  import { Button, Table, tableFilters, TablePaginator } from "@itwin/itwinui-react";
2
2
  import React, { useCallback, useMemo, useState } from "react";
3
+ import { GroupingMappingWidget } from "../../../GroupingMappingWidget";
3
4
  import { useMappingClient } from "../../context/MappingClientContext";
4
5
  import "./SelectMapping.scss";
5
6
  import { useGroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
6
7
  import { useFetchMappings } from "../hooks/useFetchMappings";
7
- const defaultDisplayStrings = {
8
- mappings: "Mappings",
9
- };
8
+ const getDefaultDisplayStrings = () => ({
9
+ mappings: GroupingMappingWidget.translate("mappings.mappings"),
10
+ });
10
11
  const SelectMappings = ({ iModelId, onSelect, onCancel, backFn, displayStrings: userDisplayStrings }) => {
11
12
  const { getAccessToken } = useGroupingMappingApiConfig();
12
13
  const mappingClient = useMappingClient();
13
14
  const [selectedMappings, setSelectedMappings] = useState([]);
14
15
  const { data: mappings, isFetching: isLoading } = useFetchMappings(iModelId, getAccessToken, mappingClient);
15
- const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
16
+ const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);
16
17
  const mappingsColumns = useMemo(() => [
17
18
  {
18
19
  id: "mappingName",
@@ -22,7 +23,7 @@ const SelectMappings = ({ iModelId, onSelect, onCancel, backFn, displayStrings:
22
23
  },
23
24
  {
24
25
  id: "description",
25
- Header: "Description",
26
+ Header: GroupingMappingWidget.translate("common.description"),
26
27
  accessor: "description",
27
28
  Filter: tableFilters.TextFilter(),
28
29
  },
@@ -30,15 +31,15 @@ const SelectMappings = ({ iModelId, onSelect, onCancel, backFn, displayStrings:
30
31
  const pageSizeList = useMemo(() => [10, 25, 50], []);
31
32
  const paginator = useCallback((props) => React.createElement(TablePaginator, { ...props, pageSizeList: pageSizeList }), [pageSizeList]);
32
33
  return (React.createElement("div", { className: "gmw-select-mapping-container" },
33
- React.createElement(Table, { data: mappings ?? [], columns: mappingsColumns, className: "gmw-select-mapping-table", emptyTableContent: `No ${displayStrings.mappings} available.`, isSortable: true, isSelectable: true, isLoading: isLoading, onSelect: (selectData) => {
34
+ React.createElement(Table, { data: mappings ?? [], columns: mappingsColumns, className: "gmw-select-mapping-table", emptyTableContent: GroupingMappingWidget.translate("import.noMappings", { mappings: displayStrings.mappings }), isSortable: true, isSelectable: true, isLoading: isLoading, onSelect: (selectData) => {
34
35
  selectData && setSelectedMappings(selectData);
35
36
  }, paginatorRenderer: paginator }),
36
37
  React.createElement("div", { className: "gmw-import-action-panel" },
37
- React.createElement(Button, { onClick: backFn }, "Back"),
38
+ React.createElement(Button, { onClick: backFn }, GroupingMappingWidget.translate("common.back")),
38
39
  React.createElement(Button, { styleType: "high-visibility", onClick: () => {
39
40
  onSelect(selectedMappings);
40
- }, disabled: isLoading || selectedMappings.length === 0 }, "Next"),
41
- React.createElement(Button, { onClick: onCancel }, "Cancel"))));
41
+ }, disabled: isLoading || selectedMappings.length === 0 }, GroupingMappingWidget.translate("common.next")),
42
+ React.createElement(Button, { onClick: onCancel }, GroupingMappingWidget.translate("common.cancel")))));
42
43
  };
43
44
  export default SelectMappings;
44
45
  //# sourceMappingURL=SelectMappings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMappings.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Import/SelectMappings.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAA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;SAClC;KACF,EACD,CAAC,cAAc,CAAC,QAAQ,CAAC,CAC1B,CAAC;IAEF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,KAAkC,EAAE,EAAE,CAAC,oBAAC,cAAc,OAAK,KAAK,EAAE,YAAY,EAAE,YAAY,GAAI,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEjJ,OAAO,CACL,6BAAK,SAAS,EAAC,8BAA8B;QAC3C,oBAAC,KAAK,IACJ,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,0BAA0B,EACpC,iBAAiB,EAAE,MAAM,cAAc,CAAC,QAAQ,aAAa,EAC7D,UAAU,QACV,YAAY,QACZ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,UAAuC,EAAE,EAAE;gBACpD,UAAU,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;YAChD,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B;QACF,6BAAK,SAAS,EAAC,yBAAyB;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,MAAM,WAAe;YACtC,oBAAC,MAAM,IACL,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,GAAG,EAAE;oBACZ,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBAC7B,CAAC,EACD,QAAQ,EAAE,SAAS,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,WAG7C;YACT,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 { TablePaginatorRendererProps } from \"@itwin/itwinui-react\";\nimport { Button, Table, tableFilters, TablePaginator } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport type { IMappingTyped } from \"../Mappings\";\nimport \"./SelectMapping.scss\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useFetchMappings } from \"../hooks/useFetchMappings\";\nimport type { Column } from \"react-table\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n};\n\ninterface SelectMappingsProps {\n iModelId: string;\n onSelect: (selectedMappings: IMappingTyped[]) => void;\n onCancel: () => void;\n backFn: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nconst SelectMappings = ({ iModelId, onSelect, onCancel, backFn, displayStrings: userDisplayStrings }: SelectMappingsProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n\n const { data: mappings, isFetching: isLoading } = useFetchMappings(iModelId, getAccessToken, mappingClient);\n\n const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);\n\n const mappingsColumns = useMemo<Column<IMappingTyped>[]>(\n () => [\n {\n id: \"mappingName\",\n Header: `${displayStrings.mappings}`,\n accessor: \"mappingName\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"description\",\n Header: \"Description\",\n accessor: \"description\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n [displayStrings.mappings],\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback((props: TablePaginatorRendererProps) => <TablePaginator {...props} pageSizeList={pageSizeList} />, [pageSizeList]);\n\n return (\n <div className=\"gmw-select-mapping-container\">\n <Table<IMappingTyped>\n data={mappings ?? []}\n columns={mappingsColumns}\n className=\"gmw-select-mapping-table\"\n emptyTableContent={`No ${displayStrings.mappings} available.`}\n isSortable\n isSelectable\n isLoading={isLoading}\n onSelect={(selectData: IMappingTyped[] | undefined) => {\n selectData && setSelectedMappings(selectData);\n }}\n paginatorRenderer={paginator}\n />\n <div className=\"gmw-import-action-panel\">\n <Button onClick={backFn}>Back</Button>\n <Button\n styleType=\"high-visibility\"\n onClick={() => {\n onSelect(selectedMappings);\n }}\n disabled={isLoading || selectedMappings.length === 0}\n >\n Next\n </Button>\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectMappings;\n"]}
1
+ {"version":3,"file":"SelectMappings.js","sourceRoot":"","sources":["../../../../../src/components/Mappings/Import/SelectMappings.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAAC,CAAC;IACtC,QAAQ,EAAE,qBAAqB,CAAC,SAAS,CAAC,mBAAmB,CAAC;CAC/D,CAAC,CAAC;AAUH,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,kBAAkB,EAAuB,EAAE,EAAE;IAC3H,MAAM,EAAE,cAAc,EAAE,GAAG,2BAA2B,EAAE,CAAC;IACzD,MAAM,aAAa,GAAG,gBAAgB,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EACxB,SAAS,EAAC,0BAA0B,EACpC,iBAAiB,EAAE,qBAAqB,CAAC,SAAS,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,EAC9G,UAAU,QACV,YAAY,QACZ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,UAAuC,EAAE,EAAE;gBACpD,UAAU,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;YAChD,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B;QACF,6BAAK,SAAS,EAAC,yBAAyB;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,MAAM,IAAG,qBAAqB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAU;YAClF,oBAAC,MAAM,IACL,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,GAAG,EAAE;oBACZ,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBAC7B,CAAC,EACD,QAAQ,EAAE,SAAS,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,IAEnD,qBAAqB,CAAC,SAAS,CAAC,aAAa,CAAC,CACxC;YACT,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,IAAG,qBAAqB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAU,CAClF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 { TablePaginatorRendererProps } from \"@itwin/itwinui-react\";\nimport { Button, Table, tableFilters, TablePaginator } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { GroupingMappingWidget } from \"../../../GroupingMappingWidget\";\nimport { useMappingClient } from \"../../context/MappingClientContext\";\nimport type { IMappingTyped } from \"../Mappings\";\nimport \"./SelectMapping.scss\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useFetchMappings } from \"../hooks/useFetchMappings\";\nimport type { Column } from \"react-table\";\n\nconst getDefaultDisplayStrings = () => ({\n mappings: GroupingMappingWidget.translate(\"mappings.mappings\"),\n});\n\ninterface SelectMappingsProps {\n iModelId: string;\n onSelect: (selectedMappings: IMappingTyped[]) => void;\n onCancel: () => void;\n backFn: () => void;\n displayStrings?: Partial<ReturnType<typeof getDefaultDisplayStrings>>;\n}\n\nconst SelectMappings = ({ iModelId, onSelect, onCancel, backFn, displayStrings: userDisplayStrings }: SelectMappingsProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n\n const { data: mappings, isFetching: isLoading } = useFetchMappings(iModelId, getAccessToken, mappingClient);\n\n const displayStrings = React.useMemo(() => ({ ...getDefaultDisplayStrings(), ...userDisplayStrings }), [userDisplayStrings]);\n\n const mappingsColumns = useMemo<Column<IMappingTyped>[]>(\n () => [\n {\n id: \"mappingName\",\n Header: `${displayStrings.mappings}`,\n accessor: \"mappingName\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"description\",\n Header: GroupingMappingWidget.translate(\"common.description\"),\n accessor: \"description\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n [displayStrings.mappings],\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback((props: TablePaginatorRendererProps) => <TablePaginator {...props} pageSizeList={pageSizeList} />, [pageSizeList]);\n\n return (\n <div className=\"gmw-select-mapping-container\">\n <Table<IMappingTyped>\n data={mappings ?? []}\n columns={mappingsColumns}\n className=\"gmw-select-mapping-table\"\n emptyTableContent={GroupingMappingWidget.translate(\"import.noMappings\", { mappings: displayStrings.mappings })}\n isSortable\n isSelectable\n isLoading={isLoading}\n onSelect={(selectData: IMappingTyped[] | undefined) => {\n selectData && setSelectedMappings(selectData);\n }}\n paginatorRenderer={paginator}\n />\n <div className=\"gmw-import-action-panel\">\n <Button onClick={backFn}>{GroupingMappingWidget.translate(\"common.back\")}</Button>\n <Button\n styleType=\"high-visibility\"\n onClick={() => {\n onSelect(selectedMappings);\n }}\n disabled={isLoading || selectedMappings.length === 0}\n >\n {GroupingMappingWidget.translate(\"common.next\")}\n </Button>\n <Button onClick={onCancel}>{GroupingMappingWidget.translate(\"common.cancel\")}</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectMappings;\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Mapping } from "@itwin/insights-client";
3
2
  import type { BeEvent } from "@itwin/core-bentley";
4
3
  import "./MappingListItem.scss";
@@ -1,8 +1,7 @@
1
1
  import React, { useCallback, useEffect, useState } from "react";
2
2
  import { MappingViewActionGroup } from "./MappingViewActionGroup";
3
3
  import { Anchor, ListItem } from "@itwin/itwinui-react";
4
- import { ExtractionStates } from "./Extraction/ExtractionStatus";
5
- import { ExtractionStatus } from "./Extraction/ExtractionStatus";
4
+ import { ExtractionStates, ExtractionStatus } from "./Extraction/ExtractionStatus";
6
5
  import { useExtractionStateJobContext } from "../context/ExtractionStateJobContext";
7
6
  import { useFetchMappingExtractionStatus } from "./hooks/useFetchMappingExtractionStatus";
8
7
  import "./MappingListItem.scss";
@@ -1 +1 @@
1
- {"version":3,"file":"MappingListItem.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingListItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE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,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC;QAChE,IAAI,aAAa,EAAE;YACjB,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;YAC/D,yFAAyF;YACzF,KAAK,+BAA+B,EAAE,CAAC;SACxC;IACH,CAAC,EAAE,CAAC,+BAA+B,EAAE,WAAW,CAAC,CAAC,CAAC;IAEnD,OAAO,CACL,oBAAC,QAAQ,IACP,UAAU,EAAE,CAAC,CAAC,iBAAiB,EAC/B,SAAS,EAAC,uBAAuB,EACjC,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,OAAO,CAAC,EAAE,EACf,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,OAAO,CAAC,WAAW;QAE1B,oBAAC,QAAQ,CAAC,OAAO;YACd,mBAAmB,CAAC,CAAC,CAAC,oBAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAG,OAAO,CAAC,WAAW,CAAU,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW;YAChI,oBAAC,QAAQ,CAAC,WAAW,QAAE,OAAO,CAAC,WAAW,CAAwB,CACjD;QACnB,oBAAC,gBAAgB,IACf,KAAK,EAAE,eAAe,EACtB,oBAAoB,EAAE,GAAG,EAAE;gBACzB,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC,GACiB;QACpB,oBAAC,sBAAsB,IACrB,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,iBAAiB,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB,GACtC,CACO,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 type { Mapping } from \"@itwin/insights-client\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport type { BeEvent } from \"@itwin/core-bentley\";\nimport { MappingViewActionGroup } from \"./MappingViewActionGroup\";\nimport { Anchor, ListItem } from \"@itwin/itwinui-react\";\nimport { ExtractionStates } from \"./Extraction/ExtractionStatus\";\nimport { ExtractionStatus } from \"./Extraction/ExtractionStatus\";\nimport { useExtractionStateJobContext } from \"../context/ExtractionStateJobContext\";\nimport { useFetchMappingExtractionStatus } from \"./hooks/useFetchMappingExtractionStatus\";\nimport \"./MappingListItem.scss\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nexport interface MappingListItemProps {\n selected: boolean;\n mapping: Mapping;\n jobId: string;\n jobStartEvent: BeEvent<(mappingId: string) => void>;\n onSelectionChange?: (mapping: Mapping) => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n onRefreshMappings: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n setShowDeleteModal: (mapping?: Mapping) => void;\n initialStateExtractionFlag?: boolean;\n setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;\n}\n\nexport const MappingListItem = ({\n selected,\n onSelectionChange,\n mapping,\n jobId,\n jobStartEvent,\n onClickMappingModify,\n onClickMappingTitle,\n onRefreshMappings,\n onToggleExtraction,\n setShowDeleteModal,\n}: MappingListItemProps) => {\n const [extractionState, setExtractionState] = useState<ExtractionStates | undefined>(ExtractionStates.None);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const [isJobStarted, setIsJobStarted] = useState<boolean>(false);\n const statusQuery = useFetchMappingExtractionStatus({ ...groupingMappingApiConfig, mapping, enabled: isJobStarted });\n const queryClient = useQueryClient();\n\n const onClickTile = useCallback(() => {\n onSelectionChange && onSelectionChange(mapping);\n }, [mapping, onSelectionChange]);\n\n // Check whether the job is still running when users refresh the mapping list\n // or modify any mappings\n useEffect(() => {\n if (mappingIdJobInfo.get(mapping.id)) {\n setIsJobStarted(true);\n }\n }, [mappingIdJobInfo, mapping.id]);\n\n const resolveTerminalExtractionStatus = useCallback(async () => {\n const state = statusQuery.data!.finalExtractionStateValue;\n if (state === ExtractionStates.Failed || state === ExtractionStates.Succeeded) {\n setIsJobStarted(false);\n setMappingIdJobInfo((prevMap: Map<string, string>) => {\n const newMap = new Map(prevMap);\n newMap.delete(mapping.id);\n return newMap;\n });\n await queryClient.invalidateQueries({ queryKey: [\"iModelExtractionStatus\"] });\n }\n }, [mapping.id, queryClient, setMappingIdJobInfo, statusQuery.data]);\n\n useEffect(() => {\n const listener = (startedMappingId: string) => {\n if (startedMappingId === mapping.id) {\n setExtractionState(ExtractionStates.Starting);\n setIsJobStarted(true);\n }\n };\n jobStartEvent.addListener(listener);\n\n return () => {\n jobStartEvent.removeListener(listener);\n };\n }, [jobStartEvent, mapping.id, jobId]);\n\n useEffect(() => {\n const isStatusReady = statusQuery.data && statusQuery.isFetched;\n if (isStatusReady) {\n setExtractionState(statusQuery.data.finalExtractionStateValue);\n // No need to await. We don't need to wait for the status to be resolved in invalidation.\n void resolveTerminalExtractionStatus();\n }\n }, [resolveTerminalExtractionStatus, statusQuery]);\n\n return (\n <ListItem\n actionable={!!onSelectionChange}\n className=\"gmw-mapping-list-item\"\n active={selected}\n key={mapping.id}\n onClick={onClickTile}\n title={mapping.mappingName}\n >\n <ListItem.Content>\n {onClickMappingTitle ? <Anchor onClick={() => onClickMappingTitle(mapping)}>{mapping.mappingName}</Anchor> : mapping.mappingName}\n <ListItem.Description>{mapping.description}</ListItem.Description>\n </ListItem.Content>\n <ExtractionStatus\n state={extractionState}\n clearExtractionState={() => {\n setExtractionState(ExtractionStates.None);\n }}\n ></ExtractionStatus>\n <MappingViewActionGroup\n mapping={mapping}\n onToggleExtraction={onToggleExtraction}\n onRefresh={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n </ListItem>\n );\n};\n"]}
1
+ {"version":3,"file":"MappingListItem.js","sourceRoot":"","sources":["../../../../src/components/Mappings/MappingListItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAG,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAiBvD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACG,EAAE,EAAE;IACzB,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAA+B,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5G,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,4BAA4B,EAAE,CAAC;IACjF,MAAM,wBAAwB,GAAG,2BAA2B,EAAE,CAAC;IAC/D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,+BAA+B,CAAC,E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AC,QAAQ,CAAC,WAAW,QAAE,OAAO,CAAC,WAAW,CAAwB,CACjD;QACnB,oBAAC,gBAAgB,IACf,KAAK,EAAE,eAAe,EACtB,oBAAoB,EAAE,GAAG,EAAE;gBACzB,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC,GACiB;QACpB,oBAAC,sBAAsB,IACrB,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,iBAAiB,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB,GACtC,CACO,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 type { Mapping } from \"@itwin/insights-client\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport type { BeEvent } from \"@itwin/core-bentley\";\nimport { MappingViewActionGroup } from \"./MappingViewActionGroup\";\nimport { Anchor, ListItem } from \"@itwin/itwinui-react\";\nimport { ExtractionStates , ExtractionStatus } from \"./Extraction/ExtractionStatus\";\nimport { useExtractionStateJobContext } from \"../context/ExtractionStateJobContext\";\nimport { useFetchMappingExtractionStatus } from \"./hooks/useFetchMappingExtractionStatus\";\nimport \"./MappingListItem.scss\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nexport interface MappingListItemProps {\n selected: boolean;\n mapping: Mapping;\n jobId: string;\n jobStartEvent: BeEvent<(mappingId: string) => void>;\n onSelectionChange?: (mapping: Mapping) => void;\n onClickMappingTitle?: (mapping: Mapping) => void;\n onClickMappingModify?: (mapping: Mapping) => void;\n onRefreshMappings: () => Promise<void>;\n onToggleExtraction: (mapping: Mapping) => Promise<void>;\n setShowDeleteModal: (mapping?: Mapping) => void;\n initialStateExtractionFlag?: boolean;\n setInitialExtractionStateFlag?: (initialStateExtractionFlag: boolean) => void;\n}\n\nexport const MappingListItem = ({\n selected,\n onSelectionChange,\n mapping,\n jobId,\n jobStartEvent,\n onClickMappingModify,\n onClickMappingTitle,\n onRefreshMappings,\n onToggleExtraction,\n setShowDeleteModal,\n}: MappingListItemProps) => {\n const [extractionState, setExtractionState] = useState<ExtractionStates | undefined>(ExtractionStates.None);\n const { mappingIdJobInfo, setMappingIdJobInfo } = useExtractionStateJobContext();\n const groupingMappingApiConfig = useGroupingMappingApiConfig();\n const [isJobStarted, setIsJobStarted] = useState<boolean>(false);\n const statusQuery = useFetchMappingExtractionStatus({ ...groupingMappingApiConfig, mapping, enabled: isJobStarted });\n const queryClient = useQueryClient();\n\n const onClickTile = useCallback(() => {\n onSelectionChange && onSelectionChange(mapping);\n }, [mapping, onSelectionChange]);\n\n // Check whether the job is still running when users refresh the mapping list\n // or modify any mappings\n useEffect(() => {\n if (mappingIdJobInfo.get(mapping.id)) {\n setIsJobStarted(true);\n }\n }, [mappingIdJobInfo, mapping.id]);\n\n const resolveTerminalExtractionStatus = useCallback(async () => {\n const state = statusQuery.data!.finalExtractionStateValue;\n if (state === ExtractionStates.Failed || state === ExtractionStates.Succeeded) {\n setIsJobStarted(false);\n setMappingIdJobInfo((prevMap: Map<string, string>) => {\n const newMap = new Map(prevMap);\n newMap.delete(mapping.id);\n return newMap;\n });\n await queryClient.invalidateQueries({ queryKey: [\"iModelExtractionStatus\"] });\n }\n }, [mapping.id, queryClient, setMappingIdJobInfo, statusQuery.data]);\n\n useEffect(() => {\n const listener = (startedMappingId: string) => {\n if (startedMappingId === mapping.id) {\n setExtractionState(ExtractionStates.Starting);\n setIsJobStarted(true);\n }\n };\n jobStartEvent.addListener(listener);\n\n return () => {\n jobStartEvent.removeListener(listener);\n };\n }, [jobStartEvent, mapping.id, jobId]);\n\n useEffect(() => {\n const isStatusReady = statusQuery.data && statusQuery.isFetched;\n if (isStatusReady) {\n setExtractionState(statusQuery.data.finalExtractionStateValue);\n // No need to await. We don't need to wait for the status to be resolved in invalidation.\n void resolveTerminalExtractionStatus();\n }\n }, [resolveTerminalExtractionStatus, statusQuery]);\n\n return (\n <ListItem\n actionable={!!onSelectionChange}\n className=\"gmw-mapping-list-item\"\n active={selected}\n key={mapping.id}\n onClick={onClickTile}\n title={mapping.mappingName}\n >\n <ListItem.Content>\n {onClickMappingTitle ? <Anchor onClick={() => onClickMappingTitle(mapping)}>{mapping.mappingName}</Anchor> : mapping.mappingName}\n <ListItem.Description>{mapping.description}</ListItem.Description>\n </ListItem.Content>\n <ExtractionStatus\n state={extractionState}\n clearExtractionState={() => {\n setExtractionState(ExtractionStates.None);\n }}\n ></ExtractionStatus>\n <MappingViewActionGroup\n mapping={mapping}\n onToggleExtraction={onToggleExtraction}\n onRefresh={onRefreshMappings}\n onClickMappingModify={onClickMappingModify}\n setShowDeleteModal={setShowDeleteModal}\n />\n </ListItem>\n );\n};\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Mapping } from "@itwin/insights-client";
3
2
  interface MappingUIActionGroupProps {
4
3
  mapping: Mapping;
@@ -5,22 +5,23 @@
5
5
  import React from "react";
6
6
  import { DropdownMenu, IconButton, MenuItem } from "@itwin/itwinui-react";
7
7
  import { SvgDelete, SvgEdit, SvgMore, SvgProcess } from "@itwin/itwinui-icons-react";
8
+ import { GroupingMappingWidget } from "../../GroupingMappingWidget";
8
9
  export const MappingViewActionGroup = ({ mapping, onToggleExtraction, onClickMappingModify, setShowDeleteModal }) => {
9
10
  return (React.createElement(DropdownMenu, { menuItems: (close) => [
10
11
  onClickMappingModify ? (React.createElement(MenuItem, { key: 0, onClick: () => {
11
12
  onClickMappingModify(mapping);
12
13
  close();
13
- }, icon: React.createElement(SvgEdit, null) }, "Modify")) : ([]),
14
+ }, icon: React.createElement(SvgEdit, null) }, GroupingMappingWidget.translate("common.modify"))) : ([]),
14
15
  React.createElement(MenuItem, { key: 1, onClick: async () => {
15
16
  close();
16
17
  await onToggleExtraction(mapping);
17
- }, icon: React.createElement(SvgProcess, null) }, mapping.extractionEnabled ? "Disable extraction" : "Enable extraction"),
18
+ }, icon: React.createElement(SvgProcess, null) }, mapping.extractionEnabled ? GroupingMappingWidget.translate("mappings.disableExtraction") : GroupingMappingWidget.translate("mappings.enableExtraction")),
18
19
  React.createElement(MenuItem, { key: 2, onClick: () => {
19
20
  setShowDeleteModal(mapping);
20
21
  close();
21
- }, icon: React.createElement(SvgDelete, null) }, "Remove"),
22
+ }, icon: React.createElement(SvgDelete, null) }, GroupingMappingWidget.translate("common.remove")),
22
23
  ].flat() },
23
- React.createElement(IconButton, { styleType: "borderless", title: "Mapping Options" },
24
+ React.createElement(IconButton, { styleType: "borderless", title: GroupingMappingWidget.translate("mappings.mappingOptions") },
24
25
  React.createElement(SvgMore, null))));
25
26
  };
26
27
  //# sourceMappingURL=MappingViewActionGroup.js.map