@itwin/components-react 4.10.0 → 4.12.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 (347) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/lib/cjs/components-react/UiComponents.d.ts +1 -5
  3. package/lib/cjs/components-react/UiComponents.d.ts.map +1 -1
  4. package/lib/cjs/components-react/UiComponents.js +3 -15
  5. package/lib/cjs/components-react/UiComponents.js.map +1 -1
  6. package/lib/cjs/components-react/UiComponents.json +153 -0
  7. package/lib/cjs/components-react/common/DelayedSpinner.js +3 -2
  8. package/lib/cjs/components-react/common/DelayedSpinner.js.map +1 -1
  9. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js +2 -1
  10. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  11. package/lib/cjs/components-react/converters/NumericTypeConverter.js +4 -2
  12. package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
  13. package/lib/cjs/components-react/converters/TypeConverter.js +2 -1
  14. package/lib/cjs/components-react/converters/TypeConverter.js.map +1 -1
  15. package/lib/cjs/components-react/datepicker/DatePicker.d.ts +2 -0
  16. package/lib/cjs/components-react/datepicker/DatePicker.d.ts.map +1 -1
  17. package/lib/cjs/components-react/datepicker/DatePicker.js +43 -40
  18. package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
  19. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.d.ts +5 -2
  20. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.d.ts.map +1 -1
  21. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js +8 -7
  22. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
  23. package/lib/cjs/components-react/datepicker/IntlFormatter.d.ts +1 -0
  24. package/lib/cjs/components-react/datepicker/IntlFormatter.d.ts.map +1 -1
  25. package/lib/cjs/components-react/datepicker/IntlFormatter.js +1 -0
  26. package/lib/cjs/components-react/datepicker/IntlFormatter.js.map +1 -1
  27. package/lib/cjs/components-react/datepicker/TimeField.d.ts.map +1 -1
  28. package/lib/cjs/components-react/datepicker/TimeField.js +28 -30
  29. package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
  30. package/lib/cjs/components-react/editors/CustomNumberEditor.js +8 -6
  31. package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
  32. package/lib/cjs/components-react/editors/DateTimeEditor.js +5 -3
  33. package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
  34. package/lib/cjs/components-react/editors/EnumEditor.d.ts +0 -1
  35. package/lib/cjs/components-react/editors/EnumEditor.d.ts.map +1 -1
  36. package/lib/cjs/components-react/editors/EnumEditor.js +2 -3
  37. package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
  38. package/lib/cjs/components-react/editors/PopupButton.d.ts.map +1 -1
  39. package/lib/cjs/components-react/editors/PopupButton.js +8 -5
  40. package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
  41. package/lib/cjs/components-react/editors/TextEditor.d.ts +0 -1
  42. package/lib/cjs/components-react/editors/TextEditor.d.ts.map +1 -1
  43. package/lib/cjs/components-react/editors/TextEditor.js +5 -4
  44. package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
  45. package/lib/cjs/components-react/editors/TextareaEditor.d.ts +0 -1
  46. package/lib/cjs/components-react/editors/TextareaEditor.d.ts.map +1 -1
  47. package/lib/cjs/components-react/editors/TextareaEditor.js +1 -2
  48. package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
  49. package/lib/cjs/components-react/favorite/FavoritePropertyList.js +3 -3
  50. package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
  51. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.d.ts.map +1 -1
  52. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js +4 -3
  53. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -1
  54. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js +2 -1
  55. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  56. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
  57. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +6 -5
  58. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
  59. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +4 -3
  60. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  61. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js +3 -3
  62. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  63. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.d.ts.map +1 -1
  64. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js +4 -3
  65. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -1
  66. package/lib/cjs/components-react/filter-builder/Operators.d.ts +1 -0
  67. package/lib/cjs/components-react/filter-builder/Operators.d.ts.map +1 -1
  68. package/lib/cjs/components-react/filter-builder/Operators.js +1 -0
  69. package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
  70. package/lib/cjs/components-react/filtering/FilteringInput.d.ts +0 -3
  71. package/lib/cjs/components-react/filtering/FilteringInput.d.ts.map +1 -1
  72. package/lib/cjs/components-react/filtering/FilteringInput.js +5 -7
  73. package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
  74. package/lib/cjs/components-react/filtering/ResultSelector.d.ts +0 -1
  75. package/lib/cjs/components-react/filtering/ResultSelector.d.ts.map +1 -1
  76. package/lib/cjs/components-react/filtering/ResultSelector.js +1 -2
  77. package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
  78. package/lib/cjs/components-react/properties/ValueRendererManager.d.ts +3 -0
  79. package/lib/cjs/components-react/properties/ValueRendererManager.d.ts.map +1 -1
  80. package/lib/cjs/components-react/properties/ValueRendererManager.js +12 -1
  81. package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
  82. package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js +4 -3
  83. package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  84. package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts +25 -0
  85. package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts.map +1 -0
  86. package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.js +62 -0
  87. package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.js.map +1 -0
  88. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +1 -1
  89. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
  90. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +3 -4
  91. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
  92. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js +6 -44
  93. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  94. package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts +1 -1
  95. package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts.map +1 -1
  96. package/lib/cjs/components-react/properties/renderers/PropertyView.js +2 -3
  97. package/lib/cjs/components-react/properties/renderers/PropertyView.js.map +1 -1
  98. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js +4 -4
  99. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  100. package/lib/cjs/components-react/properties/renderers/value/Common.js +2 -1
  101. package/lib/cjs/components-react/properties/renderers/value/Common.js.map +1 -1
  102. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.d.ts.map +1 -1
  103. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +8 -11
  104. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
  105. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +6 -3
  106. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  107. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +2 -1
  108. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  109. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +2 -1
  110. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  111. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +2 -1
  112. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  113. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js +2 -2
  114. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  115. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts.map +1 -1
  116. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js +1 -3
  117. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
  118. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -3
  119. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
  120. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +90 -80
  121. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  122. package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js +13 -11
  123. package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  124. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
  125. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  126. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +2 -1
  127. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  128. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js +2 -1
  129. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
  130. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +2 -2
  131. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  132. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +3 -2
  133. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  134. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  135. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  136. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +1 -1
  137. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
  138. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +1 -1
  139. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  140. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +22 -12
  141. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  142. package/lib/cjs/components-react/selectable-content/SelectableContent.js +3 -2
  143. package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
  144. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
  145. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +19 -21
  146. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
  147. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
  148. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js +1 -4
  149. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  150. package/lib/cjs/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
  151. package/lib/cjs/components-react/toolbar/PopupItemsPanel.js +2 -3
  152. package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
  153. package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js +6 -5
  154. package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
  155. package/lib/cjs/components-react/tree/controlled/TreeModel.js +8 -7
  156. package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
  157. package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js +8 -6
  158. package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  159. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  160. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js +3 -2
  161. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  162. package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js +2 -1
  163. package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  164. package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js +4 -2
  165. package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  166. package/lib/cjs/components-react/useTranslation.d.ts +7 -0
  167. package/lib/cjs/components-react/useTranslation.d.ts.map +1 -0
  168. package/lib/cjs/components-react/useTranslation.js +52 -0
  169. package/lib/cjs/components-react/useTranslation.js.map +1 -0
  170. package/lib/cjs/components-react.d.ts +2 -0
  171. package/lib/cjs/components-react.d.ts.map +1 -1
  172. package/lib/cjs/components-react.js +2 -0
  173. package/lib/cjs/components-react.js.map +1 -1
  174. package/lib/esm/components-react/UiComponents.d.ts +1 -5
  175. package/lib/esm/components-react/UiComponents.d.ts.map +1 -1
  176. package/lib/esm/components-react/UiComponents.js +3 -15
  177. package/lib/esm/components-react/UiComponents.js.map +1 -1
  178. package/lib/esm/components-react/UiComponents.json +153 -0
  179. package/lib/esm/components-react/common/DelayedSpinner.js +3 -2
  180. package/lib/esm/components-react/common/DelayedSpinner.js.map +1 -1
  181. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js +2 -1
  182. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  183. package/lib/esm/components-react/converters/NumericTypeConverter.js +4 -2
  184. package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
  185. package/lib/esm/components-react/converters/TypeConverter.js +2 -1
  186. package/lib/esm/components-react/converters/TypeConverter.js.map +1 -1
  187. package/lib/esm/components-react/datepicker/DatePicker.d.ts +2 -0
  188. package/lib/esm/components-react/datepicker/DatePicker.d.ts.map +1 -1
  189. package/lib/esm/components-react/datepicker/DatePicker.js +43 -40
  190. package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
  191. package/lib/esm/components-react/datepicker/DatePickerPopupButton.d.ts +5 -2
  192. package/lib/esm/components-react/datepicker/DatePickerPopupButton.d.ts.map +1 -1
  193. package/lib/esm/components-react/datepicker/DatePickerPopupButton.js +8 -7
  194. package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
  195. package/lib/esm/components-react/datepicker/IntlFormatter.d.ts +1 -0
  196. package/lib/esm/components-react/datepicker/IntlFormatter.d.ts.map +1 -1
  197. package/lib/esm/components-react/datepicker/IntlFormatter.js +1 -0
  198. package/lib/esm/components-react/datepicker/IntlFormatter.js.map +1 -1
  199. package/lib/esm/components-react/datepicker/TimeField.d.ts.map +1 -1
  200. package/lib/esm/components-react/datepicker/TimeField.js +28 -30
  201. package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
  202. package/lib/esm/components-react/editors/CustomNumberEditor.js +8 -6
  203. package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
  204. package/lib/esm/components-react/editors/DateTimeEditor.js +5 -3
  205. package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
  206. package/lib/esm/components-react/editors/EnumEditor.d.ts +0 -1
  207. package/lib/esm/components-react/editors/EnumEditor.d.ts.map +1 -1
  208. package/lib/esm/components-react/editors/EnumEditor.js +2 -3
  209. package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
  210. package/lib/esm/components-react/editors/PopupButton.d.ts.map +1 -1
  211. package/lib/esm/components-react/editors/PopupButton.js +9 -6
  212. package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
  213. package/lib/esm/components-react/editors/TextEditor.d.ts +0 -1
  214. package/lib/esm/components-react/editors/TextEditor.d.ts.map +1 -1
  215. package/lib/esm/components-react/editors/TextEditor.js +5 -4
  216. package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
  217. package/lib/esm/components-react/editors/TextareaEditor.d.ts +0 -1
  218. package/lib/esm/components-react/editors/TextareaEditor.d.ts.map +1 -1
  219. package/lib/esm/components-react/editors/TextareaEditor.js +1 -2
  220. package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
  221. package/lib/esm/components-react/favorite/FavoritePropertyList.js +3 -3
  222. package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
  223. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.d.ts.map +1 -1
  224. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js +4 -3
  225. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -1
  226. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js +2 -1
  227. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  228. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
  229. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +6 -5
  230. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
  231. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +4 -3
  232. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  233. package/lib/esm/components-react/filter-builder/FilterBuilderState.js +3 -3
  234. package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  235. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.d.ts.map +1 -1
  236. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js +4 -3
  237. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -1
  238. package/lib/esm/components-react/filter-builder/Operators.d.ts +1 -0
  239. package/lib/esm/components-react/filter-builder/Operators.d.ts.map +1 -1
  240. package/lib/esm/components-react/filter-builder/Operators.js +1 -0
  241. package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
  242. package/lib/esm/components-react/filtering/FilteringInput.d.ts +0 -3
  243. package/lib/esm/components-react/filtering/FilteringInput.d.ts.map +1 -1
  244. package/lib/esm/components-react/filtering/FilteringInput.js +6 -8
  245. package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
  246. package/lib/esm/components-react/filtering/ResultSelector.d.ts +0 -1
  247. package/lib/esm/components-react/filtering/ResultSelector.d.ts.map +1 -1
  248. package/lib/esm/components-react/filtering/ResultSelector.js +1 -2
  249. package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
  250. package/lib/esm/components-react/properties/ValueRendererManager.d.ts +3 -0
  251. package/lib/esm/components-react/properties/ValueRendererManager.d.ts.map +1 -1
  252. package/lib/esm/components-react/properties/ValueRendererManager.js +12 -1
  253. package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
  254. package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js +4 -3
  255. package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  256. package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts +25 -0
  257. package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts.map +1 -0
  258. package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.js +35 -0
  259. package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.js.map +1 -0
  260. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +1 -1
  261. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
  262. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +3 -4
  263. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
  264. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js +3 -21
  265. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  266. package/lib/esm/components-react/properties/renderers/PropertyView.d.ts +1 -1
  267. package/lib/esm/components-react/properties/renderers/PropertyView.d.ts.map +1 -1
  268. package/lib/esm/components-react/properties/renderers/PropertyView.js +2 -3
  269. package/lib/esm/components-react/properties/renderers/PropertyView.js.map +1 -1
  270. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js +4 -4
  271. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  272. package/lib/esm/components-react/properties/renderers/value/Common.js +2 -1
  273. package/lib/esm/components-react/properties/renderers/value/Common.js.map +1 -1
  274. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.d.ts.map +1 -1
  275. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +8 -11
  276. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
  277. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +6 -3
  278. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  279. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +2 -1
  280. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  281. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +2 -1
  282. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  283. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +2 -1
  284. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  285. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js +2 -2
  286. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  287. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts.map +1 -1
  288. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js +1 -3
  289. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
  290. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -3
  291. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
  292. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +90 -80
  293. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  294. package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js +13 -11
  295. package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  296. package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
  297. package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  298. package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +2 -1
  299. package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  300. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js +2 -1
  301. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
  302. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +2 -2
  303. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  304. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +3 -2
  305. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  306. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  307. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  308. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +1 -1
  309. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
  310. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +1 -1
  311. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  312. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +22 -12
  313. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  314. package/lib/esm/components-react/selectable-content/SelectableContent.js +3 -2
  315. package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
  316. package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
  317. package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +20 -22
  318. package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
  319. package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
  320. package/lib/esm/components-react/toolbar/PopupItemWithDrag.js +2 -5
  321. package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  322. package/lib/esm/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
  323. package/lib/esm/components-react/toolbar/PopupItemsPanel.js +3 -4
  324. package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
  325. package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js +6 -5
  326. package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
  327. package/lib/esm/components-react/tree/controlled/TreeModel.js +8 -7
  328. package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
  329. package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js +8 -6
  330. package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  331. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  332. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js +3 -2
  333. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  334. package/lib/esm/components-react/tree/controlled/internal/SparseTree.js +2 -1
  335. package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  336. package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js +4 -2
  337. package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  338. package/lib/esm/components-react/useTranslation.d.ts +7 -0
  339. package/lib/esm/components-react/useTranslation.d.ts.map +1 -0
  340. package/lib/esm/components-react/useTranslation.js +25 -0
  341. package/lib/esm/components-react/useTranslation.js.map +1 -0
  342. package/lib/esm/components-react.d.ts +2 -0
  343. package/lib/esm/components-react.d.ts.map +1 -1
  344. package/lib/esm/components-react.js +2 -0
  345. package/lib/esm/components-react.js.map +1 -1
  346. package/lib/public/locales/en/UiComponents.json +7 -1
  347. package/package.json +5 -6
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategoryRendererManager.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyCategoryRendererManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA2BH;;;;GAIG;AACH,MAAa,+BAA+B;IAA5C;QACU,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAC;IAuC3E,CAAC;IAnCC,mFAAmF;IAC5E,oBAAoB,CACzB,YAA8B;QAE9B,IAAI,YAAY,CAAC,eAAe,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvD,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAChC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAC3C,EAAE,CAAC,YAAY,CAAC,CAAC;IACpB,CAAC;IAED,qGAAqG;IAC9F,WAAW,CAChB,YAAoB,EACpB,gBAA0C,EAC1C,QAAQ,GAAG,KAAK;QAEhB,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC1D,MAAM,SAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;YACvD,MAAM,UAAU,GACd,+BAA+B,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,GAAG,SAAS,IAAI,UAAU,qBAAqB,YAAY,wDAAwD,CACpH,CAAC;SACH;QAED,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC;IAED,sDAAsD;IAC/C,cAAc,CAAC,YAAoB;QACxC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;;AApCa,8CAAc,GAAG,IAAI,+BAA+B,EAAE,AAAxC,CAAyC;AAH1D,0EAA+B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type * as React from \"react\";\nimport type { VirtualizedPropertyGridContext } from \"./component/VirtualizedPropertyGrid\";\nimport type { GridCategoryItem } from \"./internal/flat-items/FlatGridItem\";\n\n/**\n * Props that property category renderer receives.\n * @public\n */\nexport interface PropertyCategoryRendererProps {\n /** The category being rendered. */\n categoryItem: GridCategoryItem;\n /** Context of the surrounding property grid. */\n gridContext: VirtualizedPropertyGridContext;\n /** Sets the allocated height for category contents. */\n onHeightChanged: (newHeight: number) => void;\n}\n\n/**\n * Factory function that produces custom property category components.\n * @public\n */\nexport type PropertyCategoryRenderer = (\n categoryItem: GridCategoryItem\n) => React.ComponentType<PropertyCategoryRendererProps> | undefined;\n\n/**\n * Keeps a record of currently registered property category renderers and determines which renderers get invoked for\n * each category.\n * @public\n */\nexport class PropertyCategoryRendererManager {\n private _categoryRenderers = new Map<string, PropertyCategoryRenderer>();\n\n public static defaultManager = new PropertyCategoryRendererManager();\n\n /** Retrieves a category rendering component based for the passed category item. */\n public getCategoryComponent(\n categoryItem: GridCategoryItem\n ): React.ComponentType<PropertyCategoryRendererProps> | undefined {\n if (categoryItem.derivedCategory.renderer === undefined) {\n return undefined;\n }\n\n return this._categoryRenderers.get(\n categoryItem.derivedCategory.renderer.name\n )?.(categoryItem);\n }\n\n /** Registers a renderer factory function to be invoked on categories with specific renderer name. */\n public addRenderer(\n rendererName: string,\n categoryRenderer: PropertyCategoryRenderer,\n override = false\n ): void {\n if (this._categoryRenderers.has(rendererName) && !override) {\n const className = PropertyCategoryRendererManager.name;\n const methodName =\n PropertyCategoryRendererManager.prototype.addRenderer.name;\n throw new Error(\n `${className}.${methodName} error: renderer '${rendererName}' has already been added. Did you mean to override it?`\n );\n }\n\n this._categoryRenderers.set(rendererName, categoryRenderer);\n }\n\n /** Removes previous renderer factory registration. */\n public removeRenderer(rendererName: string): void {\n this._categoryRenderers.delete(rendererName);\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyCategoryRendererManager.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyCategoryRendererManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA2BH;;;;GAIG;AACH,MAAa,+BAA+B;IAA5C;QACU,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAC;IAuC3E,CAAC;IAnCC,mFAAmF;IAC5E,oBAAoB,CACzB,YAA8B;;QAE9B,IAAI,YAAY,CAAC,eAAe,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvD,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAA,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAChC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAC3C,0CAAG,YAAY,CAAC,CAAC;IACpB,CAAC;IAED,qGAAqG;IAC9F,WAAW,CAChB,YAAoB,EACpB,gBAA0C,EAC1C,QAAQ,GAAG,KAAK;QAEhB,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC1D,MAAM,SAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;YACvD,MAAM,UAAU,GACd,+BAA+B,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,GAAG,SAAS,IAAI,UAAU,qBAAqB,YAAY,wDAAwD,CACpH,CAAC;SACH;QAED,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC;IAED,sDAAsD;IAC/C,cAAc,CAAC,YAAoB;QACxC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;;AApCa,8CAAc,GAAG,IAAI,+BAA+B,EAAE,AAAxC,CAAyC;AAH1D,0EAA+B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type * as React from \"react\";\nimport type { VirtualizedPropertyGridContext } from \"./component/VirtualizedPropertyGrid\";\nimport type { GridCategoryItem } from \"./internal/flat-items/FlatGridItem\";\n\n/**\n * Props that property category renderer receives.\n * @public\n */\nexport interface PropertyCategoryRendererProps {\n /** The category being rendered. */\n categoryItem: GridCategoryItem;\n /** Context of the surrounding property grid. */\n gridContext: VirtualizedPropertyGridContext;\n /** Sets the allocated height for category contents. */\n onHeightChanged: (newHeight: number) => void;\n}\n\n/**\n * Factory function that produces custom property category components.\n * @public\n */\nexport type PropertyCategoryRenderer = (\n categoryItem: GridCategoryItem\n) => React.ComponentType<PropertyCategoryRendererProps> | undefined;\n\n/**\n * Keeps a record of currently registered property category renderers and determines which renderers get invoked for\n * each category.\n * @public\n */\nexport class PropertyCategoryRendererManager {\n private _categoryRenderers = new Map<string, PropertyCategoryRenderer>();\n\n public static defaultManager = new PropertyCategoryRendererManager();\n\n /** Retrieves a category rendering component based for the passed category item. */\n public getCategoryComponent(\n categoryItem: GridCategoryItem\n ): React.ComponentType<PropertyCategoryRendererProps> | undefined {\n if (categoryItem.derivedCategory.renderer === undefined) {\n return undefined;\n }\n\n return this._categoryRenderers.get(\n categoryItem.derivedCategory.renderer.name\n )?.(categoryItem);\n }\n\n /** Registers a renderer factory function to be invoked on categories with specific renderer name. */\n public addRenderer(\n rendererName: string,\n categoryRenderer: PropertyCategoryRenderer,\n override = false\n ): void {\n if (this._categoryRenderers.has(rendererName) && !override) {\n const className = PropertyCategoryRendererManager.name;\n const methodName =\n PropertyCategoryRendererManager.prototype.addRenderer.name;\n throw new Error(\n `${className}.${methodName} error: renderer '${rendererName}' has already been added. Did you mean to override it?`\n );\n }\n\n this._categoryRenderers.set(rendererName, categoryRenderer);\n }\n\n /** Removes previous renderer factory registration. */\n public removeRenderer(rendererName: string): void {\n this._categoryRenderers.delete(rendererName);\n }\n}\n"]}
@@ -66,13 +66,14 @@ class ColumnResizingPropertyListPropsSupplier extends React.Component {
66
66
  };
67
67
  }
68
68
  isMinimumColumnSizeEnabled() {
69
+ var _a;
69
70
  if (this.props.orientation !== core_react_1.Orientation.Horizontal)
70
71
  return false;
71
72
  // calculated how much width all the borders of nested properties takes up.
72
73
  const bordersWidth = this.props.maxPropertyDepth
73
74
  ? this.props.maxPropertyDepth * BORDER_WIDTH
74
75
  : 0;
75
- const actionButtonWidth = this.props.actionButtonWidth ?? 0;
76
+ const actionButtonWidth = (_a = this.props.actionButtonWidth) !== null && _a !== void 0 ? _a : 0;
76
77
  // minimum with required to render property. This consists of:
77
78
  // * minimum label width
78
79
  // * 1px resizer
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnResizingPropertyListPropsSupplier.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;AAE/B,kDAA4D;AAG5D,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,eAAe,GAAG,EAAE,CAAC;AA2C3B;;;GAGG;AACH,MAAa,uCAAwC,SAAQ,KAAK,CAAC,SAGlE;IAHD;;QAImB,kBAAa,GAAG,IAAI,CAAC;QACrB,qBAAgB,GAAG,IAAI,CAAC;QACxB,qBAAgB,GAAG,GAAG,CAAC;QAChC,cAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAClC,cAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAE1B,UAAK,GAAiD;YACpE,WAAW,EAAE,IAAI,CAAC,aAAa;YAC/B,qBAAqB,EAAE,KAAK;YAC5B,0BAA0B,EAAE,KAAK;SAClC,CAAC;QAQM,0BAAqB,GAAG,CAAC,KAAa,EAAqB,EAAE;YACnE,KAAK,GAAG,uBAAU,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAChE,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,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C,KAAK,CAAC,aAAc;gBACxC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAc;gBACxC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAkB;gBAChD,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,EAAE;aAC9D;SACF,CAAC;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;;AA9Fa,oDAAY,GACxB;IACE,aAAa,EAAE,GAAG;IAClB,aAAa,EAAE,GAAG;CACnB,AAJuB,CAItB;AApBO,0FAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { RatioChangeResult } from \"@itwin/core-react\";\nimport { Orientation, UiGeometry } from \"@itwin/core-react\";\nimport type { PropertyListProps } from \"./PropertyList\";\n\nconst BORDER_WIDTH = 10;\nconst PROPERTY_PADDING = 16;\nconst VALUE_MIN_WIDTH = 10;\n\n/** @internal */\nexport type ColumnResizeRelatedPropertyListProps = Required<\n Pick<\n PropertyListProps,\n | \"onColumnChanged\"\n | \"columnRatio\"\n | \"isResizeHandleHovered\"\n | \"onResizeHandleHoverChanged\"\n | \"isResizeHandleBeingDragged\"\n | \"onResizeHandleDragChanged\"\n | \"columnInfo\"\n | \"orientation\"\n | \"width\"\n >\n>;\n\n/** @internal */\nexport interface ColumnResizingPropertyListPropsSupplierProps {\n /** Orientation of the properties */\n orientation: Orientation;\n /** Width of the property list */\n width: number;\n /** Minimum allowed label column width, after which resizing stops */\n minLabelWidth?: number;\n /** Minimum allowed value column width, after which resizing stops */\n minValueWidth?: number;\n /** Fixed action button column width */\n actionButtonWidth?: number;\n /** Maximum depth of the properties shown */\n maxPropertyDepth?: number;\n /** A callback that receives the required column-resize-related props for the [[PropertyList]] component */\n children: (props: ColumnResizeRelatedPropertyListProps) => React.ReactNode;\n}\n\n/** @internal */\nexport interface ColumnResizingPropertyListPropsSupplierState {\n columnRatio: number;\n isResizeHandleHovered: boolean;\n isResizeHandleBeingDragged: boolean;\n}\n\n/**\n * Wrapped PropertyCategoryBlock React component with list of properties and render optimization\n * @internal\n */\nexport class ColumnResizingPropertyListPropsSupplier extends React.Component<\n ColumnResizingPropertyListPropsSupplierProps,\n ColumnResizingPropertyListPropsSupplierState\n> {\n private readonly _initialRatio = 0.25;\n private readonly _defaultMinRatio = 0.15;\n private readonly _defaultMaxRatio = 0.6;\n private _minRatio = this._defaultMinRatio;\n private _maxRatio = this._defaultMaxRatio;\n\n public override state: ColumnResizingPropertyListPropsSupplierState = {\n columnRatio: this._initialRatio,\n isResizeHandleHovered: false,\n isResizeHandleBeingDragged: false,\n };\n\n public static defaultProps: Partial<ColumnResizingPropertyListPropsSupplierProps> =\n {\n minLabelWidth: 100,\n minValueWidth: 100,\n };\n\n private _onColumnRatioChanged = (ratio: number): RatioChangeResult => {\n ratio = UiGeometry.clamp(ratio, this._minRatio, this._maxRatio);\n if (this.state.columnRatio === ratio) return { ratio };\n\n this.setState({ columnRatio: ratio });\n return { ratio };\n };\n\n // istanbul ignore next\n private _onResizeHandleHoverChanged = (isHovered: boolean) => {\n this.setState({ isResizeHandleHovered: isHovered });\n };\n\n private _onResizeHandleDragChanged = (isDragStarted: boolean) => {\n this.setState({ isResizeHandleBeingDragged: isDragStarted });\n };\n\n private isMinimumColumnSizeEnabled() {\n if (this.props.orientation !== Orientation.Horizontal) return false;\n\n // calculated how much width all the borders of nested properties takes up.\n const bordersWidth = this.props.maxPropertyDepth\n ? this.props.maxPropertyDepth * BORDER_WIDTH\n : 0;\n const actionButtonWidth = this.props.actionButtonWidth ?? 0;\n\n // minimum with required to render property. This consists of:\n // * minimum label width\n // * 1px resizer\n // * minimum value width\n // * actions buttons width\n // * all nested borders width\n // * padding\n const propertyWidth =\n this.props.minLabelWidth! +\n 1 +\n this.props.minValueWidth! +\n actionButtonWidth +\n bordersWidth +\n PROPERTY_PADDING;\n // default behavior for screens that are too small to have minimum column widths\n if (this.props.width < propertyWidth) {\n this._minRatio = this._defaultMinRatio;\n // if there are action buttons calculate maximum ratio for label. Otherwise use default.\n this._maxRatio = this.props.actionButtonWidth\n ? (this.props.width -\n this.props.actionButtonWidth -\n bordersWidth -\n PROPERTY_PADDING -\n VALUE_MIN_WIDTH) /\n this.props.width\n : this._defaultMaxRatio;\n return false;\n }\n\n this._minRatio = this.props.minLabelWidth! / this.props.width;\n this._maxRatio =\n (this.props.width - actionButtonWidth - this.props.minValueWidth!) /\n this.props.width;\n return true;\n }\n\n private getValidColumnRatio(): number {\n return UiGeometry.clamp(\n this.state.columnRatio,\n this._minRatio,\n this._maxRatio\n );\n }\n\n public override render() {\n const listProps: ColumnResizeRelatedPropertyListProps = {\n orientation: this.props.orientation,\n width: this.props.width,\n onColumnChanged: this._onColumnRatioChanged,\n columnRatio: this.getValidColumnRatio(),\n isResizeHandleHovered: this.state.isResizeHandleHovered,\n onResizeHandleHoverChanged: this._onResizeHandleHoverChanged,\n isResizeHandleBeingDragged: this.state.isResizeHandleBeingDragged,\n onResizeHandleDragChanged: this._onResizeHandleDragChanged,\n columnInfo: {\n minLabelWidth: this.props.minLabelWidth!,\n minValueWidth: this.props.minValueWidth!,\n actionButtonWidth: this.props.actionButtonWidth!,\n isMinimumColumnSizeEnabled: this.isMinimumColumnSizeEnabled(),\n },\n };\n return this.props.children(listProps);\n }\n}\n"]}
1
+ {"version":3,"file":"ColumnResizingPropertyListPropsSupplier.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;AAE/B,kDAA4D;AAG5D,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,eAAe,GAAG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BAAmB;QACzB,OAAO,uBAAU,CAAC,KAAK,CACrB,IAAI,CAAC,KAAK,CAAC,WAAW,EACtB,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;IAEe,MAAM;QACpB,MAAM,SAAS,GAAyC;YACtD,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACvB,eAAe,EAAE,IAAI,CAAC,qBAAqB;YAC3C,WAAW,EAAE,IAAI,CAAC,mBAAmB,EAAE;YACvC,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB;YACvD,0BAA0B,EAAE,IAAI,CAAC,2BAA2B;YAC5D,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B;YACjE,yBAAyB,EAAE,IAAI,CAAC,0BAA0B;YAC1D,UAAU,EAAE;gBACV,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAc;gBACxC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAc;gBACxC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAkB;gBAChD,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,EAAE;aAC9D;SACF,CAAC;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;;AA9Fa,oDAAY,GACxB;IACE,aAAa,EAAE,GAAG;IAClB,aAAa,EAAE,GAAG;CACnB,AAJuB,CAItB;AApBO,0FAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { RatioChangeResult } from \"@itwin/core-react\";\nimport { Orientation, UiGeometry } from \"@itwin/core-react\";\nimport type { PropertyListProps } from \"./PropertyList\";\n\nconst BORDER_WIDTH = 10;\nconst PROPERTY_PADDING = 16;\nconst VALUE_MIN_WIDTH = 10;\n\n/** @internal */\nexport type ColumnResizeRelatedPropertyListProps = Required<\n Pick<\n PropertyListProps,\n | \"onColumnChanged\"\n | \"columnRatio\"\n | \"isResizeHandleHovered\"\n | \"onResizeHandleHoverChanged\"\n | \"isResizeHandleBeingDragged\"\n | \"onResizeHandleDragChanged\"\n | \"columnInfo\"\n | \"orientation\"\n | \"width\"\n >\n>;\n\n/** @internal */\nexport interface ColumnResizingPropertyListPropsSupplierProps {\n /** Orientation of the properties */\n orientation: Orientation;\n /** Width of the property list */\n width: number;\n /** Minimum allowed label column width, after which resizing stops */\n minLabelWidth?: number;\n /** Minimum allowed value column width, after which resizing stops */\n minValueWidth?: number;\n /** Fixed action button column width */\n actionButtonWidth?: number;\n /** Maximum depth of the properties shown */\n maxPropertyDepth?: number;\n /** A callback that receives the required column-resize-related props for the [[PropertyList]] component */\n children: (props: ColumnResizeRelatedPropertyListProps) => React.ReactNode;\n}\n\n/** @internal */\nexport interface ColumnResizingPropertyListPropsSupplierState {\n columnRatio: number;\n isResizeHandleHovered: boolean;\n isResizeHandleBeingDragged: boolean;\n}\n\n/**\n * Wrapped PropertyCategoryBlock React component with list of properties and render optimization\n * @internal\n */\nexport class ColumnResizingPropertyListPropsSupplier extends React.Component<\n ColumnResizingPropertyListPropsSupplierProps,\n ColumnResizingPropertyListPropsSupplierState\n> {\n private readonly _initialRatio = 0.25;\n private readonly _defaultMinRatio = 0.15;\n private readonly _defaultMaxRatio = 0.6;\n private _minRatio = this._defaultMinRatio;\n private _maxRatio = this._defaultMaxRatio;\n\n public override state: ColumnResizingPropertyListPropsSupplierState = {\n columnRatio: this._initialRatio,\n isResizeHandleHovered: false,\n isResizeHandleBeingDragged: false,\n };\n\n public static defaultProps: Partial<ColumnResizingPropertyListPropsSupplierProps> =\n {\n minLabelWidth: 100,\n minValueWidth: 100,\n };\n\n private _onColumnRatioChanged = (ratio: number): RatioChangeResult => {\n ratio = UiGeometry.clamp(ratio, this._minRatio, this._maxRatio);\n if (this.state.columnRatio === ratio) return { ratio };\n\n this.setState({ columnRatio: ratio });\n return { ratio };\n };\n\n // istanbul ignore next\n private _onResizeHandleHoverChanged = (isHovered: boolean) => {\n this.setState({ isResizeHandleHovered: isHovered });\n };\n\n private _onResizeHandleDragChanged = (isDragStarted: boolean) => {\n this.setState({ isResizeHandleBeingDragged: isDragStarted });\n };\n\n private isMinimumColumnSizeEnabled() {\n if (this.props.orientation !== Orientation.Horizontal) return false;\n\n // calculated how much width all the borders of nested properties takes up.\n const bordersWidth = this.props.maxPropertyDepth\n ? this.props.maxPropertyDepth * BORDER_WIDTH\n : 0;\n const actionButtonWidth = this.props.actionButtonWidth ?? 0;\n\n // minimum with required to render property. This consists of:\n // * minimum label width\n // * 1px resizer\n // * minimum value width\n // * actions buttons width\n // * all nested borders width\n // * padding\n const propertyWidth =\n this.props.minLabelWidth! +\n 1 +\n this.props.minValueWidth! +\n actionButtonWidth +\n bordersWidth +\n PROPERTY_PADDING;\n // default behavior for screens that are too small to have minimum column widths\n if (this.props.width < propertyWidth) {\n this._minRatio = this._defaultMinRatio;\n // if there are action buttons calculate maximum ratio for label. Otherwise use default.\n this._maxRatio = this.props.actionButtonWidth\n ? (this.props.width -\n this.props.actionButtonWidth -\n bordersWidth -\n PROPERTY_PADDING -\n VALUE_MIN_WIDTH) /\n this.props.width\n : this._defaultMaxRatio;\n return false;\n }\n\n this._minRatio = this.props.minLabelWidth! / this.props.width;\n this._maxRatio =\n (this.props.width - actionButtonWidth - this.props.minValueWidth!) /\n this.props.width;\n return true;\n }\n\n private getValidColumnRatio(): number {\n return UiGeometry.clamp(\n this.state.columnRatio,\n this._minRatio,\n this._maxRatio\n );\n }\n\n public override render() {\n const listProps: ColumnResizeRelatedPropertyListProps = {\n orientation: this.props.orientation,\n width: this.props.width,\n onColumnChanged: this._onColumnRatioChanged,\n columnRatio: this.getValidColumnRatio(),\n isResizeHandleHovered: this.state.isResizeHandleHovered,\n onResizeHandleHoverChanged: this._onResizeHandleHoverChanged,\n isResizeHandleBeingDragged: this.state.isResizeHandleBeingDragged,\n onResizeHandleDragChanged: this._onResizeHandleDragChanged,\n columnInfo: {\n minLabelWidth: this.props.minLabelWidth!,\n minValueWidth: this.props.minValueWidth!,\n actionButtonWidth: this.props.actionButtonWidth!,\n isMinimumColumnSizeEnabled: this.isMinimumColumnSizeEnabled(),\n },\n };\n return this.props.children(listProps);\n }\n}\n"]}
@@ -51,9 +51,10 @@ class PropertyCategoryBlock extends React.Component {
51
51
  }
52
52
  /** @internal */
53
53
  render() {
54
+ var _a;
54
55
  const { highlight, category, children, onExpansionToggled, ...other } = this.props;
55
56
  const activeMatchIndex = this.props.category.name ===
56
- highlight?.activeHighlight?.highlightedItemIdentifier
57
+ ((_a = highlight === null || highlight === void 0 ? void 0 : highlight.activeHighlight) === null || _a === void 0 ? void 0 : _a.highlightedItemIdentifier)
57
58
  ? highlight.activeHighlight.highlightIndex
58
59
  : undefined;
59
60
  const label = highlight ? (React.createElement(HighlightedText_1.HighlightedText, { text: category.label, activeMatchIndex: activeMatchIndex, searchText: highlight.highlightedText })) : (category.label);
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategoryBlock.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyCategoryBlock.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,wDAAuD;AACvD,kEAA+D;AAmB/D;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,KAAK,CAAC,SAAqC;IACpF,YAAY,KAAiC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QAQP,kBAAa,GAAG,CAAC,YAAqB,EAAQ,EAAE;YACtD,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC;IATF,CAAC;IAEO,eAAe;QACrB,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB;YAC/B,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAMD,gBAAgB;IACA,MAAM;QACpB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,GACnE,IAAI,CAAC,KAAK,CAAC;QACb,MAAM,gBAAgB,GACpB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI;YACxB,SAAS,EAAE,eAAe,EAAE,yBAAyB;YACnD,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,cAAc;YAC1C,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CACxB,oBAAC,iCAAe,IACd,IAAI,EAAE,QAAQ,CAAC,KAAK,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,SAAS,CAAC,eAAe,GACrC,CACH,CAAC,CAAC,CAAC,CACF,QAAQ,CAAC,KAAK,CACf,CAAC;QACF,OAAO,CACL,oBAAC,+BAAe,CAAC,OAAO,IACtB,UAAU,EAAE,QAAQ,CAAC,MAAM,EAC3B,QAAQ,EAAE,IAAI,CAAC,aAAa,EAC5B,IAAI,EAAC,OAAO,KACR,KAAK;YAET,oBAAC,+BAAe,CAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI;YACzC,oBAAC,+BAAe,CAAC,OAAO,IAAC,SAAS,EAAC,+BAA+B,IAC/D,QAAQ,CAAC,MAAM,IAAI,QAAQ,CACJ,CACF,CAC3B,CAAC;IACJ,CAAC;CACF;AA9CD,sDA8CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { ExpandableBlock } from \"@itwin/itwinui-react\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\n\n/**\n * Properties for the [[PropertyCategoryBlock]] React component\n * @public\n */\nexport interface PropertyCategoryBlockProps extends CommonProps {\n /** Category of the properties */\n category: PropertyCategory;\n /** Callback to when PropertyCategoryBlock gets expended or collapsed */\n onExpansionToggled?: (categoryName: string) => void;\n /** Properties used for highlighting */\n highlight?: HighlightingComponentProps;\n /** Content */\n children?: React.ReactNode;\n}\n\n/**\n * PropertyCategoryBlock React component\n * @public\n */\nexport class PropertyCategoryBlock extends React.Component<PropertyCategoryBlockProps> {\n constructor(props: PropertyCategoryBlockProps) {\n super(props);\n }\n\n private toggleExpansion() {\n if (this.props.onExpansionToggled)\n this.props.onExpansionToggled(this.props.category.name);\n }\n\n private _handleToggle = (_isExpanding: boolean): void => {\n this.toggleExpansion();\n };\n\n /** @internal */\n public override render() {\n const { highlight, category, children, onExpansionToggled, ...other } =\n this.props;\n const activeMatchIndex =\n this.props.category.name ===\n highlight?.activeHighlight?.highlightedItemIdentifier\n ? highlight.activeHighlight.highlightIndex\n : undefined;\n const label = highlight ? (\n <HighlightedText\n text={category.label}\n activeMatchIndex={activeMatchIndex}\n searchText={highlight.highlightedText}\n />\n ) : (\n category.label\n );\n return (\n <ExpandableBlock.Wrapper\n isExpanded={category.expand}\n onToggle={this._handleToggle}\n size=\"small\"\n {...other}\n >\n <ExpandableBlock.Trigger label={label} />\n <ExpandableBlock.Content className=\"components-expandable-content\">\n {category.expand && children}\n </ExpandableBlock.Content>\n </ExpandableBlock.Wrapper>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyCategoryBlock.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyCategoryBlock.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;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R,KAAK;YAET,oBAAC,+BAAe,CAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI;YACzC,oBAAC,+BAAe,CAAC,OAAO,IAAC,SAAS,EAAC,+BAA+B,IAC/D,QAAQ,CAAC,MAAM,IAAI,QAAQ,CACJ,CACF,CAC3B,CAAC;IACJ,CAAC;CACF;AA9CD,sDA8CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { ExpandableBlock } from \"@itwin/itwinui-react\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\n\n/**\n * Properties for the [[PropertyCategoryBlock]] React component\n * @public\n */\nexport interface PropertyCategoryBlockProps extends CommonProps {\n /** Category of the properties */\n category: PropertyCategory;\n /** Callback to when PropertyCategoryBlock gets expended or collapsed */\n onExpansionToggled?: (categoryName: string) => void;\n /** Properties used for highlighting */\n highlight?: HighlightingComponentProps;\n /** Content */\n children?: React.ReactNode;\n}\n\n/**\n * PropertyCategoryBlock React component\n * @public\n */\nexport class PropertyCategoryBlock extends React.Component<PropertyCategoryBlockProps> {\n constructor(props: PropertyCategoryBlockProps) {\n super(props);\n }\n\n private toggleExpansion() {\n if (this.props.onExpansionToggled)\n this.props.onExpansionToggled(this.props.category.name);\n }\n\n private _handleToggle = (_isExpanding: boolean): void => {\n this.toggleExpansion();\n };\n\n /** @internal */\n public override render() {\n const { highlight, category, children, onExpansionToggled, ...other } =\n this.props;\n const activeMatchIndex =\n this.props.category.name ===\n highlight?.activeHighlight?.highlightedItemIdentifier\n ? highlight.activeHighlight.highlightIndex\n : undefined;\n const label = highlight ? (\n <HighlightedText\n text={category.label}\n activeMatchIndex={activeMatchIndex}\n searchText={highlight.highlightedText}\n />\n ) : (\n category.label\n );\n return (\n <ExpandableBlock.Wrapper\n isExpanded={category.expand}\n onToggle={this._handleToggle}\n size=\"small\"\n {...other}\n >\n <ExpandableBlock.Trigger label={label} />\n <ExpandableBlock.Content className=\"components-expandable-content\">\n {category.expand && children}\n </ExpandableBlock.Content>\n </ExpandableBlock.Wrapper>\n );\n }\n}\n"]}
@@ -13,10 +13,10 @@ const Links_1 = require("../../common/Links");
13
13
  /** @internal */
14
14
  class PropertyGridCommons {
15
15
  static getCurrentOrientation(width, preferredOrientation, isOrientationFixed, horizontalOrientationMinWidth) {
16
- const orientation = preferredOrientation ?? core_react_1.Orientation.Horizontal;
16
+ const orientation = preferredOrientation !== null && preferredOrientation !== void 0 ? preferredOrientation : core_react_1.Orientation.Horizontal;
17
17
  if (isOrientationFixed)
18
18
  return orientation;
19
- horizontalOrientationMinWidth = horizontalOrientationMinWidth ?? 300;
19
+ horizontalOrientationMinWidth = horizontalOrientationMinWidth !== null && horizontalOrientationMinWidth !== void 0 ? horizontalOrientationMinWidth : 300;
20
20
  // Switch to Vertical if width too small
21
21
  if (width < horizontalOrientationMinWidth)
22
22
  return core_react_1.Orientation.Vertical;
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridCommons.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH,kDAAgD;AAEhD,8CAAgD;AAgGhD,gBAAgB;AAChB,MAAa,mBAAmB;IACvB,MAAM,CAAC,qBAAqB,CACjC,KAAa,EACb,oBAAkC,EAClC,kBAA4B,EAC5B,6BAAsC;QAEtC,MAAM,WAAW,GAAG,oBAAoB,IAAI,wBAAW,CAAC,UAAU,CAAC;QACnE,IAAI,kBAAkB;YAAE,OAAO,WAAW,CAAC;QAE3C,6BAA6B,GAAG,6BAA6B,IAAI,GAAG,CAAC;QACrE,wCAAwC;QACxC,IAAI,KAAK,GAAG,6BAA6B;YAAE,OAAO,wBAAW,CAAC,QAAQ,CAAC;QAEvE,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,MAAM,UAAU,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC;QACpC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO;QACnC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,uBAAuB;QACvB,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,EAAE;YAC9B,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK;gBAC9D,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC;iBAC3B;gBACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gBACxD,IAAI,UAAU;oBAAE,UAAU,CAAC,KAAK,EAAE,CAAC;aACpC;SACF;IACH,CAAC;;AAED;;;GAGG;AACW,4BAAQ,GAAG,CACvB,KAAa,EAC0B,EAAE;IACzC,OAAO,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,GAAG,CAC1B,CAAC,QAA8C,EAAE,EAAE;QACjD,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAhDS,kDAAmB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { matchLinks } from \"../../common/Links\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport type { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\nimport type { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\nimport type { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\n\n/** Arguments for the Property Editing event callback\n * @public\n */\nexport interface PropertyEditingArgs {\n /** PropertyRecord being edited */\n propertyRecord: PropertyRecord;\n /** Unique key of currently edited property */\n propertyKey?: string;\n}\n\n/** Arguments for `PropertyGridProps.onPropertyContextMenu` callback\n * @public\n */\nexport interface PropertyGridContextMenuArgs {\n /** PropertyRecord being edited */\n propertyRecord: PropertyRecord;\n /** An event which caused the context menu callback */\n event: React.MouseEvent;\n}\n\n/**\n * Common Property Grid Props to be used by Property Grid Variants\n * @public\n */\nexport interface CommonPropertyGridProps extends CommonProps {\n /** Grid orientation. When not defined, it is chosen automatically based on width of the grid. */\n orientation?: Orientation;\n\n /** Enables/disables property hovering effect */\n isPropertyHoverEnabled?: boolean;\n\n /** Called to show a context menu when properties are right-clicked */\n onPropertyContextMenu?: (args: PropertyGridContextMenuArgs) => void;\n\n /** Enables/disables property selection */\n isPropertySelectionEnabled?: boolean;\n /** Enables/disables property selection with right click */\n isPropertySelectionOnRightClickEnabled?: boolean;\n /** Callback to property selection */\n onPropertySelectionChanged?: (property: PropertyRecord) => void;\n\n /** Enables/disables property editing */\n isPropertyEditingEnabled?: boolean;\n /** Callback for when properties are being edited */\n onPropertyEditing?: (\n args: PropertyEditingArgs,\n category: PropertyCategory\n ) => void;\n /** Callback for when properties are updated */\n onPropertyUpdated?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => Promise<boolean>;\n\n /** Custom property value renderer manager */\n propertyValueRendererManager?: PropertyValueRendererManager;\n\n /** Indicates whether the orientation is fixed and does not auto-switch to Vertical when the width is too narrow. Defaults to false. */\n isOrientationFixed?: boolean;\n /** The minimum width before the auto-switch to Vertical when the width is too narrow. Defaults to 300. */\n horizontalOrientationMinWidth?: number;\n\n /** Minimum allowed label column width, after which resizing stops */\n minLabelWidth?: number;\n /** Minimum allowed value column width, after which resizing stops */\n minValueWidth?: number;\n /** Fixed action button column width */\n actionButtonWidth?: number;\n\n /**\n * Array of action button renderers. Each renderer is called for each property and can decide\n * to render an action button for the property or not.\n */\n actionButtonRenderers?: ActionButtonRenderer[];\n}\n\n/**\n * Properties for highlighting text in property grid.\n * @public\n */\nexport interface PropertyGridContentHighlightProps\n extends HighlightingComponentProps {\n /**\n * Specifies what the highlighting should be applied on - category labels, property labels and / or property values.\n * Defaults to \"nowhere\".\n */\n filteredTypes?: FilteredType[];\n}\n\n/** @internal */\nexport class PropertyGridCommons {\n public static getCurrentOrientation(\n width: number,\n preferredOrientation?: Orientation,\n isOrientationFixed?: boolean,\n horizontalOrientationMinWidth?: number\n ): Orientation {\n const orientation = preferredOrientation ?? Orientation.Horizontal;\n if (isOrientationFixed) return orientation;\n\n horizontalOrientationMinWidth = horizontalOrientationMinWidth ?? 300;\n // Switch to Vertical if width too small\n if (width < horizontalOrientationMinWidth) return Orientation.Vertical;\n\n return orientation;\n }\n\n /**\n * Helper method to handle link clicks\n * @internal\n */\n public static handleLinkClick(text: string) {\n const linksArray = matchLinks(text);\n if (linksArray.length <= 0) return;\n const foundLink = linksArray[0];\n // istanbul ignore else\n if (foundLink && foundLink.url) {\n if (foundLink.schema === \"mailto:\" || foundLink.schema === \"pw:\")\n location.href = foundLink.url;\n else {\n const windowOpen = window.open(foundLink.url, \"_blank\");\n if (windowOpen) windowOpen.focus();\n }\n }\n }\n\n /**\n * A helper method to get links from string.\n * @internal\n */\n public static getLinks = (\n value: string\n ): Array<{ start: number; end: number }> => {\n return matchLinks(value).map(\n (linkInfo: { index: number; lastIndex: number }) => {\n return { start: linkInfo.index, end: linkInfo.lastIndex };\n }\n );\n };\n}\n"]}
1
+ {"version":3,"file":"PropertyGridCommons.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH,kDAAgD;AAEhD,8CAAgD;AAgGhD,gBAAgB;AAChB,MAAa,mBAAmB;IACvB,MAAM,CAAC,qBAAqB,CACjC,KAAa,EACb,oBAAkC,EAClC,kBAA4B,EAC5B,6BAAsC;QAEtC,MAAM,WAAW,GAAG,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,wBAAW,CAAC,UAAU,CAAC;QACnE,IAAI,kBAAkB;YAAE,OAAO,WAAW,CAAC;QAE3C,6BAA6B,GAAG,6BAA6B,aAA7B,6BAA6B,cAA7B,6BAA6B,GAAI,GAAG,CAAC;QACrE,wCAAwC;QACxC,IAAI,KAAK,GAAG,6BAA6B;YAAE,OAAO,wBAAW,CAAC,QAAQ,CAAC;QAEvE,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,MAAM,UAAU,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC;QACpC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO;QACnC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,uBAAuB;QACvB,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,EAAE;YAC9B,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK;gBAC9D,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC;iBAC3B;gBACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gBACxD,IAAI,UAAU;oBAAE,UAAU,CAAC,KAAK,EAAE,CAAC;aACpC;SACF;IACH,CAAC;;AAED;;;GAGG;AACW,4BAAQ,GAAG,CACvB,KAAa,EAC0B,EAAE;IACzC,OAAO,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,GAAG,CAC1B,CAAC,QAA8C,EAAE,EAAE;QACjD,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAhDS,kDAAmB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { matchLinks } from \"../../common/Links\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport type { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\nimport type { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\nimport type { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\n\n/** Arguments for the Property Editing event callback\n * @public\n */\nexport interface PropertyEditingArgs {\n /** PropertyRecord being edited */\n propertyRecord: PropertyRecord;\n /** Unique key of currently edited property */\n propertyKey?: string;\n}\n\n/** Arguments for `PropertyGridProps.onPropertyContextMenu` callback\n * @public\n */\nexport interface PropertyGridContextMenuArgs {\n /** PropertyRecord being edited */\n propertyRecord: PropertyRecord;\n /** An event which caused the context menu callback */\n event: React.MouseEvent;\n}\n\n/**\n * Common Property Grid Props to be used by Property Grid Variants\n * @public\n */\nexport interface CommonPropertyGridProps extends CommonProps {\n /** Grid orientation. When not defined, it is chosen automatically based on width of the grid. */\n orientation?: Orientation;\n\n /** Enables/disables property hovering effect */\n isPropertyHoverEnabled?: boolean;\n\n /** Called to show a context menu when properties are right-clicked */\n onPropertyContextMenu?: (args: PropertyGridContextMenuArgs) => void;\n\n /** Enables/disables property selection */\n isPropertySelectionEnabled?: boolean;\n /** Enables/disables property selection with right click */\n isPropertySelectionOnRightClickEnabled?: boolean;\n /** Callback to property selection */\n onPropertySelectionChanged?: (property: PropertyRecord) => void;\n\n /** Enables/disables property editing */\n isPropertyEditingEnabled?: boolean;\n /** Callback for when properties are being edited */\n onPropertyEditing?: (\n args: PropertyEditingArgs,\n category: PropertyCategory\n ) => void;\n /** Callback for when properties are updated */\n onPropertyUpdated?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => Promise<boolean>;\n\n /** Custom property value renderer manager */\n propertyValueRendererManager?: PropertyValueRendererManager;\n\n /** Indicates whether the orientation is fixed and does not auto-switch to Vertical when the width is too narrow. Defaults to false. */\n isOrientationFixed?: boolean;\n /** The minimum width before the auto-switch to Vertical when the width is too narrow. Defaults to 300. */\n horizontalOrientationMinWidth?: number;\n\n /** Minimum allowed label column width, after which resizing stops */\n minLabelWidth?: number;\n /** Minimum allowed value column width, after which resizing stops */\n minValueWidth?: number;\n /** Fixed action button column width */\n actionButtonWidth?: number;\n\n /**\n * Array of action button renderers. Each renderer is called for each property and can decide\n * to render an action button for the property or not.\n */\n actionButtonRenderers?: ActionButtonRenderer[];\n}\n\n/**\n * Properties for highlighting text in property grid.\n * @public\n */\nexport interface PropertyGridContentHighlightProps\n extends HighlightingComponentProps {\n /**\n * Specifies what the highlighting should be applied on - category labels, property labels and / or property values.\n * Defaults to \"nowhere\".\n */\n filteredTypes?: FilteredType[];\n}\n\n/** @internal */\nexport class PropertyGridCommons {\n public static getCurrentOrientation(\n width: number,\n preferredOrientation?: Orientation,\n isOrientationFixed?: boolean,\n horizontalOrientationMinWidth?: number\n ): Orientation {\n const orientation = preferredOrientation ?? Orientation.Horizontal;\n if (isOrientationFixed) return orientation;\n\n horizontalOrientationMinWidth = horizontalOrientationMinWidth ?? 300;\n // Switch to Vertical if width too small\n if (width < horizontalOrientationMinWidth) return Orientation.Vertical;\n\n return orientation;\n }\n\n /**\n * Helper method to handle link clicks\n * @internal\n */\n public static handleLinkClick(text: string) {\n const linksArray = matchLinks(text);\n if (linksArray.length <= 0) return;\n const foundLink = linksArray[0];\n // istanbul ignore else\n if (foundLink && foundLink.url) {\n if (foundLink.schema === \"mailto:\" || foundLink.schema === \"pw:\")\n location.href = foundLink.url;\n else {\n const windowOpen = window.open(foundLink.url, \"_blank\");\n if (windowOpen) windowOpen.focus();\n }\n }\n }\n\n /**\n * A helper method to get links from string.\n * @internal\n */\n public static getLinks = (\n value: string\n ): Array<{ start: number; end: number }> => {\n return matchLinks(value).map(\n (linkInfo: { index: number; lastIndex: number }) => {\n return { start: linkInfo.index, end: linkInfo.lastIndex };\n }\n );\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridEventsRelatedPropsSupplier.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,gBAAgB;AAChB,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAC/C,iBAAiB,EACf,mBAAmB,GACnB,wBAAwB,GACxB,uBAAuB,GACvB,cAAc,GACd,cAAc,GACd,qBAAqB,GACrB,oBAAoB,CACvB,GACC,IAAI,CACF,uBAAuB,EACvB,wCAAwC,GAAG,0BAA0B,CACtE,GACD,QAAQ,CACN,IAAI,CACF,uBAAuB,EACvB,wBAAwB,GAAG,4BAA4B,CACxD,CACF,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,2CAA2C,GAAG,IAAI,CAC5D,uBAAuB,EACrB,uBAAuB,GACvB,wCAAwC,GACxC,wCAAwC,GACxC,4BAA4B,GAC5B,0BAA0B,GAC1B,mBAAmB,CACtB,GACC,QAAQ,CACN,IAAI,CACF,uBAAuB,EACvB,wBAAwB,GAAG,4BAA4B,CACxD,CACF,GAAG;IACF,QAAQ,EAAE,CAAC,OAAO,EAAE,8BAA8B,KAAK,KAAK,CAAC,SAAS,CAAC;CACxE,CAAC;AAEJ;;GAEG;AACH,UAAU,2CAA2C;IACnD,gDAAgD;IAChD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,sCAAuC,SAAQ,KAAK,CAAC,SAAS,CACzE,2CAA2C,EAC3C,2CAA2C,CAC5C;IACC,gBAAgB;gBACJ,KAAK,EAAE,2CAA2C;IAK9D,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,uBAAuB,CAO7B;IAEF,OAAO,CAAC,kBAAkB,CAIxB;IAEF,OAAO,CAAC,sBAAsB,CAO5B;IAEF,OAAO,CAAC,aAAa,CASnB;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,6BAA6B;IAgBrC,OAAO,CAAC,4BAA4B;IAgCpC,gBAAgB;IACA,MAAM;CAwBvB"}
1
+ {"version":3,"file":"PropertyGridEventsRelatedPropsSupplier.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK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AAa,CAEnB;IAEF,OAAO,CAAC,6BAA6B;IAgBrC,OAAO,CAAC,4BAA4B;IA8BpC,gBAAgB;IACA,MAAM;CAwBvB"}
@@ -33,7 +33,6 @@ exports.PropertyGridEventsRelatedPropsSupplier = void 0;
33
33
  */
34
34
  require("./PropertyGrid.scss");
35
35
  const React = __importStar(require("react"));
36
- const appui_abstract_1 = require("@itwin/appui-abstract");
37
36
  /** PropertyGridEventsRelatedPropsSupplier React component.
38
37
  * @internal
39
38
  */
@@ -88,10 +87,9 @@ class PropertyGridEventsRelatedPropsSupplier extends React.Component {
88
87
  onEnabledPropertyLeftClicked(property, key) {
89
88
  let selectedPropertyKey = this.state.selectedPropertyKey;
90
89
  let editingPropertyKey = this.state.editingPropertyKey;
91
- const isValuePrimitive = property.value.valueFormat === appui_abstract_1.PropertyValueFormat.Primitive;
92
90
  const isEditingEnabled = this.props.isPropertyEditingEnabled;
93
91
  const isSelectionEnabled = this.props.isPropertySelectionEnabled;
94
- if (isEditingEnabled && isValuePrimitive) {
92
+ if (isEditingEnabled) {
95
93
  // Deselect editing key only if another selection was made
96
94
  editingPropertyKey =
97
95
  isSelectionEnabled && selectedPropertyKey !== key ? undefined : key;
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridEventsRelatedPropsSupplier.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhG;;GAEG;AACH,+BAA6B;AAC7B,6CAA+B;AAE/B,0DAA4D;AA2D5D;;GAEG;AACH,MAAa,sCAAuC,SAAQ,KAAK,CAAC,SAGjE;IACC,gBAAgB;IAChB,YAAY,KAAkD;QAC5D,KAAK,CAAC,KAAK,CAAC,CAAC;QAeP,4BAAuB,GAAG,CAChC,QAAwB,EACxB,GAAY,EACZ,EAAE;YACF,uBAAuB;YACvB,IAAI,IAAI,CAAC,sBAAsB,EAAE;gB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,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpE,IAAI,IAAI,CAAC,KAAK,CAAC,0BAA0B;YACvC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;QAElD,IAAI,CAAC,QAAQ,CAAC,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,aAAa,GAAmC;YACpD,sBAAsB,EAAE,IAAI,CAAC,KAAK,CAAC,sBAAsB;YACzD,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B;YACjE,sCAAsC,EACpC,IAAI,CAAC,KAAK,CAAC,sCAAsC;YACnD,wBAAwB,EAAE,IAAI,CAAC,KAAK,CAAC,wBAAwB;YAC7D,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB;YACnD,kBAAkB,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB;YACjD,YAAY,EAAE,IAAI,CAAC,aAAa;YAChC,YAAY,EAAE,IAAI,CAAC,aAAa;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE;gBACzC,CAAC,CAAC,IAAI,CAAC,kBAAkB;gBACzB,CAAC,CAAC,SAAS;YACb,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EAAE;gBACnD,CAAC,CAAC,IAAI,CAAC,uBAAuB;gBAC9B,CAAC,CAAC,SAAS;YACb,qBAAqB,EAAE,IAAI,CAAC,sBAAsB;SACnD,CAAC;QAEF,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,QAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAkB,CACtE,CAAC;IACJ,CAAC;CACF;AArID,wFAqIC","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 PropertyGrid\n */\nimport \"./PropertyGrid.scss\";\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\nimport type { CommonPropertyGridProps } from \"./PropertyGridCommons\";\nimport type { PropertyListProps } from \"./PropertyList\";\n\n/** @internal */\nexport type PropertyGridEventsRelatedProps = Pick<\n PropertyListProps,\n | \"onPropertyClicked\"\n | \"onPropertyRightClicked\"\n | \"onPropertyContextMenu\"\n | \"onEditCommit\"\n | \"onEditCancel\"\n | \"selectedPropertyKey\"\n | \"editingPropertyKey\"\n> &\n Pick<\n CommonPropertyGridProps,\n \"isPropertySelectionOnRightClickEnabled\" | \"isPropertyEditingEnabled\"\n > &\n Required<\n Pick<\n CommonPropertyGridProps,\n \"isPropertyHoverEnabled\" | \"isPropertySelectionEnabled\"\n >\n >;\n\n/** Properties for [[PropertyGridEventsRelatedPropsSupplier]] React component\n * @internal\n */\nexport type PropertyGridEventsRelatedPropsSupplierProps = Pick<\n CommonPropertyGridProps,\n | \"onPropertyContextMenu\"\n | \"isPropertySelectionOnRightClickEnabled\"\n | \"isPropertySelectionOnRightClickEnabled\"\n | \"onPropertySelectionChanged\"\n | \"isPropertyEditingEnabled\"\n | \"onPropertyUpdated\"\n> &\n Required<\n Pick<\n CommonPropertyGridProps,\n \"isPropertyHoverEnabled\" | \"isPropertySelectionEnabled\"\n >\n > & {\n children: (context: PropertyGridEventsRelatedProps) => React.ReactNode;\n };\n\n/** State of [[PropertyGridEventsRelatedPropsSupplier]] React component\n * @internal\n */\ninterface PropertyGridEventsRelatedPropsSupplierState {\n /** Unique key of currently selected property */\n selectedPropertyKey?: string;\n /** Unique key of currently edited property */\n editingPropertyKey?: string;\n}\n\n/** PropertyGridEventsRelatedPropsSupplier React component.\n * @internal\n */\nexport class PropertyGridEventsRelatedPropsSupplier extends React.Component<\n PropertyGridEventsRelatedPropsSupplierProps,\n PropertyGridEventsRelatedPropsSupplierState\n> {\n /** @internal */\n constructor(props: PropertyGridEventsRelatedPropsSupplierProps) {\n super(props);\n this.state = {};\n }\n\n private _isClickSupported() {\n return (\n this.props.isPropertySelectionEnabled ||\n this.props.isPropertyEditingEnabled\n );\n }\n\n private _isRightClickSupported() {\n return this.props.isPropertySelectionOnRightClickEnabled;\n }\n\n private _onPropertyRightClicked = (\n property: PropertyRecord,\n key?: string\n ) => {\n // istanbul ignore else\n if (this._isRightClickSupported())\n this.onEnabledPropertyRightClicked(property, key);\n };\n\n private _onPropertyClicked = (property: PropertyRecord, key?: string) => {\n // istanbul ignore else\n if (this._isClickSupported())\n this.onEnabledPropertyLeftClicked(property, key);\n };\n\n private _onPropertyContextMenu = (\n property: PropertyRecord,\n e: React.MouseEvent\n ) => {\n if (this.props.onPropertyContextMenu) {\n this.props.onPropertyContextMenu({ propertyRecord: property, event: e });\n }\n };\n\n private _onEditCommit = async (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => {\n // istanbul ignore else\n if (this.props.onPropertyUpdated) {\n await this.props.onPropertyUpdated(args, category);\n this.setState({ editingPropertyKey: undefined });\n }\n };\n\n private _onEditCancel = () => {\n this.setState({ editingPropertyKey: undefined });\n };\n\n private onEnabledPropertyRightClicked(\n property: PropertyRecord,\n key: string | undefined\n ) {\n let selectedPropertyKey = this.state.selectedPropertyKey;\n let editingPropertyKey = this.state.editingPropertyKey;\n\n editingPropertyKey = undefined;\n if (selectedPropertyKey !== key) selectedPropertyKey = key;\n\n if (this.props.onPropertySelectionChanged)\n this.props.onPropertySelectionChanged(property);\n\n this.setState({ selectedPropertyKey, editingPropertyKey });\n }\n\n private onEnabledPropertyLeftClicked(\n property: PropertyRecord,\n key: string | undefined\n ) {\n let selectedPropertyKey = this.state.selectedPropertyKey;\n let editingPropertyKey = this.state.editingPropertyKey;\n\n const isValuePrimitive =\n property.value.valueFormat === PropertyValueFormat.Primitive;\n const isEditingEnabled = this.props.isPropertyEditingEnabled;\n const isSelectionEnabled = this.props.isPropertySelectionEnabled;\n\n if (isEditingEnabled && isValuePrimitive) {\n // Deselect editing key only if another selection was made\n editingPropertyKey =\n isSelectionEnabled && selectedPropertyKey !== key ? undefined : key;\n }\n\n if (editingPropertyKey === key) {\n this.setState({ editingPropertyKey });\n return;\n }\n\n // Select/Deselect\n selectedPropertyKey = selectedPropertyKey !== key ? key : undefined;\n\n if (this.props.onPropertySelectionChanged)\n this.props.onPropertySelectionChanged(property);\n\n this.setState({ selectedPropertyKey, editingPropertyKey });\n }\n\n /** @internal */\n public override render() {\n const renderContext: PropertyGridEventsRelatedProps = {\n isPropertyHoverEnabled: this.props.isPropertyHoverEnabled,\n isPropertySelectionEnabled: this.props.isPropertySelectionEnabled,\n isPropertySelectionOnRightClickEnabled:\n this.props.isPropertySelectionOnRightClickEnabled,\n isPropertyEditingEnabled: this.props.isPropertyEditingEnabled,\n selectedPropertyKey: this.state.selectedPropertyKey,\n editingPropertyKey: this.state.editingPropertyKey,\n onEditCommit: this._onEditCommit,\n onEditCancel: this._onEditCancel,\n onPropertyClicked: this._isClickSupported()\n ? this._onPropertyClicked\n : undefined,\n onPropertyRightClicked: this._isRightClickSupported()\n ? this._onPropertyRightClicked\n : undefined,\n onPropertyContextMenu: this._onPropertyContextMenu,\n };\n\n return (\n <React.Fragment>{this.props.children(renderContext)}</React.Fragment>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyGridEventsRelatedPropsSupplier.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhG;;GAEG;AACH,+BAA6B;AAC7B,6CAA+B;AA4D/B;;GAEG;AACH,MAAa,sCAAuC,SAAQ,KAAK,CAAC,SAGjE;IACC,gBAAgB;IAChB,YAAY,KAAkD;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mBAAmB,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpE,IAAI,IAAI,CAAC,KAAK,CAAC,0BAA0B;YACvC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;QAElD,IAAI,CAAC,QAAQ,CAAC,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,aAAa,GAAmC;YACpD,sBAAsB,EAAE,IAAI,CAAC,KAAK,CAAC,sBAAsB;YACzD,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B;YACjE,sCAAsC,EACpC,IAAI,CAAC,KAAK,CAAC,sCAAsC;YACnD,wBAAwB,EAAE,IAAI,CAAC,KAAK,CAAC,wBAAwB;YAC7D,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB;YACnD,kBAAkB,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB;YACjD,YAAY,EAAE,IAAI,CAAC,aAAa;YAChC,YAAY,EAAE,IAAI,CAAC,aAAa;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE;gBACzC,CAAC,CAAC,IAAI,CAAC,kBAAkB;gBACzB,CAAC,CAAC,SAAS;YACb,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EAAE;gBACnD,CAAC,CAAC,IAAI,CAAC,uBAAuB;gBAC9B,CAAC,CAAC,SAAS;YACb,qBAAqB,EAAE,IAAI,CAAC,sBAAsB;SACnD,CAAC;QAEF,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,QAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAkB,CACtE,CAAC;IACJ,CAAC;CACF;AAnID,wFAmIC","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 PropertyGrid\n */\nimport \"./PropertyGrid.scss\";\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport type { PropertyCategory } from \"../PropertyDataProvider\";\nimport type { CommonPropertyGridProps } from \"./PropertyGridCommons\";\nimport type { PropertyListProps } from \"./PropertyList\";\n\n/** @internal */\nexport type PropertyGridEventsRelatedProps = Pick<\n PropertyListProps,\n | \"onPropertyClicked\"\n | \"onPropertyRightClicked\"\n | \"onPropertyContextMenu\"\n | \"onEditCommit\"\n | \"onEditCancel\"\n | \"selectedPropertyKey\"\n | \"editingPropertyKey\"\n> &\n Pick<\n CommonPropertyGridProps,\n \"isPropertySelectionOnRightClickEnabled\" | \"isPropertyEditingEnabled\"\n > &\n Required<\n Pick<\n CommonPropertyGridProps,\n \"isPropertyHoverEnabled\" | \"isPropertySelectionEnabled\"\n >\n >;\n\n/** Properties for [[PropertyGridEventsRelatedPropsSupplier]] React component\n * @internal\n */\nexport type PropertyGridEventsRelatedPropsSupplierProps = Pick<\n CommonPropertyGridProps,\n | \"onPropertyContextMenu\"\n | \"isPropertySelectionOnRightClickEnabled\"\n | \"isPropertySelectionOnRightClickEnabled\"\n | \"onPropertySelectionChanged\"\n | \"isPropertyEditingEnabled\"\n | \"onPropertyUpdated\"\n> &\n Required<\n Pick<\n CommonPropertyGridProps,\n \"isPropertyHoverEnabled\" | \"isPropertySelectionEnabled\"\n >\n > & {\n children: (context: PropertyGridEventsRelatedProps) => React.ReactNode;\n };\n\n/** State of [[PropertyGridEventsRelatedPropsSupplier]] React component\n * @internal\n */\ninterface PropertyGridEventsRelatedPropsSupplierState {\n /** Unique key of currently selected property */\n selectedPropertyKey?: string;\n /** Unique key of currently edited property */\n editingPropertyKey?: string;\n}\n\n/** PropertyGridEventsRelatedPropsSupplier React component.\n * @internal\n */\nexport class PropertyGridEventsRelatedPropsSupplier extends React.Component<\n PropertyGridEventsRelatedPropsSupplierProps,\n PropertyGridEventsRelatedPropsSupplierState\n> {\n /** @internal */\n constructor(props: PropertyGridEventsRelatedPropsSupplierProps) {\n super(props);\n this.state = {};\n }\n\n private _isClickSupported() {\n return (\n this.props.isPropertySelectionEnabled ||\n this.props.isPropertyEditingEnabled\n );\n }\n\n private _isRightClickSupported() {\n return this.props.isPropertySelectionOnRightClickEnabled;\n }\n\n private _onPropertyRightClicked = (\n property: PropertyRecord,\n key?: string\n ) => {\n // istanbul ignore else\n if (this._isRightClickSupported())\n this.onEnabledPropertyRightClicked(property, key);\n };\n\n private _onPropertyClicked = (property: PropertyRecord, key?: string) => {\n // istanbul ignore else\n if (this._isClickSupported())\n this.onEnabledPropertyLeftClicked(property, key);\n };\n\n private _onPropertyContextMenu = (\n property: PropertyRecord,\n e: React.MouseEvent\n ) => {\n if (this.props.onPropertyContextMenu) {\n this.props.onPropertyContextMenu({ propertyRecord: property, event: e });\n }\n };\n\n private _onEditCommit = async (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => {\n // istanbul ignore else\n if (this.props.onPropertyUpdated) {\n await this.props.onPropertyUpdated(args, category);\n this.setState({ editingPropertyKey: undefined });\n }\n };\n\n private _onEditCancel = () => {\n this.setState({ editingPropertyKey: undefined });\n };\n\n private onEnabledPropertyRightClicked(\n property: PropertyRecord,\n key: string | undefined\n ) {\n let selectedPropertyKey = this.state.selectedPropertyKey;\n let editingPropertyKey = this.state.editingPropertyKey;\n\n editingPropertyKey = undefined;\n if (selectedPropertyKey !== key) selectedPropertyKey = key;\n\n if (this.props.onPropertySelectionChanged)\n this.props.onPropertySelectionChanged(property);\n\n this.setState({ selectedPropertyKey, editingPropertyKey });\n }\n\n private onEnabledPropertyLeftClicked(\n property: PropertyRecord,\n key: string | undefined\n ) {\n let selectedPropertyKey = this.state.selectedPropertyKey;\n let editingPropertyKey = this.state.editingPropertyKey;\n\n const isEditingEnabled = this.props.isPropertyEditingEnabled;\n const isSelectionEnabled = this.props.isPropertySelectionEnabled;\n\n if (isEditingEnabled) {\n // Deselect editing key only if another selection was made\n editingPropertyKey =\n isSelectionEnabled && selectedPropertyKey !== key ? undefined : key;\n }\n\n if (editingPropertyKey === key) {\n this.setState({ editingPropertyKey });\n return;\n }\n\n // Select/Deselect\n selectedPropertyKey = selectedPropertyKey !== key ? key : undefined;\n\n if (this.props.onPropertySelectionChanged)\n this.props.onPropertySelectionChanged(property);\n\n this.setState({ selectedPropertyKey, editingPropertyKey });\n }\n\n /** @internal */\n public override render() {\n const renderContext: PropertyGridEventsRelatedProps = {\n isPropertyHoverEnabled: this.props.isPropertyHoverEnabled,\n isPropertySelectionEnabled: this.props.isPropertySelectionEnabled,\n isPropertySelectionOnRightClickEnabled:\n this.props.isPropertySelectionOnRightClickEnabled,\n isPropertyEditingEnabled: this.props.isPropertyEditingEnabled,\n selectedPropertyKey: this.state.selectedPropertyKey,\n editingPropertyKey: this.state.editingPropertyKey,\n onEditCommit: this._onEditCommit,\n onEditCancel: this._onEditCancel,\n onPropertyClicked: this._isClickSupported()\n ? this._onPropertyClicked\n : undefined,\n onPropertyRightClicked: this._isRightClickSupported()\n ? this._onPropertyRightClicked\n : undefined,\n onPropertyContextMenu: this._onPropertyContextMenu,\n };\n\n return (\n <React.Fragment>{this.props.children(renderContext)}</React.Fragment>\n );\n }\n}\n"]}
@@ -45,8 +45,6 @@ interface VirtualizedPropertyGridState {
45
45
  orientation: Orientation;
46
46
  /** Keeps record of dynamic node heights */
47
47
  dynamicNodeHeights: Map<string, number>;
48
- /** When resetting node height cache, marks the point at which heights have become stale */
49
- resetIndex: number;
50
48
  }
51
49
  /**
52
50
  * Context of [[VirtualizedPropertyGrid]] component.
@@ -100,7 +98,7 @@ export declare class VirtualizedPropertyGrid extends React.Component<Virtualized
100
98
  /** @internal */
101
99
  constructor(props: VirtualizedPropertyGridProps);
102
100
  /** @internal */
103
- componentDidUpdate(prevProps: VirtualizedPropertyGridProps, prevState: VirtualizedPropertyGridState): void;
101
+ componentDidUpdate(prevProps: VirtualizedPropertyGridProps): void;
104
102
  /** @internal */
105
103
  static getDerivedStateFromProps(props: VirtualizedPropertyGridProps, state: VirtualizedPropertyGridState): VirtualizedPropertyGridState | null;
106
104
  private updateOrientation;
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedPropertyGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE1F,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,qCAAqC,CAAC;AAM7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EACV,uBAAuB,EACvB,iCAAiC,EAClC,MAAM,uBAAuB,CAAC;AAK/B;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,uBA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,CAChC,SAAS,EAAE,4BAA4B,EACvC,SAAS,EAAE,4BAA4B;IAkDzC,gBAAgB;WACF,wBAAwB,CACpC,KAAK,EAAE,4BAA4B,EACnC,KAAK,EAAE,4BAA4B,GAClC,4BAA4B,GAAG,IAAI;IAOtC,OAAO,CAAC,iBAAiB;IAkBzB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IA2C3B,OAAO,CAAC,uBAAuB,CAmB7B;IAEF,OAAO,CAAC,2BAA2B,CAGjC;IAEF,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,WAAW,CAGjB;IAEF,OAAO,CAAC,gBAAgB,CAQtB;IAEF,gBAAgB;IACA,MAAM;CAyHvB;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CAAC,CAAC,SAAS,OAAO;;;;EAExE"}
1
+ {"version":3,"file":"VirtualizedPropertyGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE1F,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,qCAAqC,CAAC;AAM7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACtF,O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,CAAC;IAExD,SAAS,CAAC,EAAE,iCAAiC,CAAC;CAC/C;AAeD;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK,CAAC,SAAS,CAC1D,4BAA4B,EAC5B,4BAA4B,CAC7B;IACC,OAAO,CAAC,QAAQ,CAAuC;IAEvD,gBAAgB;gBACJ,KAAK,EAAE,4BAA4B;IAgB/C,gBAAgB;IACA,kBAAkB,CAAC,SAAS,EAAE,4BAA4B;IA2C1E,gBAAgB;WACF,wBAAwB,CACpC,KAAK,EAAE,4BAA4B,EACnC,KAAK,EAAE,4BAA4B,GAClC,4BAA4B,GAAG,IAAI;IAOtC,OAAO,CAAC,iBAAiB;IAgBzB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IA+B3B,OAAO,CAAC,uBAAuB,CAqB7B;IAEF,OAAO,CAAC,2BAA2B,CAGjC;IAEF,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,WAAW,CAGjB;IAEF,OAAO,CAAC,gBAAgB,CAQtB;IAEF,gBAAgB;IACA,MAAM;CAyHvB;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CAAC,CAAC,SAAS,OAAO;;;;EAExE"}
@@ -56,6 +56,9 @@ const PropertyGridEventsRelatedPropsSupplier_1 = require("./PropertyGridEventsRe
56
56
  const UseElementsScrollStorage_1 = require("../../common/UseElementsScrollStorage");
57
57
  const [PropertyGridInternalContextProvider, _PropertyGridInternalContextConsumer, usePropertyGridInternalContext,] = (0, UseContextWithMandatoryProvider_1.createContextWithMandatoryProvider)("PropertyGridInternalContext");
58
58
  const ACTION_BUTTON_DEFAULT_WIDTH = 90;
59
+ const CATEGORY_HEADER_HEIGHT = 42;
60
+ const CATEGORY_PROPERTY_HEIGHT = 28;
61
+ const VERTICAL_CATEGORY_PROPERTY_HEIGHT = 48;
59
62
  /**
60
63
  * VirtualizedPropertyGrid React component.
61
64
  * @public
@@ -63,6 +66,7 @@ const ACTION_BUTTON_DEFAULT_WIDTH = 90;
63
66
  class VirtualizedPropertyGrid extends React.Component {
64
67
  /** @internal */
65
68
  constructor(props) {
69
+ var _a;
66
70
  super(props);
67
71
  this._listRef = React.createRef();
68
72
  this._handleNodeHeightChange = (index, key, newHeight) => {
@@ -73,9 +77,8 @@ class VirtualizedPropertyGrid extends React.Component {
73
77
  return {
74
78
  ...state,
75
79
  dynamicNodeHeights: new Map(state.dynamicNodeHeights).set(key, newHeight),
76
- resetIndex: index,
77
80
  };
78
- });
81
+ }, () => this._listRef.current.resetAfterIndex(index));
79
82
  };
80
83
  this._calculateNodeHeightByIndex = (index) => {
81
84
  const node = this.state.gridItems[index];
@@ -96,14 +99,13 @@ class VirtualizedPropertyGrid extends React.Component {
96
99
  };
97
100
  this.state = {
98
101
  gridItems: [],
99
- orientation: props.orientation ??
100
- PropertyGridCommons_1.PropertyGridCommons.getCurrentOrientation(props.width, undefined, props.isOrientationFixed, props.horizontalOrientationMinWidth),
102
+ orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : PropertyGridCommons_1.PropertyGridCommons.getCurrentOrientation(props.width, undefined, props.isOrientationFixed, props.horizontalOrientationMinWidth),
101
103
  dynamicNodeHeights: new Map(),
102
- resetIndex: 0,
103
104
  };
104
105
  }
105
106
  /** @internal */
106
- componentDidUpdate(prevProps, prevState) {
107
+ componentDidUpdate(prevProps) {
108
+ var _a;
107
109
  if (this.props.orientation !== prevProps.orientation ||
108
110
  this.props.isOrientationFixed !== prevProps.isOrientationFixed ||
109
111
  this.props.horizontalOrientationMinWidth !==
@@ -116,7 +118,7 @@ class VirtualizedPropertyGrid extends React.Component {
116
118
  this._listRef.current.resetAfterIndex(0);
117
119
  }
118
120
  if (this.props.highlight !== prevProps.highlight &&
119
- this.props.highlight?.activeHighlight &&
121
+ ((_a = this.props.highlight) === null || _a === void 0 ? void 0 : _a.activeHighlight) &&
120
122
  this.state.gridItems.length !== 0) {
121
123
  let index = 0;
122
124
  let foundMatchingItem = false;
@@ -138,11 +140,6 @@ class VirtualizedPropertyGrid extends React.Component {
138
140
  this._listRef.current.scrollToItem(index);
139
141
  }
140
142
  }
141
- if (this.state.dynamicNodeHeights !== prevState.dynamicNodeHeights) {
142
- // istanbul ignore else
143
- if (this._listRef.current)
144
- this._listRef.current.resetAfterIndex(this.state.resetIndex);
145
- }
146
143
  }
147
144
  /** @internal */
148
145
  static getDerivedStateFromProps(props, state) {
@@ -158,9 +155,6 @@ class VirtualizedPropertyGrid extends React.Component {
158
155
  const currentOrientation = PropertyGridCommons_1.PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);
159
156
  if (currentOrientation !== this.state.orientation) {
160
157
  this.setState({ orientation: currentOrientation });
161
- // istanbul ignore else
162
- if (this._listRef.current)
163
- this._listRef.current.resetAfterIndex(0);
164
158
  }
165
159
  }
166
160
  /**
@@ -169,31 +163,24 @@ class VirtualizedPropertyGrid extends React.Component {
169
163
  * @returns current height of node.
170
164
  */
171
165
  calculateNodeHeight(node) {
172
- const categoryHeaderHeight = 38;
173
- const categoryHeaderPadding = 4;
174
- const categoryPropertyHeight = 27;
175
166
  const bottomBorderPadding = 5;
176
- const verticalPrimitivePropertyHeight = 55;
177
167
  return (getPropertyHeight(this.state) +
178
168
  node.lastInNumberOfCategories * bottomBorderPadding);
179
169
  function getPropertyHeight(state) {
180
170
  const dynamicHeight = state.dynamicNodeHeights.get(node.key);
181
171
  if (dynamicHeight !== undefined) {
182
172
  if (node instanceof MutableCustomGridCategory_1.MutableCustomGridCategory) {
183
- return (categoryHeaderHeight +
184
- categoryHeaderPadding +
173
+ return (CATEGORY_HEADER_HEIGHT +
185
174
  (node.isExpanded ? dynamicHeight + bottomBorderPadding : 0));
186
175
  }
187
- return (dynamicHeight + (state.orientation === core_react_1.Orientation.Vertical ? 28 : 0));
176
+ return dynamicHeight;
188
177
  }
189
178
  if (node.type === MutableFlatGridItem_1.FlatGridItemType.Category) {
190
- return categoryHeaderHeight + categoryHeaderPadding;
191
- }
192
- if (state.orientation === core_react_1.Orientation.Vertical &&
193
- node.type === MutableFlatGridItem_1.FlatGridItemType.Primitive) {
194
- return verticalPrimitivePropertyHeight;
179
+ return CATEGORY_HEADER_HEIGHT;
195
180
  }
196
- return categoryPropertyHeight;
181
+ return state.orientation === core_react_1.Orientation.Vertical
182
+ ? VERTICAL_CATEGORY_PROPERTY_HEIGHT
183
+ : CATEGORY_PROPERTY_HEIGHT;
197
184
  }
198
185
  }
199
186
  calculateEstimatedHeight() {
@@ -204,51 +191,55 @@ class VirtualizedPropertyGrid extends React.Component {
204
191
  }
205
192
  /** @internal */
206
193
  render() {
207
- const defaultActionButtonWidth = (this.props.actionButtonRenderers?.length ?? 0) > 0
194
+ var _a, _b;
195
+ const defaultActionButtonWidth = ((_b = (_a = this.props.actionButtonRenderers) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0
208
196
  ? ACTION_BUTTON_DEFAULT_WIDTH
209
197
  : undefined;
210
198
  return (React.createElement(ColumnResizingPropertyListPropsSupplier_1.ColumnResizingPropertyListPropsSupplier, { orientation: this.state.orientation, width: this.props.width, minLabelWidth: this.props.minLabelWidth, minValueWidth: this.props.minValueWidth, actionButtonWidth: this.props.actionButtonWidth !== undefined
211
199
  ? this.props.actionButtonWidth
212
- : defaultActionButtonWidth, maxPropertyDepth: this._getMaxItemDepth() }, (columnResizeContext) => (React.createElement(PropertyGridEventsRelatedPropsSupplier_1.PropertyGridEventsRelatedPropsSupplier, { isPropertySelectionEnabled: this.props.isPropertySelectionEnabled ?? false, isPropertySelectionOnRightClickEnabled: this.props.isPropertySelectionOnRightClickEnabled, isPropertyEditingEnabled: this.props.isPropertyEditingEnabled, onPropertyContextMenu: this.props.onPropertyContextMenu, onPropertyUpdated: this.props.onPropertyUpdated, onPropertySelectionChanged: this.props.onPropertySelectionChanged, isPropertyHoverEnabled: this.props.isPropertyHoverEnabled ?? false }, (selectionContext) => {
213
- const gridContext = {
214
- orientation: columnResizeContext.orientation,
215
- gridWidth: this.props.width,
216
- isPropertyHoverEnabled: selectionContext.isPropertyHoverEnabled,
217
- isPropertySelectionEnabled: selectionContext.isPropertySelectionEnabled,
218
- selectedPropertyKey: selectionContext.selectedPropertyKey,
219
- onPropertyClicked: selectionContext.onPropertyClicked,
220
- onPropertyRightClicked: selectionContext.onPropertyRightClicked,
221
- onPropertyContextMenu: selectionContext.onPropertyContextMenu,
222
- editingPropertyKey: selectionContext.editingPropertyKey,
223
- onEditCommit: selectionContext.onEditCommit,
224
- onEditCancel: selectionContext.onEditCancel,
225
- eventHandler: this.props.eventHandler,
226
- dataProvider: this.props.dataProvider,
227
- actionButtonRenderers: this.props.actionButtonRenderers,
228
- propertyValueRendererManager: this.props.propertyValueRendererManager,
229
- propertyCategoryRendererManager: this.props.propertyCategoryRendererManager,
230
- columnRatio: columnResizeContext.columnRatio,
231
- columnInfo: columnResizeContext.columnInfo,
232
- isResizeHandleBeingDragged: columnResizeContext.isResizeHandleBeingDragged,
233
- isResizeHandleHovered: columnResizeContext.isResizeHandleHovered,
234
- onColumnRatioChanged: columnResizeContext.onColumnChanged,
235
- onResizeHandleDragChanged: columnResizeContext.onResizeHandleDragChanged,
236
- onResizeHandleHoverChanged: columnResizeContext.onResizeHandleHoverChanged,
237
- highlight: this.props.highlight,
238
- };
239
- const renderContext = {
240
- gridItems: this.state.gridItems,
241
- gridEventHandler: this.props.eventHandler,
242
- gridModel: this.props.model,
243
- style: this.props.style,
244
- className: this.props.className,
245
- onItemHeightChanged: this._handleNodeHeightChange,
246
- gridContext,
247
- };
248
- return (React.createElement(PropertyGridInternalContextProvider, { value: renderContext },
249
- React.createElement("div", { className: (0, classnames_1.default)("components-virtualized-property-grid", "components-smallEditor-host") },
250
- React.createElement(react_window_1.VariableSizeList, { className: (0, classnames_1.default)("components-property-grid-wrapper", "ReactWindow__VariableSizeList", this.props.className), width: this.props.width, height: this.props.height, itemCount: this.state.gridItems.length, itemSize: this._calculateNodeHeightByIndex, estimatedItemSize: this.calculateEstimatedHeight(), overscanCount: 10, layout: "vertical", style: this.props.style, itemKey: this._getNodeKey, ref: this._listRef }, FlatGridItemNode))));
251
- }))));
200
+ : defaultActionButtonWidth, maxPropertyDepth: this._getMaxItemDepth() }, (columnResizeContext) => {
201
+ var _a, _b;
202
+ return (React.createElement(PropertyGridEventsRelatedPropsSupplier_1.PropertyGridEventsRelatedPropsSupplier, { isPropertySelectionEnabled: (_a = this.props.isPropertySelectionEnabled) !== null && _a !== void 0 ? _a : false, isPropertySelectionOnRightClickEnabled: this.props.isPropertySelectionOnRightClickEnabled, isPropertyEditingEnabled: this.props.isPropertyEditingEnabled, onPropertyContextMenu: this.props.onPropertyContextMenu, onPropertyUpdated: this.props.onPropertyUpdated, onPropertySelectionChanged: this.props.onPropertySelectionChanged, isPropertyHoverEnabled: (_b = this.props.isPropertyHoverEnabled) !== null && _b !== void 0 ? _b : false }, (selectionContext) => {
203
+ const gridContext = {
204
+ orientation: columnResizeContext.orientation,
205
+ gridWidth: this.props.width,
206
+ isPropertyHoverEnabled: selectionContext.isPropertyHoverEnabled,
207
+ isPropertySelectionEnabled: selectionContext.isPropertySelectionEnabled,
208
+ selectedPropertyKey: selectionContext.selectedPropertyKey,
209
+ onPropertyClicked: selectionContext.onPropertyClicked,
210
+ onPropertyRightClicked: selectionContext.onPropertyRightClicked,
211
+ onPropertyContextMenu: selectionContext.onPropertyContextMenu,
212
+ editingPropertyKey: selectionContext.editingPropertyKey,
213
+ onEditCommit: selectionContext.onEditCommit,
214
+ onEditCancel: selectionContext.onEditCancel,
215
+ eventHandler: this.props.eventHandler,
216
+ dataProvider: this.props.dataProvider,
217
+ actionButtonRenderers: this.props.actionButtonRenderers,
218
+ propertyValueRendererManager: this.props.propertyValueRendererManager,
219
+ propertyCategoryRendererManager: this.props.propertyCategoryRendererManager,
220
+ columnRatio: columnResizeContext.columnRatio,
221
+ columnInfo: columnResizeContext.columnInfo,
222
+ isResizeHandleBeingDragged: columnResizeContext.isResizeHandleBeingDragged,
223
+ isResizeHandleHovered: columnResizeContext.isResizeHandleHovered,
224
+ onColumnRatioChanged: columnResizeContext.onColumnChanged,
225
+ onResizeHandleDragChanged: columnResizeContext.onResizeHandleDragChanged,
226
+ onResizeHandleHoverChanged: columnResizeContext.onResizeHandleHoverChanged,
227
+ highlight: this.props.highlight,
228
+ };
229
+ const renderContext = {
230
+ gridItems: this.state.gridItems,
231
+ gridEventHandler: this.props.eventHandler,
232
+ gridModel: this.props.model,
233
+ style: this.props.style,
234
+ className: this.props.className,
235
+ onItemHeightChanged: this._handleNodeHeightChange,
236
+ gridContext,
237
+ };
238
+ return (React.createElement(PropertyGridInternalContextProvider, { value: renderContext },
239
+ React.createElement("div", { className: (0, classnames_1.default)("components-virtualized-property-grid", "components-smallEditor-host") },
240
+ React.createElement(react_window_1.VariableSizeList, { className: (0, classnames_1.default)("components-property-grid-wrapper", "ReactWindow__VariableSizeList", this.props.className), width: this.props.width, height: this.props.height, itemCount: this.state.gridItems.length, itemSize: this._calculateNodeHeightByIndex, estimatedItemSize: this.calculateEstimatedHeight(), overscanCount: 10, layout: "vertical", style: this.props.style, itemKey: this._getNodeKey, ref: this._listRef }, FlatGridItemNode))));
241
+ }));
242
+ }));
252
243
  }
253
244
  }
254
245
  exports.VirtualizedPropertyGrid = VirtualizedPropertyGrid;
@@ -264,20 +255,38 @@ exports.useVirtualizedPropertyGridLayoutStorage = useVirtualizedPropertyGridLayo
264
255
  const FlatGridItemNode = React.memo(({ index, style: virtualizedListStyle }) => {
265
256
  const { gridItems, gridEventHandler, gridModel, gridContext, className, style, onItemHeightChanged, } = usePropertyGridInternalContext(FlatGridItemNode);
266
257
  const node = gridItems[index];
258
+ const divRef = React.useRef(null);
259
+ const previousHeightRef = React.useRef(0);
267
260
  const onExpansionToggled = React.useCallback(() => gridEventHandler.onExpansionToggled(node.selectionKey), [gridEventHandler, node.selectionKey]);
268
261
  const onHeightChanged = React.useCallback((newHeight) => onItemHeightChanged(index, node.key, newHeight), [onItemHeightChanged, index, node.key]);
262
+ const minHeight = React.useMemo(() => {
263
+ if (node.type === MutableFlatGridItem_1.FlatGridItemType.Category)
264
+ return CATEGORY_HEADER_HEIGHT;
265
+ return gridContext.orientation === core_react_1.Orientation.Vertical
266
+ ? VERTICAL_CATEGORY_PROPERTY_HEIGHT
267
+ : CATEGORY_PROPERTY_HEIGHT;
268
+ }, [gridContext.orientation, node.type]);
269
+ React.useLayoutEffect(() => {
270
+ (0, core_bentley_1.assert)(divRef.current !== null);
271
+ const refHeight = divRef.current.getBoundingClientRect().height;
272
+ const currentHeight = Math.max(refHeight, minHeight);
273
+ if (currentHeight !== previousHeightRef.current) {
274
+ onHeightChanged(currentHeight);
275
+ previousHeightRef.current = currentHeight;
276
+ }
277
+ });
269
278
  function getDisplayNode() {
279
+ var _a, _b, _c, _d, _e, _f, _g;
270
280
  const lastInNumberOfCategories = node.lastInNumberOfCategories;
271
281
  switch (node.type) {
272
282
  case MutableFlatGridItem_1.FlatGridItemType.Category:
273
- const categoryRendererManager = gridContext.propertyCategoryRendererManager ??
274
- PropertyCategoryRendererManager_1.PropertyCategoryRendererManager.defaultManager;
283
+ const categoryRendererManager = (_a = gridContext.propertyCategoryRendererManager) !== null && _a !== void 0 ? _a : PropertyCategoryRendererManager_1.PropertyCategoryRendererManager.defaultManager;
275
284
  const customRenderer = categoryRendererManager.getCategoryComponent(node);
276
285
  const wrapperClassName = (0, classnames_1.default)("virtualized-grid-node-content", customRenderer !== undefined
277
286
  ? "virtualized-grid-node-custom-category"
278
287
  : "virtualized-grid-node-category");
279
288
  return (React.createElement(FlatItemNestedBorderWrapper_1.FlatItemNestedBorderWrapper, { borderCount: node.depth, bottomBorderCount: lastInNumberOfCategories, className: wrapperClassName },
280
- React.createElement(PropertyCategoryBlock_1.PropertyCategoryBlock, { className: className, style: style, category: node.derivedCategory, onExpansionToggled: onExpansionToggled, highlight: gridContext.highlight?.filteredTypes?.includes(PropertyDataFiltererBase_1.FilteredType.Category)
289
+ React.createElement(PropertyCategoryBlock_1.PropertyCategoryBlock, { className: className, style: style, category: node.derivedCategory, onExpansionToggled: onExpansionToggled, highlight: ((_c = (_b = gridContext.highlight) === null || _b === void 0 ? void 0 : _b.filteredTypes) === null || _c === void 0 ? void 0 : _c.includes(PropertyDataFiltererBase_1.FilteredType.Category))
281
290
  ? gridContext.highlight
282
291
  : undefined }, customRenderer !== undefined && (React.createElement(CustomCategoryContent, { renderer: customRenderer, categoryItem: node, gridContext: gridContext, onHeightChanged: onHeightChanged })))));
283
292
  case MutableFlatGridItem_1.FlatGridItemType.Array:
@@ -286,20 +295,21 @@ const FlatGridItemNode = React.memo(({ index, style: virtualizedListStyle }) =>
286
295
  const selectionKey = node.selectionKey;
287
296
  const parentCategoryItem = gridModel.getItem(node.parentCategorySelectionKey);
288
297
  return (React.createElement(FlatItemNestedBorderWrapper_1.FlatItemNestedBorderWrapper, { borderCount: parentCategoryItem.depth + 1, bottomBorderCount: lastInNumberOfCategories, className: "virtualized-grid-node-content" },
289
- React.createElement(FlatPropertyRenderer_1.FlatPropertyRenderer, { key: node.key, uniqueKey: selectionKey, propertyRecord: node.derivedRecord, orientation: gridContext.orientation, indentation: node.depth, width: gridContext.gridWidth, isHoverable: gridContext.isPropertyHoverEnabled, isSelectable: gridContext.isPropertySelectionEnabled, isSelected: selectionKey === gridContext.selectedPropertyKey, onClick: node.type === MutableFlatGridItem_1.FlatGridItemType.Primitive
290
- ? gridContext.onPropertyClicked
291
- : undefined, onRightClick: node.type === MutableFlatGridItem_1.FlatGridItemType.Primitive
292
- ? gridContext.onPropertyRightClicked
293
- : undefined, onContextMenu: gridContext.onPropertyContextMenu, category: parentCategoryItem.derivedCategory, isEditing: selectionKey === gridContext.editingPropertyKey, onEditCommit: gridContext.onEditCommit, onEditCancel: gridContext.onEditCancel, isExpanded: node.isExpanded, onExpansionToggled: onExpansionToggled, onHeightChanged: onHeightChanged, actionButtonRenderers: gridContext.actionButtonRenderers, propertyValueRendererManager: gridContext.propertyValueRendererManager, columnRatio: gridContext.columnRatio, columnInfo: gridContext.columnInfo, isResizeHandleBeingDragged: gridContext.isResizeHandleBeingDragged, isResizeHandleHovered: gridContext.isResizeHandleHovered, onColumnRatioChanged: gridContext.onColumnRatioChanged, onResizeHandleDragChanged: gridContext.onResizeHandleDragChanged, onResizeHandleHoverChanged: gridContext.onResizeHandleHoverChanged, highlight: gridContext.highlight
298
+ React.createElement(FlatPropertyRenderer_1.FlatPropertyRenderer, { key: node.key, uniqueKey: selectionKey, propertyRecord: node.derivedRecord, orientation: gridContext.orientation, indentation: node.depth, width: gridContext.gridWidth, isHoverable: gridContext.isPropertyHoverEnabled, isSelectable: gridContext.isPropertySelectionEnabled, isSelected: selectionKey === gridContext.selectedPropertyKey, onClick: gridContext.onPropertyClicked, onRightClick: gridContext.onPropertyRightClicked, onContextMenu: gridContext.onPropertyContextMenu, category: parentCategoryItem.derivedCategory, isEditing: selectionKey === gridContext.editingPropertyKey, onEditCommit: gridContext.onEditCommit, onEditCancel: gridContext.onEditCancel, isExpanded: node.isExpanded, onExpansionToggled: onExpansionToggled, onHeightChanged: onHeightChanged, actionButtonRenderers: gridContext.actionButtonRenderers, propertyValueRendererManager: gridContext.propertyValueRendererManager, columnRatio: gridContext.columnRatio, columnInfo: gridContext.columnInfo, isResizeHandleBeingDragged: gridContext.isResizeHandleBeingDragged, isResizeHandleHovered: gridContext.isResizeHandleHovered, onColumnRatioChanged: gridContext.onColumnRatioChanged, onResizeHandleDragChanged: gridContext.onResizeHandleDragChanged, onResizeHandleHoverChanged: gridContext.onResizeHandleHoverChanged, highlight: gridContext.highlight
294
299
  ? {
295
- applyOnLabel: gridContext.highlight.filteredTypes?.includes(PropertyDataFiltererBase_1.FilteredType.Label) ?? false,
296
- applyOnValue: gridContext.highlight.filteredTypes?.includes(PropertyDataFiltererBase_1.FilteredType.Value) ?? false,
300
+ applyOnLabel: (_e = (_d = gridContext.highlight.filteredTypes) === null || _d === void 0 ? void 0 : _d.includes(PropertyDataFiltererBase_1.FilteredType.Label)) !== null && _e !== void 0 ? _e : false,
301
+ applyOnValue: (_g = (_f = gridContext.highlight.filteredTypes) === null || _f === void 0 ? void 0 : _f.includes(PropertyDataFiltererBase_1.FilteredType.Value)) !== null && _g !== void 0 ? _g : false,
297
302
  ...gridContext.highlight,
298
303
  }
299
304
  : undefined })));
300
305
  }
301
306
  }
302
- return (React.createElement("div", { className: "virtualized-grid-node", style: virtualizedListStyle }, getDisplayNode()));
307
+ return (React.createElement("div", { className: "virtualized-grid-node", style: virtualizedListStyle },
308
+ React.createElement("div", { className: "virtualized-grid-node-content-wrapper", style: {
309
+ minHeight: `${minHeight}px`,
310
+ display: "grid",
311
+ } },
312
+ React.createElement("div", { ref: divRef, className: "virtualized-grid-node-content-wrapper-item" }, getDisplayNode()))));
303
313
  }, react_window_1.areEqual);
304
314
  FlatGridItemNode.displayName = "FlatGridItemNode";
305
315
  const CustomCategoryContent = (props) => {