@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 @@
1
+ {"version":3,"file":"PropertyView.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyView.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2FAA2F,CAAC;AAC5I,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAchD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;IACvD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;IAE3D,MAAM,0BAA0B,GAAG,GAAG,EAAE;QACtC,IAAI,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;YAC9D,OAAO,IAAI,CAAC;SACb;QACD,0CAA0C;QAC1C,IAAI,CAAC,kCAAkC,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;YAC7D,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC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K,CAAC,cAAc,EAC9B,iBAAiB,EAAE,SAAS,EAC5B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,GAClD,CACH,CAAC,CAAC,CAAC,SAAS,CACT,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { PropertyRecord} from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { ElementSeparator, Orientation } from \"@itwin/core-react\";\nimport { ActionButtonList } from \"@itwin/components-react\";\n\nimport \"./PropertyView.scss\";\nimport type { SharedRendererProps } from \"./PropertyRender\";\nimport { GroupQueryBuilderContext } from \"../GroupQueryBuilderContext\";\nimport { useCallback } from \"react\";\nimport { PropertyGridColumnStyleProvider } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns\";\nimport { Checkbox } from \"@itwin/itwinui-react\";\n\n/** Properties of [[PropertyView]] React component\n * @public\n */\nexport interface PropertyViewProps extends SharedRendererProps {\n /** Property label as a React element */\n labelElement: React.ReactNode;\n /** Property value as a React element */\n valueElement?: React.ReactNode;\n /** Render callback for property value. If specified, `valueElement` is ignored. */\n valueElementRenderer?: () => React.ReactNode;\n}\n\n/**\n * A React component that renders property as label/value pair\n * @public\n */\nexport const PropertyView = (props: PropertyViewProps) => {\n const context = React.useContext(GroupQueryBuilderContext);\n\n const _validatePropertySelection = () => {\n if (context.currentPropertyList.includes(props.propertyRecord)) {\n return true;\n }\n // Check if all subproperties are selected\n if (!_validateNestedPropertiesSelection(props.propertyRecord)) {\n return false;\n }\n return true;\n };\n\n const _validateNestedPropertiesSelection = (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n if (!context.currentPropertyList.includes(prop)) {\n return false;\n }\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n if (!context.currentPropertyList.includes(prop)) {\n return false;\n }\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n if (\n !_validateNestedPropertiesSelection(\n prop.value.members[subPropName]\n )\n ) {\n return false;\n }\n }\n }\n }\n return true;\n };\n\n const [isHovered, setIsHovered] = React.useState<boolean>(false);\n const [isPropertySelected, setIsPropertySelected] = React.useState<boolean>(\n _validatePropertySelection()\n );\n\n const _addSelectedProperty = useCallback(\n async (prop: PropertyRecord) => {\n // TODO: roof selected item/category value is an object but format is primitive(needs further exploration)\n if (\n !context.currentPropertyList.includes(prop) &&\n prop.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n context.setCurrentPropertyList(\n context.currentPropertyList.concat(prop)\n );\n await context.queryBuilder.addProperty(prop);\n context.setQuery(context.queryBuilder.buildQueryString());\n }\n },\n [context]\n );\n\n const _addNestedProperties = useCallback(\n (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n void _addSelectedProperty(prop);\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n void _addSelectedProperty(prop);\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n _addNestedProperties(prop.value.members[subPropName]);\n }\n }\n }\n },\n [_addSelectedProperty]\n );\n\n const _removeSelectedProperty = useCallback(\n async (prop: PropertyRecord): Promise<void> => {\n if (context.currentPropertyList.includes(prop)) {\n context.setCurrentPropertyList(\n context.currentPropertyList.filter((x: PropertyRecord) => x !== prop)\n );\n await context.queryBuilder.removeProperty(prop);\n context.setQuery(context.queryBuilder.buildQueryString());\n }\n },\n [context]\n );\n\n const _removeNestedProperties = useCallback(\n (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n void _removeSelectedProperty(prop);\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n void _removeSelectedProperty(prop);\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n _removeNestedProperties(prop.value.members[subPropName]);\n }\n }\n }\n },\n [_removeSelectedProperty]\n );\n\n React.useEffect(() => {\n if (props?.propertyRecord) {\n if (isPropertySelected) {\n _addNestedProperties(props.propertyRecord);\n } else {\n _removeNestedProperties(props.propertyRecord);\n }\n }\n }, [\n _addNestedProperties,\n _removeNestedProperties,\n isPropertySelected,\n props.propertyRecord,\n ]);\n\n React.useEffect(() => {\n if (props?.propertyRecord) {\n if (context.currentPropertyList.includes(props.propertyRecord)) {\n setIsPropertySelected(true);\n } else {\n setIsPropertySelected(false);\n }\n }\n }, [context.currentPropertyList, props.propertyRecord]);\n\n const _onPropertySelectionChanged = () => {\n setIsPropertySelected(!isPropertySelected);\n };\n\n const _onClick = () => {\n if (props.onClick) {\n props.onClick(props.propertyRecord, props.uniqueKey);\n }\n };\n\n const _onMouseEnter = () => {\n if (props.isHoverable) {\n setIsHovered(true);\n }\n };\n\n const _onMouseLeave = () => {\n if (props.isHoverable) {\n setIsHovered(false);\n }\n };\n\n const _onContextMenu = (e: React.MouseEvent) => {\n if (props.onContextMenu) {\n props.onContextMenu(props.propertyRecord, e);\n }\n if (props.onRightClick) {\n props.onRightClick(props.propertyRecord, props.uniqueKey);\n }\n e.preventDefault();\n return false;\n };\n\n const getClassName = (viewProps: PropertyViewProps) => {\n let propertyRecordClassName =\n viewProps.orientation === Orientation.Horizontal\n ? \"components-property-record--horizontal\"\n : \"components-property-record--vertical\";\n if (viewProps.isSelected) {\n propertyRecordClassName += \" components--selected\";\n }\n if (viewProps.onClick) {\n propertyRecordClassName += \" components--clickable\";\n }\n if (viewProps.isHoverable) {\n propertyRecordClassName += \" components--hoverable\";\n }\n return propertyRecordClassName;\n };\n\n const ratio = props.columnRatio ? props.columnRatio : 0.25;\n const needElementSeparator =\n props.orientation === Orientation.Horizontal &&\n !!props.onColumnRatioChanged;\n const needActionButtons = !!props.actionButtonRenderers;\n const columnsStyleProvider = new PropertyGridColumnStyleProvider(\n props.columnInfo\n );\n\n return (\n <div\n style={columnsStyleProvider.getStyle(\n props.orientation,\n needActionButtons,\n ratio,\n needElementSeparator\n )}\n className={getClassName(props)}\n onClick={_onClick}\n onContextMenu={_onContextMenu}\n onMouseEnter={_onMouseEnter}\n onMouseLeave={_onMouseLeave}\n role='presentation'\n >\n <div className='components-property-record-label'>\n {props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive && (\n <Checkbox\n className='components-property-selection-checkbox'\n checked={isPropertySelected}\n onChange={_onPropertySelectionChanged}\n />\n )}\n {props.labelElement}\n </div>\n {needElementSeparator ? (\n <ElementSeparator\n movableArea={props.width}\n onRatioChanged={props.onColumnRatioChanged}\n ratio={ratio}\n orientation={props.orientation}\n isResizeHandleHovered={props.isResizeHandleHovered}\n onResizeHandleHoverChanged={props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={props.onResizeHandleDragChanged}\n />\n ) : undefined}\n {props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive ? (\n <div className='components-property-record-value'>\n <span>\n {props.valueElementRenderer\n ? props.valueElementRenderer()\n : props.valueElement}\n </span>\n </div>\n ) : undefined}\n {props.actionButtonRenderers ? (\n <ActionButtonList\n orientation={props.orientation}\n property={props.propertyRecord}\n isPropertyHovered={isHovered}\n actionButtonRenderers={props.actionButtonRenderers}\n />\n ) : undefined}\n </div>\n );\n};\n"]}
@@ -0,0 +1,111 @@
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/core-react/lib/cjs/core-react/style/themecolors";
6
+ @import "~@itwin/itwinui-css/scss/style/typography";
7
+ @import "~@itwin/itwinui-css/scss/variables";
8
+
9
+ $text-font-size: $iui-font-size;
10
+ $text-font-color: $buic-text-color;
11
+
12
+ .components-property-record--horizontal {
13
+ height: 100%;
14
+ display: grid;
15
+ padding: 0 8px;
16
+
17
+ .components-property-record-label {
18
+ font-size: $iui-font-size-small;
19
+ color: $buic-foreground-muted;
20
+ }
21
+
22
+ .components-property-record-value {
23
+ min-height: 24px;
24
+ font-size: $text-font-size;
25
+ color: $text-font-color;
26
+ padding: 0px 5px;
27
+ }
28
+ }
29
+
30
+ .components-property-record--vertical {
31
+ height: 100%;
32
+ padding: 0 8px;
33
+ display: grid;
34
+ align-content: center;
35
+
36
+ .components-property-record-label {
37
+ font-size: $iui-font-size-small;
38
+ color: $buic-foreground-muted;
39
+ }
40
+
41
+ .components-property-record-value {
42
+ min-height: 22px;
43
+ font-size: $text-font-size;
44
+ color: $text-font-color;
45
+ }
46
+ }
47
+
48
+ @mixin record-cell {
49
+ display: flex;
50
+ align-items: center;
51
+ }
52
+
53
+ .components-property-record-label {
54
+ @include record-cell;
55
+ .components-property-selection-checkbox {
56
+ margin-right: $iui-s;
57
+ }
58
+ }
59
+
60
+ .components-property-record-value {
61
+ @include record-cell;
62
+ overflow: hidden;
63
+
64
+ span {
65
+ white-space: nowrap;
66
+ overflow: hidden;
67
+ text-overflow: ellipsis;
68
+ width: 100%;
69
+ }
70
+
71
+ .core-underlined-button {
72
+ // Offset by 2px, because value is centered vertically
73
+ // and the button has an underline which offsets it's content,
74
+ // which in turn makes it not in line with the rest of text
75
+ margin-top: 2px;
76
+ }
77
+
78
+ .multiline {
79
+ display: flex;
80
+ align-items: baseline;
81
+ }
82
+
83
+ .expanded {
84
+ white-space: pre-wrap;
85
+ margin-top: 4px;
86
+ margin-bottom: 4px;
87
+
88
+ .expand-toggle {
89
+ float: right;
90
+ margin-top: 2px;
91
+ }
92
+ }
93
+
94
+ .expand-toggle {
95
+ padding: 0;
96
+ white-space: nowrap;
97
+ border: none;
98
+ background: none;
99
+ color: var(--buic-foreground-primary);
100
+ font-size: 12px;
101
+ cursor: pointer;
102
+
103
+ &:hover {
104
+ text-decoration: underline;
105
+ }
106
+
107
+ &:active {
108
+ outline: none;
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,14 @@
1
+ import "./utils.scss";
2
+ import React from "react";
3
+ import type { ISelectionProvider, SelectionChangeEventArgs } from "@itwin/presentation-frontend";
4
+ import type { IModelConnection } from "@itwin/core-frontend";
5
+ export declare const onSelectionChanged: (evt: SelectionChangeEventArgs, selectionProvider: ISelectionProvider) => void;
6
+ export interface WidgetHeaderProps {
7
+ title: string;
8
+ disabled?: boolean;
9
+ returnFn?: () => Promise<void>;
10
+ }
11
+ export declare const WidgetHeader: ({ title, disabled, returnFn, }: WidgetHeaderProps) => JSX.Element;
12
+ export declare const handleInputChange: <T>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: React.Dispatch<React.SetStateAction<T>>) => void;
13
+ export declare const fetchIdsFromQuery: (query: string, iModelConnection: IModelConnection) => Promise<string[]>;
14
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,72 @@
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 { SvgChevronLeft } from "@itwin/itwinui-icons-react";
6
+ import { Text } from "@itwin/itwinui-react";
7
+ import "./utils.scss";
8
+ import React from "react";
9
+ import { QueryRowFormat } from "@itwin/core-common";
10
+ export const onSelectionChanged = (evt, selectionProvider) => {
11
+ /* eslint-disable no-console */
12
+ const selection = selectionProvider.getSelection(evt.imodel, evt.level);
13
+ if (selection.isEmpty) {
14
+ console.log("========== Selection cleared ==========");
15
+ }
16
+ else {
17
+ console.log("========== Selection change ===========");
18
+ if (selection.instanceKeys.size !== 0) {
19
+ // log all selected ECInstance ids grouped by ECClass name
20
+ console.log("ECInstances:");
21
+ selection.instanceKeys.forEach((ids, ecclass) => {
22
+ console.log(`${ecclass}: [${[...ids].join(",")}]`);
23
+ });
24
+ }
25
+ if (selection.nodeKeys.size !== 0) {
26
+ // log all selected node keys
27
+ console.log("Nodes:");
28
+ selection.nodeKeys.forEach((key) => console.log(JSON.stringify(key)));
29
+ }
30
+ console.log("=======================================");
31
+ }
32
+ /* eslint-enable no-console */
33
+ };
34
+ export const WidgetHeader = ({ title, disabled = false, returnFn, }) => {
35
+ return (React.createElement("div", { className: 'widget-header-container' },
36
+ returnFn && (React.createElement("div", { className: disabled ? "chevron-disabled" : "chevron", onClick: disabled ? undefined : returnFn },
37
+ React.createElement(SvgChevronLeft, null))),
38
+ React.createElement(Text, { className: 'title', variant: 'title' }, title)));
39
+ };
40
+ export const handleInputChange = (e, values, setValues) => {
41
+ const { name, value } = e.target;
42
+ setValues({
43
+ ...values,
44
+ [name]: value,
45
+ });
46
+ };
47
+ export const fetchIdsFromQuery = async (query, iModelConnection) => {
48
+ if (query === "") {
49
+ return [];
50
+ }
51
+ const ids = [];
52
+ const rowIterator = iModelConnection.query(query, undefined, {
53
+ rowFormat: QueryRowFormat.UseJsPropertyNames,
54
+ });
55
+ while (true) {
56
+ const { done, value } = await rowIterator.next();
57
+ if (done) {
58
+ break;
59
+ }
60
+ if (Object.keys(value).includes("id")) {
61
+ // eslint-disable-next-line dot-notation
62
+ ids.push(value.id);
63
+ }
64
+ else if (Object.keys(value).includes("element.id")) {
65
+ ids.push(value["element.id"]);
66
+ }
67
+ // eslint-disable-next-line dot-notation
68
+ ids.push(value.id);
69
+ }
70
+ return ids;
71
+ };
72
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,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MAAM;SACP;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACrC,wCAAwC;YACxC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;SACpB;aAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;YACpD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;SAC/B;QACD,wCAAwC;QACxC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;KACpB;IACD,OAAO,GAAG,CAAC;AACb,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 { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { QueryRowFormat } from \"@itwin/core-common\";\n\nexport const onSelectionChanged = (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider,\n) => {\n /* eslint-disable no-console */\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n if (selection.isEmpty) {\n console.log(\"========== Selection cleared ==========\");\n } else {\n console.log(\"========== Selection change ===========\");\n if (selection.instanceKeys.size !== 0) {\n // log all selected ECInstance ids grouped by ECClass name\n console.log(\"ECInstances:\");\n selection.instanceKeys.forEach((ids, ecclass) => {\n console.log(`${ecclass}: [${[...ids].join(\",\")}]`);\n });\n }\n if (selection.nodeKeys.size !== 0) {\n // log all selected node keys\n console.log(\"Nodes:\");\n selection.nodeKeys.forEach((key) => console.log(JSON.stringify(key)));\n }\n console.log(\"=======================================\");\n }\n /* eslint-enable no-console */\n};\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => Promise<void>;\n}\n\nexport const WidgetHeader = ({\n title,\n disabled = false,\n returnFn,\n}: WidgetHeaderProps) => {\n return (\n <div className='widget-header-container'>\n {returnFn && (\n <div\n className={disabled ? \"chevron-disabled\" : \"chevron\"}\n onClick={disabled ? undefined : returnFn}\n >\n <SvgChevronLeft />\n </div>\n )}\n <Text className='title' variant='title'>\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: React.Dispatch<React.SetStateAction<T>>,\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const fetchIdsFromQuery = async (\n query: string,\n iModelConnection: IModelConnection,\n) => {\n if (query === \"\") {\n return [];\n }\n const ids: string[] = [];\n const rowIterator = iModelConnection.query(query, undefined, {\n rowFormat: QueryRowFormat.UseJsPropertyNames,\n });\n while (true) {\n const { done, value } = await rowIterator.next();\n if (done) {\n break;\n }\n if (Object.keys(value).includes(\"id\")) {\n // eslint-disable-next-line dot-notation\n ids.push(value.id);\n } else if (Object.keys(value).includes(\"element.id\")) {\n ids.push(value[\"element.id\"]);\n }\n // eslint-disable-next-line dot-notation\n ids.push(value.id);\n }\n return ids;\n};\n"]}
@@ -0,0 +1,36 @@
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
+ @import '~@itwin/itwinui-css/scss/icon/index';
7
+ @import '~@itwin/itwinui-css/scss/button/index';
8
+
9
+ .widget-header-container {
10
+ display: flex;
11
+ margin-bottom: $iui-baseline * 3;
12
+
13
+ .chevron {
14
+ @include iui-icons-large();
15
+ cursor: pointer;
16
+ align-self: center;
17
+ margin-right: $iui-s;
18
+ }
19
+
20
+ .chevron-disabled {
21
+ @include iui-icons-large();
22
+ @include themed {
23
+ fill: t(iui-icons-color-actionable-disabled);
24
+ }
25
+ cursor: not-allowed;
26
+
27
+ align-self: center;
28
+ margin-right: $iui-s;
29
+ }
30
+
31
+ .title {
32
+ overflow: hidden;
33
+ white-space: nowrap;
34
+ text-overflow: ellipsis;
35
+ }
36
+ }
@@ -0,0 +1,9 @@
1
+ import type { IModelConnection } from "@itwin/core-frontend";
2
+ import { KeySet } from "@itwin/presentation-common";
3
+ export declare const visualizeElementsById: (elementIds: string[], color: string, iModelConnection: IModelConnection, replace?: boolean, wantEmphasis?: boolean) => Promise<string[]>;
4
+ export declare const visualizeElementsByKeys: (keySet: KeySet, color: string, replace?: boolean, wantEmphasis?: boolean) => Promise<string[]>;
5
+ export declare const visualizeElements: (elementIds: string[], color: string, replace?: boolean, wantEmphasis?: boolean) => void;
6
+ export declare const zoomToElements: (elementIds: string[]) => Promise<void>;
7
+ export declare const manufactureKeys: (elementIds: string[], iModelConnection: IModelConnection) => Promise<KeySet>;
8
+ export declare const clearEmphasizedElements: () => void;
9
+ //# sourceMappingURL=viewerUtils.d.ts.map
@@ -0,0 +1,106 @@
1
+ import { EmphasizeElements, IModelApp, } from "@itwin/core-frontend";
2
+ import { ColorDef, FeatureOverrideType, } from "@itwin/core-common";
3
+ import { KeySet } from "@itwin/presentation-common";
4
+ import { HiliteSetProvider } from "@itwin/presentation-frontend";
5
+ export const visualizeElementsById = async (elementIds, color, iModelConnection, replace = false, wantEmphasis = true) => {
6
+ if (!IModelApp.viewManager.selectedView) {
7
+ return [];
8
+ }
9
+ const vp = IModelApp.viewManager.selectedView;
10
+ const keySet = await manufactureKeys(elementIds, iModelConnection);
11
+ const hiliteProvider = HiliteSetProvider.create({
12
+ imodel: vp.iModel,
13
+ });
14
+ const set = await hiliteProvider.getHiliteSet(keySet);
15
+ if (set.elements) {
16
+ const ids = [...set.elements];
17
+ visualizeElements(ids, color, replace, wantEmphasis);
18
+ return ids;
19
+ }
20
+ return [];
21
+ };
22
+ export const visualizeElementsByKeys = async (keySet, color, replace = false, wantEmphasis = true) => {
23
+ if (!IModelApp.viewManager.selectedView) {
24
+ return [];
25
+ }
26
+ const vp = IModelApp.viewManager.selectedView;
27
+ const hiliteProvider = HiliteSetProvider.create({
28
+ imodel: vp.iModel,
29
+ });
30
+ const set = await hiliteProvider.getHiliteSet(keySet);
31
+ if (set.elements) {
32
+ const ids = [...set.elements];
33
+ visualizeElements(ids, color, replace, wantEmphasis);
34
+ return ids;
35
+ }
36
+ return [];
37
+ };
38
+ export const visualizeElements = (elementIds, color, replace = false, wantEmphasis = true) => {
39
+ if (!IModelApp.viewManager.selectedView) {
40
+ return;
41
+ }
42
+ const vp = IModelApp.viewManager.selectedView;
43
+ const emph = EmphasizeElements.getOrCreate(vp);
44
+ emph.overrideElements(elementIds, vp, ColorDef.fromString(color), FeatureOverrideType.ColorOnly, true);
45
+ if (!wantEmphasis) {
46
+ return;
47
+ }
48
+ emph.wantEmphasis = true;
49
+ emph.emphasizeElements(elementIds, vp, undefined, replace);
50
+ };
51
+ export const zoomToElements = async (elementIds) => {
52
+ if (!IModelApp.viewManager.selectedView) {
53
+ return;
54
+ }
55
+ const vp = IModelApp.viewManager.selectedView;
56
+ const viewChangeOpts = {};
57
+ viewChangeOpts.animateFrustumChange = true;
58
+ // It was removed. Should be a prop to be passed to lookAtViewAlignedVolume within the implementation.
59
+ // viewChangeOpts.marginPercent = new MarginPercent(0.1, 0.1, 0.1, 0.1);
60
+ await vp.zoomToElements(elementIds, { ...viewChangeOpts });
61
+ };
62
+ export const manufactureKeys = async (elementIds, iModelConnection) => {
63
+ // segment ids into batches
64
+ const batches = [];
65
+ let currBatch = [];
66
+ const batchSize = 100000;
67
+ for (const id of elementIds) {
68
+ if (currBatch.length < batchSize) {
69
+ currBatch.push(id);
70
+ }
71
+ else {
72
+ batches.push(currBatch);
73
+ currBatch = [id];
74
+ }
75
+ }
76
+ if (currBatch.length > 0 && currBatch.length <= batchSize) {
77
+ batches.push(currBatch);
78
+ }
79
+ // retrieve element properties in batches
80
+ let elemProps = [];
81
+ for (const batch of batches) {
82
+ const props = await iModelConnection.elements.getProps(batch);
83
+ elemProps = elemProps.concat(props);
84
+ }
85
+ const isElementId = (elem) => {
86
+ return elem.id !== undefined;
87
+ };
88
+ // create keyset from the element properties
89
+ const keys = elemProps
90
+ .map((elem) => ({
91
+ id: elem.id,
92
+ className: elem.classFullName,
93
+ }))
94
+ .filter(isElementId);
95
+ return new KeySet(keys);
96
+ };
97
+ export const clearEmphasizedElements = () => {
98
+ if (!IModelApp.viewManager.selectedView) {
99
+ return;
100
+ }
101
+ const vp = IModelApp.viewManager.selectedView;
102
+ const emph = EmphasizeElements.getOrCreate(vp);
103
+ emph.clearEmphasizedElements(vp);
104
+ emph.clearOverriddenElements(vp);
105
+ };
106
+ //# sourceMappingURL=viewerUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewerUtils.js","sourceRoot":"","sources":["../../../../src/widget/components/viewerUtils.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,iBAAiB,EACjB,SAAS,GACV,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,QAAQ,EACR,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EACxC,UAAoB,EACpB,KAAa,EACb,gBAAkC,EAClC,OAAO,GAAG,KAAK,EACf,YAAY,GAAG,IAAI,EACnB,EAAE;IACF,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,EAAE;QACvC,OAAO,EAAE,CAAC;KACX;IAED,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,Y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AC,WAAW,CAAC,YAAY,CAAC;IAC9C,MAAM,IAAI,GAAG,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC/C,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;AACnC,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 IModelConnection,\n ViewChangeOptions} from \"@itwin/core-frontend\";\nimport {\n EmphasizeElements,\n IModelApp,\n} from \"@itwin/core-frontend\";\nimport type {\n ElementProps} from \"@itwin/core-common\";\nimport {\n ColorDef,\n FeatureOverrideType,\n} from \"@itwin/core-common\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { HiliteSetProvider } from \"@itwin/presentation-frontend\";\n\nexport const visualizeElementsById = async (\n elementIds: string[],\n color: string,\n iModelConnection: IModelConnection,\n replace = false,\n wantEmphasis = true,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(elementIds, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n visualizeElements(ids, color, replace, wantEmphasis);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElementsByKeys = async (\n keySet: KeySet,\n color: string,\n replace = false,\n wantEmphasis = true,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n visualizeElements(ids, color, replace, wantEmphasis);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElements = (\n elementIds: string[],\n color: string,\n replace = false,\n wantEmphasis = true,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.overrideElements(\n elementIds,\n vp,\n ColorDef.fromString(color),\n FeatureOverrideType.ColorOnly,\n true,\n );\n if (!wantEmphasis) {\n return;\n }\n emph.wantEmphasis = true;\n emph.emphasizeElements(elementIds, vp, undefined, replace);\n};\n\nexport const zoomToElements = async (elementIds: string[]) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const viewChangeOpts: ViewChangeOptions = {};\n viewChangeOpts.animateFrustumChange = true;\n // It was removed. Should be a prop to be passed to lookAtViewAlignedVolume within the implementation.\n // viewChangeOpts.marginPercent = new MarginPercent(0.1, 0.1, 0.1, 0.1);\n await vp.zoomToElements(elementIds, { ...viewChangeOpts });\n};\n\nexport const manufactureKeys = async (\n elementIds: string[],\n iModelConnection: IModelConnection,\n): Promise<KeySet> => {\n // segment ids into batches\n const batches: string[][] = [];\n let currBatch: string[] = [];\n const batchSize = 100000;\n for (const id of elementIds) {\n if (currBatch.length < batchSize) {\n currBatch.push(id);\n } else {\n batches.push(currBatch);\n currBatch = [id];\n }\n }\n if (currBatch.length > 0 && currBatch.length <= batchSize) {\n batches.push(currBatch);\n }\n\n // retrieve element properties in batches\n let elemProps: ElementProps[] = [];\n for (const batch of batches) {\n const props = await iModelConnection.elements.getProps(batch);\n elemProps = elemProps.concat(props);\n }\n\n const isElementId = (elem: {\n id: string | undefined;\n className: string;\n }): elem is {\n id: string;\n className: string;\n } => {\n return elem.id !== undefined;\n };\n\n // create keyset from the element properties\n const keys = elemProps\n .map((elem: ElementProps) => ({\n id: elem.id,\n className: elem.classFullName,\n }))\n .filter(isElementId);\n return new KeySet(keys);\n};\n\nexport const clearEmphasizedElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearEmphasizedElements(vp);\n emph.clearOverriddenElements(vp);\n};\n"]}
@@ -0,0 +1,3 @@
1
+ declare const useFetchAccessToken: () => string;
2
+ export default useFetchAccessToken;
3
+ //# sourceMappingURL=useFetchAccessToken.d.ts.map
@@ -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 { IModelApp } from "@itwin/core-frontend";
6
+ import { useEffect, useState } from "react";
7
+ const useFetchAccessToken = () => {
8
+ const [accessToken, setAccessToken] = useState("");
9
+ useEffect(() => {
10
+ const fetchAccessToken = async () => {
11
+ var _a;
12
+ const accessToken = await ((_a = IModelApp.authorizationClient) === null || _a === void 0 ? void 0 : _a.getAccessToken());
13
+ setAccessToken(accessToken !== null && accessToken !== void 0 ? accessToken : "");
14
+ };
15
+ void fetchAccessToken();
16
+ }, []);
17
+ return accessToken;
18
+ };
19
+ export default useFetchAccessToken;
20
+ //# sourceMappingURL=useFetchAccessToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchAccessToken.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useFetchAccessToken.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAE3D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;;YAClC,MAAM,WAAW,GAAG,MAAM,CAAA,MAAA,SAAS,CAAC,mBAAmB,0CAAE,cAAc,EAAE,CAAA,CAAC;YAC1E,cAAc,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAC,CAAC;QACpC,CAAC,CAAC;QACF,KAAK,gBAAgB,EAAE,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,mBAAmB,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 { IModelApp } from \"@itwin/core-frontend\";\nimport { useEffect, useState } from \"react\";\n\nconst useFetchAccessToken = () => {\n const [accessToken, setAccessToken] = useState<string>(\"\");\n\n useEffect(() => {\n const fetchAccessToken = async () => {\n const accessToken = await IModelApp.authorizationClient?.getAccessToken();\n setAccessToken(accessToken ?? \"\");\n };\n void fetchAccessToken();\n }, []);\n\n return accessToken;\n};\n\nexport default useFetchAccessToken;\n"]}
@@ -0,0 +1,45 @@
1
+ import SimpleReactValidator from "simple-react-validator";
2
+ export declare const Validators: {
3
+ NoDuplicateUnderscore: {
4
+ message: string;
5
+ rule: (val: string) => boolean;
6
+ };
7
+ OnlyBeginsWithLetterOrUnderscore: {
8
+ message: string;
9
+ rule: (val: string) => boolean;
10
+ };
11
+ FollowedByLettersUnderscoresAndDigits: {
12
+ message: string;
13
+ rule: (val: string) => boolean;
14
+ };
15
+ CharLimit: {
16
+ message: string;
17
+ rule: (val: string) => boolean;
18
+ };
19
+ };
20
+ export declare const NAME_REQUIREMENTS = "required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresAndDigits|CharLimit";
21
+ export declare const Messages: {
22
+ required: string;
23
+ };
24
+ declare const useValidator: (customMessage?: {
25
+ required: string;
26
+ }, customValidator?: {
27
+ NoDuplicateUnderscore: {
28
+ message: string;
29
+ rule: (val: string) => boolean;
30
+ };
31
+ OnlyBeginsWithLetterOrUnderscore: {
32
+ message: string;
33
+ rule: (val: string) => boolean;
34
+ };
35
+ FollowedByLettersUnderscoresAndDigits: {
36
+ message: string;
37
+ rule: (val: string) => boolean;
38
+ };
39
+ CharLimit: {
40
+ message: string;
41
+ rule: (val: string) => boolean;
42
+ };
43
+ }) => [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>];
44
+ export default useValidator;
45
+ //# sourceMappingURL=useValidator.d.ts.map
@@ -0,0 +1,47 @@
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 { useState } from "react";
6
+ import SimpleReactValidator from "simple-react-validator";
7
+ export const Validators = {
8
+ NoDuplicateUnderscore: {
9
+ message: 'Remove duplicate "_"',
10
+ rule: (val) => {
11
+ return !val.match(/__+/i);
12
+ },
13
+ },
14
+ OnlyBeginsWithLetterOrUnderscore: {
15
+ message: "Name can only start with a letter or underscore.",
16
+ rule: (val) => {
17
+ return !val.match(/^[\W\d]+/i);
18
+ },
19
+ },
20
+ FollowedByLettersUnderscoresAndDigits: {
21
+ message: "Name can only contain letters, underscores, or digits",
22
+ rule: (val) => {
23
+ return !val.match(/\W+/i);
24
+ },
25
+ },
26
+ CharLimit: {
27
+ message: "There is an 128 character limit.",
28
+ rule: (val) => {
29
+ return val.length <= 128;
30
+ },
31
+ },
32
+ };
33
+ export const NAME_REQUIREMENTS = "required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresAndDigits|CharLimit";
34
+ export const Messages = { required: "This field is required." };
35
+ const useValidator = (customMessage = Messages, customValidator = Validators) => {
36
+ const [show, setShow] = useState(false);
37
+ const validator = new SimpleReactValidator({
38
+ messages: customMessage,
39
+ validators: customValidator,
40
+ });
41
+ if (show) {
42
+ validator.showMessages();
43
+ }
44
+ return [validator, setShow];
45
+ };
46
+ export default useValidator;
47
+ //# sourceMappingURL=useValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,qBAAqB,EAAE;QACrB,OAAO,EAAE,sBAAsB;QAC/B,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;KACF;IACD,gCAAgC,EAAE;QAChC,OAAO,EAAE,kDAAkD;QAC3D,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC;KACF;IACD,qCAAqC,EAAE;QACrC,OAAO,EAAE,uDAAuD;QAChE,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;KACF;IACD,SAAS,EAAE;QACT,OAAO,EAAE,kCAAkC;QAC3C,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;YACpB,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC;QAC3B,CAAC;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,iHAAiH,CAAC;AAEpH,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,QAAQ,EAAE,yBAAyB,EAAE,CAAC;AAEhE,MAAM,YAAY,GAAG,CACnB,aAAa,GAAG,QAAQ,EACxB,eAAe,GAAG,UAAU,EAC2C,EAAE;IACzE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC;QACzC,QAAQ,EAAE,aAAa;QACvB,UAAU,EAAE,eAAe;KAC5B,CAAC,CAAC;IAEH,IAAI,IAAI,EAAE;QACR,SAAS,CAAC,YAAY,EAAE,CAAC;KAC1B;IAED,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { useState } from \"react\";\nimport SimpleReactValidator from \"simple-react-validator\";\n\nexport const Validators = {\n NoDuplicateUnderscore: {\n message: 'Remove duplicate \"_\"',\n rule: (val: string) => {\n return !val.match(/__+/i);\n },\n },\n OnlyBeginsWithLetterOrUnderscore: {\n message: \"Name can only start with a letter or underscore.\",\n rule: (val: string) => {\n return !val.match(/^[\\W\\d]+/i);\n },\n },\n FollowedByLettersUnderscoresAndDigits: {\n message: \"Name can only contain letters, underscores, or digits\",\n rule: (val: string) => {\n return !val.match(/\\W+/i);\n },\n },\n CharLimit: {\n message: \"There is an 128 character limit.\",\n rule: (val: string) => {\n return val.length <= 128;\n },\n },\n};\n\nexport const NAME_REQUIREMENTS =\n \"required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresAndDigits|CharLimit\";\n\nexport const Messages = { required: \"This field is required.\" };\n\nconst useValidator = (\n customMessage = Messages,\n customValidator = Validators,\n): [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>] => {\n const [show, setShow] = useState(false);\n const validator = new SimpleReactValidator({\n messages: customMessage,\n validators: customValidator,\n });\n\n if (show) {\n validator.showMessages();\n }\n\n return [validator, setShow];\n};\n\nexport default useValidator;\n"]}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import "./DatabaseInfo.scss";
3
+ declare const DatabaseInfoIcon: () => JSX.Element;
4
+ export default DatabaseInfoIcon;
5
+ //# sourceMappingURL=DatabaseInfo.d.ts.map
@@ -0,0 +1,14 @@
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 "./DatabaseInfo.scss";
7
+ const DatabaseInfoIcon = () => {
8
+ return (React.createElement("svg", { className: 'database-info-icon', version: '1.1', viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg' },
9
+ React.createElement("g", { transform: 'translate(-76.395 -115.93)' },
10
+ React.createElement("path", { d: 'm91.293 123.66a0.77217 0.77217 0 0 1 0.83377 0.70519q0.0019 0.0233 0.0019 0.0473a1.095 1.095 0 0 1-1.0871 1.0035 0.79008 0.79008 0 0 1-0.83626-0.83626 1.0271 1.0271 0 0 1 1.0871-0.91987m-1.6723 8.0281c-0.41796 0-0.75264-0.25105-0.41796-1.4215l0.50175-2.007c0.08327-0.33447 0.08327-0.41848-4.93e-4 -0.41848-0.16708-0.0838-0.75264 0.16724-1.0873 0.41798l-0.16708-0.41798c1.0035-0.83641 2.1741-1.3382 2.7597-1.3382 0.41795 0 0.50175 0.50178 0.25089 1.3382l-0.58506 2.1746c-0.08381 0.41797-0.08381 0.50175 0.08381 0.50175a1.6749 1.6749 0 0 0 0.91989-0.50175l0.25089 0.33486a4.8242 4.8242 0 0 1-2.5091 1.3377', strokeWidth: '.50175' }),
11
+ React.createElement("path", { d: 'm82.2 116.09c-2.4283 0-5.3503 0.45305-5.666 1.0765v2.9707c0.04028 0.16181 0.30758 0.31546 0.72039 0.46923a1.3194 1.3194 0 0 0-0.72039 0.42085v2.922c0.04028 0.1618 0.32376 0.33175 0.75276 0.48568a1.3841 1.3841 0 0 0-0.75276 0.45305v2.9301c0.16188 0.60709 3.7557 1.2222 5.666 1.2222 1.9103 0 5.5041-0.61516 5.666-1.2303v-2.922c-0.04866-0.13736-0.37238-0.29179-0.80944-0.43691 0.46949-0.1618 0.80944-0.32361 0.80944-0.50186v-2.922c-0.04866-0.13775-0.36423-0.27549-0.80944-0.42084 0.4614-0.15405 0.80944-0.32361 0.80944-0.50187v-2.9382c-0.1618-0.4612-3.2377-1.0766-5.666-1.0766zm-4.8566 1.1655h0.08106a10.085 10.085 0 0 0 1.4084 0.45355 19.556 19.556 0 0 0 3.432 0.37211 19.564 19.564 0 0 0 3.432-0.37211 9.8102 9.8102 0 0 0 1.4327-0.38829l0.22668 0.0974v0.46923a10.401 10.401 0 0 1-1.5298 0.40454 19.977 19.977 0 0 1-3.5534 0.38829 19.977 19.977 0 0 1-3.5534-0.38829 10.652 10.652 0 0 1-1.546-0.40454l-0.11318-0.0485v-0.45355s0.06488-0.0485 0.28329-0.1296zm0 3.8448 0.09697 0.0485a10.296 10.296 0 0 0 1.4489 0.37211 19.677 19.677 0 0 0 3.432 0.38829 19.685 19.685 0 0 0 3.432-0.38829 10.005 10.005 0 0 0 1.4327-0.37211l0.22668 0.0974v0.46923a10.409 10.409 0 0 1-1.5298 0.40458 19.977 19.977 0 0 1-3.5534 0.38825 19.977 19.977 0 0 1-3.5534-0.38825 10.668 10.668 0 0 1-1.546-0.40458l-0.11318-0.0485v-0.43687s0.02445-0.0485 0.17011-0.12959zm0 3.8934h0.08106a10.077 10.077 0 0 0 1.4489 0.38829 19.556 19.556 0 0 0 3.432 0.37211 19.564 19.564 0 0 0 3.432-0.37211 9.8021 9.8021 0 0 0 1.3922-0.38829l0.22668 0.097v0.46927a10.264 10.264 0 0 1-1.5298 0.42084 19.977 19.977 0 0 1-3.5534 0.38829 19.977 19.977 0 0 1-3.5534-0.38829 10.523 10.523 0 0 1-1.546-0.42084l-0.11318-0.0485v-0.42084s0.08102-0.0485 0.28329-0.097z', strokeWidth: '.80942' }))));
12
+ };
13
+ export default DatabaseInfoIcon;
14
+ //# sourceMappingURL=DatabaseInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatabaseInfo.js","sourceRoot":"","sources":["../../../../src/widget/icons/DatabaseInfo.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAE7B,MAAM,gBAAgB,GAAG,GAAgB,EAAE;IACzC,OAAO,CACL,6BACE,SAAS,EAAC,oBAAoB,EAC9B,OAAO,EAAC,KAAK,EACb,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B;QAElC,2BAAG,SAAS,EAAC,4BAA4B;YACvC,8BACE,CAAC,EAAC,6lBAA6lB,EAC/lB,WAAW,EAAC,QAAQ,GACpB;YACF,8BACE,CAAC,EAAC,2qDAA2qD,EAC7qD,WAAW,EAAC,QAAQ,GACpB,CACA,CACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,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 \"./DatabaseInfo.scss\";\n\nconst DatabaseInfoIcon = (): JSX.Element => {\n return (\n <svg\n className='database-info-icon'\n version='1.1'\n viewBox='0 0 16 16'\n xmlns='http://www.w3.org/2000/svg'\n >\n <g transform='translate(-76.395 -115.93)'>\n <path\n d='m91.293 123.66a0.77217 0.77217 0 0 1 0.83377 0.70519q0.0019 0.0233 0.0019 0.0473a1.095 1.095 0 0 1-1.0871 1.0035 0.79008 0.79008 0 0 1-0.83626-0.83626 1.0271 1.0271 0 0 1 1.0871-0.91987m-1.6723 8.0281c-0.41796 0-0.75264-0.25105-0.41796-1.4215l0.50175-2.007c0.08327-0.33447 0.08327-0.41848-4.93e-4 -0.41848-0.16708-0.0838-0.75264 0.16724-1.0873 0.41798l-0.16708-0.41798c1.0035-0.83641 2.1741-1.3382 2.7597-1.3382 0.41795 0 0.50175 0.50178 0.25089 1.3382l-0.58506 2.1746c-0.08381 0.41797-0.08381 0.50175 0.08381 0.50175a1.6749 1.6749 0 0 0 0.91989-0.50175l0.25089 0.33486a4.8242 4.8242 0 0 1-2.5091 1.3377'\n strokeWidth='.50175'\n />\n <path\n d='m82.2 116.09c-2.4283 0-5.3503 0.45305-5.666 1.0765v2.9707c0.04028 0.16181 0.30758 0.31546 0.72039 0.46923a1.3194 1.3194 0 0 0-0.72039 0.42085v2.922c0.04028 0.1618 0.32376 0.33175 0.75276 0.48568a1.3841 1.3841 0 0 0-0.75276 0.45305v2.9301c0.16188 0.60709 3.7557 1.2222 5.666 1.2222 1.9103 0 5.5041-0.61516 5.666-1.2303v-2.922c-0.04866-0.13736-0.37238-0.29179-0.80944-0.43691 0.46949-0.1618 0.80944-0.32361 0.80944-0.50186v-2.922c-0.04866-0.13775-0.36423-0.27549-0.80944-0.42084 0.4614-0.15405 0.80944-0.32361 0.80944-0.50187v-2.9382c-0.1618-0.4612-3.2377-1.0766-5.666-1.0766zm-4.8566 1.1655h0.08106a10.085 10.085 0 0 0 1.4084 0.45355 19.556 19.556 0 0 0 3.432 0.37211 19.564 19.564 0 0 0 3.432-0.37211 9.8102 9.8102 0 0 0 1.4327-0.38829l0.22668 0.0974v0.46923a10.401 10.401 0 0 1-1.5298 0.40454 19.977 19.977 0 0 1-3.5534 0.38829 19.977 19.977 0 0 1-3.5534-0.38829 10.652 10.652 0 0 1-1.546-0.40454l-0.11318-0.0485v-0.45355s0.06488-0.0485 0.28329-0.1296zm0 3.8448 0.09697 0.0485a10.296 10.296 0 0 0 1.4489 0.37211 19.677 19.677 0 0 0 3.432 0.38829 19.685 19.685 0 0 0 3.432-0.38829 10.005 10.005 0 0 0 1.4327-0.37211l0.22668 0.0974v0.46923a10.409 10.409 0 0 1-1.5298 0.40458 19.977 19.977 0 0 1-3.5534 0.38825 19.977 19.977 0 0 1-3.5534-0.38825 10.668 10.668 0 0 1-1.546-0.40458l-0.11318-0.0485v-0.43687s0.02445-0.0485 0.17011-0.12959zm0 3.8934h0.08106a10.077 10.077 0 0 0 1.4489 0.38829 19.556 19.556 0 0 0 3.432 0.37211 19.564 19.564 0 0 0 3.432-0.37211 9.8021 9.8021 0 0 0 1.3922-0.38829l0.22668 0.097v0.46927a10.264 10.264 0 0 1-1.5298 0.42084 19.977 19.977 0 0 1-3.5534 0.38829 19.977 19.977 0 0 1-3.5534-0.38829 10.523 10.523 0 0 1-1.546-0.42084l-0.11318-0.0485v-0.42084s0.08102-0.0485 0.28329-0.097z'\n strokeWidth='.80942'\n />\n </g>\n </svg>\n );\n};\n\nexport default DatabaseInfoIcon;\n"]}
@@ -0,0 +1,12 @@
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/index';
6
+
7
+ .database-info-icon {
8
+ @include iui-icons-default();
9
+ @include themed {
10
+ fill: t(iui-icons-color-actionable);
11
+ }
12
+ }
@@ -0,0 +1,4 @@
1
+ export declare type CreateTypeFromInterface<Interface> = {
2
+ [Property in keyof Interface]: Interface[Property];
3
+ };
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/widget/utils.ts"],"names":[],"mappings":"","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*--------------------------------------------------------------------------------------------*/\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}