@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":"SelectProject.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectProject.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,WAAW,GACZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,MAAM,EACN,cAAc,EACd,UAAU,EACV,YAAY,EACZ,GAAG,GACJ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,sBAAsB,CAAC;AAE9B,MAAM,aAAa,GAAG;IACpB,oBAAC,GAAG,IACF,GAAG,EAAC,UAAU,EACd,KAAK,EAAC,mBAAmB,EACzB,SAAS,EAAE,oBAAC,aAAa,OAAG,GAC5B;IACF,oBAAC,GAAG,IAAC,GAAG,EAAC,SAAS,EAAC,KAAK,EAAC,iBAAiB,EAAC,SAAS,EAAE,oBAAC,WAAW,OAAG,GAAI;IACzE,oBAAC,GAAG,IAAC,GAAG,EAAC,KAAK,EAAC,KAAK,EAAC,aAAa,EAAC,SAAS,EAAE,oBAAC,OAAO,OAAG,GAAI;CAC9D,CAAC;AAKF,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAsB,EAAE,EAAE;IACnE,MAAM,WAAW,GAAG,mBAAmB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C;wBACnB,oBAAoB,CAAC,EAAE,CAAC,CAAC;qBAC1B;gBACH,CAAC,EACD,OAAO,EACL,oBAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,SAAS,EAAC,YAAY;oBAC9D,oBAAC,SAAS,OAAG,CACF,GAEf;YACF,6BAAK,SAAS,EAAC,cAAc;gBAC3B,oBAAC,WAAW,IACV,gBAAgB,EAAE,QAAQ,EAC1B,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,iBAAiB,EAChC,WAAW,EACT,WAAW,KAAK,CAAC;wBACf,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,WAAW,KAAK,CAAC;4BACjB,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,EAAE,GAEV,CACE;YACN,6BAAK,SAAS,EAAC,6BAA6B;gBAC1C,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACS,CACb,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,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 ProjectFull,\n} from \"@itwin/imodel-browser-react\";\nimport {\n ProjectGrid,\n} from \"@itwin/imodel-browser-react\";\nimport {\n SvgCalendar,\n SvgList,\n SvgSearch,\n SvgStarHollow,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n Button,\n HorizontalTabs,\n IconButton,\n LabeledInput,\n Tab,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { getUrlPrefix } from \"../../api/reportingClient\";\nimport useFetchAccessToken from \"../hooks/useFetchAccessToken\";\nimport \"./SelectProject.scss\";\n\nconst tabsWithIcons = [\n <Tab\n key='favorite'\n label='Favorite projects'\n startIcon={<SvgStarHollow />}\n />,\n <Tab key='recents' label='Recent projects' startIcon={<SvgCalendar />} />,\n <Tab key='all' label='My projects' startIcon={<SvgList />} />,\n];\ninterface SelectProjectProps {\n onSelect: (project: ProjectFull) => void;\n onCancel: () => void;\n}\nconst SelectProject = ({ onSelect, onCancel }: SelectProjectProps) => {\n const accessToken = useFetchAccessToken();\n const [projectType, setProjectType] = useState<number>(0);\n const [searchInput, setSearchInput] = useState<string>(\"\");\n const [activeSearchInput, setActiveSearchInput] = useState<string>(\"\");\n\n const startSearch = useCallback(() => {\n setActiveSearchInput(searchInput);\n }, [searchInput]);\n\n const apiOverrides = useMemo<ApiOverrides<ProjectFull[]>>(\n () => ({ serverEnvironmentPrefix: getUrlPrefix() }),\n [],\n );\n\n return (\n <div className='select-project-grid-container'>\n <HorizontalTabs\n labels={tabsWithIcons}\n onTabSelected={setProjectType}\n activeIndex={projectType}\n type={\"borderless\"}\n contentClassName='grid-holding-tab'\n >\n <LabeledInput\n displayStyle='inline'\n iconDisplayStyle='inline'\n className='search-input'\n label='Search'\n value={searchInput}\n onChange={(event) => {\n const {\n target: { value },\n } = event;\n setSearchInput(value);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n startSearch();\n }\n if (event.key === \"Escape\") {\n setSearchInput(\"\");\n setActiveSearchInput(\"\");\n }\n }}\n svgIcon={\n <IconButton onClick={() => startSearch()} styleType='borderless'>\n <SvgSearch />\n </IconButton>\n }\n />\n <div className='project-grid'>\n <ProjectGrid\n onThumbnailClick={onSelect}\n accessToken={accessToken}\n apiOverrides={apiOverrides}\n filterOptions={activeSearchInput}\n requestType={\n projectType === 0\n ? \"favorites\"\n : projectType === 1\n ? \"recents\"\n : \"\"\n }\n />\n </div>\n <div className='select-project-action-panel'>\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </HorizontalTabs>\n </div>\n );\n};\n\nexport default SelectProject;\n"]}
@@ -0,0 +1,38 @@
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-project-grid-container {
8
+ display: flex;
9
+ flex-direction: column;
10
+
11
+ > .iui-tabs-wrapper {
12
+ height: 66vh;
13
+ display: flex;
14
+ flex-direction: column;
15
+ }
16
+
17
+ .search-input {
18
+ margin-left: auto;
19
+ }
20
+
21
+ .project-grid {
22
+ overflow: auto;
23
+ flex-grow: 1;
24
+ }
25
+
26
+ .grid-holding-tab {
27
+ display: flex;
28
+ flex-direction: column;
29
+ overflow: hidden;
30
+ gap: $iui-baseline;
31
+ flex-grow: 1;
32
+ }
33
+ .select-project-action-panel {
34
+ display: flex;
35
+ justify-content: right;
36
+ padding: $iui-baseline * 2 $iui-m $iui-baseline;
37
+ }
38
+ }
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ import type { PrimitiveRendererProps } from "./PrimitivePropertyRenderer";
3
+ import "./NonPrimitivePropertyRenderer.scss";
4
+ /** Properties of [[NonPrimitivePropertyRenderer]] React component
5
+ * @public
6
+ */
7
+ export interface NonPrimitivePropertyRendererProps extends PrimitiveRendererProps {
8
+ /** Can struct/array property be collapsed */
9
+ isCollapsible?: boolean;
10
+ }
11
+ /** State of [[NonPrimitivePropertyRenderer]] React component
12
+ * @internal
13
+ */
14
+ interface NonPrimitivePropertyRendererState {
15
+ /** Is struct/array property expanded */
16
+ isExpanded?: boolean;
17
+ }
18
+ /** React Component that renders struct and array properties
19
+ * @public
20
+ */
21
+ export declare class NonPrimitivePropertyRenderer extends React.Component<NonPrimitivePropertyRendererProps, NonPrimitivePropertyRendererState> {
22
+ /** @internal */
23
+ readonly state: NonPrimitivePropertyRendererState;
24
+ private _onExpanded;
25
+ private _onCollapsed;
26
+ private getLabel;
27
+ private overrideArrayChildrenNames;
28
+ private _renderPropertyForItem;
29
+ /** @internal */
30
+ render(): JSX.Element;
31
+ }
32
+ export {};
33
+ //# sourceMappingURL=NonPrimitivePropertyRenderer.d.ts.map
@@ -0,0 +1,69 @@
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 * as React from "react";
6
+ import { PropertyRecord, PropertyValueFormat } from "@itwin/appui-abstract";
7
+ import { CommonPropertyRenderer } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer";
8
+ import { NonPrimitivePropertyLabelRenderer } from "@itwin/components-react";
9
+ import { PropertyRenderer } from "./PropertyRender";
10
+ import { PropertyView } from "./PropertyView";
11
+ import "./NonPrimitivePropertyRenderer.scss";
12
+ /** React Component that renders struct and array properties
13
+ * @public
14
+ */
15
+ export class NonPrimitivePropertyRenderer extends React.Component {
16
+ constructor() {
17
+ super(...arguments);
18
+ /** @internal */
19
+ this.state = {
20
+ /** If it's not collapsible, that means it's expanded by default and can't be collapsed */
21
+ isExpanded: !this.props.isCollapsible || this.props.propertyRecord.autoExpand,
22
+ };
23
+ this._onExpanded = () => {
24
+ this.setState({ isExpanded: true });
25
+ };
26
+ this._onCollapsed = () => {
27
+ this.setState({ isExpanded: false });
28
+ };
29
+ this._renderPropertyForItem = (item) => {
30
+ const prefix = this.props.uniqueKey
31
+ ? this.props.uniqueKey
32
+ : this.props.propertyRecord.property.name;
33
+ const uniqueKey = `${prefix}_${item.property.name}`;
34
+ return (React.createElement(PropertyRenderer, { key: uniqueKey, uniqueKey: uniqueKey, propertyRecord: item, indentation: this.props.indentation ? this.props.indentation + 1 : 1, orientation: this.props.orientation, columnRatio: this.props.columnRatio, actionButtonRenderers: this.props.actionButtonRenderers, onColumnRatioChanged: this.props.onColumnRatioChanged, width: this.props.width, isResizeHandleHovered: this.props.isResizeHandleHovered, onResizeHandleHoverChanged: this.props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: this.props.isResizeHandleBeingDragged, onResizeHandleDragChanged: this.props.onResizeHandleDragChanged, columnInfo: this.props.columnInfo }));
35
+ };
36
+ }
37
+ getLabel(props, state) {
38
+ const { orientation, indentation, width, columnRatio, columnInfo } = props;
39
+ const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, columnInfo === null || columnInfo === void 0 ? void 0 : columnInfo.minLabelWidth);
40
+ let displayLabel = props.propertyRecord.property.displayLabel;
41
+ if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array) {
42
+ displayLabel = `${displayLabel} (${this.props.propertyRecord.value.items.length})`;
43
+ }
44
+ return (React.createElement(NonPrimitivePropertyLabelRenderer, { isExpanded: !!state.isExpanded, onExpand: this._onExpanded, onCollapse: this._onCollapsed, offset: offset, renderColon: false }, displayLabel));
45
+ }
46
+ overrideArrayChildrenNames(items) {
47
+ const modifiedProperties = items.map((item, index) => {
48
+ const newProperty = { ...item.property };
49
+ newProperty.displayLabel = `[${index + 1}]`;
50
+ newProperty.name = `${newProperty.name}_${index}`;
51
+ return new PropertyRecord(item.value, newProperty);
52
+ });
53
+ return modifiedProperties;
54
+ }
55
+ /** @internal */
56
+ render() {
57
+ let items = this.props.propertyRecord.getChildrenRecords();
58
+ if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array) {
59
+ items = this.overrideArrayChildrenNames(items);
60
+ }
61
+ const { ...props } = this.props;
62
+ return (React.createElement(React.Fragment, null,
63
+ this.props.isCollapsible ? (React.createElement(PropertyView, { labelElement: this.getLabel(this.props, this.state), ...props })) : undefined,
64
+ this.state.isExpanded
65
+ ? items.map(this._renderPropertyForItem)
66
+ : undefined));
67
+ }
68
+ }
69
+ //# sourceMappingURL=NonPrimitivePropertyRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/NonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AA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AAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAC/C,KAAK,GACT,CACH,CAAC,CAAC,CAAC,SAAS;YAEZ,IAAI,CAAC,KAAK,CAAC,UAAU;gBACpB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC;gBACxC,CAAC,CAAC,SAAS,CACZ,CACJ,CAAC;IACJ,CAAC;CACF","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 { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { NonPrimitivePropertyLabelRenderer } from \"@itwin/components-react\";\n\nimport { PropertyRenderer } from \"./PropertyRender\";\nimport { PropertyView } from \"./PropertyView\";\nimport type { PrimitiveRendererProps } from \"./PrimitivePropertyRenderer\";\nimport \"./NonPrimitivePropertyRenderer.scss\";\n\n/** Properties of [[NonPrimitivePropertyRenderer]] React component\n * @public\n */\nexport interface NonPrimitivePropertyRendererProps\n extends PrimitiveRendererProps {\n /** Can struct/array property be collapsed */\n isCollapsible?: boolean;\n}\n\n/** State of [[NonPrimitivePropertyRenderer]] React component\n * @internal\n */\ninterface NonPrimitivePropertyRendererState {\n /** Is struct/array property expanded */\n isExpanded?: boolean;\n}\n\n/** React Component that renders struct and array properties\n * @public\n */\nexport class NonPrimitivePropertyRenderer extends React.Component<\nNonPrimitivePropertyRendererProps,\nNonPrimitivePropertyRendererState\n> {\n /** @internal */\n public override readonly state: NonPrimitivePropertyRendererState = {\n /** If it's not collapsible, that means it's expanded by default and can't be collapsed */\n isExpanded:\n !this.props.isCollapsible || this.props.propertyRecord.autoExpand,\n };\n\n private _onExpanded = () => {\n this.setState({ isExpanded: true });\n };\n\n private _onCollapsed = () => {\n this.setState({ isExpanded: false });\n };\n\n private getLabel(\n props: NonPrimitivePropertyRendererProps,\n state: NonPrimitivePropertyRendererState,\n ): React.ReactNode {\n const { orientation, indentation, width, columnRatio, columnInfo } = props;\n const offset = CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation,\n width,\n columnRatio,\n columnInfo?.minLabelWidth,\n );\n\n let displayLabel = props.propertyRecord.property.displayLabel;\n if (\n this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array\n ) {\n displayLabel = `${displayLabel} (${this.props.propertyRecord.value.items.length})`;\n }\n\n return (\n <NonPrimitivePropertyLabelRenderer\n isExpanded={!!state.isExpanded}\n onExpand={this._onExpanded}\n onCollapse={this._onCollapsed}\n offset={offset}\n renderColon={false}\n >\n {displayLabel}\n </NonPrimitivePropertyLabelRenderer>\n );\n }\n\n private overrideArrayChildrenNames(items: PropertyRecord[]) {\n const modifiedProperties: PropertyRecord[] = items.map(\n (item, index): PropertyRecord => {\n const newProperty = { ...item.property };\n newProperty.displayLabel = `[${index + 1}]`;\n newProperty.name = `${newProperty.name}_${index}`;\n return new PropertyRecord(item.value, newProperty);\n },\n );\n\n return modifiedProperties;\n }\n\n private _renderPropertyForItem = (item: PropertyRecord) => {\n const prefix = this.props.uniqueKey\n ? this.props.uniqueKey\n : this.props.propertyRecord.property.name;\n const uniqueKey = `${prefix}_${item.property.name}`;\n return (\n <PropertyRenderer\n key={uniqueKey}\n uniqueKey={uniqueKey}\n propertyRecord={item}\n indentation={this.props.indentation ? this.props.indentation + 1 : 1}\n orientation={this.props.orientation}\n columnRatio={this.props.columnRatio}\n actionButtonRenderers={this.props.actionButtonRenderers}\n onColumnRatioChanged={this.props.onColumnRatioChanged}\n width={this.props.width}\n isResizeHandleHovered={this.props.isResizeHandleHovered}\n onResizeHandleHoverChanged={this.props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={this.props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={this.props.onResizeHandleDragChanged}\n columnInfo={this.props.columnInfo}\n />\n );\n };\n\n /** @internal */\n public override render() {\n let items: PropertyRecord[] =\n this.props.propertyRecord.getChildrenRecords();\n if (\n this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array\n ) {\n items = this.overrideArrayChildrenNames(items);\n }\n\n const { ...props } = this.props;\n return (\n <>\n {this.props.isCollapsible ? (\n <PropertyView\n labelElement={this.getLabel(this.props, this.state)}\n {...props}\n />\n ) : undefined}\n\n {this.state.isExpanded\n ? items.map(this._renderPropertyForItem)\n : undefined}\n </>\n );\n }\n}\n"]}
@@ -0,0 +1,16 @@
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/colors';
6
+
7
+ .components-nonprimitive-property {
8
+ padding: 10px;
9
+ display: grid;
10
+ grid-row-gap: 10px;
11
+
12
+ border-radius: 3px;
13
+ border: solid 1px $uicore-gray-9;
14
+
15
+ background-color: #fff;
16
+ }
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import type { HighlightingComponentProps } from "@itwin/components-react/lib/cjs/components-react/common/HighlightingComponentProps";
3
+ import type { SharedRendererProps } from "./PropertyRender";
4
+ /** Properties of [[PrimitivePropertyRenderer]] React component
5
+ * @public
6
+ */
7
+ export interface PrimitiveRendererProps extends SharedRendererProps {
8
+ /** Property value as a React element */
9
+ valueElement?: React.ReactNode;
10
+ /** Render callback for property value. If specified, `valueElement` is ignored. */
11
+ valueElementRenderer?: () => React.ReactNode;
12
+ /** Multiplier of how much the property is indented to the right */
13
+ indentation?: number;
14
+ /** Properties used for highlighting
15
+ * @beta
16
+ */
17
+ highlight?: HighlightingComponentProps;
18
+ }
19
+ /** React Component that renders primitive properties
20
+ * @public
21
+ */
22
+ export declare class PrimitivePropertyRenderer extends React.Component<PrimitiveRendererProps> {
23
+ /** @internal */
24
+ render(): JSX.Element;
25
+ }
26
+ //# sourceMappingURL=PrimitivePropertyRenderer.d.ts.map
@@ -0,0 +1,35 @@
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 * as React from "react";
6
+ import { Orientation } from "@itwin/core-react";
7
+ import { PrimitivePropertyLabelRenderer } from "@itwin/components-react";
8
+ import { CommonPropertyRenderer } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer";
9
+ import { HighlightedText } from "@itwin/components-react/lib/cjs/components-react/common/HighlightedText";
10
+ import { PropertyView } from "./PropertyView";
11
+ /** React Component that renders primitive properties
12
+ * @public
13
+ */
14
+ export class PrimitivePropertyRenderer extends React.Component {
15
+ /** @internal */
16
+ render() {
17
+ var _a, _b;
18
+ const { indentation, highlight, ...props } = this.props;
19
+ const displayLabel = this.props.propertyRecord.property.displayLabel;
20
+ const offset = CommonPropertyRenderer.getLabelOffset(indentation, props.orientation, props.width, props.columnRatio, (_a = props.columnInfo) === null || _a === void 0 ? void 0 : _a.minLabelWidth);
21
+ const activeMatchIndex = this.props.propertyRecord.property.name ===
22
+ ((_b = highlight === null || highlight === void 0 ? void 0 : highlight.activeHighlight) === null || _b === void 0 ? void 0 : _b.highlightedItemIdentifier)
23
+ ? highlight.activeHighlight.highlightIndex
24
+ : undefined;
25
+ const label = highlight
26
+ ? HighlightedText({
27
+ text: displayLabel,
28
+ searchText: highlight.highlightedText,
29
+ activeMatchIndex,
30
+ })
31
+ : displayLabel;
32
+ return (React.createElement(PropertyView, { ...props, labelElement: React.createElement(PrimitivePropertyLabelRenderer, { offset: offset, renderColon: this.props.orientation === Orientation.Horizontal, tooltip: displayLabel }, label) }));
33
+ }
34
+ }
35
+ //# sourceMappingURL=PrimitivePropertyRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8FAA8F,CAAC;AACtI,OAAO,EAAE,eAAe,EAAE,MAAM,yEAAyE,CAAC;AAE1G,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAmB9C;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK,CAAC,SAAiC;IACpF,gBAAgB;IACA,MAAM;;QACpB,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACxD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;QACrE,MAAM,MAAM,GAAG,sBAAsB,CAAC,cAAc,CAClD,WAAW,EACX,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,WAAW,EACjB,MAAA,KAAK,CAAC,UAAU,0CAAE,aAAa,CAChC,CAAC;QAEF,MAAM,gBAAgB,GACpB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI;aACvC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,0CAAE,yBAAyB,CAAA;YACnD,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,cAAc;YAC1C,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,KAAK,GAAG,SAAS;YACrB,CAAC,CAAC,eAAe,CAAC;gBAChB,IAAI,EAAE,YAAY;gBAClB,UAAU,EAAE,SAAS,CAAC,eAAe;gBACrC,gBAAgB;aACjB,CAAC;YACF,CAAC,CAAC,YAAY,CAAC;QAEjB,OAAO,CACL,oBAAC,YAAY,OACP,KAAK,EACT,YAAY,EACV,oBAAC,8BAA8B,IAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,UAAU,EAC9D,OAAO,EAAE,YAAY,IAEpB,KAAK,CACyB,GAEnC,CACH,CAAC;IACJ,CAAC;CACF","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 { Orientation } from \"@itwin/core-react\";\nimport { PrimitivePropertyLabelRenderer } from \"@itwin/components-react\";\nimport type { HighlightingComponentProps } from \"@itwin/components-react/lib/cjs/components-react/common/HighlightingComponentProps\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { HighlightedText } from \"@itwin/components-react/lib/cjs/components-react/common/HighlightedText\";\n\nimport { PropertyView } from \"./PropertyView\";\nimport type { SharedRendererProps } from \"./PropertyRender\";\n\n/** Properties of [[PrimitivePropertyRenderer]] React component\n * @public\n */\nexport interface PrimitiveRendererProps extends SharedRendererProps {\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 /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n /** Properties used for highlighting\n * @beta\n */\n highlight?: HighlightingComponentProps;\n}\n\n/** React Component that renders primitive properties\n * @public\n */\nexport class PrimitivePropertyRenderer extends React.Component<PrimitiveRendererProps> {\n /** @internal */\n public override render() {\n const { indentation, highlight, ...props } = this.props;\n const displayLabel = this.props.propertyRecord.property.displayLabel;\n const offset = CommonPropertyRenderer.getLabelOffset(\n indentation,\n props.orientation,\n props.width,\n props.columnRatio,\n props.columnInfo?.minLabelWidth,\n );\n\n const activeMatchIndex =\n this.props.propertyRecord.property.name ===\n highlight?.activeHighlight?.highlightedItemIdentifier\n ? highlight.activeHighlight.highlightIndex\n : undefined;\n const label = highlight\n ? HighlightedText({\n text: displayLabel,\n searchText: highlight.highlightedText,\n activeMatchIndex,\n })\n : displayLabel;\n\n return (\n <PropertyView\n {...props}\n labelElement={\n <PrimitivePropertyLabelRenderer\n offset={offset}\n renderColon={this.props.orientation === Orientation.Horizontal}\n tooltip={displayLabel}\n >\n {label}\n </PrimitivePropertyLabelRenderer>\n }\n />\n );\n }\n}\n"]}
@@ -0,0 +1,67 @@
1
+ import * as React from "react";
2
+ import type { PropertyRecord } from "@itwin/appui-abstract";
3
+ import type { CommonPropertyGridProps, PropertyCategory } from "@itwin/components-react";
4
+ import { Orientation } from "@itwin/core-react";
5
+ import "./PropertyGrid.scss";
6
+ import type { PresentationPropertyDataProvider } from "@itwin/presentation-components";
7
+ /** Properties for [[PropertyGrid]] React component
8
+ * @public
9
+ */
10
+ export interface PropertyGridProps extends CommonPropertyGridProps {
11
+ /** Property data provider */
12
+ dataProvider: PresentationPropertyDataProvider;
13
+ }
14
+ /** Property Category in the [[PropertyGrid]] state
15
+ * @public
16
+ * @deprecated This was part of [[PropertyGrid]] internal state and should've never been public. The component is not using it anymore.
17
+ */
18
+ export interface PropertyGridCategory {
19
+ propertyCategory: PropertyCategory;
20
+ propertyCount: number;
21
+ properties: PropertyRecord[];
22
+ }
23
+ interface CategorizedPropertyGridRecords {
24
+ category: PropertyCategory;
25
+ records: PropertyRecord[];
26
+ children: CategorizedPropertyGridRecords[];
27
+ }
28
+ /** State of [[PropertyGrid]] React component
29
+ * @internal
30
+ */
31
+ interface PropertyGridState {
32
+ /** List of PropertyGrid categories */
33
+ categories: CategorizedPropertyGridRecords[];
34
+ /** Actual orientation used by the property grid */
35
+ orientation: Orientation;
36
+ /** If property grid currently loading data, the loading start time */
37
+ loadStart?: Date;
38
+ /** Width of PropertyGrid */
39
+ width: number;
40
+ }
41
+ /** PropertyGrid React component.
42
+ * @public
43
+ */
44
+ export declare class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> {
45
+ private _dataChangesListenerDisposeFunc?;
46
+ private _isMounted;
47
+ private _isInDataRequest;
48
+ private _hasPendingDataRequest;
49
+ static contextType: React.Context<import("../GroupQueryBuilderContext").PropertySelection>;
50
+ /** @internal */
51
+ constructor(props: PropertyGridProps);
52
+ /** @internal */
53
+ componentDidMount(): void;
54
+ /** @internal */
55
+ componentWillUnmount(): void;
56
+ componentDidUpdate(prevProps: PropertyGridProps): void;
57
+ private _onPropertyDataChanged;
58
+ private gatherData;
59
+ private getPreferredOrientation;
60
+ private _onResize;
61
+ private _onCategoryExpansionToggled;
62
+ private updateOrientation;
63
+ /** @internal */
64
+ render(): JSX.Element;
65
+ }
66
+ export {};
67
+ //# sourceMappingURL=PropertyGrid.d.ts.map
@@ -0,0 +1,172 @@
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 classnames from "classnames";
6
+ import { produce } from "immer";
7
+ import * as React from "react";
8
+ import { PropertyCategoryBlock, PropertyGridCommons, PropertyGridEventsRelatedPropsSupplier, } from "@itwin/components-react";
9
+ import { ColumnResizingPropertyListPropsSupplier, } from "@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier";
10
+ import { Orientation, ResizableContainerObserver } from "@itwin/core-react";
11
+ import { PropertyList } from "./PropertyList";
12
+ import "./PropertyGrid.scss";
13
+ import { GroupQueryBuilderContext } from "../GroupQueryBuilderContext";
14
+ import { ProgressRadial } from "@itwin/itwinui-react";
15
+ /** PropertyGrid React component.
16
+ * @public
17
+ */
18
+ export class PropertyGrid extends React.Component {
19
+ /** @internal */
20
+ constructor(props) {
21
+ super(props);
22
+ this._isMounted = false;
23
+ this._isInDataRequest = false;
24
+ this._hasPendingDataRequest = false;
25
+ this._onPropertyDataChanged = () => {
26
+ void this.gatherData();
27
+ };
28
+ this._onResize = (width) => {
29
+ this.updateOrientation(width);
30
+ };
31
+ this._onCategoryExpansionToggled = (categoryName) => {
32
+ this.setState((state) => {
33
+ return produce(state, (draft) => {
34
+ const records = findCategory(draft.categories, categoryName, true);
35
+ // istanbul ignore else
36
+ if (records) {
37
+ const category = records.category;
38
+ category.expand = !category.expand;
39
+ }
40
+ });
41
+ });
42
+ };
43
+ this.state = {
44
+ categories: [],
45
+ orientation: this.getPreferredOrientation(),
46
+ width: 0,
47
+ };
48
+ }
49
+ /** @internal */
50
+ componentDidMount() {
51
+ this._isMounted = true;
52
+ this._dataChangesListenerDisposeFunc =
53
+ this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
54
+ void this.gatherData();
55
+ }
56
+ /** @internal */
57
+ componentWillUnmount() {
58
+ // istanbul ignore else
59
+ if (this._dataChangesListenerDisposeFunc) {
60
+ this._dataChangesListenerDisposeFunc();
61
+ this._dataChangesListenerDisposeFunc = undefined;
62
+ }
63
+ this._isMounted = false;
64
+ }
65
+ componentDidUpdate(prevProps) {
66
+ if (this.props.dataProvider !== prevProps.dataProvider) {
67
+ // istanbul ignore else
68
+ if (this._dataChangesListenerDisposeFunc) {
69
+ this._dataChangesListenerDisposeFunc();
70
+ }
71
+ this._dataChangesListenerDisposeFunc =
72
+ this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
73
+ void this.gatherData();
74
+ }
75
+ if (this.props.orientation !== prevProps.orientation ||
76
+ this.props.isOrientationFixed !== prevProps.isOrientationFixed ||
77
+ this.props.horizontalOrientationMinWidth !==
78
+ prevProps.horizontalOrientationMinWidth) {
79
+ this.updateOrientation(this.state.width);
80
+ }
81
+ }
82
+ async gatherData() {
83
+ if (this._isInDataRequest) {
84
+ this._hasPendingDataRequest = true;
85
+ return;
86
+ }
87
+ this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });
88
+ this._isInDataRequest = true;
89
+ let propertyData;
90
+ try {
91
+ propertyData = await this.props.dataProvider.getData();
92
+ }
93
+ finally {
94
+ this._isInDataRequest = false;
95
+ }
96
+ if (!this._isMounted) {
97
+ return;
98
+ }
99
+ if (this._hasPendingDataRequest) {
100
+ this._hasPendingDataRequest = false;
101
+ return this.gatherData();
102
+ }
103
+ this.setState((prevState) => {
104
+ const buildCategoriesHierarchy = (newCategories, stateCategories) => newCategories.map((category) => {
105
+ var _a, _b, _c, _d;
106
+ const matchingStateCategory = findCategory(stateCategories !== null && stateCategories !== void 0 ? stateCategories : [], category.name, false);
107
+ return {
108
+ category: {
109
+ ...category,
110
+ expand: (_b = (_a = matchingStateCategory === null || matchingStateCategory === void 0 ? void 0 : matchingStateCategory.category) === null || _a === void 0 ? void 0 : _a.expand) !== null && _b !== void 0 ? _b : category.expand,
111
+ },
112
+ records: (_c = propertyData.records[category.name]) !== null && _c !== void 0 ? _c : [],
113
+ children: buildCategoriesHierarchy((_d = category.childCategories) !== null && _d !== void 0 ? _d : [], matchingStateCategory === null || matchingStateCategory === void 0 ? void 0 : matchingStateCategory.children),
114
+ };
115
+ });
116
+ return {
117
+ categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),
118
+ loadStart: undefined,
119
+ };
120
+ });
121
+ }
122
+ getPreferredOrientation() {
123
+ return this.props.orientation !== undefined
124
+ ? this.props.orientation
125
+ : Orientation.Horizontal;
126
+ }
127
+ updateOrientation(width) {
128
+ const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {
129
+ ...this.props,
130
+ };
131
+ const currentOrientation = PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);
132
+ if (currentOrientation !== this.state.orientation ||
133
+ width !== this.state.width) {
134
+ this.setState({ orientation: currentOrientation, width });
135
+ }
136
+ }
137
+ /** @internal */
138
+ render() {
139
+ var _a, _b;
140
+ if (this.state.loadStart) {
141
+ return (React.createElement("div", { className: 'gm-components-property-grid-loader' },
142
+ React.createElement(ProgressRadial, { indeterminate: true })));
143
+ }
144
+ return (React.createElement("div", { className: 'table-box-inner' },
145
+ React.createElement(PropertyGridEventsRelatedPropsSupplier, { isPropertySelectionEnabled: (_a = this.props.isPropertySelectionEnabled) !== null && _a !== void 0 ? _a : false, isPropertySelectionOnRightClickEnabled: this.props.isPropertySelectionOnRightClickEnabled, isPropertyEditingEnabled: this.props.isPropertyEditingEnabled, isPropertyHoverEnabled: (_b = this.props.isPropertyHoverEnabled) !== null && _b !== void 0 ? _b : false, onPropertyContextMenu: this.props.onPropertyContextMenu, onPropertyUpdated: this.props.onPropertyUpdated, onPropertySelectionChanged: this.props.onPropertySelectionChanged }, (selectionContext) => (React.createElement("div", { className: classnames("components-property-grid-wrapper", this.props.className), style: this.props.style },
146
+ React.createElement("div", { className: classnames("components-property-grid", "components-smallEditor-host") },
147
+ React.createElement("div", { className: 'property-categories' }, this.state.categories.map((categorizedRecords) => (React.createElement(NestedCategoryBlock, { ...selectionContext, key: categorizedRecords.category.name, categorizedRecords: categorizedRecords, onCategoryExpansionToggled: this._onCategoryExpansionToggled, orientation: this.state.orientation, propertyValueRendererManager: this.props.propertyValueRendererManager, actionButtonRenderers: this.props.actionButtonRenderers }))))),
148
+ React.createElement(ResizableContainerObserver, { onResize: this._onResize }))))));
149
+ }
150
+ }
151
+ PropertyGrid.contextType = GroupQueryBuilderContext;
152
+ function findCategory(categories, lookupName, recurseIntoChildren) {
153
+ for (const category of categories) {
154
+ if (category.category.name === lookupName) {
155
+ return category;
156
+ }
157
+ if (recurseIntoChildren) {
158
+ const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);
159
+ if (matchingChild) {
160
+ return matchingChild;
161
+ }
162
+ }
163
+ }
164
+ return undefined;
165
+ }
166
+ const NestedCategoryBlock = (props) => {
167
+ const [width, setWidth] = React.useState(1);
168
+ return (React.createElement(PropertyCategoryBlock, { category: props.categorizedRecords.category, onExpansionToggled: props.onCategoryExpansionToggled },
169
+ props.categorizedRecords.records.length ? (React.createElement(ColumnResizingPropertyListPropsSupplier, { orientation: props.orientation, width: width }, (partialListProps) => (React.createElement(PropertyList, { ...partialListProps, orientation: props.orientation, category: props.categorizedRecords.category, properties: props.categorizedRecords.records, selectedPropertyKey: props.selectedPropertyKey, onPropertyClicked: props.onPropertyClicked, onPropertyRightClicked: props.onPropertyRightClicked, onPropertyContextMenu: props.onPropertyContextMenu, propertyValueRendererManager: props.propertyValueRendererManager, editingPropertyKey: props.editingPropertyKey, onEditCommit: props.onEditCommit, onEditCancel: props.onEditCancel, isPropertyHoverEnabled: props.isPropertyHoverEnabled, isPropertySelectionEnabled: props.isPropertySelectionEnabled, isPropertyRightClickSelectionEnabled: props.isPropertyRightClickSelectionEnabled, actionButtonRenderers: props.actionButtonRenderers, setWidth: setWidth, width: width })))) : undefined,
170
+ props.categorizedRecords.children.length ? (React.createElement("div", { className: 'property-categories' }, props.categorizedRecords.children.map((categorizedChildRecords) => (React.createElement(NestedCategoryBlock, { ...props, key: categorizedChildRecords.category.name, categorizedRecords: categorizedChildRecords }))))) : undefined));
171
+ };
172
+ //# sourceMappingURL=PropertyGrid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyGrid.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sCAAsC,GACvC,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,uCAAuC,GACxC,MAAM,iHAAiH,CAAC;AACzH,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG5E,OAAO,EAAE,YAAY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AAC,4BAA4B,EAChE,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAC5C,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,EAC5D,oCAAoC,EAClC,KAAK,CAAC,oCAAoC,EAE5C,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACZ,CACH,CACuC,CAC3C,CAAC,CAAC,CAAC,SAAS;QACZ,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1C,6BAAK,SAAS,EAAC,qBAAqB,IACjC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAClE,oBAAC,mBAAmB,OACd,KAAK,EACT,GAAG,EAAE,uBAAuB,CAAC,QAAQ,CAAC,IAAI,EAC1C,kBAAkB,EAAE,uBAAuB,GAC3C,CACH,CAAC,CACE,CACP,CAAC,CAAC,CAAC,SAAS,CACS,CACzB,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 classnames from \"classnames\";\nimport { produce } from \"immer\";\nimport * as React from \"react\";\nimport type { DisposeFunc } from \"@itwin/core-bentley\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n CommonPropertyGridProps,\n PropertyCategory,\n PropertyData} from \"@itwin/components-react\";\nimport {\n PropertyCategoryBlock,\n PropertyGridCommons,\n PropertyGridEventsRelatedPropsSupplier,\n} from \"@itwin/components-react\";\nimport type {\n ColumnResizeRelatedPropertyListProps} from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport {\n ColumnResizingPropertyListPropsSupplier,\n} from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport { Orientation, ResizableContainerObserver } from \"@itwin/core-react\";\n\nimport type { PropertyListProps } from \"./PropertyList\";\nimport { PropertyList } from \"./PropertyList\";\nimport \"./PropertyGrid.scss\";\n\nimport type { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport { GroupQueryBuilderContext } from \"../GroupQueryBuilderContext\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\n/** Properties for [[PropertyGrid]] React component\n * @public\n */\nexport interface PropertyGridProps extends CommonPropertyGridProps {\n /** Property data provider */\n dataProvider: PresentationPropertyDataProvider;\n}\n\n/** Property Category in the [[PropertyGrid]] state\n * @public\n * @deprecated This was part of [[PropertyGrid]] internal state and should've never been public. The component is not using it anymore.\n */\nexport interface PropertyGridCategory {\n propertyCategory: PropertyCategory;\n propertyCount: number;\n properties: PropertyRecord[];\n}\n\ninterface CategorizedPropertyGridRecords {\n category: PropertyCategory;\n records: PropertyRecord[];\n children: CategorizedPropertyGridRecords[];\n}\n\n/** State of [[PropertyGrid]] React component\n * @internal\n */\ninterface PropertyGridState {\n /** List of PropertyGrid categories */\n categories: CategorizedPropertyGridRecords[];\n /** Actual orientation used by the property grid */\n orientation: Orientation;\n /** If property grid currently loading data, the loading start time */\n loadStart?: Date;\n /** Width of PropertyGrid */\n width: number;\n}\n\n/** PropertyGrid React component.\n * @public\n */\nexport class PropertyGrid extends React.Component<\nPropertyGridProps,\nPropertyGridState\n> {\n private _dataChangesListenerDisposeFunc?: DisposeFunc;\n private _isMounted = false;\n private _isInDataRequest = false;\n private _hasPendingDataRequest = false;\n\n static override contextType = GroupQueryBuilderContext;\n\n /** @internal */\n constructor(props: PropertyGridProps) {\n super(props);\n this.state = {\n categories: [],\n orientation: this.getPreferredOrientation(),\n width: 0,\n };\n }\n\n /** @internal */\n public override componentDidMount() {\n this._isMounted = true;\n this._dataChangesListenerDisposeFunc =\n this.props.dataProvider.onDataChanged.addListener(\n this._onPropertyDataChanged\n );\n\n void this.gatherData();\n }\n\n /** @internal */\n public override componentWillUnmount() {\n // istanbul ignore else\n if (this._dataChangesListenerDisposeFunc) {\n this._dataChangesListenerDisposeFunc();\n this._dataChangesListenerDisposeFunc = undefined;\n }\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: PropertyGridProps) {\n if (this.props.dataProvider !== prevProps.dataProvider) {\n // istanbul ignore else\n if (this._dataChangesListenerDisposeFunc) {\n this._dataChangesListenerDisposeFunc();\n }\n this._dataChangesListenerDisposeFunc =\n this.props.dataProvider.onDataChanged.addListener(\n this._onPropertyDataChanged\n );\n\n void this.gatherData();\n }\n\n if (\n this.props.orientation !== prevProps.orientation ||\n this.props.isOrientationFixed !== prevProps.isOrientationFixed ||\n this.props.horizontalOrientationMinWidth !==\n prevProps.horizontalOrientationMinWidth\n ) {\n this.updateOrientation(this.state.width);\n }\n }\n\n private _onPropertyDataChanged = () => {\n void this.gatherData();\n };\n\n private async gatherData(): Promise<void> {\n if (this._isInDataRequest) {\n this._hasPendingDataRequest = true;\n return;\n }\n\n this.setState((prev) =>\n prev.loadStart ? null : { loadStart: new Date() }\n );\n\n this._isInDataRequest = true;\n let propertyData: PropertyData;\n try {\n propertyData = await this.props.dataProvider.getData();\n } finally {\n this._isInDataRequest = false;\n }\n\n if (!this._isMounted) {\n return;\n }\n\n if (this._hasPendingDataRequest) {\n this._hasPendingDataRequest = false;\n return this.gatherData();\n }\n\n this.setState((prevState) => {\n const buildCategoriesHierarchy = (\n newCategories: PropertyCategory[],\n stateCategories: CategorizedPropertyGridRecords[] | undefined\n ) =>\n newCategories.map((category): CategorizedPropertyGridRecords => {\n const matchingStateCategory = findCategory(\n stateCategories ?? [],\n category.name,\n false\n );\n return {\n category: {\n ...category,\n expand:\n matchingStateCategory?.category?.expand ?? category.expand,\n },\n records: propertyData.records[category.name] ?? [],\n children: buildCategoriesHierarchy(\n category.childCategories ?? [],\n matchingStateCategory?.children\n ),\n };\n });\n return {\n categories: buildCategoriesHierarchy(\n propertyData.categories,\n prevState.categories\n ),\n loadStart: undefined,\n };\n });\n }\n\n private getPreferredOrientation(): Orientation {\n return this.props.orientation !== undefined\n ? this.props.orientation\n : Orientation.Horizontal;\n }\n\n private _onResize = (width: number) => {\n this.updateOrientation(width);\n };\n\n private _onCategoryExpansionToggled = (categoryName: string) => {\n this.setState((state) => {\n return produce(state, (draft) => {\n const records = findCategory(draft.categories, categoryName, true);\n // istanbul ignore else\n if (records) {\n const category = records.category;\n category.expand = !category.expand;\n }\n });\n });\n };\n\n private updateOrientation(width: number): void {\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {\n ...this.props,\n };\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(\n width,\n orientation,\n isOrientationFixed,\n horizontalOrientationMinWidth\n );\n\n if (\n currentOrientation !== this.state.orientation ||\n width !== this.state.width\n ) {\n this.setState({ orientation: currentOrientation, width });\n }\n }\n\n /** @internal */\n public override render() {\n if (this.state.loadStart) {\n return (\n <div className='gm-components-property-grid-loader'>\n <ProgressRadial indeterminate />\n </div>\n );\n }\n\n return (\n <div className='table-box-inner'>\n <PropertyGridEventsRelatedPropsSupplier\n isPropertySelectionEnabled={\n this.props.isPropertySelectionEnabled ?? false\n }\n isPropertySelectionOnRightClickEnabled={\n this.props.isPropertySelectionOnRightClickEnabled\n }\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\n onPropertyContextMenu={this.props.onPropertyContextMenu}\n onPropertyUpdated={this.props.onPropertyUpdated}\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\n >\n {(selectionContext) => (\n <div\n className={classnames(\n \"components-property-grid-wrapper\",\n this.props.className\n )}\n style={this.props.style}\n >\n <div\n className={classnames(\n \"components-property-grid\",\n \"components-smallEditor-host\"\n )}\n >\n <div className='property-categories'>\n {this.state.categories.map(\n (categorizedRecords: CategorizedPropertyGridRecords) => (\n <NestedCategoryBlock\n {...selectionContext}\n key={categorizedRecords.category.name}\n categorizedRecords={categorizedRecords}\n onCategoryExpansionToggled={\n this._onCategoryExpansionToggled\n }\n orientation={this.state.orientation}\n propertyValueRendererManager={\n this.props.propertyValueRendererManager\n }\n actionButtonRenderers={this.props.actionButtonRenderers}\n />\n )\n )}\n </div>\n </div>\n <ResizableContainerObserver onResize={this._onResize} />\n </div>\n )}\n </PropertyGridEventsRelatedPropsSupplier>\n </div>\n );\n }\n}\n\nfunction findCategory(\n categories: CategorizedPropertyGridRecords[],\n lookupName: string,\n recurseIntoChildren: boolean\n): CategorizedPropertyGridRecords | undefined {\n for (const category of categories) {\n if (category.category.name === lookupName) {\n return category;\n }\n if (recurseIntoChildren) {\n const matchingChild = findCategory(\n category.children,\n lookupName,\n recurseIntoChildren\n );\n if (matchingChild) {\n return matchingChild;\n }\n }\n }\n return undefined;\n}\n\ninterface NestedCategoryBlockProps\n extends Omit<\n PropertyListProps,\n keyof ColumnResizeRelatedPropertyListProps | \"properties\"\n > {\n categorizedRecords: CategorizedPropertyGridRecords;\n onCategoryExpansionToggled: (categoryName: string) => void;\n orientation: Orientation;\n}\nconst NestedCategoryBlock = (props: NestedCategoryBlockProps) => {\n const [width, setWidth] = React.useState(1);\n return (\n <PropertyCategoryBlock\n category={props.categorizedRecords.category}\n onExpansionToggled={props.onCategoryExpansionToggled}\n >\n {props.categorizedRecords.records.length ? (\n <ColumnResizingPropertyListPropsSupplier\n orientation={props.orientation}\n width={width}\n >\n {(partialListProps: ColumnResizeRelatedPropertyListProps) => (\n <PropertyList\n {...partialListProps}\n orientation={props.orientation}\n category={props.categorizedRecords.category}\n properties={props.categorizedRecords.records}\n selectedPropertyKey={props.selectedPropertyKey}\n onPropertyClicked={props.onPropertyClicked}\n onPropertyRightClicked={props.onPropertyRightClicked}\n onPropertyContextMenu={props.onPropertyContextMenu}\n propertyValueRendererManager={props.propertyValueRendererManager}\n editingPropertyKey={props.editingPropertyKey}\n onEditCommit={props.onEditCommit}\n onEditCancel={props.onEditCancel}\n isPropertyHoverEnabled={props.isPropertyHoverEnabled}\n isPropertySelectionEnabled={props.isPropertySelectionEnabled}\n isPropertyRightClickSelectionEnabled={\n props.isPropertyRightClickSelectionEnabled\n }\n actionButtonRenderers={props.actionButtonRenderers}\n setWidth={setWidth}\n width={width}\n />\n )}\n </ColumnResizingPropertyListPropsSupplier>\n ) : undefined}\n {props.categorizedRecords.children.length ? (\n <div className='property-categories'>\n {props.categorizedRecords.children.map((categorizedChildRecords) => (\n <NestedCategoryBlock\n {...props}\n key={categorizedChildRecords.category.name}\n categorizedRecords={categorizedChildRecords}\n />\n ))}\n </div>\n ) : undefined}\n </PropertyCategoryBlock>\n );\n};\n"]}
@@ -0,0 +1,71 @@
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/expandable/list";
6
+ @import "~@itwin/core-react/lib/cjs/core-react/scrollbar";
7
+
8
+ .gm-components-property-grid-loader {
9
+ display: flex;
10
+ justify-content: center;
11
+ align-items: center;
12
+ }
13
+
14
+ .components-property-grid {
15
+ .property-categories {
16
+ @include uicore-expandable-blocks-list;
17
+
18
+ display: grid;
19
+ grid-row-gap: 6px;
20
+ padding: 3px;
21
+ }
22
+
23
+ padding-top: 6px;
24
+ padding-bottom: 6px;
25
+
26
+ user-select: none;
27
+ color: $buic-foreground-body;
28
+ }
29
+
30
+ .components-property-grid-wrapper {
31
+ width: 100%;
32
+ height: 100%;
33
+ overflow-y: auto;
34
+
35
+ @include uicore-touch-scrolling;
36
+ @include uicore-scrollbar();
37
+ }
38
+
39
+ @mixin components-property-list {
40
+ width: 100%;
41
+
42
+ .components--selected {
43
+ background-color: $buic-row-selection;
44
+ outline: 1px solid $buic-foreground-primary;
45
+ }
46
+
47
+ .components--clickable {
48
+ cursor: pointer;
49
+
50
+ &:hover {
51
+ background: $buic-row-hover;
52
+ }
53
+ }
54
+
55
+ .components--hoverable:hover {
56
+ background-color: $buic-row-hover;
57
+ }
58
+ }
59
+
60
+ .components-property-list--horizontal {
61
+ @include components-property-list;
62
+
63
+ display: grid;
64
+ grid-row-gap: 1px; // A gap of 10px is too wasteful
65
+ overflow: hidden;
66
+ }
67
+
68
+ .components-property-list--vertical {
69
+ @include components-property-list;
70
+ // margin-top: -13px;
71
+ }