@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,10 +0,0 @@
1
- import type { PropertyRecord } from "@itwin/appui-abstract";
2
- import type { HighlightingComponentProps } from "@itwin/components-react";
3
- import { PropertyValueRendererManager } from "@itwin/components-react";
4
- import { Orientation } from "@itwin/core-react";
5
- import * as React from "react";
6
- export declare function createNewDisplayValue(orientation: Orientation, propertyRecord: PropertyRecord, indentation?: number, propertyValueRendererManager?: PropertyValueRendererManager, isExpanded?: boolean, onExpansionToggled?: () => void, onHeightChanged?: (newHeight: number) => void, highlight?: HighlightingComponentProps & {
7
- applyOnLabel: boolean;
8
- applyOnValue: boolean;
9
- }): React.ReactNode;
10
- //# sourceMappingURL=createNewDisplayValue.d.ts.map
@@ -1,65 +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.createNewDisplayValue = void 0;
23
- const components_react_1 = require("@itwin/components-react");
24
- const CommonPropertyRenderer_1 = require("@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer");
25
- const core_react_1 = require("@itwin/core-react");
26
- const React = __importStar(require("react"));
27
- const countMatchesInString_1 = require("./countMatchesInString");
28
- function createHighlightCallback(highlight, propertyRecord) {
29
- var _a;
30
- const activeMatch = highlight.activeHighlight;
31
- const propertyName = activeMatch === null || activeMatch === void 0 ? void 0 : activeMatch.highlightedItemIdentifier;
32
- const matchIndex = (_a = activeMatch === null || activeMatch === void 0 ? void 0 : activeMatch.highlightIndex) !== null && _a !== void 0 ? _a : 0;
33
- let labelMatches;
34
- if (highlight.applyOnLabel) {
35
- labelMatches = countMatchesInString_1.countMatchesInString(propertyRecord.property.displayLabel.toLowerCase(), highlight.highlightedText);
36
- }
37
- else {
38
- labelMatches = 0;
39
- }
40
- const activeMatchIndex = (propertyRecord.property.name === propertyName) && ((matchIndex - labelMatches) >= 0) ? (matchIndex - labelMatches) : undefined;
41
- const highlightCallback = (text) => (React.createElement(components_react_1.HighlightedText, { text: text, activeMatchIndex: activeMatchIndex, searchText: highlight.highlightedText }));
42
- return highlightCallback;
43
- }
44
- function createNewDisplayValue(orientation, propertyRecord, indentation, propertyValueRendererManager, isExpanded, onExpansionToggled, onHeightChanged, highlight) {
45
- const highlightCallback = (highlight === null || highlight === void 0 ? void 0 : highlight.applyOnValue) ? (createHighlightCallback(highlight, propertyRecord)) : undefined;
46
- const rendererContext = {
47
- orientation,
48
- containerType: components_react_1.PropertyContainerType.PropertyPane,
49
- isExpanded,
50
- onExpansionToggled,
51
- onHeightChanged,
52
- textHighlighter: highlightCallback,
53
- };
54
- let displayValue;
55
- if (propertyValueRendererManager)
56
- displayValue = propertyValueRendererManager.render(propertyRecord, rendererContext);
57
- else
58
- displayValue = components_react_1.PropertyValueRendererManager.defaultManager.render(propertyRecord, rendererContext);
59
- // Align value with label if orientation is vertical
60
- if (orientation === core_react_1.Orientation.Vertical)
61
- displayValue = React.createElement("span", { style: { paddingLeft: CommonPropertyRenderer_1.CommonPropertyRenderer.getLabelOffset(indentation, orientation) } }, displayValue);
62
- return displayValue;
63
- }
64
- exports.createNewDisplayValue = createNewDisplayValue;
65
- //# sourceMappingURL=createNewDisplayValue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createNewDisplayValue.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/createNewDisplayValue.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMA,8DAA+G;AAC/G,yIAAsI;AACtI,kDAAgD;AAChD,6CAA+B;AAC/B,iEAA8D;AAE9D,SAAS,uBAAuB,CAAC,SAAiE,EAAE,cAA8B;;IAChI,MAAM,WAAW,GAAG,SAAS,CAAC,eAAe,CAAC;IAC9C,MAAM,YAAY,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,yBAAyB,CAAC;IAC5D,MAAM,UAAU,GAAG,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,mCAAI,CAAC,CAAC;IACpD,IAAI,YAAoB,CAAC;IAEzB,IAAI,SAAS,CAAC,YAAY,EAAE;QAC1B,YAAY,GAAG,2CAAoB,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;KACpH;SAAM;QACL,YAAY,GAAG,CAAC,CAAC;KAClB;IAED,MAAM,gBAAgB,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAA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C;IAEtI,OAAO,YAAY,CAAC;AACtB,CAAC;AA/BD,sDA+BC","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 { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { HighlightingComponentProps, PropertyValueRendererContext } from \"@itwin/components-react\";\nimport { HighlightedText, PropertyContainerType, PropertyValueRendererManager } from \"@itwin/components-react\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { Orientation } from \"@itwin/core-react\";\nimport * as React from \"react\";\nimport { countMatchesInString } from \"./countMatchesInString\";\n\nfunction createHighlightCallback(highlight: HighlightingComponentProps & { applyOnLabel: boolean }, propertyRecord: PropertyRecord) {\n const activeMatch = highlight.activeHighlight;\n const propertyName = activeMatch?.highlightedItemIdentifier;\n const matchIndex = activeMatch?.highlightIndex ?? 0;\n let labelMatches: number;\n\n if (highlight.applyOnLabel) {\n labelMatches = countMatchesInString(propertyRecord.property.displayLabel.toLowerCase(), highlight.highlightedText);\n } else {\n labelMatches = 0;\n }\n\n const activeMatchIndex = (propertyRecord.property.name === propertyName) && ((matchIndex - labelMatches) >= 0) ? (matchIndex - labelMatches) : undefined;\n const highlightCallback = (text: string) => (<HighlightedText text={text} activeMatchIndex={activeMatchIndex} searchText={highlight.highlightedText} />);\n\n return highlightCallback;\n}\n\nexport function createNewDisplayValue(\n orientation: Orientation,\n propertyRecord: PropertyRecord,\n indentation?: number,\n propertyValueRendererManager?: PropertyValueRendererManager,\n isExpanded?: boolean,\n onExpansionToggled?: () => void,\n onHeightChanged?: (newHeight: number) => void,\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean }\n) {\n const highlightCallback = highlight?.applyOnValue ? (createHighlightCallback(highlight, propertyRecord)) : undefined;\n const rendererContext: PropertyValueRendererContext = {\n orientation,\n containerType: PropertyContainerType.PropertyPane,\n isExpanded,\n onExpansionToggled,\n onHeightChanged,\n textHighlighter: highlightCallback,\n };\n\n let displayValue: React.ReactNode | undefined;\n if (propertyValueRendererManager)\n displayValue = propertyValueRendererManager.render(propertyRecord, rendererContext);\n else\n displayValue = PropertyValueRendererManager.defaultManager.render(propertyRecord, rendererContext);\n\n // Align value with label if orientation is vertical\n if (orientation === Orientation.Vertical)\n displayValue = <span style={{ paddingLeft: CommonPropertyRenderer.getLabelOffset(indentation, orientation) }}>{displayValue}</span>;\n\n return displayValue;\n}\n"]}
@@ -1,32 +0,0 @@
1
- import * as React from "react";
2
- import type { PrimitiveRendererProps } from "./PrimitivePropertyRenderer";
3
- /** Properties of [[NonPrimitivePropertyRenderer]] React component
4
- * @public
5
- */
6
- export interface NonPrimitivePropertyRendererProps extends PrimitiveRendererProps {
7
- /** Can struct/array property be collapsed */
8
- isCollapsible?: boolean;
9
- }
10
- /** State of [[NonPrimitivePropertyRenderer]] React component
11
- * @internal
12
- */
13
- interface NonPrimitivePropertyRendererState {
14
- /** Is struct/array property expanded */
15
- isExpanded?: boolean;
16
- }
17
- /** React Component that renders struct and array properties
18
- * @public
19
- */
20
- export declare class NonPrimitivePropertyRenderer extends React.Component<NonPrimitivePropertyRendererProps, NonPrimitivePropertyRendererState> {
21
- /** @internal */
22
- readonly state: NonPrimitivePropertyRendererState;
23
- private _onExpanded;
24
- private _onCollapsed;
25
- private getLabel;
26
- private overrideArrayChildrenNames;
27
- private _renderPropertyForItem;
28
- /** @internal */
29
- render(): JSX.Element;
30
- }
31
- export {};
32
- //# sourceMappingURL=NonPrimitivePropertyRenderer.d.ts.map
@@ -1,68 +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 * 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
- /** React Component that renders struct and array properties
12
- * @public
13
- */
14
- export class NonPrimitivePropertyRenderer extends React.Component {
15
- constructor() {
16
- super(...arguments);
17
- /** @internal */
18
- this.state = {
19
- /** If it's not collapsible, that means it's expanded by default and can't be collapsed */
20
- isExpanded: !this.props.isCollapsible || this.props.propertyRecord.autoExpand,
21
- };
22
- this._onExpanded = () => {
23
- this.setState({ isExpanded: true });
24
- };
25
- this._onCollapsed = () => {
26
- this.setState({ isExpanded: false });
27
- };
28
- this._renderPropertyForItem = (item) => {
29
- const prefix = this.props.uniqueKey
30
- ? this.props.uniqueKey
31
- : this.props.propertyRecord.property.name;
32
- const uniqueKey = `${prefix}_${item.property.name}`;
33
- 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 }));
34
- };
35
- }
36
- getLabel(props, state) {
37
- const { orientation, indentation, width, columnRatio, columnInfo } = props;
38
- const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, columnInfo === null || columnInfo === void 0 ? void 0 : columnInfo.minLabelWidth);
39
- let displayLabel = props.propertyRecord.property.displayLabel;
40
- if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array) {
41
- displayLabel = `${displayLabel} (${this.props.propertyRecord.value.items.length})`;
42
- }
43
- return (React.createElement(NonPrimitivePropertyLabelRenderer, { isExpanded: !!state.isExpanded, onExpand: this._onExpanded, onCollapse: this._onCollapsed, offset: offset, renderColon: false }, displayLabel));
44
- }
45
- overrideArrayChildrenNames(items) {
46
- const modifiedProperties = items.map((item, index) => {
47
- const newProperty = { ...item.property };
48
- newProperty.displayLabel = `[${index + 1}]`;
49
- newProperty.name = `${newProperty.name}_${index}`;
50
- return new PropertyRecord(item.value, newProperty);
51
- });
52
- return modifiedProperties;
53
- }
54
- /** @internal */
55
- render() {
56
- let items = this.props.propertyRecord.getChildrenRecords();
57
- if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array) {
58
- items = this.overrideArrayChildrenNames(items);
59
- }
60
- const { ...props } = this.props;
61
- return (React.createElement(React.Fragment, null,
62
- this.props.isCollapsible ? (React.createElement(PropertyView, { labelElement: this.getLabel(this.props, this.state), ...props })) : undefined,
63
- this.state.isExpanded
64
- ? items.map(this._renderPropertyForItem)
65
- : undefined));
66
- }
67
- }
68
- //# sourceMappingURL=NonPrimitivePropertyRenderer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/NonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8FAA8F,CAAC;AACtI,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAoB9C;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK,CAA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K,EAAkB,EAAE;YAC9B,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YACzC,WAAW,CAAC,YAAY,GAAG,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC;YAC5C,WAAW,CAAC,IAAI,GAAG,GAAG,WAAW,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;YAClD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC,CACF,CAAC;QAEF,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IA2BD,gBAAgB;IACA,MAAM;QACpB,IAAI,KAAK,GACP,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC;QACjD,IACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,KAAK,EACzE;YACA,KAAK,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;SAChD;QAED,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAChC,OAAO,CACL;YACG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAC1B,oBAAC,YAAY,IACX,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,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\";\nimport { PropertyRenderer } from \"./PropertyRender\";\nimport { PropertyView } from \"./PropertyView\";\nimport type { PrimitiveRendererProps } from \"./PrimitivePropertyRenderer\";\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"]}
@@ -1,26 +0,0 @@
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
@@ -1,39 +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 * as React from "react";
6
- import { Orientation } from "@itwin/core-react";
7
- import { PrimitivePropertyLabelRenderer } from "@itwin/components-react";
8
- import { HighlightedText } from "@itwin/components-react/lib/cjs/components-react/common/HighlightedText";
9
- import { PropertyView } from "./PropertyView";
10
- import { CommonPropertyRenderer } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer";
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 { highlight, indentation, ...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, { ...this.props, labelElement: React.createElement(PrimitivePropertyLabelRenderer
33
- // Added offset to account for checkbox
34
- , {
35
- // Added offset to account for checkbox
36
- offset: offset + 24, renderColon: this.props.orientation === Orientation.Horizontal, tooltip: displayLabel }, label) }));
37
- }
38
- }
39
- //# sourceMappingURL=PrimitivePropertyRenderer.js.map
@@ -1 +0,0 @@
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,eAAe,EAAE,MAAM,yEAAyE,CAAC;AAE1G,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8FAA8F,CAAC;AAkBtI;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK,CAAC,SAAiC;IACpF,gBAAgB;IACA,MAAM;;QACpB,MAAM,EAAE,SAAS,EAAE,WAAW,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;aACrC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,0CAAE,yBAAyB,CAAA;YACrD,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,IAAI,CAAC,KAAK,EACd,YAAY,EACV,oBAAC,8BAA8B;YAC7B,uCAAuC;;gBAAvC,uCAAuC;gBACvC,MAAM,EAAE,MAAM,GAAG,EAAE,EACnB,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 { HighlightedText } from \"@itwin/components-react/lib/cjs/components-react/common/HighlightedText\";\n\nimport { PropertyView } from \"./PropertyView\";\nimport type { SharedRendererProps } from \"./PropertyRender\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\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 { highlight, indentation, ...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 {...this.props}\n labelElement={\n <PrimitivePropertyLabelRenderer\n // Added offset to account for checkbox\n offset={offset + 24}\n renderColon={this.props.orientation === Orientation.Horizontal}\n tooltip={displayLabel}\n >\n {label}\n </PrimitivePropertyLabelRenderer>\n }\n />\n );\n }\n}\n"]}
@@ -1,67 +0,0 @@
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("../context/PropertyGridWrapperContext").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
@@ -1,172 +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 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 { PropertyGridWrapperContext } from "../context/PropertyGridWrapperContext";
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: "gmw-components-property-grid-loader" },
142
- React.createElement(ProgressRadial, { indeterminate: true })));
143
- }
144
- return (React.createElement("div", { className: "gmw-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("gmw-components-property-grid-wrapper", this.props.className), style: this.props.style },
146
- React.createElement("div", { className: classnames("gmw-components-property-grid", "components-smallEditor-host") },
147
- 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 }))))),
148
- React.createElement(ResizableContainerObserver, { onResize: this._onResize }))))));
149
- }
150
- }
151
- PropertyGrid.contextType = PropertyGridWrapperContext;
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: "gmw-property-categories" }, props.categorizedRecords.children.map((categorizedChildRecords) => (React.createElement(NestedCategoryBlock, { ...props, key: categorizedChildRecords.category.name, categorizedRecords: categorizedChildRecords }))))) : undefined));
171
- };
172
- //# sourceMappingURL=PropertyGrid.js.map
@@ -1 +0,0 @@
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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AQ,EAC3C,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAC5C,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,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"]}