@itwin/components-react 3.0.0-dev.82 → 3.0.0-dev.86

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 (528) hide show
  1. package/CHANGELOG.md +1362 -1362
  2. package/README.md +11 -11
  3. package/lib/cjs/components-react/UiComponents.js.map +1 -1
  4. package/lib/cjs/components-react/_target.scss +9 -9
  5. package/lib/cjs/components-react/breadcrumb/BeInspireTree.js.map +1 -1
  6. package/lib/cjs/components-react/breadcrumb/Breadcrumb.js.map +1 -1
  7. package/lib/cjs/components-react/breadcrumb/Breadcrumb.scss +196 -196
  8. package/lib/cjs/components-react/breadcrumb/BreadcrumbDetails.js.map +1 -1
  9. package/lib/cjs/components-react/breadcrumb/BreadcrumbPath.js.map +1 -1
  10. package/lib/cjs/components-react/breadcrumb/BreadcrumbTreeUtils.js.map +1 -1
  11. package/lib/cjs/components-react/common/DateUtils.js.map +1 -1
  12. package/lib/cjs/components-react/common/DelayedSpinner.js.map +1 -1
  13. package/lib/cjs/components-react/common/HighlightedText.js.map +1 -1
  14. package/lib/cjs/components-react/common/HighlightingComponentProps.js.map +1 -1
  15. package/lib/cjs/components-react/common/IImageLoader.js.map +1 -1
  16. package/lib/cjs/components-react/common/ImageRenderer.js.map +1 -1
  17. package/lib/cjs/components-react/common/Links.js.map +1 -1
  18. package/lib/cjs/components-react/common/PageOptions.js.map +1 -1
  19. package/lib/cjs/components-react/common/SubscriptionScheduler.js.map +1 -1
  20. package/lib/cjs/components-react/common/UseAsyncValue.js.map +1 -1
  21. package/lib/cjs/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
  22. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  23. package/lib/cjs/components-react/common/UseRerender.js.map +1 -1
  24. package/lib/cjs/components-react/common/countMatchesInString.js.map +1 -1
  25. package/lib/cjs/components-react/common/selection/SelectionHandler.js.map +1 -1
  26. package/lib/cjs/components-react/common/selection/SelectionModes.js.map +1 -1
  27. package/lib/cjs/components-react/common/showhide/ShowHideDialog.js.map +1 -1
  28. package/lib/cjs/components-react/common/showhide/ShowHideItem.js.map +1 -1
  29. package/lib/cjs/components-react/common/showhide/ShowHideMenu.js.map +1 -1
  30. package/lib/cjs/components-react/converters/BooleanTypeConverter.js.map +1 -1
  31. package/lib/cjs/components-react/converters/CompositeTypeConverter.js.map +1 -1
  32. package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
  33. package/lib/cjs/components-react/converters/EnumTypeConverter.js.map +1 -1
  34. package/lib/cjs/components-react/converters/HexadecimalTypeConverter.js.map +1 -1
  35. package/lib/cjs/components-react/converters/NavigationPropertyTypeConverter.js.map +1 -1
  36. package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
  37. package/lib/cjs/components-react/converters/PointTypeConverter.js.map +1 -1
  38. package/lib/cjs/components-react/converters/StringTypeConverter.js.map +1 -1
  39. package/lib/cjs/components-react/converters/TypeConverter.js.map +1 -1
  40. package/lib/cjs/components-react/converters/TypeConverterManager.js.map +1 -1
  41. package/lib/cjs/components-react/converters/valuetypes/ConvertedTypes.js.map +1 -1
  42. package/lib/cjs/components-react/datepicker/DateField.js.map +1 -1
  43. package/lib/cjs/components-react/datepicker/DateField.scss +22 -22
  44. package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
  45. package/lib/cjs/components-react/datepicker/DatePicker.scss +170 -170
  46. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
  47. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.scss +57 -57
  48. package/lib/cjs/components-react/datepicker/IntlFormatter.js.map +1 -1
  49. package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
  50. package/lib/cjs/components-react/datepicker/TimeField.scss +73 -73
  51. package/lib/cjs/components-react/editors/BooleanEditor.js.map +1 -1
  52. package/lib/cjs/components-react/editors/BooleanEditor.scss +24 -24
  53. package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
  54. package/lib/cjs/components-react/editors/CustomNumberEditor.scss +21 -21
  55. package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
  56. package/lib/cjs/components-react/editors/DateTimeEditor.scss +9 -9
  57. package/lib/cjs/components-react/editors/EditorContainer.js.map +1 -1
  58. package/lib/cjs/components-react/editors/EditorContainer.scss +6 -6
  59. package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
  60. package/lib/cjs/components-react/editors/EnumButtonGroupEditor.scss +182 -182
  61. package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
  62. package/lib/cjs/components-react/editors/EnumEditor.scss +22 -22
  63. package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
  64. package/lib/cjs/components-react/editors/IconEditor.scss +16 -16
  65. package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
  66. package/lib/cjs/components-react/editors/ImageCheckBoxEditor.scss +23 -23
  67. package/lib/cjs/components-react/editors/NumericInputEditor.js.map +1 -1
  68. package/lib/cjs/components-react/editors/NumericInputEditor.scss +17 -17
  69. package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
  70. package/lib/cjs/components-react/editors/PopupButton.scss +119 -119
  71. package/lib/cjs/components-react/editors/PropertyEditorManager.js.map +1 -1
  72. package/lib/cjs/components-react/editors/SliderEditor.js.map +1 -1
  73. package/lib/cjs/components-react/editors/SliderEditor.scss +13 -13
  74. package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
  75. package/lib/cjs/components-react/editors/TextEditor.scss +21 -21
  76. package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
  77. package/lib/cjs/components-react/editors/TextareaEditor.scss +14 -14
  78. package/lib/cjs/components-react/editors/ThemedEnumEditor.js.map +1 -1
  79. package/lib/cjs/components-react/editors/ThemedEnumEditor.scss +82 -82
  80. package/lib/cjs/components-react/editors/ToggleEditor.js.map +1 -1
  81. package/lib/cjs/components-react/editors/ToggleEditor.scss +25 -25
  82. package/lib/cjs/components-react/editors/variables.scss +6 -6
  83. package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
  84. package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
  85. package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
  86. package/lib/cjs/components-react/filtering/FilteringInput.scss +68 -68
  87. package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
  88. package/lib/cjs/components-react/filtering/ResultSelector.scss +72 -72
  89. package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
  90. package/lib/cjs/components-react/iconpicker/IconPickerButton.scss +74 -74
  91. package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
  92. package/lib/cjs/components-react/inputs/ParsedInput.scss +23 -23
  93. package/lib/cjs/components-react/properties/ItemStyle.js.map +1 -1
  94. package/lib/cjs/components-react/properties/LinkHandler.js.map +1 -1
  95. package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
  96. package/lib/cjs/components-react/properties/renderers/ActionButtonList.js.map +1 -1
  97. package/lib/cjs/components-react/properties/renderers/ActionButtonList.scss +25 -25
  98. package/lib/cjs/components-react/properties/renderers/ActionButtonRenderer.js.map +1 -1
  99. package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  100. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
  101. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.scss +16 -16
  102. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  103. package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
  104. package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
  105. package/lib/cjs/components-react/properties/renderers/PropertyView.js.map +1 -1
  106. package/lib/cjs/components-react/properties/renderers/PropertyView.scss +106 -106
  107. package/lib/cjs/components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer.js.map +1 -1
  108. package/lib/cjs/components-react/properties/renderers/label/PrimitivePropertyLabelRenderer.js.map +1 -1
  109. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  110. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.scss +87 -87
  111. package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
  112. package/lib/cjs/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map +1 -1
  113. package/lib/cjs/components-react/properties/renderers/value/MergedPropertyValueRenderer.js.map +1 -1
  114. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
  115. package/lib/cjs/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map +1 -1
  116. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  117. package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
  118. package/lib/cjs/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
  119. package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.js.map +1 -1
  120. package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.js.map +1 -1
  121. package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js.map +1 -1
  122. package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.scss +10 -10
  123. package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
  124. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  125. package/lib/cjs/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
  126. package/lib/cjs/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
  127. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  128. package/lib/cjs/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
  129. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  130. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
  131. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.scss +75 -75
  132. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  133. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
  134. package/lib/cjs/components-react/propertygrid/component/PropertyList.js.map +1 -1
  135. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  136. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +94 -94
  137. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  138. package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  139. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  140. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  141. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
  142. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
  143. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
  144. package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
  145. package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
  146. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
  147. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
  148. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
  149. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
  150. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
  151. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
  152. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
  153. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
  154. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  155. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  156. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  157. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
  158. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  159. package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
  160. package/lib/cjs/components-react/selectable-content/SelectableContent.scss +19 -19
  161. package/lib/cjs/components-react/table/SimpleTableDataProvider.js.map +1 -1
  162. package/lib/cjs/components-react/table/TableDataProvider.js.map +1 -1
  163. package/lib/cjs/components-react/table/columnfiltering/ColumnFiltering.js.map +1 -1
  164. package/lib/cjs/components-react/table/columnfiltering/ColumnFiltering.scss +78 -78
  165. package/lib/cjs/components-react/table/columnfiltering/ColumnFilteringUtilities.js.map +1 -1
  166. package/lib/cjs/components-react/table/columnfiltering/DataGridFilterParser.d.ts.map +1 -1
  167. package/lib/cjs/components-react/table/columnfiltering/DataGridFilterParser.js +1 -0
  168. package/lib/cjs/components-react/table/columnfiltering/DataGridFilterParser.js.map +1 -1
  169. package/lib/cjs/components-react/table/columnfiltering/FilterableColumnBase.js.map +1 -1
  170. package/lib/cjs/components-react/table/columnfiltering/TableColumnFilterDescriptor.js.map +1 -1
  171. package/lib/cjs/components-react/table/columnfiltering/TableFilterDescriptor.js.map +1 -1
  172. package/lib/cjs/components-react/table/columnfiltering/TableFilterDescriptorCollection.js.map +1 -1
  173. package/lib/cjs/components-react/table/columnfiltering/data-grid-addons/AutoCompleteFilter.js.map +1 -1
  174. package/lib/cjs/components-react/table/columnfiltering/data-grid-addons/MultiSelectFilter.js.map +1 -1
  175. package/lib/cjs/components-react/table/columnfiltering/data-grid-addons/NumericFilter.d.ts.map +1 -1
  176. package/lib/cjs/components-react/table/columnfiltering/data-grid-addons/NumericFilter.js +1 -0
  177. package/lib/cjs/components-react/table/columnfiltering/data-grid-addons/NumericFilter.js.map +1 -1
  178. package/lib/cjs/components-react/table/columnfiltering/data-grid-addons/SingleSelectFilter.js.map +1 -1
  179. package/lib/cjs/components-react/table/columnfiltering/multi-value-filter/MultiValueFilter.d.ts.map +1 -1
  180. package/lib/cjs/components-react/table/columnfiltering/multi-value-filter/MultiValueFilter.js +1 -0
  181. package/lib/cjs/components-react/table/columnfiltering/multi-value-filter/MultiValueFilter.js.map +1 -1
  182. package/lib/cjs/components-react/table/columnfiltering/multi-value-filter/MultiValueFilter.scss +35 -35
  183. package/lib/cjs/components-react/table/component/ColumnDragLayer.js.map +1 -1
  184. package/lib/cjs/components-react/table/component/DragDropHeaderCell.js.map +1 -1
  185. package/lib/cjs/components-react/table/component/Table.d.ts +8 -8
  186. package/lib/cjs/components-react/table/component/Table.d.ts.map +1 -1
  187. package/lib/cjs/components-react/table/component/Table.js +3 -2
  188. package/lib/cjs/components-react/table/component/Table.js.map +1 -1
  189. package/lib/cjs/components-react/table/component/Table.scss +200 -200
  190. package/lib/cjs/components-react/table/component/TableCell.d.ts +5 -5
  191. package/lib/cjs/components-react/table/component/TableCell.d.ts.map +1 -1
  192. package/lib/cjs/components-react/table/component/TableCell.js +3 -2
  193. package/lib/cjs/components-react/table/component/TableCell.js.map +1 -1
  194. package/lib/cjs/components-react/table/component/TableCell.scss +48 -48
  195. package/lib/cjs/components-react/table/component/TableColumn.d.ts +1 -1
  196. package/lib/cjs/components-react/table/component/TableColumn.d.ts.map +1 -1
  197. package/lib/cjs/components-react/table/component/TableColumn.js +1 -0
  198. package/lib/cjs/components-react/table/component/TableColumn.js.map +1 -1
  199. package/lib/cjs/components-react/table/component/dragdrop/BeDragDropContext.js.map +1 -1
  200. package/lib/cjs/components-react/table/component/dragdrop/DragDropDef.js.map +1 -1
  201. package/lib/cjs/components-react/table/component/dragdrop/withDragSource.js.map +1 -1
  202. package/lib/cjs/components-react/table/component/dragdrop/withDropTarget.js.map +1 -1
  203. package/lib/cjs/components-react/toolbar/Item.js.map +1 -1
  204. package/lib/cjs/components-react/toolbar/Item.scss +122 -122
  205. package/lib/cjs/components-react/toolbar/ItemWrapper.js.map +1 -1
  206. package/lib/cjs/components-react/toolbar/ItemWrapper.scss +10 -10
  207. package/lib/cjs/components-react/toolbar/Items.js.map +1 -1
  208. package/lib/cjs/components-react/toolbar/Items.scss +94 -94
  209. package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
  210. package/lib/cjs/components-react/toolbar/Overflow.scss +48 -48
  211. package/lib/cjs/components-react/toolbar/OverflowPanel.js.map +1 -1
  212. package/lib/cjs/components-react/toolbar/OverflowPanel.scss +37 -37
  213. package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
  214. package/lib/cjs/components-react/toolbar/PopupItem.scss +75 -75
  215. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  216. package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
  217. package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
  218. package/lib/cjs/components-react/toolbar/Toolbar.scss +18 -18
  219. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  220. package/lib/cjs/components-react/toolbar/_variables.scss +34 -34
  221. package/lib/cjs/components-react/toolbar/groupPanel/BackArrow.js.map +1 -1
  222. package/lib/cjs/components-react/toolbar/groupPanel/BackArrow.scss +44 -44
  223. package/lib/cjs/components-react/toolbar/groupPanel/Column.js.map +1 -1
  224. package/lib/cjs/components-react/toolbar/groupPanel/Column.scss +9 -9
  225. package/lib/cjs/components-react/toolbar/groupPanel/Columns.js.map +1 -1
  226. package/lib/cjs/components-react/toolbar/groupPanel/Columns.scss +10 -10
  227. package/lib/cjs/components-react/toolbar/groupPanel/Panel.js.map +1 -1
  228. package/lib/cjs/components-react/toolbar/groupPanel/Panel.scss +17 -17
  229. package/lib/cjs/components-react/toolbar/groupPanel/Title.js.map +1 -1
  230. package/lib/cjs/components-react/toolbar/groupPanel/Title.scss +34 -34
  231. package/lib/cjs/components-react/toolbar/groupPanel/_variables.scss +16 -16
  232. package/lib/cjs/components-react/toolbar/groupPanel/tool/Expander.js.map +1 -1
  233. package/lib/cjs/components-react/toolbar/groupPanel/tool/Expander.scss +29 -29
  234. package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
  235. package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.scss +146 -146
  236. package/lib/cjs/components-react/toolbar/groupPanel/tool/_variables.scss +12 -12
  237. package/lib/cjs/components-react/toolbar/useDragInteraction.js.map +1 -1
  238. package/lib/cjs/components-react/toolbar/utilities/Direction.js.map +1 -1
  239. package/lib/cjs/components-react/tree/HighlightingEngine.js.map +1 -1
  240. package/lib/cjs/components-react/tree/HighlightingEngine.scss +7 -7
  241. package/lib/cjs/components-react/tree/ImageLoader.js.map +1 -1
  242. package/lib/cjs/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
  243. package/lib/cjs/components-react/tree/TreeComponentTestId.js.map +1 -1
  244. package/lib/cjs/components-react/tree/TreeDataProvider.js.map +1 -1
  245. package/lib/cjs/components-react/tree/controlled/Observable.js.map +1 -1
  246. package/lib/cjs/components-react/tree/controlled/TreeActions.js.map +1 -1
  247. package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
  248. package/lib/cjs/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
  249. package/lib/cjs/components-react/tree/controlled/TreeEvents.js.map +1 -1
  250. package/lib/cjs/components-react/tree/controlled/TreeHooks.js.map +1 -1
  251. package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
  252. package/lib/cjs/components-react/tree/controlled/TreeModelSource.js.map +1 -1
  253. package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  254. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  255. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.scss +102 -102
  256. package/lib/cjs/components-react/tree/controlled/component/NodeContent.js.map +1 -1
  257. package/lib/cjs/components-react/tree/controlled/component/NodeContent.scss +28 -28
  258. package/lib/cjs/components-react/tree/controlled/component/TreeNodeEditor.js.map +1 -1
  259. package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
  260. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  261. package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  262. package/lib/cjs/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
  263. package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  264. package/lib/cjs/components-react.js.map +1 -1
  265. package/lib/esm/components-react/UiComponents.js.map +1 -1
  266. package/lib/esm/components-react/_target.scss +9 -9
  267. package/lib/esm/components-react/breadcrumb/BeInspireTree.js.map +1 -1
  268. package/lib/esm/components-react/breadcrumb/Breadcrumb.js.map +1 -1
  269. package/lib/esm/components-react/breadcrumb/Breadcrumb.scss +196 -196
  270. package/lib/esm/components-react/breadcrumb/BreadcrumbDetails.js.map +1 -1
  271. package/lib/esm/components-react/breadcrumb/BreadcrumbPath.js.map +1 -1
  272. package/lib/esm/components-react/breadcrumb/BreadcrumbTreeUtils.js.map +1 -1
  273. package/lib/esm/components-react/common/DateUtils.js.map +1 -1
  274. package/lib/esm/components-react/common/DelayedSpinner.js.map +1 -1
  275. package/lib/esm/components-react/common/HighlightedText.js.map +1 -1
  276. package/lib/esm/components-react/common/HighlightingComponentProps.js.map +1 -1
  277. package/lib/esm/components-react/common/IImageLoader.js.map +1 -1
  278. package/lib/esm/components-react/common/ImageRenderer.js.map +1 -1
  279. package/lib/esm/components-react/common/Links.js.map +1 -1
  280. package/lib/esm/components-react/common/PageOptions.js.map +1 -1
  281. package/lib/esm/components-react/common/SubscriptionScheduler.js.map +1 -1
  282. package/lib/esm/components-react/common/UseAsyncValue.js.map +1 -1
  283. package/lib/esm/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
  284. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  285. package/lib/esm/components-react/common/UseRerender.js.map +1 -1
  286. package/lib/esm/components-react/common/countMatchesInString.js.map +1 -1
  287. package/lib/esm/components-react/common/selection/SelectionHandler.js.map +1 -1
  288. package/lib/esm/components-react/common/selection/SelectionModes.js.map +1 -1
  289. package/lib/esm/components-react/common/showhide/ShowHideDialog.js.map +1 -1
  290. package/lib/esm/components-react/common/showhide/ShowHideItem.js.map +1 -1
  291. package/lib/esm/components-react/common/showhide/ShowHideMenu.js.map +1 -1
  292. package/lib/esm/components-react/converters/BooleanTypeConverter.js.map +1 -1
  293. package/lib/esm/components-react/converters/CompositeTypeConverter.js.map +1 -1
  294. package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
  295. package/lib/esm/components-react/converters/EnumTypeConverter.js.map +1 -1
  296. package/lib/esm/components-react/converters/HexadecimalTypeConverter.js.map +1 -1
  297. package/lib/esm/components-react/converters/NavigationPropertyTypeConverter.js.map +1 -1
  298. package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
  299. package/lib/esm/components-react/converters/PointTypeConverter.js.map +1 -1
  300. package/lib/esm/components-react/converters/StringTypeConverter.js.map +1 -1
  301. package/lib/esm/components-react/converters/TypeConverter.js.map +1 -1
  302. package/lib/esm/components-react/converters/TypeConverterManager.js.map +1 -1
  303. package/lib/esm/components-react/converters/valuetypes/ConvertedTypes.js.map +1 -1
  304. package/lib/esm/components-react/datepicker/DateField.js.map +1 -1
  305. package/lib/esm/components-react/datepicker/DateField.scss +22 -22
  306. package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
  307. package/lib/esm/components-react/datepicker/DatePicker.scss +170 -170
  308. package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
  309. package/lib/esm/components-react/datepicker/DatePickerPopupButton.scss +57 -57
  310. package/lib/esm/components-react/datepicker/IntlFormatter.js.map +1 -1
  311. package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
  312. package/lib/esm/components-react/datepicker/TimeField.scss +73 -73
  313. package/lib/esm/components-react/editors/BooleanEditor.js.map +1 -1
  314. package/lib/esm/components-react/editors/BooleanEditor.scss +24 -24
  315. package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
  316. package/lib/esm/components-react/editors/CustomNumberEditor.scss +21 -21
  317. package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
  318. package/lib/esm/components-react/editors/DateTimeEditor.scss +9 -9
  319. package/lib/esm/components-react/editors/EditorContainer.js.map +1 -1
  320. package/lib/esm/components-react/editors/EditorContainer.scss +6 -6
  321. package/lib/esm/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
  322. package/lib/esm/components-react/editors/EnumButtonGroupEditor.scss +182 -182
  323. package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
  324. package/lib/esm/components-react/editors/EnumEditor.scss +22 -22
  325. package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
  326. package/lib/esm/components-react/editors/IconEditor.scss +16 -16
  327. package/lib/esm/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
  328. package/lib/esm/components-react/editors/ImageCheckBoxEditor.scss +23 -23
  329. package/lib/esm/components-react/editors/NumericInputEditor.js.map +1 -1
  330. package/lib/esm/components-react/editors/NumericInputEditor.scss +17 -17
  331. package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
  332. package/lib/esm/components-react/editors/PopupButton.scss +119 -119
  333. package/lib/esm/components-react/editors/PropertyEditorManager.js.map +1 -1
  334. package/lib/esm/components-react/editors/SliderEditor.js.map +1 -1
  335. package/lib/esm/components-react/editors/SliderEditor.scss +13 -13
  336. package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
  337. package/lib/esm/components-react/editors/TextEditor.scss +21 -21
  338. package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
  339. package/lib/esm/components-react/editors/TextareaEditor.scss +14 -14
  340. package/lib/esm/components-react/editors/ThemedEnumEditor.js.map +1 -1
  341. package/lib/esm/components-react/editors/ThemedEnumEditor.scss +82 -82
  342. package/lib/esm/components-react/editors/ToggleEditor.js.map +1 -1
  343. package/lib/esm/components-react/editors/ToggleEditor.scss +25 -25
  344. package/lib/esm/components-react/editors/variables.scss +6 -6
  345. package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
  346. package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
  347. package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
  348. package/lib/esm/components-react/filtering/FilteringInput.scss +68 -68
  349. package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
  350. package/lib/esm/components-react/filtering/ResultSelector.scss +72 -72
  351. package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
  352. package/lib/esm/components-react/iconpicker/IconPickerButton.scss +74 -74
  353. package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
  354. package/lib/esm/components-react/inputs/ParsedInput.scss +23 -23
  355. package/lib/esm/components-react/properties/ItemStyle.js.map +1 -1
  356. package/lib/esm/components-react/properties/LinkHandler.js.map +1 -1
  357. package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
  358. package/lib/esm/components-react/properties/renderers/ActionButtonList.js.map +1 -1
  359. package/lib/esm/components-react/properties/renderers/ActionButtonList.scss +25 -25
  360. package/lib/esm/components-react/properties/renderers/ActionButtonRenderer.js.map +1 -1
  361. package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  362. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
  363. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.scss +16 -16
  364. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  365. package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
  366. package/lib/esm/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
  367. package/lib/esm/components-react/properties/renderers/PropertyView.js.map +1 -1
  368. package/lib/esm/components-react/properties/renderers/PropertyView.scss +106 -106
  369. package/lib/esm/components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer.js.map +1 -1
  370. package/lib/esm/components-react/properties/renderers/label/PrimitivePropertyLabelRenderer.js.map +1 -1
  371. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  372. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.scss +87 -87
  373. package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
  374. package/lib/esm/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map +1 -1
  375. package/lib/esm/components-react/properties/renderers/value/MergedPropertyValueRenderer.js.map +1 -1
  376. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
  377. package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map +1 -1
  378. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  379. package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
  380. package/lib/esm/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
  381. package/lib/esm/components-react/properties/renderers/value/WithContextStyle.js.map +1 -1
  382. package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.js.map +1 -1
  383. package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js.map +1 -1
  384. package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.scss +10 -10
  385. package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
  386. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  387. package/lib/esm/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
  388. package/lib/esm/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
  389. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  390. package/lib/esm/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
  391. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  392. package/lib/esm/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
  393. package/lib/esm/components-react/propertygrid/component/PropertyGrid.scss +75 -75
  394. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  395. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
  396. package/lib/esm/components-react/propertygrid/component/PropertyList.js.map +1 -1
  397. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  398. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +94 -94
  399. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  400. package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  401. package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  402. package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  403. package/lib/esm/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
  404. package/lib/esm/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
  405. package/lib/esm/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
  406. package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
  407. package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
  408. package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
  409. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
  410. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
  411. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
  412. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
  413. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
  414. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
  415. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
  416. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  417. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  418. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  419. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
  420. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  421. package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
  422. package/lib/esm/components-react/selectable-content/SelectableContent.scss +19 -19
  423. package/lib/esm/components-react/table/SimpleTableDataProvider.js.map +1 -1
  424. package/lib/esm/components-react/table/TableDataProvider.js.map +1 -1
  425. package/lib/esm/components-react/table/columnfiltering/ColumnFiltering.js.map +1 -1
  426. package/lib/esm/components-react/table/columnfiltering/ColumnFiltering.scss +78 -78
  427. package/lib/esm/components-react/table/columnfiltering/ColumnFilteringUtilities.js.map +1 -1
  428. package/lib/esm/components-react/table/columnfiltering/DataGridFilterParser.d.ts.map +1 -1
  429. package/lib/esm/components-react/table/columnfiltering/DataGridFilterParser.js +1 -0
  430. package/lib/esm/components-react/table/columnfiltering/DataGridFilterParser.js.map +1 -1
  431. package/lib/esm/components-react/table/columnfiltering/FilterableColumnBase.js.map +1 -1
  432. package/lib/esm/components-react/table/columnfiltering/TableColumnFilterDescriptor.js.map +1 -1
  433. package/lib/esm/components-react/table/columnfiltering/TableFilterDescriptor.js.map +1 -1
  434. package/lib/esm/components-react/table/columnfiltering/TableFilterDescriptorCollection.js.map +1 -1
  435. package/lib/esm/components-react/table/columnfiltering/data-grid-addons/AutoCompleteFilter.js.map +1 -1
  436. package/lib/esm/components-react/table/columnfiltering/data-grid-addons/MultiSelectFilter.js.map +1 -1
  437. package/lib/esm/components-react/table/columnfiltering/data-grid-addons/NumericFilter.d.ts.map +1 -1
  438. package/lib/esm/components-react/table/columnfiltering/data-grid-addons/NumericFilter.js +1 -0
  439. package/lib/esm/components-react/table/columnfiltering/data-grid-addons/NumericFilter.js.map +1 -1
  440. package/lib/esm/components-react/table/columnfiltering/data-grid-addons/SingleSelectFilter.js.map +1 -1
  441. package/lib/esm/components-react/table/columnfiltering/multi-value-filter/MultiValueFilter.d.ts.map +1 -1
  442. package/lib/esm/components-react/table/columnfiltering/multi-value-filter/MultiValueFilter.js +1 -0
  443. package/lib/esm/components-react/table/columnfiltering/multi-value-filter/MultiValueFilter.js.map +1 -1
  444. package/lib/esm/components-react/table/columnfiltering/multi-value-filter/MultiValueFilter.scss +35 -35
  445. package/lib/esm/components-react/table/component/ColumnDragLayer.js.map +1 -1
  446. package/lib/esm/components-react/table/component/DragDropHeaderCell.js.map +1 -1
  447. package/lib/esm/components-react/table/component/Table.d.ts +8 -8
  448. package/lib/esm/components-react/table/component/Table.d.ts.map +1 -1
  449. package/lib/esm/components-react/table/component/Table.js +3 -2
  450. package/lib/esm/components-react/table/component/Table.js.map +1 -1
  451. package/lib/esm/components-react/table/component/Table.scss +200 -200
  452. package/lib/esm/components-react/table/component/TableCell.d.ts +5 -5
  453. package/lib/esm/components-react/table/component/TableCell.d.ts.map +1 -1
  454. package/lib/esm/components-react/table/component/TableCell.js +3 -2
  455. package/lib/esm/components-react/table/component/TableCell.js.map +1 -1
  456. package/lib/esm/components-react/table/component/TableCell.scss +48 -48
  457. package/lib/esm/components-react/table/component/TableColumn.d.ts +1 -1
  458. package/lib/esm/components-react/table/component/TableColumn.d.ts.map +1 -1
  459. package/lib/esm/components-react/table/component/TableColumn.js +1 -0
  460. package/lib/esm/components-react/table/component/TableColumn.js.map +1 -1
  461. package/lib/esm/components-react/table/component/dragdrop/BeDragDropContext.js.map +1 -1
  462. package/lib/esm/components-react/table/component/dragdrop/DragDropDef.js.map +1 -1
  463. package/lib/esm/components-react/table/component/dragdrop/withDragSource.js.map +1 -1
  464. package/lib/esm/components-react/table/component/dragdrop/withDropTarget.js.map +1 -1
  465. package/lib/esm/components-react/toolbar/Item.js.map +1 -1
  466. package/lib/esm/components-react/toolbar/Item.scss +122 -122
  467. package/lib/esm/components-react/toolbar/ItemWrapper.js.map +1 -1
  468. package/lib/esm/components-react/toolbar/ItemWrapper.scss +10 -10
  469. package/lib/esm/components-react/toolbar/Items.js.map +1 -1
  470. package/lib/esm/components-react/toolbar/Items.scss +94 -94
  471. package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
  472. package/lib/esm/components-react/toolbar/Overflow.scss +48 -48
  473. package/lib/esm/components-react/toolbar/OverflowPanel.js.map +1 -1
  474. package/lib/esm/components-react/toolbar/OverflowPanel.scss +37 -37
  475. package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
  476. package/lib/esm/components-react/toolbar/PopupItem.scss +75 -75
  477. package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  478. package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
  479. package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
  480. package/lib/esm/components-react/toolbar/Toolbar.scss +18 -18
  481. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  482. package/lib/esm/components-react/toolbar/_variables.scss +34 -34
  483. package/lib/esm/components-react/toolbar/groupPanel/BackArrow.js.map +1 -1
  484. package/lib/esm/components-react/toolbar/groupPanel/BackArrow.scss +44 -44
  485. package/lib/esm/components-react/toolbar/groupPanel/Column.js.map +1 -1
  486. package/lib/esm/components-react/toolbar/groupPanel/Column.scss +9 -9
  487. package/lib/esm/components-react/toolbar/groupPanel/Columns.js.map +1 -1
  488. package/lib/esm/components-react/toolbar/groupPanel/Columns.scss +10 -10
  489. package/lib/esm/components-react/toolbar/groupPanel/Panel.js.map +1 -1
  490. package/lib/esm/components-react/toolbar/groupPanel/Panel.scss +17 -17
  491. package/lib/esm/components-react/toolbar/groupPanel/Title.js.map +1 -1
  492. package/lib/esm/components-react/toolbar/groupPanel/Title.scss +34 -34
  493. package/lib/esm/components-react/toolbar/groupPanel/_variables.scss +16 -16
  494. package/lib/esm/components-react/toolbar/groupPanel/tool/Expander.js.map +1 -1
  495. package/lib/esm/components-react/toolbar/groupPanel/tool/Expander.scss +29 -29
  496. package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
  497. package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.scss +146 -146
  498. package/lib/esm/components-react/toolbar/groupPanel/tool/_variables.scss +12 -12
  499. package/lib/esm/components-react/toolbar/useDragInteraction.js.map +1 -1
  500. package/lib/esm/components-react/toolbar/utilities/Direction.js.map +1 -1
  501. package/lib/esm/components-react/tree/HighlightingEngine.js.map +1 -1
  502. package/lib/esm/components-react/tree/HighlightingEngine.scss +7 -7
  503. package/lib/esm/components-react/tree/ImageLoader.js.map +1 -1
  504. package/lib/esm/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
  505. package/lib/esm/components-react/tree/TreeComponentTestId.js.map +1 -1
  506. package/lib/esm/components-react/tree/TreeDataProvider.js.map +1 -1
  507. package/lib/esm/components-react/tree/controlled/Observable.js.map +1 -1
  508. package/lib/esm/components-react/tree/controlled/TreeActions.js.map +1 -1
  509. package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
  510. package/lib/esm/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
  511. package/lib/esm/components-react/tree/controlled/TreeEvents.js.map +1 -1
  512. package/lib/esm/components-react/tree/controlled/TreeHooks.js.map +1 -1
  513. package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
  514. package/lib/esm/components-react/tree/controlled/TreeModelSource.js.map +1 -1
  515. package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  516. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  517. package/lib/esm/components-react/tree/controlled/component/ControlledTree.scss +102 -102
  518. package/lib/esm/components-react/tree/controlled/component/NodeContent.js.map +1 -1
  519. package/lib/esm/components-react/tree/controlled/component/NodeContent.scss +28 -28
  520. package/lib/esm/components-react/tree/controlled/component/TreeNodeEditor.js.map +1 -1
  521. package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
  522. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  523. package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  524. package/lib/esm/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
  525. package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  526. package/lib/esm/components-react.js.map +1 -1
  527. package/lib/public/locales/en/UiComponents.json +123 -123
  528. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"MutableCategorizedPrimitiveProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAM/F,OAAO,EAAE,gBAAgB,EAAmC,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtH;;;GAGG;AACH,MAAM,OAAO,mCAAoC,SAAQ,0BAA0B;IACjF,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;IACvI,CAAC;IAED,IAAW,IAAI;QACb,OAAO,gBAAgB,CAAC,SAAS,CAAC;IACpC,CAAC;IAEM,WAAW;QAChB,OAAO,EAAE,CAAC;IACZ,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 { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\n\n/**\n * Mutable wrapper object for PropertyRecord with primitive valueFormat.\n * @beta\n */\nexport class MutableCategorizedPrimitiveProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\n public constructor(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) {\n super(FlatGridItemType.Primitive, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n }\n\n public get type(): FlatGridItemType.Primitive {\n return FlatGridItemType.Primitive;\n }\n\n public getChildren(): IMutableCategorizedPropertyItem[] {\n return [];\n }\n}\n"]}
1
+ {"version":3,"file":"MutableCategorizedPrimitiveProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAM/F,OAAO,EAAE,gBAAgB,EAAmC,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEtH;;;GAGG;AACH,MAAM,OAAO,mCAAoC,SAAQ,0BAA0B;IACjF,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;IACvI,CAAC;IAED,IAAW,IAAI;QACb,OAAO,gBAAgB,CAAC,SAAS,CAAC;IACpC,CAAC;IAEM,WAAW;QAChB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\r\n\r\n/**\r\n * Mutable wrapper object for PropertyRecord with primitive valueFormat.\r\n * @beta\r\n */\r\nexport class MutableCategorizedPrimitiveProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\r\n public constructor(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(FlatGridItemType.Primitive, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n }\r\n\r\n public get type(): FlatGridItemType.Primitive {\r\n return FlatGridItemType.Primitive;\r\n }\r\n\r\n public getChildren(): IMutableCategorizedPropertyItem[] {\r\n return [];\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableCategorizedStructProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.ts"],"names":[],"mappings":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AwF;YACxF,qCAAqC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;SAClG;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjG,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 { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\nimport { 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 * @beta\n */\nexport class MutableCategorizedStructProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\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(FlatGridItemType.Struct, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\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(value, this.selectionKey, this.parentCategorySelectionKey, childrenDepth);\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 ? super.getDescendantsAndSelf() : 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) => descendants.push(...child.getVisibleDescendantsAndSelf()));\n }\n return descendants;\n }\n\n public override getVisibleDescendantsAndSelf() {\n return this._renderLabel ? super.getVisibleDescendantsAndSelf() : 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;;;+FAG+F;AAM/F,OAAO,EAAE,gBAAgB,EAAyD,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAG5I;;;GAGG;AACH,MAAM,OAAO,gCAAiC,SAAQ,0BAA0B;IAI9E,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,eAAwC,EACxC,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;QAClI,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,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;QAC7H,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,CAAC,CAAC,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IACnF,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,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;SAClG;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/**\r\n * Mutable wrapper object for PropertyRecord with struct valueFormat which provides methods for working with and managing record children hierarchies.\r\n * @beta\r\n */\r\nexport class MutableCategorizedStructProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\r\n private _renderLabel: boolean;\r\n private _children: IMutableCategorizedPropertyItem[];\r\n\r\n public constructor(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n gridItemFactory: IMutableGridItemFactory,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(FlatGridItemType.Struct, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n this._renderLabel = !record.property.hideCompositePropertyLabel;\r\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\r\n this._children = record.getChildrenRecords().map((value) => {\r\n return gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.parentCategorySelectionKey, childrenDepth);\r\n });\r\n }\r\n\r\n public get type(): FlatGridItemType.Struct {\r\n return FlatGridItemType.Struct;\r\n }\r\n\r\n public getChildren(): IMutableCategorizedPropertyItem[] {\r\n return this._children;\r\n }\r\n\r\n public override getDescendantsAndSelf() {\r\n return this._renderLabel ? super.getDescendantsAndSelf() : this.getDescendants();\r\n }\r\n\r\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n if (this.isExpanded || !this._renderLabel) {\r\n // always render children if not rendering the label, otherwise there's no way to expand\r\n // this item to make children visible\r\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\r\n }\r\n return descendants;\r\n }\r\n\r\n public override getVisibleDescendantsAndSelf() {\r\n return this._renderLabel ? super.getVisibleDescendantsAndSelf() : this.getVisibleDescendants();\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableCustomGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAAmF,2BAA2B,GAC/H,MAAM,uBAAuB,CAAC;AAI/B,gBAAgB;AAChB,MAAM,OAAO,yBAA0B,SAAQ,2BAA2B;IASxE,YACE,QAA0B,EAC1B,WAAgC,EAChC,eAAwC,EACxC,kBAAsC,EACtC,KAAa;;QAEb,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QAZvC,SAAI,GAAG,gBAAgB,CAAC,QAAiB,CAAC;QAcxD,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,kBAAkB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACxG,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAEnC,oHAAoH;QACpH,uBAAuB;QACvB,MAAM,eAAe,GAAG,MAAA,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,GAAG,CAClC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CACrG,CAAC;QAEF,IAAI,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,IAAW,eAAe;QACxB,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,UAAU;YACvB,QAAQ,EAAE,IAAI,CAAC,SAAS;SACzB,CAAC;IACJ,CAAC;IAED,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,IAAoB,wBAAwB;QAC1C,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACxC,CAAC;IAED,IAAoB,wBAAwB,CAAC,KAAa;QACxD,IAAI,CAAC,yBAAyB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,kBAAkB;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,8BAA8B;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport {\n FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem,\n} from \"./MutableFlatGridItem\";\nimport { CategoryRecordsDict } from \"./MutableGridCategory\";\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/** @internal */\nexport class MutableCustomGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\n private readonly _children: IMutableCategorizedPropertyItem[];\n private readonly _renderer: PropertyCategory[\"renderer\"];\n\n public readonly type = FlatGridItemType.Category as const;\n public readonly label: string;\n public readonly name: string;\n public readonly selectionKey: string;\n\n public constructor(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n gridItemFactory: IMutableGridItemFactory,\n parentSelectionKey: string | undefined,\n depth: number,\n ) {\n super(depth, parentSelectionKey, parentSelectionKey);\n\n this.name = category.name;\n this.label = category.label;\n this.isExpanded = category.expand;\n this.selectionKey = parentSelectionKey === undefined ? this.name : `${parentSelectionKey}_${this.name}`;\n this._renderer = category.renderer;\n\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with\n // the parent category.\n const categoryRecords = recordsDict[category.name] ?? [];\n this._children = categoryRecords.map(\n (value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0),\n );\n\n this.lastInNumberOfCategories = -1;\n }\n\n public get derivedCategory(): PropertyCategory {\n return {\n name: this.name,\n label: this.label,\n expand: this.isExpanded,\n renderer: this._renderer,\n };\n }\n\n public get isRootCategory(): boolean {\n return this.depth === 0;\n }\n\n public override get lastInNumberOfCategories(): number {\n return this._lastInNumberOfCategories;\n }\n\n public override set lastInNumberOfCategories(value: number) {\n this._lastInNumberOfCategories = value + 1;\n }\n\n public getSelf() {\n return this;\n }\n\n public getChildCategories(): IMutableGridCategoryItem[] {\n return [];\n }\n\n public getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[] {\n return [this];\n }\n\n public getChildren(): IMutableFlatGridItem[] {\n return this._children;\n }\n\n public override getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this];\n }\n}\n"]}
1
+ {"version":3,"file":"MutableCustomGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAAmF,2BAA2B,GAC/H,MAAM,uBAAuB,CAAC;AAI/B,gBAAgB;AAChB,MAAM,OAAO,yBAA0B,SAAQ,2BAA2B;IASxE,YACE,QAA0B,EAC1B,WAAgC,EAChC,eAAwC,EACxC,kBAAsC,EACtC,KAAa;;QAEb,KAAK,CAAC,KAAK,EAAE,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C,yBAAyB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,kBAAkB;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,8BAA8B;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport {\r\n FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem,\r\n} from \"./MutableFlatGridItem\";\r\nimport { CategoryRecordsDict } from \"./MutableGridCategory\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/** @internal */\r\nexport class MutableCustomGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\r\n private readonly _children: IMutableCategorizedPropertyItem[];\r\n private readonly _renderer: PropertyCategory[\"renderer\"];\r\n\r\n public readonly type = FlatGridItemType.Category as const;\r\n public readonly label: string;\r\n public readonly name: string;\r\n public readonly selectionKey: string;\r\n\r\n public constructor(\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n gridItemFactory: IMutableGridItemFactory,\r\n parentSelectionKey: string | undefined,\r\n depth: number,\r\n ) {\r\n super(depth, parentSelectionKey, parentSelectionKey);\r\n\r\n this.name = category.name;\r\n this.label = category.label;\r\n this.isExpanded = category.expand;\r\n this.selectionKey = parentSelectionKey === undefined ? this.name : `${parentSelectionKey}_${this.name}`;\r\n this._renderer = category.renderer;\r\n\r\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with\r\n // the parent category.\r\n const categoryRecords = recordsDict[category.name] ?? [];\r\n this._children = categoryRecords.map(\r\n (value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0),\r\n );\r\n\r\n this.lastInNumberOfCategories = -1;\r\n }\r\n\r\n public get derivedCategory(): PropertyCategory {\r\n return {\r\n name: this.name,\r\n label: this.label,\r\n expand: this.isExpanded,\r\n renderer: this._renderer,\r\n };\r\n }\r\n\r\n public get isRootCategory(): boolean {\r\n return this.depth === 0;\r\n }\r\n\r\n public override get lastInNumberOfCategories(): number {\r\n return this._lastInNumberOfCategories;\r\n }\r\n\r\n public override set lastInNumberOfCategories(value: number) {\r\n this._lastInNumberOfCategories = value + 1;\r\n }\r\n\r\n public getSelf() {\r\n return this;\r\n }\r\n\r\n public getChildCategories(): IMutableGridCategoryItem[] {\r\n return [];\r\n }\r\n\r\n public getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[] {\r\n return [this];\r\n }\r\n\r\n public getChildren(): IMutableFlatGridItem[] {\r\n return this._children;\r\n }\r\n\r\n public override getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this];\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableFlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAuB,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGjG;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+DAAQ,CAAA;IACR,iEAAS,CAAA;IACT,yDAAK,CAAA;IACL,2DAAM,CAAA;AACR,CAA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AM,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 { PropertyDescription, PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { 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 * @beta\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 * @beta\n */\nexport type CategorizedPropertyTypes = FlatGridItemType.Array | FlatGridItemType.Primitive | FlatGridItemType.Struct;\n\n/**\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\n * @beta\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 * @beta\n */\nexport abstract class MutableFlatPropertyGridItem implements IMutableFlatPropertyGridItem {\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(private _depth: number, private _parentSelectionKey: string | undefined, private _parentCategorySelectionKey: string | undefined) {\n if (this._depth < 0)\n 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) => descendants.push(...child.getDescendantsAndSelf()));\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) => descendants.push(...child.getVisibleDescendantsAndSelf()));\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)\n return this.getSelf();\n\n const children = this.getChildren();\n if (children.length < 1)\n 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)\n 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)\n 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)\n 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)\n 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 * @beta\n */\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\n type: FlatGridItemType.Category;\n name: string;\n derivedCategory: PropertyCategory;\n isRootCategory: boolean;\n\n getChildCategories(): IMutableGridCategoryItem[];\n getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[];\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\n * @beta\n */\nexport interface IMutableCategorizedPropertyItem 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 * @beta\n */\nexport type IMutableFlatGridItem = IMutableCategorizedPropertyItem | IMutableGridCategoryItem;\n\n/**\n * Base class for all Mutable CategorizedProperties\n * @beta\n */\nexport abstract class MutableCategorizedProperty extends MutableFlatPropertyGridItem implements Partial<IMutableCategorizedPropertyItem> {\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(`Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`);\n }\n\n const overridenProperty = this.makeOverridenProperty(record.property, overrideName, overrideDisplayLabel);\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(propertyDescription: PropertyDescription, overrideName?: string, overrideDisplay?: string): 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(record: PropertyRecord, overridenPropertyDescription: PropertyDescription) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\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;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAuB,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGjG;;;;;GAK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iB,CAAC,MAAsB,EAAE,4BAAiD;QACjG,6DAA6D;QAC7D,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { immerable } from \"immer\";\r\nimport shortid from \"shortid\";\r\nimport { PropertyDescription, PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\n\r\n/**\r\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\r\n * Category for PropertyCategory\r\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\r\n * @beta\r\n */\r\nexport enum FlatGridItemType {\r\n Category,\r\n Primitive,\r\n Array,\r\n Struct,\r\n}\r\n\r\n/**\r\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\r\n * @beta\r\n */\r\nexport type CategorizedPropertyTypes = FlatGridItemType.Array | FlatGridItemType.Primitive | FlatGridItemType.Struct;\r\n\r\n/**\r\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\r\n * @beta\r\n */\r\nexport interface IMutableFlatPropertyGridItem {\r\n readonly type: FlatGridItemType;\r\n readonly key: string;\r\n readonly selectionKey: string;\r\n readonly parentSelectionKey: string | undefined;\r\n readonly parentCategorySelectionKey: string | undefined;\r\n readonly depth: number;\r\n readonly label: string;\r\n lastInNumberOfCategories: number;\r\n isLastInRootCategory: boolean;\r\n isExpanded: boolean;\r\n getDescendantsAndSelf(): IMutableFlatGridItem[];\r\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\r\n getChildren(): IMutableFlatGridItem[];\r\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\r\n}\r\n\r\n/**\r\n * Base class for all FlatPropertyGrid items\r\n * @beta\r\n */\r\nexport abstract class MutableFlatPropertyGridItem implements IMutableFlatPropertyGridItem {\r\n public [immerable] = true;\r\n\r\n public readonly key: string = shortid.generate();\r\n protected _isExpanded: boolean = false;\r\n protected _lastInNumberOfCategories: number = 0;\r\n protected _isLastInRootCategory: boolean = false;\r\n\r\n public constructor(private _depth: number, private _parentSelectionKey: string | undefined, private _parentCategorySelectionKey: string | undefined) {\r\n if (this._depth < 0)\r\n throw new Error(\"Depth cannot be negative\");\r\n }\r\n\r\n public abstract type: FlatGridItemType;\r\n public abstract label: string;\r\n public abstract selectionKey: string;\r\n\r\n public get depth() {\r\n return this._depth;\r\n }\r\n\r\n public get parentSelectionKey() {\r\n return this._parentSelectionKey;\r\n }\r\n\r\n public get parentCategorySelectionKey() {\r\n return this._parentCategorySelectionKey;\r\n }\r\n\r\n public get isExpanded() {\r\n return this._isExpanded;\r\n }\r\n\r\n public set isExpanded(value: boolean) {\r\n this._isExpanded = value;\r\n }\r\n\r\n public abstract getChildren(): IMutableFlatGridItem[];\r\n public abstract getSelf(): IMutableFlatGridItem;\r\n\r\n protected getDescendants() {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n this.getChildren().forEach((child) => descendants.push(...child.getDescendantsAndSelf()));\r\n\r\n return descendants;\r\n }\r\n\r\n /**\r\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\r\n */\r\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this.getSelf(), ...this.getDescendants()];\r\n }\r\n\r\n /**\r\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\r\n */\r\n public getVisibleDescendants(): IMutableFlatGridItem[] {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n if (this.isExpanded)\r\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\r\n return descendants;\r\n }\r\n\r\n /**\r\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\r\n */\r\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this.getSelf(), ...this.getVisibleDescendants()];\r\n }\r\n\r\n /**\r\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\r\n */\r\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\r\n if (!this.isExpanded)\r\n return this.getSelf();\r\n\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return this.getSelf();\r\n\r\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\r\n }\r\n\r\n /**\r\n * Sets lastInNumberOfCategories value and sends it down to this items last child\r\n * @internal\r\n */\r\n public get lastInNumberOfCategories(): number {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return 0;\r\n\r\n return this._lastInNumberOfCategories;\r\n }\r\n\r\n public set lastInNumberOfCategories(value: number) {\r\n this._lastInNumberOfCategories = value;\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return;\r\n\r\n children[children.length - 1].lastInNumberOfCategories = value;\r\n }\r\n\r\n /**\r\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\r\n * @internal\r\n */\r\n public get isLastInRootCategory(): boolean {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return false;\r\n\r\n return this._isLastInRootCategory;\r\n }\r\n\r\n public set isLastInRootCategory(value: boolean) {\r\n this._isLastInRootCategory = value;\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return;\r\n\r\n children[children.length - 1].isLastInRootCategory = value;\r\n }\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\r\n * @beta\r\n */\r\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\r\n type: FlatGridItemType.Category;\r\n name: string;\r\n derivedCategory: PropertyCategory;\r\n isRootCategory: boolean;\r\n\r\n getChildCategories(): IMutableGridCategoryItem[];\r\n getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[];\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\r\n * @beta\r\n */\r\nexport interface IMutableCategorizedPropertyItem extends IMutableFlatPropertyGridItem {\r\n readonly type: CategorizedPropertyTypes;\r\n readonly derivedRecord: PropertyRecord;\r\n readonly parentCategorySelectionKey: string;\r\n readonly parentSelectionKey: string;\r\n\r\n getChildren(): IMutableCategorizedPropertyItem[];\r\n}\r\n\r\n/**\r\n * Type which describes mutable GridCategoryItem or CategorizedProperty\r\n * @beta\r\n */\r\nexport type IMutableFlatGridItem = IMutableCategorizedPropertyItem | IMutableGridCategoryItem;\r\n\r\n/**\r\n * Base class for all Mutable CategorizedProperties\r\n * @beta\r\n */\r\nexport abstract class MutableCategorizedProperty extends MutableFlatPropertyGridItem implements Partial<IMutableCategorizedPropertyItem> {\r\n private _derivedRecord: PropertyRecord;\r\n private _selectionKey: string;\r\n\r\n public constructor(\r\n type: CategorizedPropertyTypes,\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(depth, parentSelectionKey, parentCategorySelectionKey);\r\n\r\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\r\n if (recordType !== type) {\r\n const expectedTypeStr = FlatGridItemType[type];\r\n const actualTypeStr = FlatGridItemType[recordType];\r\n throw Error(`Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`);\r\n }\r\n\r\n const overridenProperty = this.makeOverridenProperty(record.property, overrideName, overrideDisplayLabel);\r\n this._derivedRecord = this.makeDerivedRecord(record, overridenProperty);\r\n\r\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\r\n this._isExpanded = !!record.autoExpand;\r\n }\r\n\r\n public abstract override type: CategorizedPropertyTypes;\r\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\r\n\r\n /**\r\n * Maps PropertyRecord valueFormat to FlatGridItemType\r\n * @param valueType valueFormat to map\r\n * @returns mapped FlatGridItemType\r\n */\r\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\r\n switch (valueType) {\r\n case PropertyValueFormat.Primitive:\r\n return FlatGridItemType.Primitive;\r\n case PropertyValueFormat.Array:\r\n return FlatGridItemType.Array;\r\n case PropertyValueFormat.Struct:\r\n return FlatGridItemType.Struct;\r\n /* istanbul ignore next */\r\n default:\r\n const unhandledType: never = valueType;\r\n throw Error(`Property Value Format not handled: ${unhandledType}`);\r\n }\r\n }\r\n\r\n /**\r\n * Make new property description with overriden fields.\r\n * @param propertyDescription property description to override.\r\n * @param overrideName property description name to override.\r\n * @param overrideDisplay property description display name to override.\r\n */\r\n private makeOverridenProperty(propertyDescription: PropertyDescription, overrideName?: string, overrideDisplay?: string): PropertyDescription {\r\n const { name, displayLabel, ...property } = { ...propertyDescription };\r\n const newName = overrideName ?? name;\r\n const newDisplayLabel = overrideDisplay ?? displayLabel;\r\n\r\n return { ...property, name: newName, displayLabel: newDisplayLabel };\r\n }\r\n\r\n /**\r\n * Gets derived property record that has it's property description field overriden\r\n */\r\n private makeDerivedRecord(record: PropertyRecord, overridenPropertyDescription: PropertyDescription) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { value, property, ...others } = record;\r\n const newRecord = new PropertyRecord(value, overridenPropertyDescription);\r\n\r\n return Object.assign(newRecord, others);\r\n }\r\n\r\n public getSelf(): IMutableCategorizedPropertyItem {\r\n return this;\r\n }\r\n\r\n public override get parentCategorySelectionKey() {\r\n return super.parentCategorySelectionKey!;\r\n }\r\n\r\n public override get parentSelectionKey() {\r\n return super.parentSelectionKey!;\r\n }\r\n\r\n /**\r\n * Unique selection key made of parent selectionKey and this property name.\r\n */\r\n public get selectionKey() {\r\n return this._selectionKey;\r\n }\r\n\r\n public get label() {\r\n return this._derivedRecord.property.displayLabel;\r\n }\r\n\r\n /**\r\n * Record with overriden property description.\r\n */\r\n public get derivedRecord() {\r\n return this._derivedRecord;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridCategory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,gBAAgB,EAAkD,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAWtI;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,2BAA2B;IAMlE,YACE,QAA0B,EAC1B,WAAgC,EAChC,eAAwC,EACxC,kBAA2B,EAC3B,QAAgB,CAAC;;QAEjB,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QAEzF,IAAI,kBAAkB,KAAK,SAAS;YAClC,IAAI,CAAC,aA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AC,IAAI,CAAC;IAC7B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,IAAW,eAAe;QACxB,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;IACxD,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,8BAA8B;QACnC,MAAM,WAAW,GAA+B,EAAE,CAAC;QACnD,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC;QAEtG,OAAO,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,IAAoB,wBAAwB;QAC1C,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC;YAClD,OAAO,CAAC,CAAC;QAEX,OAAO,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,IAAoB,wBAAwB,CAAC,KAAa;QACxD,KAAK,CAAC,wBAAwB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,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 { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FlatGridItemType, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem } from \"./MutableFlatGridItem\";\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/**\n * Category name to PropertyRecord[] key pair interface used to describe which records belong to which category.\n * @beta\n */\nexport interface CategoryRecordsDict {\n [categoryName: string]: PropertyRecord[];\n}\n\n/**\n * Mutable wrapper object for PropertyCategory which provides methods for working with and managing category and record children hierarchies\n * @beta\n */\nexport class MutableGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\n private _children: IMutableFlatGridItem[];\n private _childCategories: IMutableGridCategoryItem[];\n private _selectionKey: string;\n private _category: PropertyCategory;\n\n constructor(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n gridItemFactory: IMutableGridItemFactory,\n parentSelectionKey?: string,\n depth: number = 0,\n ) {\n super(depth, parentSelectionKey, parentSelectionKey);\n this._category = { name: category.name, label: category.label, expand: category.expand };\n\n if (parentSelectionKey !== undefined)\n this._selectionKey = `${parentSelectionKey}_${category.name}`;\n else\n this._selectionKey = category.name;\n\n this._isExpanded = category.expand;\n\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with the parent category.\n const categoryRecords = recordsDict[category.name] ?? [];\n this._children = categoryRecords.map((value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0));\n\n const childCategories = category.childCategories ?? [];\n this._childCategories = childCategories.map((childCategory) => gridItemFactory.createGridCategory(childCategory, recordsDict, this.selectionKey, this.depth + 1));\n\n this._children.push(...this._childCategories);\n\n // Assign lastInNumberOfCategories and isLastInRootCategory for entire children hierarchy\n this.lastInNumberOfCategories = 0;\n this.isLastInRootCategory = this.isRootCategory;\n }\n\n /**\n * Category is considered to be root category if its depth is 0\n */\n public get isRootCategory() {\n return this.depth === 0;\n }\n\n public get selectionKey() {\n return this._selectionKey;\n }\n\n public get type(): FlatGridItemType.Category {\n return FlatGridItemType.Category;\n }\n\n public get name() {\n return this._category.name;\n }\n\n public get label() {\n return this._category.label;\n }\n\n public get derivedCategory(): PropertyCategory {\n return { ...this._category, expand: this.isExpanded };\n }\n\n public getSelf() {\n return this;\n }\n\n public getChildren(): IMutableFlatGridItem[] {\n return this._children;\n }\n\n public getChildCategories() {\n return this._childCategories;\n }\n\n /**\n * Gets a flat list of all categories beneath this category and itself in depth first visiting order.\n */\n public getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[] {\n const descendants: IMutableGridCategoryItem[] = [];\n this._childCategories.forEach((value) => descendants.push(...value.getDescendantCategoriesAndSelf()));\n\n return [this, ...descendants];\n }\n\n /**\n * Gets and Sets lastInNumberOfCategories.\n * Setter increments set value by one to account self as category.\n * New value is sent down to this items last child\n * @internal\n */\n public override get lastInNumberOfCategories(): number {\n if (this.isExpanded && this.getChildren().length > 0)\n return 0;\n\n return this._lastInNumberOfCategories - 1;\n }\n\n public override set lastInNumberOfCategories(value: number) {\n super.lastInNumberOfCategories = value + 1;\n }\n}\n"]}
1
+ {"version":3,"file":"MutableGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridCategory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,gBAAgB,EAAkD,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAWtI;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,2BAA2B;IAMlE,YACE,QAA0B,EAC1B,WAAgC,EAChC,eAAwC,EACxC,kBAA2B,EAC3B,QAAgB,CAAC;;QAEjB,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QAEzF,IAAI,kBAAkB,KAAK,SAAS;YAClC,IAAI,CAAC,aAAa,GAAG,GAAG,k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AC7B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,IAAW,eAAe;QACxB,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;IACxD,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,8BAA8B;QACnC,MAAM,WAAW,GAA+B,EAAE,CAAC;QACnD,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC;QAEtG,OAAO,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,IAAoB,wBAAwB;QAC1C,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC;YAClD,OAAO,CAAC,CAAC;QAEX,OAAO,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,IAAoB,wBAAwB,CAAC,KAAa;QACxD,KAAK,CAAC,wBAAwB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport { FlatGridItemType, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem } from \"./MutableFlatGridItem\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/**\r\n * Category name to PropertyRecord[] key pair interface used to describe which records belong to which category.\r\n * @beta\r\n */\r\nexport interface CategoryRecordsDict {\r\n [categoryName: string]: PropertyRecord[];\r\n}\r\n\r\n/**\r\n * Mutable wrapper object for PropertyCategory which provides methods for working with and managing category and record children hierarchies\r\n * @beta\r\n */\r\nexport class MutableGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\r\n private _children: IMutableFlatGridItem[];\r\n private _childCategories: IMutableGridCategoryItem[];\r\n private _selectionKey: string;\r\n private _category: PropertyCategory;\r\n\r\n constructor(\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n gridItemFactory: IMutableGridItemFactory,\r\n parentSelectionKey?: string,\r\n depth: number = 0,\r\n ) {\r\n super(depth, parentSelectionKey, parentSelectionKey);\r\n this._category = { name: category.name, label: category.label, expand: category.expand };\r\n\r\n if (parentSelectionKey !== undefined)\r\n this._selectionKey = `${parentSelectionKey}_${category.name}`;\r\n else\r\n this._selectionKey = category.name;\r\n\r\n this._isExpanded = category.expand;\r\n\r\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with the parent category.\r\n const categoryRecords = recordsDict[category.name] ?? [];\r\n this._children = categoryRecords.map((value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0));\r\n\r\n const childCategories = category.childCategories ?? [];\r\n this._childCategories = childCategories.map((childCategory) => gridItemFactory.createGridCategory(childCategory, recordsDict, this.selectionKey, this.depth + 1));\r\n\r\n this._children.push(...this._childCategories);\r\n\r\n // Assign lastInNumberOfCategories and isLastInRootCategory for entire children hierarchy\r\n this.lastInNumberOfCategories = 0;\r\n this.isLastInRootCategory = this.isRootCategory;\r\n }\r\n\r\n /**\r\n * Category is considered to be root category if its depth is 0\r\n */\r\n public get isRootCategory() {\r\n return this.depth === 0;\r\n }\r\n\r\n public get selectionKey() {\r\n return this._selectionKey;\r\n }\r\n\r\n public get type(): FlatGridItemType.Category {\r\n return FlatGridItemType.Category;\r\n }\r\n\r\n public get name() {\r\n return this._category.name;\r\n }\r\n\r\n public get label() {\r\n return this._category.label;\r\n }\r\n\r\n public get derivedCategory(): PropertyCategory {\r\n return { ...this._category, expand: this.isExpanded };\r\n }\r\n\r\n public getSelf() {\r\n return this;\r\n }\r\n\r\n public getChildren(): IMutableFlatGridItem[] {\r\n return this._children;\r\n }\r\n\r\n public getChildCategories() {\r\n return this._childCategories;\r\n }\r\n\r\n /**\r\n * Gets a flat list of all categories beneath this category and itself in depth first visiting order.\r\n */\r\n public getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[] {\r\n const descendants: IMutableGridCategoryItem[] = [];\r\n this._childCategories.forEach((value) => descendants.push(...value.getDescendantCategoriesAndSelf()));\r\n\r\n return [this, ...descendants];\r\n }\r\n\r\n /**\r\n * Gets and Sets lastInNumberOfCategories.\r\n * Setter increments set value by one to account self as category.\r\n * New value is sent down to this items last child\r\n * @internal\r\n */\r\n public override get lastInNumberOfCategories(): number {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return 0;\r\n\r\n return this._lastInNumberOfCategories - 1;\r\n }\r\n\r\n public override set lastInNumberOfCategories(value: number) {\r\n super.lastInNumberOfCategories = value + 1;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableGridItemFactory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAkB,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAA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EAAE,oBAAoB,CAAC,CAAC;YACzI,KAAK,mBAAmB,CAAC,KAAK;gBAC5B,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;YACrI,KAAK,mBAAmB,CAAC,MAAM;gBAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;YACtI,0BAA0B;YAC1B;gBACE,MAAM,mBAAmB,GAAU,WAAW,CAAC;gBAC/C,MAAM,IAAI,KAAK,CAAC,yDAAyD,mBAAmB,EAAE,CAAC,CAAC;SACnG;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,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,CAAC,CAAC;QAEpG,IAAI,kBAAkB,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;YACzD,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAEzF,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 { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { MutableCategorizedArrayProperty } from \"./MutableCategorizedArrayProperty\";\nimport { MutableCategorizedPrimitiveProperty } from \"./MutableCategorizedPrimitiveProperty\";\nimport { MutableCategorizedStructProperty } from \"./MutableCategorizedStructProperty\";\nimport { MutableCustomGridCategory } from \"./MutableCustomGridCategory\";\nimport { IMutableCategorizedPropertyItem, IMutableGridCategoryItem } from \"./MutableFlatGridItem\";\nimport { CategoryRecordsDict, MutableGridCategory } from \"./MutableGridCategory\";\n\n/**\n * IMutableGridItemFactory interface for creating MutableGridItem objects\n * @beta\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 * @beta\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(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\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(record, parentSelectionKey, parentCategorySelectionKey, depth, this, overrideName, overrideDisplayLabel);\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(record, parentSelectionKey, parentCategorySelectionKey, depth, this, overrideName, overrideDisplayLabel);\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(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n case PropertyValueFormat.Array:\n return this.createArrayProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n case PropertyValueFormat.Struct:\n return this.createStructProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n /* istanbul ignore next */\n default:\n const unhandledRecordType: never = valueFormat;\n throw new Error(`Unhandled property record type. Was a new type added? ${unhandledRecordType}`);\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(category, recordsDict, this, parentSelectionKey, depth ?? 0);\n\n if (parentSelectionKey !== undefined && depth !== undefined)\n return new MutableGridCategory(category, recordsDict, this, parentSelectionKey, depth);\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":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAkB,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5E,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;AAExE,OAAO,EAAuB,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAwBjF;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACvB,uBAAuB,CAC/B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,mCAAmC,CAAC,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;IACpJ,CAAC;IAES,mBAAmB,CAC3B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,+BAA+B,CAAC,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;IACtJ,CAAC;IAES,oBAAoB,CAC5B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,gCAAgC,CAAC,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;IACvJ,CAAC;IAED;;;;;;;;;OASG;IACI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EzF,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport { MutableCategorizedArrayProperty } from \"./MutableCategorizedArrayProperty\";\r\nimport { MutableCategorizedPrimitiveProperty } from \"./MutableCategorizedPrimitiveProperty\";\r\nimport { MutableCategorizedStructProperty } from \"./MutableCategorizedStructProperty\";\r\nimport { MutableCustomGridCategory } from \"./MutableCustomGridCategory\";\r\nimport { IMutableCategorizedPropertyItem, IMutableGridCategoryItem } from \"./MutableFlatGridItem\";\r\nimport { CategoryRecordsDict, MutableGridCategory } from \"./MutableGridCategory\";\r\n\r\n/**\r\n * IMutableGridItemFactory interface for creating MutableGridItem objects\r\n * @beta\r\n */\r\nexport interface IMutableGridItemFactory {\r\n createCategorizedProperty: (\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) => IMutableCategorizedPropertyItem;\r\n\r\n createGridCategory: (\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n parentSelectionKey?: string,\r\n depth?: number,\r\n ) => IMutableGridCategoryItem;\r\n}\r\n\r\n/**\r\n * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.\r\n * @beta\r\n */\r\nexport class MutableGridItemFactory implements IMutableGridItemFactory {\r\n protected createPrimitiveProperty(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n return new MutableCategorizedPrimitiveProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n }\r\n\r\n protected createArrayProperty(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n return new MutableCategorizedArrayProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, this, overrideName, overrideDisplayLabel);\r\n }\r\n\r\n protected createStructProperty(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n return new MutableCategorizedStructProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, this, overrideName, overrideDisplayLabel);\r\n }\r\n\r\n /**\r\n * Converts record into FlatGridItem.\r\n * @param record record to convert to a FlatGridItem.\r\n * @param parentSelectionKey parent selection key of provided `record`.\r\n * @param parentCategorySelectionKey parent category selection key of provided `record`.\r\n * @param depth current depth counting from parent category.\r\n * @param overrideName property name that overrides original record property name.\r\n * @param overrideDisplayLabel property display label that overrides original record property display label.\r\n * @returns converted CategorizedProperty.\r\n */\r\n public createCategorizedProperty(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ): IMutableCategorizedPropertyItem {\r\n const valueFormat = record.value.valueFormat;\r\n switch (valueFormat) {\r\n case PropertyValueFormat.Primitive:\r\n return this.createPrimitiveProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n case PropertyValueFormat.Array:\r\n return this.createArrayProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n case PropertyValueFormat.Struct:\r\n return this.createStructProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n /* istanbul ignore next */\r\n default:\r\n const unhandledRecordType: never = valueFormat;\r\n throw new Error(`Unhandled property record type. Was a new type added? ${unhandledRecordType}`);\r\n }\r\n }\r\n\r\n /**\r\n * Converts category into GridCategoryItem.\r\n * @param category PropertyCategory to convert.\r\n * @param recordsDict dictionary of category records.\r\n * @param parentSelectionKey parent selection key of this category.\r\n * @param depth current depth counting from root category.\r\n * @returns converted GridCategory.\r\n */\r\n public createGridCategory(\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n parentSelectionKey?: string,\r\n depth?: number,\r\n ): IMutableGridCategoryItem {\r\n if (category.renderer !== undefined)\r\n return new MutableCustomGridCategory(category, recordsDict, this, parentSelectionKey, depth ?? 0);\r\n\r\n if (parentSelectionKey !== undefined && depth !== undefined)\r\n return new MutableGridCategory(category, recordsDict, this, parentSelectionKey, depth);\r\n\r\n return new MutableGridCategory(category, recordsDict, this);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FlatNonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,iEAAiE,CAAC;AAEzE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAE9F,OAAO,EAAE,iCAAiC,EAAE,MAAM,uEAAuE,CAAC;AAC1H,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAU1E;;GAEG;AACH,MAAM,OAAO,gCAAiC,SAAQ,KAAK,CAAC,SAAgD;IAC1G,YAAY,KAA4C;QACtD,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,gBAAW,GAAG,GAAG,EA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C,YAAY,IACX,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KACnC,KAAK,GACT,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport \"../../../properties/renderers/NonPrimitivePropertyRenderer.scss\";\nimport _ from \"lodash\";\nimport * as React from \"react\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\nimport { PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\nimport { NonPrimitivePropertyLabelRenderer } from \"../../../properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\nimport { PropertyView } from \"../../../properties/renderers/PropertyView\";\n\n/** Properties of [[FlatNonPrimitivePropertyRenderer]] React component\n * @internal\n */\nexport interface FlatNonPrimitivePropertyRendererProps extends PrimitiveRendererProps {\n isExpanded: boolean;\n onExpandToggled: () => void;\n}\n\n/** React Component that renders flat struct and array properties\n * @internal\n */\nexport class FlatNonPrimitivePropertyRenderer extends React.Component<FlatNonPrimitivePropertyRendererProps> {\n constructor(props: FlatNonPrimitivePropertyRendererProps) {\n super(props);\n }\n\n private _onExpanded = () => {\n /* istanbul ignore else */\n if (!this.props.isExpanded)\n this.props.onExpandToggled();\n };\n\n private _onCollapsed = () => {\n /* istanbul ignore else */\n if (this.props.isExpanded)\n this.props.onExpandToggled();\n };\n\n private getLabel(props: FlatNonPrimitivePropertyRendererProps): React.ReactNode {\n const { orientation, indentation, width, columnRatio, columnInfo } = props;\n const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, columnInfo?.minLabelWidth);\n\n let displayLabel = props.propertyRecord.property.displayLabel;\n if (props.propertyRecord.value.valueFormat === PropertyValueFormat.Array)\n displayLabel = `${displayLabel} (${props.propertyRecord.value.items.length})`;\n\n return (\n <NonPrimitivePropertyLabelRenderer\n isExpanded={props.isExpanded}\n onExpand={this._onExpanded}\n onCollapse={this._onCollapsed}\n offset={offset}\n renderColon={false}\n >\n {displayLabel}\n </NonPrimitivePropertyLabelRenderer>\n );\n }\n\n /** @internal */\n public override render() {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { children, indentation, ...props } = this.props;\n return (\n <PropertyView\n labelElement={this.getLabel(this.props)}\n {...props}\n />\n );\n }\n}\n"]}
1
+ {"version":3,"file":"FlatNonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,iEAAiE,CAAC;AAEzE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAE9F,OAAO,EAAE,iCAAiC,EAAE,MAAM,uEAAuE,CAAC;AAC1H,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAU1E;;GAEG;AACH,MAAM,OAAO,gCAAiC,SAAQ,KAAK,CAAC,SAAgD;IAC1G,YAAY,KAA4C;QACtD,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,gBAAW,GAAG,GAAG,EAAE;YACzB,0BAA0B;YAC1B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU;gBACxB,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QACjC,CAAC,CAAC;QAEM,iBAAY,GAAG,GAAG,EAAE;YAC1B,0BAA0B;YAC1B,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU;gBACvB,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QACjC,CAAC,CAAC;IAZF,CAAC;IAcO,QAAQ,CAAC,KAA4C;QAC3D,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;QAC3E,MAAM,MAAM,GAAG,sBAAsB,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,aAAa,CAAC,CAAC;QAE9H,IAAI,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC9D,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,KAAK;YACtE,YAAY,GAAG,GAAG,YAAY,KAAK,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAEhF,OAAO,CACL,oBAAC,iCAAiC,IAChC,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,QAAQ,EAAE,IAAI,CAAC,WAAW,EAC1B,UAAU,EAAE,IAAI,CAAC,YAAY,EAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,KAAK,IAEjB,YAAY,CACqB,CACrC,CAAC;IACJ,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,6DAA6D;QAC7D,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACvD,OAAO,CACL,oBAAC,YAAY,IACX,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KACnC,KAAK,GACT,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"../../../properties/renderers/NonPrimitivePropertyRenderer.scss\";\r\nimport _ from \"lodash\";\r\nimport * as React from \"react\";\r\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\r\nimport { PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\r\nimport { NonPrimitivePropertyLabelRenderer } from \"../../../properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\r\nimport { PropertyView } from \"../../../properties/renderers/PropertyView\";\r\n\r\n/** Properties of [[FlatNonPrimitivePropertyRenderer]] React component\r\n * @internal\r\n */\r\nexport interface FlatNonPrimitivePropertyRendererProps extends PrimitiveRendererProps {\r\n isExpanded: boolean;\r\n onExpandToggled: () => void;\r\n}\r\n\r\n/** React Component that renders flat struct and array properties\r\n * @internal\r\n */\r\nexport class FlatNonPrimitivePropertyRenderer extends React.Component<FlatNonPrimitivePropertyRendererProps> {\r\n constructor(props: FlatNonPrimitivePropertyRendererProps) {\r\n super(props);\r\n }\r\n\r\n private _onExpanded = () => {\r\n /* istanbul ignore else */\r\n if (!this.props.isExpanded)\r\n this.props.onExpandToggled();\r\n };\r\n\r\n private _onCollapsed = () => {\r\n /* istanbul ignore else */\r\n if (this.props.isExpanded)\r\n this.props.onExpandToggled();\r\n };\r\n\r\n private getLabel(props: FlatNonPrimitivePropertyRendererProps): React.ReactNode {\r\n const { orientation, indentation, width, columnRatio, columnInfo } = props;\r\n const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, columnInfo?.minLabelWidth);\r\n\r\n let displayLabel = props.propertyRecord.property.displayLabel;\r\n if (props.propertyRecord.value.valueFormat === PropertyValueFormat.Array)\r\n displayLabel = `${displayLabel} (${props.propertyRecord.value.items.length})`;\r\n\r\n return (\r\n <NonPrimitivePropertyLabelRenderer\r\n isExpanded={props.isExpanded}\r\n onExpand={this._onExpanded}\r\n onCollapse={this._onCollapsed}\r\n offset={offset}\r\n renderColon={false}\r\n >\r\n {displayLabel}\r\n </NonPrimitivePropertyLabelRenderer>\r\n );\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { children, indentation, ...props } = this.props;\r\n return (\r\n <PropertyView\r\n labelElement={this.getLabel(this.props)}\r\n {...props}\r\n />\r\n );\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FlatPropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAA0B,MAAM,yDAAyD,CAAC;AAI5H,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAgCtF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,KAAK,EAAE,EAAE;IACjF,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,E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C,SAAS,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAE7D,IAAI,KAAK,CAAC,SAAS,EAAE;QACnB,MAAM,aAAa,GAAG,CAAC,IAAyB,EAAE,EAAE;;YAClD,0BAA0B;YAC1B,IAAI,KAAK,CAAC,QAAQ;gBAChB,MAAA,KAAK,CAAC,YAAY,+CAAlB,KAAK,EAAgB,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC/C,CAAC,CAAC;QAEF,OAAO,CACL,oBAAC,eAAe,IACd,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAC,0BAA0B,GAAG,EAAE,GAAG,CAAC,CAAC,EACrE,QAAQ,EAAE,IAAI,GACd,CACH,CAAC;KACH;IAED,OAAO,CACL,0CAEI,sBAAsB,CAAC,qBAAqB,CAC1C,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,4BAA4B,EAClC,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,kBAAkB,EACxB,KAAK,CAAC,eAAe,EACrB,KAAK,CAAC,SAAS,CAChB,CAEF,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,oBAAoB,CAAC,SAAmB,EAAE,eAA6C;IAC9F,MAAM,wBAAwB,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,wBAAwB,CAAC,OAAO,IAAI,SAAS,EAAE;YAClD,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAG,EAAE,CAAC,CAAC;SACvB;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 { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { HighlightingComponentProps } from \"../../../common/HighlightingComponentProps\";\nimport { EditorContainer, PropertyUpdatedArgs } from \"../../../editors/EditorContainer\";\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\nimport { PrimitivePropertyRenderer, PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\nimport { SharedRendererProps } from \"../../../properties/renderers/PropertyRenderer\";\nimport { PropertyValueRendererManager } from \"../../../properties/ValueRendererManager\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FlatNonPrimitivePropertyRenderer } from \"./FlatNonPrimitivePropertyRenderer\";\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 * @beta */\n isEditing?: boolean;\n /** Called when property edit is committed.\n * @beta */\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\n /** Called when property edit is cancelled.\n * @beta */\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 & { applyOnLabel: boolean, applyOnValue: boolean };\n\n children?: never;\n}\n\n/** A React component that renders flat properties\n * @internal\n */\nexport const FlatPropertyRenderer: React.FC<FlatPropertyRendererProps> = (props) => {\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 />\n );\n\n const primitiveRendererProps: PrimitiveRendererProps = {\n ...passthroughProps,\n valueElementRenderer,\n indentation: props.indentation,\n };\n switch (props.propertyRecord.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return (<PrimitivePropertyRenderer highlight={highlight?.applyOnLabel ? highlight : undefined} {...primitiveRendererProps} />);\n\n case PropertyValueFormat.Array:\n // If array is empty, render it as a primitive property\n if (props.propertyRecord.value.items.length === 0)\n return (<PrimitivePropertyRenderer highlight={highlight?.applyOnLabel ? highlight : undefined} {...primitiveRendererProps} />);\n\n // eslint-disable-next-line no-fallthrough\n case PropertyValueFormat.Struct:\n return (\n <FlatNonPrimitivePropertyRenderer\n isExpanded={props.isExpanded}\n onExpandToggled={props.onExpansionToggled}\n {...primitiveRendererProps}\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?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\n\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean };\n}\n\nconst DisplayValue: React.FC<DisplayValueProps> = (props) => {\n useResetHeightOnEdit(props.isEditing, props.onHeightChanged);\n\n if (props.isEditing) {\n const _onEditCommit = (args: PropertyUpdatedArgs) => {\n /* istanbul ignore else */\n if (props.category)\n 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 {\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};\n\nfunction useResetHeightOnEdit(isEditing?: boolean, onHeightChanged?: (newHeight: number) => void) {\n const previousEditingStatusRef = React.useRef(isEditing);\n React.useEffect(() => {\n if (!previousEditingStatusRef.current && isEditing) {\n onHeightChanged?.(27);\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;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAA0B,MAAM,yDAAyD,CAAC;AAI5H,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAgCtF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,KAAK,EAAE,EAAE;IACjF,MAAM,EACJ,QAAQ,EACR,4BAA4B,EAC5B,SAAS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GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,wBAAwB,CAAC,OAAO,IAAI,SAAS,EAAE;YAClD,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAG,EAAE,CAAC,CAAC;SACvB;QAED,wBAAwB,CAAC,OAAO,GAAG,SAAS,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { Orientation } from \"@itwin/core-react\";\r\nimport { HighlightingComponentProps } from \"../../../common/HighlightingComponentProps\";\r\nimport { EditorContainer, PropertyUpdatedArgs } from \"../../../editors/EditorContainer\";\r\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\r\nimport { PrimitivePropertyRenderer, PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\r\nimport { SharedRendererProps } from \"../../../properties/renderers/PropertyRenderer\";\r\nimport { PropertyValueRendererManager } from \"../../../properties/ValueRendererManager\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport { FlatNonPrimitivePropertyRenderer } from \"./FlatNonPrimitivePropertyRenderer\";\r\n\r\n/** Properties of [[FlatPropertyRenderer]] React component\r\n * @internal\r\n */\r\nexport interface FlatPropertyRendererProps extends SharedRendererProps {\r\n category?: PropertyCategory;\r\n /** Custom value renderer */\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n /** Multiplier of how much the property is indented to the right */\r\n indentation?: number;\r\n /** Indicates property is being edited\r\n * @beta */\r\n isEditing?: boolean;\r\n /** Called when property edit is committed.\r\n * @beta */\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n /** Called when property edit is cancelled.\r\n * @beta */\r\n onEditCancel?: () => void;\r\n /** Whether property value is displayed in expanded state. */\r\n isExpanded: boolean;\r\n /** Called when toggling between expanded and collapsed property value display state. */\r\n onExpansionToggled: () => void;\r\n /** Reports property height changes. */\r\n onHeightChanged?: (newHeight: number) => void;\r\n\r\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean };\r\n\r\n children?: never;\r\n}\r\n\r\n/** A React component that renders flat properties\r\n * @internal\r\n */\r\nexport const FlatPropertyRenderer: React.FC<FlatPropertyRendererProps> = (props) => {\r\n const {\r\n category,\r\n propertyValueRendererManager,\r\n isEditing,\r\n onEditCommit,\r\n onEditCancel,\r\n onHeightChanged,\r\n highlight,\r\n ...passthroughProps\r\n } = props;\r\n\r\n const valueElementRenderer = () => (\r\n <DisplayValue\r\n propertyRecord={passthroughProps.propertyRecord}\r\n orientation={passthroughProps.orientation}\r\n columnRatio={passthroughProps.columnRatio}\r\n width={passthroughProps.width}\r\n category={category}\r\n propertyValueRendererManager={propertyValueRendererManager}\r\n isEditing={isEditing}\r\n onEditCommit={onEditCommit}\r\n onEditCancel={onEditCancel}\r\n isExpanded={passthroughProps.isExpanded}\r\n onExpansionToggled={passthroughProps.onExpansionToggled}\r\n onHeightChanged={onHeightChanged}\r\n highlight={highlight}\r\n />\r\n );\r\n\r\n const primitiveRendererProps: PrimitiveRendererProps = {\r\n ...passthroughProps,\r\n valueElementRenderer,\r\n indentation: props.indentation,\r\n };\r\n switch (props.propertyRecord.value.valueFormat) {\r\n case PropertyValueFormat.Primitive:\r\n return (<PrimitivePropertyRenderer highlight={highlight?.applyOnLabel ? highlight : undefined} {...primitiveRendererProps} />);\r\n\r\n case PropertyValueFormat.Array:\r\n // If array is empty, render it as a primitive property\r\n if (props.propertyRecord.value.items.length === 0)\r\n return (<PrimitivePropertyRenderer highlight={highlight?.applyOnLabel ? highlight : undefined} {...primitiveRendererProps} />);\r\n\r\n // eslint-disable-next-line no-fallthrough\r\n case PropertyValueFormat.Struct:\r\n return (\r\n <FlatNonPrimitivePropertyRenderer\r\n isExpanded={props.isExpanded}\r\n onExpandToggled={props.onExpansionToggled}\r\n {...primitiveRendererProps}\r\n />\r\n );\r\n }\r\n};\r\n\r\ninterface DisplayValueProps {\r\n isEditing?: boolean;\r\n propertyRecord: PropertyRecord;\r\n\r\n orientation: Orientation;\r\n columnRatio?: number;\r\n /** Pass width to rerender component as property grid width changes */\r\n width?: number;\r\n indentation?: number;\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n isExpanded?: boolean;\r\n onExpansionToggled?: () => void;\r\n onHeightChanged?: (newHeight: number) => void;\r\n\r\n category?: PropertyCategory;\r\n onEditCancel?: () => void;\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n\r\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean };\r\n}\r\n\r\nconst DisplayValue: React.FC<DisplayValueProps> = (props) => {\r\n useResetHeightOnEdit(props.isEditing, props.onHeightChanged);\r\n\r\n if (props.isEditing) {\r\n const _onEditCommit = (args: PropertyUpdatedArgs) => {\r\n /* istanbul ignore else */\r\n if (props.category)\r\n props.onEditCommit?.(args, props.category);\r\n };\r\n\r\n return (\r\n <EditorContainer\r\n propertyRecord={props.propertyRecord}\r\n onCommit={_onEditCommit}\r\n onCancel={props.onEditCancel ?? (/* istanbul ignore next */() => { })}\r\n setFocus={true}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n {\r\n CommonPropertyRenderer.createNewDisplayValue(\r\n props.orientation,\r\n props.propertyRecord,\r\n props.indentation,\r\n props.propertyValueRendererManager,\r\n props.isExpanded,\r\n props.onExpansionToggled,\r\n props.onHeightChanged,\r\n props.highlight\r\n )\r\n }\r\n </>\r\n );\r\n};\r\n\r\nfunction useResetHeightOnEdit(isEditing?: boolean, onHeightChanged?: (newHeight: number) => void) {\r\n const previousEditingStatusRef = React.useRef(isEditing);\r\n React.useEffect(() => {\r\n if (!previousEditingStatusRef.current && isEditing) {\r\n onHeightChanged?.(27);\r\n }\r\n\r\n previousEditingStatusRef.current = isEditing;\r\n });\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectableContent.js","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAc,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAwB7D;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAuC;;IACjF,MAAM,EAAE,0BAA0B,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,mBAAmB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAA4B,EAAE,MAA8B,EAAE,EAAE;QAC7G,0BAA0B,IAAI,MAAM,CAAC,MAAM,KAAK,eAAe,IAAI,KAAK,IAAI,0BAA0B,CAAE,KAAoB,CAAC,KAAK,CAAC,CAAC;IACtI,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACjC,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAiB,CAAC,mCAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5H,OAAO,CACL,6BAAK,SAAS,EAAC,+BAA+B;QAC5C,6BAAK,SAAS,EAAC,sCAAsC;YACnD,oBAAC,YAAY,IAAC,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAC5G,SAAS,EAAC,wCAAwC,gBACtC,KAAK,CAAC,eAAe,EACjC,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,EAAE,KAAK,EAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,EAAE,EAAE,EACpE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;oBAC7C,KAAK,EAAE,YAAY,CAAC,KAAK;oBACzB,KAAK,EAAE,YAAY,CAAC,EAAE;iBACvB,CAAC,CAAC,GACH,CACE;QACN,6BAAK,SAAS,EAAC,uCAAuC,IACnD,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAAE,CACtB,CACF,CACP,CAAC;AACJ,CAAC;AAYD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjG,MAAM,0BAA0B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAClE,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,oBAAC,2BAA2B,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,IAC9J,KAAK,CAAC,QAAQ,CACa,CAC/B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable deprecation/deprecation */\n/** @packageDocumentation\n * @module SelectableContent\n */\n\nimport \"./SelectableContent.scss\";\nimport * as React from \"react\";\nimport { ActionMeta, ValueType } from \"react-select/src/types\";\nimport { OptionType, ThemedSelect } from \"@itwin/core-react\";\n\n/**\n * A definition for content displayed in [[ControlledSelectableContent]] and\n * [[SelectableContent]] components.\n * @public\n */\nexport interface SelectableContentDefinition {\n id: string;\n label: string;\n render: () => React.ReactNode;\n}\n\n/**\n * [[ControlledSelectableContent]] component properties\n * @public\n */\nexport interface ControlledSelectableContentProps {\n selectedContentId: string;\n onSelectedContentIdChanged?: (contentId: string) => void;\n children: SelectableContentDefinition[];\n selectAriaLabel?: string;\n}\n\n/**\n * A fully-controlled component that accepts a list of child components with ids and labels and\n * renders a select box at the top, allowing to choose which of the provided child components\n * should be rendered at the bottom.\n * @public\n */\nexport function ControlledSelectableContent(props: ControlledSelectableContentProps) {\n const { onSelectedContentIdChanged } = props;\n const onContentIdSelected = React.useCallback((value: ValueType<OptionType>, action: ActionMeta<OptionType>) => {\n onSelectedContentIdChanged && action.action === \"select-option\" && value && onSelectedContentIdChanged((value as OptionType).value);\n }, [onSelectedContentIdChanged]);\n const selectedContent = props.children.find((contentDef) => contentDef.id === props.selectedContentId) ?? props.children[0];\n return (\n <div className=\"components-selectable-content\">\n <div className=\"components-selectable-content-header\">\n <ThemedSelect openMenuOnClick={true} openMenuOnFocus={true} isSearchable={false} onChange={onContentIdSelected}\n className=\"components-selectable-content-selector\"\n aria-label={props.selectAriaLabel}\n value={{ label: selectedContent?.label, value: selectedContent?.id }}\n options={props.children.map((componentDef) => ({\n label: componentDef.label,\n value: componentDef.id,\n }))}\n />\n </div>\n <div className=\"components-selectable-content-wrapper\">\n {selectedContent?.render()}\n </div>\n </div>\n );\n}\n\n/**\n * [[SelectableContent]] component properties\n * @public\n */\nexport interface SelectableContentProps {\n defaultSelectedContentId: string;\n children: SelectableContentDefinition[];\n selectAriaLabel?: string;\n}\n\n/**\n * An uncontrolled component that accepts a list of child components with ids and labels and\n * renders a select box at the top, allowing to choose which of the provided child components\n * should be rendered at the bottom.\n * @public\n */\nexport function SelectableContent(props: SelectableContentProps) {\n const [selectedContentId, setSelectedContentId] = React.useState(props.defaultSelectedContentId);\n const onSelectedContentIdChanged = React.useCallback((id: string) => {\n setSelectedContentId(id);\n }, []);\n return (\n <ControlledSelectableContent selectedContentId={selectedContentId} onSelectedContentIdChanged={onSelectedContentIdChanged} selectAriaLabel={props.selectAriaLabel}>\n {props.children}\n </ControlledSelectableContent>\n );\n}\n"]}
1
+ {"version":3,"file":"SelectableContent.js","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAc,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAwB7D;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAuC;;IACjF,MAAM,EAAE,0BAA0B,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,mBAAmB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAA4B,EAAE,MAA8B,EAAE,EAAE;QAC7G,0BAA0B,IAAI,MAAM,CAAC,MAAM,KAAK,eAAe,IAAI,KAAK,IAAI,0BAA0B,CAAE,KAAoB,CAAC,KAAK,CAAC,CAAC;IACtI,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACjC,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAiB,CAAC,mCAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5H,OAAO,CACL,6BAAK,SAAS,EAAC,+BAA+B;QAC5C,6BAAK,SAAS,EAAC,sCAAsC;YACnD,oBAAC,YAAY,IAAC,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAC5G,SAAS,EAAC,wCAAwC,gBACtC,KAAK,CAAC,eAAe,EACjC,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,EAAE,KAAK,EAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,EAAE,EAAE,EACpE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;oBAC7C,KAAK,EAAE,YAAY,CAAC,KAAK;oBACzB,KAAK,EAAE,YAAY,CAAC,EAAE;iBACvB,CAAC,CAAC,GACH,CACE;QACN,6BAAK,SAAS,EAAC,uCAAuC,IACnD,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAAE,CACtB,CACF,CACP,CAAC;AACJ,CAAC;AAYD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjG,MAAM,0BAA0B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAClE,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,oBAAC,2BAA2B,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,IAC9J,KAAK,CAAC,QAAQ,CACa,CAC/B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module SelectableContent\r\n */\r\n\r\nimport \"./SelectableContent.scss\";\r\nimport * as React from \"react\";\r\nimport { ActionMeta, ValueType } from \"react-select/src/types\";\r\nimport { OptionType, ThemedSelect } from \"@itwin/core-react\";\r\n\r\n/**\r\n * A definition for content displayed in [[ControlledSelectableContent]] and\r\n * [[SelectableContent]] components.\r\n * @public\r\n */\r\nexport interface SelectableContentDefinition {\r\n id: string;\r\n label: string;\r\n render: () => React.ReactNode;\r\n}\r\n\r\n/**\r\n * [[ControlledSelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface ControlledSelectableContentProps {\r\n selectedContentId: string;\r\n onSelectedContentIdChanged?: (contentId: string) => void;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * A fully-controlled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function ControlledSelectableContent(props: ControlledSelectableContentProps) {\r\n const { onSelectedContentIdChanged } = props;\r\n const onContentIdSelected = React.useCallback((value: ValueType<OptionType>, action: ActionMeta<OptionType>) => {\r\n onSelectedContentIdChanged && action.action === \"select-option\" && value && onSelectedContentIdChanged((value as OptionType).value);\r\n }, [onSelectedContentIdChanged]);\r\n const selectedContent = props.children.find((contentDef) => contentDef.id === props.selectedContentId) ?? props.children[0];\r\n return (\r\n <div className=\"components-selectable-content\">\r\n <div className=\"components-selectable-content-header\">\r\n <ThemedSelect openMenuOnClick={true} openMenuOnFocus={true} isSearchable={false} onChange={onContentIdSelected}\r\n className=\"components-selectable-content-selector\"\r\n aria-label={props.selectAriaLabel}\r\n value={{ label: selectedContent?.label, value: selectedContent?.id }}\r\n options={props.children.map((componentDef) => ({\r\n label: componentDef.label,\r\n value: componentDef.id,\r\n }))}\r\n />\r\n </div>\r\n <div className=\"components-selectable-content-wrapper\">\r\n {selectedContent?.render()}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * [[SelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface SelectableContentProps {\r\n defaultSelectedContentId: string;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * An uncontrolled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function SelectableContent(props: SelectableContentProps) {\r\n const [selectedContentId, setSelectedContentId] = React.useState(props.defaultSelectedContentId);\r\n const onSelectedContentIdChanged = React.useCallback((id: string) => {\r\n setSelectedContentId(id);\r\n }, []);\r\n return (\r\n <ControlledSelectableContent selectedContentId={selectedContentId} onSelectedContentIdChanged={onSelectedContentIdChanged} selectAriaLabel={props.selectAriaLabel}>\r\n {props.children}\r\n </ControlledSelectableContent>\r\n );\r\n}\r\n"]}
@@ -1,20 +1,20 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/core-react/lib/cjs/core-react/select/select";
6
-
7
- .components-selectable-content {
8
- display: flex;
9
- flex-direction: column;
10
-
11
- .components-selectable-content-header {
12
- .components-selectable-content-selector {
13
- width: 100%;
14
- }
15
- }
16
-
17
- .components-selectable-content-wrapper {
18
- flex-grow: 1;
19
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "~@itwin/core-react/lib/cjs/core-react/select/select";
6
+
7
+ .components-selectable-content {
8
+ display: flex;
9
+ flex-direction: column;
10
+
11
+ .components-selectable-content-header {
12
+ .components-selectable-content-selector {
13
+ width: 100%;
14
+ }
15
+ }
16
+
17
+ .components-selectable-content-wrapper {
18
+ flex-grow: 1;
19
+ }
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleTableDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/table/SimpleTableDataProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAA8B,mBAAmB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAuC,uBAAuB,EAAsB,MAAM,mCAAmC,CAAC;AACrI,OAAO,EAAwD,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEjH,gCAAgC;AAEhC;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAclC,YAAY,OAA4B;QAThC,mBAAc,GAAkB,aAAa,CAAC,MAAM,CAAC;QACrD,qBAAgB,GAAW,CAAC,CAAC,CAAC;QAGtC,kEAAkE;QAC3D,qBAAgB,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACrD,+DAA+D;QACxD,kBAAa,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAGhD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,yBAAyB,GAAG,EAAE,CAAC;IACtC,CAAC;IAED,2CAA2C;IACpC,QAAQ,CAAC,KAAgB;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC;IAEO,eAAe;QACrB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,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O,CAAC,CAAC;QAEzC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;QAEhC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,oBAAoB;IACb,SAAS,CAAC,OAAgB,EAAE,wBAAiC,IAAI;QACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,QAAQ,IAAI,CAAC,EAAE;YACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAEhC,IAAI,CAAC,eAAe,EAAE,CAAC;YAEvB,IAAI,qBAAqB;gBACvB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,qCAAqC;IAC9B,OAAO,CAAC,OAAgB,EAAE,QAAgB;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,QAAQ,IAAI,CAAC,EAAE;YACjB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAE/B,IAAI,QAAQ,GAAG,QAAQ;gBACrB,QAAQ,EAAE,CAAC,CAAK,8CAA8C;YAEhE,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;SAC1C;QAED,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;IAEO,YAAY,CAAC,IAAa;QAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3C,IAAI,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBACzB,OAAO,CAAC,CAAC;SACZ;QACD,OAAO,CAAC,CAAC,CAAC;IACZ,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 Table\n */\n\nimport { Primitives, PropertyRecord, PropertyValueFormat, UiError } from \"@itwin/appui-abstract\";\nimport { SortDirection } from \"@itwin/core-react\";\nimport { TypeConverterManager } from \"../converters/TypeConverterManager\";\nimport { UiComponents } from \"../UiComponents\";\nimport { CompositeFilterDescriptorCollection, DistinctValueCollection, TableDistinctValue } from \"./columnfiltering/ColumnFiltering\";\nimport { ColumnDescription, MutableTableDataProvider, RowItem, TableDataChangeEvent } from \"./TableDataProvider\";\n\n// cSpell:ignore columnfiltering\n\n/**\n * A Table Data Provider using an array of items.\n * @public\n */\nexport class SimpleTableDataProvider implements MutableTableDataProvider {\n private _items: RowItem[];\n private _rowItemIndices: number[]; // Used for both filtering and sorting\n private _columns: ColumnDescription[];\n private _secondarySortColumnStack?: number[];\n private _sortDirection: SortDirection = SortDirection.NoSort;\n private _sortColumnIndex: number = -1;\n private _filterDescriptors?: CompositeFilterDescriptorCollection;\n\n /** Event emitted by the data provider when column data changes */\n public onColumnsChanged = new TableDataChangeEvent();\n /** Event emitted by the data provider when row data changes */\n public onRowsChanged = new TableDataChangeEvent();\n\n constructor(columns: ColumnDescription[]) {\n this._columns = columns;\n this._items = [];\n this._rowItemIndices = [];\n this._secondarySortColumnStack = [];\n }\n\n /** Sets the row items based on an array */\n public setItems(items: RowItem[]): void {\n this._items = items;\n this._rowItemIndices = [];\n this.resetRowIndices();\n this.onRowsChanged.raiseEvent();\n }\n\n private resetRowIndices(): void {\n this._rowItemIndices.splice(0);\n\n for (let rowIndex = 0; rowIndex < this._items.length; rowIndex++) {\n this._rowItemIndices.push(rowIndex);\n }\n }\n\n /** Retrieves the column descriptions */\n public async getColumns(): Promise<ColumnDescription[]> {\n return this._columns;\n }\n\n /** Retrieves the row count */\n public async getRowsCount(): Promise<number> {\n return this._rowItemIndices.length;\n }\n\n /** Retrieves a specific row by index */\n public async getRow(rowIndex: number, unfiltered?: boolean): Promise<RowItem> {\n let realRowIndex: number = -1;\n\n if (unfiltered) {\n // istanbul ignore else\n if (0 <= rowIndex && rowIndex < this._items.length)\n realRowIndex = rowIndex;\n } else {\n if (0 <= rowIndex && rowIndex < this._rowItemIndices.length)\n realRowIndex = this.getRowIndexFromFilteredRowIndex(rowIndex);\n }\n\n if (0 <= realRowIndex && realRowIndex < this._items.length)\n return this._items[realRowIndex];\n\n throw new UiError(UiComponents.loggerCategory(this), `getRow: Invalid row index - ${rowIndex}`);\n }\n\n private getRowIndexFromFilteredRowIndex(filteredRowIndex: number): number {\n // istanbul ignore next\n if (filteredRowIndex === undefined)\n return filteredRowIndex;\n\n // istanbul ignore next\n if (filteredRowIndex < 0 || filteredRowIndex >= this._rowItemIndices.length)\n return -1;\n\n return this._rowItemIndices[filteredRowIndex];\n }\n\n /** Sorts the rows based on the value in a specific column */\n public async sort(columnIndex: number, sortDirection: SortDirection): Promise<void> {\n // istanbul ignore next\n if (columnIndex < 0 || columnIndex >= this._columns.length)\n return;\n\n this._sortColumnIndex = columnIndex;\n this._sortDirection = sortDirection;\n\n if (sortDirection === SortDirection.NoSort) {\n if (this._filterDescriptors)\n await this.applyFilterDescriptors(this._filterDescriptors);\n else\n this.resetRowIndices();\n return;\n }\n\n this._secondarySortColumnStack = [];\n this._secondarySortColumnStack.push(columnIndex);\n\n // Sort by the column\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const dataProvider = this;\n this._rowItemIndices.sort((a: number, b: number) => {\n return dataProvider.sortDispatcher(dataProvider._items[a], dataProvider._items[b], columnIndex, sortDirection);\n });\n\n delete this._secondarySortColumnStack;\n\n return;\n }\n\n private sortDispatcher(a: RowItem, b: RowItem, columnIndex: number, sortDirection: SortDirection): number {\n let result = this.sortRows(a, b, columnIndex, sortDirection);\n\n if (result !== 0)\n return result;\n\n // Secondary sort column support\n // istanbul ignore else\n const column = this._columns[columnIndex];\n if (this._secondarySortColumnStack !== undefined &&\n column.secondarySortColumn !== undefined &&\n column.secondarySortColumn !== columnIndex &&\n this._secondarySortColumnStack.indexOf(column.secondarySortColumn) < 0) {\n\n this._secondarySortColumnStack.push(column.secondarySortColumn);\n result = this.sortDispatcher(a, b, column.secondarySortColumn, sortDirection);\n this._secondarySortColumnStack.pop();\n }\n\n return result;\n }\n\n private getPrimitiveValue(record: PropertyRecord) {\n let primitiveValue: Primitives.Value | undefined;\n const recordValue = record.value;\n // istanbul ignore else\n if (recordValue.valueFormat === PropertyValueFormat.Primitive)\n primitiveValue = recordValue.value;\n return primitiveValue;\n }\n\n private sortRows(a: RowItem, b: RowItem, columnIndex: number, sortDirection: SortDirection): number {\n const aCell = a.cells[columnIndex];\n const bCell = b.cells[columnIndex];\n\n let result: number = 0;\n const column = this._columns[columnIndex];\n\n const propertyDescription = column.propertyDescription;\n const valueA = this.getPrimitiveValue(aCell.record as PropertyRecord);\n const valueB = this.getPrimitiveValue(bCell.record as PropertyRecord);\n // istanbul ignore else\n if (valueA !== undefined && valueB !== undefined && propertyDescription)\n result = TypeConverterManager.getConverter(propertyDescription.typename, propertyDescription.converter?.name).sortCompare(valueA, valueB, column.sortIgnoreCase);\n\n if (sortDirection === SortDirection.Descending)\n result *= -1;\n\n return result;\n }\n\n /** Gets distinct values in a column\n * @public\n */\n public async getDistinctValues(columnKey: string, maximumValueCount?: number): Promise<DistinctValueCollection> {\n const distinctValues = new DistinctValueCollection();\n const columnIndex = this._columns.findIndex((description: ColumnDescription) => description.key === columnKey);\n if (columnIndex < 0 || columnIndex >= this._columns.length)\n return distinctValues;\n\n const columnDescription = this._columns[columnIndex];\n const propertyDescription = columnDescription.propertyDescription;\n const uniqueKeysMap: { [key: string]: TableDistinctValue } = {};\n const uniqueValues: any[] = [];\n\n // istanbul ignore next\n if (!propertyDescription)\n return distinctValues;\n\n for (const row of this._items) {\n const cell = row.cells[columnIndex];\n const record = cell.record;\n\n // istanbul ignore next\n if (record === undefined)\n continue;\n\n const value = this.getPrimitiveValue(record);\n const displayValue = await TypeConverterManager\n .getConverter(propertyDescription.typename, propertyDescription.converter?.name)\n .convertPropertyToString(propertyDescription, value);\n\n // istanbul ignore next\n if (value === undefined || typeof displayValue !== \"string\")\n continue;\n\n const valueKey = value.toString();\n if (!uniqueKeysMap.hasOwnProperty(valueKey)) {\n const propertyValue: TableDistinctValue = { value, label: displayValue };\n\n uniqueKeysMap[valueKey] = propertyValue;\n uniqueValues.push(propertyValue);\n }\n }\n\n distinctValues.values = uniqueValues;\n\n distinctValues.values.sort((a: TableDistinctValue, b: TableDistinctValue) => {\n if (a.value && b.value)\n return TypeConverterManager.getConverter(propertyDescription.typename, propertyDescription.converter?.name).sortCompare(a.value, b.value);\n return 0;\n });\n\n if (maximumValueCount !== undefined && distinctValues.values.length > maximumValueCount)\n distinctValues.values.splice(maximumValueCount);\n\n return distinctValues;\n }\n\n /** Apply a filter descriptor collection\n * @public\n */\n public async applyFilterDescriptors(filterDescriptors: CompositeFilterDescriptorCollection): Promise<void> {\n this._filterDescriptors = filterDescriptors;\n\n this._rowItemIndices.splice(0);\n\n this._items.forEach((row: RowItem, i: number) => {\n if (filterDescriptors.evaluateRow(row))\n this._rowItemIndices.push(i);\n });\n\n if (this._sortDirection !== SortDirection.NoSort) {\n await this.sort(this._sortColumnIndex, this._sortDirection);\n }\n }\n\n /** Adds a row to the end */\n public addRow(rowItem: RowItem): number {\n return this.insertRow(rowItem, -1);\n }\n\n /** Inserts a row at a given row index */\n public insertRow(rowItem: RowItem, index: number): number {\n let newIdx = index;\n\n if (index < 0 || index >= this._items.length)\n newIdx = this._items.push(rowItem) - 1;\n else\n this._items.splice(newIdx, 0, rowItem);\n\n this.resetRowIndices();\n this.onRowsChanged.raiseEvent();\n\n return newIdx;\n }\n\n /** Deletes a row */\n public deleteRow(rowItem: RowItem, raiseRowsChangedEvent: boolean = true): void {\n const rowIndex = this.findRowIndex(rowItem);\n if (rowIndex >= 0) {\n this._items.splice(rowIndex, 1);\n\n this.resetRowIndices();\n\n if (raiseRowsChangedEvent)\n this.onRowsChanged.raiseEvent();\n }\n }\n\n /** Moves a row to a new row index */\n public moveRow(rowItem: RowItem, newIndex: number): number {\n const oldIndex = this.findRowIndex(rowItem);\n if (oldIndex >= 0) {\n this.deleteRow(rowItem, false);\n\n if (newIndex > oldIndex)\n newIndex--; // removing the row will shrink the count by 1\n\n return this.insertRow(rowItem, newIndex);\n }\n\n return -1;\n }\n\n private findRowIndex(item: RowItem): number {\n for (let i = 0; i < this._items.length; i++) {\n if (item === this._items[i])\n return i;\n }\n return -1;\n }\n}\n"]}
1
+ {"version":3,"file":"SimpleTableDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/table/SimpleTableDataProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAA8B,mBAAmB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAuC,uBAAuB,EAAsB,MAAM,mCAAmC,CAAC;AACrI,OAAO,EAAwD,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEjH,gCAAgC;AAEhC;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAclC,YAAY,OAA4B;QAThC,mBAAc,GAAkB,aAAa,CAAC,MAAM,CAAC;QACrD,qBAAgB,GAAW,CAAC,CAAC,CAAC;QAGtC,kEAAkE;QAC3D,qBAAgB,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACrD,+DAA+D;QACxD,kBAAa,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAGhD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,eAAe,GAAG,EAAE,CAA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AC;IACZ,CAAC;IAEO,YAAY,CAAC,IAAa;QAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3C,IAAI,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBACzB,OAAO,CAAC,CAAC;SACZ;QACD,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Table\r\n */\r\n\r\nimport { Primitives, PropertyRecord, PropertyValueFormat, UiError } from \"@itwin/appui-abstract\";\r\nimport { SortDirection } from \"@itwin/core-react\";\r\nimport { TypeConverterManager } from \"../converters/TypeConverterManager\";\r\nimport { UiComponents } from \"../UiComponents\";\r\nimport { CompositeFilterDescriptorCollection, DistinctValueCollection, TableDistinctValue } from \"./columnfiltering/ColumnFiltering\";\r\nimport { ColumnDescription, MutableTableDataProvider, RowItem, TableDataChangeEvent } from \"./TableDataProvider\";\r\n\r\n// cSpell:ignore columnfiltering\r\n\r\n/**\r\n * A Table Data Provider using an array of items.\r\n * @public\r\n */\r\nexport class SimpleTableDataProvider implements MutableTableDataProvider {\r\n private _items: RowItem[];\r\n private _rowItemIndices: number[]; // Used for both filtering and sorting\r\n private _columns: ColumnDescription[];\r\n private _secondarySortColumnStack?: number[];\r\n private _sortDirection: SortDirection = SortDirection.NoSort;\r\n private _sortColumnIndex: number = -1;\r\n private _filterDescriptors?: CompositeFilterDescriptorCollection;\r\n\r\n /** Event emitted by the data provider when column data changes */\r\n public onColumnsChanged = new TableDataChangeEvent();\r\n /** Event emitted by the data provider when row data changes */\r\n public onRowsChanged = new TableDataChangeEvent();\r\n\r\n constructor(columns: ColumnDescription[]) {\r\n this._columns = columns;\r\n this._items = [];\r\n this._rowItemIndices = [];\r\n this._secondarySortColumnStack = [];\r\n }\r\n\r\n /** Sets the row items based on an array */\r\n public setItems(items: RowItem[]): void {\r\n this._items = items;\r\n this._rowItemIndices = [];\r\n this.resetRowIndices();\r\n this.onRowsChanged.raiseEvent();\r\n }\r\n\r\n private resetRowIndices(): void {\r\n this._rowItemIndices.splice(0);\r\n\r\n for (let rowIndex = 0; rowIndex < this._items.length; rowIndex++) {\r\n this._rowItemIndices.push(rowIndex);\r\n }\r\n }\r\n\r\n /** Retrieves the column descriptions */\r\n public async getColumns(): Promise<ColumnDescription[]> {\r\n return this._columns;\r\n }\r\n\r\n /** Retrieves the row count */\r\n public async getRowsCount(): Promise<number> {\r\n return this._rowItemIndices.length;\r\n }\r\n\r\n /** Retrieves a specific row by index */\r\n public async getRow(rowIndex: number, unfiltered?: boolean): Promise<RowItem> {\r\n let realRowIndex: number = -1;\r\n\r\n if (unfiltered) {\r\n // istanbul ignore else\r\n if (0 <= rowIndex && rowIndex < this._items.length)\r\n realRowIndex = rowIndex;\r\n } else {\r\n if (0 <= rowIndex && rowIndex < this._rowItemIndices.length)\r\n realRowIndex = this.getRowIndexFromFilteredRowIndex(rowIndex);\r\n }\r\n\r\n if (0 <= realRowIndex && realRowIndex < this._items.length)\r\n return this._items[realRowIndex];\r\n\r\n throw new UiError(UiComponents.loggerCategory(this), `getRow: Invalid row index - ${rowIndex}`);\r\n }\r\n\r\n private getRowIndexFromFilteredRowIndex(filteredRowIndex: number): number {\r\n // istanbul ignore next\r\n if (filteredRowIndex === undefined)\r\n return filteredRowIndex;\r\n\r\n // istanbul ignore next\r\n if (filteredRowIndex < 0 || filteredRowIndex >= this._rowItemIndices.length)\r\n return -1;\r\n\r\n return this._rowItemIndices[filteredRowIndex];\r\n }\r\n\r\n /** Sorts the rows based on the value in a specific column */\r\n public async sort(columnIndex: number, sortDirection: SortDirection): Promise<void> {\r\n // istanbul ignore next\r\n if (columnIndex < 0 || columnIndex >= this._columns.length)\r\n return;\r\n\r\n this._sortColumnIndex = columnIndex;\r\n this._sortDirection = sortDirection;\r\n\r\n if (sortDirection === SortDirection.NoSort) {\r\n if (this._filterDescriptors)\r\n await this.applyFilterDescriptors(this._filterDescriptors);\r\n else\r\n this.resetRowIndices();\r\n return;\r\n }\r\n\r\n this._secondarySortColumnStack = [];\r\n this._secondarySortColumnStack.push(columnIndex);\r\n\r\n // Sort by the column\r\n // eslint-disable-next-line @typescript-eslint/no-this-alias\r\n const dataProvider = this;\r\n this._rowItemIndices.sort((a: number, b: number) => {\r\n return dataProvider.sortDispatcher(dataProvider._items[a], dataProvider._items[b], columnIndex, sortDirection);\r\n });\r\n\r\n delete this._secondarySortColumnStack;\r\n\r\n return;\r\n }\r\n\r\n private sortDispatcher(a: RowItem, b: RowItem, columnIndex: number, sortDirection: SortDirection): number {\r\n let result = this.sortRows(a, b, columnIndex, sortDirection);\r\n\r\n if (result !== 0)\r\n return result;\r\n\r\n // Secondary sort column support\r\n // istanbul ignore else\r\n const column = this._columns[columnIndex];\r\n if (this._secondarySortColumnStack !== undefined &&\r\n column.secondarySortColumn !== undefined &&\r\n column.secondarySortColumn !== columnIndex &&\r\n this._secondarySortColumnStack.indexOf(column.secondarySortColumn) < 0) {\r\n\r\n this._secondarySortColumnStack.push(column.secondarySortColumn);\r\n result = this.sortDispatcher(a, b, column.secondarySortColumn, sortDirection);\r\n this._secondarySortColumnStack.pop();\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private getPrimitiveValue(record: PropertyRecord) {\r\n let primitiveValue: Primitives.Value | undefined;\r\n const recordValue = record.value;\r\n // istanbul ignore else\r\n if (recordValue.valueFormat === PropertyValueFormat.Primitive)\r\n primitiveValue = recordValue.value;\r\n return primitiveValue;\r\n }\r\n\r\n private sortRows(a: RowItem, b: RowItem, columnIndex: number, sortDirection: SortDirection): number {\r\n const aCell = a.cells[columnIndex];\r\n const bCell = b.cells[columnIndex];\r\n\r\n let result: number = 0;\r\n const column = this._columns[columnIndex];\r\n\r\n const propertyDescription = column.propertyDescription;\r\n const valueA = this.getPrimitiveValue(aCell.record as PropertyRecord);\r\n const valueB = this.getPrimitiveValue(bCell.record as PropertyRecord);\r\n // istanbul ignore else\r\n if (valueA !== undefined && valueB !== undefined && propertyDescription)\r\n result = TypeConverterManager.getConverter(propertyDescription.typename, propertyDescription.converter?.name).sortCompare(valueA, valueB, column.sortIgnoreCase);\r\n\r\n if (sortDirection === SortDirection.Descending)\r\n result *= -1;\r\n\r\n return result;\r\n }\r\n\r\n /** Gets distinct values in a column\r\n * @public\r\n */\r\n public async getDistinctValues(columnKey: string, maximumValueCount?: number): Promise<DistinctValueCollection> {\r\n const distinctValues = new DistinctValueCollection();\r\n const columnIndex = this._columns.findIndex((description: ColumnDescription) => description.key === columnKey);\r\n if (columnIndex < 0 || columnIndex >= this._columns.length)\r\n return distinctValues;\r\n\r\n const columnDescription = this._columns[columnIndex];\r\n const propertyDescription = columnDescription.propertyDescription;\r\n const uniqueKeysMap: { [key: string]: TableDistinctValue } = {};\r\n const uniqueValues: any[] = [];\r\n\r\n // istanbul ignore next\r\n if (!propertyDescription)\r\n return distinctValues;\r\n\r\n for (const row of this._items) {\r\n const cell = row.cells[columnIndex];\r\n const record = cell.record;\r\n\r\n // istanbul ignore next\r\n if (record === undefined)\r\n continue;\r\n\r\n const value = this.getPrimitiveValue(record);\r\n const displayValue = await TypeConverterManager\r\n .getConverter(propertyDescription.typename, propertyDescription.converter?.name)\r\n .convertPropertyToString(propertyDescription, value);\r\n\r\n // istanbul ignore next\r\n if (value === undefined || typeof displayValue !== \"string\")\r\n continue;\r\n\r\n const valueKey = value.toString();\r\n if (!uniqueKeysMap.hasOwnProperty(valueKey)) {\r\n const propertyValue: TableDistinctValue = { value, label: displayValue };\r\n\r\n uniqueKeysMap[valueKey] = propertyValue;\r\n uniqueValues.push(propertyValue);\r\n }\r\n }\r\n\r\n distinctValues.values = uniqueValues;\r\n\r\n distinctValues.values.sort((a: TableDistinctValue, b: TableDistinctValue) => {\r\n if (a.value && b.value)\r\n return TypeConverterManager.getConverter(propertyDescription.typename, propertyDescription.converter?.name).sortCompare(a.value, b.value);\r\n return 0;\r\n });\r\n\r\n if (maximumValueCount !== undefined && distinctValues.values.length > maximumValueCount)\r\n distinctValues.values.splice(maximumValueCount);\r\n\r\n return distinctValues;\r\n }\r\n\r\n /** Apply a filter descriptor collection\r\n * @public\r\n */\r\n public async applyFilterDescriptors(filterDescriptors: CompositeFilterDescriptorCollection): Promise<void> {\r\n this._filterDescriptors = filterDescriptors;\r\n\r\n this._rowItemIndices.splice(0);\r\n\r\n this._items.forEach((row: RowItem, i: number) => {\r\n if (filterDescriptors.evaluateRow(row))\r\n this._rowItemIndices.push(i);\r\n });\r\n\r\n if (this._sortDirection !== SortDirection.NoSort) {\r\n await this.sort(this._sortColumnIndex, this._sortDirection);\r\n }\r\n }\r\n\r\n /** Adds a row to the end */\r\n public addRow(rowItem: RowItem): number {\r\n return this.insertRow(rowItem, -1);\r\n }\r\n\r\n /** Inserts a row at a given row index */\r\n public insertRow(rowItem: RowItem, index: number): number {\r\n let newIdx = index;\r\n\r\n if (index < 0 || index >= this._items.length)\r\n newIdx = this._items.push(rowItem) - 1;\r\n else\r\n this._items.splice(newIdx, 0, rowItem);\r\n\r\n this.resetRowIndices();\r\n this.onRowsChanged.raiseEvent();\r\n\r\n return newIdx;\r\n }\r\n\r\n /** Deletes a row */\r\n public deleteRow(rowItem: RowItem, raiseRowsChangedEvent: boolean = true): void {\r\n const rowIndex = this.findRowIndex(rowItem);\r\n if (rowIndex >= 0) {\r\n this._items.splice(rowIndex, 1);\r\n\r\n this.resetRowIndices();\r\n\r\n if (raiseRowsChangedEvent)\r\n this.onRowsChanged.raiseEvent();\r\n }\r\n }\r\n\r\n /** Moves a row to a new row index */\r\n public moveRow(rowItem: RowItem, newIndex: number): number {\r\n const oldIndex = this.findRowIndex(rowItem);\r\n if (oldIndex >= 0) {\r\n this.deleteRow(rowItem, false);\r\n\r\n if (newIndex > oldIndex)\r\n newIndex--; // removing the row will shrink the count by 1\r\n\r\n return this.insertRow(rowItem, newIndex);\r\n }\r\n\r\n return -1;\r\n }\r\n\r\n private findRowIndex(item: RowItem): number {\r\n for (let i = 0; i < this._items.length; i++) {\r\n if (item === this._items[i])\r\n return i;\r\n }\r\n return -1;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TableDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/table/TableDataProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAM9C,gCAAgC;AAEhC;;GAEG;AACH,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yDAAW,CAAA;IACX,iEAAW,CAAA;IACX,mEAAY,CAAA;IACZ,mDAAI,CAAA;IACJ,+DAAU,CAAA;AACZ,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AA0GD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAiC;CAAI","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 Table\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { PropertyDescription, PropertyRecord } from \"@itwin/appui-abstract\";\nimport { HorizontalAlignment, SortDirection } from \"@itwin/core-react\";\nimport { ItemColorOverrides, ItemStyle } from \"../properties/ItemStyle\";\nimport { CompositeFilterDescriptorCollection, DistinctValueCollection } from \"./columnfiltering/ColumnFiltering\";\n\n// cSpell:ignore columnfiltering\n\n/** Filter Renderer for a Table column\n * @public\n */\nexport enum FilterRenderer {\n Numeric = 1,\n MultiSelect,\n SingleSelect,\n Text,\n MultiValue,\n}\n\n/**\n * Column definition provided to Table.\n * @public\n */\nexport interface ColumnDescription {\n /** A unique key for this column. */\n key: string;\n\n /** Column header label */\n label: string;\n /** Property description for all cells in the column */\n propertyDescription?: PropertyDescription;\n\n /** Preferred initial width of the column */\n width?: number;\n\n /** Indicates whether the cells in the column are editable. Defaults to false. */\n editable?: boolean;\n /** Indicates whether the column is resizable. Defaults to false. */\n resizable?: boolean;\n /** Indicates whether the display value for the cell is treated as an icon spec. Defaults to false. */\n icon?: boolean;\n\n /** Indicates whether the column is sortable. Defaults to false. */\n sortable?: boolean;\n /** Specifies a secondary sort column to use when cell values are the same. */\n secondarySortColumn?: number;\n /** Indicates whether the column sorting ignores case. Defaults to false. */\n sortIgnoreCase?: boolean;\n\n /** Indicates whether the column is filterable. Defaults to false. */\n filterable?: boolean;\n /** Specifies the filter renderer for the column. */\n filterRenderer?: FilterRenderer;\n\n /** Show field filters in Multi-Value column filtering popup. Defaults to true. */\n showFieldFilters?: boolean;\n /** Show distinct value checkboxes in Multi-Value column filtering popup. Defaults to true. */\n showDistinctValueFilters?: boolean;\n /** Filtering is case-sensitive in Multi-Value column filtering popup. Defaults to false. */\n filterCaseSensitive?: boolean;\n\n /** Sort type for react-table */\n sortType?: string;\n}\n\n/**\n * Cell definition provided to Table.\n * @public\n */\nexport interface CellItem {\n /** Key for the column containing the cell */\n key: string;\n /** Property record for the cell */\n record?: PropertyRecord;\n\n /** Indicates whether the cell is disabled */\n isDisabled?: boolean;\n /** Specifies the horizontal alignment of the contents of the cell */\n alignment?: HorizontalAlignment;\n\n /** Style properties for the contents of the cell */\n style?: ItemStyle;\n\n /**\n * Property to specify how many cells were merged to create this cell.\n * Default value is 1.\n * @alpha\n */\n mergedCellsCount?: number;\n}\n\n/**\n * Row definition provided to Table.\n * @public\n */\nexport interface RowItem {\n /** A unique key for this row */\n key: string;\n /** Array of cells in the row */\n cells: CellItem[];\n /** Indicates whether the row is disabled */\n isDisabled?: boolean;\n /** Color overrides for all cells in the row */\n colorOverrides?: ItemColorOverrides;\n\n /**\n * A key-value pairs data structure that can be used by data provider\n * to store some custom data for this node item.\n */\n extendedData?: { [key: string]: any };\n\n /**\n * Get the value from the cell for filtering purposes.\n * If not specified and the value is a primitive, the recordValue.value is returned.\n */\n getValueFromCell?: (columnKey: string) => any;\n}\n\n/** An interface table data change listeners\n * @public\n */\nexport declare type TableDataChangesListener = () => void;\n\n/** An event broadcasted on table data changes\n * @public\n */\nexport class TableDataChangeEvent extends BeEvent<TableDataChangesListener> { }\n\n/**\n * TableDataProvider provides data to the Table.\n * It also provides support for data Sorting & Filtering.\n * @public\n */\nexport interface TableDataProvider {\n /** Event emitted by the data provider when column data changes */\n onColumnsChanged: TableDataChangeEvent;\n /** Event emitted by the data provider when row data changes */\n onRowsChanged: TableDataChangeEvent;\n\n /** Retrieves the column descriptions */\n getColumns(): Promise<ColumnDescription[]>;\n /** Retrieves the row count */\n getRowsCount(): Promise<number>;\n /** Retrieves a specific row by index */\n getRow(rowIndex: number, unfiltered?: boolean): Promise<RowItem>;\n\n /** Sorts the rows based on the value in a specific column */\n sort(columnIndex: number, sortDirection: SortDirection): Promise<void>;\n\n // Column Filtering methods\n\n /** Apply a filter descriptor collection\n */\n applyFilterDescriptors?: (filterDescriptors: CompositeFilterDescriptorCollection) => Promise<void>;\n\n /** Gets distinct values in a column\n */\n getDistinctValues?: (columnKey: string, maximumValueCount?: number) => Promise<DistinctValueCollection>;\n\n /** Gets property display value expression\n * @alpha\n */\n getPropertyDisplayValueExpression?: (property: string) => string;\n}\n\n/**\n * MutableTableDataProvider provides mutation methods for data in the Table.\n * Useful for Drag & Drop processing.\n * @public\n */\nexport interface MutableTableDataProvider extends TableDataProvider {\n /** Adds a row to the end */\n addRow(rowItem: RowItem): number;\n /** Inserts a row at a given row index */\n insertRow(rowItem: RowItem, index: number): number;\n /** Deletes a row */\n deleteRow(rowItem: RowItem): void;\n /** Moves a row to a new row index */\n moveRow(rowItem: RowItem, newIndex: number): number;\n}\n"]}
1
+ {"version":3,"file":"TableDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/table/TableDataProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAM9C,gCAAgC;AAEhC;;GAEG;AACH,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yDAAW,CAAA;IACX,iEAAW,CAAA;IACX,mEAAY,CAAA;IACZ,mDAAI,CAAA;IACJ,+DAAU,CAAA;AACZ,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AA0GD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAiC;CAAI","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Table\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { PropertyDescription, PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { HorizontalAlignment, SortDirection } from \"@itwin/core-react\";\r\nimport { ItemColorOverrides, ItemStyle } from \"../properties/ItemStyle\";\r\nimport { CompositeFilterDescriptorCollection, DistinctValueCollection } from \"./columnfiltering/ColumnFiltering\";\r\n\r\n// cSpell:ignore columnfiltering\r\n\r\n/** Filter Renderer for a Table column\r\n * @public\r\n */\r\nexport enum FilterRenderer {\r\n Numeric = 1,\r\n MultiSelect,\r\n SingleSelect,\r\n Text,\r\n MultiValue,\r\n}\r\n\r\n/**\r\n * Column definition provided to Table.\r\n * @public\r\n */\r\nexport interface ColumnDescription {\r\n /** A unique key for this column. */\r\n key: string;\r\n\r\n /** Column header label */\r\n label: string;\r\n /** Property description for all cells in the column */\r\n propertyDescription?: PropertyDescription;\r\n\r\n /** Preferred initial width of the column */\r\n width?: number;\r\n\r\n /** Indicates whether the cells in the column are editable. Defaults to false. */\r\n editable?: boolean;\r\n /** Indicates whether the column is resizable. Defaults to false. */\r\n resizable?: boolean;\r\n /** Indicates whether the display value for the cell is treated as an icon spec. Defaults to false. */\r\n icon?: boolean;\r\n\r\n /** Indicates whether the column is sortable. Defaults to false. */\r\n sortable?: boolean;\r\n /** Specifies a secondary sort column to use when cell values are the same. */\r\n secondarySortColumn?: number;\r\n /** Indicates whether the column sorting ignores case. Defaults to false. */\r\n sortIgnoreCase?: boolean;\r\n\r\n /** Indicates whether the column is filterable. Defaults to false. */\r\n filterable?: boolean;\r\n /** Specifies the filter renderer for the column. */\r\n filterRenderer?: FilterRenderer;\r\n\r\n /** Show field filters in Multi-Value column filtering popup. Defaults to true. */\r\n showFieldFilters?: boolean;\r\n /** Show distinct value checkboxes in Multi-Value column filtering popup. Defaults to true. */\r\n showDistinctValueFilters?: boolean;\r\n /** Filtering is case-sensitive in Multi-Value column filtering popup. Defaults to false. */\r\n filterCaseSensitive?: boolean;\r\n\r\n /** Sort type for react-table */\r\n sortType?: string;\r\n}\r\n\r\n/**\r\n * Cell definition provided to Table.\r\n * @public\r\n */\r\nexport interface CellItem {\r\n /** Key for the column containing the cell */\r\n key: string;\r\n /** Property record for the cell */\r\n record?: PropertyRecord;\r\n\r\n /** Indicates whether the cell is disabled */\r\n isDisabled?: boolean;\r\n /** Specifies the horizontal alignment of the contents of the cell */\r\n alignment?: HorizontalAlignment;\r\n\r\n /** Style properties for the contents of the cell */\r\n style?: ItemStyle;\r\n\r\n /**\r\n * Property to specify how many cells were merged to create this cell.\r\n * Default value is 1.\r\n * @alpha\r\n */\r\n mergedCellsCount?: number;\r\n}\r\n\r\n/**\r\n * Row definition provided to Table.\r\n * @public\r\n */\r\nexport interface RowItem {\r\n /** A unique key for this row */\r\n key: string;\r\n /** Array of cells in the row */\r\n cells: CellItem[];\r\n /** Indicates whether the row is disabled */\r\n isDisabled?: boolean;\r\n /** Color overrides for all cells in the row */\r\n colorOverrides?: ItemColorOverrides;\r\n\r\n /**\r\n * A key-value pairs data structure that can be used by data provider\r\n * to store some custom data for this node item.\r\n */\r\n extendedData?: { [key: string]: any };\r\n\r\n /**\r\n * Get the value from the cell for filtering purposes.\r\n * If not specified and the value is a primitive, the recordValue.value is returned.\r\n */\r\n getValueFromCell?: (columnKey: string) => any;\r\n}\r\n\r\n/** An interface table data change listeners\r\n * @public\r\n */\r\nexport declare type TableDataChangesListener = () => void;\r\n\r\n/** An event broadcasted on table data changes\r\n * @public\r\n */\r\nexport class TableDataChangeEvent extends BeEvent<TableDataChangesListener> { }\r\n\r\n/**\r\n * TableDataProvider provides data to the Table.\r\n * It also provides support for data Sorting & Filtering.\r\n * @public\r\n */\r\nexport interface TableDataProvider {\r\n /** Event emitted by the data provider when column data changes */\r\n onColumnsChanged: TableDataChangeEvent;\r\n /** Event emitted by the data provider when row data changes */\r\n onRowsChanged: TableDataChangeEvent;\r\n\r\n /** Retrieves the column descriptions */\r\n getColumns(): Promise<ColumnDescription[]>;\r\n /** Retrieves the row count */\r\n getRowsCount(): Promise<number>;\r\n /** Retrieves a specific row by index */\r\n getRow(rowIndex: number, unfiltered?: boolean): Promise<RowItem>;\r\n\r\n /** Sorts the rows based on the value in a specific column */\r\n sort(columnIndex: number, sortDirection: SortDirection): Promise<void>;\r\n\r\n // Column Filtering methods\r\n\r\n /** Apply a filter descriptor collection\r\n */\r\n applyFilterDescriptors?: (filterDescriptors: CompositeFilterDescriptorCollection) => Promise<void>;\r\n\r\n /** Gets distinct values in a column\r\n */\r\n getDistinctValues?: (columnKey: string, maximumValueCount?: number) => Promise<DistinctValueCollection>;\r\n\r\n /** Gets property display value expression\r\n * @alpha\r\n */\r\n getPropertyDisplayValueExpression?: (property: string) => string;\r\n}\r\n\r\n/**\r\n * MutableTableDataProvider provides mutation methods for data in the Table.\r\n * Useful for Drag & Drop processing.\r\n * @public\r\n */\r\nexport interface MutableTableDataProvider extends TableDataProvider {\r\n /** Adds a row to the end */\r\n addRow(rowItem: RowItem): number;\r\n /** Inserts a row at a given row index */\r\n insertRow(rowItem: RowItem, index: number): number;\r\n /** Deletes a row */\r\n deleteRow(rowItem: RowItem): void;\r\n /** Moves a row to a new row index */\r\n moveRow(rowItem: RowItem, newIndex: number): number;\r\n}\r\n"]}