@itwin/components-react 4.13.2 → 4.13.4

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 (253) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/lib/cjs/components-react/UiComponents.js +1 -1
  3. package/lib/cjs/components-react/UiComponents.js.map +1 -1
  4. package/lib/cjs/components-react/common/DateUtils.js.map +1 -1
  5. package/lib/cjs/components-react/common/HighlightedText.js.map +1 -1
  6. package/lib/cjs/components-react/common/ImageRenderer.js +1 -1
  7. package/lib/cjs/components-react/common/ImageRenderer.js.map +1 -1
  8. package/lib/cjs/components-react/common/Links.js.map +1 -1
  9. package/lib/cjs/components-react/common/UseAsyncValue.js.map +1 -1
  10. package/lib/cjs/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
  11. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  12. package/lib/cjs/components-react/common/UseElementsScrollStorage.js.map +1 -1
  13. package/lib/cjs/components-react/common/countMatchesInString.js.map +1 -1
  14. package/lib/cjs/components-react/common/selection/SelectionHandler.js.map +1 -1
  15. package/lib/cjs/components-react/common/selection/SelectionModes.js +2 -2
  16. package/lib/cjs/components-react/common/selection/SelectionModes.js.map +1 -1
  17. package/lib/cjs/components-react/converters/BooleanTypeConverter.js +1 -1
  18. package/lib/cjs/components-react/converters/BooleanTypeConverter.js.map +1 -1
  19. package/lib/cjs/components-react/converters/CompositeTypeConverter.js.map +1 -1
  20. package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
  21. package/lib/cjs/components-react/converters/EnumTypeConverter.js.map +1 -1
  22. package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
  23. package/lib/cjs/components-react/converters/PointTypeConverter.js.map +1 -1
  24. package/lib/cjs/components-react/converters/TypeConverterManager.js +1 -1
  25. package/lib/cjs/components-react/converters/TypeConverterManager.js.map +1 -1
  26. package/lib/cjs/components-react/datepicker/DateField.js.map +1 -1
  27. package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
  28. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
  29. package/lib/cjs/components-react/datepicker/IntlFormatter.js.map +1 -1
  30. package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
  31. package/lib/cjs/components-react/editors/BooleanEditor.js.map +1 -1
  32. package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
  33. package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
  34. package/lib/cjs/components-react/editors/EditorContainer.js.map +1 -1
  35. package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
  36. package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
  37. package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
  38. package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
  39. package/lib/cjs/components-react/editors/NumericInputEditor.js.map +1 -1
  40. package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
  41. package/lib/cjs/components-react/editors/PropertyEditorManager.js +1 -1
  42. package/lib/cjs/components-react/editors/PropertyEditorManager.js.map +1 -1
  43. package/lib/cjs/components-react/editors/SliderEditor.js.map +1 -1
  44. package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
  45. package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
  46. package/lib/cjs/components-react/editors/ToggleEditor.js.map +1 -1
  47. package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
  48. package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js +1 -0
  49. package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
  50. package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
  51. package/lib/cjs/components-react/filter-builder/FilterBuilderRangeValue.js +1 -1
  52. package/lib/cjs/components-react/filter-builder/FilterBuilderRangeValue.js.map +1 -1
  53. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
  54. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  55. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  56. package/lib/cjs/components-react/filter-builder/Operators.js +2 -2
  57. package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
  58. package/lib/cjs/components-react/filtering/FilteringInput.js +1 -1
  59. package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
  60. package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
  61. package/lib/cjs/components-react/iconpicker/IconPickerButton.js +1 -1
  62. package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
  63. package/lib/cjs/components-react/inputs/ParsedInput.d.ts +1 -1
  64. package/lib/cjs/components-react/inputs/ParsedInput.d.ts.map +1 -1
  65. package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
  66. package/lib/cjs/components-react/properties/LinkHandler.js.map +1 -1
  67. package/lib/cjs/components-react/properties/ValueRendererManager.js +1 -1
  68. package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
  69. package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  70. package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
  71. package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
  72. package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts +1 -1
  73. package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
  74. package/lib/cjs/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts +1 -1
  75. package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts +1 -1
  76. package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
  77. package/lib/cjs/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
  78. package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.d.ts +1 -1
  79. package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.d.ts.map +1 -1
  80. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -1
  81. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  82. package/lib/cjs/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
  83. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +1 -1
  84. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  85. package/lib/cjs/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
  86. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js +1 -1
  87. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  88. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
  89. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  90. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  91. package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  92. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +1 -1
  93. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  94. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  95. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
  96. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
  97. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js +1 -1
  98. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
  99. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
  100. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
  101. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
  102. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
  103. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +1 -1
  104. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  105. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  106. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  107. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +3 -3
  108. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
  109. package/lib/cjs/components-react/toolbar/Items.js.map +1 -1
  110. package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
  111. package/lib/cjs/components-react/toolbar/OverflowPanel.js.map +1 -1
  112. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  113. package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
  114. package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
  115. package/lib/cjs/components-react/toolbar/utilities/Direction.js +4 -4
  116. package/lib/cjs/components-react/toolbar/utilities/Direction.js.map +1 -1
  117. package/lib/cjs/components-react/tree/HighlightingEngine.js +1 -1
  118. package/lib/cjs/components-react/tree/HighlightingEngine.js.map +1 -1
  119. package/lib/cjs/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
  120. package/lib/cjs/components-react/tree/TreeComponentTestId.js +1 -1
  121. package/lib/cjs/components-react/tree/TreeComponentTestId.js.map +1 -1
  122. package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
  123. package/lib/cjs/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
  124. package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
  125. package/lib/cjs/components-react/tree/controlled/TreeModelSource.js.map +1 -1
  126. package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  127. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  128. package/lib/cjs/components-react/tree/controlled/component/NodeContent.js.map +1 -1
  129. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  130. package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  131. package/lib/cjs/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
  132. package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  133. package/lib/cjs/components-react/useTranslation.js.map +1 -1
  134. package/lib/esm/components-react/UiComponents.js +1 -2
  135. package/lib/esm/components-react/UiComponents.js.map +1 -1
  136. package/lib/esm/components-react/common/DateUtils.js.map +1 -1
  137. package/lib/esm/components-react/common/HighlightedText.js.map +1 -1
  138. package/lib/esm/components-react/common/ImageRenderer.js +1 -2
  139. package/lib/esm/components-react/common/ImageRenderer.js.map +1 -1
  140. package/lib/esm/components-react/common/Links.js.map +1 -1
  141. package/lib/esm/components-react/common/UseAsyncValue.js.map +1 -1
  142. package/lib/esm/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
  143. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  144. package/lib/esm/components-react/common/UseElementsScrollStorage.js.map +1 -1
  145. package/lib/esm/components-react/common/countMatchesInString.js.map +1 -1
  146. package/lib/esm/components-react/common/selection/SelectionHandler.js.map +1 -1
  147. package/lib/esm/components-react/converters/BooleanTypeConverter.js +1 -2
  148. package/lib/esm/components-react/converters/BooleanTypeConverter.js.map +1 -1
  149. package/lib/esm/components-react/converters/CompositeTypeConverter.js.map +1 -1
  150. package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
  151. package/lib/esm/components-react/converters/EnumTypeConverter.js.map +1 -1
  152. package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
  153. package/lib/esm/components-react/converters/PointTypeConverter.js.map +1 -1
  154. package/lib/esm/components-react/converters/TypeConverterManager.js +1 -2
  155. package/lib/esm/components-react/converters/TypeConverterManager.js.map +1 -1
  156. package/lib/esm/components-react/datepicker/DateField.js.map +1 -1
  157. package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
  158. package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
  159. package/lib/esm/components-react/datepicker/IntlFormatter.js.map +1 -1
  160. package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
  161. package/lib/esm/components-react/editors/BooleanEditor.js.map +1 -1
  162. package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
  163. package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
  164. package/lib/esm/components-react/editors/EditorContainer.js.map +1 -1
  165. package/lib/esm/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
  166. package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
  167. package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
  168. package/lib/esm/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
  169. package/lib/esm/components-react/editors/NumericInputEditor.js.map +1 -1
  170. package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
  171. package/lib/esm/components-react/editors/PropertyEditorManager.js +1 -2
  172. package/lib/esm/components-react/editors/PropertyEditorManager.js.map +1 -1
  173. package/lib/esm/components-react/editors/SliderEditor.js.map +1 -1
  174. package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
  175. package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
  176. package/lib/esm/components-react/editors/ToggleEditor.js.map +1 -1
  177. package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
  178. package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js +1 -0
  179. package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
  180. package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
  181. package/lib/esm/components-react/filter-builder/FilterBuilderRangeValue.js.map +1 -1
  182. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
  183. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  184. package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  185. package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
  186. package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
  187. package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
  188. package/lib/esm/components-react/iconpicker/IconPickerButton.js +1 -2
  189. package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
  190. package/lib/esm/components-react/inputs/ParsedInput.d.ts +1 -1
  191. package/lib/esm/components-react/inputs/ParsedInput.d.ts.map +1 -1
  192. package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
  193. package/lib/esm/components-react/properties/LinkHandler.js.map +1 -1
  194. package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
  195. package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  196. package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
  197. package/lib/esm/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
  198. package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts +1 -1
  199. package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
  200. package/lib/esm/components-react/properties/renderers/value/MergedPropertyValueRenderer.d.ts +1 -1
  201. package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts +1 -1
  202. package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
  203. package/lib/esm/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
  204. package/lib/esm/components-react/properties/renderers/value/WithContextStyle.d.ts +1 -1
  205. package/lib/esm/components-react/properties/renderers/value/WithContextStyle.d.ts.map +1 -1
  206. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -2
  207. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  208. package/lib/esm/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
  209. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +1 -2
  210. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  211. package/lib/esm/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
  212. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js +1 -2
  213. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  214. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
  215. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  216. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  217. package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  218. package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  219. package/lib/esm/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
  220. package/lib/esm/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
  221. package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
  222. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
  223. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
  224. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
  225. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  226. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  227. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  228. package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +1 -2
  229. package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
  230. package/lib/esm/components-react/toolbar/Items.js.map +1 -1
  231. package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
  232. package/lib/esm/components-react/toolbar/OverflowPanel.js.map +1 -1
  233. package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  234. package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
  235. package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
  236. package/lib/esm/components-react/toolbar/utilities/Direction.js +2 -4
  237. package/lib/esm/components-react/toolbar/utilities/Direction.js.map +1 -1
  238. package/lib/esm/components-react/tree/HighlightingEngine.js +1 -2
  239. package/lib/esm/components-react/tree/HighlightingEngine.js.map +1 -1
  240. package/lib/esm/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
  241. package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
  242. package/lib/esm/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
  243. package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
  244. package/lib/esm/components-react/tree/controlled/TreeModelSource.js.map +1 -1
  245. package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  246. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  247. package/lib/esm/components-react/tree/controlled/component/NodeContent.js.map +1 -1
  248. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  249. package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  250. package/lib/esm/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
  251. package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  252. package/lib/esm/components-react/useTranslation.js.map +1 -1
  253. package/package.json +13 -15
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayValuePropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EACL,YAAY,EACZ,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,gCAAiC,SAAQ,8BAA8B;IAGlF,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACrD,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,IAAoB;QAEpB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEnD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS;YAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QAClE,MAAM,YAAY,GAAG,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,IAAI,YAAY,KAAK,CAAC;YAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAExD,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,YAAY;YACZ,aAAa,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport type { PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\nimport {\n FilteredType,\n PropertyRecordDataFiltererBase,\n} from \"./PropertyDataFiltererBase\";\n\n/**\n * Property data filterer which matches on Primitive Property Record display value text.\n * @public\n */\nexport class DisplayValuePropertyDataFilterer extends PropertyRecordDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText.toLowerCase().trim();\n }\n\n public get filterText(): string {\n return this._filterText;\n }\n\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() {\n return this.filterText !== \"\";\n }\n\n public async recordMatchesFilter(\n node: PropertyRecord\n ): Promise<PropertyDataFilterResult> {\n if (!this.isActive) return { matchesFilter: true };\n\n if (node.value.valueFormat !== PropertyValueFormat.Primitive)\n return { matchesFilter: false };\n\n const displayValue = node.value.displayValue?.toLowerCase() ?? \"\";\n const matchesCount = countMatchesInString(displayValue, this.filterText);\n\n if (matchesCount === 0) return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n matchesCount,\n filteredTypes: [FilteredType.Value],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"DisplayValuePropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EACL,YAAY,EACZ,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,gCAAiC,SAAQ,8BAA8B;IAGlF,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACrD,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;QACpC,CAAC;IACH,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,IAAoB;QAEpB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEnD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS;YAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QAClE,MAAM,YAAY,GAAG,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,IAAI,YAAY,KAAK,CAAC;YAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAExD,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,YAAY;YACZ,aAAa,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport type { PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\nimport {\n FilteredType,\n PropertyRecordDataFiltererBase,\n} from \"./PropertyDataFiltererBase\";\n\n/**\n * Property data filterer which matches on Primitive Property Record display value text.\n * @public\n */\nexport class DisplayValuePropertyDataFilterer extends PropertyRecordDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText.toLowerCase().trim();\n }\n\n public get filterText(): string {\n return this._filterText;\n }\n\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() {\n return this.filterText !== \"\";\n }\n\n public async recordMatchesFilter(\n node: PropertyRecord\n ): Promise<PropertyDataFilterResult> {\n if (!this.isActive) return { matchesFilter: true };\n\n if (node.value.valueFormat !== PropertyValueFormat.Primitive)\n return { matchesFilter: false };\n\n const displayValue = node.value.displayValue?.toLowerCase() ?? \"\";\n const matchesCount = countMatchesInString(displayValue, this.filterText);\n\n if (matchesCount === 0) return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n matchesCount,\n filteredTypes: [FilteredType.Value],\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LabelPropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EACL,YAAY,EACZ,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,8BAA8B;IAG3E,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACrD,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,IAAoB;QAEpB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEnD,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAC9D,MAAM,YAAY,GAAG,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACzE,IAAI,YAAY,KAAK,CAAC;YAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAExD,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,6BAA6B,EAAE,IAAI;YACnC,YAAY;YACZ,aAAa,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport type { PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\nimport {\n FilteredType,\n PropertyRecordDataFiltererBase,\n} from \"./PropertyDataFiltererBase\";\n\n/**\n * PropertyData filter which matches on any record type label and includes descendant nodes on match\n * @public\n */\nexport class LabelPropertyDataFilterer extends PropertyRecordDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText.toLowerCase().trim();\n }\n\n public get filterText(): string {\n return this._filterText;\n }\n\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() {\n return this.filterText !== \"\";\n }\n\n public async recordMatchesFilter(\n node: PropertyRecord\n ): Promise<PropertyDataFilterResult> {\n if (!this.isActive) return { matchesFilter: true };\n\n const displayLabel = node.property.displayLabel.toLowerCase();\n const matchesCount = countMatchesInString(displayLabel, this.filterText);\n if (matchesCount === 0) return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n shouldForceIncludeDescendants: true,\n matchesCount,\n filteredTypes: [FilteredType.Label],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"LabelPropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EACL,YAAY,EACZ,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,8BAA8B;IAG3E,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACrD,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;QACpC,CAAC;IACH,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,IAAoB;QAEpB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEnD,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAC9D,MAAM,YAAY,GAAG,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACzE,IAAI,YAAY,KAAK,CAAC;YAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAExD,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,6BAA6B,EAAE,IAAI;YACnC,YAAY;YACZ,aAAa,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport type { PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\nimport {\n FilteredType,\n PropertyRecordDataFiltererBase,\n} from \"./PropertyDataFiltererBase\";\n\n/**\n * PropertyData filter which matches on any record type label and includes descendant nodes on match\n * @public\n */\nexport class LabelPropertyDataFilterer extends PropertyRecordDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText.toLowerCase().trim();\n }\n\n public get filterText(): string {\n return this._filterText;\n }\n\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() {\n return this.filterText !== \"\";\n }\n\n public async recordMatchesFilter(\n node: PropertyRecord\n ): Promise<PropertyDataFilterResult> {\n if (!this.isActive) return { matchesFilter: true };\n\n const displayLabel = node.property.displayLabel.toLowerCase();\n const matchesCount = countMatchesInString(displayLabel, this.filterText);\n if (matchesCount === 0) return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n shouldForceIncludeDescendants: true,\n matchesCount,\n filteredTypes: [FilteredType.Label],\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategoryLabelFilterer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,EACL,YAAY,EACZ,gCAAgC,GACjC,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,6BAA8B,SAAQ,gCAAgC;IAGjF,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACrD,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAChC,IAAsB;QAEtB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEnD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,IAAI,YAAY,KAAK,CAAC;YAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAExD,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,6BAA6B,EAAE,IAAI;YACnC,YAAY;YACZ,aAAa,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;SACvC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider\";\nimport type { PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\nimport {\n FilteredType,\n PropertyCategoryDataFiltererBase,\n} from \"./PropertyDataFiltererBase\";\n\n/**\n * PropertyData filterer which matches on PropertyCategory's label.\n * @public\n */\nexport class PropertyCategoryLabelFilterer extends PropertyCategoryDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText.toLowerCase().trim();\n }\n\n public get filterText(): string {\n return this._filterText;\n }\n\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() {\n return this.filterText !== \"\";\n }\n\n public async categoryMatchesFilter(\n node: PropertyCategory\n ): Promise<PropertyDataFilterResult> {\n if (!this.isActive) return { matchesFilter: true };\n\n const displayLabel = node.label.toLowerCase();\n const matchesCount = countMatchesInString(displayLabel, this.filterText);\n\n if (matchesCount === 0) return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n shouldForceIncludeDescendants: true,\n matchesCount,\n filteredTypes: [FilteredType.Category],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyCategoryLabelFilterer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,EACL,YAAY,EACZ,gCAAgC,GACjC,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,6BAA8B,SAAQ,gCAAgC;IAGjF,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACrD,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;QACpC,CAAC;IACH,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAChC,IAAsB;QAEtB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEnD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,IAAI,YAAY,KAAK,CAAC;YAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAExD,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,6BAA6B,EAAE,IAAI;YACnC,YAAY;YACZ,aAAa,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;SACvC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider\";\nimport type { PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\nimport {\n FilteredType,\n PropertyCategoryDataFiltererBase,\n} from \"./PropertyDataFiltererBase\";\n\n/**\n * PropertyData filterer which matches on PropertyCategory's label.\n * @public\n */\nexport class PropertyCategoryLabelFilterer extends PropertyCategoryDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText.toLowerCase().trim();\n }\n\n public get filterText(): string {\n return this._filterText;\n }\n\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() {\n return this.filterText !== \"\";\n }\n\n public async categoryMatchesFilter(\n node: PropertyCategory\n ): Promise<PropertyDataFilterResult> {\n if (!this.isActive) return { matchesFilter: true };\n\n const displayLabel = node.label.toLowerCase();\n const matchesCount = countMatchesInString(displayLabel, this.filterText);\n\n if (matchesCount === 0) return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n shouldForceIncludeDescendants: true,\n matchesCount,\n filteredTypes: [FilteredType.Category],\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridModel.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/PropertyGridModel.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA+BlC;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAMnC,YACE,YAA0B,EAClB,gBAAyC;QAAzC,qBAAgB,GAAhB,gBAAgB,CAAyB;QAL5C,QAAW,GAAG,IAAI,CAAC;QAOxB,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,UAAU,CAAC,GAAG,CAC5C,CAAC,QAA0B,EAAE,EAAE,CAC7B,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,QAAQ,EAAE,YAAY,CAAC,OAAO,CAAC,CAC3E,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,YAAoB;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI;YACP,MAAM,IAAI,KAAK,CAAC,wCAAwC,YAAY,EAAE,CAAC,CAAC;QAE1E,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACK,QAAQ,CACd,KAA6B,EAC7B,YAAoB;QAEpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,2IAA2I;YAC3I,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;gBAAE,SAAS;YAE1D,IAAI,IAAI,CAAC,YAAY,KAAK,YAAY;gBAAE,OAAO,IAAI,CAAC;YAEpD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,YAAY,CAAC,CAAC;YAClE,IAAI,SAAS;gBAAE,OAAO,SAAS,CAAC;SACjC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACtB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,WAAW;QAChB,MAAM,QAAQ,GAA2B,EAAE,CAAC;QAC5C,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CACpC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CACnD,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;OAGG;IACI,kBAAkB;QACvB,MAAM,YAAY,GAA2B,EAAE,CAAC;QAChD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CACpC,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,4BAA4B,EAAE,CAAC,CAC9D,CAAC;QAEF,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;KAjFS,SAAS","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 */\nimport { immerable } from \"immer\";\nimport type { PropertyCategory, PropertyData } from \"../PropertyDataProvider\";\nimport type { FlatGridItem, GridCategoryItem } from \"./flat-items/FlatGridItem\";\nimport type {\n IMutableFlatGridItem,\n IMutableGridCategoryItem,\n} from \"./flat-items/MutableFlatGridItem\";\nimport type { IMutableGridItemFactory } from \"./flat-items/MutableGridItemFactory\";\n\n/**\n * PropertyGridModel interface for working with immutable FlatGridItems\n * @public\n */\nexport interface IPropertyGridModel {\n getItem: (selectionKey: string) => FlatGridItem;\n getRootCategories: () => GridCategoryItem[];\n getFlatGrid: () => FlatGridItem[];\n getVisibleFlatGrid: () => FlatGridItem[];\n}\n\n/**\n * PropertyGridModel interface for working with mutable FlatGridItems\n * @public\n */\nexport interface IMutablePropertyGridModel {\n getItem: (selectionKey: string) => IMutableFlatGridItem;\n getRootCategories: () => IMutableGridCategoryItem[];\n getFlatGrid: () => IMutableFlatGridItem[];\n getVisibleFlatGrid: () => IMutableFlatGridItem[];\n}\n\n/**\n * Implementation of PropertyGridModel for working with and converting PropertyData to mutable FlatGridItems\n * @public\n */\nexport class MutablePropertyGridModel\n implements IPropertyGridModel, IMutablePropertyGridModel\n{\n public [immerable] = true;\n\n private _categories: IMutableGridCategoryItem[];\n public constructor(\n propertyData: PropertyData,\n private _gridItemFactory: IMutableGridItemFactory\n ) {\n this._categories = propertyData.categories.map(\n (category: PropertyCategory) =>\n this._gridItemFactory.createGridCategory(category, propertyData.records)\n );\n }\n\n /**\n * Retrieves grid item from model.\n * @param selectionKey unique key for identifying item to retrieve.\n */\n public getItem(selectionKey: string) {\n const item = this.findItem(this._categories, selectionKey);\n if (!item)\n throw new Error(`Grid item at provided key not found: ${selectionKey}`);\n\n return item;\n }\n\n /**\n * Walks the grid item hierarchy and finds item matching key\n * @param items items and their descendants to check\n * @param selectionKey unique key for identifying item\n * @returns FlatGridItem if items with key exists, undefined otherwise\n */\n private findItem(\n items: IMutableFlatGridItem[],\n selectionKey: string\n ): IMutableFlatGridItem | undefined {\n for (const item of items) {\n // Each items key is prefixed with it's parent key, so we can ignore the ones that aren't prefixed to reduce checking unnecessary branches.\n if (!selectionKey.startsWith(item.selectionKey)) continue;\n\n if (item.selectionKey === selectionKey) return item;\n\n const foundItem = this.findItem(item.getChildren(), selectionKey);\n if (foundItem) return foundItem;\n }\n\n return undefined;\n }\n\n /**\n * Gets all GridCategoryItems that do not have parent categories.\n * @returns array of GridCategoryItems\n */\n public getRootCategories(): IMutableGridCategoryItem[] {\n return this._categories;\n }\n\n /**\n * Gets an array of all FlatGridItems.\n * @returns 1-Dimensional array of GridCategories and CategorizedProperties\n */\n public getFlatGrid(): IMutableFlatGridItem[] {\n const flatGrid: IMutableFlatGridItem[] = [];\n this._categories.forEach((category) =>\n flatGrid.push(...category.getDescendantsAndSelf())\n );\n\n return flatGrid;\n }\n\n /**\n * Gets an array of all currently visible FlatGridItems.\n * @returns 1-Dimensional array of GridCategories and CategorizedProperties\n */\n public getVisibleFlatGrid(): IMutableFlatGridItem[] {\n const visibleItems: IMutableFlatGridItem[] = [];\n this._categories.forEach((category) =>\n visibleItems.push(...category.getVisibleDescendantsAndSelf())\n );\n\n return visibleItems;\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyGridModel.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/PropertyGridModel.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA+BlC;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAMnC,YACE,YAA0B,EAClB,gBAAyC;QAAzC,qBAAgB,GAAhB,gBAAgB,CAAyB;QAL5C,QAAW,GAAG,IAAI,CAAC;QAOxB,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,UAAU,CAAC,GAAG,CAC5C,CAAC,QAA0B,EAAE,EAAE,CAC7B,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,QAAQ,EAAE,YAAY,CAAC,OAAO,CAAC,CAC3E,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,YAAoB;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAA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------------------------------------------------------------------------------------------\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 */\nimport { immerable } from \"immer\";\nimport type { PropertyCategory, PropertyData } from \"../PropertyDataProvider\";\nimport type { FlatGridItem, GridCategoryItem } from \"./flat-items/FlatGridItem\";\nimport type {\n IMutableFlatGridItem,\n IMutableGridCategoryItem,\n} from \"./flat-items/MutableFlatGridItem\";\nimport type { IMutableGridItemFactory } from \"./flat-items/MutableGridItemFactory\";\n\n/**\n * PropertyGridModel interface for working with immutable FlatGridItems\n * @public\n */\nexport interface IPropertyGridModel {\n getItem: (selectionKey: string) => FlatGridItem;\n getRootCategories: () => GridCategoryItem[];\n getFlatGrid: () => FlatGridItem[];\n getVisibleFlatGrid: () => FlatGridItem[];\n}\n\n/**\n * PropertyGridModel interface for working with mutable FlatGridItems\n * @public\n */\nexport interface IMutablePropertyGridModel {\n getItem: (selectionKey: string) => IMutableFlatGridItem;\n getRootCategories: () => IMutableGridCategoryItem[];\n getFlatGrid: () => IMutableFlatGridItem[];\n getVisibleFlatGrid: () => IMutableFlatGridItem[];\n}\n\n/**\n * Implementation of PropertyGridModel for working with and converting PropertyData to mutable FlatGridItems\n * @public\n */\nexport class MutablePropertyGridModel\n implements IPropertyGridModel, IMutablePropertyGridModel\n{\n public [immerable] = true;\n\n private _categories: IMutableGridCategoryItem[];\n public constructor(\n propertyData: PropertyData,\n private _gridItemFactory: IMutableGridItemFactory\n ) {\n this._categories = propertyData.categories.map(\n (category: PropertyCategory) =>\n this._gridItemFactory.createGridCategory(category, propertyData.records)\n );\n }\n\n /**\n * Retrieves grid item from model.\n * @param selectionKey unique key for identifying item to retrieve.\n */\n public getItem(selectionKey: string) {\n const item = this.findItem(this._categories, selectionKey);\n if (!item)\n throw new Error(`Grid item at provided key not found: ${selectionKey}`);\n\n return item;\n }\n\n /**\n * Walks the grid item hierarchy and finds item matching key\n * @param items items and their descendants to check\n * @param selectionKey unique key for identifying item\n * @returns FlatGridItem if items with key exists, undefined otherwise\n */\n private findItem(\n items: IMutableFlatGridItem[],\n selectionKey: string\n ): IMutableFlatGridItem | undefined {\n for (const item of items) {\n // Each items key is prefixed with it's parent key, so we can ignore the ones that aren't prefixed to reduce checking unnecessary branches.\n if (!selectionKey.startsWith(item.selectionKey)) continue;\n\n if (item.selectionKey === selectionKey) return item;\n\n const foundItem = this.findItem(item.getChildren(), selectionKey);\n if (foundItem) return foundItem;\n }\n\n return undefined;\n }\n\n /**\n * Gets all GridCategoryItems that do not have parent categories.\n * @returns array of GridCategoryItems\n */\n public getRootCategories(): IMutableGridCategoryItem[] {\n return this._categories;\n }\n\n /**\n * Gets an array of all FlatGridItems.\n * @returns 1-Dimensional array of GridCategories and CategorizedProperties\n */\n public getFlatGrid(): IMutableFlatGridItem[] {\n const flatGrid: IMutableFlatGridItem[] = [];\n this._categories.forEach((category) =>\n flatGrid.push(...category.getDescendantsAndSelf())\n );\n\n return flatGrid;\n }\n\n /**\n * Gets an array of all currently visible FlatGridItems.\n * @returns 1-Dimensional array of GridCategories and CategorizedProperties\n */\n public getVisibleFlatGrid(): IMutableFlatGridItem[] {\n const visibleItems: IMutableFlatGridItem[] = [];\n this._categories.forEach((category) =>\n visibleItems.push(...category.getVisibleDescendantsAndSelf())\n );\n\n return visibleItems;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridModelSource.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/PropertyGridModelSource.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQhC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAU9E;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IAK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W,CAChB,QAAoD;QAEpD,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO;QAEzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;IACnC,CAAC;IAED,mCAAmC;IAC5B,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { produce } from \"immer\";\nimport type { PropertyData } from \"../PropertyDataProvider\";\nimport type { IMutableFlatGridItem } from \"./flat-items/MutableFlatGridItem\";\nimport type { IMutableGridItemFactory } from \"./flat-items/MutableGridItemFactory\";\nimport type {\n IMutablePropertyGridModel,\n IPropertyGridModel,\n} from \"./PropertyGridModel\";\nimport { MutablePropertyGridModel } from \"./PropertyGridModel\";\nimport { PropertyGridModelChangeEvent } from \"./PropertyGridModelChangeEvent\";\n\n/** @public */\nexport interface IPropertyGridModelSource {\n onModelChanged: PropertyGridModelChangeEvent;\n setPropertyData: (data: PropertyData) => void;\n modifyModel(callback: (model: IMutablePropertyGridModel) => void): void;\n getModel(): IPropertyGridModel | undefined;\n}\n\n/**\n * Controls property grid model.\n * It is used to modify property grid model model and inform when the model changes.\n * @public\n */\nexport class PropertyGridModelSource implements IPropertyGridModelSource {\n private _model?: IMutablePropertyGridModel;\n /** Event that is emitted every time property model is changed. */\n public onModelChanged = new PropertyGridModelChangeEvent();\n\n public constructor(private _gridFactory: IMutableGridItemFactory) {}\n\n private getFullModelMap(\n fullModel: IMutableFlatGridItem[]\n ): Map<string, IMutableFlatGridItem> {\n const fullModelMap = new Map<string, IMutableFlatGridItem>();\n for (const item of fullModel) {\n const key = item.selectionKey;\n fullModelMap.set(key, item);\n }\n\n return fullModelMap;\n }\n\n private moveOldModelState(\n oldModel: IMutablePropertyGridModel,\n newModel: IMutablePropertyGridModel\n ) {\n const oldModelMap = this.getFullModelMap(oldModel.getFlatGrid());\n const flatGrid = newModel.getFlatGrid();\n\n flatGrid.forEach((gridItem) => {\n const oldGridItem = oldModelMap.get(gridItem.selectionKey);\n // istanbul ignore else\n if (oldGridItem) gridItem.isExpanded = oldGridItem.isExpanded;\n });\n }\n\n public setPropertyData(data: PropertyData) {\n const newModel = new MutablePropertyGridModel(data, this._gridFactory);\n if (this._model !== undefined && data.reusePropertyDataState)\n this.moveOldModelState(this._model, newModel);\n\n this._model = newModel;\n this.onModelChanged.raiseEvent();\n }\n\n /**\n * Modifies property grid model using provided callback.\n * If changes to model are detected, onModelChanged emits an event to all subscribers.\n */\n public modifyModel(\n callback: (model: IMutablePropertyGridModel) => void\n ): void {\n if (!this._model) return;\n\n this._model = produce(this._model, callback);\n this.onModelChanged.raiseEvent();\n }\n\n /** Returns property grid model. */\n public getModel(): IPropertyGridModel | undefined {\n return this._model;\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyGridModelSource.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/PropertyGridModelSource.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQhC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAU9E;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IAKlC,YAA2B,YAAqC;QAArC,iBAAY,GAAZ,YAAY,CAAyB;QAHhE,kEAAkE;QAC3D,mBAAc,GAAG,IAAI,4BAA4B,EAAE,CAAC;IAEQ,CAAC;IAE5D,eAAe,CACrB,SAAiC;QAEjC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAgC,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U,EAAE,CAAC;IACnC,CAAC;IAED,mCAAmC;IAC5B,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { produce } from \"immer\";\nimport type { PropertyData } from \"../PropertyDataProvider\";\nimport type { IMutableFlatGridItem } from \"./flat-items/MutableFlatGridItem\";\nimport type { IMutableGridItemFactory } from \"./flat-items/MutableGridItemFactory\";\nimport type {\n IMutablePropertyGridModel,\n IPropertyGridModel,\n} from \"./PropertyGridModel\";\nimport { MutablePropertyGridModel } from \"./PropertyGridModel\";\nimport { PropertyGridModelChangeEvent } from \"./PropertyGridModelChangeEvent\";\n\n/** @public */\nexport interface IPropertyGridModelSource {\n onModelChanged: PropertyGridModelChangeEvent;\n setPropertyData: (data: PropertyData) => void;\n modifyModel(callback: (model: IMutablePropertyGridModel) => void): void;\n getModel(): IPropertyGridModel | undefined;\n}\n\n/**\n * Controls property grid model.\n * It is used to modify property grid model model and inform when the model changes.\n * @public\n */\nexport class PropertyGridModelSource implements IPropertyGridModelSource {\n private _model?: IMutablePropertyGridModel;\n /** Event that is emitted every time property model is changed. */\n public onModelChanged = new PropertyGridModelChangeEvent();\n\n public constructor(private _gridFactory: IMutableGridItemFactory) {}\n\n private getFullModelMap(\n fullModel: IMutableFlatGridItem[]\n ): Map<string, IMutableFlatGridItem> {\n const fullModelMap = new Map<string, IMutableFlatGridItem>();\n for (const item of fullModel) {\n const key = item.selectionKey;\n fullModelMap.set(key, item);\n }\n\n return fullModelMap;\n }\n\n private moveOldModelState(\n oldModel: IMutablePropertyGridModel,\n newModel: IMutablePropertyGridModel\n ) {\n const oldModelMap = this.getFullModelMap(oldModel.getFlatGrid());\n const flatGrid = newModel.getFlatGrid();\n\n flatGrid.forEach((gridItem) => {\n const oldGridItem = oldModelMap.get(gridItem.selectionKey);\n // istanbul ignore else\n if (oldGridItem) gridItem.isExpanded = oldGridItem.isExpanded;\n });\n }\n\n public setPropertyData(data: PropertyData) {\n const newModel = new MutablePropertyGridModel(data, this._gridFactory);\n if (this._model !== undefined && data.reusePropertyDataState)\n this.moveOldModelState(this._model, newModel);\n\n this._model = newModel;\n this.onModelChanged.raiseEvent();\n }\n\n /**\n * Modifies property grid model using provided callback.\n * If changes to model are detected, onModelChanged emits an event to all subscribers.\n */\n public modifyModel(\n callback: (model: IMutablePropertyGridModel) => void\n ): void {\n if (!this._model) return;\n\n this._model = produce(this._model, callback);\n this.onModelChanged.raiseEvent();\n }\n\n /** Returns property grid model. */\n public getModel(): IPropertyGridModel | undefined {\n return this._model;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableCategorizedArrayProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAUhG,OAAO,EACL,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAG/B;;;GAGG;AACH,MAAM,OAAO,+BACX,SAAQ,0BAA0B;IAMlC,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,eAAwC,EACxC,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CACH,gBAAgB,CAAC,KAAK,EACtB,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,EACL,YAAY,EACZ,oBAAoB,CACrB,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAChE,MAAM,aAAa,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAChE,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;YAClD,MAAM,eAAe,GAAG,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC;YACzC,OAAO,eAAe,CAAC,yBAAyB,CAC9C,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,0BAA0B,EAC1B,aAAa,EACb,OAAO,EACP,eAAe,CAChB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAW,IAAI;QACb,OAAO,gBAAgB,CAAC,KAAK,CAAC;IAChC,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,qBAAqB;QACnC,OAAO,IAAI,CAAC,YAAY;YACtB,CAAC,CAAC,KAAK,CAAC,qBAAqB,EAAE;YAC/B,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IAC5B,CAAC;IAEe,qBAAqB;QACnC,MAAM,WAAW,GAA2B,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACzC,wFAAwF;YACxF,qCAAqC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAC1D,CAAC;SACH;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY;YACtB,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE;YACtC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACnC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n IMutableCategorizedPropertyItem,\n IMutableFlatGridItem,\n} from \"./MutableFlatGridItem\";\nimport {\n FlatGridItemType,\n MutableCategorizedProperty,\n} from \"./MutableFlatGridItem\";\nimport type { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/**\n * Mutable wrapper object for PropertyRecord with array valueFormat which provides methods for working with and managing record children hierarchies.\n * @public\n */\nexport class MutableCategorizedArrayProperty\n extends MutableCategorizedProperty\n implements IMutableCategorizedPropertyItem\n{\n private _renderLabel: boolean;\n private _children: IMutableCategorizedPropertyItem[];\n\n public constructor(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n gridItemFactory: IMutableGridItemFactory,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n super(\n FlatGridItemType.Array,\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n this._renderLabel = !record.property.hideCompositePropertyLabel;\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\n this._children = record.getChildrenRecords().map((child, index) => {\n const newName = `${child.property.name}_${index}`;\n const newDisplayLabel = `[${index + 1}]`;\n return gridItemFactory.createCategorizedProperty(\n child,\n this.selectionKey,\n parentCategorySelectionKey,\n childrenDepth,\n newName,\n newDisplayLabel\n );\n });\n }\n\n public get type(): FlatGridItemType.Array {\n return FlatGridItemType.Array;\n }\n\n public getChildren(): IMutableCategorizedPropertyItem[] {\n return this._children;\n }\n\n public override getDescendantsAndSelf() {\n return this._renderLabel\n ? super.getDescendantsAndSelf()\n : this.getDescendants();\n }\n\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded || !this._renderLabel) {\n // always render children if not rendering the label, otherwise there's no way to expand\n // this item to make children visible\n this.getChildren().forEach((child) =>\n descendants.push(...child.getVisibleDescendantsAndSelf())\n );\n }\n return descendants;\n }\n\n public override getVisibleDescendantsAndSelf() {\n return this._renderLabel\n ? super.getVisibleDescendantsAndSelf()\n : this.getVisibleDescendants();\n }\n}\n"]}
1
+ {"version":3,"file":"MutableCategorizedArrayProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAUhG,OAAO,EACL,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAG/B;;;GAGG;AACH,MAAM,OAAO,+BACX,SAAQ,0BAA0B;IAMlC,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,eAAwC,EACxC,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CACH,gBAAgB,CAAC,KAAK,EACtB,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,EACL,YAAY,EACZ,oBAAoB,CACrB,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAChE,MAAM,aAAa,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAChE,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;YAClD,MAAM,eAAe,GAAG,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC;YACzC,OAAO,eAAe,CAAC,yBAAyB,CAC9C,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,0BAA0B,EAC1B,aAAa,EACb,OAAO,EACP,eAAe,CAChB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAW,IAAI;QACb,OAAO,gBAAgB,CAAC,KAAK,CAAC;IAChC,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,qBAAqB;QACnC,OAAO,IAAI,CAAC,YAAY;YACtB,CAAC,CAAC,KAAK,CAAC,qBAAqB,EAAE;YAC/B,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IAC5B,CAAC;IAEe,qBAAqB;QACnC,MAAM,WAAW,GAA2B,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1C,wFAAwF;YACxF,qCAAqC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAC1D,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY;YACtB,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE;YACtC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACnC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n IMutableCategorizedPropertyItem,\n IMutableFlatGridItem,\n} from \"./MutableFlatGridItem\";\nimport {\n FlatGridItemType,\n MutableCategorizedProperty,\n} from \"./MutableFlatGridItem\";\nimport type { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/**\n * Mutable wrapper object for PropertyRecord with array valueFormat which provides methods for working with and managing record children hierarchies.\n * @public\n */\nexport class MutableCategorizedArrayProperty\n extends MutableCategorizedProperty\n implements IMutableCategorizedPropertyItem\n{\n private _renderLabel: boolean;\n private _children: IMutableCategorizedPropertyItem[];\n\n public constructor(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n gridItemFactory: IMutableGridItemFactory,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n super(\n FlatGridItemType.Array,\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n this._renderLabel = !record.property.hideCompositePropertyLabel;\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\n this._children = record.getChildrenRecords().map((child, index) => {\n const newName = `${child.property.name}_${index}`;\n const newDisplayLabel = `[${index + 1}]`;\n return gridItemFactory.createCategorizedProperty(\n child,\n this.selectionKey,\n parentCategorySelectionKey,\n childrenDepth,\n newName,\n newDisplayLabel\n );\n });\n }\n\n public get type(): FlatGridItemType.Array {\n return FlatGridItemType.Array;\n }\n\n public getChildren(): IMutableCategorizedPropertyItem[] {\n return this._children;\n }\n\n public override getDescendantsAndSelf() {\n return this._renderLabel\n ? super.getDescendantsAndSelf()\n : this.getDescendants();\n }\n\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded || !this._renderLabel) {\n // always render children if not rendering the label, otherwise there's no way to expand\n // this item to make children visible\n this.getChildren().forEach((child) =>\n descendants.push(...child.getVisibleDescendantsAndSelf())\n );\n }\n return descendants;\n }\n\n public override getVisibleDescendantsAndSelf() {\n return this._renderLabel\n ? super.getVisibleDescendantsAndSelf()\n : this.getVisibleDescendants();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableCategorizedStructProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableC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,YAAY,EAAE;YACzC,wFAAwF;YACxF,qCAAqC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAC1D,CAAC;SACH;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY;YACtB,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE;YACtC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACnC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n IMutableCategorizedPropertyItem,\n IMutableFlatGridItem,\n} from \"./MutableFlatGridItem\";\nimport {\n FlatGridItemType,\n MutableCategorizedProperty,\n} from \"./MutableFlatGridItem\";\nimport type { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/**\n * Mutable wrapper object for PropertyRecord with struct valueFormat which provides methods for working with and managing record children hierarchies.\n * @public\n */\nexport class MutableCategorizedStructProperty\n extends MutableCategorizedProperty\n implements IMutableCategorizedPropertyItem\n{\n private _renderLabel: boolean;\n private _children: IMutableCategorizedPropertyItem[];\n\n public constructor(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n gridItemFactory: IMutableGridItemFactory,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n super(\n FlatGridItemType.Struct,\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n this._renderLabel = !record.property.hideCompositePropertyLabel;\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\n this._children = record.getChildrenRecords().map((value) => {\n return gridItemFactory.createCategorizedProperty(\n value,\n this.selectionKey,\n this.parentCategorySelectionKey,\n childrenDepth\n );\n });\n }\n\n public get type(): FlatGridItemType.Struct {\n return FlatGridItemType.Struct;\n }\n\n public getChildren(): IMutableCategorizedPropertyItem[] {\n return this._children;\n }\n\n public override getDescendantsAndSelf() {\n return this._renderLabel\n ? super.getDescendantsAndSelf()\n : this.getDescendants();\n }\n\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded || !this._renderLabel) {\n // always render children if not rendering the label, otherwise there's no way to expand\n // this item to make children visible\n this.getChildren().forEach((child) =>\n descendants.push(...child.getVisibleDescendantsAndSelf())\n );\n }\n return descendants;\n }\n\n public override getVisibleDescendantsAndSelf() {\n return this._renderLabel\n ? super.getVisibleDescendantsAndSelf()\n : this.getVisibleDescendants();\n }\n}\n"]}
1
+ {"version":3,"file":"MutableCategorizedStructProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAUhG,OAAO,EACL,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAG/B;;;GAGG;AACH,MAAM,OAAO,gCACX,SAAQ,0BAA0B;IAMlC,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,eAAwC,EACxC,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CACH,gBAAgB,CAAC,MAAM,EACvB,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,EACL,YAAY,EACZ,oBAAoB,CACrB,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAChE,MAAM,aAAa,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACzD,OAAO,eAAe,CAAC,yBAAyB,CAC9C,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,0BAA0B,EAC/B,aAAa,CACd,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAW,IAAI;QACb,OAAO,gBAAgB,CAAC,MAAM,CAAC;IACjC,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,qBAAqB;QACnC,OAAO,IAAI,CAAC,YAAY;YACtB,CAAC,CAAC,KAAK,CAAC,qBAAqB,EAAE;YAC/B,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IAC5B,CAAC;IAEe,qBAAqB;QACnC,MAAM,WAAW,GAA2B,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1C,wFAAwF;YACxF,qCAAqC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAC1D,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY;YACtB,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE;YACtC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACnC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n IMutableCategorizedPropertyItem,\n IMutableFlatGridItem,\n} from \"./MutableFlatGridItem\";\nimport {\n FlatGridItemType,\n MutableCategorizedProperty,\n} from \"./MutableFlatGridItem\";\nimport type { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/**\n * Mutable wrapper object for PropertyRecord with struct valueFormat which provides methods for working with and managing record children hierarchies.\n * @public\n */\nexport class MutableCategorizedStructProperty\n extends MutableCategorizedProperty\n implements IMutableCategorizedPropertyItem\n{\n private _renderLabel: boolean;\n private _children: IMutableCategorizedPropertyItem[];\n\n public constructor(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n gridItemFactory: IMutableGridItemFactory,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n super(\n FlatGridItemType.Struct,\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n this._renderLabel = !record.property.hideCompositePropertyLabel;\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\n this._children = record.getChildrenRecords().map((value) => {\n return gridItemFactory.createCategorizedProperty(\n value,\n this.selectionKey,\n this.parentCategorySelectionKey,\n childrenDepth\n );\n });\n }\n\n public get type(): FlatGridItemType.Struct {\n return FlatGridItemType.Struct;\n }\n\n public getChildren(): IMutableCategorizedPropertyItem[] {\n return this._children;\n }\n\n public override getDescendantsAndSelf() {\n return this._renderLabel\n ? super.getDescendantsAndSelf()\n : this.getDescendants();\n }\n\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded || !this._renderLabel) {\n // always render children if not rendering the label, otherwise there's no way to expand\n // this item to make children visible\n this.getChildren().forEach((child) =>\n descendants.push(...child.getVisibleDescendantsAndSelf())\n );\n }\n return descendants;\n }\n\n public override getVisibleDescendantsAndSelf() {\n return this._renderLabel\n ? super.getVisibleDescendantsAndSelf()\n : this.getVisibleDescendants();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableFlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5E;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+DAAQ,CAAA;IACR,iEAAS,CAAA;IACT,yDAAK,CAAA;IACL,2DAAM,CAAA;AACR,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAgCD;;;GAGG;AACH,MAAM,OAAgB,2BAA2B;IAU/C,YACU,MAAc,EACd,mBAAuC,EACvC,2BAA+C;QAF/C,WAAM,GAAN,MAAM,CAAQ;QACd,wBAAmB,GAAnB,mBAAmB,CAAoB;QACvC,gCAA2B,GAA3B,2BAA2B,CAAoB;QAVlD,QAAW,GAAG,IAAI,CAAC;QAEV,QAAG,GAAW,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,gBAAW,GAAY,KAAK,CAAC;QAC7B,8BAAyB,GAAW,CAAC,CAAC;QACtC,0BAAqB,GAAY,KAAK,CAAC;QAO/C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACnE,CAAC;IAMD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,IAAW,0BAA0B;QACnC,OAAO,IAAI,CAAC,2BAA2B,CAAC;IAC1C,CAAC;IAED,IAAW,U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EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,GAAG,EAAE,GAAG,mBAAmB,EAAE,CAAC;QACvE,MAAM,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC;QACrC,MAAM,eAAe,GAAG,eAAe,IAAI,YAAY,CAAC;QAExD,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACK,iBAAiB,CACvB,MAAsB,EACtB,4BAAiD;QAEjD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;QAC9C,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;QAE1E,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAoB,0BAA0B;QAC5C,OAAO,KAAK,CAAC,0BAA2B,CAAC;IAC3C,CAAC;IAED,IAAoB,kBAAkB;QACpC,OAAO,KAAK,CAAC,kBAAmB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport { immerable } from \"immer\";\nimport shortid from \"shortid\";\nimport type { PropertyDescription } from \"@itwin/appui-abstract\";\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider\";\n\n/**\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\n * Category for PropertyCategory\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\n * @public\n */\nexport enum FlatGridItemType {\n Category,\n Primitive,\n Array,\n Struct,\n}\n\n/**\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\n * @public\n */\nexport type CategorizedPropertyTypes =\n | FlatGridItemType.Array\n | FlatGridItemType.Primitive\n | FlatGridItemType.Struct;\n\n/**\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\n * @public\n */\nexport interface IMutableFlatPropertyGridItem {\n readonly type: FlatGridItemType;\n readonly key: string;\n readonly selectionKey: string;\n readonly parentSelectionKey: string | undefined;\n readonly parentCategorySelectionKey: string | undefined;\n readonly depth: number;\n readonly label: string;\n lastInNumberOfCategories: number;\n isLastInRootCategory: boolean;\n isExpanded: boolean;\n getDescendantsAndSelf(): IMutableFlatGridItem[];\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\n getChildren(): IMutableFlatGridItem[];\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\n}\n\n/**\n * Base class for all FlatPropertyGrid items\n * @public\n */\nexport abstract class MutableFlatPropertyGridItem\n implements IMutableFlatPropertyGridItem\n{\n public [immerable] = true;\n\n public readonly key: string = shortid.generate();\n protected _isExpanded: boolean = false;\n protected _lastInNumberOfCategories: number = 0;\n protected _isLastInRootCategory: boolean = false;\n\n public constructor(\n private _depth: number,\n private _parentSelectionKey: string | undefined,\n private _parentCategorySelectionKey: string | undefined\n ) {\n if (this._depth < 0) throw new Error(\"Depth cannot be negative\");\n }\n\n public abstract type: FlatGridItemType;\n public abstract label: string;\n public abstract selectionKey: string;\n\n public get depth() {\n return this._depth;\n }\n\n public get parentSelectionKey() {\n return this._parentSelectionKey;\n }\n\n public get parentCategorySelectionKey() {\n return this._parentCategorySelectionKey;\n }\n\n public get isExpanded() {\n return this._isExpanded;\n }\n\n public set isExpanded(value: boolean) {\n this._isExpanded = value;\n }\n\n public abstract getChildren(): IMutableFlatGridItem[];\n public abstract getSelf(): IMutableFlatGridItem;\n\n protected getDescendants() {\n const descendants: IMutableFlatGridItem[] = [];\n this.getChildren().forEach((child) =>\n descendants.push(...child.getDescendantsAndSelf())\n );\n\n return descendants;\n }\n\n /**\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\n */\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getDescendants()];\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\n */\n public getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded)\n this.getChildren().forEach((child) =>\n descendants.push(...child.getVisibleDescendantsAndSelf())\n );\n return descendants;\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\n */\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getVisibleDescendants()];\n }\n\n /**\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\n */\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\n if (!this.isExpanded) return this.getSelf();\n\n const children = this.getChildren();\n if (children.length < 1) return this.getSelf();\n\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\n }\n\n /**\n * Sets lastInNumberOfCategories value and sends it down to this items last child\n * @internal\n */\n public get lastInNumberOfCategories(): number {\n if (this.isExpanded && this.getChildren().length > 0) return 0;\n\n return this._lastInNumberOfCategories;\n }\n\n public set lastInNumberOfCategories(value: number) {\n this._lastInNumberOfCategories = value;\n const children = this.getChildren();\n if (children.length < 1) return;\n\n children[children.length - 1].lastInNumberOfCategories = value;\n }\n\n /**\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\n * @internal\n */\n public get isLastInRootCategory(): boolean {\n if (this.isExpanded && this.getChildren().length > 0) return false;\n\n return this._isLastInRootCategory;\n }\n\n public set isLastInRootCategory(value: boolean) {\n this._isLastInRootCategory = value;\n const children = this.getChildren();\n if (children.length < 1) return;\n\n children[children.length - 1].isLastInRootCategory = value;\n }\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\n * @public\n */\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\n type: FlatGridItemType.Category;\n name: string;\n derivedCategory: PropertyCategory;\n isRootCategory: boolean;\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\n * @public\n */\nexport interface IMutableCategorizedPropertyItem\n extends IMutableFlatPropertyGridItem {\n readonly type: CategorizedPropertyTypes;\n readonly derivedRecord: PropertyRecord;\n readonly parentCategorySelectionKey: string;\n readonly parentSelectionKey: string;\n\n getChildren(): IMutableCategorizedPropertyItem[];\n}\n\n/**\n * Type which describes mutable GridCategoryItem or CategorizedProperty\n * @public\n */\nexport type IMutableFlatGridItem =\n | IMutableCategorizedPropertyItem\n | IMutableGridCategoryItem;\n\n/**\n * Base class for all Mutable CategorizedProperties\n * @public\n */\nexport abstract class MutableCategorizedProperty\n extends MutableFlatPropertyGridItem\n implements Partial<IMutableCategorizedPropertyItem>\n{\n private _derivedRecord: PropertyRecord;\n private _selectionKey: string;\n\n public constructor(\n type: CategorizedPropertyTypes,\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n super(depth, parentSelectionKey, parentCategorySelectionKey);\n\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\n if (recordType !== type) {\n const expectedTypeStr = FlatGridItemType[type];\n const actualTypeStr = FlatGridItemType[recordType];\n throw Error(\n `Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`\n );\n }\n\n const overridenProperty = this.makeOverridenProperty(\n record.property,\n overrideName,\n overrideDisplayLabel\n );\n this._derivedRecord = this.makeDerivedRecord(record, overridenProperty);\n\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\n this._isExpanded = !!record.autoExpand;\n }\n\n public abstract override type: CategorizedPropertyTypes;\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\n\n /**\n * Maps PropertyRecord valueFormat to FlatGridItemType\n * @param valueType valueFormat to map\n * @returns mapped FlatGridItemType\n */\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\n switch (valueType) {\n case PropertyValueFormat.Primitive:\n return FlatGridItemType.Primitive;\n case PropertyValueFormat.Array:\n return FlatGridItemType.Array;\n case PropertyValueFormat.Struct:\n return FlatGridItemType.Struct;\n /* istanbul ignore next */\n default:\n const unhandledType: never = valueType;\n throw Error(`Property Value Format not handled: ${unhandledType}`);\n }\n }\n\n /**\n * Make new property description with overriden fields.\n * @param propertyDescription property description to override.\n * @param overrideName property description name to override.\n * @param overrideDisplay property description display name to override.\n */\n private makeOverridenProperty(\n propertyDescription: PropertyDescription,\n overrideName?: string,\n overrideDisplay?: string\n ): PropertyDescription {\n const { name, displayLabel, ...property } = { ...propertyDescription };\n const newName = overrideName ?? name;\n const newDisplayLabel = overrideDisplay ?? displayLabel;\n\n return { ...property, name: newName, displayLabel: newDisplayLabel };\n }\n\n /**\n * Gets derived property record that has it's property description field overriden\n */\n private makeDerivedRecord(\n record: PropertyRecord,\n overridenPropertyDescription: PropertyDescription\n ) {\n const { value, property, ...others } = record;\n const newRecord = new PropertyRecord(value, overridenPropertyDescription);\n\n return Object.assign(newRecord, others);\n }\n\n public getSelf(): IMutableCategorizedPropertyItem {\n return this;\n }\n\n public override get parentCategorySelectionKey() {\n return super.parentCategorySelectionKey!;\n }\n\n public override get parentSelectionKey() {\n return super.parentSelectionKey!;\n }\n\n /**\n * Unique selection key made of parent selectionKey and this property name.\n */\n public get selectionKey() {\n return this._selectionKey;\n }\n\n public get label() {\n return this._derivedRecord.property.displayLabel;\n }\n\n /**\n * Record with overriden property description.\n */\n public get derivedRecord() {\n return this._derivedRecord;\n }\n}\n"]}
1
+ {"version":3,"file":"MutableFlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5E;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+DAAQ,CAAA;IACR,iEAAS,CAAA;IACT,yDAAK,CAAA;IACL,2DAAM,CAAA;AACR,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAgCD;;;GAGG;AACH,MAAM,OAAgB,2BAA2B;IAU/C,YACU,MAAc,EACd,mBAAuC,EACvC,2BAA+C;QAF/C,WAAM,GAAN,MAAM,CAAQ;QACd,wBAAmB,GAAnB,mBAAmB,CAAoB;QACvC,gCAA2B,GAA3B,2BAA2B,CAAoB;QAVlD,QAAW,GAAG,IAAI,CAAC;QAEV,QAAG,GAAW,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,gBAAW,GAAY,KAAK,CAAC;QAC7B,8BAAyB,GAAW,CAAC,CAAC;QACtC,0BAAqB,GAAY,KAAK,CAAC;QAO/C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACnE,CAAC;IAMD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,IAAW,0BAA0B;QACnC,OAAO,IAAI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AKG;IACK,qBAAqB,CAC3B,mBAAwC,EACxC,YAAqB,EACrB,eAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,GAAG,EAAE,GAAG,mBAAmB,EAAE,CAAC;QACvE,MAAM,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC;QACrC,MAAM,eAAe,GAAG,eAAe,IAAI,YAAY,CAAC;QAExD,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACK,iBAAiB,CACvB,MAAsB,EACtB,4BAAiD;QAEjD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;QAC9C,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;QAE1E,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAoB,0BAA0B;QAC5C,OAAO,KAAK,CAAC,0BAA2B,CAAC;IAC3C,CAAC;IAED,IAAoB,kBAAkB;QACpC,OAAO,KAAK,CAAC,kBAAmB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport { immerable } from \"immer\";\nimport shortid from \"shortid\";\nimport type { PropertyDescription } from \"@itwin/appui-abstract\";\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider\";\n\n/**\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\n * Category for PropertyCategory\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\n * @public\n */\nexport enum FlatGridItemType {\n Category,\n Primitive,\n Array,\n Struct,\n}\n\n/**\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\n * @public\n */\nexport type CategorizedPropertyTypes =\n | FlatGridItemType.Array\n | FlatGridItemType.Primitive\n | FlatGridItemType.Struct;\n\n/**\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\n * @public\n */\nexport interface IMutableFlatPropertyGridItem {\n readonly type: FlatGridItemType;\n readonly key: string;\n readonly selectionKey: string;\n readonly parentSelectionKey: string | undefined;\n readonly parentCategorySelectionKey: string | undefined;\n readonly depth: number;\n readonly label: string;\n lastInNumberOfCategories: number;\n isLastInRootCategory: boolean;\n isExpanded: boolean;\n getDescendantsAndSelf(): IMutableFlatGridItem[];\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\n getChildren(): IMutableFlatGridItem[];\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\n}\n\n/**\n * Base class for all FlatPropertyGrid items\n * @public\n */\nexport abstract class MutableFlatPropertyGridItem\n implements IMutableFlatPropertyGridItem\n{\n public [immerable] = true;\n\n public readonly key: string = shortid.generate();\n protected _isExpanded: boolean = false;\n protected _lastInNumberOfCategories: number = 0;\n protected _isLastInRootCategory: boolean = false;\n\n public constructor(\n private _depth: number,\n private _parentSelectionKey: string | undefined,\n private _parentCategorySelectionKey: string | undefined\n ) {\n if (this._depth < 0) throw new Error(\"Depth cannot be negative\");\n }\n\n public abstract type: FlatGridItemType;\n public abstract label: string;\n public abstract selectionKey: string;\n\n public get depth() {\n return this._depth;\n }\n\n public get parentSelectionKey() {\n return this._parentSelectionKey;\n }\n\n public get parentCategorySelectionKey() {\n return this._parentCategorySelectionKey;\n }\n\n public get isExpanded() {\n return this._isExpanded;\n }\n\n public set isExpanded(value: boolean) {\n this._isExpanded = value;\n }\n\n public abstract getChildren(): IMutableFlatGridItem[];\n public abstract getSelf(): IMutableFlatGridItem;\n\n protected getDescendants() {\n const descendants: IMutableFlatGridItem[] = [];\n this.getChildren().forEach((child) =>\n descendants.push(...child.getDescendantsAndSelf())\n );\n\n return descendants;\n }\n\n /**\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\n */\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getDescendants()];\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\n */\n public getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded)\n this.getChildren().forEach((child) =>\n descendants.push(...child.getVisibleDescendantsAndSelf())\n );\n return descendants;\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\n */\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getVisibleDescendants()];\n }\n\n /**\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\n */\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\n if (!this.isExpanded) return this.getSelf();\n\n const children = this.getChildren();\n if (children.length < 1) return this.getSelf();\n\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\n }\n\n /**\n * Sets lastInNumberOfCategories value and sends it down to this items last child\n * @internal\n */\n public get lastInNumberOfCategories(): number {\n if (this.isExpanded && this.getChildren().length > 0) return 0;\n\n return this._lastInNumberOfCategories;\n }\n\n public set lastInNumberOfCategories(value: number) {\n this._lastInNumberOfCategories = value;\n const children = this.getChildren();\n if (children.length < 1) return;\n\n children[children.length - 1].lastInNumberOfCategories = value;\n }\n\n /**\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\n * @internal\n */\n public get isLastInRootCategory(): boolean {\n if (this.isExpanded && this.getChildren().length > 0) return false;\n\n return this._isLastInRootCategory;\n }\n\n public set isLastInRootCategory(value: boolean) {\n this._isLastInRootCategory = value;\n const children = this.getChildren();\n if (children.length < 1) return;\n\n children[children.length - 1].isLastInRootCategory = value;\n }\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\n * @public\n */\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\n type: FlatGridItemType.Category;\n name: string;\n derivedCategory: PropertyCategory;\n isRootCategory: boolean;\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\n * @public\n */\nexport interface IMutableCategorizedPropertyItem\n extends IMutableFlatPropertyGridItem {\n readonly type: CategorizedPropertyTypes;\n readonly derivedRecord: PropertyRecord;\n readonly parentCategorySelectionKey: string;\n readonly parentSelectionKey: string;\n\n getChildren(): IMutableCategorizedPropertyItem[];\n}\n\n/**\n * Type which describes mutable GridCategoryItem or CategorizedProperty\n * @public\n */\nexport type IMutableFlatGridItem =\n | IMutableCategorizedPropertyItem\n | IMutableGridCategoryItem;\n\n/**\n * Base class for all Mutable CategorizedProperties\n * @public\n */\nexport abstract class MutableCategorizedProperty\n extends MutableFlatPropertyGridItem\n implements Partial<IMutableCategorizedPropertyItem>\n{\n private _derivedRecord: PropertyRecord;\n private _selectionKey: string;\n\n public constructor(\n type: CategorizedPropertyTypes,\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n super(depth, parentSelectionKey, parentCategorySelectionKey);\n\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\n if (recordType !== type) {\n const expectedTypeStr = FlatGridItemType[type];\n const actualTypeStr = FlatGridItemType[recordType];\n throw Error(\n `Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`\n );\n }\n\n const overridenProperty = this.makeOverridenProperty(\n record.property,\n overrideName,\n overrideDisplayLabel\n );\n this._derivedRecord = this.makeDerivedRecord(record, overridenProperty);\n\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\n this._isExpanded = !!record.autoExpand;\n }\n\n public abstract override type: CategorizedPropertyTypes;\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\n\n /**\n * Maps PropertyRecord valueFormat to FlatGridItemType\n * @param valueType valueFormat to map\n * @returns mapped FlatGridItemType\n */\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\n switch (valueType) {\n case PropertyValueFormat.Primitive:\n return FlatGridItemType.Primitive;\n case PropertyValueFormat.Array:\n return FlatGridItemType.Array;\n case PropertyValueFormat.Struct:\n return FlatGridItemType.Struct;\n /* istanbul ignore next */\n default:\n const unhandledType: never = valueType;\n throw Error(`Property Value Format not handled: ${unhandledType}`);\n }\n }\n\n /**\n * Make new property description with overriden fields.\n * @param propertyDescription property description to override.\n * @param overrideName property description name to override.\n * @param overrideDisplay property description display name to override.\n */\n private makeOverridenProperty(\n propertyDescription: PropertyDescription,\n overrideName?: string,\n overrideDisplay?: string\n ): PropertyDescription {\n const { name, displayLabel, ...property } = { ...propertyDescription };\n const newName = overrideName ?? name;\n const newDisplayLabel = overrideDisplay ?? displayLabel;\n\n return { ...property, name: newName, displayLabel: newDisplayLabel };\n }\n\n /**\n * Gets derived property record that has it's property description field overriden\n */\n private makeDerivedRecord(\n record: PropertyRecord,\n overridenPropertyDescription: PropertyDescription\n ) {\n const { value, property, ...others } = record;\n const newRecord = new PropertyRecord(value, overridenPropertyDescription);\n\n return Object.assign(newRecord, others);\n }\n\n public getSelf(): IMutableCategorizedPropertyItem {\n return this;\n }\n\n public override get parentCategorySelectionKey() {\n return super.parentCategorySelectionKey!;\n }\n\n public override get parentSelectionKey() {\n return super.parentSelectionKey!;\n }\n\n /**\n * Unique selection key made of parent selectionKey and this property name.\n */\n public get selectionKey() {\n return this._selectionKey;\n }\n\n public get label() {\n return this._derivedRecord.property.displayLabel;\n }\n\n /**\n * Record with overriden property description.\n */\n public get derivedRecord() {\n return this._derivedRecord;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableGridItemFactory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAMxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAwB5D;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACvB,uBAAuB,CAC/B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,mCAAmC,CAC5C,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,EACL,YAAY,EACZ,oBAAoB,CACrB,CAAC;IACJ,CAAC;IAES,mBAAmB,CAC3B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,+BAA+B,CACxC,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,oBAAoB,CACrB,CAAC;IACJ,CAAC;IAES,oBAAoB,CAC5B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,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AAI,KAAK,KAAK,SAAS;YACzD,OAAO,IAAI,mBAAmB,CAC5B,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,KAAK,CACN,CAAC;QAEJ,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { MutableCategorizedArrayProperty } from \"./MutableCategorizedArrayProperty\";\nimport { MutableCategorizedPrimitiveProperty } from \"./MutableCategorizedPrimitiveProperty\";\nimport { MutableCategorizedStructProperty } from \"./MutableCategorizedStructProperty\";\nimport { MutableCustomGridCategory } from \"./MutableCustomGridCategory\";\nimport type {\n IMutableCategorizedPropertyItem,\n IMutableGridCategoryItem,\n} from \"./MutableFlatGridItem\";\nimport type { CategoryRecordsDict } from \"./MutableGridCategory\";\nimport { MutableGridCategory } from \"./MutableGridCategory\";\n\n/**\n * IMutableGridItemFactory interface for creating MutableGridItem objects\n * @public\n */\nexport interface IMutableGridItemFactory {\n createCategorizedProperty: (\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) => IMutableCategorizedPropertyItem;\n\n createGridCategory: (\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number\n ) => IMutableGridCategoryItem;\n}\n\n/**\n * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.\n * @public\n */\nexport class MutableGridItemFactory implements IMutableGridItemFactory {\n protected createPrimitiveProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedPrimitiveProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n protected createArrayProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedArrayProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n this,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n protected createStructProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedStructProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n this,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n /**\n * Converts record into FlatGridItem.\n * @param record record to convert to a FlatGridItem.\n * @param parentSelectionKey parent selection key of provided `record`.\n * @param parentCategorySelectionKey parent category selection key of provided `record`.\n * @param depth current depth counting from parent category.\n * @param overrideName property name that overrides original record property name.\n * @param overrideDisplayLabel property display label that overrides original record property display label.\n * @returns converted CategorizedProperty.\n */\n public createCategorizedProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ): IMutableCategorizedPropertyItem {\n const valueFormat = record.value.valueFormat;\n switch (valueFormat) {\n case PropertyValueFormat.Primitive:\n return this.createPrimitiveProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n case PropertyValueFormat.Array:\n return this.createArrayProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n case PropertyValueFormat.Struct:\n return this.createStructProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n /* istanbul ignore next */\n default:\n const unhandledRecordType: never = valueFormat;\n throw new Error(\n `Unhandled property record type. Was a new type added? ${unhandledRecordType}`\n );\n }\n }\n\n /**\n * Converts category into GridCategoryItem.\n * @param category PropertyCategory to convert.\n * @param recordsDict dictionary of category records.\n * @param parentSelectionKey parent selection key of this category.\n * @param depth current depth counting from root category.\n * @returns converted GridCategory.\n */\n public createGridCategory(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number\n ): IMutableGridCategoryItem {\n if (category.renderer !== undefined)\n return new MutableCustomGridCategory(\n category,\n recordsDict,\n this,\n parentSelectionKey,\n depth ?? 0\n );\n\n if (parentSelectionKey !== undefined && depth !== undefined)\n return new MutableGridCategory(\n category,\n recordsDict,\n this,\n parentSelectionKey,\n depth\n );\n\n return new MutableGridCategory(category, recordsDict, this);\n }\n}\n"]}
1
+ {"version":3,"file":"MutableGridItemFactory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAMxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAwB5D;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACvB,uBAAuB,CAC/B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,mCAAmC,CAC5C,MAAM,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AAoB,CACrB,CAAC;YACJ,0BAA0B;YAC1B;gBACE,MAAM,mBAAmB,GAAU,WAAW,CAAC;gBAC/C,MAAM,IAAI,KAAK,CACb,yDAAyD,mBAAmB,EAAE,CAC/E,CAAC;QACN,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACI,kBAAkB,CACvB,QAA0B,EAC1B,WAAgC,EAChC,kBAA2B,EAC3B,KAAc;QAEd,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS;YACjC,OAAO,IAAI,yBAAyB,CAClC,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,KAAK,IAAI,CAAC,CACX,CAAC;QAEJ,IAAI,kBAAkB,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;YACzD,OAAO,IAAI,mBAAmB,CAC5B,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,KAAK,CACN,CAAC;QAEJ,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { MutableCategorizedArrayProperty } from \"./MutableCategorizedArrayProperty\";\nimport { MutableCategorizedPrimitiveProperty } from \"./MutableCategorizedPrimitiveProperty\";\nimport { MutableCategorizedStructProperty } from \"./MutableCategorizedStructProperty\";\nimport { MutableCustomGridCategory } from \"./MutableCustomGridCategory\";\nimport type {\n IMutableCategorizedPropertyItem,\n IMutableGridCategoryItem,\n} from \"./MutableFlatGridItem\";\nimport type { CategoryRecordsDict } from \"./MutableGridCategory\";\nimport { MutableGridCategory } from \"./MutableGridCategory\";\n\n/**\n * IMutableGridItemFactory interface for creating MutableGridItem objects\n * @public\n */\nexport interface IMutableGridItemFactory {\n createCategorizedProperty: (\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) => IMutableCategorizedPropertyItem;\n\n createGridCategory: (\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number\n ) => IMutableGridCategoryItem;\n}\n\n/**\n * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.\n * @public\n */\nexport class MutableGridItemFactory implements IMutableGridItemFactory {\n protected createPrimitiveProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedPrimitiveProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n protected createArrayProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedArrayProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n this,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n protected createStructProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedStructProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n this,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n /**\n * Converts record into FlatGridItem.\n * @param record record to convert to a FlatGridItem.\n * @param parentSelectionKey parent selection key of provided `record`.\n * @param parentCategorySelectionKey parent category selection key of provided `record`.\n * @param depth current depth counting from parent category.\n * @param overrideName property name that overrides original record property name.\n * @param overrideDisplayLabel property display label that overrides original record property display label.\n * @returns converted CategorizedProperty.\n */\n public createCategorizedProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ): IMutableCategorizedPropertyItem {\n const valueFormat = record.value.valueFormat;\n switch (valueFormat) {\n case PropertyValueFormat.Primitive:\n return this.createPrimitiveProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n case PropertyValueFormat.Array:\n return this.createArrayProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n case PropertyValueFormat.Struct:\n return this.createStructProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n /* istanbul ignore next */\n default:\n const unhandledRecordType: never = valueFormat;\n throw new Error(\n `Unhandled property record type. Was a new type added? ${unhandledRecordType}`\n );\n }\n }\n\n /**\n * Converts category into GridCategoryItem.\n * @param category PropertyCategory to convert.\n * @param recordsDict dictionary of category records.\n * @param parentSelectionKey parent selection key of this category.\n * @param depth current depth counting from root category.\n * @returns converted GridCategory.\n */\n public createGridCategory(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number\n ): IMutableGridCategoryItem {\n if (category.renderer !== undefined)\n return new MutableCustomGridCategory(\n category,\n recordsDict,\n this,\n parentSelectionKey,\n depth ?? 0\n );\n\n if (parentSelectionKey !== undefined && depth !== undefined)\n return new MutableGridCategory(\n category,\n recordsDict,\n this,\n parentSelectionKey,\n depth\n );\n\n return new MutableGridCategory(category, recordsDict, this);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FlatPropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAA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AAS,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type { HighlightingComponentProps } from \"../../../common/HighlightingComponentProps\";\nimport type { PropertyUpdatedArgs } from \"../../../editors/EditorContainer\";\nimport { EditorContainer } from \"../../../editors/EditorContainer\";\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\nimport type { PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\nimport type { SharedRendererProps } from \"../../../properties/renderers/PropertyRenderer\";\nimport { PropertyValueRendererManager } from \"../../../properties/ValueRendererManager\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FlatNonPrimitivePropertyRenderer } from \"./FlatNonPrimitivePropertyRenderer\";\nimport { CustomizablePropertyRenderer } from \"../../../properties/renderers/CustomizablePropertyRenderer\";\n\n/** Properties of [[FlatPropertyRenderer]] React component\n * @internal\n */\nexport interface FlatPropertyRendererProps extends SharedRendererProps {\n category?: PropertyCategory;\n /** Custom value renderer */\n propertyValueRendererManager?: PropertyValueRendererManager;\n /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n /** Indicates property is being edited */\n isEditing?: boolean;\n /** Called when property edit is committed. */\n onEditCommit?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => void;\n /** Called when property edit is cancelled. */\n onEditCancel?: () => void;\n /** Whether property value is displayed in expanded state. */\n isExpanded: boolean;\n /** Called when toggling between expanded and collapsed property value display state. */\n onExpansionToggled: () => void;\n /** Reports property height changes. */\n onHeightChanged?: (newHeight: number) => void;\n\n highlight?: HighlightingComponentProps & {\n applyOnLabel: boolean;\n applyOnValue: boolean;\n };\n\n children?: never;\n}\n\n/** A React component that renders flat properties\n * @internal\n */\nexport const FlatPropertyRenderer: React.FC<FlatPropertyRendererProps> = (\n props\n) => {\n const {\n category,\n propertyValueRendererManager,\n isEditing,\n onEditCommit,\n onEditCancel,\n onHeightChanged,\n highlight,\n ...passthroughProps\n } = props;\n\n const valueElementRenderer = () => (\n <DisplayValue\n propertyRecord={passthroughProps.propertyRecord}\n orientation={passthroughProps.orientation}\n columnRatio={passthroughProps.columnRatio}\n width={passthroughProps.width}\n category={category}\n propertyValueRendererManager={propertyValueRendererManager}\n isEditing={isEditing}\n onEditCommit={onEditCommit}\n onEditCancel={onEditCancel}\n isExpanded={passthroughProps.isExpanded}\n onExpansionToggled={passthroughProps.onExpansionToggled}\n onHeightChanged={onHeightChanged}\n highlight={highlight}\n indentation={props.indentation}\n />\n );\n\n const primitiveRendererProps: PrimitiveRendererProps = {\n ...passthroughProps,\n valueElementRenderer,\n indentation: props.indentation,\n };\n\n const rendererManager =\n propertyValueRendererManager ?? PropertyValueRendererManager.defaultManager;\n const hasCustomRenderer = rendererManager.hasCustomRenderer(\n passthroughProps.propertyRecord\n );\n\n switch (props.propertyRecord.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return (\n <CustomizablePropertyRenderer\n highlight={highlight?.applyOnLabel ? highlight : undefined}\n {...primitiveRendererProps}\n />\n );\n\n case PropertyValueFormat.Array:\n // If array is empty or has a custom renderer registered, render it as a customizable property\n if (props.propertyRecord.value.items.length === 0 || hasCustomRenderer)\n return (\n <CustomizablePropertyRenderer\n highlight={highlight?.applyOnLabel ? highlight : undefined}\n {...primitiveRendererProps}\n />\n );\n\n // eslint-disable-next-line no-fallthrough\n case PropertyValueFormat.Struct:\n // If a custom renderer is registered for the struct property, render it as a customizable property\n if (hasCustomRenderer) {\n return (\n <CustomizablePropertyRenderer\n highlight={highlight?.applyOnLabel ? highlight : undefined}\n {...primitiveRendererProps}\n />\n );\n }\n\n return (\n <FlatNonPrimitivePropertyRenderer\n {...primitiveRendererProps}\n isExpanded={props.isExpanded}\n onExpandToggled={props.onExpansionToggled}\n valueElement={undefined}\n valueElementRenderer={undefined}\n />\n );\n }\n};\n\ninterface DisplayValueProps {\n isEditing?: boolean;\n propertyRecord: PropertyRecord;\n\n orientation: Orientation;\n columnRatio?: number;\n /** Pass width to rerender component as property grid width changes */\n width?: number;\n indentation?: number;\n propertyValueRendererManager?: PropertyValueRendererManager;\n isExpanded?: boolean;\n onExpansionToggled?: () => void;\n onHeightChanged?: (newHeight: number) => void;\n\n category?: PropertyCategory;\n onEditCancel?: () => void;\n onEditCommit?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => void;\n\n highlight?: HighlightingComponentProps & {\n applyOnLabel: boolean;\n applyOnValue: boolean;\n };\n}\n\nconst DisplayValue: React.FC<DisplayValueProps> = (props) => {\n useResetHeightOnEdit(\n props.orientation,\n props.isEditing,\n props.onHeightChanged\n );\n\n if (props.isEditing) {\n const _onEditCommit = (args: PropertyUpdatedArgs) => {\n /* istanbul ignore else */\n if (props.category) props.onEditCommit?.(args, props.category);\n };\n\n return (\n <EditorContainer\n propertyRecord={props.propertyRecord}\n onCommit={_onEditCommit}\n onCancel={props.onEditCancel ?? /* istanbul ignore next */ (() => {})}\n setFocus={true}\n />\n );\n }\n\n return (\n <>\n {CommonPropertyRenderer.createNewDisplayValue(\n props.orientation,\n props.propertyRecord,\n props.indentation,\n props.propertyValueRendererManager,\n props.isExpanded,\n props.onExpansionToggled,\n props.onHeightChanged,\n props.highlight\n )}\n </>\n );\n};\n\nfunction useResetHeightOnEdit(\n orientation: Orientation,\n isEditing?: boolean,\n onHeightChanged?: (newHeight: number) => void\n) {\n const previousEditingStatusRef = React.useRef(isEditing);\n React.useEffect(() => {\n if (!previousEditingStatusRef.current && isEditing) {\n onHeightChanged?.(orientation === Orientation.Vertical ? 48 : 28);\n }\n\n previousEditingStatusRef.current = isEditing;\n });\n}\n"]}
1
+ {"version":3,"file":"FlatPropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAG9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAExF,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAmC1G;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CACvE,KAAK,EACL,EAAE;IACF,MAAM,EACJ,QAAQ,EACR,4BAA4B,EAC5B,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,SAAS,EACT,GAAG,gBAAgB,EACpB,GAAG,KAAK,CAAC;IAEV,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CACjC,oBAAC,YAAY,IACX,cAAc,EAAE,gBAAgB,CAAC,cAAc,EAC/C,WAAW,EAAE,gBAAgB,CAAC,WAAW,EACzC,WAAW,EAAE,gBAAgB,CAAC,WAAW,EACzC,KAAK,EAAE,gBAAgB,CAAC,KAAK,EAC7B,QAAQ,EAAE,QAAQ,EAClB,4BAA4B,EAAE,4BAA4B,EAC1D,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,gBAAgB,CAAC,UAAU,EACvC,kBAAkB,EAAE,gBAAgB,CAAC,k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AC,GAAG,EAAE;QACnB,IAAI,CAAC,wBAAwB,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YACnD,eAAe,EAAE,CAAC,WAAW,KAAK,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,wBAAwB,CAAC,OAAO,GAAG,SAAS,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type { HighlightingComponentProps } from \"../../../common/HighlightingComponentProps\";\nimport type { PropertyUpdatedArgs } from \"../../../editors/EditorContainer\";\nimport { EditorContainer } from \"../../../editors/EditorContainer\";\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\nimport type { PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\nimport type { SharedRendererProps } from \"../../../properties/renderers/PropertyRenderer\";\nimport { PropertyValueRendererManager } from \"../../../properties/ValueRendererManager\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FlatNonPrimitivePropertyRenderer } from \"./FlatNonPrimitivePropertyRenderer\";\nimport { CustomizablePropertyRenderer } from \"../../../properties/renderers/CustomizablePropertyRenderer\";\n\n/** Properties of [[FlatPropertyRenderer]] React component\n * @internal\n */\nexport interface FlatPropertyRendererProps extends SharedRendererProps {\n category?: PropertyCategory;\n /** Custom value renderer */\n propertyValueRendererManager?: PropertyValueRendererManager;\n /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n /** Indicates property is being edited */\n isEditing?: boolean;\n /** Called when property edit is committed. */\n onEditCommit?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => void;\n /** Called when property edit is cancelled. */\n onEditCancel?: () => void;\n /** Whether property value is displayed in expanded state. */\n isExpanded: boolean;\n /** Called when toggling between expanded and collapsed property value display state. */\n onExpansionToggled: () => void;\n /** Reports property height changes. */\n onHeightChanged?: (newHeight: number) => void;\n\n highlight?: HighlightingComponentProps & {\n applyOnLabel: boolean;\n applyOnValue: boolean;\n };\n\n children?: never;\n}\n\n/** A React component that renders flat properties\n * @internal\n */\nexport const FlatPropertyRenderer: React.FC<FlatPropertyRendererProps> = (\n props\n) => {\n const {\n category,\n propertyValueRendererManager,\n isEditing,\n onEditCommit,\n onEditCancel,\n onHeightChanged,\n highlight,\n ...passthroughProps\n } = props;\n\n const valueElementRenderer = () => (\n <DisplayValue\n propertyRecord={passthroughProps.propertyRecord}\n orientation={passthroughProps.orientation}\n columnRatio={passthroughProps.columnRatio}\n width={passthroughProps.width}\n category={category}\n propertyValueRendererManager={propertyValueRendererManager}\n isEditing={isEditing}\n onEditCommit={onEditCommit}\n onEditCancel={onEditCancel}\n isExpanded={passthroughProps.isExpanded}\n onExpansionToggled={passthroughProps.onExpansionToggled}\n onHeightChanged={onHeightChanged}\n highlight={highlight}\n indentation={props.indentation}\n />\n );\n\n const primitiveRendererProps: PrimitiveRendererProps = {\n ...passthroughProps,\n valueElementRenderer,\n indentation: props.indentation,\n };\n\n const rendererManager =\n propertyValueRendererManager ?? PropertyValueRendererManager.defaultManager;\n const hasCustomRenderer = rendererManager.hasCustomRenderer(\n passthroughProps.propertyRecord\n );\n\n switch (props.propertyRecord.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return (\n <CustomizablePropertyRenderer\n highlight={highlight?.applyOnLabel ? highlight : undefined}\n {...primitiveRendererProps}\n />\n );\n\n case PropertyValueFormat.Array:\n // If array is empty or has a custom renderer registered, render it as a customizable property\n if (props.propertyRecord.value.items.length === 0 || hasCustomRenderer)\n return (\n <CustomizablePropertyRenderer\n highlight={highlight?.applyOnLabel ? highlight : undefined}\n {...primitiveRendererProps}\n />\n );\n\n // eslint-disable-next-line no-fallthrough\n case PropertyValueFormat.Struct:\n // If a custom renderer is registered for the struct property, render it as a customizable property\n if (hasCustomRenderer) {\n return (\n <CustomizablePropertyRenderer\n highlight={highlight?.applyOnLabel ? highlight : undefined}\n {...primitiveRendererProps}\n />\n );\n }\n\n return (\n <FlatNonPrimitivePropertyRenderer\n {...primitiveRendererProps}\n isExpanded={props.isExpanded}\n onExpandToggled={props.onExpansionToggled}\n valueElement={undefined}\n valueElementRenderer={undefined}\n />\n );\n }\n};\n\ninterface DisplayValueProps {\n isEditing?: boolean;\n propertyRecord: PropertyRecord;\n\n orientation: Orientation;\n columnRatio?: number;\n /** Pass width to rerender component as property grid width changes */\n width?: number;\n indentation?: number;\n propertyValueRendererManager?: PropertyValueRendererManager;\n isExpanded?: boolean;\n onExpansionToggled?: () => void;\n onHeightChanged?: (newHeight: number) => void;\n\n category?: PropertyCategory;\n onEditCancel?: () => void;\n onEditCommit?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => void;\n\n highlight?: HighlightingComponentProps & {\n applyOnLabel: boolean;\n applyOnValue: boolean;\n };\n}\n\nconst DisplayValue: React.FC<DisplayValueProps> = (props) => {\n useResetHeightOnEdit(\n props.orientation,\n props.isEditing,\n props.onHeightChanged\n );\n\n if (props.isEditing) {\n const _onEditCommit = (args: PropertyUpdatedArgs) => {\n /* istanbul ignore else */\n if (props.category) props.onEditCommit?.(args, props.category);\n };\n\n return (\n <EditorContainer\n propertyRecord={props.propertyRecord}\n onCommit={_onEditCommit}\n onCancel={props.onEditCancel ?? /* istanbul ignore next */ (() => {})}\n setFocus={true}\n />\n );\n }\n\n return (\n <>\n {CommonPropertyRenderer.createNewDisplayValue(\n props.orientation,\n props.propertyRecord,\n props.indentation,\n props.propertyValueRendererManager,\n props.isExpanded,\n props.onExpansionToggled,\n props.onHeightChanged,\n props.highlight\n )}\n </>\n );\n};\n\nfunction useResetHeightOnEdit(\n orientation: Orientation,\n isEditing?: boolean,\n onHeightChanged?: (newHeight: number) => void\n) {\n const previousEditingStatusRef = React.useRef(isEditing);\n React.useEffect(() => {\n if (!previousEditingStatusRef.current && isEditing) {\n onHeightChanged?.(orientation === Orientation.Vertical ? 48 : 28);\n }\n\n previousEditingStatusRef.current = isEditing;\n });\n}\n"]}
@@ -72,7 +72,7 @@ export var ToolbarOpacitySetting;
72
72
  /** Helpers for [[ToolbarPanelAlignment]].
73
73
  * @internal
74
74
  */
75
- class ToolbarPanelAlignmentHelpers {
75
+ export class ToolbarPanelAlignmentHelpers {
76
76
  /** @returns Class name of specified [[ToolbarPanelAlignment]] */
77
77
  static getCssClassName(panelAlignment) {
78
78
  switch (panelAlignment) {
@@ -87,7 +87,6 @@ class ToolbarPanelAlignmentHelpers {
87
87
  ToolbarPanelAlignmentHelpers.START_CLASS_NAME = "components-panel-alignment-start";
88
88
  /** Class name of [[ToolbarPanelAlignment.End]] */
89
89
  ToolbarPanelAlignmentHelpers.END_CLASS_NAME = "components-panel-alignment-end";
90
- export { ToolbarPanelAlignmentHelpers };
91
90
  /**
92
91
  * Context used by Toolbar component to provide Direction to child components.
93
92
  * @internal