@itwin/grouping-mapping-widget 0.12.0 → 0.14.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 (329) hide show
  1. package/lib/cjs/grouping-mapping-widget.d.ts +3 -0
  2. package/lib/cjs/grouping-mapping-widget.js +7 -1
  3. package/lib/cjs/grouping-mapping-widget.js.map +1 -1
  4. package/lib/cjs/test/GroupingMappingCustomUI.test.js +2 -2
  5. package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
  6. package/lib/cjs/widget/components/CalculatedPropertyAction.js +7 -119
  7. package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
  8. package/lib/cjs/widget/components/CalculatedPropertyAction.scss +1 -12
  9. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.d.ts +12 -0
  10. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js +154 -0
  11. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -0
  12. package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.scss +27 -0
  13. package/lib/cjs/widget/components/ConfirmMappingsImport.js +1 -1
  14. package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
  15. package/lib/cjs/widget/components/GroupAction.js +50 -66
  16. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  17. package/lib/cjs/widget/components/GroupAction.scss +0 -18
  18. package/lib/cjs/widget/components/GroupColorLegend.d.ts +10 -0
  19. package/lib/cjs/widget/components/GroupColorLegend.js +20 -0
  20. package/lib/cjs/widget/components/GroupColorLegend.js.map +1 -0
  21. package/lib/cjs/widget/components/GroupColorLegend.scss +9 -0
  22. package/lib/cjs/widget/components/GroupColorToggle.d.ts +9 -0
  23. package/lib/cjs/widget/components/GroupColorToggle.js +69 -0
  24. package/lib/cjs/widget/components/GroupColorToggle.js.map +1 -0
  25. package/lib/cjs/widget/components/GroupDetails.d.ts +13 -0
  26. package/lib/cjs/widget/components/GroupDetails.js +34 -0
  27. package/lib/cjs/widget/components/GroupDetails.js.map +1 -0
  28. package/lib/cjs/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  29. package/lib/cjs/widget/components/GroupDetailsActionPanel.js +19 -0
  30. package/lib/cjs/widget/components/GroupDetailsActionPanel.js.map +1 -0
  31. package/lib/cjs/widget/components/GroupDetailsStep.d.ts +13 -0
  32. package/lib/cjs/widget/components/GroupDetailsStep.js +25 -0
  33. package/lib/cjs/widget/components/GroupDetailsStep.js.map +1 -0
  34. package/lib/cjs/widget/components/GroupDetailsStep.scss +11 -0
  35. package/lib/cjs/widget/components/GroupItem.d.ts +12 -0
  36. package/lib/cjs/widget/components/GroupItem.js +19 -0
  37. package/lib/cjs/widget/components/GroupItem.js.map +1 -0
  38. package/lib/cjs/widget/components/GroupMenuActions.d.ts +13 -0
  39. package/lib/cjs/widget/components/GroupMenuActions.js +68 -0
  40. package/lib/cjs/widget/components/GroupMenuActions.js.map +1 -0
  41. package/lib/cjs/widget/components/GroupMenuActions.scss +13 -0
  42. package/lib/cjs/widget/components/Grouping.d.ts +9 -5
  43. package/lib/cjs/widget/components/Grouping.js +15 -144
  44. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  45. package/lib/cjs/widget/components/Grouping.scss +0 -16
  46. package/lib/cjs/widget/components/GroupingMapping.js +4 -6
  47. package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
  48. package/lib/cjs/widget/components/GroupingMappingContent.js +1 -1
  49. package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
  50. package/lib/cjs/widget/components/GroupingMappingContext.js +1 -1
  51. package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -1
  52. package/lib/cjs/widget/components/GroupingMappingHeader.d.ts +1 -2
  53. package/lib/cjs/widget/components/GroupingMappingHeader.js +9 -2
  54. package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -1
  55. package/lib/cjs/widget/components/GroupingMappingRouter.js +20 -21
  56. package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
  57. package/lib/cjs/widget/components/GroupsAddButton.d.ts +3 -2
  58. package/lib/cjs/widget/components/GroupsAddButton.js +4 -3
  59. package/lib/cjs/widget/components/GroupsAddButton.js.map +1 -1
  60. package/lib/cjs/widget/components/GroupsAddButton.scss +2 -0
  61. package/lib/cjs/widget/components/GroupsShowHideButtons.d.ts +11 -0
  62. package/lib/cjs/widget/components/GroupsShowHideButtons.js +45 -0
  63. package/lib/cjs/widget/components/GroupsShowHideButtons.js.map +1 -0
  64. package/lib/cjs/widget/components/GroupsVisualization.d.ts +9 -0
  65. package/lib/cjs/widget/components/GroupsVisualization.js +137 -0
  66. package/lib/cjs/widget/components/GroupsVisualization.js.map +1 -0
  67. package/lib/cjs/widget/components/GroupsVisualization.scss +12 -0
  68. package/lib/cjs/widget/components/GroupsVisualizationActions.d.ts +10 -0
  69. package/lib/cjs/widget/components/GroupsVisualizationActions.js +27 -0
  70. package/lib/cjs/widget/components/GroupsVisualizationActions.js.map +1 -0
  71. package/lib/cjs/widget/components/GroupsVisualizationActions.scss +9 -0
  72. package/lib/cjs/widget/components/Mapping.js +2 -3
  73. package/lib/cjs/widget/components/Mapping.js.map +1 -1
  74. package/lib/cjs/widget/components/MappingAction.js +1 -1
  75. package/lib/cjs/widget/components/MappingAction.js.map +1 -1
  76. package/lib/cjs/widget/components/MappingImportWizardModal.js +1 -1
  77. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
  78. package/lib/cjs/widget/components/PropertyAction.d.ts +8 -0
  79. package/lib/cjs/widget/components/PropertyAction.js +100 -0
  80. package/lib/cjs/widget/components/PropertyAction.js.map +1 -0
  81. package/lib/cjs/widget/components/PropertyAction.scss +9 -0
  82. package/lib/cjs/widget/components/PropertyMenu.d.ts +1 -2
  83. package/lib/cjs/widget/components/PropertyMenu.js +6 -49
  84. package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
  85. package/lib/cjs/widget/components/PropertyMenu.scss +2 -17
  86. package/lib/cjs/widget/components/PropertyMenuWithVisualization.d.ts +8 -0
  87. package/lib/cjs/widget/components/PropertyMenuWithVisualization.js +45 -0
  88. package/lib/cjs/widget/components/PropertyMenuWithVisualization.js.map +1 -0
  89. package/lib/cjs/widget/components/PropertyMenuWithVisualization.scss +16 -0
  90. package/lib/cjs/widget/components/QueryBuilder.d.ts +1 -1
  91. package/lib/cjs/widget/components/QueryBuilder.js +4 -4
  92. package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
  93. package/lib/cjs/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  94. package/lib/cjs/widget/components/QueryBuilderActionPanel.js +17 -0
  95. package/lib/cjs/widget/components/QueryBuilderActionPanel.js.map +1 -0
  96. package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +13 -0
  97. package/lib/cjs/widget/components/QueryBuilderCustomUI.js +28 -0
  98. package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +1 -0
  99. package/lib/cjs/widget/components/QueryBuilderStep.d.ts +16 -0
  100. package/lib/cjs/widget/components/QueryBuilderStep.js +30 -0
  101. package/lib/cjs/widget/components/QueryBuilderStep.js.map +1 -0
  102. package/lib/cjs/widget/components/QueryBuilderStep.scss +18 -0
  103. package/lib/cjs/widget/components/SelectMappings.js +1 -1
  104. package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
  105. package/lib/cjs/widget/components/SharedCalculatedPropertyForms.d.ts +16 -0
  106. package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js +62 -0
  107. package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js.map +1 -0
  108. package/lib/cjs/widget/components/StatusIcon.d.ts +15 -0
  109. package/lib/cjs/widget/components/StatusIcon.js +26 -0
  110. package/lib/cjs/widget/components/StatusIcon.js.map +1 -0
  111. package/lib/cjs/widget/components/StatusIcon.scss +26 -0
  112. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +2 -2
  113. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js +1 -1
  114. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  115. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  116. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js +0 -2
  117. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  118. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  119. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +51 -32
  120. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  121. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  122. package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.d.ts +4 -0
  123. package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
  124. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -1
  125. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +3 -3
  126. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  127. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  128. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +1 -1
  129. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  130. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  131. package/lib/cjs/widget/components/groupsHelpers.d.ts +1 -1
  132. package/lib/cjs/widget/components/groupsHelpers.js +11 -14
  133. package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
  134. package/lib/cjs/widget/components/utils.d.ts +1 -1
  135. package/lib/cjs/widget/components/utils.js.map +1 -1
  136. package/lib/esm/grouping-mapping-widget.d.ts +3 -0
  137. package/lib/esm/grouping-mapping-widget.js +3 -0
  138. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  139. package/lib/esm/test/GroupingMappingCustomUI.test.js +2 -2
  140. package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
  141. package/lib/esm/widget/components/CalculatedPropertyAction.js +9 -121
  142. package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
  143. package/lib/esm/widget/components/CalculatedPropertyAction.scss +1 -12
  144. package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.d.ts +12 -0
  145. package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js +128 -0
  146. package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -0
  147. package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.scss +27 -0
  148. package/lib/esm/widget/components/ConfirmMappingsImport.js +1 -1
  149. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
  150. package/lib/esm/widget/components/GroupAction.js +53 -69
  151. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  152. package/lib/esm/widget/components/GroupAction.scss +0 -18
  153. package/lib/esm/widget/components/GroupColorLegend.d.ts +10 -0
  154. package/lib/esm/widget/components/GroupColorLegend.js +13 -0
  155. package/lib/esm/widget/components/GroupColorLegend.js.map +1 -0
  156. package/lib/esm/widget/components/GroupColorLegend.scss +9 -0
  157. package/lib/esm/widget/components/GroupColorToggle.d.ts +9 -0
  158. package/lib/esm/widget/components/GroupColorToggle.js +46 -0
  159. package/lib/esm/widget/components/GroupColorToggle.js.map +1 -0
  160. package/lib/esm/widget/components/GroupDetails.d.ts +13 -0
  161. package/lib/esm/widget/components/GroupDetails.js +27 -0
  162. package/lib/esm/widget/components/GroupDetails.js.map +1 -0
  163. package/lib/esm/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  164. package/lib/esm/widget/components/GroupDetailsActionPanel.js +12 -0
  165. package/lib/esm/widget/components/GroupDetailsActionPanel.js.map +1 -0
  166. package/lib/esm/widget/components/GroupDetailsStep.d.ts +13 -0
  167. package/lib/esm/widget/components/GroupDetailsStep.js +18 -0
  168. package/lib/esm/widget/components/GroupDetailsStep.js.map +1 -0
  169. package/lib/esm/widget/components/GroupDetailsStep.scss +11 -0
  170. package/lib/esm/widget/components/GroupItem.d.ts +12 -0
  171. package/lib/esm/widget/components/GroupItem.js +12 -0
  172. package/lib/esm/widget/components/GroupItem.js.map +1 -0
  173. package/lib/esm/widget/components/GroupMenuActions.d.ts +13 -0
  174. package/lib/esm/widget/components/GroupMenuActions.js +45 -0
  175. package/lib/esm/widget/components/GroupMenuActions.js.map +1 -0
  176. package/lib/esm/widget/components/GroupMenuActions.scss +13 -0
  177. package/lib/esm/widget/components/Grouping.d.ts +9 -5
  178. package/lib/esm/widget/components/Grouping.js +18 -147
  179. package/lib/esm/widget/components/Grouping.js.map +1 -1
  180. package/lib/esm/widget/components/Grouping.scss +0 -16
  181. package/lib/esm/widget/components/GroupingMapping.js +4 -6
  182. package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
  183. package/lib/esm/widget/components/GroupingMappingContent.js +1 -1
  184. package/lib/esm/widget/components/GroupingMappingContent.js.map +1 -1
  185. package/lib/esm/widget/components/GroupingMappingContext.js +1 -1
  186. package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -1
  187. package/lib/esm/widget/components/GroupingMappingHeader.d.ts +1 -2
  188. package/lib/esm/widget/components/GroupingMappingHeader.js +9 -2
  189. package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -1
  190. package/lib/esm/widget/components/GroupingMappingRouter.js +20 -21
  191. package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
  192. package/lib/esm/widget/components/GroupsAddButton.d.ts +3 -2
  193. package/lib/esm/widget/components/GroupsAddButton.js +5 -4
  194. package/lib/esm/widget/components/GroupsAddButton.js.map +1 -1
  195. package/lib/esm/widget/components/GroupsAddButton.scss +2 -0
  196. package/lib/esm/widget/components/GroupsShowHideButtons.d.ts +11 -0
  197. package/lib/esm/widget/components/GroupsShowHideButtons.js +22 -0
  198. package/lib/esm/widget/components/GroupsShowHideButtons.js.map +1 -0
  199. package/lib/esm/widget/components/GroupsVisualization.d.ts +9 -0
  200. package/lib/esm/widget/components/GroupsVisualization.js +114 -0
  201. package/lib/esm/widget/components/GroupsVisualization.js.map +1 -0
  202. package/lib/esm/widget/components/GroupsVisualization.scss +12 -0
  203. package/lib/esm/widget/components/GroupsVisualizationActions.d.ts +10 -0
  204. package/lib/esm/widget/components/GroupsVisualizationActions.js +20 -0
  205. package/lib/esm/widget/components/GroupsVisualizationActions.js.map +1 -0
  206. package/lib/esm/widget/components/GroupsVisualizationActions.scss +9 -0
  207. package/lib/esm/widget/components/Mapping.js +2 -3
  208. package/lib/esm/widget/components/Mapping.js.map +1 -1
  209. package/lib/esm/widget/components/MappingAction.js +1 -1
  210. package/lib/esm/widget/components/MappingAction.js.map +1 -1
  211. package/lib/esm/widget/components/MappingImportWizardModal.js +1 -1
  212. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
  213. package/lib/esm/widget/components/PropertyAction.d.ts +8 -0
  214. package/lib/esm/widget/components/PropertyAction.js +77 -0
  215. package/lib/esm/widget/components/PropertyAction.js.map +1 -0
  216. package/lib/esm/widget/components/PropertyAction.scss +9 -0
  217. package/lib/esm/widget/components/PropertyMenu.d.ts +1 -2
  218. package/lib/esm/widget/components/PropertyMenu.js +7 -50
  219. package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
  220. package/lib/esm/widget/components/PropertyMenu.scss +2 -17
  221. package/lib/esm/widget/components/PropertyMenuWithVisualization.d.ts +8 -0
  222. package/lib/esm/widget/components/PropertyMenuWithVisualization.js +22 -0
  223. package/lib/esm/widget/components/PropertyMenuWithVisualization.js.map +1 -0
  224. package/lib/esm/widget/components/PropertyMenuWithVisualization.scss +16 -0
  225. package/lib/esm/widget/components/QueryBuilder.d.ts +1 -1
  226. package/lib/esm/widget/components/QueryBuilder.js +4 -4
  227. package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
  228. package/lib/esm/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  229. package/lib/esm/widget/components/QueryBuilderActionPanel.js +10 -0
  230. package/lib/esm/widget/components/QueryBuilderActionPanel.js.map +1 -0
  231. package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +13 -0
  232. package/lib/esm/widget/components/QueryBuilderCustomUI.js +21 -0
  233. package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +1 -0
  234. package/lib/esm/widget/components/QueryBuilderStep.d.ts +16 -0
  235. package/lib/esm/widget/components/QueryBuilderStep.js +23 -0
  236. package/lib/esm/widget/components/QueryBuilderStep.js.map +1 -0
  237. package/lib/esm/widget/components/QueryBuilderStep.scss +18 -0
  238. package/lib/esm/widget/components/SelectMappings.js +1 -1
  239. package/lib/esm/widget/components/SelectMappings.js.map +1 -1
  240. package/lib/esm/widget/components/SharedCalculatedPropertyForms.d.ts +16 -0
  241. package/lib/esm/widget/components/SharedCalculatedPropertyForms.js +39 -0
  242. package/lib/esm/widget/components/SharedCalculatedPropertyForms.js.map +1 -0
  243. package/lib/esm/widget/components/StatusIcon.d.ts +15 -0
  244. package/lib/esm/widget/components/StatusIcon.js +19 -0
  245. package/lib/esm/widget/components/StatusIcon.js.map +1 -0
  246. package/lib/esm/widget/components/StatusIcon.scss +26 -0
  247. package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +2 -2
  248. package/lib/esm/widget/components/context/GroupHilitedElementsContext.js +1 -1
  249. package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  250. package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  251. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js +0 -2
  252. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  253. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  254. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js +53 -34
  255. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  256. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  257. package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.d.ts +4 -0
  258. package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
  259. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -1
  260. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +4 -4
  261. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  262. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  263. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +2 -2
  264. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  265. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  266. package/lib/esm/widget/components/groupsHelpers.d.ts +1 -1
  267. package/lib/esm/widget/components/groupsHelpers.js +11 -14
  268. package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
  269. package/lib/esm/widget/components/utils.d.ts +1 -1
  270. package/lib/esm/widget/components/utils.js.map +1 -1
  271. package/package.json +1 -1
  272. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  273. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -91
  274. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  275. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  276. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -62
  277. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  278. package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  279. package/lib/cjs/widget/components/property-grid/PropertyGrid.js +0 -198
  280. package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +0 -1
  281. package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +0 -71
  282. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  283. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +0 -77
  284. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  285. package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +0 -69
  286. package/lib/cjs/widget/components/property-grid/PropertyList.js +0 -87
  287. package/lib/cjs/widget/components/property-grid/PropertyList.js.map +0 -1
  288. package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +0 -92
  289. package/lib/cjs/widget/components/property-grid/PropertyRender.js +0 -109
  290. package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +0 -1
  291. package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +0 -22
  292. package/lib/cjs/widget/components/property-grid/PropertyView.js +0 -232
  293. package/lib/cjs/widget/components/property-grid/PropertyView.js.map +0 -1
  294. package/lib/cjs/widget/components/property-grid/PropertyView.scss +0 -77
  295. package/lib/cjs/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  296. package/lib/cjs/widget/components/property-grid/countMatchesInString.js +0 -32
  297. package/lib/cjs/widget/components/property-grid/countMatchesInString.js.map +0 -1
  298. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  299. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js +0 -65
  300. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
  301. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  302. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -68
  303. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  304. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  305. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -39
  306. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  307. package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  308. package/lib/esm/widget/components/property-grid/PropertyGrid.js +0 -172
  309. package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +0 -1
  310. package/lib/esm/widget/components/property-grid/PropertyGrid.scss +0 -71
  311. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  312. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +0 -54
  313. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  314. package/lib/esm/widget/components/property-grid/PropertyList.d.ts +0 -69
  315. package/lib/esm/widget/components/property-grid/PropertyList.js +0 -60
  316. package/lib/esm/widget/components/property-grid/PropertyList.js.map +0 -1
  317. package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +0 -92
  318. package/lib/esm/widget/components/property-grid/PropertyRender.js +0 -86
  319. package/lib/esm/widget/components/property-grid/PropertyRender.js.map +0 -1
  320. package/lib/esm/widget/components/property-grid/PropertyView.d.ts +0 -22
  321. package/lib/esm/widget/components/property-grid/PropertyView.js +0 -209
  322. package/lib/esm/widget/components/property-grid/PropertyView.js.map +0 -1
  323. package/lib/esm/widget/components/property-grid/PropertyView.scss +0 -77
  324. package/lib/esm/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  325. package/lib/esm/widget/components/property-grid/countMatchesInString.js +0 -28
  326. package/lib/esm/widget/components/property-grid/countMatchesInString.js.map +0 -1
  327. package/lib/esm/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  328. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js +0 -42
  329. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilder.js","sourceRoot":"","sources":["../../../../src/widget/components/QueryBuilder.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAyC/C,4FAA4F;AAC5F,MAAM,OAAO,YAAY;IAUvB,YAAY,QAA0C;QAI/C,eAAU,GAAG,GAAG,EAAE;YACvB,IA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;IAEO,OAAO,CAAC,CAAU;QACxB,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;;AArZuB,uCAA0B,GAChD,iCAAiC,CAAC;AACZ,wCAA2B,GACjD,iCAAiC,CAAC;AACZ,qCAAwB,GAAG,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 { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport type {\n InstanceKey,\n PropertiesField,\n} from \"@itwin/presentation-common\";\nimport type { Primitives, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { toaster } from \"@itwin/itwinui-react\";\n\nexport interface Query {\n unions: QueryUnion[];\n}\n\nexport interface QueryUnion {\n classes: QueryClass[];\n properties: QueryProperty[];\n}\n\nexport interface QueryClass {\n // schemaName.className\n className: string;\n classJoins: ClassJoin[];\n}\n\nexport interface ClassJoin {\n classProperty: string;\n joinClassName: string;\n joinClassProperty: string;\n}\n\nexport interface QueryProperty {\n className: string;\n classProperties: ClassProperty[];\n isCategory: boolean;\n isAspect: boolean;\n}\n\nexport interface ClassProperty {\n name: string;\n value: Primitives.Value;\n needsQuote: boolean;\n}\n\nexport interface AddedProperty {\n propertyRecord: PropertyRecord;\n propertiesField: PropertiesField;\n}\n\n/* This class is to build adaptive and dynamic query for find similar property selections */\nexport class QueryBuilder {\n private static readonly MULTI_ASPECT_PRIMARY_CLASS =\n \"BisCore:ElementOwnsMultiAspects\";\n private static readonly UNIQUE_ASPECT_PRIMARY_CLASS =\n \"BisCore:ElementOwnsUniqueAspect\";\n private static readonly DEFAULT_DOUBLE_PRECISION = 4;\n\n private dataProvider: PresentationPropertyDataProvider;\n private query: Query | undefined;\n\n constructor(provider: PresentationPropertyDataProvider) {\n this.dataProvider = provider;\n }\n\n public resetQuery = () => {\n this.query = undefined;\n }\n\n private isCategory(propertyField: PropertiesField): boolean {\n const classInfo =\n propertyField.properties[0].property.navigationPropertyInfo?.classInfo;\n return classInfo?.name === \"BisCore:GeometricElement3dIsInCategory\";\n }\n\n private _propertyMap: Map<string, AddedProperty> = new Map();\n\n private regenerateQuery = () => {\n this.resetQuery();\n\n for (const property of this._propertyMap.values()) {\n this.buildProperty(property.propertyRecord, property.propertiesField);\n }\n }\n\n public async addProperty(prop: PropertyRecord): Promise<boolean> {\n // TODO: only handle primitive properties now\n if (prop.value?.valueFormat !== PropertyValueFormat.Primitive) {\n toaster.warning(\"Only primitive types are supported for now.\");\n return false;\n }\n if (prop.value.value === undefined) {\n return false;\n }\n\n const propertyField = (await this.dataProvider.getFieldByPropertyRecord(\n prop,\n )) as PropertiesField;\n\n if (!propertyField) {\n toaster.negative(\n \"Error. Failed to fetch field for this property record.\",\n );\n return false;\n }\n\n this._propertyMap.set(JSON.stringify(propertyField.getFieldDescriptor()), { propertyRecord: prop, propertiesField: propertyField });\n return true;\n }\n\n public async removeProperty(prop: PropertyRecord) {\n const propertyField = (await this.dataProvider.getFieldByPropertyRecord(\n prop,\n )) as PropertiesField;\n\n this._propertyMap.delete(JSON.stringify(propertyField.getFieldDescriptor()));\n }\n\n private buildProperty(prop: PropertyRecord, propertiesField: PropertiesField) {\n if (prop.value?.valueFormat !== PropertyValueFormat.Primitive || prop.value.value === undefined) {\n toaster.negative(\n \"Error. An unexpected error has occured while building a query.\",\n );\n return;\n }\n\n function replaceAll(str: string, match: string, replacement: string) {\n return str.split(match).join(replacement);\n }\n // if property value has single quote, escape\n if (\n (typeof prop.value.value === \"string\" ||\n prop.value.value instanceof String) &&\n String(prop.value.value).indexOf(\"'\") >= 0\n ) {\n prop.value.value = replaceAll(prop.value.value.toString(), \"'\", \"''\");\n }\n\n const pathToPrimaryClass = propertiesField.parent?.pathToPrimaryClass;\n\n // get the special cases\n const isNavigation: boolean =\n prop.property.typename.toLowerCase() === \"navigation\";\n const isCategory: boolean = isNavigation && this.isCategory(propertiesField);\n\n const isAspect: boolean =\n pathToPrimaryClass?.find(\n (a) =>\n a.relationshipInfo?.name ===\n QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS ||\n a.relationshipInfo?.name === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS,\n ) !== undefined;\n\n for (let i = 0; i < propertiesField.properties.length; i++) {\n const property = propertiesField.properties[i].property;\n\n const className = property.classInfo.name.replace(\":\", \".\");\n const propertyName = isNavigation\n ? isCategory\n ? `${property.name}.CodeValue`\n : `${property.name}.id`\n : property.name;\n const propertyValue = isNavigation\n ? isCategory\n ? prop.value.displayValue ?? \"\"\n : (prop.value.value as InstanceKey).id\n : prop.value.value;\n\n if (\n !isAspect &&\n pathToPrimaryClass &&\n pathToPrimaryClass.length > 0\n ) {\n this.addRelatedToQuery(\n i,\n propertiesField,\n propertyName,\n propertyValue,\n );\n } else {\n this.addPropertyToQuery(\n i,\n className,\n propertyName,\n propertyValue,\n this.needsQuote(propertiesField),\n isCategory,\n isAspect,\n );\n }\n }\n return true;\n }\n\n private needsQuote(propertyField: PropertiesField): boolean {\n // list of property types that need quote around property value\n const typeName = propertyField.type.typeName.toLowerCase();\n return \"string\" === typeName || \"uri\" === typeName;\n }\n\n private addRelatedToQuery(\n unionIndex: number,\n propertyField: PropertiesField,\n propertyName: string,\n propertyValue: Primitives.Value,\n ) {\n const paths = [...(propertyField.parent?.pathToPrimaryClass ?? [])];\n paths.reverse().forEach((path) => {\n const sourceClassName = path.sourceClassInfo?.name.replace(\":\", \".\");\n const targetClassName = path.targetClassInfo?.name.replace(\":\", \".\");\n const relClassName = path.relationshipInfo?.name.replace(\":\", \".\");\n\n const relClassProperty = path.isForwardRelationship\n ? `SourceECInstanceId`\n : `TargetECInstanceId`;\n\n const relPropertyValue = path.isForwardRelationship\n ? `TargetECInstanceId`\n : `SourceECInstanceId`;\n\n this.addClassToQuery(\n unionIndex,\n targetClassName,\n `ECInstanceId`,\n relClassName,\n relPropertyValue\n );\n\n this.addClassToQuery(\n unionIndex,\n relClassName,\n relClassProperty,\n sourceClassName,\n `ECInstanceId`\n );\n\n if (path.sourceClassInfo?.name\n === propertyField.parent?.contentClassInfo.name) {\n this.addPropertyToQuery(\n unionIndex,\n sourceClassName,\n propertyName,\n propertyValue,\n this.needsQuote(propertyField),\n false,\n false,\n );\n }\n });\n }\n\n private addClassToQuery(\n unionIndex: number,\n className: string,\n classProperty: string,\n joinClassName: string,\n joinClassProperty: string,\n ) {\n if (this.query === undefined) {\n this.query = { unions: [] };\n }\n\n const classJoin: ClassJoin = {\n classProperty,\n joinClassName,\n joinClassProperty,\n };\n\n const queryClass: QueryClass = {\n className,\n classJoins: [classJoin],\n };\n\n if (this.query.unions.length <= unionIndex) {\n this.query.unions.push({\n classes: [queryClass],\n properties: [],\n });\n return;\n }\n\n const foundClass = this.query.unions[unionIndex].classes.find((c) =>\n c.className === className\n );\n\n if (foundClass) {\n const foundJoin = foundClass.classJoins.find((join) =>\n join.classProperty === classProperty && join.joinClassName === joinClassName && join.joinClassProperty === joinClassProperty\n );\n\n if (!foundJoin)\n foundClass.classJoins.push(classJoin);\n return;\n }\n\n this.query.unions[unionIndex].classes.push(queryClass);\n }\n\n private addPropertyToQuery(\n unionIndex: number,\n className: string,\n propertyName: string,\n propertyValue: Primitives.Value,\n needsQuote: boolean,\n isCategory: boolean,\n isAspect: boolean,\n ) {\n if (this.query === undefined) {\n this.query = { unions: [] };\n }\n\n const queryJoin: ClassProperty = {\n name: propertyName,\n value: propertyValue,\n needsQuote,\n };\n\n const queryProperty: QueryProperty = {\n className,\n isCategory,\n isAspect,\n classProperties: [queryJoin],\n };\n\n if (this.query.unions.length <= unionIndex) {\n this.query.unions.push({\n classes: [],\n properties: [queryProperty],\n });\n return;\n }\n\n const foundPropertyClass = this.query.unions[unionIndex].properties.find((p) =>\n p.className === className\n );\n\n if (foundPropertyClass) {\n const foundJoin = foundPropertyClass?.classProperties.find((join) =>\n join.name === propertyName\n );\n\n if (foundJoin) {\n foundJoin.value = propertyValue;\n return;\n }\n\n foundPropertyClass.classProperties.push(queryJoin);\n return;\n }\n\n this.query.unions[unionIndex].properties.push(queryProperty);\n }\n\n public buildQueryString() {\n this.regenerateQuery();\n if (\n this.query === undefined ||\n (this.query.unions.find((u) => u.classes.length === 0 && u.properties.length === 0))\n ) {\n return \"\";\n }\n\n const unionSegments: string[] = [];\n for (const union of this.query.unions) {\n\n const baseClass = union.classes[0];\n const baseProperty = union.properties[0];\n const baseClassName = baseClass ? baseClass.className : baseProperty?.className;\n const baseIdName = `${baseClassName}.ECInstanceId`;\n\n const selectClause = this.selectClause(baseProperty, baseClass);\n\n let querySegments: Map<string, string[]> = new Map();\n querySegments = this.relationalJoinSegments(union.classes, querySegments);\n\n const whereSegments: string[] = [];\n for (const property of union.properties) {\n if (property.isCategory) {\n if (property.className !== baseClassName)\n querySegments.set(\"BisCore.GeometricElement3d\", [`BisCore.GeometricElement3d.ECInstanceId = ${baseIdName}`]);\n\n querySegments.set(\"BisCore.Category\", [`BisCore.Category.ECInstanceId = BisCore.GeometricElement3d.category.id`]);\n whereSegments.push(this.categoryWhereQuery(property.classProperties[0].value.toString()));\n continue;\n }\n\n const joinIdName = property.isAspect\n ? `${property.className}.Element.id`\n : `${property.className}.ECInstanceId`;\n\n if (!querySegments.has(property.className) && property.className !== baseClassName)\n querySegments.set(property.className, [`${joinIdName} = ${baseIdName}`]);\n\n for (const prop of property.classProperties) {\n whereSegments.push(this.propertyQuerySegment(property.className, prop, prop.needsQuote));\n }\n }\n\n const joinClauses: string[] = [];\n for (const key of querySegments.keys()) {\n joinClauses.push(`JOIN ${key} ON ${querySegments.get(key)?.join(\" AND \")}`);\n }\n\n const whereClause = `WHERE ${whereSegments.join(\" AND \")}`;\n\n unionSegments.push([selectClause, ...joinClauses, whereClause].join(\" \"));\n }\n\n return unionSegments.join(\" UNION \");\n }\n\n private selectClause(baseProperty: QueryProperty | undefined, baseClass: QueryClass | undefined) {\n if (baseClass) {\n return `SELECT ${baseClass.className}.ECInstanceId, ${baseClass.className}.ECClassId FROM ${baseClass.className}`;\n }\n\n if (baseProperty) {\n const baseIdName = baseProperty.isAspect\n ? `${baseProperty.className}.Element.id ECInstanceId`\n : `${baseProperty.className}.ECInstanceId, ${baseProperty.className}.ECClassId`;\n\n return `SELECT ${baseIdName} FROM ${baseProperty.className}`;\n }\n\n return \"\";\n }\n\n private relationalJoinSegments = (classes: QueryClass[], querySegments: Map<string, string[]>): Map<string, string[]> => {\n for (const queryClass of classes) {\n for (const classJoin of queryClass.classJoins) {\n const querySegment = [\n ...querySegments.get(classJoin.joinClassName) ?? [],\n `${queryClass.className}.${classJoin.classProperty} = ${classJoin.joinClassName}.${classJoin.joinClassProperty}`,\n ];\n querySegments.set(classJoin.joinClassName, querySegment);\n }\n }\n\n return querySegments;\n }\n\n private propertyQuerySegment = (className: string, property: ClassProperty, needsQuote: boolean): string => {\n if (this.isFloat(property.value))\n return `ROUND(${className}.${property.name}, ` +\n `${QueryBuilder.DEFAULT_DOUBLE_PRECISION}) = ` +\n `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;\n\n const propertyValue = needsQuote ? `'${property.value}'` : property.value;\n return `${className}.${property.name} = ${propertyValue}`;\n }\n\n private categoryWhereQuery(codeValue: string): string {\n return `((BisCore.Category.CodeValue = '${codeValue}') OR (BisCore.Category.UserLabel = '${codeValue}'))`;\n }\n\n private isFloat(n: unknown): boolean {\n return Number(n) === n && n % 1 !== 0;\n }\n}\n"]}
1
+ {"version":3,"file":"QueryBuilder.js","sourceRoot":"","sources":["../../../../src/widget/components/QueryBuilder.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAyC/C,4FAA4F;AAC5F,MAAM,OAA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A0BO,kBAAkB,CAAC,SAAiB;QAC1C,OAAO,mCAAmC,SAAS,wCAAwC,SAAS,KAAK,CAAC;IAC5G,CAAC;IAEO,OAAO,CAAC,CAAU;QACxB,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;;AArZuB,uCAA0B,GAChD,iCAAiC,CAAC;AACZ,wCAA2B,GACjD,iCAAiC,CAAC;AACZ,qCAAwB,GAAG,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 { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport type {\n InstanceKey,\n PropertiesField,\n} from \"@itwin/presentation-common\";\nimport type { Primitives, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { toaster } from \"@itwin/itwinui-react\";\n\nexport interface Query {\n unions: QueryUnion[];\n}\n\nexport interface QueryUnion {\n classes: QueryClass[];\n properties: QueryProperty[];\n}\n\nexport interface QueryClass {\n // schemaName.className\n className: string;\n classJoins: ClassJoin[];\n}\n\nexport interface ClassJoin {\n classProperty: string;\n joinClassName: string;\n joinClassProperty: string;\n}\n\nexport interface QueryProperty {\n className: string;\n classProperties: ClassProperty[];\n isCategory: boolean;\n isAspect: boolean;\n}\n\nexport interface ClassProperty {\n name: string;\n value: Primitives.Value;\n needsQuote: boolean;\n}\n\nexport interface AddedProperty {\n propertyRecord: PropertyRecord;\n propertiesField: PropertiesField;\n}\n\n/* This class is to build adaptive and dynamic query for find similar property selections */\nexport class QueryBuilder {\n private static readonly MULTI_ASPECT_PRIMARY_CLASS =\n \"BisCore:ElementOwnsMultiAspects\";\n private static readonly UNIQUE_ASPECT_PRIMARY_CLASS =\n \"BisCore:ElementOwnsUniqueAspect\";\n private static readonly DEFAULT_DOUBLE_PRECISION = 4;\n\n private dataProvider: PresentationPropertyDataProvider;\n private query: Query | undefined;\n\n constructor(provider: PresentationPropertyDataProvider) {\n this.dataProvider = provider;\n }\n\n private isCategory(propertyField: PropertiesField): boolean {\n const classInfo =\n propertyField.properties[0].property.navigationPropertyInfo?.classInfo;\n return classInfo?.name === \"BisCore:GeometricElement3dIsInCategory\";\n }\n\n private _propertyMap: Map<string, AddedProperty> = new Map();\n\n public resetQueryBuilder = () => {\n this._propertyMap = new Map();\n };\n\n private regenerateQuery = () => {\n this.query = undefined;\n\n for (const property of this._propertyMap.values()) {\n this.buildProperty(property.propertyRecord, property.propertiesField);\n }\n };\n\n public async addProperty(prop: PropertyRecord): Promise<boolean> {\n // TODO: only handle primitive properties now\n if (prop.value?.valueFormat !== PropertyValueFormat.Primitive) {\n toaster.warning(\"Only primitive types are supported for now.\");\n return false;\n }\n if (prop.value.value === undefined) {\n return false;\n }\n\n const propertyField = (await this.dataProvider.getFieldByPropertyRecord(\n prop,\n )) as PropertiesField;\n\n if (!propertyField) {\n toaster.negative(\n \"Error. Failed to fetch field for this property record.\",\n );\n return false;\n }\n\n this._propertyMap.set(JSON.stringify(propertyField.getFieldDescriptor()), { propertyRecord: prop, propertiesField: propertyField });\n return true;\n }\n\n public async removeProperty(prop: PropertyRecord) {\n const propertyField = (await this.dataProvider.getFieldByPropertyRecord(\n prop,\n )) as PropertiesField;\n\n this._propertyMap.delete(JSON.stringify(propertyField.getFieldDescriptor()));\n }\n\n private buildProperty(prop: PropertyRecord, propertiesField: PropertiesField) {\n if (prop.value?.valueFormat !== PropertyValueFormat.Primitive || prop.value.value === undefined) {\n toaster.negative(\n \"Error. An unexpected error has occured while building a query.\",\n );\n return;\n }\n\n function replaceAll(str: string, match: string, replacement: string) {\n return str.split(match).join(replacement);\n }\n // if property value has single quote, escape\n if (\n (typeof prop.value.value === \"string\" ||\n prop.value.value instanceof String) &&\n String(prop.value.value).indexOf(\"'\") >= 0\n ) {\n prop.value.value = replaceAll(prop.value.value.toString(), \"'\", \"''\");\n }\n\n const pathToPrimaryClass = propertiesField.parent?.pathToPrimaryClass;\n\n // get the special cases\n const isNavigation: boolean =\n prop.property.typename.toLowerCase() === \"navigation\";\n const isCategory: boolean = isNavigation && this.isCategory(propertiesField);\n\n const isAspect: boolean =\n pathToPrimaryClass?.find(\n (a) =>\n a.relationshipInfo?.name ===\n QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS ||\n a.relationshipInfo?.name === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS,\n ) !== undefined;\n\n for (let i = 0; i < propertiesField.properties.length; i++) {\n const property = propertiesField.properties[i].property;\n\n const className = property.classInfo.name.replace(\":\", \".\");\n const propertyName = isNavigation\n ? isCategory\n ? `${property.name}.CodeValue`\n : `${property.name}.id`\n : property.name;\n const propertyValue = isNavigation\n ? isCategory\n ? prop.value.displayValue ?? \"\"\n : (prop.value.value as InstanceKey).id\n : prop.value.value;\n\n if (\n !isAspect &&\n pathToPrimaryClass &&\n pathToPrimaryClass.length > 0\n ) {\n this.addRelatedToQuery(\n i,\n propertiesField,\n propertyName,\n propertyValue,\n );\n } else {\n this.addPropertyToQuery(\n i,\n className,\n propertyName,\n propertyValue,\n this.needsQuote(propertiesField),\n isCategory,\n isAspect,\n );\n }\n }\n return true;\n }\n\n private needsQuote(propertyField: PropertiesField): boolean {\n // list of property types that need quote around property value\n const typeName = propertyField.type.typeName.toLowerCase();\n return \"string\" === typeName || \"uri\" === typeName;\n }\n\n private addRelatedToQuery(\n unionIndex: number,\n propertyField: PropertiesField,\n propertyName: string,\n propertyValue: Primitives.Value,\n ) {\n const paths = [...(propertyField.parent?.pathToPrimaryClass ?? [])];\n paths.reverse().forEach((path) => {\n const sourceClassName = path.sourceClassInfo?.name.replace(\":\", \".\");\n const targetClassName = path.targetClassInfo?.name.replace(\":\", \".\");\n const relClassName = path.relationshipInfo?.name.replace(\":\", \".\");\n\n const relClassProperty = path.isForwardRelationship\n ? `SourceECInstanceId`\n : `TargetECInstanceId`;\n\n const relPropertyValue = path.isForwardRelationship\n ? `TargetECInstanceId`\n : `SourceECInstanceId`;\n\n this.addClassToQuery(\n unionIndex,\n targetClassName,\n `ECInstanceId`,\n relClassName,\n relPropertyValue\n );\n\n this.addClassToQuery(\n unionIndex,\n relClassName,\n relClassProperty,\n sourceClassName,\n `ECInstanceId`\n );\n\n if (path.sourceClassInfo?.name\n === propertyField.parent?.contentClassInfo.name) {\n this.addPropertyToQuery(\n unionIndex,\n sourceClassName,\n propertyName,\n propertyValue,\n this.needsQuote(propertyField),\n false,\n false,\n );\n }\n });\n }\n\n private addClassToQuery(\n unionIndex: number,\n className: string,\n classProperty: string,\n joinClassName: string,\n joinClassProperty: string,\n ) {\n if (this.query === undefined) {\n this.query = { unions: [] };\n }\n\n const classJoin: ClassJoin = {\n classProperty,\n joinClassName,\n joinClassProperty,\n };\n\n const queryClass: QueryClass = {\n className,\n classJoins: [classJoin],\n };\n\n if (this.query.unions.length <= unionIndex) {\n this.query.unions.push({\n classes: [queryClass],\n properties: [],\n });\n return;\n }\n\n const foundClass = this.query.unions[unionIndex].classes.find((c) =>\n c.className === className\n );\n\n if (foundClass) {\n const foundJoin = foundClass.classJoins.find((join) =>\n join.classProperty === classProperty && join.joinClassName === joinClassName && join.joinClassProperty === joinClassProperty\n );\n\n if (!foundJoin)\n foundClass.classJoins.push(classJoin);\n return;\n }\n\n this.query.unions[unionIndex].classes.push(queryClass);\n }\n\n private addPropertyToQuery(\n unionIndex: number,\n className: string,\n propertyName: string,\n propertyValue: Primitives.Value,\n needsQuote: boolean,\n isCategory: boolean,\n isAspect: boolean,\n ) {\n if (this.query === undefined) {\n this.query = { unions: [] };\n }\n\n const queryJoin: ClassProperty = {\n name: propertyName,\n value: propertyValue,\n needsQuote,\n };\n\n const queryProperty: QueryProperty = {\n className,\n isCategory,\n isAspect,\n classProperties: [queryJoin],\n };\n\n if (this.query.unions.length <= unionIndex) {\n this.query.unions.push({\n classes: [],\n properties: [queryProperty],\n });\n return;\n }\n\n const foundPropertyClass = this.query.unions[unionIndex].properties.find((p) =>\n p.className === className\n );\n\n if (foundPropertyClass) {\n const foundJoin = foundPropertyClass?.classProperties.find((join) =>\n join.name === propertyName\n );\n\n if (foundJoin) {\n foundJoin.value = propertyValue;\n return;\n }\n\n foundPropertyClass.classProperties.push(queryJoin);\n return;\n }\n\n this.query.unions[unionIndex].properties.push(queryProperty);\n }\n\n public buildQueryString() {\n this.regenerateQuery();\n if (\n this.query === undefined ||\n (this.query.unions.find((u) => u.classes.length === 0 && u.properties.length === 0))\n ) {\n return \"\";\n }\n\n const unionSegments: string[] = [];\n for (const union of this.query.unions) {\n\n const baseClass = union.classes[0];\n const baseProperty = union.properties[0];\n const baseClassName = baseClass ? baseClass.className : baseProperty?.className;\n const baseIdName = `${baseClassName}.ECInstanceId`;\n\n const selectClause = this.selectClause(baseProperty, baseClass);\n\n let querySegments: Map<string, string[]> = new Map();\n querySegments = this.relationalJoinSegments(union.classes, querySegments);\n\n const whereSegments: string[] = [];\n for (const property of union.properties) {\n if (property.isCategory) {\n if (property.className !== baseClassName)\n querySegments.set(\"BisCore.GeometricElement3d\", [`BisCore.GeometricElement3d.ECInstanceId = ${baseIdName}`]);\n\n querySegments.set(\"BisCore.Category\", [`BisCore.Category.ECInstanceId = BisCore.GeometricElement3d.category.id`]);\n whereSegments.push(this.categoryWhereQuery(property.classProperties[0].value.toString()));\n continue;\n }\n\n const joinIdName = property.isAspect\n ? `${property.className}.Element.id`\n : `${property.className}.ECInstanceId`;\n\n if (!querySegments.has(property.className) && property.className !== baseClassName)\n querySegments.set(property.className, [`${joinIdName} = ${baseIdName}`]);\n\n for (const prop of property.classProperties) {\n whereSegments.push(this.propertyQuerySegment(property.className, prop, prop.needsQuote));\n }\n }\n\n const joinClauses: string[] = [];\n for (const key of querySegments.keys()) {\n joinClauses.push(`JOIN ${key} ON ${querySegments.get(key)?.join(\" AND \")}`);\n }\n\n const whereClause = `WHERE ${whereSegments.join(\" AND \")}`;\n\n unionSegments.push([selectClause, ...joinClauses, whereClause].join(\" \"));\n }\n\n return unionSegments.join(\" UNION \");\n }\n\n private selectClause(baseProperty: QueryProperty | undefined, baseClass: QueryClass | undefined) {\n if (baseClass) {\n return `SELECT ${baseClass.className}.ECInstanceId, ${baseClass.className}.ECClassId FROM ${baseClass.className}`;\n }\n\n if (baseProperty) {\n const baseIdName = baseProperty.isAspect\n ? `${baseProperty.className}.Element.id ECInstanceId`\n : `${baseProperty.className}.ECInstanceId, ${baseProperty.className}.ECClassId`;\n\n return `SELECT ${baseIdName} FROM ${baseProperty.className}`;\n }\n\n return \"\";\n }\n\n private relationalJoinSegments = (classes: QueryClass[], querySegments: Map<string, string[]>): Map<string, string[]> => {\n for (const queryClass of classes) {\n for (const classJoin of queryClass.classJoins) {\n const querySegment = [\n ...querySegments.get(classJoin.joinClassName) ?? [],\n `${queryClass.className}.${classJoin.classProperty} = ${classJoin.joinClassName}.${classJoin.joinClassProperty}`,\n ];\n querySegments.set(classJoin.joinClassName, querySegment);\n }\n }\n\n return querySegments;\n };\n\n private propertyQuerySegment = (className: string, property: ClassProperty, needsQuote: boolean): string => {\n if (this.isFloat(property.value))\n return `ROUND(${className}.${property.name}, ` +\n `${QueryBuilder.DEFAULT_DOUBLE_PRECISION}) = ` +\n `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;\n\n const propertyValue = needsQuote ? `'${property.value}'` : property.value;\n return `${className}.${property.name} = ${propertyValue}`;\n };\n\n private categoryWhereQuery(codeValue: string): string {\n return `((BisCore.Category.CodeValue = '${codeValue}') OR (BisCore.Category.UserLabel = '${codeValue}'))`;\n }\n\n private isFloat(n: unknown): boolean {\n return Number(n) === n && n % 1 !== 0;\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export interface QueryBuilderActionPanelProps {
3
+ onClickNext: () => void;
4
+ }
5
+ export declare const QueryBuilderActionPanel: ({ onClickNext }: QueryBuilderActionPanelProps) => JSX.Element;
6
+ //# sourceMappingURL=QueryBuilderActionPanel.d.ts.map
@@ -0,0 +1,10 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { Button } from "@itwin/itwinui-react";
6
+ import React from "react";
7
+ export const QueryBuilderActionPanel = ({ onClickNext }) => {
8
+ return (React.createElement(Button, { styleType: 'high-visibility', id: 'save-app', onClick: onClickNext }, "Next"));
9
+ };
10
+ //# sourceMappingURL=QueryBuilderActionPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilderActionPanel.js","sourceRoot":"","sources":["../../../../src/widget/components/QueryBuilderActionPanel.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,WAAW,EAAgC,EAAE,EAAE;IACvF,OAAO,CACL,oBAAC,MAAM,IACL,SAAS,EAAC,iBAAiB,EAC3B,EAAE,EAAC,UAAU,EACb,OAAO,EAAE,WAAW,WAGb,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { Button } from \"@itwin/itwinui-react\";\nimport React from \"react\";\n\nexport interface QueryBuilderActionPanelProps {\n onClickNext: () => void;\n}\n\nexport const QueryBuilderActionPanel = ({ onClickNext }: QueryBuilderActionPanelProps) => {\n return (\n <Button\n styleType='high-visibility'\n id='save-app'\n onClick={onClickNext}\n >\n Next\n </Button>\n );\n};\n"]}
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { GroupingCustomUI } from "./customUI/GroupingMappingCustomUI";
3
+ import type { Group } from "@itwin/insights-client";
4
+ export interface QueryBuilderCustomUIProps {
5
+ queryGenerationType: string;
6
+ groupUIs: GroupingCustomUI[];
7
+ isUpdating: boolean;
8
+ resetView: () => Promise<void>;
9
+ setQuery: (query: string) => void;
10
+ group?: Group;
11
+ }
12
+ export declare const QueryBuilderCustomUI: ({ queryGenerationType, groupUIs, isUpdating, resetView, setQuery, group, }: QueryBuilderCustomUIProps) => JSX.Element;
13
+ //# sourceMappingURL=QueryBuilderCustomUI.d.ts.map
@@ -0,0 +1,21 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import React from "react";
6
+ import { EmptyMessage } from "./utils";
7
+ export const QueryBuilderCustomUI = ({ queryGenerationType, groupUIs, isUpdating, resetView, setQuery, group, }) => {
8
+ if (queryGenerationType && queryGenerationType.length > 0) {
9
+ const selectedCustomUI = groupUIs.find((e) => e.name === queryGenerationType);
10
+ if (selectedCustomUI) {
11
+ return React.createElement(selectedCustomUI.uiComponent, {
12
+ updateQuery: setQuery,
13
+ isUpdating,
14
+ resetView,
15
+ initialEditModeQuery: group === null || group === void 0 ? void 0 : group.query,
16
+ });
17
+ }
18
+ }
19
+ return React.createElement(EmptyMessage, { message: "No query generation method selected. " });
20
+ };
21
+ //# sourceMappingURL=QueryBuilderCustomUI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../src/widget/components/QueryBuilderCustomUI.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAYvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EACnC,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,EACR,KAAK,GACqB,EAAE,EAAE;IAC9B,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;QACzD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAAC;QAC9E,IAAI,gBAAgB,EAAE;YACpB,OAAO,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,WAAW,EAAE;gBACvD,WAAW,EAAE,QAAQ;gBACrB,UAAU;gBACV,SAAS;gBACT,oBAAoB,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK;aACnC,CAAC,CAAC;SACJ;KACF;IACD,OAAO,oBAAC,YAAY,IAAC,OAAO,EAAC,uCAAuC,GAAG,CAAC;AAC1E,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport type { GroupingCustomUI } from \"./customUI/GroupingMappingCustomUI\";\nimport { EmptyMessage } from \"./utils\";\nimport type { Group } from \"@itwin/insights-client\";\n\nexport interface QueryBuilderCustomUIProps {\n queryGenerationType: string;\n groupUIs: GroupingCustomUI[];\n isUpdating: boolean;\n resetView: () => Promise<void>;\n setQuery: (query: string) => void;\n group?: Group;\n}\n\nexport const QueryBuilderCustomUI = ({\n queryGenerationType,\n groupUIs,\n isUpdating,\n resetView,\n setQuery,\n group,\n}: QueryBuilderCustomUIProps) => {\n if (queryGenerationType && queryGenerationType.length > 0) {\n const selectedCustomUI = groupUIs.find((e) => e.name === queryGenerationType);\n if (selectedCustomUI) {\n return React.createElement(selectedCustomUI.uiComponent, {\n updateQuery: setQuery,\n isUpdating,\n resetView,\n initialEditModeQuery: group?.query,\n });\n }\n }\n return <EmptyMessage message=\"No query generation method selected. \" />;\n};\n"]}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import type { SelectOption } from "@itwin/itwinui-react";
3
+ import type { QueryBuilderCustomUIProps } from "./QueryBuilderCustomUI";
4
+ import "./QueryBuilderStep.scss";
5
+ declare const defaultDisplayStrings: {
6
+ groupBy: string;
7
+ };
8
+ export interface QueryBuilderStepProps extends QueryBuilderCustomUIProps {
9
+ isHidden: boolean;
10
+ onChange: (value: string) => Promise<void>;
11
+ getOptions: SelectOption<string>[];
12
+ displayStrings?: Partial<typeof defaultDisplayStrings>;
13
+ }
14
+ export declare const QueryBuilderStep: ({ isHidden, onChange, getOptions, displayStrings: userDisplayStrings, ...rest }: QueryBuilderStepProps) => JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=QueryBuilderStep.d.ts.map
@@ -0,0 +1,23 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import React from "react";
6
+ import { ComboBox, Fieldset, Label } from "@itwin/itwinui-react";
7
+ import { QueryBuilderCustomUI } from "./QueryBuilderCustomUI";
8
+ import "./QueryBuilderStep.scss";
9
+ const defaultDisplayStrings = {
10
+ groupBy: "Group By",
11
+ };
12
+ export const QueryBuilderStep = ({ isHidden, onChange, getOptions, displayStrings: userDisplayStrings, ...rest }) => {
13
+ const containerClassName = isHidden ? "gmw-hide" : "gmw-query-builder-container";
14
+ const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
15
+ return (React.createElement(Fieldset, { legend: displayStrings.groupBy, className: containerClassName },
16
+ React.createElement("span", null,
17
+ React.createElement(Label, { htmlFor: 'query-combo-input' }, "Query Generation Tool"),
18
+ React.createElement(ComboBox, { value: rest.queryGenerationType, inputProps: {
19
+ id: "query-combo-input",
20
+ }, options: getOptions, onChange: onChange })),
21
+ React.createElement(QueryBuilderCustomUI, { ...rest })));
22
+ };
23
+ //# sourceMappingURL=QueryBuilderStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilderStep.js","sourceRoot":"","sources":["../../../../src/widget/components/QueryBuilderStep.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,yBAAyB,CAAC;AAEjC,MAAM,qBAAqB,GAAG;IAC5B,OAAO,EAAE,UAAU;CACpB,CAAC;AASF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAyB,EAAE,EAAE;IACzI,MAAM,kBAAkB,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,6BAA6B,CAAC;IAEjF,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAClC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,qBAAqB,EAAE,GAAG,kBAAkB,EAAE,CAAC,EAC3D,CAAC,kBAAkB,CAAC,CACrB,CAAC;IAEF,OAAO,CACL,oBAAC,QAAQ,IAAC,MAAM,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,kBAAkB;QACrE;YACE,oBAAC,KAAK,IAAC,OAAO,EAAC,mBAAmB,4BAA8B;YAChE,oBAAC,QAAQ,IACP,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAC/B,UAAU,EAAE;oBACV,EAAE,EAAE,mBAAmB;iBACxB,EACD,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,GAClB,CACG;QACP,oBAAC,oBAAoB,OACf,IAAI,GACR,CACO,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { ComboBox, Fieldset, Label } from \"@itwin/itwinui-react\";\nimport type { QueryBuilderCustomUIProps } from \"./QueryBuilderCustomUI\";\nimport { QueryBuilderCustomUI } from \"./QueryBuilderCustomUI\";\nimport \"./QueryBuilderStep.scss\";\n\nconst defaultDisplayStrings = {\n groupBy: \"Group By\",\n};\n\nexport interface QueryBuilderStepProps extends QueryBuilderCustomUIProps {\n isHidden: boolean;\n onChange: (value: string) => Promise<void>;\n getOptions: SelectOption<string>[];\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nexport const QueryBuilderStep = ({ isHidden, onChange, getOptions, displayStrings: userDisplayStrings, ...rest }: QueryBuilderStepProps) => {\n const containerClassName = isHidden ? \"gmw-hide\" : \"gmw-query-builder-container\";\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n return (\n <Fieldset legend={displayStrings.groupBy} className={containerClassName}>\n <span>\n <Label htmlFor='query-combo-input'>Query Generation Tool</Label>\n <ComboBox\n value={rest.queryGenerationType}\n inputProps={{\n id: \"query-combo-input\",\n }}\n options={getOptions}\n onChange={onChange}\n />\n </span>\n <QueryBuilderCustomUI\n {...rest}\n />\n </Fieldset>\n );\n};\n"]}
@@ -0,0 +1,18 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "~@itwin/itwinui-css/scss/variables";
6
+
7
+ .gmw-hide {
8
+ display: none;
9
+ }
10
+ .gmw-query-builder-container {
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: $iui-baseline;
14
+ flex-grow: 1;
15
+ min-width: 0;
16
+ min-height: 0;
17
+ overflow: auto;
18
+ }
@@ -30,7 +30,7 @@ const SelectMappings = ({ iModelId, onSelect, onCancel, backFn, displayStrings:
30
30
  useEffect(() => {
31
31
  void fetchMappings(setMappings, iModelId, setIsLoading, getAccessToken, mappingClient);
32
32
  }, [getAccessToken, mappingClient, iModelId, setIsLoading]);
33
- const displayStrings = { ...defaultDisplayStrings, ...userDisplayStrings };
33
+ const displayStrings = React.useMemo(() => ({ ...defaultDisplayStrings, ...userDisplayStrings }), [userDisplayStrings]);
34
34
  const mappingsColumns = useMemo(() => [
35
35
  {
36
36
  Header: "Table",
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMappings.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectMappings.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,MAAM,EACN,KAAK,EACL,YAAY,EACZ,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEjF,MAAM,qBAAqB,GAAG;IAC5B,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,aAAa,GAAG,KAAK,EACzB,WAA4D,EAC5D,QAAgB,EAChB,YAA2D,EAC3D,cAAgC,EAChC,cAA+B,EAC/B,EAAE;IACF,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAA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OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type {\n TablePaginatorRendererProps,\n} from \"@itwin/itwinui-react\";\nimport {\n Button,\n Table,\n tableFilters,\n TablePaginator,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { IMappingsClient, Mapping } from \"@itwin/insights-client\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport type { IMappingTyped } from \"./Mapping\";\nimport \"./SelectMapping.scss\";\nimport { handleError } from \"./utils\";\nimport type { GetAccessTokenFn } from \"./context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n};\n\nconst fetchMappings = async (\n setMappings: React.Dispatch<React.SetStateAction<Mapping[]>>,\n iModelId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>,\n getAccessToken: GetAccessTokenFn,\n mappingsClient: IMappingsClient\n) => {\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const mappings = await mappingsClient.getMappings(accessToken, iModelId);\n setMappings(mappings);\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n};\n\ninterface SelectMappingsProps {\n iModelId: string;\n onSelect: (selectedMappings: IMappingTyped[]) => void;\n onCancel: () => void;\n backFn: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nconst SelectMappings = ({\n iModelId,\n onSelect,\n onCancel,\n backFn,\n displayStrings: userDisplayStrings,\n}: SelectMappingsProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [mappings, setMappings] = useState<Mapping[]>([]);\n\n useEffect(() => {\n void fetchMappings(setMappings, iModelId, setIsLoading, getAccessToken, mappingClient);\n }, [getAccessToken, mappingClient, iModelId, setIsLoading]);\n\n const displayStrings = { ...defaultDisplayStrings, ...userDisplayStrings };\n\n const mappingsColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"mappingName\",\n Header: `${displayStrings.mappings}`,\n accessor: \"mappingName\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"description\",\n Header: \"Description\",\n accessor: \"description\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n },\n ],\n [displayStrings.mappings]\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback(\n (props: TablePaginatorRendererProps) => (\n <TablePaginator {...props} pageSizeList={pageSizeList} />\n ),\n [pageSizeList]\n );\n\n return (\n <div className='gmw-select-mapping-container'>\n <Table<IMappingTyped>\n data={mappings}\n columns={mappingsColumns}\n className='gmw-select-mapping-table'\n emptyTableContent={`No ${displayStrings.mappings} available.`}\n isSortable\n isSelectable\n isLoading={isLoading}\n onSelect={(selectData: IMappingTyped[] | undefined) => {\n selectData && setSelectedMappings(selectData);\n }}\n paginatorRenderer={paginator}\n />\n <div className='gmw-import-action-panel'>\n <Button onClick={backFn}>Back</Button>\n <Button\n styleType='high-visibility'\n onClick={() => {\n onSelect(selectedMappings);\n }}\n disabled={isLoading || selectedMappings.length === 0}\n >\n Next\n </Button>\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectMappings;\n"]}
1
+ {"version":3,"file":"SelectMappings.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectMappings.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,MAAM,EACN,KAAK,EACL,YAAY,EACZ,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,EA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,EAAE,QAAQ,EACd,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,0BAA0B,EACpC,iBAAiB,EAAE,MAAM,cAAc,CAAC,QAAQ,aAAa,EAC7D,UAAU,QACV,YAAY,QACZ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,UAAuC,EAAE,EAAE;gBACpD,UAAU,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;YAChD,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B;QACF,6BAAK,SAAS,EAAC,yBAAyB;YACtC,oBAAC,MAAM,IAAC,OAAO,EAAE,MAAM,WAAe;YACtC,oBAAC,MAAM,IACL,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,GAAG,EAAE;oBACZ,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBAC7B,CAAC,EACD,QAAQ,EAAE,SAAS,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,WAG7C;YACT,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type {\n TablePaginatorRendererProps,\n} from \"@itwin/itwinui-react\";\nimport {\n Button,\n Table,\n tableFilters,\n TablePaginator,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { IMappingsClient, Mapping } from \"@itwin/insights-client\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport type { IMappingTyped } from \"./Mapping\";\nimport \"./SelectMapping.scss\";\nimport { handleError } from \"./utils\";\nimport type { GetAccessTokenFn } from \"./context/GroupingApiConfigContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\nconst defaultDisplayStrings = {\n mappings: \"Mappings\",\n};\n\nconst fetchMappings = async (\n setMappings: React.Dispatch<React.SetStateAction<Mapping[]>>,\n iModelId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>,\n getAccessToken: GetAccessTokenFn,\n mappingsClient: IMappingsClient\n) => {\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const mappings = await mappingsClient.getMappings(accessToken, iModelId);\n setMappings(mappings);\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n};\n\ninterface SelectMappingsProps {\n iModelId: string;\n onSelect: (selectedMappings: IMappingTyped[]) => void;\n onCancel: () => void;\n backFn: () => void;\n displayStrings?: Partial<typeof defaultDisplayStrings>;\n}\n\nconst SelectMappings = ({\n iModelId,\n onSelect,\n onCancel,\n backFn,\n displayStrings: userDisplayStrings,\n}: SelectMappingsProps) => {\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [selectedMappings, setSelectedMappings] = useState<IMappingTyped[]>([]);\n const [mappings, setMappings] = useState<Mapping[]>([]);\n\n useEffect(() => {\n void fetchMappings(setMappings, iModelId, setIsLoading, getAccessToken, mappingClient);\n }, [getAccessToken, mappingClient, iModelId, setIsLoading]);\n\n const displayStrings = React.useMemo(\n () => ({ ...defaultDisplayStrings, ...userDisplayStrings }),\n [userDisplayStrings]\n );\n\n const mappingsColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"mappingName\",\n Header: `${displayStrings.mappings}`,\n accessor: \"mappingName\",\n Filter: tableFilters.TextFilter(),\n },\n {\n id: \"description\",\n Header: \"Description\",\n accessor: \"description\",\n Filter: tableFilters.TextFilter(),\n },\n ],\n },\n ],\n [displayStrings.mappings]\n );\n\n const pageSizeList = useMemo(() => [10, 25, 50], []);\n const paginator = useCallback(\n (props: TablePaginatorRendererProps) => (\n <TablePaginator {...props} pageSizeList={pageSizeList} />\n ),\n [pageSizeList]\n );\n\n return (\n <div className='gmw-select-mapping-container'>\n <Table<IMappingTyped>\n data={mappings}\n columns={mappingsColumns}\n className='gmw-select-mapping-table'\n emptyTableContent={`No ${displayStrings.mappings} available.`}\n isSortable\n isSelectable\n isLoading={isLoading}\n onSelect={(selectData: IMappingTyped[] | undefined) => {\n selectData && setSelectedMappings(selectData);\n }}\n paginatorRenderer={paginator}\n />\n <div className='gmw-import-action-panel'>\n <Button onClick={backFn}>Back</Button>\n <Button\n styleType='high-visibility'\n onClick={() => {\n onSelect(selectedMappings);\n }}\n disabled={isLoading || selectedMappings.length === 0}\n >\n Next\n </Button>\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectMappings;\n"]}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { CalculatedPropertyType } from "@itwin/insights-client";
3
+ import type { SelectOption } from "@itwin/itwinui-react";
4
+ import type SimpleReactValidator from "simple-react-validator";
5
+ interface SharedCalculatedPropertyFormsProps {
6
+ propertyName: string;
7
+ setPropertyName: (value: string) => void;
8
+ type: CalculatedPropertyType | undefined;
9
+ setType: (value: CalculatedPropertyType | undefined) => void;
10
+ validator: SimpleReactValidator;
11
+ itemRenderer?: (option: SelectOption<string>) => JSX.Element;
12
+ selectedItemRenderer?: (option: SelectOption<string>) => JSX.Element;
13
+ }
14
+ export declare const SharedCalculatedPropertyForms: ({ propertyName, setPropertyName, type, setType, validator, itemRenderer, selectedItemRenderer, }: SharedCalculatedPropertyFormsProps) => JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=SharedCalculatedPropertyForms.d.ts.map
@@ -0,0 +1,39 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { CalculatedPropertyType, } from "@itwin/insights-client";
6
+ import React, { useCallback } from "react";
7
+ import { NAME_REQUIREMENTS } from "../hooks/useValidator";
8
+ import { LabeledInput, LabeledSelect } from "@itwin/itwinui-react";
9
+ export const SharedCalculatedPropertyForms = ({ propertyName, setPropertyName, type, setType, validator, itemRenderer, selectedItemRenderer, }) => {
10
+ const generateOptionsFromCalculatedPropertyType = useCallback(() => {
11
+ const options = [];
12
+ const indexableEnum = CalculatedPropertyType;
13
+ for (const key in indexableEnum) {
14
+ if (typeof indexableEnum[key] === "string" && key !== "Undefined") {
15
+ // Generate labels by adding space between capitals
16
+ const label = key
17
+ .replace(/([A-Z])/g, " $1")
18
+ .trim()
19
+ .replace(/^\w/, (c) => c.toUpperCase());
20
+ options.push({ value: indexableEnum[key], label });
21
+ }
22
+ }
23
+ return options;
24
+ }, []);
25
+ return (React.createElement(React.Fragment, null,
26
+ React.createElement(LabeledInput, { value: propertyName, required: true, name: "name", label: "Name", onChange: (event) => {
27
+ setPropertyName(event.target.value);
28
+ validator.showMessageFor("name");
29
+ }, message: validator.message("name", propertyName, NAME_REQUIREMENTS), status: validator.message("name", propertyName, NAME_REQUIREMENTS)
30
+ ? "negative"
31
+ : undefined, onBlur: () => {
32
+ validator.showMessageFor("name");
33
+ }, onBlurCapture: (event) => {
34
+ setPropertyName(event.target.value);
35
+ validator.showMessageFor("name");
36
+ } }),
37
+ React.createElement(LabeledSelect, { label: "Quantity Type", required: true, options: generateOptionsFromCalculatedPropertyType(), value: type, onChange: setType, itemRenderer: itemRenderer, selectedItemRenderer: selectedItemRenderer, onShow: () => { }, onHide: () => { } })));
38
+ };
39
+ //# sourceMappingURL=SharedCalculatedPropertyForms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../src/widget/components/SharedCalculatedPropertyForms.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACL,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AA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AAE,YAAY,EAAE,iBAAiB,CAAC,EACnE,MAAM,EACJ,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,CAAC;gBACxD,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,SAAS,EAEf,MAAM,EAAE,GAAG,EAAE;gBACX,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC,EACD,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACpC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC,GACD;QACF,oBAAC,aAAa,IACZ,KAAK,EAAC,eAAe,EACrB,QAAQ,QACR,OAAO,EAAE,yCAAyC,EAAE,EACpD,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,GACjB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport {\n CalculatedPropertyType,\n} from \"@itwin/insights-client\";\nimport React, { useCallback } from \"react\";\nimport { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledInput, LabeledSelect } from \"@itwin/itwinui-react\";\nimport type SimpleReactValidator from \"simple-react-validator\";\n\ninterface SharedCalculatedPropertyFormsProps {\n propertyName: string;\n setPropertyName: (value: string) => void;\n type: CalculatedPropertyType | undefined;\n setType: (value: CalculatedPropertyType | undefined) => void;\n validator: SimpleReactValidator;\n itemRenderer?: (option: SelectOption<string>) => JSX.Element;\n selectedItemRenderer?: (option: SelectOption<string>) => JSX.Element;\n}\n\nexport const SharedCalculatedPropertyForms = ({\n propertyName,\n setPropertyName,\n type,\n setType,\n validator,\n itemRenderer,\n selectedItemRenderer,\n}: SharedCalculatedPropertyFormsProps) => {\n\n const generateOptionsFromCalculatedPropertyType = useCallback(() => {\n const options: SelectOption<CalculatedPropertyType>[] = [];\n\n const indexableEnum = CalculatedPropertyType as unknown as { [key: string]: string };\n\n for (const key in indexableEnum) {\n if (typeof indexableEnum[key] === \"string\" && key !== \"Undefined\") {\n // Generate labels by adding space between capitals\n const label = key\n .replace(/([A-Z])/g, \" $1\")\n .trim()\n .replace(/^\\w/, (c) => c.toUpperCase());\n options.push({ value: indexableEnum[key] as CalculatedPropertyType, label });\n }\n }\n return options;\n }, []);\n\n return (\n <>\n <LabeledInput\n value={propertyName}\n required\n name=\"name\"\n label=\"Name\"\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", propertyName, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledSelect<CalculatedPropertyType>\n label=\"Quantity Type\"\n required\n options={generateOptionsFromCalculatedPropertyType()}\n value={type}\n onChange={setType}\n itemRenderer={itemRenderer}\n selectedItemRenderer={selectedItemRenderer}\n onShow={() => { }}\n onHide={() => { }}\n />\n </>\n );\n};\n"]}
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { SvgInfoCircular, SvgStatusError, SvgStatusSuccess, SvgStatusWarning } from "@itwin/itwinui-icons-react";
3
+ import "./StatusIcon.scss";
4
+ declare const StatusIconMap: {
5
+ readonly success: typeof SvgStatusSuccess;
6
+ readonly error: typeof SvgStatusError;
7
+ readonly warning: typeof SvgStatusWarning;
8
+ readonly informational: typeof SvgInfoCircular;
9
+ };
10
+ export declare const StatusIcon: ({ status, className, ...rest }: {
11
+ status: keyof typeof StatusIconMap;
12
+ className?: string | undefined;
13
+ }) => JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=StatusIcon.d.ts.map
@@ -0,0 +1,19 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import React from "react";
6
+ import classnames from "classnames";
7
+ import { SvgInfoCircular, SvgStatusError, SvgStatusSuccess, SvgStatusWarning } from "@itwin/itwinui-icons-react";
8
+ import "./StatusIcon.scss";
9
+ const StatusIconMap = {
10
+ success: SvgStatusSuccess,
11
+ error: SvgStatusError,
12
+ warning: SvgStatusWarning,
13
+ informational: SvgInfoCircular,
14
+ };
15
+ export const StatusIcon = ({ status, className, ...rest }) => {
16
+ const Element = StatusIconMap[status];
17
+ return React.createElement(Element, { className: classnames("gmw-status-icon", `gmw-status-icon-${status}`, className), ...rest });
18
+ };
19
+ //# sourceMappingURL=StatusIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusIcon.js","sourceRoot":"","sources":["../../../../src/widget/components/StatusIcon.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACjH,OAAO,mBAAmB,CAAC;AAE3B,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,gBAAgB;IACzB,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,gBAAgB;IACzB,aAAa,EAAE,eAAe;CACtB,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,MAAM,EACN,SAAS,EACT,GAAG,IAAI,EAIR,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,oBAAC,OAAO,IAAC,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,mBAAmB,MAAM,EAAE,EAAE,SAAS,CAAC,KAAM,IAAI,GAAI,CAAC;AACjH,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 classnames from \"classnames\";\nimport { SvgInfoCircular, SvgStatusError, SvgStatusSuccess, SvgStatusWarning } from \"@itwin/itwinui-icons-react\";\nimport \"./StatusIcon.scss\";\n\nconst StatusIconMap = {\n success: SvgStatusSuccess,\n error: SvgStatusError,\n warning: SvgStatusWarning,\n informational: SvgInfoCircular,\n} as const;\n\nexport const StatusIcon = ({\n status,\n className,\n ...rest\n}: {\n status: keyof typeof StatusIconMap;\n className?: string;\n}) => {\n const Element = StatusIconMap[status];\n return <Element className={classnames(\"gmw-status-icon\", `gmw-status-icon-${status}`, className)} {...rest} />;\n};\n"]}
@@ -0,0 +1,26 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "@itwin/itwinui-css/scss/icon/variables";
6
+
7
+ .gmw-status-icon {
8
+ width: $iui-icons-default;
9
+ height: $iui-icons-default;
10
+
11
+ &-success {
12
+ fill: var(--iui-icons-color-positive);
13
+ }
14
+
15
+ &-error {
16
+ fill: var(--iui-icons-color-negative);
17
+ }
18
+
19
+ &-warning {
20
+ fill: var(--iui-icons-color-warning);
21
+ }
22
+
23
+ &-informational {
24
+ fill: var(--iui-icons-color-primary);
25
+ }
26
+ }
@@ -8,11 +8,11 @@ export interface QueryCacheItem {
8
8
  }
9
9
  export interface GroupHilitedElements {
10
10
  hilitedElementsQueryCache: MutableRefObject<Map<string, QueryCacheItem>>;
11
- hiddenGroupsIds: string[];
11
+ hiddenGroupsIds: Set<string>;
12
12
  showGroupColor: boolean;
13
13
  groups: Group[];
14
14
  setGroups: (groups: Group[]) => void;
15
- setHiddenGroupsIds: (hiddenGroupIds: string[]) => void;
15
+ setHiddenGroupsIds: (hiddenGroupIds: Set<string>) => void;
16
16
  setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;
17
17
  }
18
18
  export declare const GroupHilitedElementsContext: React.Context<GroupHilitedElements>;
@@ -5,7 +5,7 @@
5
5
  import * as React from "react";
6
6
  export const GroupHilitedElementsContext = React.createContext({
7
7
  hilitedElementsQueryCache: { current: new Map() },
8
- hiddenGroupsIds: [],
8
+ hiddenGroupsIds: new Set(),
9
9
  showGroupColor: false,
10
10
  groups: [],
11
11
  setGroups: () => { },
@@ -1 +1 @@
1
- {"version":3,"file":"GroupHilitedElementsContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/GroupHilitedElementsContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,yBAAyB,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE;IACjD,eAAe,EAAE,EAAE;IACnB,cAAc,EAAE,KAAK;IACrB,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC;IACpB,kBAAkB,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAyB,EAAE;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,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 * as React from \"react\";\nimport type { MutableRefObject } from \"react\";\nimport type { Group } from \"@itwin/insights-client\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nexport interface QueryCacheItem {\n keySet: KeySet;\n ids: string[];\n}\nexport interface GroupHilitedElements {\n hilitedElementsQueryCache: MutableRefObject<Map<string, QueryCacheItem>>;\n hiddenGroupsIds: string[];\n showGroupColor: boolean;\n groups: Group[];\n setGroups: (groups: Group[]) => void;\n setHiddenGroupsIds: (hiddenGroupIds: string[]) => void;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n}\n\nexport const GroupHilitedElementsContext = React.createContext<GroupHilitedElements>({\n hilitedElementsQueryCache: { current: new Map() },\n hiddenGroupsIds: [],\n showGroupColor: false,\n groups: [],\n setGroups: () => { },\n setHiddenGroupsIds: () => { },\n setShowGroupColor: () => { },\n});\n\nexport const useGroupHilitedElementsContext = (): GroupHilitedElements => {\n const context = React.useContext(GroupHilitedElementsContext);\n if (!context) {\n throw new Error(\n \"useGroupHilitedElementsContext should be used within a GroupHilitedElementsContext provider\"\n );\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"GroupHilitedElementsContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/GroupHilitedElementsContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,yBAAyB,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE;IACjD,eAAe,EAAE,IAAI,GAAG,EAAE;IAC1B,cAAc,EAAE,KAAK;IACrB,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC;IACpB,kBAAkB,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAyB,EAAE;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,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 * as React from \"react\";\nimport type { MutableRefObject } from \"react\";\nimport type { Group } from \"@itwin/insights-client\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nexport interface QueryCacheItem {\n keySet: KeySet;\n ids: string[];\n}\nexport interface GroupHilitedElements {\n hilitedElementsQueryCache: MutableRefObject<Map<string, QueryCacheItem>>;\n hiddenGroupsIds: Set<string>;\n showGroupColor: boolean;\n groups: Group[];\n setGroups: (groups: Group[]) => void;\n setHiddenGroupsIds: (hiddenGroupIds: Set<string>) => void;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n}\n\nexport const GroupHilitedElementsContext = React.createContext<GroupHilitedElements>({\n hilitedElementsQueryCache: { current: new Map() },\n hiddenGroupsIds: new Set(),\n showGroupColor: false,\n groups: [],\n setGroups: () => { },\n setHiddenGroupsIds: () => { },\n setShowGroupColor: () => { },\n});\n\nexport const useGroupHilitedElementsContext = (): GroupHilitedElements => {\n const context = React.useContext(GroupHilitedElementsContext);\n if (!context) {\n throw new Error(\n \"useGroupHilitedElementsContext should be used within a GroupHilitedElementsContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -3,12 +3,10 @@ import type { PropertyRecord } from "@itwin/appui-abstract";
3
3
  import type { QueryBuilder } from "../QueryBuilder";
4
4
  export interface PropertySelection {
5
5
  currentPropertyList: PropertyRecord[];
6
- setCurrentPropertyList: (value: PropertyRecord[]) => void;
6
+ setCurrentPropertyList: (value: PropertyRecord[] | ((value: PropertyRecord[]) => PropertyRecord[])) => void;
7
7
  setQuery: (value: string) => void;
8
8
  queryBuilder?: QueryBuilder;
9
- setQueryBuilder: (value: QueryBuilder | undefined) => void;
10
9
  isUpdating: boolean;
11
- resetView: () => Promise<void>;
12
10
  }
13
11
  export declare const PropertyGridWrapperContext: React.Context<PropertySelection>;
14
12
  export declare const usePropertyGridWrapper: () => PropertySelection;
@@ -7,9 +7,7 @@ export const PropertyGridWrapperContext = React.createContext({
7
7
  currentPropertyList: [],
8
8
  setCurrentPropertyList: () => [],
9
9
  setQuery: () => "",
10
- setQueryBuilder: () => undefined,
11
10
  isUpdating: false,
12
- resetView: async () => { },
13
11
  });
14
12
  export const usePropertyGridWrapper = () => {
15
13
  const context = React.useContext(PropertyGridWrapperContext);
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridWrapperContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/PropertyGridWrapperContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAAoB;IAC/E,mBAAmB,EAAE,EAAE;IACvB,sBAAsB,EAAE,GAAG,EAAE,CAAC,EAAE;IAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;IAClB,eAAe,EAAE,GAAG,EAAE,CAAC,SAAS;IAChC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,KAAK,IAAI,EAAE,GAAG,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAsB,EAAE;IAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,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 * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { QueryBuilder } from \"../QueryBuilder\";\n\nexport interface PropertySelection {\n currentPropertyList: PropertyRecord[];\n setCurrentPropertyList: (value: PropertyRecord[]) => void;\n setQuery: (value: string) => void;\n queryBuilder?: QueryBuilder;\n setQueryBuilder: (value: QueryBuilder | undefined) => void;\n isUpdating: boolean;\n resetView: () => Promise<void>;\n}\n\nexport const PropertyGridWrapperContext = React.createContext<PropertySelection>({\n currentPropertyList: [],\n setCurrentPropertyList: () => [],\n setQuery: () => \"\",\n setQueryBuilder: () => undefined,\n isUpdating: false,\n resetView: async () => { },\n});\n\nexport const usePropertyGridWrapper = (): PropertySelection => {\n const context = React.useContext(PropertyGridWrapperContext);\n if (!context) {\n throw new Error(\n \"usePropertyGridWrapperContext should be used within a PropertyGridWrapperContext provider\"\n );\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"PropertyGridWrapperContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/PropertyGridWrapperContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAAoB;IAC/E,mBAAmB,EAAE,EAAE;IACvB,sBAAsB,EAAE,GAAG,EAAE,CAAC,EAAE;IAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;IAClB,UAAU,EAAE,KAAK;CAClB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAsB,EAAE;IAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,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 * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { QueryBuilder } from \"../QueryBuilder\";\n\nexport interface PropertySelection {\n currentPropertyList: PropertyRecord[];\n setCurrentPropertyList: (value: PropertyRecord[] | ((value: PropertyRecord[]) => PropertyRecord[])) => void;\n setQuery: (value: string) => void;\n queryBuilder?: QueryBuilder;\n isUpdating: boolean;\n}\n\nexport const PropertyGridWrapperContext = React.createContext<PropertySelection>({\n currentPropertyList: [],\n setCurrentPropertyList: () => [],\n setQuery: () => \"\",\n isUpdating: false,\n});\n\nexport const usePropertyGridWrapper = (): PropertySelection => {\n const context = React.useContext(PropertyGridWrapperContext);\n if (!context) {\n throw new Error(\n \"usePropertyGridWrapperContext should be used within a PropertyGridWrapperContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import "./GroupQueryBuilderCustomUI.scss";
3
3
  import type { GroupingCustomUIProps } from "./GroupingMappingCustomUI";
4
- export declare const GroupQueryBuilderCustomUI: ({ isUpdating, resetView, updateQuery }: GroupingCustomUIProps) => JSX.Element;
4
+ export declare const GroupQueryBuilderCustomUI: ({ updateQuery, isUpdating, resetView, }: GroupingCustomUIProps) => JSX.Element;
5
5
  //# sourceMappingURL=GroupQueryBuilderCustomUI.d.ts.map