@itwin/grouping-mapping-widget 0.2.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 (305) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +26 -0
  3. package/lib/cjs/api/GroupQueryBuilderApi.d.ts +15 -0
  4. package/lib/cjs/api/GroupQueryBuilderApi.js +27 -0
  5. package/lib/cjs/api/GroupQueryBuilderApi.js.map +1 -0
  6. package/lib/cjs/api/generated/api.d.ts +3222 -0
  7. package/lib/cjs/api/generated/api.js +5291 -0
  8. package/lib/cjs/api/generated/api.js.map +1 -0
  9. package/lib/cjs/api/generated/configuration.d.ts +56 -0
  10. package/lib/cjs/api/generated/configuration.js +30 -0
  11. package/lib/cjs/api/generated/configuration.js.map +1 -0
  12. package/lib/cjs/api/generated/index.d.ts +14 -0
  13. package/lib/cjs/api/generated/index.js +31 -0
  14. package/lib/cjs/api/generated/index.js.map +1 -0
  15. package/lib/cjs/api/reportingClient.d.ts +34 -0
  16. package/lib/cjs/api/reportingClient.js +177 -0
  17. package/lib/cjs/api/reportingClient.js.map +1 -0
  18. package/lib/cjs/decorators/BboxDimensionsDecorator.d.ts +82 -0
  19. package/lib/cjs/decorators/BboxDimensionsDecorator.js +418 -0
  20. package/lib/cjs/decorators/BboxDimensionsDecorator.js.map +1 -0
  21. package/lib/cjs/grouping-mapping-widget.d.ts +7 -0
  22. package/lib/cjs/grouping-mapping-widget.js +27 -0
  23. package/lib/cjs/grouping-mapping-widget.js.map +1 -0
  24. package/lib/cjs/widget/GroupingMappingWidget.d.ts +7 -0
  25. package/lib/cjs/widget/GroupingMappingWidget.js +51 -0
  26. package/lib/cjs/widget/GroupingMappingWidget.js.map +1 -0
  27. package/lib/cjs/widget/components/ActionPanel.d.ts +11 -0
  28. package/lib/cjs/widget/components/ActionPanel.js +37 -0
  29. package/lib/cjs/widget/components/ActionPanel.js.map +1 -0
  30. package/lib/cjs/widget/components/ActionPanel.scss +12 -0
  31. package/lib/cjs/widget/components/CalculatedPropertyAction.d.ts +14 -0
  32. package/lib/cjs/widget/components/CalculatedPropertyAction.js +160 -0
  33. package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -0
  34. package/lib/cjs/widget/components/CalculatedPropertyAction.scss +27 -0
  35. package/lib/cjs/widget/components/CalculatedPropertyTable.d.ts +18 -0
  36. package/lib/cjs/widget/components/CalculatedPropertyTable.js +109 -0
  37. package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -0
  38. package/lib/cjs/widget/components/ConfirmMappingsImport.d.ts +16 -0
  39. package/lib/cjs/widget/components/ConfirmMappingsImport.js +112 -0
  40. package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -0
  41. package/lib/cjs/widget/components/ConfirmMappingsImport.scss +84 -0
  42. package/lib/cjs/widget/components/CustomCalculationAction.d.ts +14 -0
  43. package/lib/cjs/widget/components/CustomCalculationAction.js +103 -0
  44. package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -0
  45. package/lib/cjs/widget/components/CustomCalculationAction.scss +16 -0
  46. package/lib/cjs/widget/components/CustomCalculationTable.d.ts +18 -0
  47. package/lib/cjs/widget/components/CustomCalculationTable.js +114 -0
  48. package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -0
  49. package/lib/cjs/widget/components/DeleteModal.d.ts +12 -0
  50. package/lib/cjs/widget/components/DeleteModal.js +64 -0
  51. package/lib/cjs/widget/components/DeleteModal.js.map +1 -0
  52. package/lib/cjs/widget/components/DeleteModal.scss +12 -0
  53. package/lib/cjs/widget/components/GroupAction.d.ts +12 -0
  54. package/lib/cjs/widget/components/GroupAction.js +166 -0
  55. package/lib/cjs/widget/components/GroupAction.js.map +1 -0
  56. package/lib/cjs/widget/components/GroupAction.scss +19 -0
  57. package/lib/cjs/widget/components/GroupPropertyAction.d.ts +17 -0
  58. package/lib/cjs/widget/components/GroupPropertyAction.js +372 -0
  59. package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -0
  60. package/lib/cjs/widget/components/GroupPropertyAction.scss +36 -0
  61. package/lib/cjs/widget/components/GroupPropertyTable.d.ts +18 -0
  62. package/lib/cjs/widget/components/GroupPropertyTable.js +109 -0
  63. package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -0
  64. package/lib/cjs/widget/components/GroupQueryBuilder.scss +24 -0
  65. package/lib/cjs/widget/components/GroupQueryBuilderContainer.d.ts +4 -0
  66. package/lib/cjs/widget/components/GroupQueryBuilderContainer.js +66 -0
  67. package/lib/cjs/widget/components/GroupQueryBuilderContainer.js.map +1 -0
  68. package/lib/cjs/widget/components/GroupQueryBuilderContext.d.ts +13 -0
  69. package/lib/cjs/widget/components/GroupQueryBuilderContext.js +37 -0
  70. package/lib/cjs/widget/components/GroupQueryBuilderContext.js.map +1 -0
  71. package/lib/cjs/widget/components/Grouping.d.ts +12 -0
  72. package/lib/cjs/widget/components/Grouping.js +214 -0
  73. package/lib/cjs/widget/components/Grouping.js.map +1 -0
  74. package/lib/cjs/widget/components/Grouping.scss +15 -0
  75. package/lib/cjs/widget/components/GroupingMapping.d.ts +5 -0
  76. package/lib/cjs/widget/components/GroupingMapping.js +34 -0
  77. package/lib/cjs/widget/components/GroupingMapping.js.map +1 -0
  78. package/lib/cjs/widget/components/GroupingMapping.scss +24 -0
  79. package/lib/cjs/widget/components/Mapping.d.ts +7 -0
  80. package/lib/cjs/widget/components/Mapping.js +162 -0
  81. package/lib/cjs/widget/components/Mapping.js.map +1 -0
  82. package/lib/cjs/widget/components/Mapping.scss +26 -0
  83. package/lib/cjs/widget/components/MappingAction.d.ts +11 -0
  84. package/lib/cjs/widget/components/MappingAction.js +98 -0
  85. package/lib/cjs/widget/components/MappingAction.js.map +1 -0
  86. package/lib/cjs/widget/components/MappingAction.scss +16 -0
  87. package/lib/cjs/widget/components/MappingImportWizardModal.d.ts +10 -0
  88. package/lib/cjs/widget/components/MappingImportWizardModal.js +102 -0
  89. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -0
  90. package/lib/cjs/widget/components/MappingImportWizardModal.scss +21 -0
  91. package/lib/cjs/widget/components/PropertyMenu.d.ts +24 -0
  92. package/lib/cjs/widget/components/PropertyMenu.js +141 -0
  93. package/lib/cjs/widget/components/PropertyMenu.js.map +1 -0
  94. package/lib/cjs/widget/components/PropertyMenu.scss +48 -0
  95. package/lib/cjs/widget/components/QueryBuilder.d.ts +39 -0
  96. package/lib/cjs/widget/components/QueryBuilder.js +345 -0
  97. package/lib/cjs/widget/components/QueryBuilder.js.map +1 -0
  98. package/lib/cjs/widget/components/SelectIModel.d.ts +12 -0
  99. package/lib/cjs/widget/components/SelectIModel.js +42 -0
  100. package/lib/cjs/widget/components/SelectIModel.js.map +1 -0
  101. package/lib/cjs/widget/components/SelectIModel.scss +20 -0
  102. package/lib/cjs/widget/components/SelectMapping.scss +17 -0
  103. package/lib/cjs/widget/components/SelectMappings.d.ts +12 -0
  104. package/lib/cjs/widget/components/SelectMappings.js +82 -0
  105. package/lib/cjs/widget/components/SelectMappings.js.map +1 -0
  106. package/lib/cjs/widget/components/SelectProject.d.ts +10 -0
  107. package/lib/cjs/widget/components/SelectProject.js +71 -0
  108. package/lib/cjs/widget/components/SelectProject.js.map +1 -0
  109. package/lib/cjs/widget/components/SelectProject.scss +38 -0
  110. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +33 -0
  111. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +92 -0
  112. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +1 -0
  113. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.scss +16 -0
  114. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +26 -0
  115. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +58 -0
  116. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +1 -0
  117. package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +67 -0
  118. package/lib/cjs/widget/components/property-grid/PropertyGrid.js +198 -0
  119. package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +1 -0
  120. package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +71 -0
  121. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +17 -0
  122. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +67 -0
  123. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +1 -0
  124. package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +69 -0
  125. package/lib/cjs/widget/components/property-grid/PropertyList.js +87 -0
  126. package/lib/cjs/widget/components/property-grid/PropertyList.js.map +1 -0
  127. package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +92 -0
  128. package/lib/cjs/widget/components/property-grid/PropertyRender.js +111 -0
  129. package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +1 -0
  130. package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +20 -0
  131. package/lib/cjs/widget/components/property-grid/PropertyView.js +218 -0
  132. package/lib/cjs/widget/components/property-grid/PropertyView.js.map +1 -0
  133. package/lib/cjs/widget/components/property-grid/PropertyView.scss +111 -0
  134. package/lib/cjs/widget/components/utils.d.ts +14 -0
  135. package/lib/cjs/widget/components/utils.js +82 -0
  136. package/lib/cjs/widget/components/utils.js.map +1 -0
  137. package/lib/cjs/widget/components/utils.scss +36 -0
  138. package/lib/cjs/widget/components/viewerUtils.d.ts +9 -0
  139. package/lib/cjs/widget/components/viewerUtils.js +115 -0
  140. package/lib/cjs/widget/components/viewerUtils.js.map +1 -0
  141. package/lib/cjs/widget/hooks/useFetchAccessToken.d.ts +3 -0
  142. package/lib/cjs/widget/hooks/useFetchAccessToken.js +22 -0
  143. package/lib/cjs/widget/hooks/useFetchAccessToken.js.map +1 -0
  144. package/lib/cjs/widget/hooks/useValidator.d.ts +45 -0
  145. package/lib/cjs/widget/hooks/useValidator.js +53 -0
  146. package/lib/cjs/widget/hooks/useValidator.js.map +1 -0
  147. package/lib/cjs/widget/icons/DatabaseInfo.d.ts +5 -0
  148. package/lib/cjs/widget/icons/DatabaseInfo.js +19 -0
  149. package/lib/cjs/widget/icons/DatabaseInfo.js.map +1 -0
  150. package/lib/cjs/widget/icons/DatabaseInfo.scss +12 -0
  151. package/lib/cjs/widget/utils.d.ts +4 -0
  152. package/lib/cjs/widget/utils.js +3 -0
  153. package/lib/cjs/widget/utils.js.map +1 -0
  154. package/lib/esm/api/GroupQueryBuilderApi.d.ts +15 -0
  155. package/lib/esm/api/GroupQueryBuilderApi.js +23 -0
  156. package/lib/esm/api/GroupQueryBuilderApi.js.map +1 -0
  157. package/lib/esm/api/generated/api.d.ts +3222 -0
  158. package/lib/esm/api/generated/api.js +5248 -0
  159. package/lib/esm/api/generated/api.js.map +1 -0
  160. package/lib/esm/api/generated/configuration.d.ts +56 -0
  161. package/lib/esm/api/generated/configuration.js +26 -0
  162. package/lib/esm/api/generated/configuration.js.map +1 -0
  163. package/lib/esm/api/generated/index.d.ts +14 -0
  164. package/lib/esm/api/generated/index.js +19 -0
  165. package/lib/esm/api/generated/index.js.map +1 -0
  166. package/lib/esm/api/reportingClient.d.ts +34 -0
  167. package/lib/esm/api/reportingClient.js +173 -0
  168. package/lib/esm/api/reportingClient.js.map +1 -0
  169. package/lib/esm/decorators/BboxDimensionsDecorator.d.ts +82 -0
  170. package/lib/esm/decorators/BboxDimensionsDecorator.js +414 -0
  171. package/lib/esm/decorators/BboxDimensionsDecorator.js.map +1 -0
  172. package/lib/esm/grouping-mapping-widget.d.ts +7 -0
  173. package/lib/esm/grouping-mapping-widget.js +11 -0
  174. package/lib/esm/grouping-mapping-widget.js.map +1 -0
  175. package/lib/esm/widget/GroupingMappingWidget.d.ts +7 -0
  176. package/lib/esm/widget/GroupingMappingWidget.js +25 -0
  177. package/lib/esm/widget/GroupingMappingWidget.js.map +1 -0
  178. package/lib/esm/widget/components/ActionPanel.d.ts +11 -0
  179. package/lib/esm/widget/components/ActionPanel.js +16 -0
  180. package/lib/esm/widget/components/ActionPanel.js.map +1 -0
  181. package/lib/esm/widget/components/ActionPanel.scss +12 -0
  182. package/lib/esm/widget/components/CalculatedPropertyAction.d.ts +14 -0
  183. package/lib/esm/widget/components/CalculatedPropertyAction.js +136 -0
  184. package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -0
  185. package/lib/esm/widget/components/CalculatedPropertyAction.scss +27 -0
  186. package/lib/esm/widget/components/CalculatedPropertyTable.d.ts +18 -0
  187. package/lib/esm/widget/components/CalculatedPropertyTable.js +85 -0
  188. package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -0
  189. package/lib/esm/widget/components/ConfirmMappingsImport.d.ts +16 -0
  190. package/lib/esm/widget/components/ConfirmMappingsImport.js +91 -0
  191. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -0
  192. package/lib/esm/widget/components/ConfirmMappingsImport.scss +84 -0
  193. package/lib/esm/widget/components/CustomCalculationAction.d.ts +14 -0
  194. package/lib/esm/widget/components/CustomCalculationAction.js +79 -0
  195. package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -0
  196. package/lib/esm/widget/components/CustomCalculationAction.scss +16 -0
  197. package/lib/esm/widget/components/CustomCalculationTable.d.ts +18 -0
  198. package/lib/esm/widget/components/CustomCalculationTable.js +90 -0
  199. package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -0
  200. package/lib/esm/widget/components/DeleteModal.d.ts +12 -0
  201. package/lib/esm/widget/components/DeleteModal.js +41 -0
  202. package/lib/esm/widget/components/DeleteModal.js.map +1 -0
  203. package/lib/esm/widget/components/DeleteModal.scss +12 -0
  204. package/lib/esm/widget/components/GroupAction.d.ts +12 -0
  205. package/lib/esm/widget/components/GroupAction.js +142 -0
  206. package/lib/esm/widget/components/GroupAction.js.map +1 -0
  207. package/lib/esm/widget/components/GroupAction.scss +19 -0
  208. package/lib/esm/widget/components/GroupPropertyAction.d.ts +17 -0
  209. package/lib/esm/widget/components/GroupPropertyAction.js +347 -0
  210. package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -0
  211. package/lib/esm/widget/components/GroupPropertyAction.scss +36 -0
  212. package/lib/esm/widget/components/GroupPropertyTable.d.ts +18 -0
  213. package/lib/esm/widget/components/GroupPropertyTable.js +85 -0
  214. package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -0
  215. package/lib/esm/widget/components/GroupQueryBuilder.scss +24 -0
  216. package/lib/esm/widget/components/GroupQueryBuilderContainer.d.ts +4 -0
  217. package/lib/esm/widget/components/GroupQueryBuilderContainer.js +43 -0
  218. package/lib/esm/widget/components/GroupQueryBuilderContainer.js.map +1 -0
  219. package/lib/esm/widget/components/GroupQueryBuilderContext.d.ts +13 -0
  220. package/lib/esm/widget/components/GroupQueryBuilderContext.js +15 -0
  221. package/lib/esm/widget/components/GroupQueryBuilderContext.js.map +1 -0
  222. package/lib/esm/widget/components/Grouping.d.ts +12 -0
  223. package/lib/esm/widget/components/Grouping.js +188 -0
  224. package/lib/esm/widget/components/Grouping.js.map +1 -0
  225. package/lib/esm/widget/components/Grouping.scss +15 -0
  226. package/lib/esm/widget/components/GroupingMapping.d.ts +5 -0
  227. package/lib/esm/widget/components/GroupingMapping.js +13 -0
  228. package/lib/esm/widget/components/GroupingMapping.js.map +1 -0
  229. package/lib/esm/widget/components/GroupingMapping.scss +24 -0
  230. package/lib/esm/widget/components/Mapping.d.ts +7 -0
  231. package/lib/esm/widget/components/Mapping.js +136 -0
  232. package/lib/esm/widget/components/Mapping.js.map +1 -0
  233. package/lib/esm/widget/components/Mapping.scss +26 -0
  234. package/lib/esm/widget/components/MappingAction.d.ts +11 -0
  235. package/lib/esm/widget/components/MappingAction.js +74 -0
  236. package/lib/esm/widget/components/MappingAction.js.map +1 -0
  237. package/lib/esm/widget/components/MappingAction.scss +16 -0
  238. package/lib/esm/widget/components/MappingImportWizardModal.d.ts +10 -0
  239. package/lib/esm/widget/components/MappingImportWizardModal.js +76 -0
  240. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -0
  241. package/lib/esm/widget/components/MappingImportWizardModal.scss +21 -0
  242. package/lib/esm/widget/components/PropertyMenu.d.ts +24 -0
  243. package/lib/esm/widget/components/PropertyMenu.js +115 -0
  244. package/lib/esm/widget/components/PropertyMenu.js.map +1 -0
  245. package/lib/esm/widget/components/PropertyMenu.scss +48 -0
  246. package/lib/esm/widget/components/QueryBuilder.d.ts +39 -0
  247. package/lib/esm/widget/components/QueryBuilder.js +341 -0
  248. package/lib/esm/widget/components/QueryBuilder.js.map +1 -0
  249. package/lib/esm/widget/components/SelectIModel.d.ts +12 -0
  250. package/lib/esm/widget/components/SelectIModel.js +18 -0
  251. package/lib/esm/widget/components/SelectIModel.js.map +1 -0
  252. package/lib/esm/widget/components/SelectIModel.scss +20 -0
  253. package/lib/esm/widget/components/SelectMapping.scss +17 -0
  254. package/lib/esm/widget/components/SelectMappings.d.ts +12 -0
  255. package/lib/esm/widget/components/SelectMappings.js +61 -0
  256. package/lib/esm/widget/components/SelectMappings.js.map +1 -0
  257. package/lib/esm/widget/components/SelectProject.d.ts +10 -0
  258. package/lib/esm/widget/components/SelectProject.js +47 -0
  259. package/lib/esm/widget/components/SelectProject.js.map +1 -0
  260. package/lib/esm/widget/components/SelectProject.scss +38 -0
  261. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +33 -0
  262. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +69 -0
  263. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +1 -0
  264. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.scss +16 -0
  265. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +26 -0
  266. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +35 -0
  267. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +1 -0
  268. package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +67 -0
  269. package/lib/esm/widget/components/property-grid/PropertyGrid.js +172 -0
  270. package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +1 -0
  271. package/lib/esm/widget/components/property-grid/PropertyGrid.scss +71 -0
  272. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +17 -0
  273. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +44 -0
  274. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +1 -0
  275. package/lib/esm/widget/components/property-grid/PropertyList.d.ts +69 -0
  276. package/lib/esm/widget/components/property-grid/PropertyList.js +60 -0
  277. package/lib/esm/widget/components/property-grid/PropertyList.js.map +1 -0
  278. package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +92 -0
  279. package/lib/esm/widget/components/property-grid/PropertyRender.js +88 -0
  280. package/lib/esm/widget/components/property-grid/PropertyRender.js.map +1 -0
  281. package/lib/esm/widget/components/property-grid/PropertyView.d.ts +20 -0
  282. package/lib/esm/widget/components/property-grid/PropertyView.js +195 -0
  283. package/lib/esm/widget/components/property-grid/PropertyView.js.map +1 -0
  284. package/lib/esm/widget/components/property-grid/PropertyView.scss +111 -0
  285. package/lib/esm/widget/components/utils.d.ts +14 -0
  286. package/lib/esm/widget/components/utils.js +72 -0
  287. package/lib/esm/widget/components/utils.js.map +1 -0
  288. package/lib/esm/widget/components/utils.scss +36 -0
  289. package/lib/esm/widget/components/viewerUtils.d.ts +9 -0
  290. package/lib/esm/widget/components/viewerUtils.js +106 -0
  291. package/lib/esm/widget/components/viewerUtils.js.map +1 -0
  292. package/lib/esm/widget/hooks/useFetchAccessToken.d.ts +3 -0
  293. package/lib/esm/widget/hooks/useFetchAccessToken.js +20 -0
  294. package/lib/esm/widget/hooks/useFetchAccessToken.js.map +1 -0
  295. package/lib/esm/widget/hooks/useValidator.d.ts +45 -0
  296. package/lib/esm/widget/hooks/useValidator.js +47 -0
  297. package/lib/esm/widget/hooks/useValidator.js.map +1 -0
  298. package/lib/esm/widget/icons/DatabaseInfo.d.ts +5 -0
  299. package/lib/esm/widget/icons/DatabaseInfo.js +14 -0
  300. package/lib/esm/widget/icons/DatabaseInfo.js.map +1 -0
  301. package/lib/esm/widget/icons/DatabaseInfo.scss +12 -0
  302. package/lib/esm/widget/utils.d.ts +4 -0
  303. package/lib/esm/widget/utils.js +2 -0
  304. package/lib/esm/widget/utils.js.map +1 -0
  305. package/package.json +116 -0
@@ -0,0 +1,345 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueryBuilder = void 0;
4
+ const appui_abstract_1 = require("@itwin/appui-abstract");
5
+ require("core-js/features/string/virtual");
6
+ /* This class is to build adaptive and dynamic query for find similar property selections */
7
+ class QueryBuilder {
8
+ /**
9
+ *
10
+ */
11
+ constructor(provider) {
12
+ this.dataProvider = provider;
13
+ }
14
+ async addProperty(prop) {
15
+ var _a, _b, _c, _d, _e;
16
+ // TODO: only handle primitive properties now
17
+ if (((_a = prop.value) === null || _a === void 0 ? void 0 : _a.valueFormat) !== appui_abstract_1.PropertyValueFormat.Primitive ||
18
+ prop.value.value === undefined) {
19
+ return;
20
+ }
21
+ function replaceAll(str, match, replacement) {
22
+ return str.split(match).join(replacement);
23
+ }
24
+ // if property value has single quote, escape
25
+ if ((typeof prop.value.value === "string" ||
26
+ prop.value.value instanceof String) &&
27
+ String(prop.value.value).indexOf("'") >= 0) {
28
+ prop.value.value = replaceAll(prop.value.value.toString(), "'", "''");
29
+ }
30
+ const propertyField = (await ((_b = this.dataProvider) === null || _b === void 0 ? void 0 : _b.getFieldByPropertyRecord(prop)));
31
+ if (propertyField === undefined) {
32
+ return;
33
+ }
34
+ // get the special cases
35
+ const isNavigation = prop.property.typename.toLowerCase() === "navigation";
36
+ const isAspect = ((_c = propertyField.parent) === null || _c === void 0 ? void 0 : _c.pathToPrimaryClass.find((a) => {
37
+ var _a, _b;
38
+ return ((_a = a.relationshipInfo) === null || _a === void 0 ? void 0 : _a.name) ===
39
+ QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS ||
40
+ ((_b = a.relationshipInfo) === null || _b === void 0 ? void 0 : _b.name) === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS;
41
+ })) !== undefined;
42
+ const className = propertyField.properties[0].property.classInfo.name.replace(":", ".");
43
+ const propertyName = isNavigation
44
+ ? `${propertyField.properties[0].property.name}.id`
45
+ : propertyField.properties[0].property.name;
46
+ const propertyValue = isNavigation
47
+ ? prop.value.value.id
48
+ : prop.value.value;
49
+ // console.log(prop);
50
+ // console.log(propertyField);
51
+ if (!isAspect &&
52
+ ((_d = propertyField.parent) === null || _d === void 0 ? void 0 : _d.pathToPrimaryClass) &&
53
+ ((_e = propertyField.parent) === null || _e === void 0 ? void 0 : _e.pathToPrimaryClass.length) > 0) {
54
+ this.addRelatedProperty(propertyField, propertyName, propertyValue, isAspect);
55
+ }
56
+ else {
57
+ this.addPropertyToQuery(className, propertyName, propertyValue, isAspect, this._needsQuote(propertyField), false);
58
+ }
59
+ }
60
+ _needsQuote(propertyField) {
61
+ // list of property types that need quote around property value
62
+ if (propertyField.type.typeName.toLowerCase() === "string") {
63
+ return true;
64
+ }
65
+ if (propertyField.type.typeName.toLowerCase() === "uri") {
66
+ return true;
67
+ }
68
+ return false;
69
+ }
70
+ addRelatedProperty(propertyField, propertyName, propertyValue, isAspect) {
71
+ var _a, _b;
72
+ const paths = [...((_b = (_a = propertyField.parent) === null || _a === void 0 ? void 0 : _a.pathToPrimaryClass) !== null && _b !== void 0 ? _b : [])];
73
+ paths.reverse().forEach((path) => {
74
+ var _a, _b, _c, _d, _e, _f, _g;
75
+ const sourceClassName = (_a = path.sourceClassInfo) === null || _a === void 0 ? void 0 : _a.name.replace(":", ".");
76
+ const targetClassName = (_b = path.targetClassInfo) === null || _b === void 0 ? void 0 : _b.name.replace(":", ".");
77
+ const relClassName = (_c = path.relationshipInfo) === null || _c === void 0 ? void 0 : _c.name.replace(":", ".");
78
+ if (!path.isForwardRelationship) {
79
+ this.addPropertyToQuery(targetClassName, `ECInstanceId`, `${relClassName}.SourceECInstanceId`, isAspect, false, true);
80
+ this.addPropertyToQuery(relClassName, `TargetECInstanceId`, `${sourceClassName}.ECInstanceId`, isAspect, false, true);
81
+ if (((_d = path.sourceClassInfo) === null || _d === void 0 ? void 0 : _d.name) ===
82
+ ((_e = propertyField.parent) === null || _e === void 0 ? void 0 : _e.contentClassInfo.name)) {
83
+ this.addPropertyToQuery(sourceClassName, propertyName, propertyValue, isAspect, this._needsQuote(propertyField), true);
84
+ }
85
+ else {
86
+ this.addPropertyToQuery(sourceClassName, `ECInstanceId`, `${relClassName}.TargetECInstanceId`, isAspect, false, true);
87
+ }
88
+ }
89
+ else {
90
+ this.addPropertyToQuery(targetClassName, `ECInstanceId`, `${relClassName}.TargetECInstanceId`, isAspect, false, true);
91
+ this.addPropertyToQuery(relClassName, `SourceECInstanceId`, `${sourceClassName}.ECInstanceId`, isAspect, false, true);
92
+ if (((_f = path.sourceClassInfo) === null || _f === void 0 ? void 0 : _f.name) ===
93
+ ((_g = propertyField.parent) === null || _g === void 0 ? void 0 : _g.contentClassInfo.name)) {
94
+ this.addPropertyToQuery(sourceClassName, propertyName, propertyValue, isAspect, this._needsQuote(propertyField), true);
95
+ }
96
+ else {
97
+ this.addPropertyToQuery(sourceClassName, `ECInstanceId`, `${relClassName}.SourceECInstanceId`, isAspect, false, true);
98
+ }
99
+ }
100
+ });
101
+ }
102
+ addPropertyToQuery(className, propertyName, propertyValue, isAspect, needsQuote, isRelational) {
103
+ if (this.query === undefined || this.query.classes.length === 0) {
104
+ this.query = {
105
+ classes: [
106
+ {
107
+ className,
108
+ isAspect,
109
+ isRelational,
110
+ properties: [
111
+ {
112
+ name: propertyName,
113
+ value: propertyValue,
114
+ needsQuote,
115
+ },
116
+ ],
117
+ },
118
+ ],
119
+ };
120
+ return;
121
+ }
122
+ const foundClass = this.query.classes.find((c) => c.className === className);
123
+ if (foundClass) {
124
+ foundClass.isRelational = isRelational;
125
+ if (!foundClass.properties.find((x) => x.name === propertyName)) {
126
+ foundClass.properties.push({
127
+ name: propertyName,
128
+ value: propertyValue,
129
+ needsQuote,
130
+ });
131
+ }
132
+ }
133
+ else {
134
+ this.query.classes.push({
135
+ className,
136
+ isRelational,
137
+ properties: [
138
+ {
139
+ name: propertyName,
140
+ value: propertyValue,
141
+ needsQuote,
142
+ },
143
+ ],
144
+ isAspect,
145
+ });
146
+ }
147
+ }
148
+ async removeProperty(prop) {
149
+ var _a, _b, _c, _d;
150
+ if (this.query === undefined || this.query.classes.length === 0) {
151
+ return;
152
+ }
153
+ const propertyField = (await ((_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.getFieldByPropertyRecord(prop)));
154
+ if (propertyField === undefined) {
155
+ return;
156
+ }
157
+ const isAspect = ((_b = propertyField.parent) === null || _b === void 0 ? void 0 : _b.pathToPrimaryClass.find((a) => {
158
+ var _a, _b;
159
+ return ((_a = a.relationshipInfo) === null || _a === void 0 ? void 0 : _a.name) ===
160
+ QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS ||
161
+ ((_b = a.relationshipInfo) === null || _b === void 0 ? void 0 : _b.name) === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS;
162
+ })) !== undefined;
163
+ const isNavigation = prop.property.typename.toLowerCase() === "navigation";
164
+ const propertyName = isNavigation
165
+ ? `${propertyField.properties[0].property.name}.id`
166
+ : propertyField.properties[0].property.name;
167
+ const className = propertyField.properties[0].property.classInfo.name.replace(":", ".");
168
+ if (!isAspect &&
169
+ ((_c = propertyField.parent) === null || _c === void 0 ? void 0 : _c.pathToPrimaryClass) &&
170
+ ((_d = propertyField.parent) === null || _d === void 0 ? void 0 : _d.pathToPrimaryClass.length) > 0) {
171
+ this.removeRelatedProperty(propertyField, propertyName);
172
+ }
173
+ else {
174
+ this.removePropertyFromQuery(className, propertyName);
175
+ }
176
+ }
177
+ removeRelatedProperty(propertyField, propertyName) {
178
+ var _a, _b;
179
+ const paths = [...((_b = (_a = propertyField.parent) === null || _a === void 0 ? void 0 : _a.pathToPrimaryClass) !== null && _b !== void 0 ? _b : [])];
180
+ paths.reverse().forEach((path) => {
181
+ var _a, _b, _c, _d, _e, _f, _g;
182
+ const sourceClassName = (_a = path.sourceClassInfo) === null || _a === void 0 ? void 0 : _a.name.replace(":", ".");
183
+ const targetClassName = (_b = path.targetClassInfo) === null || _b === void 0 ? void 0 : _b.name.replace(":", ".");
184
+ const relClassName = (_c = path.relationshipInfo) === null || _c === void 0 ? void 0 : _c.name.replace(":", ".");
185
+ if (!path.isForwardRelationship) {
186
+ this.removePropertyFromQuery(targetClassName, `ECInstanceId`);
187
+ this.removePropertyFromQuery(relClassName, `TargetECInstanceId`);
188
+ if (((_d = path.sourceClassInfo) === null || _d === void 0 ? void 0 : _d.name) ===
189
+ ((_e = propertyField.parent) === null || _e === void 0 ? void 0 : _e.contentClassInfo.name)) {
190
+ this.removePropertyFromQuery(sourceClassName, propertyName);
191
+ }
192
+ else {
193
+ this.removePropertyFromQuery(sourceClassName, `ECInstanceId`);
194
+ }
195
+ }
196
+ else {
197
+ this.removePropertyFromQuery(targetClassName, `ECInstanceId`);
198
+ this.removePropertyFromQuery(relClassName, `SourceECInstanceId`);
199
+ if (((_f = path.sourceClassInfo) === null || _f === void 0 ? void 0 : _f.name) ===
200
+ ((_g = propertyField.parent) === null || _g === void 0 ? void 0 : _g.contentClassInfo.name)) {
201
+ this.removePropertyFromQuery(sourceClassName, propertyName);
202
+ }
203
+ else {
204
+ this.removePropertyFromQuery(sourceClassName, `ECInstanceId`);
205
+ }
206
+ }
207
+ });
208
+ }
209
+ removePropertyFromQuery(className, propertyName) {
210
+ var _a, _b, _c, _d;
211
+ const foundClass = (_a = this.query) === null || _a === void 0 ? void 0 : _a.classes.find((c) => c.className === className);
212
+ if (foundClass) {
213
+ const foundPropertyIndex = foundClass.properties.findIndex((p) => p.name === propertyName);
214
+ if (foundPropertyIndex > -1) {
215
+ foundClass.properties.splice(foundPropertyIndex, 1);
216
+ }
217
+ if (foundClass.properties.length === 0) {
218
+ // remove the entire class if all properties are removed
219
+ const foundClassIndex = (_c = (_b = this.query) === null || _b === void 0 ? void 0 : _b.classes.findIndex((c) => c.className === className)) !== null && _c !== void 0 ? _c : -1;
220
+ if (foundClassIndex > -1) {
221
+ (_d = this.query) === null || _d === void 0 ? void 0 : _d.classes.splice(foundClassIndex, 1);
222
+ }
223
+ }
224
+ }
225
+ }
226
+ buildQueryString() {
227
+ if (this.query === undefined || this.query.classes.length === 0) {
228
+ return "";
229
+ }
230
+ const baseClass = this.query.classes[0];
231
+ const baseClassName = baseClass.className;
232
+ const baseIdName = baseClass.isAspect
233
+ ? `${baseClassName}.Element.id`
234
+ : `${baseClassName}.ECInstanceId`;
235
+ let queryString = `SELECT ${baseIdName} FROM ${baseClassName}`;
236
+ if (this.query.classes.length > 1) {
237
+ for (let i = 1; i < this.query.classes.length; i++) {
238
+ const joinClass = this.query.classes[i];
239
+ const joinClassName = joinClass.className;
240
+ const joinIdName = joinClass.isAspect
241
+ ? `${joinClassName}.Element.id`
242
+ : `${joinClassName}.ECInstanceId`;
243
+ if (joinClass.isRelational) {
244
+ queryString += ` JOIN ${joinClassName}`;
245
+ if (joinClass.properties.length > 0) {
246
+ if (joinClass.properties[0].needsQuote) {
247
+ queryString += ` ON ${joinClassName}.${joinClass.properties[0].name}='${joinClass.properties[0].value}'`;
248
+ }
249
+ else {
250
+ if (this._isFloat(joinClass.properties[0].value)) {
251
+ queryString += ` ON ROUND(${joinClassName}.${joinClass.properties[0].name}, `;
252
+ queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
253
+ queryString += `${Number(joinClass.properties[0].value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
254
+ }
255
+ else {
256
+ queryString += ` ON ${joinClassName}.${joinClass.properties[0].name}=${joinClass.properties[0].value}`;
257
+ }
258
+ }
259
+ }
260
+ // when base is regular property, link base to first joined relational property
261
+ if (!baseClass.isRelational && i === 1) {
262
+ queryString += ` AND ${joinIdName} = ${baseIdName}`;
263
+ }
264
+ for (const property of joinClass.properties) {
265
+ if (property.needsQuote) {
266
+ queryString += ` AND ${joinClassName}.${property.name}='${property.value}'`;
267
+ }
268
+ else {
269
+ if (this._isFloat(property.value)) {
270
+ queryString += ` AND ROUND(${joinClassName}.${property.name}, `;
271
+ queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
272
+ queryString += `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
273
+ }
274
+ else {
275
+ queryString += ` AND ${joinClassName}.${property.name}=${property.value}`;
276
+ }
277
+ }
278
+ }
279
+ }
280
+ else {
281
+ queryString += ` JOIN ${joinClassName} ON ${joinIdName} = ${baseIdName}`;
282
+ for (const property of joinClass.properties) {
283
+ if (property.needsQuote) {
284
+ queryString += ` AND ${joinClassName}.${property.name}='${property.value}'`;
285
+ }
286
+ else {
287
+ if (this._isFloat(property.value)) {
288
+ queryString += ` AND ROUND(${joinClassName}.${property.name}, `;
289
+ queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
290
+ queryString += `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
291
+ }
292
+ else {
293
+ queryString += ` AND ${joinClassName}.${property.name}=${property.value}`;
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
299
+ }
300
+ const properties = baseClass.properties;
301
+ if (properties.length > 0) {
302
+ if (properties[0].needsQuote) {
303
+ queryString += ` WHERE ${baseClassName}.${properties[0].name}='${properties[0].value}'`;
304
+ }
305
+ else {
306
+ if (this._isFloat(properties[0].value)) {
307
+ queryString += ` WHERE ROUND(${baseClassName}.${properties[0].name}, `;
308
+ queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
309
+ queryString += `${Number(properties[0].value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
310
+ }
311
+ else {
312
+ queryString += ` WHERE ${baseClassName}.${properties[0].name}=${properties[0].value}`;
313
+ }
314
+ }
315
+ if (properties.length > 1) {
316
+ for (let i = 1; i < properties.length; i++) {
317
+ if (properties[i].needsQuote) {
318
+ queryString += ` AND ${baseClassName}.${properties[i].name}='${properties[i].value}'`;
319
+ }
320
+ else {
321
+ if (this._isFloat(properties[i].value)) {
322
+ queryString += ` AND ROUND(${baseClassName}.${properties[i].name}, `;
323
+ queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
324
+ queryString += `${Number(properties[i].value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
325
+ }
326
+ else {
327
+ queryString += ` AND ${baseClassName}.${properties[i].name}=${properties[i].value}`;
328
+ }
329
+ }
330
+ }
331
+ }
332
+ }
333
+ // console.log(queryString);
334
+ // console.log(this.query);
335
+ return queryString;
336
+ }
337
+ _isFloat(n) {
338
+ return Number(n) === n && n % 1 !== 0;
339
+ }
340
+ }
341
+ exports.QueryBuilder = QueryBuilder;
342
+ QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS = "BisCore:ElementOwnsMultiAspects";
343
+ QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS = "BisCore:ElementOwnsUniqueAspect";
344
+ QueryBuilder.DEFAULT_DOUBLE_PRECISION = 4;
345
+ //# sourceMappingURL=QueryBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilder.js","sourceRoot":"","sources":["../../../../src/widget/components/QueryBuilder.ts"],"names":[],"mappings":";;;AASA,0DAE+B;AAC/B,2CAAyC;AAoBzC,4FAA4F;AAC5F,MAAa,YAAY;IAUvB;;OAEG;IACH,YAAY,QAAsD;QAChE,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,IAAoB;;QAC3C,6CAA6C;QAC7C,IACE,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,MAAK,oCAAmB,CAAC,SAAS;YACzD,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,EAC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,CAAC,EAAE;gBACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBAC1C,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE;wBAC5B,WAAW,IAAI,QAAQ,aAAa,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;qBACvF;yBAAM;wBACL,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;4BACtC,WAAW,IAAI,cAAc,aAAa,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;4BACrE,WAAW,IAAI,GAAG,YAAY,CAAC,wBAAwB,IAAI,CAAC;4BAC5D,WAAW,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CACnD,YAAY,CAAC,wBAAwB,CACtC,EAAE,CAAC;yBACL;6BAAM;4BACL,WAAW,IAAI,QAAQ,aAAa,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;yBACrF;qBACF;iBACF;aACF;SACF;QAED,4BAA4B;QAC5B,2BAA2B;QAC3B,OAAO,WAAW,CAAC;IACrB,CAAC;IAEO,QAAQ,CAAC,CAAU;QACzB,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;;AApdH,oCAqdC;AApdwB,uCAA0B,GAC/C,iCAAiC,CAAC;AACb,wCAA2B,GAChD,iCAAiC,CAAC;AACb,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 { InstanceKey, PropertiesField } from \"@itwin/presentation-common\";\nimport type {\n Primitives,\n PropertyRecord} from \"@itwin/appui-abstract\";\nimport {\n PropertyValueFormat,\n} from \"@itwin/appui-abstract\";\nimport \"core-js/features/string/virtual\";\n\nexport interface Query {\n classes: QueryClass[];\n}\n\nexport interface QueryClass {\n // schemaName.className\n className: string;\n properties: QueryProperty[];\n isAspect: boolean;\n isRelational?: boolean;\n}\n\nexport interface QueryProperty {\n name: string;\n value: Primitives.Value;\n needsQuote: boolean;\n}\n\n/* This class is to build adaptive and dynamic query for find similar property selections */\nexport class QueryBuilder {\n public static readonly MULTI_ASPECT_PRIMARY_CLASS =\n \"BisCore:ElementOwnsMultiAspects\";\n public static readonly UNIQUE_ASPECT_PRIMARY_CLASS =\n \"BisCore:ElementOwnsUniqueAspect\";\n public static readonly DEFAULT_DOUBLE_PRECISION = 4;\n\n public dataProvider: PresentationPropertyDataProvider | undefined;\n public query: Query | undefined;\n\n /**\n *\n */\n constructor(provider: PresentationPropertyDataProvider | undefined) {\n this.dataProvider = provider;\n }\n\n public async addProperty(prop: PropertyRecord) {\n // TODO: only handle primitive properties now\n if (\n prop.value?.valueFormat !== PropertyValueFormat.Primitive ||\n prop.value.value === undefined\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 propertyField = (await this.dataProvider?.getFieldByPropertyRecord(\n prop,\n )) as PropertiesField;\n if (propertyField === undefined) {\n return;\n }\n\n // get the special cases\n const isNavigation: boolean =\n prop.property.typename.toLowerCase() === \"navigation\";\n\n const isAspect: boolean =\n propertyField.parent?.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 const className =\n propertyField.properties[0].property.classInfo.name.replace(\":\", \".\");\n const propertyName = isNavigation\n ? `${propertyField.properties[0].property.name}.id`\n : propertyField.properties[0].property.name;\n const propertyValue = isNavigation\n ? (prop.value.value as InstanceKey).id\n : prop.value.value;\n\n // console.log(prop);\n // console.log(propertyField);\n\n if (\n !isAspect &&\n propertyField.parent?.pathToPrimaryClass &&\n propertyField.parent?.pathToPrimaryClass.length > 0\n ) {\n this.addRelatedProperty(\n propertyField,\n propertyName,\n propertyValue,\n isAspect,\n );\n } else {\n this.addPropertyToQuery(\n className,\n propertyName,\n propertyValue,\n isAspect,\n this._needsQuote(propertyField),\n false,\n );\n }\n }\n\n private _needsQuote(propertyField: PropertiesField): boolean {\n // list of property types that need quote around property value\n if (propertyField.type.typeName.toLowerCase() === \"string\") {\n return true;\n }\n if (propertyField.type.typeName.toLowerCase() === \"uri\") {\n return true;\n }\n return false;\n }\n\n public addRelatedProperty(\n propertyField: PropertiesField,\n propertyName: string,\n propertyValue: Primitives.Value,\n isAspect: boolean,\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 if (!path.isForwardRelationship) {\n this.addPropertyToQuery(\n targetClassName,\n `ECInstanceId`,\n `${relClassName}.SourceECInstanceId`,\n isAspect,\n false,\n true,\n );\n this.addPropertyToQuery(\n relClassName,\n `TargetECInstanceId`,\n `${sourceClassName}.ECInstanceId`,\n isAspect,\n false,\n true,\n );\n if (\n path.sourceClassInfo?.name ===\n propertyField.parent?.contentClassInfo.name\n ) {\n this.addPropertyToQuery(\n sourceClassName,\n propertyName,\n propertyValue,\n isAspect,\n this._needsQuote(propertyField),\n true,\n );\n } else {\n this.addPropertyToQuery(\n sourceClassName,\n `ECInstanceId`,\n `${relClassName}.TargetECInstanceId`,\n isAspect,\n false,\n true,\n );\n }\n } else {\n this.addPropertyToQuery(\n targetClassName,\n `ECInstanceId`,\n `${relClassName}.TargetECInstanceId`,\n isAspect,\n false,\n true,\n );\n this.addPropertyToQuery(\n relClassName,\n `SourceECInstanceId`,\n `${sourceClassName}.ECInstanceId`,\n isAspect,\n false,\n true,\n );\n if (\n path.sourceClassInfo?.name ===\n propertyField.parent?.contentClassInfo.name\n ) {\n this.addPropertyToQuery(\n sourceClassName,\n propertyName,\n propertyValue,\n isAspect,\n this._needsQuote(propertyField),\n true,\n );\n } else {\n this.addPropertyToQuery(\n sourceClassName,\n `ECInstanceId`,\n `${relClassName}.SourceECInstanceId`,\n isAspect,\n false,\n true,\n );\n }\n }\n });\n }\n\n public addPropertyToQuery(\n className: string,\n propertyName: string,\n propertyValue: Primitives.Value,\n isAspect: boolean,\n needsQuote: boolean,\n isRelational?: boolean,\n ) {\n if (this.query === undefined || this.query.classes.length === 0) {\n this.query = {\n classes: [\n {\n className,\n isAspect,\n isRelational,\n properties: [\n {\n name: propertyName,\n value: propertyValue,\n needsQuote,\n },\n ],\n },\n ],\n };\n return;\n }\n\n const foundClass = this.query.classes.find(\n (c) => c.className === className,\n );\n if (foundClass) {\n foundClass.isRelational = isRelational;\n if (!foundClass.properties.find((x) => x.name === propertyName)) {\n foundClass.properties.push({\n name: propertyName,\n value: propertyValue,\n needsQuote,\n });\n }\n } else {\n this.query.classes.push({\n className,\n isRelational,\n properties: [\n {\n name: propertyName,\n value: propertyValue,\n needsQuote,\n },\n ],\n isAspect,\n });\n }\n }\n\n public async removeProperty(prop: PropertyRecord) {\n if (this.query === undefined || this.query.classes.length === 0) {\n return;\n }\n\n const propertyField = (await this.dataProvider?.getFieldByPropertyRecord(\n prop,\n )) as PropertiesField;\n if (propertyField === undefined) {\n return;\n }\n\n const isAspect: boolean =\n propertyField.parent?.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 const isNavigation: boolean =\n prop.property.typename.toLowerCase() === \"navigation\";\n\n const propertyName = isNavigation\n ? `${propertyField.properties[0].property.name}.id`\n : propertyField.properties[0].property.name;\n const className =\n propertyField.properties[0].property.classInfo.name.replace(\":\", \".\");\n\n if (\n !isAspect &&\n propertyField.parent?.pathToPrimaryClass &&\n propertyField.parent?.pathToPrimaryClass.length > 0\n ) {\n this.removeRelatedProperty(propertyField, propertyName);\n } else {\n this.removePropertyFromQuery(className, propertyName);\n }\n }\n\n public removeRelatedProperty(\n propertyField: PropertiesField,\n propertyName: string,\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 if (!path.isForwardRelationship) {\n this.removePropertyFromQuery(targetClassName, `ECInstanceId`);\n this.removePropertyFromQuery(relClassName, `TargetECInstanceId`);\n if (\n path.sourceClassInfo?.name ===\n propertyField.parent?.contentClassInfo.name\n ) {\n this.removePropertyFromQuery(sourceClassName, propertyName);\n } else {\n this.removePropertyFromQuery(sourceClassName, `ECInstanceId`);\n }\n } else {\n this.removePropertyFromQuery(targetClassName, `ECInstanceId`);\n this.removePropertyFromQuery(relClassName, `SourceECInstanceId`);\n if (\n path.sourceClassInfo?.name ===\n propertyField.parent?.contentClassInfo.name\n ) {\n this.removePropertyFromQuery(sourceClassName, propertyName);\n } else {\n this.removePropertyFromQuery(sourceClassName, `ECInstanceId`);\n }\n }\n });\n }\n\n public removePropertyFromQuery(className: string, propertyName: string) {\n const foundClass = this.query?.classes.find(\n (c) => c.className === className,\n );\n if (foundClass) {\n const foundPropertyIndex = foundClass.properties.findIndex(\n (p) => p.name === propertyName,\n );\n if (foundPropertyIndex > -1) {\n foundClass.properties.splice(foundPropertyIndex, 1);\n }\n if (foundClass.properties.length === 0) {\n // remove the entire class if all properties are removed\n const foundClassIndex =\n this.query?.classes.findIndex((c) => c.className === className) ?? -1;\n if (foundClassIndex > -1) {\n this.query?.classes.splice(foundClassIndex, 1);\n }\n }\n }\n }\n\n public buildQueryString() {\n if (this.query === undefined || this.query.classes.length === 0) {\n return \"\";\n }\n\n const baseClass = this.query.classes[0];\n const baseClassName = baseClass.className;\n const baseIdName = baseClass.isAspect\n ? `${baseClassName}.Element.id`\n : `${baseClassName}.ECInstanceId`;\n\n let queryString = `SELECT ${baseIdName} FROM ${baseClassName}`;\n\n if (this.query.classes.length > 1) {\n for (let i = 1; i < this.query.classes.length; i++) {\n const joinClass = this.query.classes[i];\n const joinClassName = joinClass.className;\n const joinIdName = joinClass.isAspect\n ? `${joinClassName}.Element.id`\n : `${joinClassName}.ECInstanceId`;\n\n if (joinClass.isRelational) {\n queryString += ` JOIN ${joinClassName}`;\n if (joinClass.properties.length > 0) {\n if (joinClass.properties[0].needsQuote) {\n queryString += ` ON ${joinClassName}.${joinClass.properties[0].name}='${joinClass.properties[0].value}'`;\n } else {\n if (this._isFloat(joinClass.properties[0].value)) {\n queryString += ` ON ROUND(${joinClassName}.${joinClass.properties[0].name}, `;\n queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;\n queryString += `${Number(joinClass.properties[0].value).toFixed(\n QueryBuilder.DEFAULT_DOUBLE_PRECISION,\n )}`;\n } else {\n queryString += ` ON ${joinClassName}.${joinClass.properties[0].name}=${joinClass.properties[0].value}`;\n }\n }\n }\n // when base is regular property, link base to first joined relational property\n if (!baseClass.isRelational && i === 1) {\n queryString += ` AND ${joinIdName} = ${baseIdName}`;\n }\n for (const property of joinClass.properties) {\n if (property.needsQuote) {\n queryString += ` AND ${joinClassName}.${property.name}='${property.value}'`;\n } else {\n if (this._isFloat(property.value)) {\n queryString += ` AND ROUND(${joinClassName}.${property.name}, `;\n queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;\n queryString += `${Number(property.value).toFixed(\n QueryBuilder.DEFAULT_DOUBLE_PRECISION,\n )}`;\n } else {\n queryString += ` AND ${joinClassName}.${property.name}=${property.value}`;\n }\n }\n }\n } else {\n queryString += ` JOIN ${joinClassName} ON ${joinIdName} = ${baseIdName}`;\n for (const property of joinClass.properties) {\n if (property.needsQuote) {\n queryString += ` AND ${joinClassName}.${property.name}='${property.value}'`;\n } else {\n if (this._isFloat(property.value)) {\n queryString += ` AND ROUND(${joinClassName}.${property.name}, `;\n queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;\n queryString += `${Number(property.value).toFixed(\n QueryBuilder.DEFAULT_DOUBLE_PRECISION,\n )}`;\n } else {\n queryString += ` AND ${joinClassName}.${property.name}=${property.value}`;\n }\n }\n }\n }\n }\n }\n\n const properties = baseClass.properties;\n if (properties.length > 0) {\n if (properties[0].needsQuote) {\n queryString += ` WHERE ${baseClassName}.${properties[0].name}='${properties[0].value}'`;\n } else {\n if (this._isFloat(properties[0].value)) {\n queryString += ` WHERE ROUND(${baseClassName}.${properties[0].name}, `;\n queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;\n queryString += `${Number(properties[0].value).toFixed(\n QueryBuilder.DEFAULT_DOUBLE_PRECISION,\n )}`;\n } else {\n queryString += ` WHERE ${baseClassName}.${properties[0].name}=${properties[0].value}`;\n }\n }\n if (properties.length > 1) {\n for (let i = 1; i < properties.length; i++) {\n if (properties[i].needsQuote) {\n queryString += ` AND ${baseClassName}.${properties[i].name}='${properties[i].value}'`;\n } else {\n if (this._isFloat(properties[i].value)) {\n queryString += ` AND ROUND(${baseClassName}.${properties[i].name}, `;\n queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;\n queryString += `${Number(properties[i].value).toFixed(\n QueryBuilder.DEFAULT_DOUBLE_PRECISION,\n )}`;\n } else {\n queryString += ` AND ${baseClassName}.${properties[i].name}=${properties[i].value}`;\n }\n }\n }\n }\n }\n\n // console.log(queryString);\n // console.log(this.query);\n return queryString;\n }\n\n private _isFloat(n: unknown): boolean {\n return Number(n) === n && n % 1 !== 0;\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { IModelFull } from "@itwin/imodel-browser-react";
3
+ import "./SelectIModel.scss";
4
+ interface SelectIModelProps {
5
+ projectId: string;
6
+ onSelect: (project: IModelFull) => void;
7
+ onCancel: () => void;
8
+ backFn: () => void;
9
+ }
10
+ declare const SelectIModel: ({ projectId, onSelect, onCancel, backFn, }: SelectIModelProps) => JSX.Element;
11
+ export default SelectIModel;
12
+ //# sourceMappingURL=SelectIModel.d.ts.map
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const imodel_browser_react_1 = require("@itwin/imodel-browser-react");
26
+ const itwinui_react_1 = require("@itwin/itwinui-react");
27
+ const react_1 = __importStar(require("react"));
28
+ const reportingClient_1 = require("../../api/reportingClient");
29
+ const useFetchAccessToken_1 = __importDefault(require("../hooks/useFetchAccessToken"));
30
+ require("./SelectIModel.scss");
31
+ const SelectIModel = ({ projectId, onSelect, onCancel, backFn, }) => {
32
+ const accessToken = useFetchAccessToken_1.default();
33
+ const apiOverrides = react_1.useMemo(() => ({ serverEnvironmentPrefix: reportingClient_1.getUrlPrefix() }), []);
34
+ return (react_1.default.createElement("div", { className: 'imodel-grid-container' },
35
+ react_1.default.createElement("div", { className: 'imodel-grid' },
36
+ react_1.default.createElement(imodel_browser_react_1.IModelGrid, { projectId: projectId, onThumbnailClick: onSelect, accessToken: accessToken, apiOverrides: apiOverrides })),
37
+ react_1.default.createElement("div", { className: 'import-action-panel' },
38
+ react_1.default.createElement(itwinui_react_1.Button, { onClick: backFn }, "Back"),
39
+ react_1.default.createElement(itwinui_react_1.Button, { onClick: onCancel }, "Cancel"))));
40
+ };
41
+ exports.default = SelectIModel;
42
+ //# sourceMappingURL=SelectIModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA,sEAEqC;AACrC,wDAA8C;AAC9C,+CAAuC;AACvC,+DAAyD;AACzD,uFAA+D;AAC/D,+BAA6B;AAQ7B,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,GACY,EAAE,EAAE;IACtB,MAAM,WAAW,GAAG,6BAAmB,EAAE,CAAC;IAE1C,MAAM,YAAY,GAAG,eAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,EAAE,uBAAuB,EAAE,8BAAY,EAAE,EAAE,CAAC,EACnD,EAAE,CACH,CAAC;IAEF,OAAO,CACL,uCAAK,SAAS,EAAC,uBAAuB;QACpC,uCAAK,SAAS,EAAC,aAAa;YAC1B,8BAAC,iCAAU,IACT,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,QAAQ,EAC1B,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,GAC1B,CACE;QACN,uCAAK,SAAS,EAAC,qBAAqB;YAClC,8BAAC,sBAAM,IAAC,OAAO,EAAE,MAAM,WAAe;YACtC,8BAAC,sBAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type {\n ApiOverrides,\n IModelFull,\n} from \"@itwin/imodel-browser-react\";\nimport {\n IModelGrid,\n} from \"@itwin/imodel-browser-react\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport React, { useMemo } from \"react\";\nimport { getUrlPrefix } from \"../../api/reportingClient\";\nimport useFetchAccessToken from \"../hooks/useFetchAccessToken\";\nimport \"./SelectIModel.scss\";\n\ninterface SelectIModelProps {\n projectId: string;\n onSelect: (project: IModelFull) => void;\n onCancel: () => void;\n backFn: () => void;\n}\nconst SelectIModel = ({\n projectId,\n onSelect,\n onCancel,\n backFn,\n}: SelectIModelProps) => {\n const accessToken = useFetchAccessToken();\n\n const apiOverrides = useMemo<ApiOverrides<IModelFull[]>>(\n () => ({ serverEnvironmentPrefix: getUrlPrefix() }),\n []\n );\n\n return (\n <div className='imodel-grid-container'>\n <div className='imodel-grid'>\n <IModelGrid\n projectId={projectId}\n onThumbnailClick={onSelect}\n accessToken={accessToken}\n apiOverrides={apiOverrides}\n />\n </div>\n <div className='import-action-panel'>\n <Button onClick={backFn}>Back</Button>\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectIModel;\n"]}
@@ -0,0 +1,20 @@
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
+ .imodel-grid-container {
8
+ display: flex;
9
+ flex-direction: column;
10
+ height: 66vh;
11
+
12
+ .imodel-grid {
13
+ overflow: auto;
14
+ flex-grow: 1;
15
+
16
+ .search-input {
17
+ margin-left: auto;
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,17 @@
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
+ .select-mapping-container {
8
+ display: flex;
9
+ flex-direction: column;
10
+ height: 66vh;
11
+ gap: $iui-baseline * 2;
12
+
13
+ .select-mapping-table {
14
+ flex-grow: 1;
15
+ overflow: auto;
16
+ }
17
+ }
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { Mapping } from "./Mapping";
3
+ import "./SelectMapping.scss";
4
+ interface SelectMappingsProps {
5
+ iModelId: string;
6
+ onSelect: (selectedMappings: Mapping[]) => void;
7
+ onCancel: () => void;
8
+ backFn: () => void;
9
+ }
10
+ declare const SelectMappings: ({ iModelId, onSelect, onCancel, backFn, }: SelectMappingsProps) => JSX.Element;
11
+ export default SelectMappings;
12
+ //# sourceMappingURL=SelectMappings.d.ts.map
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const itwinui_react_1 = require("@itwin/itwinui-react");
23
+ const react_1 = __importStar(require("react"));
24
+ const reportingClient_1 = require("../../api/reportingClient");
25
+ require("./SelectMapping.scss");
26
+ const fetchMappings = async (setMappings, iModelId, setIsLoading) => {
27
+ try {
28
+ setIsLoading(true);
29
+ const mappings = await reportingClient_1.reportingClientApi.getMappings(iModelId);
30
+ setMappings(mappings);
31
+ }
32
+ catch {
33
+ }
34
+ finally {
35
+ setIsLoading(false);
36
+ }
37
+ };
38
+ const useFetchMappings = (iModelId, setIsLoading) => {
39
+ const [mappings, setMappings] = react_1.useState([]);
40
+ react_1.useEffect(() => {
41
+ void fetchMappings(setMappings, iModelId, setIsLoading);
42
+ }, [iModelId, setIsLoading]);
43
+ return [mappings, setMappings];
44
+ };
45
+ const SelectMappings = ({ iModelId, onSelect, onCancel, backFn, }) => {
46
+ const [isLoading, setIsLoading] = react_1.useState(true);
47
+ const [mappings] = useFetchMappings(iModelId, setIsLoading);
48
+ const [selectedMappings, setSelectedMappings] = react_1.useState([]);
49
+ const mappingsColumns = react_1.useMemo(() => [
50
+ {
51
+ Header: "Table",
52
+ columns: [
53
+ {
54
+ id: "mappingName",
55
+ Header: "Mapping Name",
56
+ accessor: "mappingName",
57
+ Filter: itwinui_react_1.tableFilters.TextFilter(),
58
+ },
59
+ {
60
+ id: "description",
61
+ Header: "Description",
62
+ accessor: "description",
63
+ Filter: itwinui_react_1.tableFilters.TextFilter(),
64
+ },
65
+ ],
66
+ },
67
+ ], []);
68
+ const pageSizeList = react_1.useMemo(() => [10, 25, 50], []);
69
+ const paginator = react_1.useCallback((props) => (react_1.default.createElement(itwinui_react_1.TablePaginator, { ...props, pageSizeList: pageSizeList })), [pageSizeList]);
70
+ return (react_1.default.createElement("div", { className: 'select-mapping-container' },
71
+ react_1.default.createElement(itwinui_react_1.Table, { data: mappings, columns: mappingsColumns, className: 'select-mapping-table', emptyTableContent: 'No Mappings available.', isSortable: true, isSelectable: true, isLoading: isLoading, onSelect: (selectData) => {
72
+ selectData && setSelectedMappings(selectData);
73
+ }, paginatorRenderer: paginator }),
74
+ react_1.default.createElement("div", { className: 'import-action-panel' },
75
+ react_1.default.createElement(itwinui_react_1.Button, { onClick: backFn }, "Back"),
76
+ react_1.default.createElement(itwinui_react_1.Button, { styleType: 'high-visibility', onClick: () => {
77
+ onSelect(selectedMappings);
78
+ }, disabled: isLoading || selectedMappings.length === 0 }, "Next"),
79
+ react_1.default.createElement(itwinui_react_1.Button, { onClick: onCancel }, "Cancel"))));
80
+ };
81
+ exports.default = SelectMappings;
82
+ //# sourceMappingURL=SelectMappings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectMappings.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectMappings.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA,wDAK8B;AAC9B,+CAAyE;AAEzE,+DAA+D;AAE/D,gCAA8B;AAE9B,MAAM,aAAa,GAAG,KAAK,EACzB,WAAwE,EACxE,QAAgB,EAChB,YAA2D,EAC3D,EAAE;IACF,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,QAAQ,GAAG,MAAM,oCAAkB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC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D,EAAE,CACH,CAAC;IAEF,MAAM,YAAY,GAAG,eAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,mBAAW,CAC3B,CAAC,KAAkC,EAAE,EAAE,CAAC,CACtC,8BAAC,8BAAc,OAAK,KAAK,EAAE,YAAY,EAAE,YAAY,GAAI,CAC1D,EACD,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,OAAO,CACL,uCAAK,SAAS,EAAC,0BAA0B;QACvC,8BAAC,qBAAK,IACJ,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,sBAAsB,EAChC,iBAAiB,EAAC,wBAAwB,EAC1C,UAAU,QACV,YAAY,QACZ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,UAAiC,EAAE,EAAE;gBAC9C,UAAU,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;YAChD,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B;QACF,uCAAK,SAAS,EAAC,qBAAqB;YAClC,8BAAC,sBAAM,IAAC,OAAO,EAAE,MAAM,WAAe;YACtC,8BAAC,sBAAM,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,8BAAC,sBAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,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} 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 { MappingReportingAPI } from \"../../api/generated/api\";\nimport { reportingClientApi } from \"../../api/reportingClient\";\nimport type { Mapping } from \"./Mapping\";\nimport \"./SelectMapping.scss\";\n\nconst fetchMappings = async (\n setMappings: React.Dispatch<React.SetStateAction<MappingReportingAPI[]>>,\n iModelId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>\n) => {\n try {\n setIsLoading(true);\n const mappings = await reportingClientApi.getMappings(iModelId);\n setMappings(mappings);\n } catch {\n } finally {\n setIsLoading(false);\n }\n};\n\nconst useFetchMappings = (\n iModelId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>\n): [\n MappingReportingAPI[],\n React.Dispatch<React.SetStateAction<MappingReportingAPI[]>>\n] => {\n const [mappings, setMappings] = useState<MappingReportingAPI[]>([]);\n useEffect(() => {\n void fetchMappings(setMappings, iModelId, setIsLoading);\n }, [iModelId, setIsLoading]);\n\n return [mappings, setMappings];\n};\n\ninterface SelectMappingsProps {\n iModelId: string;\n onSelect: (selectedMappings: Mapping[]) => void;\n onCancel: () => void;\n backFn: () => void;\n}\n\nconst SelectMappings = ({\n iModelId,\n onSelect,\n onCancel,\n backFn,\n}: SelectMappingsProps) => {\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [mappings] = useFetchMappings(iModelId, setIsLoading);\n const [selectedMappings, setSelectedMappings] = useState<Mapping[]>([]);\n\n const mappingsColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"mappingName\",\n Header: \"Mapping Name\",\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 []\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='select-mapping-container'>\n <Table<Mapping>\n data={mappings}\n columns={mappingsColumns}\n className='select-mapping-table'\n emptyTableContent='No Mappings available.'\n isSortable\n isSelectable\n isLoading={isLoading}\n onSelect={(selectData: Mapping[] | undefined) => {\n selectData && setSelectedMappings(selectData);\n }}\n paginatorRenderer={paginator}\n />\n <div className='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,10 @@
1
+ /// <reference types="react" />
2
+ import type { ProjectFull } from "@itwin/imodel-browser-react";
3
+ import "./SelectProject.scss";
4
+ interface SelectProjectProps {
5
+ onSelect: (project: ProjectFull) => void;
6
+ onCancel: () => void;
7
+ }
8
+ declare const SelectProject: ({ onSelect, onCancel }: SelectProjectProps) => JSX.Element;
9
+ export default SelectProject;
10
+ //# sourceMappingURL=SelectProject.d.ts.map