@itwin/components-react 3.6.0-dev.8 → 3.6.1

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 (383) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/LICENSE.md +1 -1
  3. package/lib/cjs/components-react/breadcrumb/Breadcrumb.d.ts +5 -5
  4. package/lib/cjs/components-react/breadcrumb/Breadcrumb.js +3 -3
  5. package/lib/cjs/components-react/breadcrumb/Breadcrumb.js.map +1 -1
  6. package/lib/cjs/components-react/breadcrumb/BreadcrumbDetails.d.ts +2 -2
  7. package/lib/cjs/components-react/breadcrumb/BreadcrumbDetails.js +1 -1
  8. package/lib/cjs/components-react/breadcrumb/BreadcrumbDetails.js.map +1 -1
  9. package/lib/cjs/components-react/breadcrumb/BreadcrumbPath.d.ts +3 -3
  10. package/lib/cjs/components-react/breadcrumb/BreadcrumbPath.js +2 -2
  11. package/lib/cjs/components-react/breadcrumb/BreadcrumbPath.js.map +1 -1
  12. package/lib/cjs/components-react/breadcrumb/BreadcrumbTreeUtils.d.ts +1 -1
  13. package/lib/cjs/components-react/breadcrumb/BreadcrumbTreeUtils.js +1 -1
  14. package/lib/cjs/components-react/breadcrumb/BreadcrumbTreeUtils.js.map +1 -1
  15. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.d.ts +4 -1
  16. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.d.ts.map +1 -1
  17. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js +4 -1
  18. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  19. package/lib/cjs/components-react/common/showhide/ShowHideDialog.d.ts +2 -2
  20. package/lib/cjs/components-react/common/showhide/ShowHideDialog.js +1 -1
  21. package/lib/cjs/components-react/common/showhide/ShowHideDialog.js.map +1 -1
  22. package/lib/cjs/components-react/common/showhide/ShowHideItem.d.ts +2 -2
  23. package/lib/cjs/components-react/common/showhide/ShowHideItem.js.map +1 -1
  24. package/lib/cjs/components-react/common/showhide/ShowHideMenu.d.ts +2 -2
  25. package/lib/cjs/components-react/common/showhide/ShowHideMenu.js +1 -1
  26. package/lib/cjs/components-react/common/showhide/ShowHideMenu.js.map +1 -1
  27. package/lib/cjs/components-react/converters/TypeConverterManager.d.ts.map +1 -1
  28. package/lib/cjs/components-react/converters/TypeConverterManager.js +3 -4
  29. package/lib/cjs/components-react/converters/TypeConverterManager.js.map +1 -1
  30. package/lib/cjs/components-react/editors/ThemedEnumEditor.d.ts +3 -3
  31. package/lib/cjs/components-react/editors/ThemedEnumEditor.js +2 -2
  32. package/lib/cjs/components-react/editors/ThemedEnumEditor.js.map +1 -1
  33. package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts +22 -24
  34. package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts.map +1 -1
  35. package/lib/cjs/components-react/filter-builder/FilterBuilder.js +24 -83
  36. package/lib/cjs/components-react/filter-builder/FilterBuilder.js.map +1 -1
  37. package/lib/cjs/components-react/filter-builder/FilterBuilderContext.d.ts +80 -0
  38. package/lib/cjs/components-react/filter-builder/FilterBuilderContext.d.ts.map +1 -0
  39. package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js +83 -0
  40. package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js.map +1 -0
  41. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts +14 -3
  42. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
  43. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js +22 -12
  44. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
  45. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +4 -0
  46. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +25 -16
  47. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
  48. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js +22 -14
  49. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
  50. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +14 -2
  51. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -1
  52. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js +11 -5
  53. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  54. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +16 -2
  55. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
  56. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +11 -5
  57. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
  58. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts +14 -2
  59. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
  60. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +11 -5
  61. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  62. package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts +52 -8
  63. package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -1
  64. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js +102 -12
  65. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  66. package/lib/cjs/components-react/filter-builder/Operators.d.ts +23 -5
  67. package/lib/cjs/components-react/filter-builder/Operators.d.ts.map +1 -1
  68. package/lib/cjs/components-react/filter-builder/Operators.js +25 -7
  69. package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
  70. package/lib/cjs/components-react/filter-builder/Types.d.ts +24 -4
  71. package/lib/cjs/components-react/filter-builder/Types.d.ts.map +1 -1
  72. package/lib/cjs/components-react/filter-builder/Types.js +11 -1
  73. package/lib/cjs/components-react/filter-builder/Types.js.map +1 -1
  74. package/lib/cjs/components-react/filtering/FilteringInput.js +1 -1
  75. package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
  76. package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts +2 -2
  77. package/lib/cjs/components-react/iconpicker/IconPickerButton.js +2 -2
  78. package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
  79. package/lib/cjs/components-react/properties/LinkHandler.d.ts +2 -2
  80. package/lib/cjs/components-react/properties/LinkHandler.js +1 -1
  81. package/lib/cjs/components-react/properties/LinkHandler.js.map +1 -1
  82. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.d.ts +3 -3
  83. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -1
  84. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  85. package/lib/cjs/components-react/propertygrid/PropertyDataProvider.d.ts +2 -2
  86. package/lib/cjs/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
  87. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.d.ts +3 -1
  88. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.d.ts.map +1 -1
  89. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js +1 -0
  90. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
  91. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts +5 -10
  92. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
  93. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  94. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +3 -3
  95. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
  96. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  97. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +11 -0
  98. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +2 -2
  99. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js +1 -1
  100. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  101. package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.d.ts +2 -2
  102. package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js +1 -1
  103. package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
  104. package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.d.ts +3 -3
  105. package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js +3 -3
  106. package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
  107. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.d.ts +3 -3
  108. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js +1 -1
  109. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
  110. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.d.ts +2 -2
  111. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js +1 -1
  112. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
  113. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.d.ts +2 -2
  114. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.d.ts.map +1 -1
  115. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js +1 -1
  116. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
  117. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts +6 -6
  118. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts.map +1 -1
  119. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
  120. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts +1 -1
  121. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +1 -1
  122. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
  123. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.d.ts +1 -1
  124. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js +1 -1
  125. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
  126. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.d.ts +1 -1
  127. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js +1 -1
  128. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
  129. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts +10 -10
  130. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +3 -3
  131. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  132. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.d.ts +2 -2
  133. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +1 -1
  134. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  135. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.d.ts +2 -2
  136. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  137. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  138. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +3 -6
  139. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  140. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  141. package/lib/cjs/components-react/table/SimpleTableDataProvider.d.ts +1 -1
  142. package/lib/cjs/components-react/table/SimpleTableDataProvider.js +1 -1
  143. package/lib/cjs/components-react/table/SimpleTableDataProvider.js.map +1 -1
  144. package/lib/cjs/components-react/table/TableDataProvider.d.ts +8 -8
  145. package/lib/cjs/components-react/table/TableDataProvider.js +2 -2
  146. package/lib/cjs/components-react/table/TableDataProvider.js.map +1 -1
  147. package/lib/cjs/components-react/table/columnfiltering/ColumnFiltering.d.ts +16 -16
  148. package/lib/cjs/components-react/table/columnfiltering/ColumnFiltering.js +6 -6
  149. package/lib/cjs/components-react/table/columnfiltering/ColumnFiltering.js.map +1 -1
  150. package/lib/cjs/components-react/table/component/ColumnDragLayer.d.ts +1 -1
  151. package/lib/cjs/components-react/table/component/ColumnDragLayer.js +1 -1
  152. package/lib/cjs/components-react/table/component/ColumnDragLayer.js.map +1 -1
  153. package/lib/cjs/components-react/table/component/Table.d.ts +9 -9
  154. package/lib/cjs/components-react/table/component/Table.d.ts.map +1 -1
  155. package/lib/cjs/components-react/table/component/Table.js +2 -2
  156. package/lib/cjs/components-react/table/component/Table.js.map +1 -1
  157. package/lib/cjs/components-react/table/component/TableCell.d.ts +6 -6
  158. package/lib/cjs/components-react/table/component/TableCell.js +3 -3
  159. package/lib/cjs/components-react/table/component/TableCell.js.map +1 -1
  160. package/lib/cjs/components-react/table/component/TableColumn.d.ts +1 -1
  161. package/lib/cjs/components-react/table/component/TableColumn.js.map +1 -1
  162. package/lib/cjs/components-react/table/component/dragdrop/BeDragDropContext.d.ts +1 -1
  163. package/lib/cjs/components-react/table/component/dragdrop/BeDragDropContext.js +1 -1
  164. package/lib/cjs/components-react/table/component/dragdrop/BeDragDropContext.js.map +1 -1
  165. package/lib/cjs/components-react/table/component/dragdrop/DragDropDef.d.ts +8 -8
  166. package/lib/cjs/components-react/table/component/dragdrop/DragDropDef.js +2 -2
  167. package/lib/cjs/components-react/table/component/dragdrop/DragDropDef.js.map +1 -1
  168. package/lib/cjs/components-react/table/component/dragdrop/withDragSource.d.ts +2 -2
  169. package/lib/cjs/components-react/table/component/dragdrop/withDragSource.js +1 -1
  170. package/lib/cjs/components-react/table/component/dragdrop/withDragSource.js.map +1 -1
  171. package/lib/cjs/components-react/table/component/dragdrop/withDropTarget.d.ts +2 -2
  172. package/lib/cjs/components-react/table/component/dragdrop/withDropTarget.js +1 -1
  173. package/lib/cjs/components-react/table/component/dragdrop/withDropTarget.js.map +1 -1
  174. package/lib/cjs/components-react/toolbar/Toolbar.d.ts +1 -1
  175. package/lib/cjs/components-react/toolbar/Toolbar.d.ts.map +1 -1
  176. package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
  177. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +2 -2
  178. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  179. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  180. package/lib/cjs/components-react/tree/TreeDataProvider.d.ts +2 -2
  181. package/lib/cjs/components-react/tree/TreeDataProvider.d.ts.map +1 -1
  182. package/lib/cjs/components-react/tree/TreeDataProvider.js.map +1 -1
  183. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts +1 -4
  184. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  185. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  186. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.d.ts +2 -5
  187. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.d.ts.map +1 -1
  188. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  189. package/lib/cjs/components-react.d.ts +4 -6
  190. package/lib/cjs/components-react.d.ts.map +1 -1
  191. package/lib/cjs/components-react.js +4 -6
  192. package/lib/cjs/components-react.js.map +1 -1
  193. package/lib/esm/components-react/breadcrumb/Breadcrumb.d.ts +5 -5
  194. package/lib/esm/components-react/breadcrumb/Breadcrumb.js +3 -3
  195. package/lib/esm/components-react/breadcrumb/Breadcrumb.js.map +1 -1
  196. package/lib/esm/components-react/breadcrumb/BreadcrumbDetails.d.ts +2 -2
  197. package/lib/esm/components-react/breadcrumb/BreadcrumbDetails.js +1 -1
  198. package/lib/esm/components-react/breadcrumb/BreadcrumbDetails.js.map +1 -1
  199. package/lib/esm/components-react/breadcrumb/BreadcrumbPath.d.ts +3 -3
  200. package/lib/esm/components-react/breadcrumb/BreadcrumbPath.js +2 -2
  201. package/lib/esm/components-react/breadcrumb/BreadcrumbPath.js.map +1 -1
  202. package/lib/esm/components-react/breadcrumb/BreadcrumbTreeUtils.d.ts +1 -1
  203. package/lib/esm/components-react/breadcrumb/BreadcrumbTreeUtils.js +1 -1
  204. package/lib/esm/components-react/breadcrumb/BreadcrumbTreeUtils.js.map +1 -1
  205. package/lib/esm/components-react/common/UseDebouncedAsyncValue.d.ts +4 -1
  206. package/lib/esm/components-react/common/UseDebouncedAsyncValue.d.ts.map +1 -1
  207. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js +4 -1
  208. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  209. package/lib/esm/components-react/common/showhide/ShowHideDialog.d.ts +2 -2
  210. package/lib/esm/components-react/common/showhide/ShowHideDialog.js +1 -1
  211. package/lib/esm/components-react/common/showhide/ShowHideDialog.js.map +1 -1
  212. package/lib/esm/components-react/common/showhide/ShowHideItem.d.ts +2 -2
  213. package/lib/esm/components-react/common/showhide/ShowHideItem.js.map +1 -1
  214. package/lib/esm/components-react/common/showhide/ShowHideMenu.d.ts +2 -2
  215. package/lib/esm/components-react/common/showhide/ShowHideMenu.js +1 -1
  216. package/lib/esm/components-react/common/showhide/ShowHideMenu.js.map +1 -1
  217. package/lib/esm/components-react/converters/TypeConverterManager.d.ts.map +1 -1
  218. package/lib/esm/components-react/converters/TypeConverterManager.js +3 -4
  219. package/lib/esm/components-react/converters/TypeConverterManager.js.map +1 -1
  220. package/lib/esm/components-react/editors/ThemedEnumEditor.d.ts +3 -3
  221. package/lib/esm/components-react/editors/ThemedEnumEditor.js +2 -2
  222. package/lib/esm/components-react/editors/ThemedEnumEditor.js.map +1 -1
  223. package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts +22 -24
  224. package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts.map +1 -1
  225. package/lib/esm/components-react/filter-builder/FilterBuilder.js +17 -75
  226. package/lib/esm/components-react/filter-builder/FilterBuilder.js.map +1 -1
  227. package/lib/esm/components-react/filter-builder/FilterBuilderContext.d.ts +80 -0
  228. package/lib/esm/components-react/filter-builder/FilterBuilderContext.d.ts.map +1 -0
  229. package/lib/esm/components-react/filter-builder/FilterBuilderContext.js +60 -0
  230. package/lib/esm/components-react/filter-builder/FilterBuilderContext.js.map +1 -0
  231. package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts +14 -3
  232. package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
  233. package/lib/esm/components-react/filter-builder/FilterBuilderRule.js +17 -7
  234. package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
  235. package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +4 -0
  236. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +25 -16
  237. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
  238. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js +15 -7
  239. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
  240. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +14 -2
  241. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -1
  242. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js +7 -1
  243. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  244. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +16 -2
  245. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
  246. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +7 -1
  247. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
  248. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts +14 -2
  249. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
  250. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +7 -1
  251. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  252. package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts +52 -8
  253. package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -1
  254. package/lib/esm/components-react/filter-builder/FilterBuilderState.js +96 -7
  255. package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  256. package/lib/esm/components-react/filter-builder/Operators.d.ts +23 -5
  257. package/lib/esm/components-react/filter-builder/Operators.d.ts.map +1 -1
  258. package/lib/esm/components-react/filter-builder/Operators.js +23 -5
  259. package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
  260. package/lib/esm/components-react/filter-builder/Types.d.ts +24 -4
  261. package/lib/esm/components-react/filter-builder/Types.d.ts.map +1 -1
  262. package/lib/esm/components-react/filter-builder/Types.js +11 -1
  263. package/lib/esm/components-react/filter-builder/Types.js.map +1 -1
  264. package/lib/esm/components-react/filtering/FilteringInput.js +1 -1
  265. package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
  266. package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts +2 -2
  267. package/lib/esm/components-react/iconpicker/IconPickerButton.js +2 -2
  268. package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
  269. package/lib/esm/components-react/properties/LinkHandler.d.ts +2 -2
  270. package/lib/esm/components-react/properties/LinkHandler.js +1 -1
  271. package/lib/esm/components-react/properties/LinkHandler.js.map +1 -1
  272. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.d.ts +3 -3
  273. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -1
  274. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  275. package/lib/esm/components-react/propertygrid/PropertyDataProvider.d.ts +2 -2
  276. package/lib/esm/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
  277. package/lib/esm/components-react/propertygrid/component/PropertyGrid.d.ts +3 -1
  278. package/lib/esm/components-react/propertygrid/component/PropertyGrid.d.ts.map +1 -1
  279. package/lib/esm/components-react/propertygrid/component/PropertyGrid.js +1 -0
  280. package/lib/esm/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
  281. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts +5 -10
  282. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
  283. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  284. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +3 -3
  285. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
  286. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  287. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +11 -0
  288. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +2 -2
  289. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js +1 -1
  290. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  291. package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.d.ts +2 -2
  292. package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js +1 -1
  293. package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
  294. package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.d.ts +3 -3
  295. package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js +3 -3
  296. package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
  297. package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.d.ts +3 -3
  298. package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js +1 -1
  299. package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
  300. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.d.ts +2 -2
  301. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js +1 -1
  302. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
  303. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.d.ts +2 -2
  304. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.d.ts.map +1 -1
  305. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js +1 -1
  306. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
  307. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts +6 -6
  308. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts.map +1 -1
  309. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
  310. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts +1 -1
  311. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +1 -1
  312. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
  313. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.d.ts +1 -1
  314. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js +1 -1
  315. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
  316. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.d.ts +1 -1
  317. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js +1 -1
  318. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
  319. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts +10 -10
  320. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +3 -3
  321. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  322. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.d.ts +2 -2
  323. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +1 -1
  324. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  325. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.d.ts +2 -2
  326. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  327. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  328. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +3 -6
  329. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  330. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  331. package/lib/esm/components-react/table/SimpleTableDataProvider.d.ts +1 -1
  332. package/lib/esm/components-react/table/SimpleTableDataProvider.js +1 -1
  333. package/lib/esm/components-react/table/SimpleTableDataProvider.js.map +1 -1
  334. package/lib/esm/components-react/table/TableDataProvider.d.ts +8 -8
  335. package/lib/esm/components-react/table/TableDataProvider.js +2 -2
  336. package/lib/esm/components-react/table/TableDataProvider.js.map +1 -1
  337. package/lib/esm/components-react/table/columnfiltering/ColumnFiltering.d.ts +16 -16
  338. package/lib/esm/components-react/table/columnfiltering/ColumnFiltering.js +6 -6
  339. package/lib/esm/components-react/table/columnfiltering/ColumnFiltering.js.map +1 -1
  340. package/lib/esm/components-react/table/component/ColumnDragLayer.d.ts +1 -1
  341. package/lib/esm/components-react/table/component/ColumnDragLayer.js +1 -1
  342. package/lib/esm/components-react/table/component/ColumnDragLayer.js.map +1 -1
  343. package/lib/esm/components-react/table/component/Table.d.ts +9 -9
  344. package/lib/esm/components-react/table/component/Table.d.ts.map +1 -1
  345. package/lib/esm/components-react/table/component/Table.js +2 -2
  346. package/lib/esm/components-react/table/component/Table.js.map +1 -1
  347. package/lib/esm/components-react/table/component/TableCell.d.ts +6 -6
  348. package/lib/esm/components-react/table/component/TableCell.js +3 -3
  349. package/lib/esm/components-react/table/component/TableCell.js.map +1 -1
  350. package/lib/esm/components-react/table/component/TableColumn.d.ts +1 -1
  351. package/lib/esm/components-react/table/component/TableColumn.js.map +1 -1
  352. package/lib/esm/components-react/table/component/dragdrop/BeDragDropContext.d.ts +1 -1
  353. package/lib/esm/components-react/table/component/dragdrop/BeDragDropContext.js +1 -1
  354. package/lib/esm/components-react/table/component/dragdrop/BeDragDropContext.js.map +1 -1
  355. package/lib/esm/components-react/table/component/dragdrop/DragDropDef.d.ts +8 -8
  356. package/lib/esm/components-react/table/component/dragdrop/DragDropDef.js +2 -2
  357. package/lib/esm/components-react/table/component/dragdrop/DragDropDef.js.map +1 -1
  358. package/lib/esm/components-react/table/component/dragdrop/withDragSource.d.ts +2 -2
  359. package/lib/esm/components-react/table/component/dragdrop/withDragSource.js +1 -1
  360. package/lib/esm/components-react/table/component/dragdrop/withDragSource.js.map +1 -1
  361. package/lib/esm/components-react/table/component/dragdrop/withDropTarget.d.ts +2 -2
  362. package/lib/esm/components-react/table/component/dragdrop/withDropTarget.js +1 -1
  363. package/lib/esm/components-react/table/component/dragdrop/withDropTarget.js.map +1 -1
  364. package/lib/esm/components-react/toolbar/Toolbar.d.ts +1 -1
  365. package/lib/esm/components-react/toolbar/Toolbar.d.ts.map +1 -1
  366. package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
  367. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +2 -2
  368. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  369. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  370. package/lib/esm/components-react/tree/TreeDataProvider.d.ts +2 -2
  371. package/lib/esm/components-react/tree/TreeDataProvider.d.ts.map +1 -1
  372. package/lib/esm/components-react/tree/TreeDataProvider.js.map +1 -1
  373. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts +1 -4
  374. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  375. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  376. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.d.ts +2 -5
  377. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.d.ts.map +1 -1
  378. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  379. package/lib/esm/components-react.d.ts +4 -6
  380. package/lib/esm/components-react.d.ts.map +1 -1
  381. package/lib/esm/components-react.js +4 -6
  382. package/lib/esm/components-react.js.map +1 -1
  383. package/package.json +23 -13
@@ -8,7 +8,7 @@ import { PropertyCategory } from "../../PropertyDataProvider";
8
8
  * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.
9
9
  * Category for PropertyCategory
10
10
  * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)
11
- * @beta
11
+ * @public
12
12
  */
13
13
  export declare enum FlatGridItemType {
14
14
  Category = 0,
@@ -18,12 +18,12 @@ export declare enum FlatGridItemType {
18
18
  }
19
19
  /**
20
20
  * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties
21
- * @beta
21
+ * @public
22
22
  */
23
23
  export declare type CategorizedPropertyTypes = FlatGridItemType.Array | FlatGridItemType.Primitive | FlatGridItemType.Struct;
24
24
  /**
25
25
  * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems
26
- * @beta
26
+ * @public
27
27
  */
28
28
  export interface IMutableFlatPropertyGridItem {
29
29
  readonly type: FlatGridItemType;
@@ -43,7 +43,7 @@ export interface IMutableFlatPropertyGridItem {
43
43
  }
44
44
  /**
45
45
  * Base class for all FlatPropertyGrid items
46
- * @beta
46
+ * @public
47
47
  */
48
48
  export declare abstract class MutableFlatPropertyGridItem implements IMutableFlatPropertyGridItem {
49
49
  private _depth;
@@ -97,7 +97,7 @@ export declare abstract class MutableFlatPropertyGridItem implements IMutableFla
97
97
  }
98
98
  /**
99
99
  * Data structure which describes methods and properties to be held by Mutable GridCategoryItems
100
- * @beta
100
+ * @public
101
101
  */
102
102
  export interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {
103
103
  type: FlatGridItemType.Category;
@@ -105,17 +105,17 @@ export interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {
105
105
  derivedCategory: PropertyCategory;
106
106
  isRootCategory: boolean;
107
107
  /**
108
- * @deprecated Use [[getChildren]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.
108
+ * @deprecated in 3.1. Use [[getChildren]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.
109
109
  */
110
110
  getChildCategories(): IMutableGridCategoryItem[];
111
111
  /**
112
- * @deprecated Use [[getDescendantsAndSelf]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.
112
+ * @deprecated in 3.1. Use [[getDescendantsAndSelf]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.
113
113
  */
114
114
  getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[];
115
115
  }
116
116
  /**
117
117
  * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems
118
- * @beta
118
+ * @public
119
119
  */
120
120
  export interface IMutableCategorizedPropertyItem extends IMutableFlatPropertyGridItem {
121
121
  readonly type: CategorizedPropertyTypes;
@@ -126,12 +126,12 @@ export interface IMutableCategorizedPropertyItem extends IMutableFlatPropertyGri
126
126
  }
127
127
  /**
128
128
  * Type which describes mutable GridCategoryItem or CategorizedProperty
129
- * @beta
129
+ * @public
130
130
  */
131
131
  export declare type IMutableFlatGridItem = IMutableCategorizedPropertyItem | IMutableGridCategoryItem;
132
132
  /**
133
133
  * Base class for all Mutable CategorizedProperties
134
- * @beta
134
+ * @public
135
135
  */
136
136
  export declare abstract class MutableCategorizedProperty extends MutableFlatPropertyGridItem implements Partial<IMutableCategorizedPropertyItem> {
137
137
  private _derivedRecord;
@@ -13,7 +13,7 @@ import { PropertyRecord, PropertyValueFormat } from "@itwin/appui-abstract";
13
13
  * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.
14
14
  * Category for PropertyCategory
15
15
  * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)
16
- * @beta
16
+ * @public
17
17
  */
18
18
  export var FlatGridItemType;
19
19
  (function (FlatGridItemType) {
@@ -24,7 +24,7 @@ export var FlatGridItemType;
24
24
  })(FlatGridItemType || (FlatGridItemType = {}));
25
25
  /**
26
26
  * Base class for all FlatPropertyGrid items
27
- * @beta
27
+ * @public
28
28
  */
29
29
  export class MutableFlatPropertyGridItem {
30
30
  constructor(_depth, _parentSelectionKey, _parentCategorySelectionKey) {
@@ -127,7 +127,7 @@ export class MutableFlatPropertyGridItem {
127
127
  _a = immerable;
128
128
  /**
129
129
  * Base class for all Mutable CategorizedProperties
130
- * @beta
130
+ * @public
131
131
  */
132
132
  export class MutableCategorizedProperty extends MutableFlatPropertyGridItem {
133
133
  constructor(type, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel) {
@@ -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,MAA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Y,CAAC;QAExD,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACK,iBAAiB,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 /**\r\n * @deprecated Use [[getChildren]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.\r\n */\r\n getChildCategories(): IMutableGridCategoryItem[];\r\n /**\r\n * @deprecated Use [[getDescendantsAndSelf]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.\r\n */\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
+ {"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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B,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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\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 /**\r\n * @deprecated in 3.1. Use [[getChildren]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.\r\n */\r\n getChildCategories(): IMutableGridCategoryItem[];\r\n /**\r\n * @deprecated in 3.1. Use [[getDescendantsAndSelf]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.\r\n */\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 * @public\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 * @public\r\n */\r\nexport type IMutableFlatGridItem = IMutableCategorizedPropertyItem | IMutableGridCategoryItem;\r\n\r\n/**\r\n * Base class for all Mutable CategorizedProperties\r\n * @public\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"]}
@@ -7,14 +7,14 @@ import { FlatGridItemType, IMutableFlatGridItem, IMutableGridCategoryItem, Mutab
7
7
  import { IMutableGridItemFactory } from "./MutableGridItemFactory";
8
8
  /**
9
9
  * Category name to PropertyRecord[] key pair interface used to describe which records belong to which category.
10
- * @beta
10
+ * @public
11
11
  */
12
12
  export interface CategoryRecordsDict {
13
13
  [categoryName: string]: PropertyRecord[];
14
14
  }
15
15
  /**
16
16
  * Mutable wrapper object for PropertyCategory which provides methods for working with and managing category and record children hierarchies
17
- * @beta
17
+ * @public
18
18
  */
19
19
  export declare class MutableGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {
20
20
  private _children;
@@ -5,7 +5,7 @@
5
5
  import { FlatGridItemType, MutableFlatPropertyGridItem } from "./MutableFlatGridItem";
6
6
  /**
7
7
  * Mutable wrapper object for PropertyCategory which provides methods for working with and managing category and record children hierarchies
8
- * @beta
8
+ * @public
9
9
  */
10
10
  export class MutableGridCategory extends MutableFlatPropertyGridItem {
11
11
  constructor(category, recordsDict, gridItemFactory, parentSelectionKey, depth = 0) {
@@ -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,aAAa,GAAG,GAAG,kBAAkB,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;;YAE9D,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC;QAErC,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC;QAEnC,yIAAyI;QACzI,MAAM,eAAe,GAAG,MAAA,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,yBAAyB,C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C;IAC/B,CAAC;IAED;;OAEG;IACI,8BAA8B;QACnC,MAAM,WAAW,GAA+B,EAAE,CAAC;QACnD,mDAAmD;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 // eslint-disable-next-line deprecation/deprecation\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
+ {"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,kBAAkB,IAAI,QAAQ,CAAC,IAAI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d,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,mDAAmD;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 * @public\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 * @public\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 // eslint-disable-next-line deprecation/deprecation\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"]}
@@ -10,7 +10,7 @@ import { IMutableCategorizedPropertyItem, IMutableGridCategoryItem } from "./Mut
10
10
  import { CategoryRecordsDict } from "./MutableGridCategory";
11
11
  /**
12
12
  * IMutableGridItemFactory interface for creating MutableGridItem objects
13
- * @beta
13
+ * @public
14
14
  */
15
15
  export interface IMutableGridItemFactory {
16
16
  createCategorizedProperty: (record: PropertyRecord, parentSelectionKey: string, parentCategorySelectionKey: string, depth: number, overrideName?: string, overrideDisplayLabel?: string) => IMutableCategorizedPropertyItem;
@@ -18,7 +18,7 @@ export interface IMutableGridItemFactory {
18
18
  }
19
19
  /**
20
20
  * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.
21
- * @beta
21
+ * @public
22
22
  */
23
23
  export declare class MutableGridItemFactory implements IMutableGridItemFactory {
24
24
  protected createPrimitiveProperty(record: PropertyRecord, parentSelectionKey: string, parentCategorySelectionKey: string, depth: number, overrideName?: string, overrideDisplayLabel?: string): MutableCategorizedPrimitiveProperty;
@@ -13,7 +13,7 @@ import { MutableCustomGridCategory } from "./MutableCustomGridCategory";
13
13
  import { MutableGridCategory } from "./MutableGridCategory";
14
14
  /**
15
15
  * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.
16
- * @beta
16
+ * @public
17
17
  */
18
18
  export class MutableGridItemFactory {
19
19
  createPrimitiveProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel) {
@@ -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,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,0BAA0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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":["/*---------------------------------------------------------------------------------------------\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
+ {"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,yBAAyB,CAC9B,MAAsB,EACtB,kB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AAQ,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 * @public\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 * @public\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"]}
@@ -16,14 +16,11 @@ export interface FlatPropertyRendererProps extends SharedRendererProps {
16
16
  propertyValueRendererManager?: PropertyValueRendererManager;
17
17
  /** Multiplier of how much the property is indented to the right */
18
18
  indentation?: number;
19
- /** Indicates property is being edited
20
- * @beta */
19
+ /** Indicates property is being edited */
21
20
  isEditing?: boolean;
22
- /** Called when property edit is committed.
23
- * @beta */
21
+ /** Called when property edit is committed. */
24
22
  onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;
25
- /** Called when property edit is cancelled.
26
- * @beta */
23
+ /** Called when property edit is cancelled. */
27
24
  onEditCancel?: () => void;
28
25
  /** Whether property value is displayed in expanded state. */
29
26
  isExpanded: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"FlatPropertyRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAmB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,4BAA4B;IAC5B,4BAA4B,CAAC,EAAE,4BAA4B,CAAC;IAC5D,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;eACW;IACX,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;eACW;IACX,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/E;eACW;IACX,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,6DAA6D;IAC7D,UAAU,EAAE,OAAO,CAAC;IACpB,wFAAwF;IACxF,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,uCAAuC;IACvC,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C,SAAS,CAAC,EAAE,0BAA0B,GAAG;QAAE,YAAY,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAE,CAAC;IAE1F,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAsDpE,CAAC"}
1
+ {"version":3,"file":"FlatPropertyRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK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ACpC,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":["/*---------------------------------------------------------------------------------------------\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
+ {"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;AA6BtF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,K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AEF,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":["/*---------------------------------------------------------------------------------------------\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 isEditing?: boolean;\r\n /** Called when property edit is committed. */\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n /** Called when property edit is cancelled. */\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"]}
@@ -6,7 +6,7 @@ import { CompositeFilterDescriptorCollection, DistinctValueCollection } from "./
6
6
  import { ColumnDescription, MutableTableDataProvider, RowItem, TableDataChangeEvent } from "./TableDataProvider";
7
7
  /**
8
8
  * A Table Data Provider using an array of items.
9
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.
9
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
10
10
  * @public
11
11
  */
12
12
  export declare class SimpleTableDataProvider implements MutableTableDataProvider {
@@ -15,7 +15,7 @@ import { TableDataChangeEvent } from "./TableDataProvider";
15
15
  // cSpell:ignore columnfiltering
16
16
  /**
17
17
  * A Table Data Provider using an array of items.
18
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.
18
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
19
19
  * @public
20
20
  */
21
21
  export class SimpleTableDataProvider {
@@ -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,E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AqB;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":["/*---------------------------------------------------------------------------------------------\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/* eslint-disable deprecation/deprecation */\r\n// cSpell:ignore columnfiltering\r\n\r\n/**\r\n * A Table Data Provider using an array of items.\r\n * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.\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
+ {"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,4C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AC;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":["/*---------------------------------------------------------------------------------------------\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/* eslint-disable deprecation/deprecation */\r\n// cSpell:ignore columnfiltering\r\n\r\n/**\r\n * A Table Data Provider using an array of items.\r\n * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.\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"]}
@@ -7,7 +7,7 @@ import { HorizontalAlignment, SortDirection } from "@itwin/core-react";
7
7
  import { ItemColorOverrides, ItemStyle } from "../properties/ItemStyle";
8
8
  import { CompositeFilterDescriptorCollection, DistinctValueCollection } from "./columnfiltering/ColumnFiltering";
9
9
  /** Filter Renderer for a Table column
10
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
10
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
11
11
  * @public
12
12
  */
13
13
  export declare enum FilterRenderer {
@@ -19,7 +19,7 @@ export declare enum FilterRenderer {
19
19
  }
20
20
  /**
21
21
  * Column definition provided to Table.
22
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
22
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
23
23
  * @public
24
24
  */
25
25
  export interface ColumnDescription {
@@ -58,7 +58,7 @@ export interface ColumnDescription {
58
58
  }
59
59
  /**
60
60
  * Cell definition provided to Table.
61
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
61
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
62
62
  * @public
63
63
  */
64
64
  export interface CellItem {
@@ -81,7 +81,7 @@ export interface CellItem {
81
81
  }
82
82
  /**
83
83
  * Row definition provided to Table.
84
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
84
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
85
85
  * @public
86
86
  */
87
87
  export interface RowItem {
@@ -107,12 +107,12 @@ export interface RowItem {
107
107
  getValueFromCell?: (columnKey: string) => any;
108
108
  }
109
109
  /** An interface table data change listeners
110
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this type.
110
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this type.
111
111
  * @public
112
112
  */
113
113
  export declare type TableDataChangesListener = () => void;
114
114
  /** An event broadcasted on table data changes
115
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.
115
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
116
116
  * @public
117
117
  */
118
118
  export declare class TableDataChangeEvent extends BeEvent<TableDataChangesListener> {
@@ -120,7 +120,7 @@ export declare class TableDataChangeEvent extends BeEvent<TableDataChangesListen
120
120
  /**
121
121
  * TableDataProvider provides data to the Table.
122
122
  * It also provides support for data Sorting & Filtering.
123
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
123
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
124
124
  * @public
125
125
  */
126
126
  export interface TableDataProvider {
@@ -150,7 +150,7 @@ export interface TableDataProvider {
150
150
  /**
151
151
  * MutableTableDataProvider provides mutation methods for data in the Table.
152
152
  * Useful for Drag & Drop processing.
153
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
153
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
154
154
  * @public
155
155
  */
156
156
  export interface MutableTableDataProvider extends TableDataProvider {
@@ -9,7 +9,7 @@ import { BeEvent } from "@itwin/core-bentley";
9
9
  /* eslint-disable deprecation/deprecation */
10
10
  // cSpell:ignore columnfiltering
11
11
  /** Filter Renderer for a Table column
12
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
12
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
13
13
  * @public
14
14
  */
15
15
  export var FilterRenderer;
@@ -21,7 +21,7 @@ export var FilterRenderer;
21
21
  FilterRenderer[FilterRenderer["MultiValue"] = 5] = "MultiValue";
22
22
  })(FilterRenderer || (FilterRenderer = {}));
23
23
  /** An event broadcasted on table data changes
24
- * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.
24
+ * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
25
25
  * @public
26
26
  */
27
27
  export class TableDataChangeEvent extends BeEvent {