@itwin/components-react 4.10.0 → 4.11.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 (323) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/lib/cjs/components-react/UiComponents.d.ts +1 -1
  3. package/lib/cjs/components-react/UiComponents.js +2 -4
  4. package/lib/cjs/components-react/UiComponents.js.map +1 -1
  5. package/lib/cjs/components-react/common/DelayedSpinner.js +3 -2
  6. package/lib/cjs/components-react/common/DelayedSpinner.js.map +1 -1
  7. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js +2 -1
  8. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  9. package/lib/cjs/components-react/converters/NumericTypeConverter.js +4 -2
  10. package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
  11. package/lib/cjs/components-react/converters/TypeConverter.js +2 -1
  12. package/lib/cjs/components-react/converters/TypeConverter.js.map +1 -1
  13. package/lib/cjs/components-react/datepicker/DatePicker.d.ts +2 -0
  14. package/lib/cjs/components-react/datepicker/DatePicker.d.ts.map +1 -1
  15. package/lib/cjs/components-react/datepicker/DatePicker.js +43 -40
  16. package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
  17. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.d.ts +5 -2
  18. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.d.ts.map +1 -1
  19. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js +8 -7
  20. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
  21. package/lib/cjs/components-react/datepicker/IntlFormatter.d.ts +1 -0
  22. package/lib/cjs/components-react/datepicker/IntlFormatter.d.ts.map +1 -1
  23. package/lib/cjs/components-react/datepicker/IntlFormatter.js +1 -0
  24. package/lib/cjs/components-react/datepicker/IntlFormatter.js.map +1 -1
  25. package/lib/cjs/components-react/datepicker/TimeField.d.ts.map +1 -1
  26. package/lib/cjs/components-react/datepicker/TimeField.js +28 -30
  27. package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
  28. package/lib/cjs/components-react/editors/CustomNumberEditor.js +8 -6
  29. package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
  30. package/lib/cjs/components-react/editors/DateTimeEditor.js +5 -3
  31. package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
  32. package/lib/cjs/components-react/editors/EnumEditor.d.ts +0 -1
  33. package/lib/cjs/components-react/editors/EnumEditor.d.ts.map +1 -1
  34. package/lib/cjs/components-react/editors/EnumEditor.js +2 -3
  35. package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
  36. package/lib/cjs/components-react/editors/PopupButton.d.ts.map +1 -1
  37. package/lib/cjs/components-react/editors/PopupButton.js +8 -5
  38. package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
  39. package/lib/cjs/components-react/editors/TextEditor.d.ts +0 -1
  40. package/lib/cjs/components-react/editors/TextEditor.d.ts.map +1 -1
  41. package/lib/cjs/components-react/editors/TextEditor.js +5 -4
  42. package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
  43. package/lib/cjs/components-react/editors/TextareaEditor.d.ts +0 -1
  44. package/lib/cjs/components-react/editors/TextareaEditor.d.ts.map +1 -1
  45. package/lib/cjs/components-react/editors/TextareaEditor.js +1 -2
  46. package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
  47. package/lib/cjs/components-react/favorite/FavoritePropertyList.js +3 -3
  48. package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
  49. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.d.ts.map +1 -1
  50. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js +4 -3
  51. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -1
  52. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js +2 -1
  53. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  54. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
  55. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +6 -5
  56. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
  57. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +4 -3
  58. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  59. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js +3 -3
  60. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  61. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.d.ts.map +1 -1
  62. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js +4 -3
  63. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -1
  64. package/lib/cjs/components-react/filtering/FilteringInput.d.ts +0 -3
  65. package/lib/cjs/components-react/filtering/FilteringInput.d.ts.map +1 -1
  66. package/lib/cjs/components-react/filtering/FilteringInput.js +5 -7
  67. package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
  68. package/lib/cjs/components-react/filtering/ResultSelector.d.ts +0 -1
  69. package/lib/cjs/components-react/filtering/ResultSelector.d.ts.map +1 -1
  70. package/lib/cjs/components-react/filtering/ResultSelector.js +1 -2
  71. package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
  72. package/lib/cjs/components-react/properties/ValueRendererManager.d.ts +3 -0
  73. package/lib/cjs/components-react/properties/ValueRendererManager.d.ts.map +1 -1
  74. package/lib/cjs/components-react/properties/ValueRendererManager.js +12 -1
  75. package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
  76. package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js +4 -3
  77. package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  78. package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts +25 -0
  79. package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts.map +1 -0
  80. package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.js +62 -0
  81. package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.js.map +1 -0
  82. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +1 -1
  83. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
  84. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +3 -4
  85. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
  86. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js +6 -44
  87. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  88. package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts +1 -1
  89. package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts.map +1 -1
  90. package/lib/cjs/components-react/properties/renderers/PropertyView.js +2 -3
  91. package/lib/cjs/components-react/properties/renderers/PropertyView.js.map +1 -1
  92. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js +4 -4
  93. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  94. package/lib/cjs/components-react/properties/renderers/value/Common.js +2 -1
  95. package/lib/cjs/components-react/properties/renderers/value/Common.js.map +1 -1
  96. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.d.ts.map +1 -1
  97. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +8 -11
  98. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
  99. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +6 -3
  100. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  101. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +2 -1
  102. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  103. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +2 -1
  104. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  105. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +2 -1
  106. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  107. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js +2 -2
  108. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  109. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts.map +1 -1
  110. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js +1 -3
  111. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
  112. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -3
  113. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
  114. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +90 -80
  115. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  116. package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js +13 -11
  117. package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  118. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
  119. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  120. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +2 -1
  121. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  122. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js +2 -1
  123. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
  124. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +2 -2
  125. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  126. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +3 -2
  127. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  128. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  129. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  130. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +1 -1
  131. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
  132. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +1 -1
  133. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  134. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +22 -12
  135. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  136. package/lib/cjs/components-react/selectable-content/SelectableContent.js +3 -2
  137. package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
  138. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
  139. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +15 -14
  140. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
  141. package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js +6 -5
  142. package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
  143. package/lib/cjs/components-react/tree/controlled/TreeModel.js +8 -7
  144. package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
  145. package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js +8 -6
  146. package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  147. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  148. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js +3 -2
  149. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  150. package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js +2 -1
  151. package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  152. package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js +4 -2
  153. package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  154. package/lib/cjs/components-react/useTranslation.d.ts +10 -0
  155. package/lib/cjs/components-react/useTranslation.d.ts.map +1 -0
  156. package/lib/cjs/components-react/useTranslation.js +20 -0
  157. package/lib/cjs/components-react/useTranslation.js.map +1 -0
  158. package/lib/cjs/components-react.d.ts +1 -0
  159. package/lib/cjs/components-react.d.ts.map +1 -1
  160. package/lib/cjs/components-react.js +1 -0
  161. package/lib/cjs/components-react.js.map +1 -1
  162. package/lib/esm/components-react/UiComponents.d.ts +1 -1
  163. package/lib/esm/components-react/UiComponents.js +2 -4
  164. package/lib/esm/components-react/UiComponents.js.map +1 -1
  165. package/lib/esm/components-react/common/DelayedSpinner.js +3 -2
  166. package/lib/esm/components-react/common/DelayedSpinner.js.map +1 -1
  167. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js +2 -1
  168. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  169. package/lib/esm/components-react/converters/NumericTypeConverter.js +4 -2
  170. package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
  171. package/lib/esm/components-react/converters/TypeConverter.js +2 -1
  172. package/lib/esm/components-react/converters/TypeConverter.js.map +1 -1
  173. package/lib/esm/components-react/datepicker/DatePicker.d.ts +2 -0
  174. package/lib/esm/components-react/datepicker/DatePicker.d.ts.map +1 -1
  175. package/lib/esm/components-react/datepicker/DatePicker.js +43 -40
  176. package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
  177. package/lib/esm/components-react/datepicker/DatePickerPopupButton.d.ts +5 -2
  178. package/lib/esm/components-react/datepicker/DatePickerPopupButton.d.ts.map +1 -1
  179. package/lib/esm/components-react/datepicker/DatePickerPopupButton.js +8 -7
  180. package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
  181. package/lib/esm/components-react/datepicker/IntlFormatter.d.ts +1 -0
  182. package/lib/esm/components-react/datepicker/IntlFormatter.d.ts.map +1 -1
  183. package/lib/esm/components-react/datepicker/IntlFormatter.js +1 -0
  184. package/lib/esm/components-react/datepicker/IntlFormatter.js.map +1 -1
  185. package/lib/esm/components-react/datepicker/TimeField.d.ts.map +1 -1
  186. package/lib/esm/components-react/datepicker/TimeField.js +28 -30
  187. package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
  188. package/lib/esm/components-react/editors/CustomNumberEditor.js +8 -6
  189. package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
  190. package/lib/esm/components-react/editors/DateTimeEditor.js +5 -3
  191. package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
  192. package/lib/esm/components-react/editors/EnumEditor.d.ts +0 -1
  193. package/lib/esm/components-react/editors/EnumEditor.d.ts.map +1 -1
  194. package/lib/esm/components-react/editors/EnumEditor.js +2 -3
  195. package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
  196. package/lib/esm/components-react/editors/PopupButton.d.ts.map +1 -1
  197. package/lib/esm/components-react/editors/PopupButton.js +9 -6
  198. package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
  199. package/lib/esm/components-react/editors/TextEditor.d.ts +0 -1
  200. package/lib/esm/components-react/editors/TextEditor.d.ts.map +1 -1
  201. package/lib/esm/components-react/editors/TextEditor.js +5 -4
  202. package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
  203. package/lib/esm/components-react/editors/TextareaEditor.d.ts +0 -1
  204. package/lib/esm/components-react/editors/TextareaEditor.d.ts.map +1 -1
  205. package/lib/esm/components-react/editors/TextareaEditor.js +1 -2
  206. package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
  207. package/lib/esm/components-react/favorite/FavoritePropertyList.js +3 -3
  208. package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
  209. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.d.ts.map +1 -1
  210. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js +4 -3
  211. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -1
  212. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js +2 -1
  213. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  214. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
  215. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +6 -5
  216. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
  217. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +4 -3
  218. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  219. package/lib/esm/components-react/filter-builder/FilterBuilderState.js +3 -3
  220. package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  221. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.d.ts.map +1 -1
  222. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js +4 -3
  223. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -1
  224. package/lib/esm/components-react/filtering/FilteringInput.d.ts +0 -3
  225. package/lib/esm/components-react/filtering/FilteringInput.d.ts.map +1 -1
  226. package/lib/esm/components-react/filtering/FilteringInput.js +6 -8
  227. package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
  228. package/lib/esm/components-react/filtering/ResultSelector.d.ts +0 -1
  229. package/lib/esm/components-react/filtering/ResultSelector.d.ts.map +1 -1
  230. package/lib/esm/components-react/filtering/ResultSelector.js +1 -2
  231. package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
  232. package/lib/esm/components-react/properties/ValueRendererManager.d.ts +3 -0
  233. package/lib/esm/components-react/properties/ValueRendererManager.d.ts.map +1 -1
  234. package/lib/esm/components-react/properties/ValueRendererManager.js +12 -1
  235. package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
  236. package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js +4 -3
  237. package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  238. package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts +25 -0
  239. package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts.map +1 -0
  240. package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.js +35 -0
  241. package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.js.map +1 -0
  242. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +1 -1
  243. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
  244. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +3 -4
  245. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
  246. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js +3 -21
  247. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  248. package/lib/esm/components-react/properties/renderers/PropertyView.d.ts +1 -1
  249. package/lib/esm/components-react/properties/renderers/PropertyView.d.ts.map +1 -1
  250. package/lib/esm/components-react/properties/renderers/PropertyView.js +2 -3
  251. package/lib/esm/components-react/properties/renderers/PropertyView.js.map +1 -1
  252. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js +4 -4
  253. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  254. package/lib/esm/components-react/properties/renderers/value/Common.js +2 -1
  255. package/lib/esm/components-react/properties/renderers/value/Common.js.map +1 -1
  256. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.d.ts.map +1 -1
  257. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +8 -11
  258. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
  259. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +6 -3
  260. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  261. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +2 -1
  262. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  263. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +2 -1
  264. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  265. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +2 -1
  266. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  267. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js +2 -2
  268. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  269. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts.map +1 -1
  270. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js +1 -3
  271. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
  272. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -3
  273. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
  274. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +90 -80
  275. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  276. package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js +13 -11
  277. package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  278. package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
  279. package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  280. package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +2 -1
  281. package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  282. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js +2 -1
  283. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
  284. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +2 -2
  285. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  286. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +3 -2
  287. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  288. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  289. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  290. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +1 -1
  291. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
  292. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +1 -1
  293. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  294. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +22 -12
  295. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  296. package/lib/esm/components-react/selectable-content/SelectableContent.js +3 -2
  297. package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
  298. package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
  299. package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +15 -14
  300. package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
  301. package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js +6 -5
  302. package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
  303. package/lib/esm/components-react/tree/controlled/TreeModel.js +8 -7
  304. package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
  305. package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js +8 -6
  306. package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  307. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  308. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js +3 -2
  309. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  310. package/lib/esm/components-react/tree/controlled/internal/SparseTree.js +2 -1
  311. package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  312. package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js +4 -2
  313. package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  314. package/lib/esm/components-react/useTranslation.d.ts +10 -0
  315. package/lib/esm/components-react/useTranslation.d.ts.map +1 -0
  316. package/lib/esm/components-react/useTranslation.js +16 -0
  317. package/lib/esm/components-react/useTranslation.js.map +1 -0
  318. package/lib/esm/components-react.d.ts +1 -0
  319. package/lib/esm/components-react.d.ts.map +1 -1
  320. package/lib/esm/components-react.js +1 -0
  321. package/lib/esm/components-react.js.map +1 -1
  322. package/lib/public/locales/en/UiComponents.json +7 -1
  323. package/package.json +4 -4
@@ -35,7 +35,7 @@ export class CommonPropertyRenderer {
35
35
  return currentSize - minColumnLabelWidth;
36
36
  }
37
37
  static createNewDisplayValue(orientation, propertyRecord, indentation, propertyValueRendererManager, isExpanded, onExpansionToggled, onHeightChanged, highlight) {
38
- const highlightCallback = highlight?.applyOnValue
38
+ const highlightCallback = (highlight === null || highlight === void 0 ? void 0 : highlight.applyOnValue)
39
39
  ? CommonPropertyRenderer.createHighlightCallback(highlight, propertyRecord)
40
40
  : undefined;
41
41
  const rendererContext = {
@@ -59,9 +59,10 @@ export class CommonPropertyRenderer {
59
59
  return displayValue;
60
60
  }
61
61
  static createHighlightCallback(highlight, propertyRecord) {
62
+ var _a;
62
63
  const activeMatch = highlight.activeHighlight;
63
- const propertyName = activeMatch?.highlightedItemIdentifier;
64
- const matchIndex = activeMatch?.highlightIndex ?? 0;
64
+ const propertyName = activeMatch === null || activeMatch === void 0 ? void 0 : activeMatch.highlightedItemIdentifier;
65
+ const matchIndex = (_a = activeMatch === null || activeMatch === void 0 ? void 0 : activeMatch.highlightIndex) !== null && _a !== void 0 ? _a : 0;
65
66
  let labelMatches;
66
67
  if (highlight.applyOnLabel) {
67
68
  labelMatches = countMatchesInString(propertyRecord.property.displayLabel.toLowerCase(), highlight.highlightedText);
@@ -1 +1 @@
1
- {"version":3,"file":"CommonPropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/CommonPropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EACL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAC1B,MAAM,CAAC,cAAc,CAC1B,WAAoB,EACpB,WAAyB,E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,CAAC,eAAe,GACrC,CACH,CAAC;QAEF,OAAO,iBAAiB,CAAC;IAC3B,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { countMatchesInString } from \"../../common/countMatchesInString\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport type { PropertyValueRendererContext } from \"../ValueRendererManager\";\nimport {\n PropertyContainerType,\n PropertyValueRendererManager,\n} from \"../ValueRendererManager\";\n\n/**\n * @internal\n */\nexport class CommonPropertyRenderer {\n public static getLabelOffset(\n indentation?: number,\n orientation?: Orientation,\n width?: number,\n columnRatio?: number,\n minColumnLabelWidth?: number\n ): number {\n if (!indentation) return 0;\n\n const maxIndent = 17;\n const minIndent = 6;\n if (\n orientation !== Orientation.Horizontal ||\n !width ||\n !columnRatio ||\n !minColumnLabelWidth\n )\n return indentation * maxIndent;\n\n const currentSize = Math.ceil(width * columnRatio);\n const shrinkThreshold = minColumnLabelWidth + maxIndent * indentation;\n if (currentSize >= shrinkThreshold) return indentation * maxIndent;\n\n const minShrink =\n minColumnLabelWidth + minIndent + maxIndent * (indentation - 1);\n if (currentSize <= minShrink)\n return (\n minIndent +\n this.getLabelOffset(\n indentation - 1,\n orientation,\n width,\n columnRatio,\n minColumnLabelWidth\n )\n );\n\n return currentSize - minColumnLabelWidth;\n }\n\n public static 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 & {\n applyOnLabel: boolean;\n applyOnValue: boolean;\n }\n ) {\n const highlightCallback = highlight?.applyOnValue\n ? CommonPropertyRenderer.createHighlightCallback(\n highlight,\n propertyRecord\n )\n : 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(\n propertyRecord,\n rendererContext\n );\n else\n displayValue = PropertyValueRendererManager.defaultManager.render(\n propertyRecord,\n rendererContext\n );\n\n // Align value with label if orientation is vertical\n if (orientation === Orientation.Vertical)\n displayValue = (\n <span\n style={{\n paddingLeft: CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation\n ),\n }}\n >\n {displayValue}\n </span>\n );\n\n return displayValue;\n }\n\n private static createHighlightCallback(\n highlight: HighlightingComponentProps & { applyOnLabel: boolean },\n propertyRecord: PropertyRecord\n ) {\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(\n propertyRecord.property.displayLabel.toLowerCase(),\n highlight.highlightedText\n );\n } else {\n labelMatches = 0;\n }\n\n const activeMatchIndex =\n propertyRecord.property.name === propertyName &&\n matchIndex - labelMatches >= 0\n ? matchIndex - labelMatches\n : undefined;\n const highlightCallback = (text: string) => (\n <HighlightedText\n text={text}\n activeMatchIndex={activeMatchIndex}\n searchText={highlight.highlightedText}\n />\n );\n\n return highlightCallback;\n }\n}\n"]}
1
+ {"version":3,"file":"CommonPropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/CommonPropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;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EAClD,SAAS,CAAC,eAAe,CAC1B,CAAC;SACH;aAAM;YACL,YAAY,GAAG,CAAC,CAAC;SAClB;QAED,MAAM,gBAAgB,GACpB,cAAc,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY;YAC7C,UAAU,GAAG,YAAY,IAAI,CAAC;YAC5B,CAAC,CAAC,UAAU,GAAG,YAAY;YAC3B,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAC1C,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,SAAS,CAAC,eAAe,GACrC,CACH,CAAC;QAEF,OAAO,iBAAiB,CAAC;IAC3B,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { countMatchesInString } from \"../../common/countMatchesInString\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport type { PropertyValueRendererContext } from \"../ValueRendererManager\";\nimport {\n PropertyContainerType,\n PropertyValueRendererManager,\n} from \"../ValueRendererManager\";\n\n/**\n * @internal\n */\nexport class CommonPropertyRenderer {\n public static getLabelOffset(\n indentation?: number,\n orientation?: Orientation,\n width?: number,\n columnRatio?: number,\n minColumnLabelWidth?: number\n ): number {\n if (!indentation) return 0;\n\n const maxIndent = 17;\n const minIndent = 6;\n if (\n orientation !== Orientation.Horizontal ||\n !width ||\n !columnRatio ||\n !minColumnLabelWidth\n )\n return indentation * maxIndent;\n\n const currentSize = Math.ceil(width * columnRatio);\n const shrinkThreshold = minColumnLabelWidth + maxIndent * indentation;\n if (currentSize >= shrinkThreshold) return indentation * maxIndent;\n\n const minShrink =\n minColumnLabelWidth + minIndent + maxIndent * (indentation - 1);\n if (currentSize <= minShrink)\n return (\n minIndent +\n this.getLabelOffset(\n indentation - 1,\n orientation,\n width,\n columnRatio,\n minColumnLabelWidth\n )\n );\n\n return currentSize - minColumnLabelWidth;\n }\n\n public static 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 & {\n applyOnLabel: boolean;\n applyOnValue: boolean;\n }\n ) {\n const highlightCallback = highlight?.applyOnValue\n ? CommonPropertyRenderer.createHighlightCallback(\n highlight,\n propertyRecord\n )\n : 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(\n propertyRecord,\n rendererContext\n );\n else\n displayValue = PropertyValueRendererManager.defaultManager.render(\n propertyRecord,\n rendererContext\n );\n\n // Align value with label if orientation is vertical\n if (orientation === Orientation.Vertical)\n displayValue = (\n <span\n style={{\n paddingLeft: CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation\n ),\n }}\n >\n {displayValue}\n </span>\n );\n\n return displayValue;\n }\n\n private static createHighlightCallback(\n highlight: HighlightingComponentProps & { applyOnLabel: boolean },\n propertyRecord: PropertyRecord\n ) {\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(\n propertyRecord.property.displayLabel.toLowerCase(),\n highlight.highlightedText\n );\n } else {\n labelMatches = 0;\n }\n\n const activeMatchIndex =\n propertyRecord.property.name === propertyName &&\n matchIndex - labelMatches >= 0\n ? matchIndex - labelMatches\n : undefined;\n const highlightCallback = (text: string) => (\n <HighlightedText\n text={text}\n activeMatchIndex={activeMatchIndex}\n searchText={highlight.highlightedText}\n />\n );\n\n return highlightCallback;\n }\n}\n"]}
@@ -0,0 +1,25 @@
1
+ /** @packageDocumentation
2
+ * @module Properties
3
+ */
4
+ import * as React from "react";
5
+ import type { HighlightingComponentProps } from "../../common/HighlightingComponentProps";
6
+ import type { SharedRendererProps } from "./PropertyRenderer";
7
+ /** Properties of [[CustomizablePropertyRenderer]] React component
8
+ * @public
9
+ */
10
+ interface CustomizablePropertyRendererProps extends SharedRendererProps {
11
+ /** Property value as a React element */
12
+ valueElement?: React.ReactNode;
13
+ /** Render callback for property value. If specified, `valueElement` is ignored */
14
+ valueElementRenderer?: () => React.ReactNode;
15
+ /** Multiplier of how much the property is indented to the right */
16
+ indentation?: number;
17
+ /** Properties used for highlighting */
18
+ highlight?: HighlightingComponentProps;
19
+ }
20
+ /** React Component that renders customizable properties
21
+ * @public
22
+ */
23
+ export declare function CustomizablePropertyRenderer(props: CustomizablePropertyRendererProps): React.JSX.Element;
24
+ export {};
25
+ //# sourceMappingURL=CustomizablePropertyRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomizablePropertyRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/CustomizablePropertyRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAG1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D;;GAEG;AACH,UAAU,iCAAkC,SAAQ,mBAAmB;IACrE,wCAAwC;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC7C,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,SAAS,CAAC,EAAE,0BAA0B,CAAC;CACxC;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,iCAAiC,qBAuCzC"}
@@ -0,0 +1,35 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Properties
7
+ */
8
+ import * as React from "react";
9
+ import { Orientation } from "@itwin/core-react";
10
+ import { HighlightedText } from "../../common/HighlightedText";
11
+ import { CommonPropertyRenderer } from "./CommonPropertyRenderer";
12
+ import { PrimitivePropertyLabelRenderer } from "./label/PrimitivePropertyLabelRenderer";
13
+ import { PropertyView } from "./PropertyView";
14
+ /** React Component that renders customizable properties
15
+ * @public
16
+ */
17
+ export function CustomizablePropertyRenderer(props) {
18
+ var _a, _b;
19
+ const { indentation, highlight, ...passthroughProps } = props;
20
+ const displayLabel = props.propertyRecord.property.displayLabel;
21
+ const offset = CommonPropertyRenderer.getLabelOffset(indentation, passthroughProps.orientation, passthroughProps.width, passthroughProps.columnRatio, (_a = passthroughProps.columnInfo) === null || _a === void 0 ? void 0 : _a.minLabelWidth);
22
+ const activeMatchIndex = props.propertyRecord.property.name ===
23
+ ((_b = highlight === null || highlight === void 0 ? void 0 : highlight.activeHighlight) === null || _b === void 0 ? void 0 : _b.highlightedItemIdentifier)
24
+ ? highlight.activeHighlight.highlightIndex
25
+ : undefined;
26
+ const label = highlight
27
+ ? HighlightedText({
28
+ text: displayLabel,
29
+ searchText: highlight.highlightedText,
30
+ activeMatchIndex,
31
+ })
32
+ : displayLabel;
33
+ return (React.createElement(PropertyView, { ...passthroughProps, labelElement: React.createElement(PrimitivePropertyLabelRenderer, { offset: offset, renderColon: props.orientation === Orientation.Horizontal, tooltip: displayLabel }, label) }));
34
+ }
35
+ //# sourceMappingURL=CustomizablePropertyRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomizablePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/CustomizablePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAgB9C;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,KAAwC;;IAExC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAC9D,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IAChE,MAAM,MAAM,GAAG,sBAAsB,CAAC,cAAc,CAClD,WAAW,EACX,gBAAgB,CAAC,WAAW,EAC5B,gBAAgB,CAAC,KAAK,EACtB,gBAAgB,CAAC,WAAW,EAC5B,MAAA,gBAAgB,CAAC,UAAU,0CAAE,aAAa,CAC3C,CAAC;IAEF,MAAM,gBAAgB,GACpB,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI;SAClC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,0CAAE,yBAAyB,CAAA;QACnD,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,cAAc;QAC1C,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,KAAK,GAAG,SAAS;QACrB,CAAC,CAAC,eAAe,CAAC;YACd,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE,SAAS,CAAC,eAAe;YACrC,gBAAgB;SACjB,CAAC;QACJ,CAAC,CAAC,YAAY,CAAC;IAEjB,OAAO,CACL,oBAAC,YAAY,OACP,gBAAgB,EACpB,YAAY,EACV,oBAAC,8BAA8B,IAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,UAAU,EACzD,OAAO,EAAE,YAAY,IAEpB,KAAK,CACyB,GAEnC,CACH,CAAC;AACJ,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { CommonPropertyRenderer } from \"./CommonPropertyRenderer\";\nimport { PrimitivePropertyLabelRenderer } from \"./label/PrimitivePropertyLabelRenderer\";\nimport type { SharedRendererProps } from \"./PropertyRenderer\";\nimport { PropertyView } from \"./PropertyView\";\n\n/** Properties of [[CustomizablePropertyRenderer]] React component\n * @public\n */\ninterface CustomizablePropertyRendererProps 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 highlight?: HighlightingComponentProps;\n}\n\n/** React Component that renders customizable properties\n * @public\n */\nexport function CustomizablePropertyRenderer(\n props: CustomizablePropertyRendererProps\n) {\n const { indentation, highlight, ...passthroughProps } = props;\n const displayLabel = props.propertyRecord.property.displayLabel;\n const offset = CommonPropertyRenderer.getLabelOffset(\n indentation,\n passthroughProps.orientation,\n passthroughProps.width,\n passthroughProps.columnRatio,\n passthroughProps.columnInfo?.minLabelWidth\n );\n\n const activeMatchIndex =\n 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 {...passthroughProps}\n labelElement={\n <PrimitivePropertyLabelRenderer\n offset={offset}\n renderColon={props.orientation === Orientation.Horizontal}\n tooltip={displayLabel}\n >\n {label}\n </PrimitivePropertyLabelRenderer>\n }\n />\n );\n}\n"]}
@@ -40,7 +40,7 @@ export class NonPrimitivePropertyRenderer extends React.Component {
40
40
  getLabel(props, state) {
41
41
  const { orientation, indentation, width, columnRatio, columnInfo } = props;
42
42
  // istanbul ignore next
43
- const minLabelWidth = columnInfo?.minLabelWidth;
43
+ const minLabelWidth = columnInfo === null || columnInfo === void 0 ? void 0 : columnInfo.minLabelWidth;
44
44
  const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, minLabelWidth);
45
45
  let displayLabel = props.propertyRecord.property.displayLabel;
46
46
  if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array)
@@ -1 +1 @@
1
- {"version":3,"file":"NonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/NonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iCAAiC,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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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport \"./NonPrimitivePropertyRenderer.scss\";\nimport * as React from \"react\";\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { CommonPropertyRenderer } from \"./CommonPropertyRenderer\";\nimport { NonPrimitivePropertyLabelRenderer } from \"./label/NonPrimitivePropertyLabelRenderer\";\nimport type { PrimitiveRendererProps } from \"./PrimitivePropertyRenderer\";\nimport { PropertyRenderer } from \"./PropertyRenderer\";\nimport { PropertyView } from \"./PropertyView\";\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<\n NonPrimitivePropertyRendererProps,\n NonPrimitivePropertyRendererState\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 constructor(props: NonPrimitivePropertyRendererProps) {\n super(props);\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 // istanbul ignore next\n const minLabelWidth = columnInfo?.minLabelWidth;\n const offset = CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation,\n width,\n columnRatio,\n 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 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 const { indentation, ...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
+ {"version":3,"file":"NonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/NonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAmB9C;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK,CAAC,SAGvD;IAQC,YAAY,KAAwC;QAClD,KAAK,CAAC,KAAK,CAAC,CAAC;QARf,gBAAgB;QACS,UAAK,GAAsC;YAClE,0FAA0F;YAC1F,UAAU,EACR,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU;SACpE,CAAC;QAMM,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,CAAC,CAAC;QAEM,iBAAY,GAAG,GAAG,EAAE;YAC1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C;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;YAEzE,KAAK,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;QAEjD,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7C,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport \"./NonPrimitivePropertyRenderer.scss\";\nimport * as React from \"react\";\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { CommonPropertyRenderer } from \"./CommonPropertyRenderer\";\nimport { NonPrimitivePropertyLabelRenderer } from \"./label/NonPrimitivePropertyLabelRenderer\";\nimport type { PrimitiveRendererProps } from \"./PrimitivePropertyRenderer\";\nimport { PropertyRenderer } from \"./PropertyRenderer\";\nimport { PropertyView } from \"./PropertyView\";\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<\n NonPrimitivePropertyRendererProps,\n NonPrimitivePropertyRendererState\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 constructor(props: NonPrimitivePropertyRendererProps) {\n super(props);\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 // istanbul ignore next\n const minLabelWidth = columnInfo?.minLabelWidth;\n const offset = CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation,\n width,\n columnRatio,\n 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 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 const { indentation, ...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,21 +1,20 @@
1
1
  /** @packageDocumentation
2
2
  * @module Properties
3
3
  */
4
- import * as React from "react";
5
4
  import type { HighlightingComponentProps } from "../../common/HighlightingComponentProps";
6
5
  import type { SharedRendererProps } from "./PropertyRenderer";
6
+ import React from "react";
7
7
  /** Properties of [[PrimitivePropertyRenderer]] React component
8
8
  * @public
9
9
  */
10
10
  export interface PrimitiveRendererProps extends SharedRendererProps {
11
11
  /** Property value as a React element */
12
12
  valueElement?: React.ReactNode;
13
- /** Render callback for property value. If specified, `valueElement` is ignored. */
13
+ /** Render callback for property value. If specified, `valueElement` is ignored */
14
14
  valueElementRenderer?: () => React.ReactNode;
15
15
  /** Multiplier of how much the property is indented to the right */
16
16
  indentation?: number;
17
- /** Properties used for highlighting
18
- */
17
+ /** Properties used for highlighting */
19
18
  highlight?: HighlightingComponentProps;
20
19
  }
21
20
  /** React Component that renders primitive properties
@@ -1 +1 @@
1
- {"version":3,"file":"PrimitivePropertyRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAG1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,wCAAwC;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,mFAAmF;IACnF,oBAAoB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC7C,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;OACG;IACH,SAAS,CAAC,EAAE,0BAA0B,CAAC;CACxC;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC;gBACxE,KAAK,EAAE,sBAAsB;IAIzC,gBAAgB;IACA,MAAM;CAuCvB"}
1
+ {"version":3,"file":"PrimitivePropertyRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,wCAAwC;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC7C,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,SAAS,CAAC,EAAE,0BAA0B,CAAC;CACxC;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC;gBACxE,KAAK,EAAE,sBAAsB;IAIzC,gBAAgB;IACA,MAAM;CAGvB"}
@@ -5,12 +5,8 @@
5
5
  /** @packageDocumentation
6
6
  * @module Properties
7
7
  */
8
- import * as React from "react";
9
- import { Orientation } from "@itwin/core-react";
10
- import { HighlightedText } from "../../common/HighlightedText";
11
- import { CommonPropertyRenderer } from "./CommonPropertyRenderer";
12
- import { PrimitivePropertyLabelRenderer } from "./label/PrimitivePropertyLabelRenderer";
13
- import { PropertyView } from "./PropertyView";
8
+ import { CustomizablePropertyRenderer } from "./CustomizablePropertyRenderer";
9
+ import React from "react";
14
10
  /** React Component that renders primitive properties
15
11
  * @public
16
12
  */
@@ -20,21 +16,7 @@ export class PrimitivePropertyRenderer extends React.Component {
20
16
  }
21
17
  /** @internal */
22
18
  render() {
23
- const { indentation, highlight, ...props } = this.props;
24
- const displayLabel = this.props.propertyRecord.property.displayLabel;
25
- const offset = CommonPropertyRenderer.getLabelOffset(indentation, props.orientation, props.width, props.columnRatio, props.columnInfo?.minLabelWidth);
26
- const activeMatchIndex = this.props.propertyRecord.property.name ===
27
- highlight?.activeHighlight?.highlightedItemIdentifier
28
- ? highlight.activeHighlight.highlightIndex
29
- : undefined;
30
- const label = highlight
31
- ? HighlightedText({
32
- text: displayLabel,
33
- searchText: highlight.highlightedText,
34
- activeMatchIndex,
35
- })
36
- : displayLabel;
37
- return (React.createElement(PropertyView, { ...props, labelElement: React.createElement(PrimitivePropertyLabelRenderer, { offset: offset, renderColon: this.props.orientation === Orientation.Horizontal, tooltip: displayLabel }, label) }));
19
+ return React.createElement(CustomizablePropertyRenderer, { ...this.props });
38
20
  }
39
21
  }
40
22
  //# sourceMappingURL=PrimitivePropertyRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiB9C;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK,CAAC,SAAiC;IACpF,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACxD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;QACrE,MAAM,MAAM,GAAG,sBAAsB,CAAC,cAAc,CAClD,WAAW,EACX,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,UAAU,EAAE,aAAa,CAChC,CAAC;QAEF,MAAM,gBAAgB,GACpB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI;YACvC,SAAS,EAAE,eAAe,EAAE,yBAAyB;YACnD,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,cAAc;YAC1C,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,KAAK,GAAG,SAAS;YACrB,CAAC,CAAC,eAAe,CAAC;gBACd,IAAI,EAAE,YAAY;gBAClB,UAAU,EAAE,SAAS,CAAC,eAAe;gBACrC,gBAAgB;aACjB,CAAC;YACJ,CAAC,CAAC,YAAY,CAAC;QAEjB,OAAO,CACL,oBAAC,YAAY,OACP,KAAK,EACT,YAAY,EACV,oBAAC,8BAA8B,IAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,UAAU,EAC9D,OAAO,EAAE,YAAY,IAEpB,KAAK,CACyB,GAEnC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { CommonPropertyRenderer } from \"./CommonPropertyRenderer\";\nimport { PrimitivePropertyLabelRenderer } from \"./label/PrimitivePropertyLabelRenderer\";\nimport type { SharedRendererProps } from \"./PropertyRenderer\";\nimport { PropertyView } from \"./PropertyView\";\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 */\n highlight?: HighlightingComponentProps;\n}\n\n/** React Component that renders primitive properties\n * @public\n */\nexport class PrimitivePropertyRenderer extends React.Component<PrimitiveRendererProps> {\n constructor(props: PrimitiveRendererProps) {\n super(props);\n }\n\n /** @internal */\n public override render() {\n const { indentation, highlight, ...props } = this.props;\n const displayLabel = this.props.propertyRecord.property.displayLabel;\n const offset = CommonPropertyRenderer.getLabelOffset(\n indentation,\n props.orientation,\n props.width,\n props.columnRatio,\n props.columnInfo?.minLabelWidth\n );\n\n const activeMatchIndex =\n this.props.propertyRecord.property.name ===\n highlight?.activeHighlight?.highlightedItemIdentifier\n ? highlight.activeHighlight.highlightIndex\n : undefined;\n const label = highlight\n ? HighlightedText({\n text: displayLabel,\n searchText: highlight.highlightedText,\n activeMatchIndex,\n })\n : displayLabel;\n\n return (\n <PropertyView\n {...props}\n labelElement={\n <PrimitivePropertyLabelRenderer\n offset={offset}\n renderColon={this.props.orientation === Orientation.Horizontal}\n tooltip={displayLabel}\n >\n {label}\n </PrimitivePropertyLabelRenderer>\n }\n />\n );\n }\n}\n"]}
1
+ {"version":3,"file":"PrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK,CAAC,SAAiC;IACpF,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,OAAO,oBAAC,4BAA4B,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;IAC1D,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport type { SharedRendererProps } from \"./PropertyRenderer\";\nimport { CustomizablePropertyRenderer } from \"./CustomizablePropertyRenderer\";\nimport React from \"react\";\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 highlight?: HighlightingComponentProps;\n}\n\n/** React Component that renders primitive properties\n * @public\n */\nexport class PrimitivePropertyRenderer extends React.Component<PrimitiveRendererProps> {\n constructor(props: PrimitiveRendererProps) {\n super(props);\n }\n\n /** @internal */\n public override render() {\n return <CustomizablePropertyRenderer {...this.props} />;\n }\n}\n"]}
@@ -12,7 +12,7 @@ export interface PropertyViewProps extends SharedRendererProps {
12
12
  labelElement: React.ReactNode;
13
13
  /** Property value as a React element */
14
14
  valueElement?: React.ReactNode;
15
- /** Render callback for property value. If specified, `valueElement` is ignored. */
15
+ /** Render callback for property value. If specified, `valueElement` is ignored */
16
16
  valueElementRenderer?: () => React.ReactNode;
17
17
  }
18
18
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyView.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PropertyView.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,wCAAwC;IACxC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wCAAwC;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,mFAAmF;IACnF,oBAAoB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC9C;AAED,gBAAgB;AAChB,UAAU,iBAAiB;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAC/C,iBAAiB,EACjB,iBAAiB,CAClB;gBACa,KAAK,EAAE,iBAAiB;IAOpC,OAAO,CAAC,QAAQ,CAGd;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,cAAc,CAOpB;IAEF,OAAO,CAAC,YAAY;IAWpB,gBAAgB;IACA,MAAM;CA6DvB"}
1
+ {"version":3,"file":"PropertyView.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PropertyView.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,wCAAwC;IACxC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wCAAwC;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC9C;AAED,gBAAgB;AAChB,UAAU,iBAAiB;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAC/C,iBAAiB,EACjB,iBAAiB,CAClB;gBACa,KAAK,EAAE,iBAAiB;IAOpC,OAAO,CAAC,QAAQ,CAGd;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,cAAc,CAOpB;IAEF,OAAO,CAAC,YAAY;IAWpB,gBAAgB;IACA,MAAM;CA+DvB"}
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import "./PropertyView.scss";
9
9
  import * as React from "react";
10
- import { PropertyValueFormat } from "@itwin/appui-abstract";
11
10
  import { ElementSeparator, Orientation } from "@itwin/core-react";
12
11
  import { ActionButtonList } from "./ActionButtonList";
13
12
  import { PropertyGridColumnStyleProvider } from "./PropertyGridColumns";
@@ -61,11 +60,11 @@ export class PropertyView extends React.Component {
61
60
  !!this.props.onColumnRatioChanged;
62
61
  const needActionButtons = !!this.props.actionButtonRenderers;
63
62
  const columnsStyleProvider = new PropertyGridColumnStyleProvider(this.props.columnInfo);
63
+ const renderValueElement = !!(this.props.valueElement || this.props.valueElementRenderer);
64
64
  return (React.createElement("div", { style: columnsStyleProvider.getStyle(this.props.orientation, needActionButtons, ratio, needElementSeparator), className: this.getClassName(this.props), onClick: this._onClick, onContextMenu: this._onContextMenu, onMouseEnter: this._onMouseEnter, onMouseLeave: this._onMouseLeave, role: "presentation" },
65
65
  React.createElement("div", { className: "components-property-record-label" }, this.props.labelElement),
66
66
  needElementSeparator ? (React.createElement(ElementSeparator, { movableArea: this.props.width, onRatioChanged: this.props.onColumnRatioChanged, ratio: ratio, orientation: this.props.orientation, isResizeHandleHovered: this.props.isResizeHandleHovered, onResizeHandleHoverChanged: this.props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: this.props.isResizeHandleBeingDragged, onResizeHandleDragChanged: this.props.onResizeHandleDragChanged })) : undefined,
67
- this.props.propertyRecord.value.valueFormat ===
68
- PropertyValueFormat.Primitive ? (React.createElement("div", { className: "components-property-record-value" },
67
+ renderValueElement ? (React.createElement("div", { className: "components-property-record-value" },
69
68
  React.createElement("span", null, this.props.valueElementRenderer
70
69
  ? this.props.valueElementRenderer()
71
70
  : this.props.valueElement))) : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyView.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PropertyView.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAoBxE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAGvC;IACC,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QAMP,aAAQ,GAAG,GAAG,EAAE;YACtB,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO;gBACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACxE,CAAC,CAAC;QAEM,kBAAa,GAAG,GAAG,EAAE;YAC3B,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW;gBAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,CAAC,CAAC;QAEM,kBAAa,GAAG,GAAG,EAAE;YAC3B,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW;gBAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAClE,CAAC,CAAC;QAEM,mBAAc,GAAG,C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AAC,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;oBACnC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CACtB,CACH,CACP,CAAC,CAAC,CAAC,SAAS;YACZ,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAClC,oBAAC,gBAAgB,IACf,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACnC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EACvC,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,GACvD,CACH,CAAC,CAAC,CAAC,SAAS,CACT,CACP,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport \"./PropertyView.scss\";\nimport * as React from \"react\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { ElementSeparator, Orientation } from \"@itwin/core-react\";\nimport { ActionButtonList } from \"./ActionButtonList\";\nimport { PropertyGridColumnStyleProvider } from \"./PropertyGridColumns\";\nimport type { SharedRendererProps } from \"./PropertyRenderer\";\n\n/** Properties of [[PropertyView]] React component\n * @public\n */\nexport interface PropertyViewProps extends SharedRendererProps {\n /** Property label as a React element */\n labelElement: React.ReactNode;\n /** Property value as a React element */\n valueElement?: React.ReactNode;\n /** Render callback for property value. If specified, `valueElement` is ignored. */\n valueElementRenderer?: () => React.ReactNode;\n}\n\n/** @internal */\ninterface PropertyViewState {\n isHovered: boolean;\n}\n\n/**\n * A React component that renders property as label/value pair\n * @public\n */\nexport class PropertyView extends React.Component<\n PropertyViewProps,\n PropertyViewState\n> {\n constructor(props: PropertyViewProps) {\n super(props);\n this.state = {\n isHovered: false,\n };\n }\n\n private _onClick = () => {\n if (this.props.onClick)\n this.props.onClick(this.props.propertyRecord, this.props.uniqueKey);\n };\n\n private _onMouseEnter = () => {\n if (this.props.isHoverable) this.setState({ isHovered: true });\n };\n\n private _onMouseLeave = () => {\n if (this.props.isHoverable) this.setState({ isHovered: false });\n };\n\n private _onContextMenu = (e: React.MouseEvent) => {\n if (this.props.onContextMenu)\n this.props.onContextMenu(this.props.propertyRecord, e);\n if (this.props.onRightClick)\n this.props.onRightClick(this.props.propertyRecord, this.props.uniqueKey);\n e.preventDefault();\n return false;\n };\n\n private getClassName(props: PropertyViewProps) {\n let propertyRecordClassName =\n props.orientation === Orientation.Horizontal\n ? \"components-property-record--horizontal\"\n : \"components-property-record--vertical\";\n if (props.isSelected) propertyRecordClassName += \" components--selected\";\n if (props.onClick) propertyRecordClassName += \" components--clickable\";\n if (props.isHoverable) propertyRecordClassName += \" components--hoverable\";\n return propertyRecordClassName;\n }\n\n /** @internal */\n public override render() {\n const ratio = this.props.columnRatio ? this.props.columnRatio : 0.25;\n const needElementSeparator =\n this.props.orientation === Orientation.Horizontal &&\n !!this.props.onColumnRatioChanged;\n const needActionButtons = !!this.props.actionButtonRenderers;\n const columnsStyleProvider = new PropertyGridColumnStyleProvider(\n this.props.columnInfo\n );\n\n return (\n <div\n style={columnsStyleProvider.getStyle(\n this.props.orientation,\n needActionButtons,\n ratio,\n needElementSeparator\n )}\n className={this.getClassName(this.props)}\n onClick={this._onClick}\n onContextMenu={this._onContextMenu}\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n role=\"presentation\"\n >\n <div className=\"components-property-record-label\">\n {this.props.labelElement}\n </div>\n {needElementSeparator ? (\n <ElementSeparator\n movableArea={this.props.width}\n onRatioChanged={this.props.onColumnRatioChanged}\n ratio={ratio}\n orientation={this.props.orientation}\n isResizeHandleHovered={this.props.isResizeHandleHovered}\n onResizeHandleHoverChanged={this.props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={this.props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={this.props.onResizeHandleDragChanged}\n />\n ) : undefined}\n {this.props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive ? (\n <div className=\"components-property-record-value\">\n <span>\n {this.props.valueElementRenderer\n ? this.props.valueElementRenderer()\n : this.props.valueElement}\n </span>\n </div>\n ) : undefined}\n {this.props.actionButtonRenderers ? (\n <ActionButtonList\n orientation={this.props.orientation}\n property={this.props.propertyRecord}\n isPropertyHovered={this.state.isHovered}\n actionButtonRenderers={this.props.actionButtonRenderers}\n />\n ) : undefined}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyView.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PropertyView.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAoBxE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAGvC;IACC,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QAMP,aAAQ,GAAG,GAAG,EAAE;YACtB,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO;gBACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACxE,CAAC,CAAC;QAEM,kBAAa,GAAG,GAAG,EAAE;YAC3B,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW;gBAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CA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,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EACjE,yBAAyB,EAAE,IAAI,CAAC,KAAK,CAAC,yBAAyB,GAC/D,CACH,CAAC,CAAC,CAAC,SAAS;YACZ,kBAAkB,CAAC,CAAC,CAAC,CACpB,6BAAK,SAAS,EAAC,kCAAkC;gBAC/C,kCACG,IAAI,CAAC,KAAK,CAAC,oBAAoB;oBAC9B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;oBACnC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CACtB,CACH,CACP,CAAC,CAAC,CAAC,SAAS;YACZ,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAClC,oBAAC,gBAAgB,IACf,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACnC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EACvC,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,GACvD,CACH,CAAC,CAAC,CAAC,SAAS,CACT,CACP,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport \"./PropertyView.scss\";\nimport * as React from \"react\";\nimport { ElementSeparator, Orientation } from \"@itwin/core-react\";\nimport { ActionButtonList } from \"./ActionButtonList\";\nimport { PropertyGridColumnStyleProvider } from \"./PropertyGridColumns\";\nimport type { SharedRendererProps } from \"./PropertyRenderer\";\n\n/** Properties of [[PropertyView]] React component\n * @public\n */\nexport interface PropertyViewProps extends SharedRendererProps {\n /** Property label as a React element */\n labelElement: React.ReactNode;\n /** Property value as a React element */\n valueElement?: React.ReactNode;\n /** Render callback for property value. If specified, `valueElement` is ignored */\n valueElementRenderer?: () => React.ReactNode;\n}\n\n/** @internal */\ninterface PropertyViewState {\n isHovered: boolean;\n}\n\n/**\n * A React component that renders property as label/value pair\n * @public\n */\nexport class PropertyView extends React.Component<\n PropertyViewProps,\n PropertyViewState\n> {\n constructor(props: PropertyViewProps) {\n super(props);\n this.state = {\n isHovered: false,\n };\n }\n\n private _onClick = () => {\n if (this.props.onClick)\n this.props.onClick(this.props.propertyRecord, this.props.uniqueKey);\n };\n\n private _onMouseEnter = () => {\n if (this.props.isHoverable) this.setState({ isHovered: true });\n };\n\n private _onMouseLeave = () => {\n if (this.props.isHoverable) this.setState({ isHovered: false });\n };\n\n private _onContextMenu = (e: React.MouseEvent) => {\n if (this.props.onContextMenu)\n this.props.onContextMenu(this.props.propertyRecord, e);\n if (this.props.onRightClick)\n this.props.onRightClick(this.props.propertyRecord, this.props.uniqueKey);\n e.preventDefault();\n return false;\n };\n\n private getClassName(props: PropertyViewProps) {\n let propertyRecordClassName =\n props.orientation === Orientation.Horizontal\n ? \"components-property-record--horizontal\"\n : \"components-property-record--vertical\";\n if (props.isSelected) propertyRecordClassName += \" components--selected\";\n if (props.onClick) propertyRecordClassName += \" components--clickable\";\n if (props.isHoverable) propertyRecordClassName += \" components--hoverable\";\n return propertyRecordClassName;\n }\n\n /** @internal */\n public override render() {\n const ratio = this.props.columnRatio ? this.props.columnRatio : 0.25;\n const needElementSeparator =\n this.props.orientation === Orientation.Horizontal &&\n !!this.props.onColumnRatioChanged;\n const needActionButtons = !!this.props.actionButtonRenderers;\n const columnsStyleProvider = new PropertyGridColumnStyleProvider(\n this.props.columnInfo\n );\n const renderValueElement = !!(\n this.props.valueElement || this.props.valueElementRenderer\n );\n\n return (\n <div\n style={columnsStyleProvider.getStyle(\n this.props.orientation,\n needActionButtons,\n ratio,\n needElementSeparator\n )}\n className={this.getClassName(this.props)}\n onClick={this._onClick}\n onContextMenu={this._onContextMenu}\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n role=\"presentation\"\n >\n <div className=\"components-property-record-label\">\n {this.props.labelElement}\n </div>\n {needElementSeparator ? (\n <ElementSeparator\n movableArea={this.props.width}\n onRatioChanged={this.props.onColumnRatioChanged}\n ratio={ratio}\n orientation={this.props.orientation}\n isResizeHandleHovered={this.props.isResizeHandleHovered}\n onResizeHandleHoverChanged={this.props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={this.props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={this.props.onResizeHandleDragChanged}\n />\n ) : undefined}\n {renderValueElement ? (\n <div className=\"components-property-record-value\">\n <span>\n {this.props.valueElementRenderer\n ? this.props.valueElementRenderer()\n : this.props.valueElement}\n </span>\n </div>\n ) : undefined}\n {this.props.actionButtonRenderers ? (\n <ActionButtonList\n orientation={this.props.orientation}\n property={this.props.propertyRecord}\n isPropertyHovered={this.state.isHovered}\n actionButtonRenderers={this.props.actionButtonRenderers}\n />\n ) : undefined}\n </div>\n );\n }\n}\n"]}
@@ -18,10 +18,10 @@ export class PropertyLabelRenderer extends React.PureComponent {
18
18
  };
19
19
  }
20
20
  render() {
21
- const title = this.props.tooltip ??
22
- (typeof this.props.children == "string"
23
- ? this.props.children
24
- : /* istanbul ignore next */ undefined);
21
+ var _a;
22
+ const title = (_a = this.props.tooltip) !== null && _a !== void 0 ? _a : (typeof this.props.children == "string"
23
+ ? this.props.children
24
+ : /* istanbul ignore next */ undefined);
25
25
  return (React.createElement(React.Fragment, null,
26
26
  React.createElement("span", { className: "components-property-label-renderer", title: title }, this.props.children),
27
27
  this.props.renderColon ? (React.createElement("span", { className: "components-property-label-renderer-colon" }, ":")) : undefined));
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyLabelRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/label/PropertyLabelRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,gBAAgB;AAChB,MAAM,OAAO,qBAAsB,SAAQ,KAAK,CAAC,aAAyC;IACxF,6EAA6E;IACtE,MAAM,CAAC,QAAQ,CAAC,MAAe;QACpC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO;YACL,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,eAAe,MAAM,KAAK;SAClC,CAAC;IACJ,CAAC;IAEe,MAAM;QACpB,MAAM,KAAK,GACT,IAAI,CAAC,KAAK,CAAC,OAAO;YAClB,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,QAAQ;gBACrC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACrB,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;QAC5C,OAAO,CACL;YACE,8BAAM,SAAS,EAAC,oCAAoC,EAAC,KAAK,EAAE,KAAK,IAC9D,IAAI,CAAC,KAAK,CAAC,QAAQ,CACf;YACN,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CACxB,8BAAM,SAAS,EAAC,0CAA0C,QAAS,CACpE,CAAC,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport \"./PropertyLabelRenderer.scss\";\nimport * as React from \"react\";\n\n/** Base properties for a property label renderer\n * @public\n */\nexport interface PropertyLabelRendererProps {\n /** Label to be rendered */\n children: string | React.ReactElement;\n /** Indicates whether to render a colon after the label */\n renderColon?: boolean;\n /** Custom tooltip for the component. */\n tooltip?: string;\n}\n\n/** @internal */\nexport class PropertyLabelRenderer extends React.PureComponent<PropertyLabelRendererProps> {\n /** Get React CSS style object based on provided offset from the left side */\n public static getStyle(offset?: number): React.CSSProperties {\n offset = offset ? offset : 0;\n return {\n paddingLeft: offset,\n width: `calc(100% - ${offset}px)`,\n };\n }\n\n public override render() {\n const title =\n this.props.tooltip ??\n (typeof this.props.children == \"string\"\n ? this.props.children\n : /* istanbul ignore next */ undefined);\n return (\n <>\n <span className=\"components-property-label-renderer\" title={title}>\n {this.props.children}\n </span>\n {this.props.renderColon ? (\n <span className=\"components-property-label-renderer-colon\">:</span>\n ) : undefined}\n </>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyLabelRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/label/PropertyLabelRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,gBAAgB;AAChB,MAAM,OAAO,qBAAsB,SAAQ,KAAK,CAAC,aAAyC;IACxF,6EAA6E;IACtE,MAAM,CAAC,QAAQ,CAAC,MAAe;QACpC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO;YACL,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,eAAe,MAAM,KAAK;SAClC,CAAC;IACJ,CAAC;IAEe,MAAM;;QACpB,MAAM,KAAK,GACT,MAAA,IAAI,CAAC,KAAK,CAAC,OAAO,mCAClB,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,QAAQ;YACrC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ;YACrB,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;QAC5C,OAAO,CACL;YACE,8BAAM,SAAS,EAAC,oCAAoC,EAAC,KAAK,EAAE,KAAK,IAC9D,IAAI,CAAC,KAAK,CAAC,QAAQ,CACf;YACN,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CACxB,8BAAM,SAAS,EAAC,0CAA0C,QAAS,CACpE,CAAC,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport \"./PropertyLabelRenderer.scss\";\nimport * as React from \"react\";\n\n/** Base properties for a property label renderer\n * @public\n */\nexport interface PropertyLabelRendererProps {\n /** Label to be rendered */\n children: string | React.ReactElement;\n /** Indicates whether to render a colon after the label */\n renderColon?: boolean;\n /** Custom tooltip for the component. */\n tooltip?: string;\n}\n\n/** @internal */\nexport class PropertyLabelRenderer extends React.PureComponent<PropertyLabelRendererProps> {\n /** Get React CSS style object based on provided offset from the left side */\n public static getStyle(offset?: number): React.CSSProperties {\n offset = offset ? offset : 0;\n return {\n paddingLeft: offset,\n width: `calc(100% - ${offset}px)`,\n };\n }\n\n public override render() {\n const title =\n this.props.tooltip ??\n (typeof this.props.children == \"string\"\n ? this.props.children\n : /* istanbul ignore next */ undefined);\n return (\n <>\n <span className=\"components-property-label-renderer\" title={title}>\n {this.props.children}\n </span>\n {this.props.renderColon ? (\n <span className=\"components-property-label-renderer-colon\">:</span>\n ) : undefined}\n </>\n );\n }\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import { TypeConverterManager } from "../../../converters/TypeConverterManager";
2
2
  /** @internal */
3
3
  export function convertRecordToString(record) {
4
+ var _a;
4
5
  const primitive = record.value;
5
6
  return (primitive.displayValue ||
6
- TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name).convertPropertyToString(record.property, primitive.value));
7
+ TypeConverterManager.getConverter(record.property.typename, (_a = record.property.converter) === null || _a === void 0 ? void 0 : _a.name).convertPropertyToString(record.property, primitive.value));
7
8
  }
8
9
  //# sourceMappingURL=Common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/Common.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,gBAAgB;AAChB,MAAM,UAAU,qBAAqB,CACnC,MAAsB;IAEtB,MAAM,SAAS,GAAG,MAAM,CAAC,KAAuB,CAAC;IACjD,OAAO,CACL,SAAS,CAAC,YAAY;QACtB,oBAAoB,CAAC,YAAY,CAC/B,MAAM,CAAC,QAAQ,CAAC,QAAQ,EACxB,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAChC,CAAC,uBAAuB,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,CAC5D,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { PrimitiveValue, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { TypeConverterManager } from \"../../../converters/TypeConverterManager\";\n\n/** @internal */\nexport function convertRecordToString(\n record: PropertyRecord\n): string | Promise<string> {\n const primitive = record.value as PrimitiveValue;\n return (\n primitive.displayValue ||\n TypeConverterManager.getConverter(\n record.property.typename,\n record.property.converter?.name\n ).convertPropertyToString(record.property, primitive.value)\n );\n}\n"]}
1
+ {"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/Common.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,gBAAgB;AAChB,MAAM,UAAU,qBAAqB,CACnC,MAAsB;;IAEtB,MAAM,SAAS,GAAG,MAAM,CAAC,KAAuB,CAAC;IACjD,OAAO,CACL,SAAS,CAAC,YAAY;QACtB,oBAAoB,CAAC,YAAY,CAC/B,MAAM,CAAC,QAAQ,CAAC,QAAQ,EACxB,MAAA,MAAM,CAAC,QAAQ,CAAC,SAAS,0CAAE,IAAI,CAChC,CAAC,uBAAuB,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,CAC5D,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { PrimitiveValue, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { TypeConverterManager } from \"../../../converters/TypeConverterManager\";\n\n/** @internal */\nexport function convertRecordToString(\n record: PropertyRecord\n): string | Promise<string> {\n const primitive = record.value as PrimitiveValue;\n return (\n primitive.displayValue ||\n TypeConverterManager.getConverter(\n record.property.typename,\n record.property.converter?.name\n ).convertPropertyToString(record.property, primitive.value)\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MultilineTextPropertyValueRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAKpC,gBAAgB;AAChB,qBAAa,kCACX,YAAW,sBAAsB;IAE1B,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO;IAI1C,MAAM,CACX,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,4BAA4B,GACrC,KAAK,CAAC,SAAS;CAQnB;AA6BD,UAAU,0BAA0B;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,cAAc;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAqDtE,CAAC"}
1
+ {"version":3,"file":"MultilineTextPropertyValueRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAMpC,gBAAgB;AAChB,qBAAa,kCACX,YAAW,sBAAsB;IAE1B,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO;IAI1C,MAAM,CACX,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,4BAA4B,GACrC,KAAK,CAAC,SAAS;CAQnB;AA6BD,UAAU,0BAA0B;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,cAAc;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA+CtE,CAAC"}
@@ -10,10 +10,10 @@ import * as React from "react";
10
10
  import { useLayoutEffect, useRef, useState } from "react";
11
11
  import { assert } from "@itwin/core-bentley";
12
12
  import { PropertyValueFormat } from "@itwin/appui-abstract";
13
- import { UiComponents } from "../../../UiComponents";
14
13
  import { useRenderedStringValue } from "./PrimitivePropertyValueRenderer";
15
14
  import classnames from "classnames";
16
15
  import { convertRecordToString } from "./Common";
16
+ import { useTranslation } from "../../../useTranslation";
17
17
  /** @internal */
18
18
  export class MultilineTextPropertyValueRenderer {
19
19
  canRender(record) {
@@ -24,27 +24,24 @@ export class MultilineTextPropertyValueRenderer {
24
24
  }
25
25
  }
26
26
  const MultilineTextPropertyValueRendererImpl = (props) => {
27
+ var _a, _b, _c, _d;
27
28
  const { stringValue, element } = useRenderedStringValue(props.record, convertRecordToString, props.context);
28
- return (React.createElement(MultilineTextRenderer, { style: props.context?.style, stringValue: stringValue, isExpanded: props.context?.isExpanded, onExpansionToggled: props.context?.onExpansionToggled, onHeightChanged: props.context?.onHeightChanged }, element));
29
+ return (React.createElement(MultilineTextRenderer, { style: (_a = props.context) === null || _a === void 0 ? void 0 : _a.style, stringValue: stringValue, isExpanded: (_b = props.context) === null || _b === void 0 ? void 0 : _b.isExpanded, onExpansionToggled: (_c = props.context) === null || _c === void 0 ? void 0 : _c.onExpansionToggled, onHeightChanged: (_d = props.context) === null || _d === void 0 ? void 0 : _d.onHeightChanged }, element));
29
30
  };
30
31
  /** @internal */
31
32
  export const MultilineTextRenderer = (props) => {
33
+ const { translate } = useTranslation();
32
34
  const spanRef = useRef(null);
33
35
  const divRef = useRef(null);
34
- const previousHeightRef = useRef(0);
35
36
  const [contentOverflows, setContentOverflows] = useState(false);
36
37
  // eslint-disable-next-line react-hooks/exhaustive-deps
37
38
  useLayoutEffect(() => {
38
39
  assert(divRef.current !== null && spanRef.current !== null);
39
40
  setContentOverflows(spanRef.current.clientWidth < spanRef.current.scrollWidth);
40
- const currentHeight = Math.max(divRef.current.offsetHeight, 27);
41
- if (currentHeight !== previousHeightRef.current) {
42
- props.onHeightChanged?.(currentHeight);
43
- previousHeightRef.current = currentHeight;
44
- }
45
41
  });
46
42
  const handleExpansionToggleClick = (event) => {
47
- props.onExpansionToggled?.();
43
+ var _a;
44
+ (_a = props.onExpansionToggled) === null || _a === void 0 ? void 0 : _a.call(props);
48
45
  event.stopPropagation();
49
46
  };
50
47
  // In order to always trigger onMouseLeave event on PropertyView, collapse button must remain mounted at all times.
@@ -52,7 +49,7 @@ export const MultilineTextRenderer = (props) => {
52
49
  return (React.createElement("div", { ref: divRef, className: "multiline" },
53
50
  React.createElement("span", { ref: spanRef, className: classnames("content", { expanded: props.isExpanded }), style: props.style, title: props.isExpanded ? undefined : props.stringValue },
54
51
  props.children,
55
- React.createElement("button", { className: "expand-toggle", style: { display: props.isExpanded ? "inline-block" : "none" }, onClick: handleExpansionToggleClick }, UiComponents.translate("property.collapse"))),
56
- contentOverflows && !props.isExpanded && (React.createElement("button", { className: "expand-toggle", onClick: handleExpansionToggleClick }, UiComponents.translate("property.expand")))));
52
+ React.createElement("button", { className: "expand-toggle", style: { display: props.isExpanded ? "inline-block" : "none" }, onClick: handleExpansionToggleClick }, translate("property.collapse"))),
53
+ contentOverflows && !props.isExpanded && (React.createElement("button", { className: "expand-toggle", onClick: handleExpansionToggleClick }, translate("property.expand")))));
57
54
  };
58
55
  //# sourceMappingURL=MultilineTextPropertyValueRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultilineTextPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAA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C,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,EAC9D,OAAO,EAAE,0BAA0B,IAElC,YAAY,CAAC,SAAS,CAAC,mBAAmB,CAAC,CACrC,CACJ;QACN,gBAAgB,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACxC,gCAAQ,SAAS,EAAC,eAAe,EAAC,OAAO,EAAE,0BAA0B,IAClE,YAAY,CAAC,SAAS,CAAC,iBAAiB,CAAC,CACnC,CACV,CACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { useLayoutEffect, useRef, useState } from \"react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { UiComponents } from \"../../../UiComponents\";\nimport type {\n IPropertyValueRenderer,\n PropertyValueRendererContext,\n} from \"../../ValueRendererManager\";\nimport { useRenderedStringValue } from \"./PrimitivePropertyValueRenderer\";\nimport classnames from \"classnames\";\nimport { convertRecordToString } from \"./Common\";\n\n/** @internal */\nexport class MultilineTextPropertyValueRenderer\n implements IPropertyValueRenderer\n{\n public canRender(record: PropertyRecord): boolean {\n return record.value.valueFormat === PropertyValueFormat.Primitive;\n }\n\n public render(\n record: PropertyRecord,\n context?: PropertyValueRendererContext\n ): React.ReactNode {\n return (\n <MultilineTextPropertyValueRendererImpl\n record={record}\n context={context}\n />\n );\n }\n}\n\ninterface MultilineTextPropertyValueRendererImplProps {\n record: PropertyRecord;\n context?: PropertyValueRendererContext;\n children?: never;\n}\n\nconst MultilineTextPropertyValueRendererImpl: React.FC<\n MultilineTextPropertyValueRendererImplProps\n> = (props) => {\n const { stringValue, element } = useRenderedStringValue(\n props.record,\n convertRecordToString,\n props.context\n );\n return (\n <MultilineTextRenderer\n style={props.context?.style}\n stringValue={stringValue}\n isExpanded={props.context?.isExpanded}\n onExpansionToggled={props.context?.onExpansionToggled}\n onHeightChanged={props.context?.onHeightChanged}\n >\n {element}\n </MultilineTextRenderer>\n );\n};\n\ninterface MultilineTextRendererProps {\n stringValue?: string;\n isExpanded?: boolean;\n onExpansionToggled?: () => void;\n onHeightChanged?: (newHeight: number) => void;\n style?: React.CSSProperties;\n /** Content */\n children?: React.ReactNode;\n}\n\n/** @internal */\nexport const MultilineTextRenderer: React.FC<MultilineTextRendererProps> = (\n props\n) => {\n const spanRef = useRef<HTMLSpanElement>(null);\n const divRef = useRef<HTMLDivElement>(null);\n const previousHeightRef = useRef(0);\n const [contentOverflows, setContentOverflows] = useState<boolean>(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n assert(divRef.current !== null && spanRef.current !== null);\n\n setContentOverflows(\n spanRef.current.clientWidth < spanRef.current.scrollWidth\n );\n\n const currentHeight = Math.max(divRef.current.offsetHeight, 27);\n if (currentHeight !== previousHeightRef.current) {\n props.onHeightChanged?.(currentHeight);\n previousHeightRef.current = currentHeight;\n }\n });\n\n const handleExpansionToggleClick = (event: React.MouseEvent) => {\n props.onExpansionToggled?.();\n event.stopPropagation();\n };\n\n // In order to always trigger onMouseLeave event on PropertyView, collapse button must remain mounted at all times.\n // https://github.com/facebook/react/issues/6807\n return (\n <div ref={divRef} className=\"multiline\">\n <span\n ref={spanRef}\n className={classnames(\"content\", { expanded: props.isExpanded })}\n style={props.style}\n title={props.isExpanded ? undefined : props.stringValue}\n >\n {props.children}\n <button\n className=\"expand-toggle\"\n style={{ display: props.isExpanded ? \"inline-block\" : \"none\" }}\n onClick={handleExpansionToggleClick}\n >\n {UiComponents.translate(\"property.collapse\")}\n </button>\n </span>\n {contentOverflows && !props.isExpanded && (\n <button className=\"expand-toggle\" onClick={handleExpansionToggleClick}>\n {UiComponents.translate(\"property.expand\")}\n </button>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"MultilineTextPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAK5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,gBAAgB;AAChB,MAAM,OAAO,kCAAkC;IAGtC,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS,CAAC;IACpE,CAAC;IAEM,MAAM,CACX,MAAsB,EACtB,OAAsC;QAEtC,OAAO,CACL,oBAAC,sCAAsC,IACrC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;IACJ,CAAC;CACF;AAQD,MAAM,sCAAsC,GAExC,CAAC,KAAK,EAAE,EAAE;;IACZ,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,sBAAsB,CACrD,KAAK,CAAC,MAAM,EACZ,qBAAqB,EACrB,KAAK,CAAC,OAAO,CACd,CAAC;IACF,OAAO,CACL,oBAAC,qBAAqB,IACpB,KAAK,EAAE,MAAA,KAAK,CAAC,OAAO,0CAAE,KAAK,EAC3B,WAAW,EAAE,WAAW,EACxB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E,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW;YAEtD,KAAK,CAAC,QAAQ;YACf,gCACE,SAAS,EAAC,eAAe,EACzB,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,EAC9D,OAAO,EAAE,0BAA0B,IAElC,SAAS,CAAC,mBAAmB,CAAC,CACxB,CACJ;QACN,gBAAgB,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACxC,gCAAQ,SAAS,EAAC,eAAe,EAAC,OAAO,EAAE,0BAA0B,IAClE,SAAS,CAAC,iBAAiB,CAAC,CACtB,CACV,CACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { useLayoutEffect, useRef, useState } from \"react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type {\n IPropertyValueRenderer,\n PropertyValueRendererContext,\n} from \"../../ValueRendererManager\";\nimport { useRenderedStringValue } from \"./PrimitivePropertyValueRenderer\";\nimport classnames from \"classnames\";\nimport { convertRecordToString } from \"./Common\";\nimport { useTranslation } from \"../../../useTranslation\";\n\n/** @internal */\nexport class MultilineTextPropertyValueRenderer\n implements IPropertyValueRenderer\n{\n public canRender(record: PropertyRecord): boolean {\n return record.value.valueFormat === PropertyValueFormat.Primitive;\n }\n\n public render(\n record: PropertyRecord,\n context?: PropertyValueRendererContext\n ): React.ReactNode {\n return (\n <MultilineTextPropertyValueRendererImpl\n record={record}\n context={context}\n />\n );\n }\n}\n\ninterface MultilineTextPropertyValueRendererImplProps {\n record: PropertyRecord;\n context?: PropertyValueRendererContext;\n children?: never;\n}\n\nconst MultilineTextPropertyValueRendererImpl: React.FC<\n MultilineTextPropertyValueRendererImplProps\n> = (props) => {\n const { stringValue, element } = useRenderedStringValue(\n props.record,\n convertRecordToString,\n props.context\n );\n return (\n <MultilineTextRenderer\n style={props.context?.style}\n stringValue={stringValue}\n isExpanded={props.context?.isExpanded}\n onExpansionToggled={props.context?.onExpansionToggled}\n onHeightChanged={props.context?.onHeightChanged}\n >\n {element}\n </MultilineTextRenderer>\n );\n};\n\ninterface MultilineTextRendererProps {\n stringValue?: string;\n isExpanded?: boolean;\n onExpansionToggled?: () => void;\n onHeightChanged?: (newHeight: number) => void;\n style?: React.CSSProperties;\n /** Content */\n children?: React.ReactNode;\n}\n\n/** @internal */\nexport const MultilineTextRenderer: React.FC<MultilineTextRendererProps> = (\n props\n) => {\n const { translate } = useTranslation();\n const spanRef = useRef<HTMLSpanElement>(null);\n const divRef = useRef<HTMLDivElement>(null);\n const [contentOverflows, setContentOverflows] = useState<boolean>(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n assert(divRef.current !== null && spanRef.current !== null);\n\n setContentOverflows(\n spanRef.current.clientWidth < spanRef.current.scrollWidth\n );\n });\n\n const handleExpansionToggleClick = (event: React.MouseEvent) => {\n props.onExpansionToggled?.();\n event.stopPropagation();\n };\n\n // In order to always trigger onMouseLeave event on PropertyView, collapse button must remain mounted at all times.\n // https://github.com/facebook/react/issues/6807\n return (\n <div ref={divRef} className=\"multiline\">\n <span\n ref={spanRef}\n className={classnames(\"content\", { expanded: props.isExpanded })}\n style={props.style}\n title={props.isExpanded ? undefined : props.stringValue}\n >\n {props.children}\n <button\n className=\"expand-toggle\"\n style={{ display: props.isExpanded ? \"inline-block\" : \"none\" }}\n onClick={handleExpansionToggleClick}\n >\n {translate(\"property.collapse\")}\n </button>\n </span>\n {contentOverflows && !props.isExpanded && (\n <button className=\"expand-toggle\" onClick={handleExpansionToggleClick}>\n {translate(\"property.expand\")}\n </button>\n )}\n </div>\n );\n};\n"]}
@@ -29,13 +29,15 @@ export class PrimitivePropertyValueRenderer {
29
29
  * @internal
30
30
  */
31
31
  export function convertPrimitiveRecordToString(record) {
32
+ var _a;
32
33
  const primitive = record.value;
33
- return TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name).convertPropertyToString(record.property, primitive.value);
34
+ return TypeConverterManager.getConverter(record.property.typename, (_a = record.property.converter) === null || _a === void 0 ? void 0 : _a.name).convertPropertyToString(record.property, primitive.value);
34
35
  }
35
36
  /** @internal */
36
37
  export function PrimitivePropertyValueRendererImpl(props) {
38
+ var _a;
37
39
  const { stringValue, element } = useRenderedStringValue(props.record, props.stringValueCalculator, props.context, props.linksHandler);
38
- return (React.createElement("span", { style: props.context?.style, title: stringValue }, element));
40
+ return (React.createElement("span", { style: (_a = props.context) === null || _a === void 0 ? void 0 : _a.style, title: stringValue }, element));
39
41
  }
40
42
  /**
41
43
  * Default link handler used for handling records,
@@ -51,8 +53,9 @@ export const DEFAULT_LINKS_HANDLER = {
51
53
  };
52
54
  /** @internal */
53
55
  export function useRenderedStringValue(record, stringValueCalculator, context, linksHandler) {
56
+ var _a, _b;
54
57
  const stringValue = useAsyncValue(stringValueCalculator(record));
55
- const el = stringValue === undefined ? (context?.defaultValue) : (React.createElement(LinksRenderer, { value: stringValue, links: record.links ?? linksHandler ?? DEFAULT_LINKS_HANDLER, highlighter: context?.textHighlighter }));
58
+ const el = stringValue === undefined ? (context === null || context === void 0 ? void 0 : context.defaultValue) : (React.createElement(LinksRenderer, { value: stringValue, links: (_b = (_a = record.links) !== null && _a !== void 0 ? _a : linksHandler) !== null && _b !== void 0 ? _b : DEFAULT_LINKS_HANDLER, highlighter: context === null || context === void 0 ? void 0 : context.textHighlighter }));
56
59
  return { stringValue, element: el };
57
60
  }
58
61
  //# sourceMappingURL=PrimitivePropertyValueRenderer.js.map