@itwin/grouping-mapping-widget 0.11.1 → 0.13.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 (355) hide show
  1. package/lib/cjs/grouping-mapping-widget.d.ts +4 -1
  2. package/lib/cjs/grouping-mapping-widget.js +7 -1
  3. package/lib/cjs/grouping-mapping-widget.js.map +1 -1
  4. package/lib/cjs/test/WidgetHeader.test.js +3 -3
  5. package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
  6. package/lib/cjs/widget/components/CalculatedPropertyAction.d.ts +7 -9
  7. package/lib/cjs/widget/components/CalculatedPropertyAction.js +49 -24
  8. package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
  9. package/lib/cjs/widget/components/CalculatedPropertyTable.d.ts +9 -16
  10. package/lib/cjs/widget/components/CalculatedPropertyTable.js +29 -31
  11. package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
  12. package/lib/cjs/widget/components/CalculatedPropertyTable.scss +9 -0
  13. package/lib/cjs/widget/components/ConfirmMappingsImport.js +1 -1
  14. package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
  15. package/lib/cjs/widget/components/CustomCalculationAction.d.ts +6 -9
  16. package/lib/cjs/widget/components/CustomCalculationAction.js +79 -9
  17. package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
  18. package/lib/cjs/widget/components/CustomCalculationTable.d.ts +8 -16
  19. package/lib/cjs/widget/components/CustomCalculationTable.js +22 -29
  20. package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
  21. package/lib/cjs/widget/components/DeleteModal.d.ts +4 -5
  22. package/lib/cjs/widget/components/DeleteModal.js +9 -13
  23. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  24. package/lib/cjs/widget/components/GroupAction.js +51 -66
  25. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  26. package/lib/cjs/widget/components/GroupAction.scss +0 -18
  27. package/lib/cjs/widget/components/GroupDetails.d.ts +13 -0
  28. package/lib/cjs/widget/components/GroupDetails.js +34 -0
  29. package/lib/cjs/widget/components/GroupDetails.js.map +1 -0
  30. package/lib/cjs/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  31. package/lib/cjs/widget/components/GroupDetailsActionPanel.js +19 -0
  32. package/lib/cjs/widget/components/GroupDetailsActionPanel.js.map +1 -0
  33. package/lib/cjs/widget/components/GroupDetailsStep.d.ts +13 -0
  34. package/lib/cjs/widget/components/GroupDetailsStep.js +25 -0
  35. package/lib/cjs/widget/components/GroupDetailsStep.js.map +1 -0
  36. package/lib/cjs/widget/components/GroupDetailsStep.scss +11 -0
  37. package/lib/cjs/widget/components/GroupInformationPanel.d.ts +10 -0
  38. package/lib/cjs/widget/components/GroupInformationPanel.js +23 -0
  39. package/lib/cjs/widget/components/GroupInformationPanel.js.map +1 -0
  40. package/lib/cjs/widget/components/GroupInformationPanel.scss +13 -0
  41. package/lib/cjs/widget/components/GroupPropertyAction.d.ts +6 -9
  42. package/lib/cjs/widget/components/GroupPropertyAction.js +26 -15
  43. package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
  44. package/lib/cjs/widget/components/GroupPropertyTable.d.ts +8 -15
  45. package/lib/cjs/widget/components/GroupPropertyTable.js +23 -28
  46. package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
  47. package/lib/cjs/widget/components/Grouping.d.ts +2 -1
  48. package/lib/cjs/widget/components/Grouping.js +13 -17
  49. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  50. package/lib/cjs/widget/components/Grouping.scss +2 -9
  51. package/lib/cjs/widget/components/GroupingMapping.js +1 -2
  52. package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
  53. package/lib/cjs/widget/components/GroupingMappingContent.js +8 -4
  54. package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
  55. package/lib/cjs/widget/components/GroupingMappingContext.js +17 -1
  56. package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -1
  57. package/lib/cjs/widget/components/GroupingMappingHeader.d.ts +1 -2
  58. package/lib/cjs/widget/components/GroupingMappingHeader.js +10 -3
  59. package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -1
  60. package/lib/cjs/widget/components/GroupingMappingRouter.js +23 -2
  61. package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
  62. package/lib/cjs/widget/components/GroupsAddButton.d.ts +9 -0
  63. package/lib/cjs/widget/components/GroupsAddButton.js +17 -0
  64. package/lib/cjs/widget/components/GroupsAddButton.js.map +1 -0
  65. package/lib/cjs/widget/components/GroupsAddButton.scss +7 -0
  66. package/lib/cjs/widget/components/Mapping.js +7 -14
  67. package/lib/cjs/widget/components/Mapping.js.map +1 -1
  68. package/lib/cjs/widget/components/MappingAction.js +1 -1
  69. package/lib/cjs/widget/components/MappingAction.js.map +1 -1
  70. package/lib/cjs/widget/components/MappingImportWizardModal.js +1 -1
  71. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
  72. package/lib/cjs/widget/components/PropertyAction.d.ts +8 -0
  73. package/lib/cjs/widget/components/PropertyAction.js +100 -0
  74. package/lib/cjs/widget/components/PropertyAction.js.map +1 -0
  75. package/lib/cjs/widget/components/PropertyAction.scss +9 -0
  76. package/lib/cjs/widget/components/PropertyMenu.d.ts +12 -17
  77. package/lib/cjs/widget/components/PropertyMenu.js +52 -155
  78. package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
  79. package/lib/cjs/widget/components/PropertyMenu.scss +4 -28
  80. package/lib/cjs/widget/components/PropertyNameCell.d.ts +11 -0
  81. package/lib/cjs/widget/components/PropertyNameCell.js +15 -0
  82. package/lib/cjs/widget/components/PropertyNameCell.js.map +1 -0
  83. package/lib/cjs/widget/components/PropertyTable.d.ts +18 -0
  84. package/lib/cjs/widget/components/PropertyTable.js +54 -0
  85. package/lib/cjs/widget/components/PropertyTable.js.map +1 -0
  86. package/lib/cjs/widget/components/PropertyTable.scss +11 -0
  87. package/lib/cjs/widget/components/PropertyTableToolbar.d.ts +10 -0
  88. package/lib/cjs/widget/components/PropertyTableToolbar.js +23 -0
  89. package/lib/cjs/widget/components/PropertyTableToolbar.js.map +1 -0
  90. package/lib/cjs/widget/components/PropertyTableToolbar.scss +12 -0
  91. package/lib/cjs/widget/components/QueryBuilder.d.ts +1 -1
  92. package/lib/cjs/widget/components/QueryBuilder.js +4 -4
  93. package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
  94. package/lib/cjs/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  95. package/lib/cjs/widget/components/QueryBuilderActionPanel.js +17 -0
  96. package/lib/cjs/widget/components/QueryBuilderActionPanel.js.map +1 -0
  97. package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +11 -0
  98. package/lib/cjs/widget/components/QueryBuilderCustomUI.js +27 -0
  99. package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +1 -0
  100. package/lib/cjs/widget/components/QueryBuilderStep.d.ts +16 -0
  101. package/lib/cjs/widget/components/QueryBuilderStep.js +30 -0
  102. package/lib/cjs/widget/components/QueryBuilderStep.js.map +1 -0
  103. package/lib/cjs/widget/components/QueryBuilderStep.scss +18 -0
  104. package/lib/cjs/widget/components/SelectMappings.js +1 -1
  105. package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
  106. package/lib/cjs/widget/components/StatusIcon.d.ts +15 -0
  107. package/lib/cjs/widget/components/StatusIcon.js +26 -0
  108. package/lib/cjs/widget/components/StatusIcon.js.map +1 -0
  109. package/lib/cjs/widget/components/StatusIcon.scss +26 -0
  110. package/lib/cjs/widget/components/ToggleGroupVisibility.d.ts +9 -0
  111. package/lib/cjs/widget/components/ToggleGroupVisibility.js +16 -0
  112. package/lib/cjs/widget/components/ToggleGroupVisibility.js.map +1 -0
  113. package/lib/cjs/widget/components/ToggleGroupVisibility.scss +9 -0
  114. package/lib/cjs/widget/components/WidgetHeader.d.ts +9 -0
  115. package/lib/cjs/widget/components/WidgetHeader.js +22 -0
  116. package/lib/cjs/widget/components/WidgetHeader.js.map +1 -0
  117. package/lib/cjs/widget/components/WidgetHeader.scss +36 -0
  118. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +6 -1
  119. package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  120. package/lib/cjs/widget/components/context/PropertiesContext.d.ts +15 -0
  121. package/lib/cjs/widget/components/context/PropertiesContext.js +43 -0
  122. package/lib/cjs/widget/components/context/PropertiesContext.js.map +1 -0
  123. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  124. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js +0 -2
  125. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  126. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  127. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +51 -32
  128. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  129. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  130. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +1 -1
  131. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  132. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  133. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +1 -1
  134. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  135. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  136. package/lib/cjs/widget/components/groupsHelpers.d.ts +6 -3
  137. package/lib/cjs/widget/components/groupsHelpers.js +43 -40
  138. package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
  139. package/lib/cjs/widget/components/utils.d.ts +1 -7
  140. package/lib/cjs/widget/components/utils.js +1 -9
  141. package/lib/cjs/widget/components/utils.js.map +1 -1
  142. package/lib/cjs/widget/components/utils.scss +0 -29
  143. package/lib/cjs/widget/components/viewerUtils.d.ts +4 -2
  144. package/lib/cjs/widget/components/viewerUtils.js +4 -22
  145. package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
  146. package/lib/cjs/widget/hooks/useFetchData.d.ts +3 -5
  147. package/lib/cjs/widget/hooks/useFetchData.js +9 -7
  148. package/lib/cjs/widget/hooks/useFetchData.js.map +1 -1
  149. package/lib/esm/grouping-mapping-widget.d.ts +4 -1
  150. package/lib/esm/grouping-mapping-widget.js +3 -0
  151. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  152. package/lib/esm/test/WidgetHeader.test.js +1 -1
  153. package/lib/esm/test/WidgetHeader.test.js.map +1 -1
  154. package/lib/esm/widget/components/CalculatedPropertyAction.d.ts +7 -9
  155. package/lib/esm/widget/components/CalculatedPropertyAction.js +50 -27
  156. package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
  157. package/lib/esm/widget/components/CalculatedPropertyTable.d.ts +9 -16
  158. package/lib/esm/widget/components/CalculatedPropertyTable.js +30 -31
  159. package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -1
  160. package/lib/esm/widget/components/CalculatedPropertyTable.scss +9 -0
  161. package/lib/esm/widget/components/ConfirmMappingsImport.js +1 -1
  162. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
  163. package/lib/esm/widget/components/CustomCalculationAction.d.ts +6 -9
  164. package/lib/esm/widget/components/CustomCalculationAction.js +79 -11
  165. package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
  166. package/lib/esm/widget/components/CustomCalculationTable.d.ts +8 -16
  167. package/lib/esm/widget/components/CustomCalculationTable.js +23 -29
  168. package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -1
  169. package/lib/esm/widget/components/DeleteModal.d.ts +4 -5
  170. package/lib/esm/widget/components/DeleteModal.js +9 -13
  171. package/lib/esm/widget/components/DeleteModal.js.map +1 -1
  172. package/lib/esm/widget/components/GroupAction.js +54 -69
  173. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  174. package/lib/esm/widget/components/GroupAction.scss +0 -18
  175. package/lib/esm/widget/components/GroupDetails.d.ts +13 -0
  176. package/lib/esm/widget/components/GroupDetails.js +27 -0
  177. package/lib/esm/widget/components/GroupDetails.js.map +1 -0
  178. package/lib/esm/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  179. package/lib/esm/widget/components/GroupDetailsActionPanel.js +12 -0
  180. package/lib/esm/widget/components/GroupDetailsActionPanel.js.map +1 -0
  181. package/lib/esm/widget/components/GroupDetailsStep.d.ts +13 -0
  182. package/lib/esm/widget/components/GroupDetailsStep.js +18 -0
  183. package/lib/esm/widget/components/GroupDetailsStep.js.map +1 -0
  184. package/lib/esm/widget/components/GroupDetailsStep.scss +11 -0
  185. package/lib/esm/widget/components/GroupInformationPanel.d.ts +10 -0
  186. package/lib/esm/widget/components/GroupInformationPanel.js +16 -0
  187. package/lib/esm/widget/components/GroupInformationPanel.js.map +1 -0
  188. package/lib/esm/widget/components/GroupInformationPanel.scss +13 -0
  189. package/lib/esm/widget/components/GroupPropertyAction.d.ts +6 -9
  190. package/lib/esm/widget/components/GroupPropertyAction.js +25 -15
  191. package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
  192. package/lib/esm/widget/components/GroupPropertyTable.d.ts +8 -15
  193. package/lib/esm/widget/components/GroupPropertyTable.js +24 -28
  194. package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -1
  195. package/lib/esm/widget/components/Grouping.d.ts +2 -1
  196. package/lib/esm/widget/components/Grouping.js +15 -19
  197. package/lib/esm/widget/components/Grouping.js.map +1 -1
  198. package/lib/esm/widget/components/Grouping.scss +2 -9
  199. package/lib/esm/widget/components/GroupingMapping.js +1 -2
  200. package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
  201. package/lib/esm/widget/components/GroupingMappingContent.js +9 -5
  202. package/lib/esm/widget/components/GroupingMappingContent.js.map +1 -1
  203. package/lib/esm/widget/components/GroupingMappingContext.js +17 -1
  204. package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -1
  205. package/lib/esm/widget/components/GroupingMappingHeader.d.ts +1 -2
  206. package/lib/esm/widget/components/GroupingMappingHeader.js +10 -3
  207. package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -1
  208. package/lib/esm/widget/components/GroupingMappingRouter.js +23 -2
  209. package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
  210. package/lib/esm/widget/components/GroupsAddButton.d.ts +9 -0
  211. package/lib/esm/widget/components/GroupsAddButton.js +10 -0
  212. package/lib/esm/widget/components/GroupsAddButton.js.map +1 -0
  213. package/lib/esm/widget/components/GroupsAddButton.scss +7 -0
  214. package/lib/esm/widget/components/Mapping.js +7 -14
  215. package/lib/esm/widget/components/Mapping.js.map +1 -1
  216. package/lib/esm/widget/components/MappingAction.js +1 -1
  217. package/lib/esm/widget/components/MappingAction.js.map +1 -1
  218. package/lib/esm/widget/components/MappingImportWizardModal.js +1 -1
  219. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
  220. package/lib/esm/widget/components/PropertyAction.d.ts +8 -0
  221. package/lib/esm/widget/components/PropertyAction.js +77 -0
  222. package/lib/esm/widget/components/PropertyAction.js.map +1 -0
  223. package/lib/esm/widget/components/PropertyAction.scss +9 -0
  224. package/lib/esm/widget/components/PropertyMenu.d.ts +12 -17
  225. package/lib/esm/widget/components/PropertyMenu.js +54 -154
  226. package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
  227. package/lib/esm/widget/components/PropertyMenu.scss +4 -28
  228. package/lib/esm/widget/components/PropertyNameCell.d.ts +11 -0
  229. package/lib/esm/widget/components/PropertyNameCell.js +8 -0
  230. package/lib/esm/widget/components/PropertyNameCell.js.map +1 -0
  231. package/lib/esm/widget/components/PropertyTable.d.ts +18 -0
  232. package/lib/esm/widget/components/PropertyTable.js +28 -0
  233. package/lib/esm/widget/components/PropertyTable.js.map +1 -0
  234. package/lib/esm/widget/components/PropertyTable.scss +11 -0
  235. package/lib/esm/widget/components/PropertyTableToolbar.d.ts +10 -0
  236. package/lib/esm/widget/components/PropertyTableToolbar.js +16 -0
  237. package/lib/esm/widget/components/PropertyTableToolbar.js.map +1 -0
  238. package/lib/esm/widget/components/PropertyTableToolbar.scss +12 -0
  239. package/lib/esm/widget/components/QueryBuilder.d.ts +1 -1
  240. package/lib/esm/widget/components/QueryBuilder.js +4 -4
  241. package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
  242. package/lib/esm/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  243. package/lib/esm/widget/components/QueryBuilderActionPanel.js +10 -0
  244. package/lib/esm/widget/components/QueryBuilderActionPanel.js.map +1 -0
  245. package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +11 -0
  246. package/lib/esm/widget/components/QueryBuilderCustomUI.js +20 -0
  247. package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +1 -0
  248. package/lib/esm/widget/components/QueryBuilderStep.d.ts +16 -0
  249. package/lib/esm/widget/components/QueryBuilderStep.js +23 -0
  250. package/lib/esm/widget/components/QueryBuilderStep.js.map +1 -0
  251. package/lib/esm/widget/components/QueryBuilderStep.scss +18 -0
  252. package/lib/esm/widget/components/SelectMappings.js +1 -1
  253. package/lib/esm/widget/components/SelectMappings.js.map +1 -1
  254. package/lib/esm/widget/components/StatusIcon.d.ts +15 -0
  255. package/lib/esm/widget/components/StatusIcon.js +19 -0
  256. package/lib/esm/widget/components/StatusIcon.js.map +1 -0
  257. package/lib/esm/widget/components/StatusIcon.scss +26 -0
  258. package/lib/esm/widget/components/ToggleGroupVisibility.d.ts +9 -0
  259. package/lib/esm/widget/components/ToggleGroupVisibility.js +9 -0
  260. package/lib/esm/widget/components/ToggleGroupVisibility.js.map +1 -0
  261. package/lib/esm/widget/components/ToggleGroupVisibility.scss +9 -0
  262. package/lib/esm/widget/components/WidgetHeader.d.ts +9 -0
  263. package/lib/esm/widget/components/WidgetHeader.js +15 -0
  264. package/lib/esm/widget/components/WidgetHeader.js.map +1 -0
  265. package/lib/esm/widget/components/WidgetHeader.scss +36 -0
  266. package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +6 -1
  267. package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
  268. package/lib/esm/widget/components/context/PropertiesContext.d.ts +15 -0
  269. package/lib/esm/widget/components/context/PropertiesContext.js +20 -0
  270. package/lib/esm/widget/components/context/PropertiesContext.js.map +1 -0
  271. package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  272. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js +0 -2
  273. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  274. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  275. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js +53 -34
  276. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  277. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  278. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +2 -2
  279. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  280. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  281. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +2 -2
  282. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  283. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  284. package/lib/esm/widget/components/groupsHelpers.d.ts +6 -3
  285. package/lib/esm/widget/components/groupsHelpers.js +41 -40
  286. package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
  287. package/lib/esm/widget/components/utils.d.ts +1 -7
  288. package/lib/esm/widget/components/utils.js +0 -7
  289. package/lib/esm/widget/components/utils.js.map +1 -1
  290. package/lib/esm/widget/components/utils.scss +0 -29
  291. package/lib/esm/widget/components/viewerUtils.d.ts +4 -2
  292. package/lib/esm/widget/components/viewerUtils.js +3 -20
  293. package/lib/esm/widget/components/viewerUtils.js.map +1 -1
  294. package/lib/esm/widget/hooks/useFetchData.d.ts +3 -5
  295. package/lib/esm/widget/hooks/useFetchData.js +9 -7
  296. package/lib/esm/widget/hooks/useFetchData.js.map +1 -1
  297. package/package.json +1 -1
  298. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  299. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -91
  300. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  301. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  302. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -62
  303. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  304. package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  305. package/lib/cjs/widget/components/property-grid/PropertyGrid.js +0 -198
  306. package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +0 -1
  307. package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +0 -71
  308. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  309. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +0 -77
  310. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  311. package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +0 -69
  312. package/lib/cjs/widget/components/property-grid/PropertyList.js +0 -87
  313. package/lib/cjs/widget/components/property-grid/PropertyList.js.map +0 -1
  314. package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +0 -92
  315. package/lib/cjs/widget/components/property-grid/PropertyRender.js +0 -109
  316. package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +0 -1
  317. package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +0 -22
  318. package/lib/cjs/widget/components/property-grid/PropertyView.js +0 -232
  319. package/lib/cjs/widget/components/property-grid/PropertyView.js.map +0 -1
  320. package/lib/cjs/widget/components/property-grid/PropertyView.scss +0 -77
  321. package/lib/cjs/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  322. package/lib/cjs/widget/components/property-grid/countMatchesInString.js +0 -32
  323. package/lib/cjs/widget/components/property-grid/countMatchesInString.js.map +0 -1
  324. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  325. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js +0 -65
  326. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
  327. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  328. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -68
  329. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  330. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  331. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -39
  332. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  333. package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  334. package/lib/esm/widget/components/property-grid/PropertyGrid.js +0 -172
  335. package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +0 -1
  336. package/lib/esm/widget/components/property-grid/PropertyGrid.scss +0 -71
  337. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  338. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +0 -54
  339. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  340. package/lib/esm/widget/components/property-grid/PropertyList.d.ts +0 -69
  341. package/lib/esm/widget/components/property-grid/PropertyList.js +0 -60
  342. package/lib/esm/widget/components/property-grid/PropertyList.js.map +0 -1
  343. package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +0 -92
  344. package/lib/esm/widget/components/property-grid/PropertyRender.js +0 -86
  345. package/lib/esm/widget/components/property-grid/PropertyRender.js.map +0 -1
  346. package/lib/esm/widget/components/property-grid/PropertyView.d.ts +0 -22
  347. package/lib/esm/widget/components/property-grid/PropertyView.js +0 -209
  348. package/lib/esm/widget/components/property-grid/PropertyView.js.map +0 -1
  349. package/lib/esm/widget/components/property-grid/PropertyView.scss +0 -77
  350. package/lib/esm/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  351. package/lib/esm/widget/components/property-grid/countMatchesInString.js +0 -28
  352. package/lib/esm/widget/components/property-grid/countMatchesInString.js.map +0 -1
  353. package/lib/esm/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  354. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js +0 -42
  355. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
@@ -1,198 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.PropertyGrid = void 0;
26
- /*---------------------------------------------------------------------------------------------
27
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
28
- * See LICENSE.md in the project root for license terms and full copyright notice.
29
- *--------------------------------------------------------------------------------------------*/
30
- const classnames_1 = __importDefault(require("classnames"));
31
- const immer_1 = require("immer");
32
- const React = __importStar(require("react"));
33
- const components_react_1 = require("@itwin/components-react");
34
- const ColumnResizingPropertyListPropsSupplier_1 = require("@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier");
35
- const core_react_1 = require("@itwin/core-react");
36
- const PropertyList_1 = require("./PropertyList");
37
- require("./PropertyGrid.scss");
38
- const PropertyGridWrapperContext_1 = require("../context/PropertyGridWrapperContext");
39
- const itwinui_react_1 = require("@itwin/itwinui-react");
40
- /** PropertyGrid React component.
41
- * @public
42
- */
43
- class PropertyGrid extends React.Component {
44
- /** @internal */
45
- constructor(props) {
46
- super(props);
47
- this._isMounted = false;
48
- this._isInDataRequest = false;
49
- this._hasPendingDataRequest = false;
50
- this._onPropertyDataChanged = () => {
51
- void this.gatherData();
52
- };
53
- this._onResize = (width) => {
54
- this.updateOrientation(width);
55
- };
56
- this._onCategoryExpansionToggled = (categoryName) => {
57
- this.setState((state) => {
58
- return immer_1.produce(state, (draft) => {
59
- const records = findCategory(draft.categories, categoryName, true);
60
- // istanbul ignore else
61
- if (records) {
62
- const category = records.category;
63
- category.expand = !category.expand;
64
- }
65
- });
66
- });
67
- };
68
- this.state = {
69
- categories: [],
70
- orientation: this.getPreferredOrientation(),
71
- width: 0,
72
- };
73
- }
74
- /** @internal */
75
- componentDidMount() {
76
- this._isMounted = true;
77
- this._dataChangesListenerDisposeFunc =
78
- this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
79
- void this.gatherData();
80
- }
81
- /** @internal */
82
- componentWillUnmount() {
83
- // istanbul ignore else
84
- if (this._dataChangesListenerDisposeFunc) {
85
- this._dataChangesListenerDisposeFunc();
86
- this._dataChangesListenerDisposeFunc = undefined;
87
- }
88
- this._isMounted = false;
89
- }
90
- componentDidUpdate(prevProps) {
91
- if (this.props.dataProvider !== prevProps.dataProvider) {
92
- // istanbul ignore else
93
- if (this._dataChangesListenerDisposeFunc) {
94
- this._dataChangesListenerDisposeFunc();
95
- }
96
- this._dataChangesListenerDisposeFunc =
97
- this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
98
- void this.gatherData();
99
- }
100
- if (this.props.orientation !== prevProps.orientation ||
101
- this.props.isOrientationFixed !== prevProps.isOrientationFixed ||
102
- this.props.horizontalOrientationMinWidth !==
103
- prevProps.horizontalOrientationMinWidth) {
104
- this.updateOrientation(this.state.width);
105
- }
106
- }
107
- async gatherData() {
108
- if (this._isInDataRequest) {
109
- this._hasPendingDataRequest = true;
110
- return;
111
- }
112
- this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });
113
- this._isInDataRequest = true;
114
- let propertyData;
115
- try {
116
- propertyData = await this.props.dataProvider.getData();
117
- }
118
- finally {
119
- this._isInDataRequest = false;
120
- }
121
- if (!this._isMounted) {
122
- return;
123
- }
124
- if (this._hasPendingDataRequest) {
125
- this._hasPendingDataRequest = false;
126
- return this.gatherData();
127
- }
128
- this.setState((prevState) => {
129
- const buildCategoriesHierarchy = (newCategories, stateCategories) => newCategories.map((category) => {
130
- var _a, _b, _c, _d;
131
- const matchingStateCategory = findCategory(stateCategories !== null && stateCategories !== void 0 ? stateCategories : [], category.name, false);
132
- return {
133
- category: {
134
- ...category,
135
- 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,
136
- },
137
- records: (_c = propertyData.records[category.name]) !== null && _c !== void 0 ? _c : [],
138
- children: buildCategoriesHierarchy((_d = category.childCategories) !== null && _d !== void 0 ? _d : [], matchingStateCategory === null || matchingStateCategory === void 0 ? void 0 : matchingStateCategory.children),
139
- };
140
- });
141
- return {
142
- categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),
143
- loadStart: undefined,
144
- };
145
- });
146
- }
147
- getPreferredOrientation() {
148
- return this.props.orientation !== undefined
149
- ? this.props.orientation
150
- : core_react_1.Orientation.Horizontal;
151
- }
152
- updateOrientation(width) {
153
- const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {
154
- ...this.props,
155
- };
156
- const currentOrientation = components_react_1.PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);
157
- if (currentOrientation !== this.state.orientation ||
158
- width !== this.state.width) {
159
- this.setState({ orientation: currentOrientation, width });
160
- }
161
- }
162
- /** @internal */
163
- render() {
164
- var _a, _b;
165
- if (this.state.loadStart) {
166
- return (React.createElement("div", { className: "gmw-components-property-grid-loader" },
167
- React.createElement(itwinui_react_1.ProgressRadial, { indeterminate: true })));
168
- }
169
- return (React.createElement("div", { className: "gmw-table-box-inner" },
170
- React.createElement(components_react_1.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_1.default("gmw-components-property-grid-wrapper", this.props.className), style: this.props.style },
171
- React.createElement("div", { className: classnames_1.default("gmw-components-property-grid", "components-smallEditor-host") },
172
- React.createElement("div", { className: "gmw-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 }))))),
173
- React.createElement(core_react_1.ResizableContainerObserver, { onResize: this._onResize }))))));
174
- }
175
- }
176
- exports.PropertyGrid = PropertyGrid;
177
- PropertyGrid.contextType = PropertyGridWrapperContext_1.PropertyGridWrapperContext;
178
- function findCategory(categories, lookupName, recurseIntoChildren) {
179
- for (const category of categories) {
180
- if (category.category.name === lookupName) {
181
- return category;
182
- }
183
- if (recurseIntoChildren) {
184
- const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);
185
- if (matchingChild) {
186
- return matchingChild;
187
- }
188
- }
189
- }
190
- return undefined;
191
- }
192
- const NestedCategoryBlock = (props) => {
193
- const [width, setWidth] = React.useState(1);
194
- return (React.createElement(components_react_1.PropertyCategoryBlock, { category: props.categorizedRecords.category, onExpansionToggled: props.onCategoryExpansionToggled },
195
- props.categorizedRecords.records.length ? (React.createElement(ColumnResizingPropertyListPropsSupplier_1.ColumnResizingPropertyListPropsSupplier, { orientation: props.orientation, width: width }, (partialListProps) => (React.createElement(PropertyList_1.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,
196
- props.categorizedRecords.children.length ? (React.createElement("div", { className: "gmw-property-categories" }, props.categorizedRecords.children.map((categorizedChildRecords) => (React.createElement(NestedCategoryBlock, { ...props, key: categorizedChildRecords.category.name, categorizedRecords: categorizedChildRecords }))))) : undefined));
197
- };
198
- //# sourceMappingURL=PropertyGrid.js.map
@@ -1 +0,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B,EAC9C,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,4BAA4B,EAAE,KAAK,CAAC,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,yBAAyB,IACrC,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,\n} from \"@itwin/components-react\";\nimport {\n PropertyCategoryBlock,\n PropertyGridCommons,\n PropertyGridEventsRelatedPropsSupplier,\n} from \"@itwin/components-react\";\nimport type { ColumnResizeRelatedPropertyListProps } from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport { ColumnResizingPropertyListPropsSupplier } 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 { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\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 = PropertyGridWrapperContext;\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=\"gmw-components-property-grid-loader\">\n <ProgressRadial indeterminate />\n </div>\n );\n }\n\n return (\n <div className=\"gmw-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 \"gmw-components-property-grid-wrapper\",\n this.props.className\n )}\n style={this.props.style}\n >\n <div\n className={classnames(\n \"gmw-components-property-grid\",\n \"components-smallEditor-host\"\n )}\n >\n <div className=\"gmw-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=\"gmw-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"]}
@@ -1,71 +0,0 @@
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
- .gmw-components-property-grid-loader {
9
- display: flex;
10
- justify-content: center;
11
- align-items: center;
12
- }
13
-
14
- .gmw-components-property-grid {
15
- .gmw-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
- .gmw-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 gmw-components-property-list {
40
- width: 100%;
41
-
42
- .gmw-components--selected {
43
- background-color: $buic-row-selection;
44
- outline: 1px solid $buic-foreground-primary;
45
- }
46
-
47
- .gmw-components--clickable {
48
- cursor: pointer;
49
-
50
- &:hover {
51
- background: $buic-row-hover;
52
- }
53
- }
54
-
55
- .gmw-components--hoverable:hover {
56
- background-color: $buic-row-hover;
57
- }
58
- }
59
-
60
- .gmw-components-property-list--horizontal {
61
- @include gmw-components-property-list;
62
-
63
- display: grid;
64
- grid-row-gap: 0px;
65
- overflow: hidden;
66
- }
67
-
68
- .gmw-components-property-list--vertical {
69
- @include gmw-components-property-list;
70
- // margin-top: -13px;
71
- }
@@ -1,23 +0,0 @@
1
- import * as React from "react";
2
- import { PresentationPropertyDataProvider } from "@itwin/presentation-components";
3
- import "../customUI/GroupQueryBuilderCustomUI.scss";
4
- import type { KeySet } from "@itwin/presentation-common";
5
- import type { IModelConnection } from "@itwin/core-frontend";
6
- interface PropertyGridWrapperState {
7
- dataProvider?: PresentationPropertyDataProvider;
8
- }
9
- interface PropertyProps {
10
- keys: KeySet;
11
- imodel?: IModelConnection;
12
- }
13
- export declare class PropertyGridWrapper extends React.Component<PropertyProps, PropertyGridWrapperState> {
14
- static contextType: React.Context<import("../context/PropertyGridWrapperContext").PropertySelection>;
15
- constructor(props: PropertyProps | Readonly<PropertyProps>);
16
- private createPropertyDataProvider;
17
- private createDataProvider;
18
- componentDidMount(): void;
19
- componentDidUpdate(prevProps: PropertyProps): void;
20
- render(): JSX.Element;
21
- }
22
- export {};
23
- //# sourceMappingURL=PropertyGridWrapper.d.ts.map
@@ -1,77 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.PropertyGridWrapper = void 0;
23
- /*---------------------------------------------------------------------------------------------
24
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
25
- * See LICENSE.md in the project root for license terms and full copyright notice.
26
- *--------------------------------------------------------------------------------------------*/
27
- const React = __importStar(require("react"));
28
- const presentation_components_1 = require("@itwin/presentation-components");
29
- const PropertyGrid_1 = require("./PropertyGrid");
30
- require("../customUI/GroupQueryBuilderCustomUI.scss");
31
- const PropertyGridWrapperContext_1 = require("../context/PropertyGridWrapperContext");
32
- const QueryBuilder_1 = require("../QueryBuilder");
33
- /* This approach uses PresentationPropertyDataProvider to all the work of querying the backend and
34
- providing the content to the PropertyGrid component. */
35
- class PropertyGridWrapper extends React.Component {
36
- constructor(props) {
37
- super(props);
38
- this.createPropertyDataProvider = (keys, imodel) => {
39
- const dataProvider = new presentation_components_1.PresentationPropertyDataProvider({
40
- imodel,
41
- ruleset: presentation_components_1.DEFAULT_PROPERTY_GRID_RULESET,
42
- });
43
- dataProvider.keys = keys;
44
- dataProvider.isNestedPropertyCategoryGroupingEnabled = true;
45
- return dataProvider;
46
- };
47
- this.state = {};
48
- }
49
- createDataProvider() {
50
- if (!this.props.imodel || this.props.keys.isEmpty) {
51
- this.setState({ dataProvider: undefined });
52
- return;
53
- }
54
- const dataProvider = this.createPropertyDataProvider(this.props.keys, this.props.imodel);
55
- this.context.setQueryBuilder(new QueryBuilder_1.QueryBuilder(dataProvider));
56
- this.setState({ dataProvider });
57
- }
58
- componentDidMount() {
59
- this.createDataProvider();
60
- }
61
- componentDidUpdate(prevProps) {
62
- if (prevProps.keys === this.props.keys) {
63
- return;
64
- }
65
- this.createDataProvider();
66
- }
67
- render() {
68
- const dataProvider = this.state.dataProvider;
69
- return (React.createElement(React.Fragment, null,
70
- dataProvider && React.createElement(PropertyGrid_1.PropertyGrid, { dataProvider: dataProvider }),
71
- !dataProvider && (React.createElement("div", { className: "gmw-select-element-hint" },
72
- React.createElement("span", null, "Select an element to see its properties.")))));
73
- }
74
- }
75
- exports.PropertyGridWrapper = PropertyGridWrapper;
76
- PropertyGridWrapper.contextType = PropertyGridWrapperContext_1.PropertyGridWrapperContext;
77
- //# sourceMappingURL=PropertyGridWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyGridWrapper.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyGridWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAC/B,4EAAiH;AACjH,iDAA8C;AAC9C,sDAAoD;AACpD,sFAAmF;AACnF,kDAA+C;AAa/C;0DAC0D;AAC1D,MAAa,mBAAoB,SAAQ,KAAK,CAAC,SAG9C;IAEC,YAAY,KAA8C;QACxD,KAAK,CAAC,KAAK,CAAC,CAAC;QAIP,+BAA0B,GAAG,CAAC,IAAY,EAAE,MAAwB,EAAoC,EAAE;YAChH,MAAM,YAAY,GAAG,IAAI,0DAAgC,CAAC;gBACxD,MAAM;gBACN,OAAO,EAAE,uDAA6B;aACvC,CAAC,CAAC;YACH,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;YACzB,YAAY,CAAC,uCAAuC,GAAG,IAAI,CAAC;YAC5D,OAAO,YAAY,CAAC;QACtB,CAAC,CAAA;QAXC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAYO,kBAAkB;QACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE;YACjD,IAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;YAC3C,OAAO;SACR;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,0BAA0B,CAClD,IAAI,CAAC,KAAK,CAAC,IAAI,EACf,IAAI,CAAC,KAAK,CAAC,MAAM,CAClB,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,2BAAY,CAAC,YAAY,CAAC,CAAC,CAAC;QAE7D,IAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;IAClC,CAAC;IAEe,iBAAiB;QAC/B,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAEe,kBAAkB,CAAC,SAAwB;QACzD,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACtC,OAAO;SACR;QAED,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAEe,MAAM;QACpB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QAC7C,OAAO,CACL;YACG,YAAY,IAAI,oBAAC,2BAAY,IAAC,YAAY,EAAE,YAAY,GAAI;YAC5D,CAAC,YAAY,IAAI,CAChB,6BAAK,SAAS,EAAC,yBAAyB;gBACtC,6EAAqD,CACjD,CACP,CACA,CACJ,CAAC;IACJ,CAAC;;AA3DH,kDA4DC;AAxDiB,+BAAW,GAAG,uDAA0B,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 { DEFAULT_PROPERTY_GRID_RULESET, PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport { PropertyGrid } from \"./PropertyGrid\";\nimport \"../customUI/GroupQueryBuilderCustomUI.scss\";\nimport { PropertyGridWrapperContext } from \"../context/PropertyGridWrapperContext\";\nimport { QueryBuilder } from \"../QueryBuilder\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\n\ninterface PropertyGridWrapperState {\n dataProvider?: PresentationPropertyDataProvider;\n}\n\ninterface PropertyProps {\n keys: KeySet;\n imodel?: IModelConnection;\n}\n\n/* This approach uses PresentationPropertyDataProvider to all the work of querying the backend and\n providing the content to the PropertyGrid component. */\nexport class PropertyGridWrapper extends React.Component<\nPropertyProps,\nPropertyGridWrapperState\n> {\n static override contextType = PropertyGridWrapperContext;\n constructor(props: PropertyProps | Readonly<PropertyProps>) {\n super(props);\n this.state = {};\n }\n\n private createPropertyDataProvider = (keys: KeySet, imodel: IModelConnection): PresentationPropertyDataProvider => {\n const dataProvider = new PresentationPropertyDataProvider({\n imodel,\n ruleset: DEFAULT_PROPERTY_GRID_RULESET,\n });\n dataProvider.keys = keys;\n dataProvider.isNestedPropertyCategoryGroupingEnabled = true;\n return dataProvider;\n }\n\n private createDataProvider() {\n if (!this.props.imodel || this.props.keys.isEmpty) {\n this.setState({ dataProvider: undefined });\n return;\n }\n\n const dataProvider = this.createPropertyDataProvider(\n this.props.keys,\n this.props.imodel\n );\n this.context.setQueryBuilder(new QueryBuilder(dataProvider));\n\n this.setState({ dataProvider });\n }\n\n public override componentDidMount() {\n this.createDataProvider();\n }\n\n public override componentDidUpdate(prevProps: PropertyProps) {\n if (prevProps.keys === this.props.keys) {\n return;\n }\n\n this.createDataProvider();\n }\n\n public override render() {\n const dataProvider = this.state.dataProvider;\n return (\n <>\n {dataProvider && <PropertyGrid dataProvider={dataProvider} />}\n {!dataProvider && (\n <div className=\"gmw-select-element-hint\">\n <span>Select an element to see its properties.</span>\n </div>\n )}\n </>\n );\n }\n}\n"]}
@@ -1,69 +0,0 @@
1
- /** @packageDocumentation
2
- * @module PropertyGrid
3
- */
4
- import * as React from "react";
5
- import type { PropertyRecord } from "@itwin/appui-abstract";
6
- import type { CommonProps, RatioChangeResult } from "@itwin/core-react";
7
- import { Orientation } from "@itwin/core-react";
8
- import type { ActionButtonRenderer, PropertyCategory, PropertyUpdatedArgs, PropertyValueRendererManager } from "@itwin/components-react";
9
- import type { PropertyGridColumnInfo } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns";
10
- /** Properties of [[PropertyList]] React component
11
- * @public
12
- */
13
- export interface PropertyListProps extends CommonProps {
14
- orientation: Orientation;
15
- category?: PropertyCategory;
16
- properties: PropertyRecord[];
17
- selectedPropertyKey?: string;
18
- onPropertyClicked?: (property: PropertyRecord, key?: string) => void;
19
- onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;
20
- onPropertyContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;
21
- columnRatio?: number;
22
- /** Callback to column ratio changed event */
23
- onColumnChanged?: (ratio: number) => void | RatioChangeResult;
24
- propertyValueRendererManager?: PropertyValueRendererManager;
25
- editingPropertyKey?: string;
26
- onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;
27
- onEditCancel?: () => void;
28
- /** Enables/disables property hovering effect */
29
- isPropertyHoverEnabled?: boolean;
30
- /** Enables/disables property selection */
31
- isPropertySelectionEnabled?: boolean;
32
- /** Enables/disables property right click selection */
33
- isPropertyRightClickSelectionEnabled?: boolean;
34
- /** Array of action button renderers */
35
- actionButtonRenderers?: ActionButtonRenderer[];
36
- /** Is resize handle hovered */
37
- isResizeHandleHovered?: boolean;
38
- /** Callback to hover event change */
39
- onResizeHandleHoverChanged?: (isHovered: boolean) => void;
40
- /** Is resize handle being dragged */
41
- isResizeHandleBeingDragged?: boolean;
42
- /** Callback to drag event change */
43
- onResizeHandleDragChanged?: (isDragStarted: boolean) => void;
44
- /** Information for styling property grid columns */
45
- columnInfo?: PropertyGridColumnInfo;
46
- setWidth?: React.Dispatch<React.SetStateAction<number>>;
47
- width: number;
48
- }
49
- /**
50
- * Get unique key for property record
51
- * @internal
52
- */
53
- export declare function getPropertyKey(propertyCategory: PropertyCategory, propertyRecord: PropertyRecord): string;
54
- /** A React component that renders multiple properties within a category as a list.
55
- * @public
56
- */
57
- export declare class PropertyList extends React.Component<PropertyListProps> {
58
- constructor(props: PropertyListProps);
59
- private _listRef;
60
- private _onEditCommit;
61
- private afterRender;
62
- /** @internal */
63
- componentDidMount(): void;
64
- /** @internal */
65
- componentDidUpdate(): void;
66
- /** @internal */
67
- render(): JSX.Element;
68
- }
69
- //# sourceMappingURL=PropertyList.d.ts.map
@@ -1,87 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module PropertyGrid
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.PropertyList = exports.getPropertyKey = void 0;
33
- const classnames_1 = __importDefault(require("classnames"));
34
- const React = __importStar(require("react"));
35
- const appui_abstract_1 = require("@itwin/appui-abstract");
36
- const core_react_1 = require("@itwin/core-react");
37
- const PropertyRender_1 = require("./PropertyRender");
38
- /**
39
- * Get unique key for property record
40
- * @internal
41
- */
42
- function getPropertyKey(propertyCategory, propertyRecord) {
43
- return propertyCategory.name + propertyRecord.property.name;
44
- }
45
- exports.getPropertyKey = getPropertyKey;
46
- /** A React component that renders multiple properties within a category as a list.
47
- * @public
48
- */
49
- class PropertyList extends React.Component {
50
- constructor(props) {
51
- super(props);
52
- this._listRef = React.createRef();
53
- this._onEditCommit = (args) => {
54
- // istanbul ignore else
55
- if (this.props.onEditCommit && this.props.category)
56
- this.props.onEditCommit(args, this.props.category);
57
- };
58
- }
59
- afterRender() {
60
- if (this.props.orientation !== core_react_1.Orientation.Horizontal ||
61
- !this._listRef.current) {
62
- return;
63
- }
64
- const width = this._listRef.current.getBoundingClientRect().width;
65
- if (this.props.setWidth && width !== this.props.width) {
66
- this.props.setWidth(width);
67
- }
68
- }
69
- /** @internal */
70
- componentDidMount() {
71
- this.afterRender();
72
- }
73
- /** @internal */
74
- componentDidUpdate() {
75
- this.afterRender();
76
- }
77
- /** @internal */
78
- render() {
79
- const propertyListClassName = classnames_1.default((this.props.orientation === core_react_1.Orientation.Horizontal) ? "gmw-components-property-list--horizontal" : "gmw-components-property-list--vertical", this.props.className);
80
- return (React.createElement("div", { className: propertyListClassName, style: this.props.style, ref: this._listRef }, this.props.properties.map((propertyRecord) => {
81
- const key = this.props.category ? getPropertyKey(this.props.category, propertyRecord) : propertyRecord.property.name;
82
- return (React.createElement(PropertyRender_1.PropertyRenderer, { key: key, uniqueKey: key, isHoverable: this.props.isPropertyHoverEnabled, isSelectable: this.props.isPropertySelectionEnabled, isSelected: key === this.props.selectedPropertyKey, propertyRecord: propertyRecord, orientation: this.props.orientation, onClick: propertyRecord.value.valueFormat === appui_abstract_1.PropertyValueFormat.Primitive ? this.props.onPropertyClicked : undefined, onRightClick: propertyRecord.value.valueFormat === appui_abstract_1.PropertyValueFormat.Primitive ? this.props.onPropertyRightClicked : undefined, onContextMenu: this.props.onPropertyContextMenu, columnRatio: this.props.columnRatio, onColumnRatioChanged: this.props.onColumnChanged, propertyValueRendererManager: this.props.propertyValueRendererManager, isEditing: key === this.props.editingPropertyKey, onEditCommit: this._onEditCommit, onEditCancel: this.props.onEditCancel, actionButtonRenderers: this.props.actionButtonRenderers, isResizeHandleHovered: this.props.isResizeHandleHovered, onResizeHandleHoverChanged: this.props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: this.props.isResizeHandleBeingDragged, onResizeHandleDragChanged: this.props.onResizeHandleDragChanged, columnInfo: this.props.columnInfo, width: this.props.width }));
83
- })));
84
- }
85
- }
86
- exports.PropertyList = PropertyList;
87
- //# sourceMappingURL=PropertyList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyList.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyList.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4DAAoC;AACpC,6CAA+B;AAE/B,0DAA4D;AAE5D,kDAAgD;AAQhD,qDAAoD;AA2CpD;;;GAGG;AACH,SAAgB,cAAc,CAAC,gBAAkC,EAAE,cAA8B;IAC/F,OAAO,gBAAgB,CAAC,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC9D,CAAC;AAFD,wCAEC;AAED;;GAEG;AACH,MAAa,YAAa,SAAQ,KAAK,CAAC,SAA4B;IAElE,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,aAAQ,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAE7C,kBAAa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AqB,EACvD,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACvD,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EACjE,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EACjE,yBAAyB,EAAE,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAC/D,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GACvB,CAAC,CAAC;QACR,CAAC,CAAC,CACE,CACP,CAAC;IACJ,CAAC;CACF;AA9ED,oCA8EC","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*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { PropertyRecord} from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { CommonProps, RatioChangeResult } from \"@itwin/core-react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type {\n ActionButtonRenderer,\n PropertyCategory,\n PropertyUpdatedArgs,\n PropertyValueRendererManager,\n} from \"@itwin/components-react\";\n\nimport { PropertyRenderer } from \"./PropertyRender\";\nimport type { PropertyGridColumnInfo } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns\";\n\n/** Properties of [[PropertyList]] React component\n * @public\n */\nexport interface PropertyListProps extends CommonProps {\n orientation: Orientation;\n category?: PropertyCategory;\n properties: PropertyRecord[];\n selectedPropertyKey?: string;\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\n columnRatio?: number;\n /** Callback to column ratio changed event */\n onColumnChanged?: (ratio: number) => void | RatioChangeResult;\n propertyValueRendererManager?: PropertyValueRendererManager;\n editingPropertyKey?: string;\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\n onEditCancel?: () => void;\n /** Enables/disables property hovering effect */\n isPropertyHoverEnabled?: boolean;\n /** Enables/disables property selection */\n isPropertySelectionEnabled?: boolean;\n /** Enables/disables property right click selection */\n isPropertyRightClickSelectionEnabled?: boolean;\n /** Array of action button renderers */\n actionButtonRenderers?: ActionButtonRenderer[];\n /** Is resize handle hovered */\n isResizeHandleHovered?: boolean;\n /** Callback to hover event change */\n onResizeHandleHoverChanged?: (isHovered: boolean) => void;\n /** Is resize handle being dragged */\n isResizeHandleBeingDragged?: boolean;\n /** Callback to drag event change */\n onResizeHandleDragChanged?: (isDragStarted: boolean) => void;\n /** Information for styling property grid columns */\n columnInfo?: PropertyGridColumnInfo;\n setWidth?: React.Dispatch<React.SetStateAction<number>>;\n width: number;\n}\n\n/**\n * Get unique key for property record\n * @internal\n */\nexport function getPropertyKey(propertyCategory: PropertyCategory, propertyRecord: PropertyRecord) {\n return propertyCategory.name + propertyRecord.property.name;\n}\n\n/** A React component that renders multiple properties within a category as a list.\n * @public\n */\nexport class PropertyList extends React.Component<PropertyListProps> {\n\n constructor(props: PropertyListProps) {\n super(props);\n }\n\n private _listRef = React.createRef<HTMLDivElement>();\n\n private _onEditCommit = (args: PropertyUpdatedArgs) => {\n // istanbul ignore else\n if (this.props.onEditCommit && this.props.category)\n this.props.onEditCommit(args, this.props.category);\n };\n\n private afterRender() {\n if (\n this.props.orientation !== Orientation.Horizontal ||\n !this._listRef.current\n ) {\n return;\n }\n const width = this._listRef.current.getBoundingClientRect().width;\n if (this.props.setWidth && width !== this.props.width) {\n this.props.setWidth(width);\n }\n }\n\n /** @internal */\n public override componentDidMount() {\n this.afterRender();\n }\n\n /** @internal */\n public override componentDidUpdate() {\n this.afterRender();\n }\n\n /** @internal */\n public override render() {\n const propertyListClassName = classnames(\n (this.props.orientation === Orientation.Horizontal) ? \"gmw-components-property-list--horizontal\" : \"gmw-components-property-list--vertical\",\n this.props.className,\n );\n\n return (\n <div className={propertyListClassName} style={this.props.style} ref={this._listRef}>\n {this.props.properties.map((propertyRecord: PropertyRecord) => {\n const key = this.props.category ? getPropertyKey(this.props.category, propertyRecord) : propertyRecord.property.name;\n return (\n <PropertyRenderer\n key={key}\n uniqueKey={key}\n isHoverable={this.props.isPropertyHoverEnabled}\n isSelectable={this.props.isPropertySelectionEnabled}\n isSelected={key === this.props.selectedPropertyKey}\n propertyRecord={propertyRecord}\n orientation={this.props.orientation}\n onClick={propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyClicked : undefined}\n onRightClick={propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyRightClicked : undefined}\n onContextMenu={this.props.onPropertyContextMenu}\n columnRatio={this.props.columnRatio}\n onColumnRatioChanged={this.props.onColumnChanged}\n propertyValueRendererManager={this.props.propertyValueRendererManager}\n isEditing={key === this.props.editingPropertyKey}\n onEditCommit={this._onEditCommit}\n onEditCancel={this.props.onEditCancel}\n actionButtonRenderers={this.props.actionButtonRenderers}\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 width={this.props.width}\n />);\n })}\n </div>\n );\n }\n}\n"]}