@itwin/grouping-mapping-widget 0.25.2 → 0.26.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 (343) hide show
  1. package/lib/cjs/WidgetShell/GroupingMapping.d.ts +5 -5
  2. package/lib/cjs/WidgetShell/GroupingMapping.js.map +1 -1
  3. package/lib/cjs/WidgetShell/GroupingMappingWidget.d.ts +4 -0
  4. package/lib/cjs/WidgetShell/GroupingMappingWidget.js +4 -0
  5. package/lib/cjs/WidgetShell/GroupingMappingWidget.js.map +1 -1
  6. package/lib/cjs/components/GroupingMappingContext.d.ts +19 -3
  7. package/lib/cjs/components/GroupingMappingContext.js +27 -9
  8. package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
  9. package/lib/cjs/components/Groups/Editing/GroupAction.d.ts +10 -2
  10. package/lib/cjs/components/Groups/Editing/GroupAction.js +9 -5
  11. package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
  12. package/lib/cjs/components/Groups/GroupColorLegend.d.ts +3 -3
  13. package/lib/cjs/components/Groups/GroupColorLegend.js.map +1 -1
  14. package/lib/cjs/components/Groups/GroupListItem.d.ts +4 -4
  15. package/lib/cjs/components/Groups/GroupListItem.js +6 -3
  16. package/lib/cjs/components/Groups/GroupListItem.js.map +1 -1
  17. package/lib/cjs/components/Groups/GroupListItem.scss +14 -0
  18. package/lib/cjs/components/Groups/GroupMenuActions.d.ts +4 -4
  19. package/lib/cjs/components/Groups/GroupMenuActions.js.map +1 -1
  20. package/lib/cjs/components/Groups/GroupMenuActions.scss +2 -0
  21. package/lib/cjs/components/Groups/GroupOverlapProgressBar.d.ts +2 -2
  22. package/lib/cjs/components/Groups/GroupOverlapProgressBar.js.map +1 -1
  23. package/lib/cjs/components/Groups/Groups.d.ts +12 -4
  24. package/lib/cjs/components/Groups/Groups.js +4 -0
  25. package/lib/cjs/components/Groups/Groups.js.map +1 -1
  26. package/lib/cjs/components/Groups/GroupsShowHideButtons.d.ts +4 -4
  27. package/lib/cjs/components/Groups/GroupsShowHideButtons.js.map +1 -1
  28. package/lib/cjs/components/Groups/GroupsView.d.ts +19 -11
  29. package/lib/cjs/components/Groups/GroupsView.js +4 -0
  30. package/lib/cjs/components/Groups/GroupsView.js.map +1 -1
  31. package/lib/cjs/components/Groups/GroupsVisualization.d.ts +8 -0
  32. package/lib/cjs/components/Groups/GroupsVisualization.js +8 -4
  33. package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
  34. package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.d.ts +3 -3
  35. package/lib/cjs/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
  36. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +2 -2
  37. package/lib/cjs/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
  38. package/lib/cjs/components/Groups/groupsHelpers.d.ts +2 -2
  39. package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
  40. package/lib/cjs/components/Groups/hooks/useFetchGroups.d.ts +3 -3
  41. package/lib/cjs/components/Groups/hooks/useFetchGroups.js +6 -5
  42. package/lib/cjs/components/Groups/hooks/useFetchGroups.js.map +1 -1
  43. package/lib/cjs/components/Groups/hooks/useGroupsOperations.d.ts +15 -7
  44. package/lib/cjs/components/Groups/hooks/useGroupsOperations.js +9 -5
  45. package/lib/cjs/components/Groups/hooks/useGroupsOperations.js.map +1 -1
  46. package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.d.ts +4 -4
  47. package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
  48. package/lib/cjs/components/Mappings/Editing/MappingAction.d.ts +8 -0
  49. package/lib/cjs/components/Mappings/Editing/MappingAction.js +7 -2
  50. package/lib/cjs/components/Mappings/Editing/MappingAction.js.map +1 -1
  51. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +3 -1
  52. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
  53. package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.d.ts +1 -2
  54. package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js +4 -3
  55. package/lib/cjs/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
  56. package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js +1 -1
  57. package/lib/cjs/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
  58. package/lib/cjs/components/Mappings/Mappings.d.ts +8 -0
  59. package/lib/cjs/components/Mappings/Mappings.js +4 -0
  60. package/lib/cjs/components/Mappings/Mappings.js.map +1 -1
  61. package/lib/cjs/components/Mappings/MappingsView.d.ts +7 -0
  62. package/lib/cjs/components/Mappings/MappingsView.js +4 -0
  63. package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
  64. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.d.ts +1 -2
  65. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +9 -8
  66. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
  67. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +5 -4
  68. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
  69. package/lib/cjs/components/Mappings/hooks/useFetchMappings.js +1 -1
  70. package/lib/cjs/components/Mappings/hooks/useFetchMappings.js.map +1 -1
  71. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +9 -2
  72. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +12 -8
  73. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
  74. package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +1 -1
  75. package/lib/cjs/components/Mappings/hooks/useRunExtraction.js +20 -14
  76. package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -1
  77. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +10 -2
  78. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +20 -7
  79. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
  80. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +11 -3
  81. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +19 -7
  82. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
  83. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.d.ts +3 -3
  84. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +6 -4
  85. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
  86. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +10 -2
  87. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +52 -34
  88. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
  89. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.d.ts +3 -3
  90. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js +6 -4
  91. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
  92. package/lib/cjs/components/Properties/GroupColorToggle.d.ts +2 -2
  93. package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
  94. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.d.ts +12 -4
  95. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +24 -18
  96. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
  97. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.d.ts +3 -3
  98. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +6 -4
  99. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
  100. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.d.ts +3 -5
  101. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js +0 -26
  102. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
  103. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +3 -3
  104. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
  105. package/lib/cjs/components/Properties/PropertyMenu.d.ts +13 -5
  106. package/lib/cjs/components/Properties/PropertyMenu.js +12 -14
  107. package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -1
  108. package/lib/cjs/components/Properties/PropertyMenuWithVisualization.d.ts +8 -0
  109. package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js +4 -0
  110. package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
  111. package/lib/cjs/components/Properties/hooks/useFormulaValidation.d.ts +2 -1
  112. package/lib/cjs/components/Properties/hooks/useFormulaValidation.js +8 -4
  113. package/lib/cjs/components/Properties/hooks/useFormulaValidation.js.map +1 -1
  114. package/lib/cjs/components/Properties/hooks/usePropertiesQuery.d.ts +4 -0
  115. package/lib/cjs/components/Properties/hooks/usePropertiesQuery.js +12 -0
  116. package/lib/cjs/components/Properties/hooks/usePropertiesQuery.js.map +1 -0
  117. package/lib/cjs/components/context/ExtractionClientContext.js +3 -3
  118. package/lib/cjs/components/context/ExtractionClientContext.js.map +1 -1
  119. package/lib/cjs/components/context/GroupingApiConfigContext.d.ts +16 -0
  120. package/lib/cjs/components/context/GroupingApiConfigContext.js +7 -0
  121. package/lib/cjs/components/context/GroupingApiConfigContext.js.map +1 -1
  122. package/lib/cjs/components/context/GroupsClientContext.d.ts +20 -0
  123. package/lib/cjs/components/context/GroupsClientContext.js +45 -0
  124. package/lib/cjs/components/context/GroupsClientContext.js.map +1 -0
  125. package/lib/cjs/components/context/MappingClientContext.d.ts +12 -0
  126. package/lib/cjs/components/context/MappingClientContext.js +14 -2
  127. package/lib/cjs/components/context/MappingClientContext.js.map +1 -1
  128. package/lib/cjs/components/context/PropertiesClientContext.d.ts +20 -0
  129. package/lib/cjs/components/context/PropertiesClientContext.js +45 -0
  130. package/lib/cjs/components/context/PropertiesClientContext.js.map +1 -0
  131. package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.d.ts +4 -0
  132. package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js +4 -0
  133. package/lib/cjs/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  134. package/lib/cjs/components/customUI/GroupingMappingCustomUI.d.ts +15 -3
  135. package/lib/cjs/components/customUI/GroupingMappingCustomUI.js +3 -0
  136. package/lib/cjs/components/customUI/GroupingMappingCustomUI.js.map +1 -1
  137. package/lib/cjs/components/customUI/ManualGroupingCustomUI.d.ts +4 -0
  138. package/lib/cjs/components/customUI/ManualGroupingCustomUI.js +4 -0
  139. package/lib/cjs/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  140. package/lib/cjs/components/customUI/SearchGroupingCustomUI.d.ts +4 -0
  141. package/lib/cjs/components/customUI/SearchGroupingCustomUI.js +4 -0
  142. package/lib/cjs/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  143. package/lib/cjs/formula/FormulaDataTypeResolver.d.ts +1 -0
  144. package/lib/cjs/formula/FormulaDataTypeResolver.js +1 -0
  145. package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -1
  146. package/lib/cjs/formula/FormulaFunctionProvider.js +41 -41
  147. package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
  148. package/lib/cjs/formula/FormulaOperatorsProvider.js +3 -3
  149. package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -1
  150. package/lib/cjs/formula/FormulaTokensDataTypeResolver.js +2 -2
  151. package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -1
  152. package/lib/cjs/formula/IResult.d.ts +3 -0
  153. package/lib/cjs/formula/IResult.js.map +1 -1
  154. package/lib/cjs/formula/Types.d.ts +16 -1
  155. package/lib/cjs/formula/Types.js.map +1 -1
  156. package/lib/cjs/grouping-mapping-widget.d.ts +2 -0
  157. package/lib/cjs/grouping-mapping-widget.js +11 -1
  158. package/lib/cjs/grouping-mapping-widget.js.map +1 -1
  159. package/lib/cjs/test/GroupPropertyUtils.test.js +0 -39
  160. package/lib/cjs/test/GroupPropertyUtils.test.js.map +1 -1
  161. package/lib/cjs/test/GroupingMappingCustomUI.test.js +19 -8
  162. package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
  163. package/lib/esm/WidgetShell/GroupingMapping.d.ts +5 -5
  164. package/lib/esm/WidgetShell/GroupingMapping.js.map +1 -1
  165. package/lib/esm/WidgetShell/GroupingMappingWidget.d.ts +4 -0
  166. package/lib/esm/WidgetShell/GroupingMappingWidget.js +4 -0
  167. package/lib/esm/WidgetShell/GroupingMappingWidget.js.map +1 -1
  168. package/lib/esm/components/GroupingMappingContext.d.ts +19 -3
  169. package/lib/esm/components/GroupingMappingContext.js +27 -9
  170. package/lib/esm/components/GroupingMappingContext.js.map +1 -1
  171. package/lib/esm/components/Groups/Editing/GroupAction.d.ts +10 -2
  172. package/lib/esm/components/Groups/Editing/GroupAction.js +9 -5
  173. package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
  174. package/lib/esm/components/Groups/GroupColorLegend.d.ts +3 -3
  175. package/lib/esm/components/Groups/GroupColorLegend.js.map +1 -1
  176. package/lib/esm/components/Groups/GroupListItem.d.ts +4 -4
  177. package/lib/esm/components/Groups/GroupListItem.js +6 -3
  178. package/lib/esm/components/Groups/GroupListItem.js.map +1 -1
  179. package/lib/esm/components/Groups/GroupListItem.scss +14 -0
  180. package/lib/esm/components/Groups/GroupMenuActions.d.ts +4 -4
  181. package/lib/esm/components/Groups/GroupMenuActions.js.map +1 -1
  182. package/lib/esm/components/Groups/GroupMenuActions.scss +2 -0
  183. package/lib/esm/components/Groups/GroupOverlapProgressBar.d.ts +2 -2
  184. package/lib/esm/components/Groups/GroupOverlapProgressBar.js.map +1 -1
  185. package/lib/esm/components/Groups/Groups.d.ts +12 -4
  186. package/lib/esm/components/Groups/Groups.js +4 -0
  187. package/lib/esm/components/Groups/Groups.js.map +1 -1
  188. package/lib/esm/components/Groups/GroupsShowHideButtons.d.ts +4 -4
  189. package/lib/esm/components/Groups/GroupsShowHideButtons.js.map +1 -1
  190. package/lib/esm/components/Groups/GroupsView.d.ts +19 -11
  191. package/lib/esm/components/Groups/GroupsView.js +4 -0
  192. package/lib/esm/components/Groups/GroupsView.js.map +1 -1
  193. package/lib/esm/components/Groups/GroupsVisualization.d.ts +8 -0
  194. package/lib/esm/components/Groups/GroupsVisualization.js +8 -4
  195. package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
  196. package/lib/esm/components/Groups/OverlappedElementsInformationPanel.d.ts +3 -3
  197. package/lib/esm/components/Groups/OverlappedElementsInformationPanel.js.map +1 -1
  198. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.d.ts +2 -2
  199. package/lib/esm/components/Groups/QueryBuilder/QueryBuilderCustomUI.js.map +1 -1
  200. package/lib/esm/components/Groups/groupsHelpers.d.ts +2 -2
  201. package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
  202. package/lib/esm/components/Groups/hooks/useFetchGroups.d.ts +3 -3
  203. package/lib/esm/components/Groups/hooks/useFetchGroups.js +6 -5
  204. package/lib/esm/components/Groups/hooks/useFetchGroups.js.map +1 -1
  205. package/lib/esm/components/Groups/hooks/useGroupsOperations.d.ts +15 -7
  206. package/lib/esm/components/Groups/hooks/useGroupsOperations.js +9 -5
  207. package/lib/esm/components/Groups/hooks/useGroupsOperations.js.map +1 -1
  208. package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.d.ts +4 -4
  209. package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
  210. package/lib/esm/components/Mappings/Editing/MappingAction.d.ts +8 -0
  211. package/lib/esm/components/Mappings/Editing/MappingAction.js +7 -2
  212. package/lib/esm/components/Mappings/Editing/MappingAction.js.map +1 -1
  213. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +3 -1
  214. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
  215. package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.d.ts +1 -2
  216. package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js +4 -3
  217. package/lib/esm/components/Mappings/Import/ConfirmMappingsImport.js.map +1 -1
  218. package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js +1 -1
  219. package/lib/esm/components/Mappings/Import/MappingImportWizardModal.js.map +1 -1
  220. package/lib/esm/components/Mappings/Mappings.d.ts +8 -0
  221. package/lib/esm/components/Mappings/Mappings.js +4 -0
  222. package/lib/esm/components/Mappings/Mappings.js.map +1 -1
  223. package/lib/esm/components/Mappings/MappingsView.d.ts +7 -0
  224. package/lib/esm/components/Mappings/MappingsView.js +4 -0
  225. package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
  226. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.d.ts +1 -2
  227. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +9 -8
  228. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
  229. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +6 -5
  230. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -1
  231. package/lib/esm/components/Mappings/hooks/useFetchMappings.js +1 -1
  232. package/lib/esm/components/Mappings/hooks/useFetchMappings.js.map +1 -1
  233. package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +9 -2
  234. package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +13 -9
  235. package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
  236. package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +1 -1
  237. package/lib/esm/components/Mappings/hooks/useRunExtraction.js +20 -14
  238. package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -1
  239. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.d.ts +10 -2
  240. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +21 -8
  241. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
  242. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.d.ts +11 -3
  243. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +20 -8
  244. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
  245. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.d.ts +3 -3
  246. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +6 -4
  247. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
  248. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.d.ts +10 -2
  249. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +53 -35
  250. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
  251. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.d.ts +3 -3
  252. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js +6 -4
  253. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
  254. package/lib/esm/components/Properties/GroupColorToggle.d.ts +2 -2
  255. package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
  256. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.d.ts +12 -4
  257. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +24 -18
  258. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
  259. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.d.ts +3 -3
  260. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +6 -4
  261. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
  262. package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.d.ts +3 -5
  263. package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js +0 -26
  264. package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
  265. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +3 -3
  266. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -1
  267. package/lib/esm/components/Properties/PropertyMenu.d.ts +13 -5
  268. package/lib/esm/components/Properties/PropertyMenu.js +12 -14
  269. package/lib/esm/components/Properties/PropertyMenu.js.map +1 -1
  270. package/lib/esm/components/Properties/PropertyMenuWithVisualization.d.ts +8 -0
  271. package/lib/esm/components/Properties/PropertyMenuWithVisualization.js +4 -0
  272. package/lib/esm/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
  273. package/lib/esm/components/Properties/hooks/useFormulaValidation.d.ts +2 -1
  274. package/lib/esm/components/Properties/hooks/useFormulaValidation.js +8 -4
  275. package/lib/esm/components/Properties/hooks/useFormulaValidation.js.map +1 -1
  276. package/lib/esm/components/Properties/hooks/usePropertiesQuery.d.ts +4 -0
  277. package/lib/esm/components/Properties/hooks/usePropertiesQuery.js +8 -0
  278. package/lib/esm/components/Properties/hooks/usePropertiesQuery.js.map +1 -0
  279. package/lib/esm/components/context/ExtractionClientContext.js +3 -3
  280. package/lib/esm/components/context/ExtractionClientContext.js.map +1 -1
  281. package/lib/esm/components/context/GroupingApiConfigContext.d.ts +16 -0
  282. package/lib/esm/components/context/GroupingApiConfigContext.js +7 -0
  283. package/lib/esm/components/context/GroupingApiConfigContext.js.map +1 -1
  284. package/lib/esm/components/context/GroupsClientContext.d.ts +20 -0
  285. package/lib/esm/components/context/GroupsClientContext.js +39 -0
  286. package/lib/esm/components/context/GroupsClientContext.js.map +1 -0
  287. package/lib/esm/components/context/MappingClientContext.d.ts +12 -0
  288. package/lib/esm/components/context/MappingClientContext.js +15 -3
  289. package/lib/esm/components/context/MappingClientContext.js.map +1 -1
  290. package/lib/esm/components/context/PropertiesClientContext.d.ts +20 -0
  291. package/lib/esm/components/context/PropertiesClientContext.js +39 -0
  292. package/lib/esm/components/context/PropertiesClientContext.js.map +1 -0
  293. package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.d.ts +4 -0
  294. package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js +4 -0
  295. package/lib/esm/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  296. package/lib/esm/components/customUI/GroupingMappingCustomUI.d.ts +15 -3
  297. package/lib/esm/components/customUI/GroupingMappingCustomUI.js +3 -0
  298. package/lib/esm/components/customUI/GroupingMappingCustomUI.js.map +1 -1
  299. package/lib/esm/components/customUI/ManualGroupingCustomUI.d.ts +4 -0
  300. package/lib/esm/components/customUI/ManualGroupingCustomUI.js +4 -0
  301. package/lib/esm/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  302. package/lib/esm/components/customUI/SearchGroupingCustomUI.d.ts +4 -0
  303. package/lib/esm/components/customUI/SearchGroupingCustomUI.js +4 -0
  304. package/lib/esm/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  305. package/lib/esm/formula/FormulaDataTypeResolver.d.ts +1 -0
  306. package/lib/esm/formula/FormulaDataTypeResolver.js +1 -0
  307. package/lib/esm/formula/FormulaDataTypeResolver.js.map +1 -1
  308. package/lib/esm/formula/FormulaFunctionProvider.js +41 -41
  309. package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -1
  310. package/lib/esm/formula/FormulaOperatorsProvider.js +3 -3
  311. package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -1
  312. package/lib/esm/formula/FormulaTokensDataTypeResolver.js +2 -2
  313. package/lib/esm/formula/FormulaTokensDataTypeResolver.js.map +1 -1
  314. package/lib/esm/formula/IResult.d.ts +3 -0
  315. package/lib/esm/formula/IResult.js.map +1 -1
  316. package/lib/esm/formula/Types.d.ts +16 -1
  317. package/lib/esm/formula/Types.js.map +1 -1
  318. package/lib/esm/grouping-mapping-widget.d.ts +2 -0
  319. package/lib/esm/grouping-mapping-widget.js +2 -0
  320. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  321. package/lib/esm/test/GroupPropertyUtils.test.js +0 -39
  322. package/lib/esm/test/GroupPropertyUtils.test.js.map +1 -1
  323. package/lib/esm/test/GroupingMappingCustomUI.test.js +19 -8
  324. package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
  325. package/package.json +3 -2
  326. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +0 -4
  327. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js +0 -12
  328. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +0 -1
  329. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.d.ts +0 -4
  330. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js +0 -12
  331. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js.map +0 -1
  332. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.d.ts +0 -4
  333. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js +0 -12
  334. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js.map +0 -1
  335. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +0 -4
  336. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js +0 -8
  337. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +0 -1
  338. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.d.ts +0 -4
  339. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js +0 -8
  340. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js.map +0 -1
  341. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.d.ts +0 -4
  342. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js +0 -8
  343. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js.map +0 -1
@@ -5,21 +5,25 @@
5
5
  import { useEffect, useState } from "react";
6
6
  import { resolveFormulaDataType } from "../../../formula/FormulaDataTypeResolver";
7
7
  import { debounce } from "../../../common/utils";
8
- function validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid) {
8
+ function validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType) {
9
9
  if (!formula) {
10
10
  setFormulaErrorMessage("");
11
11
  setIsValid(false);
12
+ setDataType(undefined);
12
13
  return false;
13
14
  }
14
- const error = resolveFormulaDataType(formulaName, formula, properties).errorMessage ?? "";
15
+ const resolveFormulaType = resolveFormulaDataType(formulaName, formula, properties);
16
+ const error = resolveFormulaType.errorMessage ?? "";
15
17
  setFormulaErrorMessage(error);
16
18
  setIsValid(!error);
19
+ setDataType(resolveFormulaType.value);
17
20
  return !error;
18
21
  }
19
22
  const debouncedValidationFunc = debounce(validate, 5000);
20
23
  export function useFormulaValidation(formulaName, formula, properties, setFormulaErrorMessage) {
21
24
  const [isValid, setIsValid] = useState(false);
22
- useEffect(() => debouncedValidationFunc(formulaName, formula, properties, setFormulaErrorMessage, setIsValid), [formulaName, formula, properties, setFormulaErrorMessage]);
23
- return { isValid, forceValidation: () => validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid) };
25
+ const [inferredDataType, setDataType] = useState(undefined);
26
+ useEffect(() => debouncedValidationFunc(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType), [formulaName, formula, properties, setFormulaErrorMessage]);
27
+ return { isValid, inferredDataType, forceValidation: () => validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType) };
24
28
  }
25
29
  //# sourceMappingURL=useFormulaValidation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormulaValidation.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useFormulaValidation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,SAAS,QAAQ,CAAC,WAAmB,EAAE,OAAe,EAAE,UAAuB,EAAE,sBAA2C,EAAE,UAAgC;IAC5J,IAAI,CAAC,OAAO,EAAE;QACZ,sBAAsB,CAAC,EAAE,CAAC,CAAC;QAC3B,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,KAAK,GAAG,sBAAsB,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC;IAC1F,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC9B,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,CAAC,KAAK,CAAC;AAChB,CAAC;AAED,MAAM,uBAAuB,GAAG,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAEzD,MAAM,UAAU,oBAAoB,CAAC,WAAmB,EAAE,OAAe,EAAE,UAAuB,EAAE,sBAA2C;IAC7I,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAC3K,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAE,CAAC;AAC5H,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 { useEffect, useState } from \"react\";\nimport { resolveFormulaDataType } from \"../../../formula/FormulaDataTypeResolver\";\nimport type { PropertyMap } from \"../../../formula/Types\";\nimport { debounce } from \"../../../common/utils\";\n\nfunction validate(formulaName: string, formula: string, properties: PropertyMap, setFormulaErrorMessage: (s: string) => void, setIsValid: (b: boolean) => void): boolean {\n if (!formula) {\n setFormulaErrorMessage(\"\");\n setIsValid(false);\n return false;\n }\n\n const error = resolveFormulaDataType(formulaName, formula, properties).errorMessage ?? \"\";\n setFormulaErrorMessage(error);\n setIsValid(!error);\n return !error;\n}\n\nconst debouncedValidationFunc = debounce(validate, 5000);\n\nexport function useFormulaValidation(formulaName: string, formula: string, properties: PropertyMap, setFormulaErrorMessage: (s: string) => void) {\n const [isValid, setIsValid] = useState(false);\n useEffect(() => debouncedValidationFunc(formulaName, formula, properties, setFormulaErrorMessage, setIsValid), [formulaName, formula, properties, setFormulaErrorMessage]);\n return { isValid, forceValidation: () => validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid) };\n}\n"]}
1
+ {"version":3,"file":"useFormulaValidation.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useFormulaValidation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,SAAS,QAAQ,CAAC,WAAmB,EAAE,OAAe,EAAE,UAAuB,EAAE,sBAA2C,EAAE,UAAgC,EAAE,WAA6D;IAC3N,IAAI,CAAC,OAAO,EAAE;QACZ,sBAAsB,CAAC,EAAE,CAAC,CAAC;QAC3B,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,WAAW,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,kBAAkB,CAAC,YAAY,IAAI,EAAE,CAAC;IACpD,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC9B,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC;IACnB,WAAW,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,KAAK,CAAC;AAChB,CAAC;AAED,MAAM,uBAAuB,GAAG,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAEzD,MAAM,UAAU,oBAAoB,CAAC,WAAmB,EAAE,OAAe,EAAE,UAAuB,EAAE,sBAA2C;IAC7I,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,gBAAgB,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAuB,SAAS,CAAC,CAAC;IAClF,SAAS,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC;IACxL,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC;AAC3J,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 { useEffect, useState } from \"react\";\nimport { resolveFormulaDataType } from \"../../../formula/FormulaDataTypeResolver\";\nimport type { DataType, PropertyMap } from \"../../../formula/Types\";\nimport { debounce } from \"../../../common/utils\";\n\nfunction validate(formulaName: string, formula: string, properties: PropertyMap, setFormulaErrorMessage: (s: string) => void, setIsValid: (b: boolean) => void, setDataType: (inferredDataType: DataType | undefined) => void ): boolean {\n if (!formula) {\n setFormulaErrorMessage(\"\");\n setIsValid(false);\n setDataType(undefined);\n return false;\n }\n\n const resolveFormulaType = resolveFormulaDataType(formulaName, formula, properties);\n const error = resolveFormulaType.errorMessage ?? \"\";\n setFormulaErrorMessage(error);\n setIsValid(!error);\n setDataType(resolveFormulaType.value);\n return !error;\n}\n\nconst debouncedValidationFunc = debounce(validate, 5000);\n\nexport function useFormulaValidation(formulaName: string, formula: string, properties: PropertyMap, setFormulaErrorMessage: (s: string) => void) {\n const [isValid, setIsValid] = useState(false);\n const [inferredDataType, setDataType] = useState<DataType | undefined>(undefined);\n useEffect(() => debouncedValidationFunc(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType), [formulaName, formula, properties, setFormulaErrorMessage]);\n return { isValid, inferredDataType, forceValidation: () => validate(formulaName, formula, properties, setFormulaErrorMessage, setIsValid, setDataType) };\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { IPropertiesClient } from "@itwin/insights-client";
2
+ import type { GetAccessTokenFn } from "../../context/GroupingApiConfigContext";
3
+ export declare const usePropertiesQuery: (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, propertiesClient: IPropertiesClient) => import("@tanstack/react-query").UseQueryResult<import("@itwin/insights-client").PropertyList, unknown>;
4
+ //# sourceMappingURL=usePropertiesQuery.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ export const usePropertiesQuery = (iModelId, mappingId, groupId, getAccessToken, propertiesClient) => {
3
+ return useQuery({
4
+ queryKey: ["properties", iModelId, mappingId, groupId],
5
+ queryFn: async () => propertiesClient.getProperties(await getAccessToken(), mappingId, groupId),
6
+ });
7
+ };
8
+ //# sourceMappingURL=usePropertiesQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePropertiesQuery.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/usePropertiesQuery.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,cAAgC,EAAE,gBAAmC,EAAE,EAAE;IAChK,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;QACtD,OAAO,EAAG,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,MAAM,cAAc,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC;KACjG,CAAC,CAAC;AACL,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 { IPropertiesClient } from \"@itwin/insights-client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\n\nexport const usePropertiesQuery = (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, propertiesClient: IPropertiesClient) => {\n return useQuery({\n queryKey: [\"properties\", iModelId, mappingId, groupId],\n queryFn: async () => propertiesClient.getProperties(await getAccessToken(), mappingId, groupId),\n });\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { ExtractionClient, REPORTING_BASE_PATH } from "@itwin/insights-client";
2
1
  import { createContext, useContext } from "react";
2
+ import { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH } from "@itwin/insights-client";
3
3
  const prefixUrl = (baseUrl, prefix) => {
4
4
  if (prefix && baseUrl) {
5
5
  return baseUrl.replace("api.bentley.com", `${prefix}-api.bentley.com`);
@@ -7,8 +7,8 @@ const prefixUrl = (baseUrl, prefix) => {
7
7
  return baseUrl;
8
8
  };
9
9
  export const createDefaultExtractionClient = (prefix) => {
10
- const url = prefixUrl(REPORTING_BASE_PATH, prefix);
11
- return new ExtractionClient(url);
10
+ const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);
11
+ return new ExtractionClient(undefined, url);
12
12
  };
13
13
  export const createExtractionClient = (clientProp) => {
14
14
  if (undefined === clientProp || typeof clientProp === "string") {
@@ -1 +1 @@
1
- {"version":3,"file":"ExtractionClientContext.js","sourceRoot":"","sources":["../../../../src/components/context/ExtractionClientContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,MAAe,EAAE,EAAE;IACtD,IAAI,MAAM,IAAI,OAAO,EAAE;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,MAAM,kBAAkB,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,MAAqB,EAAqB,EAAE;IACxF,MAAM,GAAG,GAAG,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACnD,OAAO,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAA4C,EAAE,EAAE;IACrF,IAAI,SAAS,KAAK,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAC9D,OAAO,6BAA6B,CAAC,UAA0B,CAAC,CAAC;KAClE;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAoB,6BAA6B,EAAE,CAAC,CAAC;AAEzG,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { IExtractionClient } from \"@itwin/insights-client\";\nimport { ExtractionClient, REPORTING_BASE_PATH } from \"@itwin/insights-client\";\nimport { createContext, useContext } from \"react\";\nimport type { ClientPrefix } from \"./GroupingApiConfigContext\";\n\nconst prefixUrl = (baseUrl?: string, prefix?: string) => {\n if (prefix && baseUrl) {\n return baseUrl.replace(\"api.bentley.com\", `${prefix}-api.bentley.com`);\n }\n return baseUrl;\n};\n\nexport const createDefaultExtractionClient = (prefix?: ClientPrefix): IExtractionClient => {\n const url = prefixUrl(REPORTING_BASE_PATH, prefix);\n return new ExtractionClient(url);\n};\n\nexport const createExtractionClient = (clientProp: IExtractionClient | ClientPrefix) => {\n if (undefined === clientProp || typeof clientProp === \"string\") {\n return createDefaultExtractionClient(clientProp as ClientPrefix);\n }\n return clientProp;\n};\n\nexport const ExtractionClientContext = createContext<IExtractionClient>(createDefaultExtractionClient());\n\nexport const useExtractionClient = () => {\n const context = useContext(ExtractionClientContext);\n if (!context) {\n throw new Error(\n \"useExtractionClient should be used within a ExtractionClientContext provider\"\n );\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"ExtractionClientContext.js","sourceRoot":"","sources":["../../../../src/components/context/ExtractionClientContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,MAAe,EAAE,EAAE;IACtD,IAAI,MAAM,IAAI,OAAO,EAAE;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,MAAM,kBAAkB,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,MAAqB,EAAqB,EAAE;IACxF,MAAM,GAAG,GAAG,SAAS,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,IAAI,gBAAgB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAA4C,EAAE,EAAE;IACrF,IAAI,SAAS,KAAK,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAC9D,OAAO,6BAA6B,CAAC,UAA0B,CAAC,CAAC;KAClE;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAoB,6BAA6B,EAAE,CAAC,CAAC;AAEzG,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { IExtractionClient } from \"@itwin/insights-client\";\nimport { createContext, useContext } from \"react\";\nimport { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH } from \"@itwin/insights-client\";\nimport type { ClientPrefix } from \"./GroupingApiConfigContext\";\n\nconst prefixUrl = (baseUrl?: string, prefix?: string) => {\n if (prefix && baseUrl) {\n return baseUrl.replace(\"api.bentley.com\", `${prefix}-api.bentley.com`);\n }\n return baseUrl;\n};\n\nexport const createDefaultExtractionClient = (prefix?: ClientPrefix): IExtractionClient => {\n const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);\n return new ExtractionClient(undefined, url);\n};\n\nexport const createExtractionClient = (clientProp: IExtractionClient | ClientPrefix) => {\n if (undefined === clientProp || typeof clientProp === \"string\") {\n return createDefaultExtractionClient(clientProp as ClientPrefix);\n }\n return clientProp;\n};\n\nexport const ExtractionClientContext = createContext<IExtractionClient>(createDefaultExtractionClient());\n\nexport const useExtractionClient = () => {\n const context = useContext(ExtractionClientContext);\n if (!context) {\n throw new Error(\n \"useExtractionClient should be used within a ExtractionClientContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -1,14 +1,30 @@
1
1
  import type { AccessToken } from "@itwin/core-bentley";
2
2
  import type { IModelConnection } from "@itwin/core-frontend";
3
3
  import * as React from "react";
4
+ /**
5
+ * @public
6
+ */
4
7
  export declare type ClientPrefix = "" | "dev" | "qa" | undefined;
8
+ /**
9
+ * @public
10
+ */
5
11
  export declare type GetAccessTokenFn = () => Promise<AccessToken>;
12
+ /**
13
+ * @public
14
+ */
6
15
  export interface GroupingMappingApiConfig {
7
16
  getAccessToken: GetAccessTokenFn;
8
17
  iModelId: string;
9
18
  iModelConnection?: IModelConnection;
10
19
  prefix?: ClientPrefix;
11
20
  }
21
+ /**
22
+ * @public
23
+ */
12
24
  export declare const GroupingMappingApiConfigContext: React.Context<GroupingMappingApiConfig>;
25
+ /**
26
+ * Hook to access the GroupingMappingApiConfig from the context.
27
+ * @public
28
+ */
13
29
  export declare const useGroupingMappingApiConfig: () => GroupingMappingApiConfig;
14
30
  //# sourceMappingURL=GroupingApiConfigContext.d.ts.map
@@ -1,11 +1,18 @@
1
1
  import * as React from "react";
2
2
  import { createContext } from "react";
3
+ /**
4
+ * @public
5
+ */
3
6
  export const GroupingMappingApiConfigContext = createContext({
4
7
  getAccessToken: async () => "",
5
8
  iModelId: "",
6
9
  prefix: undefined,
7
10
  iModelConnection: undefined,
8
11
  });
12
+ /**
13
+ * Hook to access the GroupingMappingApiConfig from the context.
14
+ * @public
15
+ */
9
16
  export const useGroupingMappingApiConfig = () => {
10
17
  const context = React.useContext(GroupingMappingApiConfigContext);
11
18
  if (!context) {
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingApiConfigContext.js","sourceRoot":"","sources":["../../../../src/components/context/GroupingApiConfigContext.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAWtC,MAAM,CAAC,MAAM,+BAA+B,GAC1C,aAAa,CAA2B;IACtC,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,SAAS;IACjB,gBAAgB,EAAE,SAAS;CAC5B,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IAClE,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { AccessToken } from \"@itwin/core-bentley\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\n\nexport type ClientPrefix = \"\" | \"dev\" | \"qa\" | undefined;\nexport type GetAccessTokenFn = () => Promise<AccessToken>;\nexport interface GroupingMappingApiConfig {\n getAccessToken: GetAccessTokenFn;\n iModelId: string;\n iModelConnection?: IModelConnection;\n prefix?: ClientPrefix;\n}\n\nexport const GroupingMappingApiConfigContext =\n createContext<GroupingMappingApiConfig>({\n getAccessToken: async () => \"\",\n iModelId: \"\",\n prefix: undefined,\n iModelConnection: undefined,\n });\n\nexport const useGroupingMappingApiConfig = () => {\n const context = React.useContext(GroupingMappingApiConfigContext);\n if (!context) {\n throw new Error(\n \"useGroupingMappingApiConfig should be used within a GroupingMappingApiConfigContext provider\"\n );\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"GroupingApiConfigContext.js","sourceRoot":"","sources":["../../../../src/components/context/GroupingApiConfigContext.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAsBtC;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,aAAa,CAA2B;IACtC,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,SAAS;IACjB,gBAAgB,EAAE,SAAS;CAC5B,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IAClE,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { AccessToken } from \"@itwin/core-bentley\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\n\n/**\n * @public\n */\nexport type ClientPrefix = \"\" | \"dev\" | \"qa\" | undefined;\n\n/**\n * @public\n */\nexport type GetAccessTokenFn = () => Promise<AccessToken>;\n\n/**\n * @public\n */\nexport interface GroupingMappingApiConfig {\n getAccessToken: GetAccessTokenFn;\n iModelId: string;\n iModelConnection?: IModelConnection;\n prefix?: ClientPrefix;\n}\n\n/**\n * @public\n */\nexport const GroupingMappingApiConfigContext =\n createContext<GroupingMappingApiConfig>({\n getAccessToken: async () => \"\",\n iModelId: \"\",\n prefix: undefined,\n iModelConnection: undefined,\n });\n\n/**\n * Hook to access the GroupingMappingApiConfig from the context.\n * @public\n */\nexport const useGroupingMappingApiConfig = () => {\n const context = React.useContext(GroupingMappingApiConfigContext);\n if (!context) {\n throw new Error(\n \"useGroupingMappingApiConfig should be used within a GroupingMappingApiConfigContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import type { IGroupsClient } from "@itwin/insights-client";
3
+ import type { ClientPrefix } from "./GroupingApiConfigContext";
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare const createDefaultGroupsClient: (prefix?: ClientPrefix) => IGroupsClient;
8
+ /**
9
+ * @internal
10
+ */
11
+ export declare const createGroupsClient: (clientProp: IGroupsClient | ClientPrefix) => IGroupsClient;
12
+ /**
13
+ * @internal
14
+ */
15
+ export declare const GroupsClientContext: import("react").Context<IGroupsClient>;
16
+ /**
17
+ * @internal
18
+ */
19
+ export declare const useGroupsClient: () => IGroupsClient;
20
+ //# sourceMappingURL=GroupsClientContext.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { GROUPING_AND_MAPPING_BASE_PATH, GroupsClient } from "@itwin/insights-client";
2
+ import { createContext, useContext } from "react";
3
+ const prefixUrl = (baseUrl, prefix) => {
4
+ if (prefix && baseUrl) {
5
+ return baseUrl.replace("api.bentley.com", `${prefix}-api.bentley.com`);
6
+ }
7
+ return baseUrl;
8
+ };
9
+ /**
10
+ * @internal
11
+ */
12
+ export const createDefaultGroupsClient = (prefix) => {
13
+ const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);
14
+ return new GroupsClient(undefined, url);
15
+ };
16
+ /**
17
+ * @internal
18
+ */
19
+ export const createGroupsClient = (clientProp) => {
20
+ if (undefined === clientProp || typeof clientProp === "string") {
21
+ return createDefaultGroupsClient(clientProp);
22
+ }
23
+ return clientProp;
24
+ };
25
+ /**
26
+ * @internal
27
+ */
28
+ export const GroupsClientContext = createContext(createDefaultGroupsClient());
29
+ /**
30
+ * @internal
31
+ */
32
+ export const useGroupsClient = () => {
33
+ const context = useContext(GroupsClientContext);
34
+ if (!context) {
35
+ throw new Error("useGroupsClient should be used within a GroupsClientContext provider");
36
+ }
37
+ return context;
38
+ };
39
+ //# sourceMappingURL=GroupsClientContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupsClientContext.js","sourceRoot":"","sources":["../../../../src/components/context/GroupsClientContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,MAAe,EAAE,EAAE;IACtD,IAAI,MAAM,IAAI,OAAO,EAAE;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,MAAM,kBAAkB,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAqB,EAAiB,EAAE;IAChF,MAAM,GAAG,GAAG,SAAS,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,IAAI,YAAY,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAwC,EAAE,EAAE;IAC7E,IAAI,SAAS,KAAK,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAC9D,OAAO,yBAAyB,CAAC,UAA0B,CAAC,CAAC;KAC9D;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAgB,yBAAyB,EAAE,CAAC,CAAC;AAE7F;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,OAAO,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { IGroupsClient } from \"@itwin/insights-client\";\nimport { GROUPING_AND_MAPPING_BASE_PATH, GroupsClient } from \"@itwin/insights-client\";\nimport { createContext, useContext } from \"react\";\nimport type { ClientPrefix } from \"./GroupingApiConfigContext\";\n\nconst prefixUrl = (baseUrl?: string, prefix?: string) => {\n if (prefix && baseUrl) {\n return baseUrl.replace(\"api.bentley.com\", `${prefix}-api.bentley.com`);\n }\n return baseUrl;\n};\n\n/**\n * @internal\n */\nexport const createDefaultGroupsClient = (prefix?: ClientPrefix): IGroupsClient => {\n const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);\n return new GroupsClient(undefined, url);\n};\n\n/**\n * @internal\n */\nexport const createGroupsClient = (clientProp: IGroupsClient | ClientPrefix) => {\n if (undefined === clientProp || typeof clientProp === \"string\") {\n return createDefaultGroupsClient(clientProp as ClientPrefix);\n }\n return clientProp;\n};\n\n/**\n * @internal\n */\nexport const GroupsClientContext = createContext<IGroupsClient>(createDefaultGroupsClient());\n\n/**\n * @internal\n */\nexport const useGroupsClient = () => {\n const context = useContext(GroupsClientContext);\n if (!context) {\n throw new Error(\n \"useGroupsClient should be used within a GroupsClientContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -1,8 +1,20 @@
1
1
  /// <reference types="react" />
2
2
  import type { IMappingsClient } from "@itwin/insights-client";
3
3
  import type { ClientPrefix } from "./GroupingApiConfigContext";
4
+ /**
5
+ * @internal
6
+ */
4
7
  export declare const createDefaultMappingClient: (prefix?: ClientPrefix) => IMappingsClient;
8
+ /**
9
+ * @internal
10
+ */
5
11
  export declare const createMappingClient: (clientProp: IMappingsClient | ClientPrefix) => IMappingsClient;
12
+ /**
13
+ * @internal
14
+ */
6
15
  export declare const MappingClientContext: import("react").Context<IMappingsClient>;
16
+ /**
17
+ * @internal
18
+ */
7
19
  export declare const useMappingClient: () => IMappingsClient;
8
20
  //# sourceMappingURL=MappingClientContext.d.ts.map
@@ -1,4 +1,4 @@
1
- import { MappingsClient, REPORTING_BASE_PATH } from "@itwin/insights-client";
1
+ import { GROUPING_AND_MAPPING_BASE_PATH, MappingsClient } from "@itwin/insights-client";
2
2
  import { createContext, useContext } from "react";
3
3
  const prefixUrl = (baseUrl, prefix) => {
4
4
  if (prefix && baseUrl) {
@@ -6,17 +6,29 @@ const prefixUrl = (baseUrl, prefix) => {
6
6
  }
7
7
  return baseUrl;
8
8
  };
9
+ /**
10
+ * @internal
11
+ */
9
12
  export const createDefaultMappingClient = (prefix) => {
10
- const url = prefixUrl(REPORTING_BASE_PATH, prefix);
11
- return new MappingsClient(url);
13
+ const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);
14
+ return new MappingsClient(undefined, url);
12
15
  };
16
+ /**
17
+ * @internal
18
+ */
13
19
  export const createMappingClient = (clientProp) => {
14
20
  if (undefined === clientProp || typeof clientProp === "string") {
15
21
  return createDefaultMappingClient(clientProp);
16
22
  }
17
23
  return clientProp;
18
24
  };
25
+ /**
26
+ * @internal
27
+ */
19
28
  export const MappingClientContext = createContext(createDefaultMappingClient());
29
+ /**
30
+ * @internal
31
+ */
20
32
  export const useMappingClient = () => {
21
33
  const context = useContext(MappingClientContext);
22
34
  if (!context) {
@@ -1 +1 @@
1
- {"version":3,"file":"MappingClientContext.js","sourceRoot":"","sources":["../../../../src/components/context/MappingClientContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,MAAe,EAAE,EAAE;IACtD,IAAI,MAAM,IAAI,OAAO,EAAE;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,MAAM,kBAAkB,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAAqB,EAAmB,EAAE;IACnF,MAAM,GAAG,GAAG,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACnD,OAAO,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAA0C,EAAE,EAAE;IAChF,IAAI,SAAS,KAAK,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAC9D,OAAO,0BAA0B,CAAC,UAA0B,CAAC,CAAC;KAC/D;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAkB,0BAA0B,EAAE,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { IMappingsClient} from \"@itwin/insights-client\";\nimport { MappingsClient, REPORTING_BASE_PATH } from \"@itwin/insights-client\";\nimport { createContext, useContext } from \"react\";\nimport type { ClientPrefix } from \"./GroupingApiConfigContext\";\n\nconst prefixUrl = (baseUrl?: string, prefix?: string) => {\n if (prefix && baseUrl) {\n return baseUrl.replace(\"api.bentley.com\", `${prefix}-api.bentley.com`);\n }\n return baseUrl;\n};\n\nexport const createDefaultMappingClient = (prefix?: ClientPrefix): IMappingsClient => {\n const url = prefixUrl(REPORTING_BASE_PATH, prefix);\n return new MappingsClient(url);\n};\n\nexport const createMappingClient = (clientProp: IMappingsClient | ClientPrefix) => {\n if (undefined === clientProp || typeof clientProp === \"string\") {\n return createDefaultMappingClient(clientProp as ClientPrefix);\n }\n return clientProp;\n};\nexport const MappingClientContext = createContext<IMappingsClient>(createDefaultMappingClient());\n\nexport const useMappingClient = () => {\n const context = useContext(MappingClientContext);\n if (!context) {\n throw new Error(\n \"useMappingClient should be used within a MappingClientContext provider\"\n );\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"MappingClientContext.js","sourceRoot":"","sources":["../../../../src/components/context/MappingClientContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,MAAe,EAAE,EAAE;IACtD,IAAI,MAAM,IAAI,OAAO,EAAE;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,MAAM,kBAAkB,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAAqB,EAAmB,EAAE;IACnF,MAAM,GAAG,GAAG,SAAS,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,IAAI,cAAc,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAA0C,EAAE,EAAE;IAChF,IAAI,SAAS,KAAK,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAC9D,OAAO,0BAA0B,CAAC,UAA0B,CAAC,CAAC;KAC/D;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAkB,0BAA0B,EAAE,CAAC,CAAC;AAEjG;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { IMappingsClient} from \"@itwin/insights-client\";\nimport { GROUPING_AND_MAPPING_BASE_PATH, MappingsClient } from \"@itwin/insights-client\";\nimport { createContext, useContext } from \"react\";\nimport type { ClientPrefix } from \"./GroupingApiConfigContext\";\n\nconst prefixUrl = (baseUrl?: string, prefix?: string) => {\n if (prefix && baseUrl) {\n return baseUrl.replace(\"api.bentley.com\", `${prefix}-api.bentley.com`);\n }\n return baseUrl;\n};\n\n/**\n * @internal\n */\nexport const createDefaultMappingClient = (prefix?: ClientPrefix): IMappingsClient => {\n const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);\n return new MappingsClient(undefined, url);\n};\n\n/**\n * @internal\n */\nexport const createMappingClient = (clientProp: IMappingsClient | ClientPrefix) => {\n if (undefined === clientProp || typeof clientProp === \"string\") {\n return createDefaultMappingClient(clientProp as ClientPrefix);\n }\n return clientProp;\n};\n\n/**\n * @internal\n */\nexport const MappingClientContext = createContext<IMappingsClient>(createDefaultMappingClient());\n\n/**\n * @internal\n */\nexport const useMappingClient = () => {\n const context = useContext(MappingClientContext);\n if (!context) {\n throw new Error(\n \"useMappingClient should be used within a MappingClientContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import type { IPropertiesClient } from "@itwin/insights-client";
3
+ import type { ClientPrefix } from "./GroupingApiConfigContext";
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare const createDefaultPropertiesClient: (prefix?: ClientPrefix) => IPropertiesClient;
8
+ /**
9
+ * @internal
10
+ */
11
+ export declare const createPropertiesClient: (clientProp: IPropertiesClient | ClientPrefix) => IPropertiesClient;
12
+ /**
13
+ * @internal
14
+ */
15
+ export declare const PropertiesClientContext: import("react").Context<IPropertiesClient>;
16
+ /**
17
+ * @internal
18
+ */
19
+ export declare const usePropertiesClient: () => IPropertiesClient;
20
+ //# sourceMappingURL=PropertiesClientContext.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { GROUPING_AND_MAPPING_BASE_PATH, PropertiesClient } from "@itwin/insights-client";
2
+ import { createContext, useContext } from "react";
3
+ const prefixUrl = (baseUrl, prefix) => {
4
+ if (prefix && baseUrl) {
5
+ return baseUrl.replace("api.bentley.com", `${prefix}-api.bentley.com`);
6
+ }
7
+ return baseUrl;
8
+ };
9
+ /**
10
+ * @internal
11
+ */
12
+ export const createDefaultPropertiesClient = (prefix) => {
13
+ const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);
14
+ return new PropertiesClient(undefined, url);
15
+ };
16
+ /**
17
+ * @internal
18
+ */
19
+ export const createPropertiesClient = (clientProp) => {
20
+ if (undefined === clientProp || typeof clientProp === "string") {
21
+ return createDefaultPropertiesClient(clientProp);
22
+ }
23
+ return clientProp;
24
+ };
25
+ /**
26
+ * @internal
27
+ */
28
+ export const PropertiesClientContext = createContext(createDefaultPropertiesClient());
29
+ /**
30
+ * @internal
31
+ */
32
+ export const usePropertiesClient = () => {
33
+ const context = useContext(PropertiesClientContext);
34
+ if (!context) {
35
+ throw new Error("useGroupsClient should be used within a GroupsClientContext provider");
36
+ }
37
+ return context;
38
+ };
39
+ //# sourceMappingURL=PropertiesClientContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertiesClientContext.js","sourceRoot":"","sources":["../../../../src/components/context/PropertiesClientContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,MAAe,EAAE,EAAE;IACtD,IAAI,MAAM,IAAI,OAAO,EAAE;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,MAAM,kBAAkB,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,MAAqB,EAAqB,EAAE;IACxF,MAAM,GAAG,GAAG,SAAS,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,IAAI,gBAAgB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAA4C,EAAE,EAAE;IACrF,IAAI,SAAS,KAAK,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAC9D,OAAO,6BAA6B,CAAC,UAA0B,CAAC,CAAC;KAClE;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAoB,6BAA6B,EAAE,CAAC,CAAC;AAEzG;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { IPropertiesClient } from \"@itwin/insights-client\";\nimport { GROUPING_AND_MAPPING_BASE_PATH, PropertiesClient } from \"@itwin/insights-client\";\nimport { createContext, useContext } from \"react\";\nimport type { ClientPrefix } from \"./GroupingApiConfigContext\";\n\nconst prefixUrl = (baseUrl?: string, prefix?: string) => {\n if (prefix && baseUrl) {\n return baseUrl.replace(\"api.bentley.com\", `${prefix}-api.bentley.com`);\n }\n return baseUrl;\n};\n\n/**\n * @internal\n */\nexport const createDefaultPropertiesClient = (prefix?: ClientPrefix): IPropertiesClient => {\n const url = prefixUrl(GROUPING_AND_MAPPING_BASE_PATH, prefix);\n return new PropertiesClient(undefined, url);\n};\n\n/**\n * @internal\n */\nexport const createPropertiesClient = (clientProp: IPropertiesClient | ClientPrefix) => {\n if (undefined === clientProp || typeof clientProp === \"string\") {\n return createDefaultPropertiesClient(clientProp as ClientPrefix);\n }\n return clientProp;\n};\n\n/**\n * @internal\n */\nexport const PropertiesClientContext = createContext<IPropertiesClient>(createDefaultPropertiesClient());\n\n/**\n * @internal\n */\nexport const usePropertiesClient = () => {\n const context = useContext(PropertiesClientContext);\n if (!context) {\n throw new Error(\n \"useGroupsClient should be used within a GroupsClientContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import "./GroupQueryBuilderCustomUI.scss";
3
3
  import type { GroupingCustomUIProps } from "./GroupingMappingCustomUI";
4
+ /**
5
+ * A default group query builder for the Grouping Mapping Widget that uses the property grid to generate queries.
6
+ * @public
7
+ */
4
8
  export declare const GroupQueryBuilderCustomUI: ({ updateQuery, isUpdating, resetView, }: GroupingCustomUIProps) => JSX.Element;
5
9
  //# sourceMappingURL=GroupQueryBuilderCustomUI.d.ts.map
@@ -29,6 +29,10 @@ const createPropertyDataProvider = async (keys, iModelConnection) => {
29
29
  }
30
30
  return dataProvider;
31
31
  };
32
+ /**
33
+ * A default group query builder for the Grouping Mapping Widget that uses the property grid to generate queries.
34
+ * @public
35
+ */
32
36
  export const GroupQueryBuilderCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
33
37
  const { iModelConnection } = useGroupingMappingApiConfig();
34
38
  if (!iModelConnection) {
@@ -1 +1 @@
1
- {"version":3,"file":"GroupQueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/GroupQueryBuilderCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,YAAY,EA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AC,KAAK,IAAC,IAAI,EAAC,eAAe,6GAEnB,CACT,CAAC,CAAC;QACD;YACE,6BAAK,SAAS,EAAC,oCAAoC;gBACjD,oBAAC,0BAA0B,IAAC,QAAQ,EAAE,MAAM,GAAI;gBAChD,oBAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,qBAAqB;oBAC/D,oBAAC,uCAAuC,IACtC,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,qBAAqB,EAAE,qBAAqB,GAC5C,CACkC,CAClC;YACN,6BAAK,SAAS,EAAC,yBAAyB;gBACtC,oBAAC,MAAM,IACL,SAAS,EAAC,SAAS,EACnB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,kBAAkB,YAGpB,CACL,CACL,CAED,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport \"./GroupQueryBuilderCustomUI.scss\";\nimport { QueryBuilder } from \"../Groups/QueryBuilder/QueryBuilder\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport {\n DEFAULT_PROPERTY_GRID_RULESET,\n PresentationPropertyDataProvider,\n} from \"@itwin/presentation-components\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ActionButtonRendererProps } from \"@itwin/components-react\";\nimport { VirtualizedPropertyGridWithDataProvider } from \"@itwin/components-react\";\nimport { ResizableContainerObserver } from \"@itwin/core-react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { PropertyAction } from \"../Properties/PropertyAction\";\nimport { Alert, Button } from \"@itwin/itwinui-react\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\nconst createPropertyDataProvider = async (\n keys: KeySet,\n iModelConnection: IModelConnection\n): Promise<PresentationPropertyDataProvider> => {\n const dataProvider = new PresentationPropertyDataProvider({\n imodel: iModelConnection,\n ruleset: DEFAULT_PROPERTY_GRID_RULESET,\n });\n dataProvider.keys = keys;\n dataProvider.isNestedPropertyCategoryGroupingEnabled = true;\n const data = await dataProvider.getData();\n const selectedCategory = data.categories.find((category) => category.label === IModelApp.localization.getLocalizedString(\"Presentation:selectedItems.categoryLabel\"));\n if (selectedCategory) {\n selectedCategory.expand = true;\n }\n return dataProvider;\n};\n\ninterface ContainerDimensions {\n width: number;\n height: number;\n}\n\nexport const GroupQueryBuilderCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [size, setSize] = useState<ContainerDimensions>({ width: 0, height: 0 });\n const [dataProvider, setDataProvider] =\n useState<PresentationPropertyDataProvider | undefined>(undefined);\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n const [selectionKeySet, setSelectionKeyset] = useState<KeySet>(new KeySet());\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder | undefined>();\n\n useEffect(() => {\n const onSelectionChanged = async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider\n ) => {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setSelectionKeyset(keys);\n const dataProvider = await createPropertyDataProvider(keys, iModelConnection);\n setDataProvider(dataProvider);\n setQueryBuilder(new QueryBuilder(dataProvider));\n };\n\n return iModelConnection\n ? Presentation.selection.selectionChange.addListener(onSelectionChanged)\n : () => { };\n }, [iModelConnection]);\n\n const onClickResetButton = async () => {\n queryBuilder?.resetQueryBuilder();\n updateQuery(\"\");\n setCurrentPropertyList([]);\n if (resetView)\n await resetView().catch((e) =>\n /* eslint-disable no-console */\n console.error(e)\n );\n };\n\n const resize = useCallback((width, height) => setSize({ width, height }), []);\n\n const propertyContextValues = useMemo(\n () => ({\n currentPropertyList,\n setCurrentPropertyList,\n queryBuilder,\n setQuery: updateQuery,\n isUpdating: isUpdating ?? false,\n }),\n [currentPropertyList, isUpdating, queryBuilder, updateQuery]\n );\n\n const actionButtonRenderers = useMemo(\n () => [\n ({ property }: ActionButtonRendererProps) => (\n <PropertyAction property={property} />\n ),\n ],\n []\n );\n\n return (\n <div className=\"gmw-select-query-generator-container\">\n {!dataProvider || selectionKeySet.size === 0 ? (\n <Alert type='informational'>\n Please select on an element within the viewer first, then select properties to generate a group query.\n </Alert>\n ) :\n <>\n <div className=\"gmw-select-property-grid-container\">\n <ResizableContainerObserver onResize={resize} />\n <PropertyGridWrapperContext.Provider value={propertyContextValues}>\n <VirtualizedPropertyGridWithDataProvider\n dataProvider={dataProvider}\n width={size.width}\n height={size.height}\n actionButtonRenderers={actionButtonRenderers}\n />\n </PropertyGridWrapperContext.Provider>\n </div>\n <div className=\"gmw-select-reset-button\">\n <Button\n styleType=\"default\"\n size=\"small\"\n onClick={onClickResetButton}\n >\n Reset\n </Button>\n </div>\n </>\n }\n </div>\n );\n};\n\n"]}
1
+ {"version":3,"file":"GroupQueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/GroupQueryBuilderCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAK5D,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AI,EAAC,eAAe,6GAEnB,CACT,CAAC,CAAC;QACD;YACE,6BAAK,SAAS,EAAC,oCAAoC;gBACjD,oBAAC,0BAA0B,IAAC,QAAQ,EAAE,MAAM,GAAI;gBAChD,oBAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,qBAAqB;oBAC/D,oBAAC,uCAAuC,IACtC,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,qBAAqB,EAAE,qBAAqB,GAC5C,CACkC,CAClC;YACN,6BAAK,SAAS,EAAC,yBAAyB;gBACtC,oBAAC,MAAM,IACL,SAAS,EAAC,SAAS,EACnB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,kBAAkB,YAGpB,CACL,CACL,CAED,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport \"./GroupQueryBuilderCustomUI.scss\";\nimport { QueryBuilder } from \"../Groups/QueryBuilder/QueryBuilder\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\nimport {\n DEFAULT_PROPERTY_GRID_RULESET,\n PresentationPropertyDataProvider,\n} from \"@itwin/presentation-components\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { ActionButtonRendererProps } from \"@itwin/components-react\";\nimport { VirtualizedPropertyGridWithDataProvider } from \"@itwin/components-react\";\nimport { ResizableContainerObserver } from \"@itwin/core-react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { PropertyAction } from \"../Properties/PropertyAction\";\nimport { Alert, Button } from \"@itwin/itwinui-react\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\nconst createPropertyDataProvider = async (\n keys: KeySet,\n iModelConnection: IModelConnection\n): Promise<PresentationPropertyDataProvider> => {\n const dataProvider = new PresentationPropertyDataProvider({\n imodel: iModelConnection,\n ruleset: DEFAULT_PROPERTY_GRID_RULESET,\n });\n dataProvider.keys = keys;\n dataProvider.isNestedPropertyCategoryGroupingEnabled = true;\n const data = await dataProvider.getData();\n const selectedCategory = data.categories.find((category) => category.label === IModelApp.localization.getLocalizedString(\"Presentation:selectedItems.categoryLabel\"));\n if (selectedCategory) {\n selectedCategory.expand = true;\n }\n return dataProvider;\n};\n\ninterface ContainerDimensions {\n width: number;\n height: number;\n}\n\n/**\n * A default group query builder for the Grouping Mapping Widget that uses the property grid to generate queries.\n * @public\n */\nexport const GroupQueryBuilderCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n}: GroupingCustomUIProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [size, setSize] = useState<ContainerDimensions>({ width: 0, height: 0 });\n const [dataProvider, setDataProvider] =\n useState<PresentationPropertyDataProvider | undefined>(undefined);\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n const [selectionKeySet, setSelectionKeyset] = useState<KeySet>(new KeySet());\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder | undefined>();\n\n useEffect(() => {\n const onSelectionChanged = async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider\n ) => {\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setSelectionKeyset(keys);\n const dataProvider = await createPropertyDataProvider(keys, iModelConnection);\n setDataProvider(dataProvider);\n setQueryBuilder(new QueryBuilder(dataProvider));\n };\n\n return iModelConnection\n ? Presentation.selection.selectionChange.addListener(onSelectionChanged)\n : () => { };\n }, [iModelConnection]);\n\n const onClickResetButton = async () => {\n queryBuilder?.resetQueryBuilder();\n updateQuery(\"\");\n setCurrentPropertyList([]);\n if (resetView)\n await resetView().catch((e) =>\n /* eslint-disable no-console */\n console.error(e)\n );\n };\n\n const resize = useCallback((width, height) => setSize({ width, height }), []);\n\n const propertyContextValues = useMemo(\n () => ({\n currentPropertyList,\n setCurrentPropertyList,\n queryBuilder,\n setQuery: updateQuery,\n isUpdating: isUpdating ?? false,\n }),\n [currentPropertyList, isUpdating, queryBuilder, updateQuery]\n );\n\n const actionButtonRenderers = useMemo(\n () => [\n ({ property }: ActionButtonRendererProps) => (\n <PropertyAction property={property} />\n ),\n ],\n []\n );\n\n return (\n <div className=\"gmw-select-query-generator-container\">\n {!dataProvider || selectionKeySet.size === 0 ? (\n <Alert type='informational'>\n Please select on an element within the viewer first, then select properties to generate a group query.\n </Alert>\n ) :\n <>\n <div className=\"gmw-select-property-grid-container\">\n <ResizableContainerObserver onResize={resize} />\n <PropertyGridWrapperContext.Provider value={propertyContextValues}>\n <VirtualizedPropertyGridWithDataProvider\n dataProvider={dataProvider}\n width={size.width}\n height={size.height}\n actionButtonRenderers={actionButtonRenderers}\n />\n </PropertyGridWrapperContext.Provider>\n </div>\n <div className=\"gmw-select-reset-button\">\n <Button\n styleType=\"default\"\n size=\"small\"\n onClick={onClickResetButton}\n >\n Reset\n </Button>\n </div>\n </>\n }\n </div>\n );\n};\n"]}
@@ -1,11 +1,19 @@
1
- import type { Group, Mapping } from "@itwin/insights-client";
1
+ import type { GroupMinimal, Mapping } from "@itwin/insights-client";
2
2
  import type { ReactElement } from "react";
3
+ /**
4
+ * @public
5
+ */
3
6
  export declare enum GroupingMappingCustomUIType {
4
7
  Grouping = 0,
5
8
  Context = 1
6
9
  }
10
+ /**
11
+ * @public
12
+ */
7
13
  export declare type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;
8
- /** Custom UI Definitions. */
14
+ /** Custom UI Definitions.
15
+ * @public
16
+ */
9
17
  export interface IGroupingMappingCustomUI {
10
18
  /**
11
19
  * See GroupingMappingCustomUIType.
@@ -26,6 +34,7 @@ export interface IGroupingMappingCustomUI {
26
34
  }
27
35
  /**
28
36
  * Context custom UI type definition.
37
+ * @public
29
38
  */
30
39
  export interface ContextCustomUI extends IGroupingMappingCustomUI {
31
40
  /**
@@ -39,10 +48,11 @@ export interface ContextCustomUI extends IGroupingMappingCustomUI {
39
48
  /**
40
49
  * Callback function for context custom UI menu item click event.
41
50
  */
42
- onClick?: (group: Group, mapping: Mapping, iModelId: string) => void;
51
+ onClick?: (group: GroupMinimal, mapping: Mapping, iModelId: string) => void;
43
52
  }
44
53
  /**
45
54
  * Group custom UI type definition.
55
+ * @public
46
56
  */
47
57
  export interface GroupingCustomUI extends IGroupingMappingCustomUI {
48
58
  /**
@@ -57,6 +67,7 @@ export interface GroupingCustomUI extends IGroupingMappingCustomUI {
57
67
  /** Custom UI Component props definitions. */
58
68
  /**
59
69
  * Context custom UI component arguments definition.
70
+ * @public
60
71
  */
61
72
  export interface ContextCustomUIProps {
62
73
  /**
@@ -74,6 +85,7 @@ export interface ContextCustomUIProps {
74
85
  }
75
86
  /**
76
87
  * Group custom UI component arguments definition.
88
+ * @public
77
89
  */
78
90
  export interface GroupingCustomUIProps {
79
91
  /**
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @public
3
+ */
1
4
  export var GroupingMappingCustomUIType;
2
5
  (function (GroupingMappingCustomUIType) {
3
6
  GroupingMappingCustomUIType[GroupingMappingCustomUIType["Grouping"] = 0] = "Grouping";
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingMappingCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/GroupingMappingCustomUI.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,qFAAQ,CAAA;IACR,mFAAO,CAAA;AACT,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC","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 { Group, Mapping } from \"@itwin/insights-client\";\nimport type { ReactElement } from \"react\";\n\nexport enum GroupingMappingCustomUIType {\n Grouping,\n Context,\n}\n\nexport type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;\n\n/** Custom UI Definitions. */\n\nexport interface IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType;\n /**\n * Unique identifier of the custom UI.\n */\n name: string;\n /**\n * Display label in the widget.\n */\n displayLabel: string;\n /**\n * Optional icon, will be shown before display label in widget.\n */\n icon?: ReactElement;\n}\n\n/**\n * Context custom UI type definition.\n */\nexport interface ContextCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Context;\n /**\n * User defined component for UI interaction with grouping mapping widget.\n */\n uiComponent?: React.ComponentType<ContextCustomUIProps>;\n /**\n * Callback function for context custom UI menu item click event.\n */\n onClick?: (group: Group, mapping: Mapping, iModelId: string) => void;\n}\n\n/**\n * Group custom UI type definition.\n */\nexport interface GroupingCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Grouping;\n /**\n * Custom UI Component to build query interactively. Refer to SearchGroupingCustomUI/ManualGroupingCustomUI.\n */\n uiComponent: (props: GroupingCustomUIProps) => JSX.Element;\n}\n\n/** Custom UI Component props definitions. */\n\n/**\n * Context custom UI component arguments definition.\n */\nexport interface ContextCustomUIProps {\n /**\n * IModel Id.\n */\n iModelId: string;\n /**\n * Mapping Id.\n */\n mappingId: string;\n /**\n * Group Id.\n */\n groupId: string;\n}\n\n/**\n * Group custom UI component arguments definition.\n */\nexport interface GroupingCustomUIProps {\n /**\n * To validate and update current query.\n */\n updateQuery: (query: string) => void;\n /**\n * To get the query loading status.\n */\n isUpdating?: boolean;\n /**\n * To reset the viewer.\n */\n resetView?: () => Promise<void>;\n /**\n * The initial query for the Group being edited.\n */\n initialEditModeQuery?: string;\n\n}\n"]}
1
+ {"version":3,"file":"GroupingMappingCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/GroupingMappingCustomUI.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,qFAAQ,CAAA;IACR,mFAAO,CAAA;AACT,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC","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 {GroupMinimal, Mapping } from \"@itwin/insights-client\";\nimport type { ReactElement } from \"react\";\n\n/**\n * @public\n */\nexport enum GroupingMappingCustomUIType {\n Grouping,\n Context,\n}\n\n/**\n * @public\n */\nexport type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;\n\n/** Custom UI Definitions.\n * @public\n */\nexport interface IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType;\n /**\n * Unique identifier of the custom UI.\n */\n name: string;\n /**\n * Display label in the widget.\n */\n displayLabel: string;\n /**\n * Optional icon, will be shown before display label in widget.\n */\n icon?: ReactElement;\n}\n\n/**\n * Context custom UI type definition.\n * @public\n */\nexport interface ContextCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Context;\n /**\n * User defined component for UI interaction with grouping mapping widget.\n */\n uiComponent?: React.ComponentType<ContextCustomUIProps>;\n /**\n * Callback function for context custom UI menu item click event.\n */\n onClick?: (group: GroupMinimal, mapping: Mapping, iModelId: string) => void;\n}\n\n/**\n * Group custom UI type definition.\n * @public\n */\nexport interface GroupingCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Grouping;\n /**\n * Custom UI Component to build query interactively. Refer to SearchGroupingCustomUI/ManualGroupingCustomUI.\n */\n uiComponent: (props: GroupingCustomUIProps) => JSX.Element;\n}\n\n/** Custom UI Component props definitions. */\n\n/**\n * Context custom UI component arguments definition.\n * @public\n */\nexport interface ContextCustomUIProps {\n /**\n * IModel Id.\n */\n iModelId: string;\n /**\n * Mapping Id.\n */\n mappingId: string;\n /**\n * Group Id.\n */\n groupId: string;\n}\n\n/**\n * Group custom UI component arguments definition.\n * @public\n */\nexport interface GroupingCustomUIProps {\n /**\n * To validate and update current query.\n */\n updateQuery: (query: string) => void;\n /**\n * To get the query loading status.\n */\n isUpdating?: boolean;\n /**\n * To reset the viewer.\n */\n resetView?: () => Promise<void>;\n /**\n * The initial query for the Group being edited.\n */\n initialEditModeQuery?: string;\n\n}\n"]}
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import "./ManualGroupingCustomUI.scss";
3
3
  import type { GroupingCustomUIProps } from "./GroupingMappingCustomUI";
4
+ /**
5
+ * A default group query builder for the Grouping Mapping Widget that uses a manual input to generate queries.
6
+ * @public
7
+ */
4
8
  export declare const ManualGroupingCustomUI: ({ updateQuery, isUpdating, resetView, initialEditModeQuery, }: GroupingCustomUIProps) => JSX.Element;
5
9
  //# sourceMappingURL=ManualGroupingCustomUI.d.ts.map
@@ -6,6 +6,10 @@ import React from "react";
6
6
  import { Alert, Button, LabeledTextarea } from "@itwin/itwinui-react";
7
7
  import { LoadingSpinner } from "../SharedComponents/LoadingSpinner";
8
8
  import "./ManualGroupingCustomUI.scss";
9
+ /**
10
+ * A default group query builder for the Grouping Mapping Widget that uses a manual input to generate queries.
11
+ * @public
12
+ */
9
13
  export const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, initialEditModeQuery, }) => {
10
14
  const [manualInput, setManualInput] = React.useState(initialEditModeQuery ?? "");
11
15
  return (React.createElement("div", { className: 'gmw-manual-form' },
@@ -1 +1 @@
1
- {"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,+BAA+B,CAAC;AAGvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,EACT,oBAAoB,GACE,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;IAEjF,OAAO,CACL,6BAAK,SAAS,EAAC,iBAAiB;QAC9B,oBAAC,KAAK,IAAC,IAAI,EAAC,eAAe,0GAEnB;QACR,oBAAC,eAAe,IACd,KAAK,EAAC,OAAO,EACb,QAAQ,QACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,oEAAoE,GACjF;QACF,6BAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,IAAI,oBAAC,cAAc,OAAG;YACjC,oBAAC,MAAM,IAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,YAE5D;YACT,oBAAC,MAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport { LoadingSpinner } from \"../SharedComponents/LoadingSpinner\";\nimport \"./ManualGroupingCustomUI.scss\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\n\nexport const ManualGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n initialEditModeQuery,\n}: GroupingCustomUIProps) => {\n const [manualInput, setManualInput] = React.useState(initialEditModeQuery ?? \"\");\n\n return (\n <div className='gmw-manual-form'>\n <Alert type='informational'>\n Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query.\n </Alert>\n <LabeledTextarea\n label='Query'\n required\n value={manualInput}\n onChange={(event) => setManualInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement\"`}\n />\n <div className='gmw-manual-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button disabled={isUpdating} onClick={() => updateQuery(manualInput)}>\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setManualInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../src/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":"AAAA;;;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------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport { LoadingSpinner } from \"../SharedComponents/LoadingSpinner\";\nimport \"./ManualGroupingCustomUI.scss\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\n\n/**\n * A default group query builder for the Grouping Mapping Widget that uses a manual input to generate queries.\n * @public\n */\nexport const ManualGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n initialEditModeQuery,\n}: GroupingCustomUIProps) => {\n const [manualInput, setManualInput] = React.useState(initialEditModeQuery ?? \"\");\n\n return (\n <div className='gmw-manual-form'>\n <Alert type='informational'>\n Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query.\n </Alert>\n <LabeledTextarea\n label='Query'\n required\n value={manualInput}\n onChange={(event) => setManualInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement\"`}\n />\n <div className='gmw-manual-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button disabled={isUpdating} onClick={() => updateQuery(manualInput)}>\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setManualInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n"]}
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import type { GroupingCustomUIProps } from "./GroupingMappingCustomUI";
3
3
  import "./SearchGroupingCustomUI.scss";
4
+ /**
5
+ * A default group query builder for the Grouping Mapping Widget that uses a generic query template to search for elements.
6
+ * @public
7
+ */
4
8
  export declare const SearchGroupingCustomUI: ({ updateQuery, isUpdating, resetView, }: GroupingCustomUIProps) => JSX.Element;
5
9
  //# sourceMappingURL=SearchGroupingCustomUI.d.ts.map
@@ -6,6 +6,10 @@ import React from "react";
6
6
  import { Alert, Button, LabeledTextarea } from "@itwin/itwinui-react";
7
7
  import { LoadingSpinner } from "../SharedComponents/LoadingSpinner";
8
8
  import "./SearchGroupingCustomUI.scss";
9
+ /**
10
+ * A default group query builder for the Grouping Mapping Widget that uses a generic query template to search for elements.
11
+ * @public
12
+ */
9
13
  export const SearchGroupingCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
10
14
  const [searchInput, setSearchInput] = React.useState("");
11
15
  const isWrappedInQuotes = (text) => {