@itwin/components-react 4.9.0-dev.1 → 4.10.0-dev.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 (473) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/lib/cjs/components-react/common/DelayedSpinner.d.ts +1 -1
  3. package/lib/cjs/components-react/common/DelayedSpinner.d.ts.map +1 -1
  4. package/lib/cjs/components-react/common/DelayedSpinner.js +2 -3
  5. package/lib/cjs/components-react/common/DelayedSpinner.js.map +1 -1
  6. package/lib/cjs/components-react/common/HighlightedText.d.ts +2 -2
  7. package/lib/cjs/components-react/common/HighlightedText.d.ts.map +1 -1
  8. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js +1 -2
  9. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  10. package/lib/cjs/components-react/converters/NumericTypeConverter.js +2 -4
  11. package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
  12. package/lib/cjs/components-react/converters/TypeConverter.js +1 -2
  13. package/lib/cjs/components-react/converters/TypeConverter.js.map +1 -1
  14. package/lib/cjs/components-react/datepicker/DateField.d.ts +2 -2
  15. package/lib/cjs/components-react/datepicker/DateField.d.ts.map +1 -1
  16. package/lib/cjs/components-react/datepicker/DatePicker.d.ts +2 -2
  17. package/lib/cjs/components-react/datepicker/DatePicker.d.ts.map +1 -1
  18. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.d.ts +1 -1
  19. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.d.ts.map +1 -1
  20. package/lib/cjs/components-react/datepicker/TimeField.d.ts +2 -2
  21. package/lib/cjs/components-react/datepicker/TimeField.d.ts.map +1 -1
  22. package/lib/cjs/components-react/datepicker/TimeField.scss +1 -1
  23. package/lib/cjs/components-react/editors/BooleanEditor.d.ts +1 -1
  24. package/lib/cjs/components-react/editors/CustomNumberEditor.js +6 -8
  25. package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
  26. package/lib/cjs/components-react/editors/DateTimeEditor.js +2 -3
  27. package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
  28. package/lib/cjs/components-react/editors/EditorContainer.d.ts +1 -1
  29. package/lib/cjs/components-react/editors/EnumButtonGroupEditor.d.ts +1 -1
  30. package/lib/cjs/components-react/editors/EnumEditor.d.ts +1 -1
  31. package/lib/cjs/components-react/editors/EnumEditor.js +1 -1
  32. package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
  33. package/lib/cjs/components-react/editors/IconEditor.d.ts +1 -1
  34. package/lib/cjs/components-react/editors/ImageCheckBoxEditor.d.ts +1 -1
  35. package/lib/cjs/components-react/editors/PopupButton.d.ts +2 -2
  36. package/lib/cjs/components-react/editors/PopupButton.d.ts.map +1 -1
  37. package/lib/cjs/components-react/editors/PopupButton.js +3 -4
  38. package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
  39. package/lib/cjs/components-react/editors/TextEditor.js +2 -4
  40. package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
  41. package/lib/cjs/components-react/editors/ToggleEditor.d.ts +1 -1
  42. package/lib/cjs/components-react/favorite/FavoritePropertyList.d.ts +2 -2
  43. package/lib/cjs/components-react/favorite/FavoritePropertyList.d.ts.map +1 -1
  44. package/lib/cjs/components-react/favorite/FavoritePropertyList.js +3 -3
  45. package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
  46. package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts +7 -3
  47. package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts.map +1 -1
  48. package/lib/cjs/components-react/filter-builder/FilterBuilder.js +3 -7
  49. package/lib/cjs/components-react/filter-builder/FilterBuilder.js.map +1 -1
  50. package/lib/cjs/components-react/filter-builder/FilterBuilderContext.d.ts +0 -36
  51. package/lib/cjs/components-react/filter-builder/FilterBuilderContext.d.ts.map +1 -1
  52. package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js +1 -73
  53. package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js.map +1 -1
  54. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.d.ts +24 -0
  55. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.d.ts.map +1 -0
  56. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js +30 -0
  57. package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -0
  58. package/lib/cjs/components-react/filter-builder/FilterBuilderRangeValue.d.ts +31 -0
  59. package/lib/cjs/components-react/filter-builder/FilterBuilderRangeValue.d.ts.map +1 -0
  60. package/lib/cjs/components-react/filter-builder/FilterBuilderRangeValue.js +76 -0
  61. package/lib/cjs/components-react/filter-builder/FilterBuilderRangeValue.js.map +1 -0
  62. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts +4 -3
  63. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
  64. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js +15 -9
  65. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
  66. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +37 -22
  67. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +10 -6
  68. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
  69. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js +15 -40
  70. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
  71. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.scss +25 -59
  72. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +11 -6
  73. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -1
  74. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js +44 -8
  75. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  76. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +1 -1
  77. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
  78. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +4 -4
  79. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
  80. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts +4 -4
  81. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
  82. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +41 -3
  83. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  84. package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts +10 -11
  85. package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -1
  86. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js +153 -46
  87. package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  88. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.d.ts +20 -0
  89. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.d.ts.map +1 -0
  90. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js +30 -0
  91. package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -0
  92. package/lib/cjs/components-react/filter-builder/Operators.d.ts +24 -19
  93. package/lib/cjs/components-react/filter-builder/Operators.d.ts.map +1 -1
  94. package/lib/cjs/components-react/filter-builder/Operators.js +40 -64
  95. package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
  96. package/lib/cjs/components-react/filter-builder/Types.d.ts +2 -2
  97. package/lib/cjs/components-react/filter-builder/Types.d.ts.map +1 -1
  98. package/lib/cjs/components-react/filter-builder/Types.js.map +1 -1
  99. package/lib/cjs/components-react/filtering/FilteringInput.d.ts +1 -1
  100. package/lib/cjs/components-react/filtering/ResultSelector.d.ts +1 -1
  101. package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts +1 -1
  102. package/lib/cjs/components-react/properties/LinkHandler.d.ts +1 -1
  103. package/lib/cjs/components-react/properties/LinkHandler.d.ts.map +1 -1
  104. package/lib/cjs/components-react/properties/renderers/ActionButtonList.d.ts +1 -1
  105. package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js +3 -4
  106. package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  107. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts +1 -1
  108. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +1 -1
  109. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
  110. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +1 -1
  111. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js +2 -3
  112. package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  113. package/lib/cjs/components-react/properties/renderers/PropertyRenderer.d.ts +1 -1
  114. package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts +1 -1
  115. package/lib/cjs/components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer.d.ts +1 -1
  116. package/lib/cjs/components-react/properties/renderers/label/PrimitivePropertyLabelRenderer.d.ts +1 -1
  117. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.d.ts +1 -1
  118. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js +4 -4
  119. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  120. package/lib/cjs/components-react/properties/renderers/value/Common.js +1 -2
  121. package/lib/cjs/components-react/properties/renderers/value/Common.js.map +1 -1
  122. package/lib/cjs/components-react/properties/renderers/value/DoublePropertyValueRenderer.d.ts +2 -2
  123. package/lib/cjs/components-react/properties/renderers/value/DoublePropertyValueRenderer.d.ts.map +1 -1
  124. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +3 -6
  125. package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
  126. package/lib/cjs/components-react/properties/renderers/value/NavigationPropertyValueRenderer.d.ts +2 -2
  127. package/lib/cjs/components-react/properties/renderers/value/NavigationPropertyValueRenderer.d.ts.map +1 -1
  128. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.d.ts +2 -2
  129. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.d.ts.map +1 -1
  130. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +3 -6
  131. package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  132. package/lib/cjs/components-react/properties/renderers/value/UrlPropertyValueRenderer.d.ts +2 -2
  133. package/lib/cjs/components-react/properties/renderers/value/UrlPropertyValueRenderer.d.ts.map +1 -1
  134. package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts +1 -1
  135. package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.d.ts +1 -1
  136. package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.d.ts +1 -1
  137. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -2
  138. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  139. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +1 -2
  140. package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  141. package/lib/cjs/components-react/propertygrid/component/FlatItemNestedBorderWrapper.d.ts +1 -1
  142. package/lib/cjs/components-react/propertygrid/component/FlatItemNestedBorderWrapper.d.ts.map +1 -1
  143. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.d.ts +1 -1
  144. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -2
  145. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  146. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js +2 -2
  147. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  148. package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts +1 -1
  149. package/lib/cjs/components-react/propertygrid/component/PropertyList.d.ts +1 -1
  150. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -1
  151. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +49 -54
  152. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  153. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +5 -2
  154. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts.map +1 -1
  155. package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js +11 -13
  156. package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  157. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
  158. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  159. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +1 -2
  160. package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  161. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js +1 -2
  162. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
  163. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +2 -2
  164. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  165. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +2 -3
  166. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  167. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  168. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  169. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts +1 -1
  170. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +1 -1
  171. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
  172. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +5 -7
  173. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  174. package/lib/cjs/components-react/selectable-content/SelectableContent.d.ts +2 -2
  175. package/lib/cjs/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
  176. package/lib/cjs/components-react/selectable-content/SelectableContent.js +2 -3
  177. package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
  178. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts +2 -2
  179. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
  180. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +4 -6
  181. package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
  182. package/lib/cjs/components-react/toolbar/ItemWrapper.d.ts +1 -1
  183. package/lib/cjs/components-react/toolbar/ItemWrapper.d.ts.map +1 -1
  184. package/lib/cjs/components-react/toolbar/Items.d.ts +1 -1
  185. package/lib/cjs/components-react/toolbar/Items.d.ts.map +1 -1
  186. package/lib/cjs/components-react/toolbar/Overflow.d.ts +1 -1
  187. package/lib/cjs/components-react/toolbar/Overflow.d.ts.map +1 -1
  188. package/lib/cjs/components-react/toolbar/OverflowPanel.d.ts +1 -1
  189. package/lib/cjs/components-react/toolbar/OverflowPanel.d.ts.map +1 -1
  190. package/lib/cjs/components-react/toolbar/PopupItem.d.ts +2 -2
  191. package/lib/cjs/components-react/toolbar/PopupItem.d.ts.map +1 -1
  192. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts +2 -2
  193. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
  194. package/lib/cjs/components-react/toolbar/PopupItemsPanel.d.ts +2 -2
  195. package/lib/cjs/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
  196. package/lib/cjs/components-react/toolbar/Toolbar.d.ts +1 -1
  197. package/lib/cjs/components-react/toolbar/Toolbar.d.ts.map +1 -1
  198. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +1 -1
  199. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  200. package/lib/cjs/components-react/toolbar/groupPanel/Column.d.ts +1 -1
  201. package/lib/cjs/components-react/toolbar/groupPanel/Column.d.ts.map +1 -1
  202. package/lib/cjs/components-react/toolbar/groupPanel/Columns.d.ts +1 -1
  203. package/lib/cjs/components-react/toolbar/groupPanel/Columns.d.ts.map +1 -1
  204. package/lib/cjs/components-react/toolbar/groupPanel/Panel.d.ts +1 -1
  205. package/lib/cjs/components-react/toolbar/groupPanel/Panel.d.ts.map +1 -1
  206. package/lib/cjs/components-react/toolbar/groupPanel/Title.d.ts +1 -1
  207. package/lib/cjs/components-react/toolbar/groupPanel/Title.d.ts.map +1 -1
  208. package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.d.ts +1 -1
  209. package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.d.ts.map +1 -1
  210. package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js +5 -6
  211. package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
  212. package/lib/cjs/components-react/tree/controlled/TreeHooks.d.ts +12 -0
  213. package/lib/cjs/components-react/tree/controlled/TreeHooks.d.ts.map +1 -1
  214. package/lib/cjs/components-react/tree/controlled/TreeHooks.js +22 -1
  215. package/lib/cjs/components-react/tree/controlled/TreeHooks.js.map +1 -1
  216. package/lib/cjs/components-react/tree/controlled/TreeModel.js +7 -8
  217. package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
  218. package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js +6 -8
  219. package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  220. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts +1 -1
  221. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  222. package/lib/cjs/components-react/tree/controlled/component/NodeContent.d.ts +2 -2
  223. package/lib/cjs/components-react/tree/controlled/component/NodeContent.d.ts.map +1 -1
  224. package/lib/cjs/components-react/tree/controlled/component/TreeNodeEditor.d.ts +1 -1
  225. package/lib/cjs/components-react/tree/controlled/component/TreeNodeEditor.d.ts.map +1 -1
  226. package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +1 -1
  227. package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
  228. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.d.ts +1 -1
  229. package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js +1 -2
  230. package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  231. package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js +2 -4
  232. package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  233. package/lib/cjs/components-react.d.ts +3 -0
  234. package/lib/cjs/components-react.d.ts.map +1 -1
  235. package/lib/cjs/components-react.js +3 -0
  236. package/lib/cjs/components-react.js.map +1 -1
  237. package/lib/esm/components-react/common/DelayedSpinner.d.ts +1 -1
  238. package/lib/esm/components-react/common/DelayedSpinner.d.ts.map +1 -1
  239. package/lib/esm/components-react/common/DelayedSpinner.js +2 -3
  240. package/lib/esm/components-react/common/DelayedSpinner.js.map +1 -1
  241. package/lib/esm/components-react/common/HighlightedText.d.ts +2 -2
  242. package/lib/esm/components-react/common/HighlightedText.d.ts.map +1 -1
  243. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js +1 -2
  244. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  245. package/lib/esm/components-react/converters/NumericTypeConverter.js +2 -4
  246. package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
  247. package/lib/esm/components-react/converters/TypeConverter.js +1 -2
  248. package/lib/esm/components-react/converters/TypeConverter.js.map +1 -1
  249. package/lib/esm/components-react/datepicker/DateField.d.ts +2 -2
  250. package/lib/esm/components-react/datepicker/DateField.d.ts.map +1 -1
  251. package/lib/esm/components-react/datepicker/DatePicker.d.ts +2 -2
  252. package/lib/esm/components-react/datepicker/DatePicker.d.ts.map +1 -1
  253. package/lib/esm/components-react/datepicker/DatePickerPopupButton.d.ts +1 -1
  254. package/lib/esm/components-react/datepicker/DatePickerPopupButton.d.ts.map +1 -1
  255. package/lib/esm/components-react/datepicker/TimeField.d.ts +2 -2
  256. package/lib/esm/components-react/datepicker/TimeField.d.ts.map +1 -1
  257. package/lib/esm/components-react/datepicker/TimeField.scss +1 -1
  258. package/lib/esm/components-react/editors/BooleanEditor.d.ts +1 -1
  259. package/lib/esm/components-react/editors/CustomNumberEditor.js +6 -8
  260. package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
  261. package/lib/esm/components-react/editors/DateTimeEditor.js +2 -3
  262. package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
  263. package/lib/esm/components-react/editors/EditorContainer.d.ts +1 -1
  264. package/lib/esm/components-react/editors/EnumButtonGroupEditor.d.ts +1 -1
  265. package/lib/esm/components-react/editors/EnumEditor.d.ts +1 -1
  266. package/lib/esm/components-react/editors/EnumEditor.js +1 -1
  267. package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
  268. package/lib/esm/components-react/editors/IconEditor.d.ts +1 -1
  269. package/lib/esm/components-react/editors/ImageCheckBoxEditor.d.ts +1 -1
  270. package/lib/esm/components-react/editors/PopupButton.d.ts +2 -2
  271. package/lib/esm/components-react/editors/PopupButton.d.ts.map +1 -1
  272. package/lib/esm/components-react/editors/PopupButton.js +3 -4
  273. package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
  274. package/lib/esm/components-react/editors/TextEditor.js +2 -4
  275. package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
  276. package/lib/esm/components-react/editors/ToggleEditor.d.ts +1 -1
  277. package/lib/esm/components-react/favorite/FavoritePropertyList.d.ts +2 -2
  278. package/lib/esm/components-react/favorite/FavoritePropertyList.d.ts.map +1 -1
  279. package/lib/esm/components-react/favorite/FavoritePropertyList.js +3 -3
  280. package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
  281. package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts +7 -3
  282. package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts.map +1 -1
  283. package/lib/esm/components-react/filter-builder/FilterBuilder.js +4 -8
  284. package/lib/esm/components-react/filter-builder/FilterBuilder.js.map +1 -1
  285. package/lib/esm/components-react/filter-builder/FilterBuilderContext.d.ts +0 -36
  286. package/lib/esm/components-react/filter-builder/FilterBuilderContext.d.ts.map +1 -1
  287. package/lib/esm/components-react/filter-builder/FilterBuilderContext.js +0 -71
  288. package/lib/esm/components-react/filter-builder/FilterBuilderContext.js.map +1 -1
  289. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.d.ts +24 -0
  290. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.d.ts.map +1 -0
  291. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js +23 -0
  292. package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -0
  293. package/lib/esm/components-react/filter-builder/FilterBuilderRangeValue.d.ts +31 -0
  294. package/lib/esm/components-react/filter-builder/FilterBuilderRangeValue.d.ts.map +1 -0
  295. package/lib/esm/components-react/filter-builder/FilterBuilderRangeValue.js +73 -0
  296. package/lib/esm/components-react/filter-builder/FilterBuilderRangeValue.js.map +1 -0
  297. package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts +4 -3
  298. package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
  299. package/lib/esm/components-react/filter-builder/FilterBuilderRule.js +19 -13
  300. package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
  301. package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +37 -22
  302. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +10 -6
  303. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
  304. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js +17 -42
  305. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
  306. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.scss +25 -59
  307. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +11 -6
  308. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -1
  309. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js +42 -7
  310. package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
  311. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +1 -1
  312. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
  313. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +4 -4
  314. package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
  315. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts +4 -4
  316. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
  317. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +40 -2
  318. package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  319. package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts +10 -11
  320. package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -1
  321. package/lib/esm/components-react/filter-builder/FilterBuilderState.js +151 -44
  322. package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
  323. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.d.ts +20 -0
  324. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.d.ts.map +1 -0
  325. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js +23 -0
  326. package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -0
  327. package/lib/esm/components-react/filter-builder/Operators.d.ts +24 -19
  328. package/lib/esm/components-react/filter-builder/Operators.d.ts.map +1 -1
  329. package/lib/esm/components-react/filter-builder/Operators.js +37 -61
  330. package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
  331. package/lib/esm/components-react/filter-builder/Types.d.ts +2 -2
  332. package/lib/esm/components-react/filter-builder/Types.d.ts.map +1 -1
  333. package/lib/esm/components-react/filter-builder/Types.js.map +1 -1
  334. package/lib/esm/components-react/filtering/FilteringInput.d.ts +1 -1
  335. package/lib/esm/components-react/filtering/ResultSelector.d.ts +1 -1
  336. package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts +1 -1
  337. package/lib/esm/components-react/properties/LinkHandler.d.ts +1 -1
  338. package/lib/esm/components-react/properties/LinkHandler.d.ts.map +1 -1
  339. package/lib/esm/components-react/properties/renderers/ActionButtonList.d.ts +1 -1
  340. package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js +3 -4
  341. package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
  342. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts +1 -1
  343. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +1 -1
  344. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
  345. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +1 -1
  346. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js +2 -3
  347. package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  348. package/lib/esm/components-react/properties/renderers/PropertyRenderer.d.ts +1 -1
  349. package/lib/esm/components-react/properties/renderers/PropertyView.d.ts +1 -1
  350. package/lib/esm/components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer.d.ts +1 -1
  351. package/lib/esm/components-react/properties/renderers/label/PrimitivePropertyLabelRenderer.d.ts +1 -1
  352. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.d.ts +1 -1
  353. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js +4 -4
  354. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  355. package/lib/esm/components-react/properties/renderers/value/Common.js +1 -2
  356. package/lib/esm/components-react/properties/renderers/value/Common.js.map +1 -1
  357. package/lib/esm/components-react/properties/renderers/value/DoublePropertyValueRenderer.d.ts +2 -2
  358. package/lib/esm/components-react/properties/renderers/value/DoublePropertyValueRenderer.d.ts.map +1 -1
  359. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +3 -6
  360. package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
  361. package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.d.ts +2 -2
  362. package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.d.ts.map +1 -1
  363. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.d.ts +2 -2
  364. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.d.ts.map +1 -1
  365. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +3 -6
  366. package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  367. package/lib/esm/components-react/properties/renderers/value/UrlPropertyValueRenderer.d.ts +2 -2
  368. package/lib/esm/components-react/properties/renderers/value/UrlPropertyValueRenderer.d.ts.map +1 -1
  369. package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts +1 -1
  370. package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.d.ts +1 -1
  371. package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.d.ts +1 -1
  372. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -2
  373. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  374. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +1 -2
  375. package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
  376. package/lib/esm/components-react/propertygrid/component/FlatItemNestedBorderWrapper.d.ts +1 -1
  377. package/lib/esm/components-react/propertygrid/component/FlatItemNestedBorderWrapper.d.ts.map +1 -1
  378. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.d.ts +1 -1
  379. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -2
  380. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  381. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js +2 -2
  382. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  383. package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts +1 -1
  384. package/lib/esm/components-react/propertygrid/component/PropertyList.d.ts +1 -1
  385. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -1
  386. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +49 -54
  387. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  388. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +5 -2
  389. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts.map +1 -1
  390. package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js +11 -13
  391. package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  392. package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
  393. package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  394. package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +1 -2
  395. package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  396. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js +1 -2
  397. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
  398. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +2 -2
  399. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  400. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +2 -3
  401. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  402. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  403. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  404. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts +1 -1
  405. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +1 -1
  406. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
  407. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +5 -7
  408. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  409. package/lib/esm/components-react/selectable-content/SelectableContent.d.ts +2 -2
  410. package/lib/esm/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
  411. package/lib/esm/components-react/selectable-content/SelectableContent.js +2 -3
  412. package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
  413. package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts +2 -2
  414. package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
  415. package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +4 -6
  416. package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
  417. package/lib/esm/components-react/toolbar/ItemWrapper.d.ts +1 -1
  418. package/lib/esm/components-react/toolbar/ItemWrapper.d.ts.map +1 -1
  419. package/lib/esm/components-react/toolbar/Items.d.ts +1 -1
  420. package/lib/esm/components-react/toolbar/Items.d.ts.map +1 -1
  421. package/lib/esm/components-react/toolbar/Overflow.d.ts +1 -1
  422. package/lib/esm/components-react/toolbar/Overflow.d.ts.map +1 -1
  423. package/lib/esm/components-react/toolbar/OverflowPanel.d.ts +1 -1
  424. package/lib/esm/components-react/toolbar/OverflowPanel.d.ts.map +1 -1
  425. package/lib/esm/components-react/toolbar/PopupItem.d.ts +2 -2
  426. package/lib/esm/components-react/toolbar/PopupItem.d.ts.map +1 -1
  427. package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts +2 -2
  428. package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
  429. package/lib/esm/components-react/toolbar/PopupItemsPanel.d.ts +2 -2
  430. package/lib/esm/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
  431. package/lib/esm/components-react/toolbar/Toolbar.d.ts +1 -1
  432. package/lib/esm/components-react/toolbar/Toolbar.d.ts.map +1 -1
  433. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +1 -1
  434. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  435. package/lib/esm/components-react/toolbar/groupPanel/Column.d.ts +1 -1
  436. package/lib/esm/components-react/toolbar/groupPanel/Column.d.ts.map +1 -1
  437. package/lib/esm/components-react/toolbar/groupPanel/Columns.d.ts +1 -1
  438. package/lib/esm/components-react/toolbar/groupPanel/Columns.d.ts.map +1 -1
  439. package/lib/esm/components-react/toolbar/groupPanel/Panel.d.ts +1 -1
  440. package/lib/esm/components-react/toolbar/groupPanel/Panel.d.ts.map +1 -1
  441. package/lib/esm/components-react/toolbar/groupPanel/Title.d.ts +1 -1
  442. package/lib/esm/components-react/toolbar/groupPanel/Title.d.ts.map +1 -1
  443. package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.d.ts +1 -1
  444. package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.d.ts.map +1 -1
  445. package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js +5 -6
  446. package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
  447. package/lib/esm/components-react/tree/controlled/TreeHooks.d.ts +12 -0
  448. package/lib/esm/components-react/tree/controlled/TreeHooks.d.ts.map +1 -1
  449. package/lib/esm/components-react/tree/controlled/TreeHooks.js +21 -1
  450. package/lib/esm/components-react/tree/controlled/TreeHooks.js.map +1 -1
  451. package/lib/esm/components-react/tree/controlled/TreeModel.js +7 -8
  452. package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
  453. package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js +6 -8
  454. package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
  455. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts +1 -1
  456. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  457. package/lib/esm/components-react/tree/controlled/component/NodeContent.d.ts +2 -2
  458. package/lib/esm/components-react/tree/controlled/component/NodeContent.d.ts.map +1 -1
  459. package/lib/esm/components-react/tree/controlled/component/TreeNodeEditor.d.ts +1 -1
  460. package/lib/esm/components-react/tree/controlled/component/TreeNodeEditor.d.ts.map +1 -1
  461. package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +1 -1
  462. package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
  463. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.d.ts +1 -1
  464. package/lib/esm/components-react/tree/controlled/internal/SparseTree.js +1 -2
  465. package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
  466. package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js +2 -4
  467. package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
  468. package/lib/esm/components-react.d.ts +3 -0
  469. package/lib/esm/components-react.d.ts.map +1 -1
  470. package/lib/esm/components-react.js +3 -0
  471. package/lib/esm/components-react.js.map +1 -1
  472. package/lib/public/locales/en/UiComponents.json +12 -7
  473. package/package.json +7 -8
@@ -1 +1 @@
1
- {"version":3,"file":"SparseTree.js","sourceRoot":"","sources":["../../../../../../src/components-react/tree/controlled/internal/SparseTree.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,iCAAkC;AAClC,sDAAyE;AAOzE;;;;;GAKG;AACH,MAAa,UAAU;IAOrB;QAJQ,eAAU,GAAG,IAAI,WAAW,EAAU,CAAC;QACvC,sBAAiB,GAAwC,EAAE,CAAC;QAC5D,cAAS,GAAsB,EAAE,CAAC;QAGxC,IAAI,CAAC,iBAAS,CAAC,GAAG,IAAI,CAAC;IACzB,CAAC;IAEM,OAAO,CAAC,MAAc;QAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAEM,cAAc,CACnB,QAA4B,EAC5B,OAAe;QAEf,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ;YAAE,OAAO,SAAS,CAAC;QAEhC,OAAO,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAEM,WAAW,CAChB,QA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AY,EAAE;oBAC3C,MAAM,SAAS,CAAC;iBACjB;gBAED,MAAM,KAAK,CAAC;gBACZ,EAAE,YAAY,CAAC;aAChB;YAED,OAAO,YAAY,GAAG,MAAM,EAAE,EAAE,YAAY,EAAE;gBAC5C,MAAM,SAAS,CAAC;aACjB;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;IAEO,UAAU,CAAC,KAAa;QAI9B,OAAO,IAAA,yBAAU,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAEO,MAAM,CAAC,OAAO,CAAI,KAAa,EAAE,KAAkB;QACzD,OAAO,IAAA,6BAAc,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;CACF;AApHD,kCAoHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tree\n */\n\nimport { immerable } from \"immer\";\nimport { assert, compareNumbers, lowerBound } from \"@itwin/core-bentley\";\n\n/** @internal */\nexport interface Node {\n readonly id: string;\n}\n\n/**\n * Structure for sparse tree storage.\n * It uses SparseArray to store children ids for parent. This allows\n * having tree structure with some nodes missing in the tree branch.\n * @internal\n */\nexport class SparseTree<T extends Node> {\n public [immerable]: boolean;\n\n private _rootNodes = new SparseArray<string>();\n private _parentToChildren: Record<string, SparseArray<string>> = {};\n private _idToNode: Record<string, T> = {};\n\n constructor() {\n this[immerable] = true;\n }\n\n public getNode(nodeId: string): T | undefined {\n return this._idToNode[nodeId];\n }\n\n public getChildOffset(\n parentId: string | undefined,\n childId: string\n ): number | undefined {\n const children = this.getChildren(parentId);\n if (!children) return undefined;\n\n return children.getIndex(childId);\n }\n\n public getChildren(\n parentId: string | undefined,\n createIfNotExist: boolean = false\n ): SparseArray<string> | undefined {\n if (parentId === undefined) {\n return this._rootNodes;\n }\n\n if (this._parentToChildren[parentId] === undefined && createIfNotExist) {\n this._parentToChildren[parentId] = new SparseArray<string>();\n }\n\n return this._parentToChildren[parentId];\n }\n\n public setChildren(\n parentId: string | undefined,\n children: T[],\n offset: number\n ) {\n const existingChildren = this.getChildren(parentId, true)!;\n children.forEach((child, index) => {\n const existingChildId = existingChildren.get(offset + index);\n if (existingChildId !== undefined) {\n this.deleteSubtree(existingChildId);\n }\n\n existingChildren.set(offset + index, child.id);\n this._idToNode[child.id] = child;\n });\n }\n\n public insertChild(parentId: string | undefined, child: T, offset: number) {\n const existingChildren = this.getChildren(parentId, true)!;\n existingChildren.insert(offset, child.id);\n this._idToNode[child.id] = child;\n }\n\n public setNodeId(\n parentId: string | undefined,\n index: number,\n newId: string\n ): boolean {\n const previousNodeId = this.getChildren(parentId)?.get(index);\n if (previousNodeId === undefined) {\n return false;\n }\n\n if (previousNodeId === newId) {\n return true;\n }\n\n if (this.getNode(newId) !== undefined) {\n return false;\n }\n\n this._idToNode[newId] = this._idToNode[previousNodeId];\n delete this._idToNode[previousNodeId];\n\n this._parentToChildren[newId] = this._parentToChildren[previousNodeId];\n delete this._parentToChildren[previousNodeId];\n\n if (parentId === undefined) {\n this._rootNodes.set(index, newId);\n } else {\n this._parentToChildren[parentId].set(index, newId);\n }\n\n return true;\n }\n\n public moveNode(\n sourceParentId: string | undefined,\n sourceNodeId: string,\n targetParentId: string | undefined,\n targetIndex: number\n ): void {\n const sourceNodeSiblings = this.getChildren(sourceParentId);\n assert(sourceNodeSiblings !== undefined);\n\n const sourceIndex = this.getChildOffset(sourceParentId, sourceNodeId);\n assert(sourceIndex !== undefined);\n\n sourceNodeSiblings.remove(sourceIndex);\n if (targetParentId === sourceParentId && targetIndex > sourceIndex) {\n targetIndex -= 1;\n }\n\n const targetNodeSiblings = this.getChildren(targetParentId, true);\n assert(targetNodeSiblings !== undefined);\n targetNodeSiblings.insert(targetIndex, sourceNodeId);\n }\n\n public setNumChildren(parentId: string | undefined, numChildren: number) {\n const children = this.getChildren(parentId, true)!;\n for (const [childId] of children.iterateValues()) {\n this.deleteSubtree(childId);\n }\n\n children.setLength(numChildren);\n }\n\n public removeChild(\n parentId: string | undefined,\n child: string | number\n ): void {\n const children = this.getChildren(parentId);\n if (children === undefined) return;\n\n if (typeof child === \"string\") {\n const childIndex = children.getIndex(child);\n if (childIndex !== undefined) {\n children.remove(childIndex);\n }\n\n this.deleteSubtree(child);\n } else {\n const childId = children.get(child);\n children.remove(child);\n if (childId !== undefined) {\n this.deleteSubtree(childId);\n }\n }\n }\n\n public deleteSubtree(\n parentId: string | undefined,\n deleteParent: boolean = true\n ) {\n const children = this.getChildren(parentId);\n if (children !== undefined) {\n for (const [childId] of children.iterateValues()) {\n this.deleteSubtree(childId);\n }\n }\n\n if (parentId === undefined) {\n this._rootNodes.setLength(0);\n return;\n }\n if (deleteParent) {\n delete this._idToNode[parentId];\n }\n delete this._parentToChildren[parentId];\n }\n}\n\n/**\n * Structure for sparse array value storage.\n * The main advantage of this class over the standard javascript array is that\n * this class does not need to check each index when iterating values that are\n * stored in the array.\n * @public\n */\nexport class SparseArray<T> implements Iterable<T | undefined> {\n public [immerable]: boolean;\n\n private _length = 0;\n private _array: Array<[T, number]> = [];\n\n constructor() {\n this[immerable] = true;\n }\n\n /** Returns length of array including intermediate 'undefined' values */\n public getLength(): number {\n return this._length;\n }\n\n /** Sets length of array. */\n public setLength(length: number) {\n const { index } = this.lowerBound(length);\n this._array.length = index;\n this._length = length;\n }\n\n /** Returns index of supplied value.\n *\n * @returns index of value or undefined if value is not found.\n */\n public getIndex(lookupValue: T): number | undefined {\n for (const [value, index] of this._array) {\n if (value === lookupValue) return index;\n }\n return undefined;\n }\n\n /** Returns value at specific position.\n *\n * @returns stored value or undefined.\n */\n public get(index: number): T | undefined {\n const { index: i, equal } = this.lowerBound(index);\n return equal ? this._array[i][0] : undefined;\n }\n\n /** Sets value at specific position. Overrides any existing value. */\n public set(index: number, value: T) {\n const { index: i, equal } = this.lowerBound(index);\n this._array.splice(i, equal ? 1 : 0, [value, index]);\n this._length = Math.max(this._length, index + 1);\n }\n\n /** Inserts value at specific position. Increases array length by one. */\n public insert(index: number, value: T) {\n const { index: i } = this.lowerBound(index);\n this._array.splice(i, 0, [value, index]);\n\n for (let j = i + 1; j < this._array.length; j++) {\n this._array[j][1]++;\n }\n\n this._length = Math.max(this._length + 1, index + 1);\n }\n\n /** Removes value at specified index and reduces array length by one. */\n public remove(index: number): void {\n if (index >= this._length) {\n return;\n }\n\n const { index: i, equal } = this.lowerBound(index);\n this._array.splice(i, equal ? 1 : 0);\n\n for (let j = i; j < this._array.length; j++) {\n this._array[j][1]--;\n }\n\n this._length = Math.max(0, this._length - 1);\n }\n\n /**\n * Iterates values that are stored in the array\n * @returns `[value, index]` tuples.\n */\n public iterateValues(): IterableIterator<[T, number]> {\n return this._array[Symbol.iterator]();\n }\n\n /** Iterates the array with all intermediate `undefined` values */\n public [Symbol.iterator](): IterableIterator<T | undefined> {\n const array = this._array;\n const length = this._length;\n return (function* () {\n let currentIndex = 0;\n for (const [value, index] of array) {\n for (; currentIndex < index; ++currentIndex) {\n yield undefined;\n }\n\n yield value;\n ++currentIndex;\n }\n\n for (; currentIndex < length; ++currentIndex) {\n yield undefined;\n }\n })();\n }\n\n private lowerBound(index: number): {\n index: number;\n equal: boolean;\n } {\n return lowerBound(index, this._array, SparseArray.compare);\n }\n\n private static compare<T>(index: number, value: [T, number]): number {\n return compareNumbers(index, value[1]);\n }\n}\n"]}
1
+ {"version":3,"file":"SparseTree.js","sourceRoot":"","sources":["../../../../../../src/components-react/tree/controlled/internal/SparseTree.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,iCAAkC;AAClC,sDAAyE;AAOzE;;;;;GAKG;AACH,MAAa,UAAU;IAOrB;QAJQ,eAAU,GAAG,IAAI,WAAW,EAAU,CAAC;QACvC,sBAAiB,GAAwC,EAAE,CAAC;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;IACI,aAAa;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACxC,CAAC;IAED,kEAAkE;IAC3D,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,YAAY,GAAG,CAAC,CAAC;YACrB,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,KAAK,EAAE;gBAClC,OAAO,YAAY,GAAG,KAAK,EAAE,EAAE,YAAY,EAAE;oBAC3C,MAAM,SAAS,CAAC;iBACjB;gBAED,MAAM,KAAK,CAAC;gBACZ,EAAE,YAAY,CAAC;aAChB;YAED,OAAO,YAAY,GAAG,MAAM,EAAE,EAAE,YAAY,EAAE;gBAC5C,MAAM,SAAS,CAAC;aACjB;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;IAEO,UAAU,CAAC,KAAa;QAI9B,OAAO,IAAA,yBAAU,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAEO,MAAM,CAAC,OAAO,CAAI,KAAa,EAAE,KAAkB;QACzD,OAAO,IAAA,6BAAc,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;CACF;AApHD,kCAoHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tree\n */\n\nimport { immerable } from \"immer\";\nimport { assert, compareNumbers, lowerBound } from \"@itwin/core-bentley\";\n\n/** @internal */\nexport interface Node {\n readonly id: string;\n}\n\n/**\n * Structure for sparse tree storage.\n * It uses SparseArray to store children ids for parent. This allows\n * having tree structure with some nodes missing in the tree branch.\n * @internal\n */\nexport class SparseTree<T extends Node> {\n public [immerable]: boolean;\n\n private _rootNodes = new SparseArray<string>();\n private _parentToChildren: Record<string, SparseArray<string>> = {};\n private _idToNode: Record<string, T> = {};\n\n constructor() {\n this[immerable] = true;\n }\n\n public getNode(nodeId: string): T | undefined {\n return this._idToNode[nodeId];\n }\n\n public getChildOffset(\n parentId: string | undefined,\n childId: string\n ): number | undefined {\n const children = this.getChildren(parentId);\n if (!children) return undefined;\n\n return children.getIndex(childId);\n }\n\n public getChildren(\n parentId: string | undefined,\n createIfNotExist: boolean = false\n ): SparseArray<string> | undefined {\n if (parentId === undefined) {\n return this._rootNodes;\n }\n\n if (this._parentToChildren[parentId] === undefined && createIfNotExist) {\n this._parentToChildren[parentId] = new SparseArray<string>();\n }\n\n return this._parentToChildren[parentId];\n }\n\n public setChildren(\n parentId: string | undefined,\n children: T[],\n offset: number\n ) {\n const existingChildren = this.getChildren(parentId, true)!;\n children.forEach((child, index) => {\n const existingChildId = existingChildren.get(offset + index);\n if (existingChildId !== undefined) {\n this.deleteSubtree(existingChildId);\n }\n\n existingChildren.set(offset + index, child.id);\n this._idToNode[child.id] = child;\n });\n }\n\n public insertChild(parentId: string | undefined, child: T, offset: number) {\n const existingChildren = this.getChildren(parentId, true)!;\n existingChildren.insert(offset, child.id);\n this._idToNode[child.id] = child;\n }\n\n public setNodeId(\n parentId: string | undefined,\n index: number,\n newId: string\n ): boolean {\n const previousNodeId = this.getChildren(parentId)?.get(index);\n if (previousNodeId === undefined) {\n return false;\n }\n\n if (previousNodeId === newId) {\n return true;\n }\n\n if (this.getNode(newId) !== undefined) {\n return false;\n }\n\n this._idToNode[newId] = this._idToNode[previousNodeId];\n delete this._idToNode[previousNodeId];\n\n this._parentToChildren[newId] = this._parentToChildren[previousNodeId];\n delete this._parentToChildren[previousNodeId];\n\n if (parentId === undefined) {\n this._rootNodes.set(index, newId);\n } else {\n this._parentToChildren[parentId].set(index, newId);\n }\n\n return true;\n }\n\n public moveNode(\n sourceParentId: string | undefined,\n sourceNodeId: string,\n targetParentId: string | undefined,\n targetIndex: number\n ): void {\n const sourceNodeSiblings = this.getChildren(sourceParentId);\n assert(sourceNodeSiblings !== undefined);\n\n const sourceIndex = this.getChildOffset(sourceParentId, sourceNodeId);\n assert(sourceIndex !== undefined);\n\n sourceNodeSiblings.remove(sourceIndex);\n if (targetParentId === sourceParentId && targetIndex > sourceIndex) {\n targetIndex -= 1;\n }\n\n const targetNodeSiblings = this.getChildren(targetParentId, true);\n assert(targetNodeSiblings !== undefined);\n targetNodeSiblings.insert(targetIndex, sourceNodeId);\n }\n\n public setNumChildren(parentId: string | undefined, numChildren: number) {\n const children = this.getChildren(parentId, true)!;\n for (const [childId] of children.iterateValues()) {\n this.deleteSubtree(childId);\n }\n\n children.setLength(numChildren);\n }\n\n public removeChild(\n parentId: string | undefined,\n child: string | number\n ): void {\n const children = this.getChildren(parentId);\n if (children === undefined) return;\n\n if (typeof child === \"string\") {\n const childIndex = children.getIndex(child);\n if (childIndex !== undefined) {\n children.remove(childIndex);\n }\n\n this.deleteSubtree(child);\n } else {\n const childId = children.get(child);\n children.remove(child);\n if (childId !== undefined) {\n this.deleteSubtree(childId);\n }\n }\n }\n\n public deleteSubtree(\n parentId: string | undefined,\n deleteParent: boolean = true\n ) {\n const children = this.getChildren(parentId);\n if (children !== undefined) {\n for (const [childId] of children.iterateValues()) {\n this.deleteSubtree(childId);\n }\n }\n\n if (parentId === undefined) {\n this._rootNodes.setLength(0);\n return;\n }\n if (deleteParent) {\n delete this._idToNode[parentId];\n }\n delete this._parentToChildren[parentId];\n }\n}\n\n/**\n * Structure for sparse array value storage.\n * The main advantage of this class over the standard javascript array is that\n * this class does not need to check each index when iterating values that are\n * stored in the array.\n * @public\n */\nexport class SparseArray<T> implements Iterable<T | undefined> {\n public [immerable]: boolean;\n\n private _length = 0;\n private _array: Array<[T, number]> = [];\n\n constructor() {\n this[immerable] = true;\n }\n\n /** Returns length of array including intermediate 'undefined' values */\n public getLength(): number {\n return this._length;\n }\n\n /** Sets length of array. */\n public setLength(length: number) {\n const { index } = this.lowerBound(length);\n this._array.length = index;\n this._length = length;\n }\n\n /** Returns index of supplied value.\n *\n * @returns index of value or undefined if value is not found.\n */\n public getIndex(lookupValue: T): number | undefined {\n for (const [value, index] of this._array) {\n if (value === lookupValue) return index;\n }\n return undefined;\n }\n\n /** Returns value at specific position.\n *\n * @returns stored value or undefined.\n */\n public get(index: number): T | undefined {\n const { index: i, equal } = this.lowerBound(index);\n return equal ? this._array[i][0] : undefined;\n }\n\n /** Sets value at specific position. Overrides any existing value. */\n public set(index: number, value: T) {\n const { index: i, equal } = this.lowerBound(index);\n this._array.splice(i, equal ? 1 : 0, [value, index]);\n this._length = Math.max(this._length, index + 1);\n }\n\n /** Inserts value at specific position. Increases array length by one. */\n public insert(index: number, value: T) {\n const { index: i } = this.lowerBound(index);\n this._array.splice(i, 0, [value, index]);\n\n for (let j = i + 1; j < this._array.length; j++) {\n this._array[j][1]++;\n }\n\n this._length = Math.max(this._length + 1, index + 1);\n }\n\n /** Removes value at specified index and reduces array length by one. */\n public remove(index: number): void {\n if (index >= this._length) {\n return;\n }\n\n const { index: i, equal } = this.lowerBound(index);\n this._array.splice(i, equal ? 1 : 0);\n\n for (let j = i; j < this._array.length; j++) {\n this._array[j][1]--;\n }\n\n this._length = Math.max(0, this._length - 1);\n }\n\n /**\n * Iterates values that are stored in the array\n * @returns `[value, index]` tuples.\n */\n public iterateValues(): IterableIterator<[T, number]> {\n return this._array[Symbol.iterator]();\n }\n\n /** Iterates the array with all intermediate `undefined` values */\n public [Symbol.iterator](): IterableIterator<T | undefined> {\n const array = this._array;\n const length = this._length;\n return (function* () {\n let currentIndex = 0;\n for (const [value, index] of array) {\n for (; currentIndex < index; ++currentIndex) {\n yield undefined;\n }\n\n yield value;\n ++currentIndex;\n }\n\n for (; currentIndex < length; ++currentIndex) {\n yield undefined;\n }\n })();\n }\n\n private lowerBound(index: number): {\n index: number;\n equal: boolean;\n } {\n return lowerBound(index, this._array, SparseArray.compare);\n }\n\n private static compare<T>(index: number, value: [T, number]): number {\n return compareNumbers(index, value[1]);\n }\n}\n"]}
@@ -215,13 +215,11 @@ class ItemHandler {
215
215
  deselect() { }
216
216
  // eslint-disable-next-line @itwin/prefer-get
217
217
  isSelected() {
218
- var _a;
219
218
  // istanbul ignore next
220
- return !!((_a = this._node) === null || _a === void 0 ? void 0 : _a.isSelected);
219
+ return !!this._node?.isSelected;
221
220
  }
222
221
  item() {
223
- var _a, _b;
224
- return (_b = (_a = this._node) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : "";
222
+ return this._node?.id ?? "";
225
223
  }
226
224
  }
227
225
  //# sourceMappingURL=TreeSelectionManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeSelectionManager.js","sourceRoot":"","sources":["../../../../../../src/components-react/tree/controlled/internal/TreeSelectionManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,+BAA+B;AAC/B,sDAAgD;AAKhD,iFAA8E;AAI9E,4CAA+C;AAC/C,kDAI2B;AA2B3B,gBAAgB;AAChB,SAAgB,gBAAgB,CAAC,SAAc;IAC7C,OAAO,CACL,SAAS;QACT,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ;QAClC,OAAO,SAAS,CAAC,EAAE,KAAK,QAAQ,CACjC,CAAC;AACJ,CAAC;AAND,4CAMC;AAED,gBAAgB;AAChB,MAAa,oBAAoB;IAc/B,YACE,aAA4B,EAC5B,eAAuC;QANlC,uBAAkB,GAAG,IAAI,wBAAS,EAA8B,CAAC;QACjE,wBAAmB,GAAG,IAAI,wBAAS,EAA6B,CAAC;QACjE,oBAAe,GAAG,IAAI,wBAAS,EAA2B,CAAC;QAuK1D,qBAAgB,GAAG,CACzB,CAAsB,EACtB,OAAoB,EACpB,SAAkB,EAClB,EAAE;YACF,MAAM,e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K,CAAC;iBACd;gBAED,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAChE,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC;YAC/C,CAAC;YACD,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM;SACnB,CAAC;QAEF,OAAO,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;IACzD,CAAC;IAEM,aAAa,CAAC,KAA0B,EAAE,OAAoB;QACnE,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAEM,WAAW,CAAC,KAA0B,EAAE,OAAoB;QACjE,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;CAkEF;AAnPD,oDAmPC;AAID,SAAS,qBAAqB,CAC5B,SAAgC;IAEhC,OAAO,OAAO,SAAS,KAAK,QAAQ,CAAC;AACvC,CAAC;AAED,MAAM,WAAW;IAGf,YAAY,IAA+B;QACzC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,gCAAgC;IACzB,SAAS,KAAI,CAAC;IAErB,gCAAgC;IACzB,MAAM,KAAI,CAAC;IAElB,gCAAgC;IACzB,QAAQ,KAAI,CAAC;IAEpB,6CAA6C;IACtC,UAAU;;QACf,uBAAuB;QACvB,OAAO,CAAC,CAAC,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU,CAAA,CAAC;IAClC,CAAC;IAEM,IAAI;;QACT,OAAO,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,EAAE,mCAAI,EAAE,CAAC;IAC9B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tree\n */\n\nimport type { Observable } from \"rxjs\";\nimport { Subject } from \"rxjs\";\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport type {\n MultiSelectionHandler,\n SingleSelectionHandler,\n} from \"../../../common/selection/SelectionHandler\";\nimport { SelectionHandler } from \"../../../common/selection/SelectionHandler\";\nimport type { SelectionMode } from \"../../../common/selection/SelectionModes\";\nimport type { TreeActions } from \"../TreeActions\";\nimport type { TreeModelNode, VisibleTreeNodes } from \"../TreeModel\";\nimport { isTreeModelNode } from \"../TreeModel\";\nimport {\n isNavigationKey,\n ItemKeyboardNavigator,\n Orientation,\n} from \"@itwin/core-react\";\n\n/** @internal */\nexport interface SelectionReplacementEvent {\n selectedNodeIds: IndividualSelection | RangeSelection;\n}\n\n/** @internal */\nexport interface SelectionModificationEvent {\n selectedNodes: IndividualSelection | RangeSelection;\n deselectedNodes: IndividualSelection;\n}\n\n/** @internal */\nexport interface DragSelectionStartEvent {\n selectionChanges: Observable<SelectionModificationEvent>;\n}\n\n/** @internal */\nexport type IndividualSelection = string[];\n\n/** @internal */\nexport interface RangeSelection {\n from: string;\n to: string;\n}\n\n/** @internal */\nexport function isRangeSelection(selection: any): selection is RangeSelection {\n return (\n selection &&\n typeof selection.from === \"string\" &&\n typeof selection.to === \"string\"\n );\n}\n\n/** @internal */\nexport class TreeSelectionManager\n implements\n Pick<TreeActions, \"onNodeClicked\" | \"onNodeMouseDown\" | \"onNodeMouseMove\">\n{\n private _selectionHandler: SelectionHandler<Selection>;\n private _dragSelectionOperation?: Subject<SelectionModificationEvent>;\n private _itemHandlers: Array<Array<SingleSelectionHandler<string>>>;\n\n private _getVisibleNodes: () => VisibleTreeNodes;\n\n public onSelectionChanged = new BeUiEvent<SelectionModificationEvent>();\n public onSelectionReplaced = new BeUiEvent<SelectionReplacementEvent>();\n public onDragSelection = new BeUiEvent<DragSelectionStartEvent>();\n\n constructor(\n selectionMode: SelectionMode,\n getVisibleNodes: () => VisibleTreeNodes\n ) {\n this._getVisibleNodes = getVisibleNodes;\n\n const onItemsSelected = (selections: Selection[], replacement: boolean) => {\n // Assumes that `selections` will only contain either a list of\n // `IndividualSelection` items or a single `RangeSelection` item.\n if (isIndividualSelection(selections[0])) {\n if (replacement) {\n this.onSelectionReplaced.emit({\n selectedNodeIds: selections as IndividualSelection,\n });\n } else {\n this.onSelectionChanged.emit({\n selectedNodes: selections as IndividualSelection,\n deselectedNodes: [],\n });\n }\n } else {\n if (replacement) {\n this.onSelectionReplaced.emit({\n selectedNodeIds: selections[0],\n });\n } else {\n this.onSelectionChanged.emit({\n selectedNodes: selections[0],\n deselectedNodes: [],\n });\n }\n }\n };\n\n const onItemsDeselected = (deselections: Selection[]) => {\n // Assumes that this will be always called with `IndividualSelection` items\n this.onSelectionChanged.emit({\n selectedNodes: [],\n deselectedNodes: deselections as IndividualSelection,\n });\n };\n\n this._selectionHandler = new SelectionHandler(\n selectionMode,\n onItemsSelected,\n onItemsDeselected\n );\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n const itemHandlers = new Proxy(\n {},\n {\n get(_target, prop) {\n if (prop === \"length\") {\n return _this._getVisibleNodes().getNumNodes();\n }\n\n const index: number = +(prop as string);\n const node = _this.getVisibleNodeAtIndex(\n _this._getVisibleNodes(),\n index\n );\n return new ItemHandler(node);\n },\n }\n ) as Array<SingleSelectionHandler<string>>;\n this._itemHandlers = [itemHandlers];\n }\n\n private getVisibleNodeAtIndex(\n nodes: VisibleTreeNodes | undefined,\n index: number\n ): TreeModelNode | undefined {\n const foundNode =\n nodes !== undefined\n ? nodes.getAtIndex(index)\n : /* istanbul ignore next */ undefined;\n return isTreeModelNode(foundNode) ? foundNode : undefined;\n }\n\n public onNodeClicked(nodeId: string, event: React.MouseEvent) {\n const selectionFunc = this._selectionHandler.createSelectionFunction(\n ...this.createSelectionHandlers(nodeId)\n );\n selectionFunc(event.shiftKey, event.ctrlKey);\n }\n\n public onNodeMouseDown(nodeId: string) {\n this._selectionHandler.createDragAction(\n this.createSelectionHandlers(nodeId)[0],\n this._itemHandlers,\n nodeId\n );\n window.addEventListener(\n \"mouseup\",\n () => {\n /* istanbul ignore else */\n if (this._dragSelectionOperation) {\n this._selectionHandler.completeDragAction();\n this._dragSelectionOperation.complete();\n this._dragSelectionOperation = undefined;\n }\n },\n { once: true }\n );\n this._dragSelectionOperation = new Subject();\n this.onDragSelection.emit({\n selectionChanges: this._dragSelectionOperation,\n });\n }\n\n public onNodeMouseMove(nodeId: string) {\n this._selectionHandler.updateDragAction(nodeId);\n }\n\n private createSelectionHandlers(\n nodeId: string\n ): [MultiSelectionHandler<Selection>, SingleSelectionHandler<string>] {\n let deselectedAll = false;\n const multiSelectionHandler: MultiSelectionHandler<Selection> = {\n selectBetween: (item1, item2) => [\n { from: item1 as string, to: item2 as string },\n ],\n updateSelection: (selections, deselections) => {\n // Assumes `updateSelection` will never be called with selection ranges\n const selectedNodeIds = selections as string[];\n const deselectedNodeIds = deselections as string[];\n this._dragSelectionOperation!.next({\n selectedNodes: selectedNodeIds,\n deselectedNodes: deselectedNodeIds,\n });\n },\n deselectAll: () => {\n deselectedAll = true;\n },\n areEqual: (item1, item2) => item1 === item2,\n };\n\n const singleSelectionHandler: SingleSelectionHandler<string> = {\n preselect: () => {},\n select: () => {},\n deselect: () => {},\n isSelected: () => {\n if (deselectedAll) {\n return false;\n }\n\n const node = this._getVisibleNodes().getModel().getNode(nodeId);\n return node !== undefined && node.isSelected;\n },\n item: () => nodeId,\n };\n\n return [multiSelectionHandler, singleSelectionHandler];\n }\n\n public onTreeKeyDown(event: React.KeyboardEvent, actions: TreeActions): void {\n this._onKeyboardEvent(event, actions, true);\n }\n\n public onTreeKeyUp(event: React.KeyboardEvent, actions: TreeActions): void {\n this._onKeyboardEvent(event, actions, false);\n }\n\n private _onKeyboardEvent = (\n e: React.KeyboardEvent,\n actions: TreeActions,\n isKeyDown: boolean\n ) => {\n const processedNodeId = this._selectionHandler.processedItem;\n if (!isNavigationKey(e.key) || !isIndividualSelection(processedNodeId)) {\n return;\n }\n\n const isExpandable = (node: TreeModelNode): boolean =>\n !node.isLoading && node.numChildren !== 0;\n const isEditing = (node: TreeModelNode): boolean =>\n node.editingInfo !== undefined;\n\n const processedNode = this._getVisibleNodes()\n .getModel()\n .getNode(processedNodeId);\n\n // istanbul ignore if\n if (!processedNode || isEditing(processedNode)) return;\n\n const handleKeyboardSelectItem = (index: number) => {\n const node = this.getVisibleNodeAtIndex(this._getVisibleNodes(), index);\n // istanbul ignore if\n if (!node || isEditing(node)) return;\n\n const selectionFunc = this._selectionHandler.createSelectionFunction(\n ...this.createSelectionHandlers(node.id)\n );\n selectionFunc(e.shiftKey, e.ctrlKey);\n };\n const handleKeyboardActivateItem = (_index: number) => {\n if (isExpandable(processedNode)) {\n if (!processedNode.isExpanded) actions.onNodeExpanded(processedNode.id);\n else actions.onNodeCollapsed(processedNode.id);\n } else {\n actions.onNodeEditorActivated(processedNode.id);\n }\n };\n const handleCrossAxisArrowKey = (forward: boolean) => {\n if (!isExpandable(processedNode)) return;\n\n if (forward && !processedNode.isExpanded)\n actions.onNodeExpanded(processedNode.id);\n else if (!forward && processedNode.isExpanded)\n actions.onNodeCollapsed(processedNode.id);\n };\n\n const itemKeyboardNavigator = new ItemKeyboardNavigator(\n handleKeyboardSelectItem,\n handleKeyboardActivateItem\n );\n itemKeyboardNavigator.orientation = Orientation.Vertical;\n itemKeyboardNavigator.crossAxisArrowKeyHandler = handleCrossAxisArrowKey;\n itemKeyboardNavigator.allowWrap = false;\n itemKeyboardNavigator.itemCount = this._getVisibleNodes().getNumNodes();\n\n const processedNodeIndex =\n this._getVisibleNodes().getIndexOfNode(processedNodeId);\n isKeyDown\n ? itemKeyboardNavigator.handleKeyDownEvent(e, processedNodeIndex)\n : itemKeyboardNavigator.handleKeyUpEvent(e, processedNodeIndex);\n };\n}\n\ntype Selection = string | RangeSelection;\n\nfunction isIndividualSelection(\n selection: Selection | undefined\n): selection is string {\n return typeof selection === \"string\";\n}\n\nclass ItemHandler implements SingleSelectionHandler<string> {\n private _node: TreeModelNode | undefined;\n\n constructor(node: TreeModelNode | undefined) {\n this._node = node;\n }\n\n /* istanbul ignore next: noop */\n public preselect() {}\n\n /* istanbul ignore next: noop */\n public select() {}\n\n /* istanbul ignore next: noop */\n public deselect() {}\n\n // eslint-disable-next-line @itwin/prefer-get\n public isSelected(): boolean {\n // istanbul ignore next\n return !!this._node?.isSelected;\n }\n\n public item(): string {\n return this._node?.id ?? \"\";\n }\n}\n"]}
1
+ {"version":3,"file":"TreeSelectionManager.js","sourceRoot":"","sources":["../../../../../../src/components-react/tree/controlled/internal/TreeSelectionManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,+BAA+B;AAC/B,sDAAgD;AAKhD,iFAA8E;AAI9E,4CAA+C;AAC/C,kDAI2B;AA2B3B,gBAAgB;AAChB,SAAgB,gBAAgB,CAAC,SAAc;IAC7C,OAAO,CACL,SAAS;QACT,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ;QAClC,OAAO,SAAS,CAAC,EAAE,KAAK,QAAQ,CACjC,CAAC;AACJ,CAAC;AAND,4CAMC;AAED,gBAAgB;AAChB,MAAa,oBAAoB;IAc/B,YACE,aAA4B,EAC5B,eAAuC;QANlC,uBAAkB,GAAG,IAAI,wBAAS,EAA8B,CAAC;QACjE,wBAAmB,GAAG,IAAI,wBAAS,EAA6B,CAAC;QACjE,oBAAe,GAAG,IAAI,wBAAS,EAA2B,CAAC;QAuK1D,qBAAgB,GAAG,CACzB,CAAsB,EACtB,OAAoB,EACpB,SAAkB,EAClB,EAAE;YACF,MAAM,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC;YAC7D,IAAI,CAAC,IAAA,4BAAe,EAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,eAAe,CAAC,EAAE;gBACtE,OAAO;aACR;YAED,MAAM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C/C,CAAC;YACD,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM;SACnB,CAAC;QAEF,OAAO,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;IACzD,CAAC;IAEM,aAAa,CAAC,KAA0B,EAAE,OAAoB;QACnE,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAEM,WAAW,CAAC,KAA0B,EAAE,OAAoB;QACjE,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;CAkEF;AAnPD,oDAmPC;AAID,SAAS,qBAAqB,CAC5B,SAAgC;IAEhC,OAAO,OAAO,SAAS,KAAK,QAAQ,CAAC;AACvC,CAAC;AAED,MAAM,WAAW;IAGf,YAAY,IAA+B;QACzC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,gCAAgC;IACzB,SAAS,KAAI,CAAC;IAErB,gCAAgC;IACzB,MAAM,KAAI,CAAC;IAElB,gCAAgC;IACzB,QAAQ,KAAI,CAAC;IAEpB,6CAA6C;IACtC,UAAU;QACf,uBAAuB;QACvB,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC;IAClC,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC;IAC9B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tree\n */\n\nimport type { Observable } from \"rxjs\";\nimport { Subject } from \"rxjs\";\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport type {\n MultiSelectionHandler,\n SingleSelectionHandler,\n} from \"../../../common/selection/SelectionHandler\";\nimport { SelectionHandler } from \"../../../common/selection/SelectionHandler\";\nimport type { SelectionMode } from \"../../../common/selection/SelectionModes\";\nimport type { TreeActions } from \"../TreeActions\";\nimport type { TreeModelNode, VisibleTreeNodes } from \"../TreeModel\";\nimport { isTreeModelNode } from \"../TreeModel\";\nimport {\n isNavigationKey,\n ItemKeyboardNavigator,\n Orientation,\n} from \"@itwin/core-react\";\n\n/** @internal */\nexport interface SelectionReplacementEvent {\n selectedNodeIds: IndividualSelection | RangeSelection;\n}\n\n/** @internal */\nexport interface SelectionModificationEvent {\n selectedNodes: IndividualSelection | RangeSelection;\n deselectedNodes: IndividualSelection;\n}\n\n/** @internal */\nexport interface DragSelectionStartEvent {\n selectionChanges: Observable<SelectionModificationEvent>;\n}\n\n/** @internal */\nexport type IndividualSelection = string[];\n\n/** @internal */\nexport interface RangeSelection {\n from: string;\n to: string;\n}\n\n/** @internal */\nexport function isRangeSelection(selection: any): selection is RangeSelection {\n return (\n selection &&\n typeof selection.from === \"string\" &&\n typeof selection.to === \"string\"\n );\n}\n\n/** @internal */\nexport class TreeSelectionManager\n implements\n Pick<TreeActions, \"onNodeClicked\" | \"onNodeMouseDown\" | \"onNodeMouseMove\">\n{\n private _selectionHandler: SelectionHandler<Selection>;\n private _dragSelectionOperation?: Subject<SelectionModificationEvent>;\n private _itemHandlers: Array<Array<SingleSelectionHandler<string>>>;\n\n private _getVisibleNodes: () => VisibleTreeNodes;\n\n public onSelectionChanged = new BeUiEvent<SelectionModificationEvent>();\n public onSelectionReplaced = new BeUiEvent<SelectionReplacementEvent>();\n public onDragSelection = new BeUiEvent<DragSelectionStartEvent>();\n\n constructor(\n selectionMode: SelectionMode,\n getVisibleNodes: () => VisibleTreeNodes\n ) {\n this._getVisibleNodes = getVisibleNodes;\n\n const onItemsSelected = (selections: Selection[], replacement: boolean) => {\n // Assumes that `selections` will only contain either a list of\n // `IndividualSelection` items or a single `RangeSelection` item.\n if (isIndividualSelection(selections[0])) {\n if (replacement) {\n this.onSelectionReplaced.emit({\n selectedNodeIds: selections as IndividualSelection,\n });\n } else {\n this.onSelectionChanged.emit({\n selectedNodes: selections as IndividualSelection,\n deselectedNodes: [],\n });\n }\n } else {\n if (replacement) {\n this.onSelectionReplaced.emit({\n selectedNodeIds: selections[0],\n });\n } else {\n this.onSelectionChanged.emit({\n selectedNodes: selections[0],\n deselectedNodes: [],\n });\n }\n }\n };\n\n const onItemsDeselected = (deselections: Selection[]) => {\n // Assumes that this will be always called with `IndividualSelection` items\n this.onSelectionChanged.emit({\n selectedNodes: [],\n deselectedNodes: deselections as IndividualSelection,\n });\n };\n\n this._selectionHandler = new SelectionHandler(\n selectionMode,\n onItemsSelected,\n onItemsDeselected\n );\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n const itemHandlers = new Proxy(\n {},\n {\n get(_target, prop) {\n if (prop === \"length\") {\n return _this._getVisibleNodes().getNumNodes();\n }\n\n const index: number = +(prop as string);\n const node = _this.getVisibleNodeAtIndex(\n _this._getVisibleNodes(),\n index\n );\n return new ItemHandler(node);\n },\n }\n ) as Array<SingleSelectionHandler<string>>;\n this._itemHandlers = [itemHandlers];\n }\n\n private getVisibleNodeAtIndex(\n nodes: VisibleTreeNodes | undefined,\n index: number\n ): TreeModelNode | undefined {\n const foundNode =\n nodes !== undefined\n ? nodes.getAtIndex(index)\n : /* istanbul ignore next */ undefined;\n return isTreeModelNode(foundNode) ? foundNode : undefined;\n }\n\n public onNodeClicked(nodeId: string, event: React.MouseEvent) {\n const selectionFunc = this._selectionHandler.createSelectionFunction(\n ...this.createSelectionHandlers(nodeId)\n );\n selectionFunc(event.shiftKey, event.ctrlKey);\n }\n\n public onNodeMouseDown(nodeId: string) {\n this._selectionHandler.createDragAction(\n this.createSelectionHandlers(nodeId)[0],\n this._itemHandlers,\n nodeId\n );\n window.addEventListener(\n \"mouseup\",\n () => {\n /* istanbul ignore else */\n if (this._dragSelectionOperation) {\n this._selectionHandler.completeDragAction();\n this._dragSelectionOperation.complete();\n this._dragSelectionOperation = undefined;\n }\n },\n { once: true }\n );\n this._dragSelectionOperation = new Subject();\n this.onDragSelection.emit({\n selectionChanges: this._dragSelectionOperation,\n });\n }\n\n public onNodeMouseMove(nodeId: string) {\n this._selectionHandler.updateDragAction(nodeId);\n }\n\n private createSelectionHandlers(\n nodeId: string\n ): [MultiSelectionHandler<Selection>, SingleSelectionHandler<string>] {\n let deselectedAll = false;\n const multiSelectionHandler: MultiSelectionHandler<Selection> = {\n selectBetween: (item1, item2) => [\n { from: item1 as string, to: item2 as string },\n ],\n updateSelection: (selections, deselections) => {\n // Assumes `updateSelection` will never be called with selection ranges\n const selectedNodeIds = selections as string[];\n const deselectedNodeIds = deselections as string[];\n this._dragSelectionOperation!.next({\n selectedNodes: selectedNodeIds,\n deselectedNodes: deselectedNodeIds,\n });\n },\n deselectAll: () => {\n deselectedAll = true;\n },\n areEqual: (item1, item2) => item1 === item2,\n };\n\n const singleSelectionHandler: SingleSelectionHandler<string> = {\n preselect: () => {},\n select: () => {},\n deselect: () => {},\n isSelected: () => {\n if (deselectedAll) {\n return false;\n }\n\n const node = this._getVisibleNodes().getModel().getNode(nodeId);\n return node !== undefined && node.isSelected;\n },\n item: () => nodeId,\n };\n\n return [multiSelectionHandler, singleSelectionHandler];\n }\n\n public onTreeKeyDown(event: React.KeyboardEvent, actions: TreeActions): void {\n this._onKeyboardEvent(event, actions, true);\n }\n\n public onTreeKeyUp(event: React.KeyboardEvent, actions: TreeActions): void {\n this._onKeyboardEvent(event, actions, false);\n }\n\n private _onKeyboardEvent = (\n e: React.KeyboardEvent,\n actions: TreeActions,\n isKeyDown: boolean\n ) => {\n const processedNodeId = this._selectionHandler.processedItem;\n if (!isNavigationKey(e.key) || !isIndividualSelection(processedNodeId)) {\n return;\n }\n\n const isExpandable = (node: TreeModelNode): boolean =>\n !node.isLoading && node.numChildren !== 0;\n const isEditing = (node: TreeModelNode): boolean =>\n node.editingInfo !== undefined;\n\n const processedNode = this._getVisibleNodes()\n .getModel()\n .getNode(processedNodeId);\n\n // istanbul ignore if\n if (!processedNode || isEditing(processedNode)) return;\n\n const handleKeyboardSelectItem = (index: number) => {\n const node = this.getVisibleNodeAtIndex(this._getVisibleNodes(), index);\n // istanbul ignore if\n if (!node || isEditing(node)) return;\n\n const selectionFunc = this._selectionHandler.createSelectionFunction(\n ...this.createSelectionHandlers(node.id)\n );\n selectionFunc(e.shiftKey, e.ctrlKey);\n };\n const handleKeyboardActivateItem = (_index: number) => {\n if (isExpandable(processedNode)) {\n if (!processedNode.isExpanded) actions.onNodeExpanded(processedNode.id);\n else actions.onNodeCollapsed(processedNode.id);\n } else {\n actions.onNodeEditorActivated(processedNode.id);\n }\n };\n const handleCrossAxisArrowKey = (forward: boolean) => {\n if (!isExpandable(processedNode)) return;\n\n if (forward && !processedNode.isExpanded)\n actions.onNodeExpanded(processedNode.id);\n else if (!forward && processedNode.isExpanded)\n actions.onNodeCollapsed(processedNode.id);\n };\n\n const itemKeyboardNavigator = new ItemKeyboardNavigator(\n handleKeyboardSelectItem,\n handleKeyboardActivateItem\n );\n itemKeyboardNavigator.orientation = Orientation.Vertical;\n itemKeyboardNavigator.crossAxisArrowKeyHandler = handleCrossAxisArrowKey;\n itemKeyboardNavigator.allowWrap = false;\n itemKeyboardNavigator.itemCount = this._getVisibleNodes().getNumNodes();\n\n const processedNodeIndex =\n this._getVisibleNodes().getIndexOfNode(processedNodeId);\n isKeyDown\n ? itemKeyboardNavigator.handleKeyDownEvent(e, processedNodeIndex)\n : itemKeyboardNavigator.handleKeyUpEvent(e, processedNodeIndex);\n };\n}\n\ntype Selection = string | RangeSelection;\n\nfunction isIndividualSelection(\n selection: Selection | undefined\n): selection is string {\n return typeof selection === \"string\";\n}\n\nclass ItemHandler implements SingleSelectionHandler<string> {\n private _node: TreeModelNode | undefined;\n\n constructor(node: TreeModelNode | undefined) {\n this._node = node;\n }\n\n /* istanbul ignore next: noop */\n public preselect() {}\n\n /* istanbul ignore next: noop */\n public select() {}\n\n /* istanbul ignore next: noop */\n public deselect() {}\n\n // eslint-disable-next-line @itwin/prefer-get\n public isSelected(): boolean {\n // istanbul ignore next\n return !!this._node?.isSelected;\n }\n\n public item(): string {\n return this._node?.id ?? \"\";\n }\n}\n"]}
@@ -61,8 +61,11 @@ export * from "./components-react/filter-builder/FilterBuilder";
61
61
  export * from "./components-react/filter-builder/FilterBuilderRuleOperator";
62
62
  export * from "./components-react/filter-builder/FilterBuilderState";
63
63
  export * from "./components-react/filter-builder/FilterBuilderRuleValue";
64
+ export * from "./components-react/filter-builder/FilterBuilderRangeValue";
64
65
  export * from "./components-react/filter-builder/Operators";
65
66
  export * from "./components-react/filter-builder/Types";
67
+ export * from "./components-react/filter-builder/FilterBuilderLogicalOperator";
68
+ export * from "./components-react/filter-builder/FilterBuilderToolbar";
66
69
  export * from "./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer";
67
70
  export * from "./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer";
68
71
  export * from "./components-react/properties/renderers/label/PropertyLabelRenderer";
@@ -1 +1 @@
1
- {"version":3,"file":"components-react.d.ts","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sDAAsD,CAAC;AACrE,cAAc,yCAAyC,CAAC;AACxD,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC;AAEpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,oDAAoD,CAAC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,qDAAqD,CAAC;AACpE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AACzE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+DAA+D,CAAC;AAC9E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
1
+ {"version":3,"file":"components-react.d.ts","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sDAAsD,CAA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GG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
@@ -84,8 +84,11 @@ __exportStar(require("./components-react/filter-builder/FilterBuilder"), exports
84
84
  __exportStar(require("./components-react/filter-builder/FilterBuilderRuleOperator"), exports);
85
85
  __exportStar(require("./components-react/filter-builder/FilterBuilderState"), exports);
86
86
  __exportStar(require("./components-react/filter-builder/FilterBuilderRuleValue"), exports);
87
+ __exportStar(require("./components-react/filter-builder/FilterBuilderRangeValue"), exports);
87
88
  __exportStar(require("./components-react/filter-builder/Operators"), exports);
88
89
  __exportStar(require("./components-react/filter-builder/Types"), exports);
90
+ __exportStar(require("./components-react/filter-builder/FilterBuilderLogicalOperator"), exports);
91
+ __exportStar(require("./components-react/filter-builder/FilterBuilderToolbar"), exports);
89
92
  __exportStar(require("./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer"), exports);
90
93
  __exportStar(require("./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer"), exports);
91
94
  __exportStar(require("./components-react/properties/renderers/label/PropertyLabelRenderer"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;AAEhG,qEAAqE;AAErE,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AAErB,kEAAgD;AAChD,wEAAsD;AACtD,qFAAmE;AACnE,uFAAqE;AACrE,4EAA0D;AAC1D,yEAAuD;AACvD,uFAAqE;AACrE,0EAAwD;AACxD,mFAAiE;AACjE,sEAAoD;AAEpD,8EAA4D;AAC5D,qFAAmE;AACnE,qFAAmE;AACnE,sFAAoE;AACpE,kFAAgE;AAChE,yFAAuE;AACvE,gGAA8E;AAC9E,qFAAmE;AACnE,mFAAiE;AACjE,oFAAkE;AAClE,uFAAqE;AAErE,0FAAwE;AAExE,0EAAwD;AACxD,2EAAyD;AACzD,sFAAoE;AACpE,8EAA4D;A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A4D;AAC5D,8EAA4D;AAE5D,sFAAoE;AACpE,uEAAqD;AACrD,+EAA6D;AAC7D,qEAAmD;AACnD,iFAA+D;AAC/D,kEAAgD;AAChD,iFAA+D;AAE/D,2EAAyD;AACzD,iFAA+D;AAC/D,6EAA2D;AAC3D,sEAAoD;AACpD,iFAA+D;AAC/D,yFAAuE;AACvE,sFAAoE;AACpE,gFAA8D;AAC9D,+EAA6D;AAC7D,qFAAmE;AACnE,oFAAkE;AAClE,gFAA8D;AAC9D,+EAA6D;AAC7D,8FAA4E;AAC5E,2FAAyE;AACzE,8FAA4E;AAC5E,gGAA8E;AAC9E,4FAA0E;AAC1E,yFAAuE;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\n\nexport { UiComponents } from \"./components-react/UiComponents\";\n\nexport * from \"./components-react/common/Links\";\nexport * from \"./components-react/common/PageOptions\";\nexport * from \"./components-react/common/selection/SelectionModes\";\nexport * from \"./components-react/common/HighlightingComponentProps\";\nexport * from \"./components-react/common/HighlightedText\";\nexport * from \"./components-react/common/IImageLoader\";\nexport * from \"./components-react/common/selection/SelectionHandler\";\nexport * from \"./components-react/common/UseAsyncValue\";\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\nexport * from \"./components-react/common/DateUtils\";\n\nexport * from \"./components-react/converters/TypeConverter\";\nexport * from \"./components-react/converters/TypeConverterManager\";\nexport * from \"./components-react/converters/BooleanTypeConverter\";\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\nexport * from \"./components-react/converters/EnumTypeConverter\";\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\nexport * from \"./components-react/converters/NumericTypeConverter\";\nexport * from \"./components-react/converters/PointTypeConverter\";\nexport * from \"./components-react/converters/StringTypeConverter\";\nexport * from \"./components-react/converters/CompositeTypeConverter\";\n\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\n\nexport * from \"./components-react/datepicker/DateField\";\nexport * from \"./components-react/datepicker/DatePicker\";\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\nexport * from \"./components-react/datepicker/IntlFormatter\";\nexport * from \"./components-react/datepicker/TimeField\";\n\nexport * from \"./components-react/editors/BooleanEditor\";\nexport * from \"./components-react/editors/CustomNumberEditor\";\nexport * from \"./components-react/editors/DateTimeEditor\";\nexport * from \"./components-react/editors/EditorContainer\";\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\nexport * from \"./components-react/editors/EnumEditor\";\nexport * from \"./components-react/editors/IconEditor\";\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\nexport * from \"./components-react/editors/NumericInputEditor\";\nexport * from \"./components-react/editors/PropertyEditorManager\";\nexport * from \"./components-react/editors/SliderEditor\";\nexport * from \"./components-react/editors/TextEditor\";\nexport * from \"./components-react/editors/TextareaEditor\";\nexport * from \"./components-react/editors/ToggleEditor\";\n\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\nexport * from \"./components-react/favorite/FavoritePropertyList\";\n\nexport * from \"./components-react/filtering/FilteringInput\";\nexport * from \"./components-react/filtering/ResultSelector\";\n\nexport * from \"./components-react/inputs/ParsedInput\";\n\nexport * from \"./components-react/properties/LinkHandler\";\nexport * from \"./components-react/properties/ValueRendererManager\";\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyView\";\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\n\nexport * from \"./components-react/filter-builder/FilterBuilder\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleOperator\";\nexport * from \"./components-react/filter-builder/FilterBuilderState\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleValue\";\nexport * from \"./components-react/filter-builder/Operators\";\nexport * from \"./components-react/filter-builder/Types\";\n\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\n\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\nexport * from \"./components-react/properties/ItemStyle\";\n\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\nexport * from \"./components-react/propertygrid/component/PropertyList\";\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\n\nexport * from \"./components-react/selectable-content/SelectableContent\";\n\n// TODO: toolbar/groupPanel components needs a refactor.\nexport * from \"./components-react/toolbar/groupPanel/tool/Tool\";\n\nexport * from \"./components-react/toolbar/groupPanel/Column\";\nexport * from \"./components-react/toolbar/groupPanel/Columns\";\nexport * from \"./components-react/toolbar/groupPanel/Panel\";\nexport * from \"./components-react/toolbar/groupPanel/Title\";\n\nexport * from \"./components-react/toolbar/InternalToolbarComponent\";\nexport * from \"./components-react/toolbar/PopupItem\";\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\nexport * from \"./components-react/toolbar/Toolbar\";\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\nexport * from \"./components-react/toolbar/Item\";\nexport * from \"./components-react/toolbar/utilities/Direction\";\n\nexport * from \"./components-react/tree/TreeDataProvider\";\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\nexport * from \"./components-react/tree/HighlightingEngine\";\nexport * from \"./components-react/tree/ImageLoader\";\nexport * from \"./components-react/tree/controlled/TreeActions\";\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\nexport * from \"./components-react/tree/controlled/TreeEvents\";\nexport * from \"./components-react/tree/controlled/TreeModel\";\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\nexport * from \"./components-react/tree/controlled/Observable\";\nexport * from \"./components-react/tree/controlled/TreeHooks\";\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\nexport * from \"./components-react/tree/controlled/component/NodeContent\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\n\n/** @docs-package-description\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Breadcrumb\n * Classes and components for working with a Breadcrumb.\n * As of version 3.0, the Breadcrumb is deprecated.\n */\n/**\n * @docs-group-description Date\n * Classes, interfaces, and components for showing and setting date and time.\n */\n/**\n * @docs-group-description DragDrop\n * Classes and Higher Order Components for working with the DragDrop API.\n */\n/**\n * @docs-group-description Favorite\n * Classes and components for displaying favorite properties.\n */\n/**\n * @docs-group-description Filtering\n * Classes and components for working with filtering.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input.\n */\n/**\n * @docs-group-description SelectableContent\n * Classes and components for working with SelectableContent component.\n */\n/**\n * @docs-group-description Properties\n * Classes and components for working with Properties.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description PropertyGrid\n * Classes and components for working with a PropertyGrid.\n */\n/**\n * @docs-group-description Table\n * Classes and components for working with a Table.\n */\n/**\n * @docs-group-description Toolbar\n * Functions and components that provide a Toolbar.\n */\n/**\n * @docs-group-description Tree\n * Classes and components for working with a Tree.\n */\n/**\n * @docs-group-description TypeConverters\n * Classes for working with Type Converters.\n */\n/**\n * @docs-group-description PropertyFilterBuilder\n * Classes and components for working with PropertyFilterBuilder.\n */\n"]}
1
+ {"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;AAEhG,qEAAqE;AAErE,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AAErB,kEAAgD;AAChD,wEAAsD;AACtD,qFAAmE;AACnE,uFAAqE;AACrE,4EAA0D;AAC1D,yEAAuD;AACvD,uFAAqE;AACrE,0EAAwD;AACxD,mFAAiE;AACjE,sEAAoD;AAEpD,8EAA4D;AAC5D,qFAAmE;AACnE,qFAAmE;AACnE,sFAAoE;AACpE,kFAAgE;AAChE,yFAAuE;AACvE,gGAA8E;AAC9E,qFAAmE;AACnE,mFAAiE;AACjE,oFAAkE;AAClE,uFAAqE;AAErE,0FAAwE;AAExE,0EAAwD;AACxD,2EAAyD;AACzD,sFAAoE;AACpE,8EAA4D;AAC5D,0EAAwD;AAExD,2EAAyD;AACzD,gFAA8D;AAC9D,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;AAC5D,8EAA4D;AAE5D,sFAAoE;AACpE,uEAAqD;AACrD,+EAA6D;AAC7D,qEAAmD;AACnD,iFAA+D;AAC/D,kEAAgD;AAChD,iFAA+D;AAE/D,2EAAyD;AACzD,iFAA+D;AAC/D,6EAA2D;AAC3D,sEAAoD;AACpD,iFAA+D;AAC/D,yFAAuE;AACvE,sFAAoE;AACpE,gFAA8D;AAC9D,+EAA6D;AAC7D,qFAAmE;AACnE,oFAAkE;AAClE,gFAA8D;AAC9D,+EAA6D;AAC7D,8FAA4E;AAC5E,2FAAyE;AACzE,8FAA4E;AAC5E,gGAA8E;AAC9E,4FAA0E;AAC1E,yFAAuE;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\n\nexport { UiComponents } from \"./components-react/UiComponents\";\n\nexport * from \"./components-react/common/Links\";\nexport * from \"./components-react/common/PageOptions\";\nexport * from \"./components-react/common/selection/SelectionModes\";\nexport * from \"./components-react/common/HighlightingComponentProps\";\nexport * from \"./components-react/common/HighlightedText\";\nexport * from \"./components-react/common/IImageLoader\";\nexport * from \"./components-react/common/selection/SelectionHandler\";\nexport * from \"./components-react/common/UseAsyncValue\";\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\nexport * from \"./components-react/common/DateUtils\";\n\nexport * from \"./components-react/converters/TypeConverter\";\nexport * from \"./components-react/converters/TypeConverterManager\";\nexport * from \"./components-react/converters/BooleanTypeConverter\";\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\nexport * from \"./components-react/converters/EnumTypeConverter\";\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\nexport * from \"./components-react/converters/NumericTypeConverter\";\nexport * from \"./components-react/converters/PointTypeConverter\";\nexport * from \"./components-react/converters/StringTypeConverter\";\nexport * from \"./components-react/converters/CompositeTypeConverter\";\n\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\n\nexport * from \"./components-react/datepicker/DateField\";\nexport * from \"./components-react/datepicker/DatePicker\";\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\nexport * from \"./components-react/datepicker/IntlFormatter\";\nexport * from \"./components-react/datepicker/TimeField\";\n\nexport * from \"./components-react/editors/BooleanEditor\";\nexport * from \"./components-react/editors/CustomNumberEditor\";\nexport * from \"./components-react/editors/DateTimeEditor\";\nexport * from \"./components-react/editors/EditorContainer\";\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\nexport * from \"./components-react/editors/EnumEditor\";\nexport * from \"./components-react/editors/IconEditor\";\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\nexport * from \"./components-react/editors/NumericInputEditor\";\nexport * from \"./components-react/editors/PropertyEditorManager\";\nexport * from \"./components-react/editors/SliderEditor\";\nexport * from \"./components-react/editors/TextEditor\";\nexport * from \"./components-react/editors/TextareaEditor\";\nexport * from \"./components-react/editors/ToggleEditor\";\n\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\nexport * from \"./components-react/favorite/FavoritePropertyList\";\n\nexport * from \"./components-react/filtering/FilteringInput\";\nexport * from \"./components-react/filtering/ResultSelector\";\n\nexport * from \"./components-react/inputs/ParsedInput\";\n\nexport * from \"./components-react/properties/LinkHandler\";\nexport * from \"./components-react/properties/ValueRendererManager\";\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyView\";\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\n\nexport * from \"./components-react/filter-builder/FilterBuilder\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleOperator\";\nexport * from \"./components-react/filter-builder/FilterBuilderState\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleValue\";\nexport * from \"./components-react/filter-builder/FilterBuilderRangeValue\";\nexport * from \"./components-react/filter-builder/Operators\";\nexport * from \"./components-react/filter-builder/Types\";\nexport * from \"./components-react/filter-builder/FilterBuilderLogicalOperator\";\nexport * from \"./components-react/filter-builder/FilterBuilderToolbar\";\n\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\n\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\nexport * from \"./components-react/properties/ItemStyle\";\n\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\nexport * from \"./components-react/propertygrid/component/PropertyList\";\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\n\nexport * from \"./components-react/selectable-content/SelectableContent\";\n\n// TODO: toolbar/groupPanel components needs a refactor.\nexport * from \"./components-react/toolbar/groupPanel/tool/Tool\";\n\nexport * from \"./components-react/toolbar/groupPanel/Column\";\nexport * from \"./components-react/toolbar/groupPanel/Columns\";\nexport * from \"./components-react/toolbar/groupPanel/Panel\";\nexport * from \"./components-react/toolbar/groupPanel/Title\";\n\nexport * from \"./components-react/toolbar/InternalToolbarComponent\";\nexport * from \"./components-react/toolbar/PopupItem\";\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\nexport * from \"./components-react/toolbar/Toolbar\";\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\nexport * from \"./components-react/toolbar/Item\";\nexport * from \"./components-react/toolbar/utilities/Direction\";\n\nexport * from \"./components-react/tree/TreeDataProvider\";\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\nexport * from \"./components-react/tree/HighlightingEngine\";\nexport * from \"./components-react/tree/ImageLoader\";\nexport * from \"./components-react/tree/controlled/TreeActions\";\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\nexport * from \"./components-react/tree/controlled/TreeEvents\";\nexport * from \"./components-react/tree/controlled/TreeModel\";\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\nexport * from \"./components-react/tree/controlled/Observable\";\nexport * from \"./components-react/tree/controlled/TreeHooks\";\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\nexport * from \"./components-react/tree/controlled/component/NodeContent\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\n\n/** @docs-package-description\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Breadcrumb\n * Classes and components for working with a Breadcrumb.\n * As of version 3.0, the Breadcrumb is deprecated.\n */\n/**\n * @docs-group-description Date\n * Classes, interfaces, and components for showing and setting date and time.\n */\n/**\n * @docs-group-description DragDrop\n * Classes and Higher Order Components for working with the DragDrop API.\n */\n/**\n * @docs-group-description Favorite\n * Classes and components for displaying favorite properties.\n */\n/**\n * @docs-group-description Filtering\n * Classes and components for working with filtering.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input.\n */\n/**\n * @docs-group-description SelectableContent\n * Classes and components for working with SelectableContent component.\n */\n/**\n * @docs-group-description Properties\n * Classes and components for working with Properties.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description PropertyGrid\n * Classes and components for working with a PropertyGrid.\n */\n/**\n * @docs-group-description Table\n * Classes and components for working with a Table.\n */\n/**\n * @docs-group-description Toolbar\n * Functions and components that provide a Toolbar.\n */\n/**\n * @docs-group-description Tree\n * Classes and components for working with a Tree.\n */\n/**\n * @docs-group-description TypeConverters\n * Classes for working with Type Converters.\n */\n/**\n * @docs-group-description PropertyFilterBuilder\n * Classes and components for working with PropertyFilterBuilder.\n */\n"]}
@@ -19,6 +19,6 @@ export interface DelayedSpinnerProps {
19
19
  * Spinner that is rendered with delay.
20
20
  * @internal
21
21
  */
22
- export declare function DelayedSpinner(props: DelayedSpinnerProps): JSX.Element | null;
22
+ export declare function DelayedSpinner(props: DelayedSpinnerProps): React.JSX.Element | null;
23
23
  export {};
24
24
  //# sourceMappingURL=DelayedSpinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DelayedSpinner.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/DelayedSpinner.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,KAAK,mBAAmB,GAAG,KAAK,CAAC,wBAAwB,CACvD,OAAO,cAAc,CACtB,CAAC;AAEF,wCAAwC;AACxC,KAAK,cAAc,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,sBAuBxD"}
1
+ {"version":3,"file":"DelayedSpinner.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/DelayedSpinner.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,KAAK,mBAAmB,GAAG,KAAK,CAAC,wBAAwB,CACvD,OAAO,cAAc,CACtB,CAAC;AAEF,wCAAwC;AACxC,KAAK,cAAc,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,4BAuBxD"}
@@ -12,8 +12,7 @@ import { ProgressRadial } from "@itwin/itwinui-react";
12
12
  * @internal
13
13
  */
14
14
  export function DelayedSpinner(props) {
15
- var _a, _b;
16
- const delay = (_a = props.delay) !== null && _a !== void 0 ? _a : 500;
15
+ const delay = props.delay ?? 500;
17
16
  const [loadStart] = React.useState(props.loadStart || new Date());
18
17
  const currTime = new Date();
19
18
  const diff = currTime.getTime() - loadStart.getTime();
@@ -26,7 +25,7 @@ export function DelayedSpinner(props) {
26
25
  });
27
26
  if (diff < delay)
28
27
  return null;
29
- return (React.createElement(ProgressRadial, { "data-testid": "components-delayed-spinner", indeterminate: true, size: (_b = props.size) !== null && _b !== void 0 ? _b : "large" }));
28
+ return (React.createElement(ProgressRadial, { "data-testid": "components-delayed-spinner", indeterminate: true, size: props.size ?? "large" }));
30
29
  }
31
30
  const useForceUpdate = () => {
32
31
  const [value, set] = React.useState(true);
@@ -1 +1 @@
1
- {"version":3,"file":"DelayedSpinner.js","sourceRoot":"","sources":["../../../../src/components-react/common/DelayedSpinner.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAmBtD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;;IACvD,MAAM,KAAK,GAAG,MAAA,KAAK,CAAC,KAAK,mCAAI,GAAG,CAAC;IACjC,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;IAElE,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;IAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IAEtD,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,IAAI,IAAI,KAAK;YAAE,OAAO;QAC1B,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC;QAC/C,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,IAAI,IAAI,GAAG,KAAK;QAAE,OAAO,IAAI,CAAC;IAE9B,OAAO,CACL,oBAAC,cAAc,mBACD,4BAA4B,EACxC,aAAa,QACb,IAAI,EAAE,MAAA,KAAK,CAAC,IAAI,mCAAI,OAAO,GAC3B,CACH,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport * as React from \"react\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\ntype ProgressRadialProps = React.ComponentPropsWithoutRef<\n typeof ProgressRadial\n>;\n\n/** Type for ProgressRadialProps.size */\ntype RadialSizeType = ProgressRadialProps[\"size\"];\n\n/**\n * Props for [[DelayedSpinner]] component.\n * @internal\n */\nexport interface DelayedSpinnerProps {\n loadStart?: Date;\n delay?: number;\n size?: RadialSizeType;\n}\n\n/**\n * Spinner that is rendered with delay.\n * @internal\n */\nexport function DelayedSpinner(props: DelayedSpinnerProps) {\n const delay = props.delay ?? 500;\n const [loadStart] = React.useState(props.loadStart || new Date());\n\n const currTime = new Date();\n const diff = currTime.getTime() - loadStart.getTime();\n\n const update = useForceUpdate();\n React.useEffect(() => {\n if (diff >= delay) return;\n const timer = setTimeout(update, delay - diff);\n return () => clearTimeout(timer);\n });\n\n if (diff < delay) return null;\n\n return (\n <ProgressRadial\n data-testid=\"components-delayed-spinner\"\n indeterminate\n size={props.size ?? \"large\"}\n />\n );\n}\n\nconst useForceUpdate = () => {\n const [value, set] = React.useState(true);\n return () => set(!value);\n};\n"]}
1
+ {"version":3,"file":"DelayedSpinner.js","sourceRoot":"","sources":["../../../../src/components-react/common/DelayedSp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------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport * as React from \"react\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\ntype ProgressRadialProps = React.ComponentPropsWithoutRef<\n typeof ProgressRadial\n>;\n\n/** Type for ProgressRadialProps.size */\ntype RadialSizeType = ProgressRadialProps[\"size\"];\n\n/**\n * Props for [[DelayedSpinner]] component.\n * @internal\n */\nexport interface DelayedSpinnerProps {\n loadStart?: Date;\n delay?: number;\n size?: RadialSizeType;\n}\n\n/**\n * Spinner that is rendered with delay.\n * @internal\n */\nexport function DelayedSpinner(props: DelayedSpinnerProps) {\n const delay = props.delay ?? 500;\n const [loadStart] = React.useState(props.loadStart || new Date());\n\n const currTime = new Date();\n const diff = currTime.getTime() - loadStart.getTime();\n\n const update = useForceUpdate();\n React.useEffect(() => {\n if (diff >= delay) return;\n const timer = setTimeout(update, delay - diff);\n return () => clearTimeout(timer);\n });\n\n if (diff < delay) return null;\n\n return (\n <ProgressRadial\n data-testid=\"components-delayed-spinner\"\n indeterminate\n size={props.size ?? \"large\"}\n />\n );\n}\n\nconst useForceUpdate = () => {\n const [value, set] = React.useState(true);\n return () => set(!value);\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Common
3
3
  */
4
- /// <reference types="react" />
4
+ import React from "react";
5
5
  /**
6
6
  * Properties of [[HighlightedText]]
7
7
  * @public
@@ -19,5 +19,5 @@ export interface HighlightedTextProps {
19
19
  * Also actively highlights one matched part which is selected with 'activeMatchIndex'
20
20
  * @public
21
21
  */
22
- export declare function HighlightedText(props: HighlightedTextProps): JSX.Element;
22
+ export declare function HighlightedText(props: HighlightedTextProps): React.JSX.Element;
23
23
  //# sourceMappingURL=HighlightedText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HighlightedText.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/HighlightedText.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAMH;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IAEnC,UAAU,EAAE,MAAM,CAAC;IAEnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAa1D"}
1
+ {"version":3,"file":"HighlightedText.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/HighlightedText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IAEnC,UAAU,EAAE,MAAM,CAAC;IAEnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAa1D"}
@@ -18,7 +18,6 @@ import { scheduleSubscription, SubscriptionScheduler, } from "./SubscriptionSche
18
18
  * @beta
19
19
  */
20
20
  export function useDebouncedAsyncValue(valueToBeResolved) {
21
- var _a;
22
21
  const [scheduler] = useState(() => new SubscriptionScheduler());
23
22
  const [{ result, inProgress }, setState] = useState({
24
23
  result: undefined,
@@ -57,7 +56,7 @@ export function useDebouncedAsyncValue(valueToBeResolved) {
57
56
  };
58
57
  }, [valueToBeResolved, scheduler]);
59
58
  if (isErrorResult(result)) {
60
- throw (_a = result.error) !== null && _a !== void 0 ? _a : new Error("Exception in `useDebouncedAsyncValue`");
59
+ throw result.error ?? new Error("Exception in `useDebouncedAsyncValue`");
61
60
  }
62
61
  return { value: result, inProgress };
63
62
  }
@@ -1 +1 @@
1
- {"version":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AAI,EAAE,EAAE;gBACb,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;YACrE,CAAC;YACD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;gBACb,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBAClB,GAAG,IAAI;oBACP,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;oBACtC,UAAU,EAAE,KAAK;iBAClB,CAAC,CAAC,CAAC;YACN,CAAC;SACF,CAAC,CAAC;QAEL,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;IAEnC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;QACzB,MAAM,MAAA,MAAM,CAAC,KAAK,mCAAI,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;KAC1E;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AACvC,CAAC;AAOD,SAAS,aAAa,CACpB,GAA2B;IAE3B,OAAO,GAAG,KAAK,SAAS,IAAK,GAAmB,CAAC,QAAQ,CAAC;AAC5D,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport { useEffect, useState } from \"react\";\nimport { defer, share } from \"rxjs\";\nimport {\n scheduleSubscription,\n SubscriptionScheduler,\n} from \"./SubscriptionScheduler\";\n\n/**\n * Custom hook for working with promise values.\n * Promises are debounced using trailing and leading edge.\n * The first promise will always be executed.\n * Any promises following the first while it is executing will be scheduled (and unscheduled), leaving only the last promise to be resolved.\n * Once the first promise finishes resolving, the last passed promise starts resolving.\n * @throws if/when `valueToBeResolved` promise is rejected. The error is thrown in the React's render loop, so it can be caught using an error boundary.\n * @beta\n */\nexport function useDebouncedAsyncValue<TReturn>(\n valueToBeResolved: undefined | (() => Promise<TReturn>)\n) {\n const [scheduler] = useState(() => new SubscriptionScheduler<TReturn>());\n\n const [{ result, inProgress }, setState] = useState<{\n result: TReturn | ErrorResult | undefined;\n inProgress: boolean;\n }>({\n result: undefined,\n inProgress: false,\n });\n\n useEffect(() => {\n if (!valueToBeResolved) {\n setState((prev) => ({ ...prev, result: undefined, inProgress: false }));\n return;\n }\n\n setState((prev) => ({\n ...prev,\n inProgress: true,\n }));\n // schedule and subscribe to the observable emitting value from valueToBeResolved promise\n const subscription = defer(valueToBeResolved)\n .pipe(\n share({\n resetOnError: false,\n resetOnComplete: false,\n resetOnRefCountZero: true,\n }),\n scheduleSubscription(scheduler)\n )\n .subscribe({\n next: (data) => {\n setState((prev) => ({ ...prev, result: data, inProgress: false }));\n },\n error: (err) => {\n setState((prev) => ({\n ...prev,\n result: { error: err, hasError: true },\n inProgress: false,\n }));\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [valueToBeResolved, scheduler]);\n\n if (isErrorResult(result)) {\n throw result.error ?? new Error(\"Exception in `useDebouncedAsyncValue`\");\n }\n\n return { value: result, inProgress };\n}\n\ninterface ErrorResult {\n error: Error | undefined;\n hasError: boolean;\n}\n\nfunction isErrorResult<TResult>(\n obj?: TResult | ErrorResult\n): obj is ErrorResult {\n return obj !== undefined && (obj as ErrorResult).hasError;\n}\n"]}
1
+ {"version":3,"file":"UseDebouncedAsyncValue.js","sourceRoot":"","sources":["../../../../src/components-react/common/UseDebouncedAsyncValue.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,O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AAC,GAAG,EAAE,EAAE;gBACb,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBAClB,GAAG,IAAI;oBACP,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;oBACtC,UAAU,EAAE,KAAK;iBAClB,CAAC,CAAC,CAAC;YACN,CAAC;SACF,CAAC,CAAC;QAEL,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;IAEnC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;QACzB,MAAM,MAAM,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;KAC1E;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AACvC,CAAC;AAOD,SAAS,aAAa,CACpB,GAA2B;IAE3B,OAAO,GAAG,KAAK,SAAS,IAAK,GAAmB,CAAC,QAAQ,CAAC;AAC5D,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport { useEffect, useState } from \"react\";\nimport { defer, share } from \"rxjs\";\nimport {\n scheduleSubscription,\n SubscriptionScheduler,\n} from \"./SubscriptionScheduler\";\n\n/**\n * Custom hook for working with promise values.\n * Promises are debounced using trailing and leading edge.\n * The first promise will always be executed.\n * Any promises following the first while it is executing will be scheduled (and unscheduled), leaving only the last promise to be resolved.\n * Once the first promise finishes resolving, the last passed promise starts resolving.\n * @throws if/when `valueToBeResolved` promise is rejected. The error is thrown in the React's render loop, so it can be caught using an error boundary.\n * @beta\n */\nexport function useDebouncedAsyncValue<TReturn>(\n valueToBeResolved: undefined | (() => Promise<TReturn>)\n) {\n const [scheduler] = useState(() => new SubscriptionScheduler<TReturn>());\n\n const [{ result, inProgress }, setState] = useState<{\n result: TReturn | ErrorResult | undefined;\n inProgress: boolean;\n }>({\n result: undefined,\n inProgress: false,\n });\n\n useEffect(() => {\n if (!valueToBeResolved) {\n setState((prev) => ({ ...prev, result: undefined, inProgress: false }));\n return;\n }\n\n setState((prev) => ({\n ...prev,\n inProgress: true,\n }));\n // schedule and subscribe to the observable emitting value from valueToBeResolved promise\n const subscription = defer(valueToBeResolved)\n .pipe(\n share({\n resetOnError: false,\n resetOnComplete: false,\n resetOnRefCountZero: true,\n }),\n scheduleSubscription(scheduler)\n )\n .subscribe({\n next: (data) => {\n setState((prev) => ({ ...prev, result: data, inProgress: false }));\n },\n error: (err) => {\n setState((prev) => ({\n ...prev,\n result: { error: err, hasError: true },\n inProgress: false,\n }));\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [valueToBeResolved, scheduler]);\n\n if (isErrorResult(result)) {\n throw result.error ?? new Error(\"Exception in `useDebouncedAsyncValue`\");\n }\n\n return { value: result, inProgress };\n}\n\ninterface ErrorResult {\n error: Error | undefined;\n hasError: boolean;\n}\n\nfunction isErrorResult<TResult>(\n obj?: TResult | ErrorResult\n): obj is ErrorResult {\n return obj !== undefined && (obj as ErrorResult).hasError;\n}\n"]}
@@ -42,7 +42,6 @@ export class FloatTypeConverter extends NumericTypeConverterBase {
42
42
  return Number.isNaN(parsedValue) ? undefined : parsedValue;
43
43
  }
44
44
  convertToString(value) {
45
- var _a;
46
45
  if (value === undefined)
47
46
  return "";
48
47
  let numericValue = 0;
@@ -52,7 +51,7 @@ export class FloatTypeConverter extends NumericTypeConverterBase {
52
51
  numericValue = 0;
53
52
  }
54
53
  else {
55
- numericValue = (_a = FloatTypeConverter.parseString(value)) !== null && _a !== void 0 ? _a : 0;
54
+ numericValue = FloatTypeConverter.parseString(value) ?? 0;
56
55
  }
57
56
  }
58
57
  else {
@@ -83,7 +82,6 @@ export class IntTypeConverter extends NumericTypeConverterBase {
83
82
  return Number.isNaN(parsedValue) ? undefined : parsedValue;
84
83
  }
85
84
  convertToString(value) {
86
- var _a;
87
85
  if (value === undefined)
88
86
  return "";
89
87
  let numericValue = 0;
@@ -93,7 +91,7 @@ export class IntTypeConverter extends NumericTypeConverterBase {
93
91
  numericValue = 0;
94
92
  }
95
93
  else {
96
- numericValue = (_a = IntTypeConverter.parseString(value)) !== null && _a !== void 0 ? _a : 0;
94
+ numericValue = IntTypeConverter.parseString(value) ?? 0;
97
95
  }
98
96
  }
99
97
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"NumericTypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/NumericTypeConverter.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,OAAgB,wBACpB,SAAQ,aAAa;IAGrB,IAAoB,iBAAiB;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,UAAU,CAAC,CAAqB,EAAE,CAAqB;QAC5D,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAEM,mBAAmB,CACxB,CAAqB,EACrB,CAAqB;QAErB,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAEM,aAAa,CAAC,CAAqB,EAAE,CAAqB;QAC/D,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAEM,sBAAsB,CAC3B,CAAqB,EACrB,CAAqB;QAErB,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAEM,WAAW,CAChB,CAAqB,EACrB,CAAqB,EACrB,WAAqB;QAErB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjB,CAAC;CACF;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,CACpC,iBAAiB,CAAC,MAAM,EACxB,kBAAkB,CACnB,CAAC;AACF,oBAAoB,CAAC,iBAAiB,CACpC,iBAAiB,CAAC,MAAM,EACxB,kBAAkB,CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,wBAAwB;IACpD,MAAM,CAAC,WAAW,CAAC,KAAa;QACtC,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;IAC7D,CAAC;IAEe,eAAe,CAAC,KAAsB;;QACpD,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QAEnC,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI,EAAE;gBACnD,sCAAsC;gBACtC,YAAY,GAAG,CAAC,CAAC;aAClB;iBAAM;gBACL,YAAY,GAAG,MAAA,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC,mCAAI,CAAC,CAAC;aACzD;SACF;aAAM;YACL,YAAY,GAAG,KAAK,CAAC;SACtB;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC7C,CAAC;IAEe,iBAAiB,CAAC,KAAa;QAC7C,OAAO,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,oBAAoB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;AAChF,oBAAoB,CAAC,iBAAiB,CACpC,iBAAiB,CAAC,OAAO,EACzB,gBAAgB,CACjB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module TypeConverters\n */\n\nimport type { Primitives } from \"@itwin/appui-abstract\";\nimport { StandardTypeNames } from \"@itwin/appui-abstract\";\nimport type { LessGreaterOperatorProcessor } from \"./TypeConverter\";\nimport { TypeConverter } from \"./TypeConverter\";\nimport { TypeConverterManager } from \"./TypeConverterManager\";\n\n/**\n * Base Numeric Type Converter.\n * @public\n */\nexport abstract class NumericTypeConverterBase\n extends TypeConverter\n implements LessGreaterOperatorProcessor\n{\n public override get isLessGreaterType(): boolean {\n return true;\n }\n\n public isLessThan(a: Primitives.Numeric, b: Primitives.Numeric): boolean {\n return a < b;\n }\n\n public isLessThanOrEqualTo(\n a: Primitives.Numeric,\n b: Primitives.Numeric\n ): boolean {\n return a <= b;\n }\n\n public isGreaterThan(a: Primitives.Numeric, b: Primitives.Numeric): boolean {\n return a > b;\n }\n\n public isGreaterThanOrEqualTo(\n a: Primitives.Numeric,\n b: Primitives.Numeric\n ): boolean {\n return a >= b;\n }\n\n public sortCompare(\n a: Primitives.Numeric,\n b: Primitives.Numeric,\n _ignoreCase?: boolean\n ): number {\n return +a - +b;\n }\n}\n\n/**\n * Float Type Converter.\n * @public\n */\nexport class FloatTypeConverter extends NumericTypeConverterBase {\n private static parseString(value: string): number | undefined {\n const parsedValue = parseFloat(value);\n return Number.isNaN(parsedValue) ? undefined : parsedValue;\n }\n\n public override convertToString(value?: Primitives.Float) {\n if (value === undefined) return \"\";\n\n let numericValue = 0;\n if (typeof value === \"string\") {\n if (value === \"-\" || value === \"\" || value === \"-0.0\" || value === \"-0\") {\n // handle these semi-valid values as 0\n numericValue = 0;\n } else {\n numericValue = FloatTypeConverter.parseString(value) ?? 0;\n }\n } else {\n numericValue = value;\n }\n // this is close to calling `toFixed(2)`, but cuts of any trailing zeros\n let stringValue = (Math.round(100 * numericValue) / 100).toString();\n // because this is a _float_ converter, we want to emphasize the number is a float - make\n // sure there's a decimal part\n if (stringValue.indexOf(\".\") === -1) stringValue += \".0\";\n return stringValue;\n }\n\n public override convertFromString(value: string): number | undefined {\n return FloatTypeConverter.parseString(value);\n }\n}\nTypeConverterManager.registerConverter(\n StandardTypeNames.Float,\n FloatTypeConverter\n);\nTypeConverterManager.registerConverter(\n StandardTypeNames.Double,\n FloatTypeConverter\n);\nTypeConverterManager.registerConverter(\n StandardTypeNames.Number,\n FloatTypeConverter\n);\n\n/**\n * Int Type Converter.\n * @public\n */\nexport class IntTypeConverter extends NumericTypeConverterBase {\n private static parseString(value: string): number | undefined {\n const parsedValue = parseInt(value, 10);\n return Number.isNaN(parsedValue) ? undefined : parsedValue;\n }\n\n public override convertToString(value?: Primitives.Int) {\n if (value === undefined) return \"\";\n\n let numericValue = 0;\n if (typeof value === \"string\") {\n if (value === \"-\" || value === \"\" || value === \"-0\") {\n // handle these semi-valid values as 0\n numericValue = 0;\n } else {\n numericValue = IntTypeConverter.parseString(value) ?? 0;\n }\n } else {\n numericValue = value;\n }\n return Math.round(numericValue).toString();\n }\n\n public override convertFromString(value: string): number | undefined {\n return IntTypeConverter.parseString(value);\n }\n}\n\nTypeConverterManager.registerConverter(StandardTypeNames.Int, IntTypeConverter);\nTypeConverterManager.registerConverter(\n StandardTypeNames.Integer,\n IntTypeConverter\n);\n"]}
1
+ {"version":3,"file":"NumericTypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/NumericTypeConverter.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,OAAgB,wBACpB,SAAQ,aAAa;IAGrB,IAAoB,iBAAiB;QACnC,OAAO,IAAI,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AAC,KAAK,CAAC,IAAI,CAAC,CAAC;aACzD;SACF;aAAM;YACL,YAAY,GAAG,KAAK,CAAC;SACtB;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC7C,CAAC;IAEe,iBAAiB,CAAC,KAAa;QAC7C,OAAO,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,oBAAoB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;AAChF,oBAAoB,CAAC,iBAAiB,CACpC,iBAAiB,CAAC,OAAO,EACzB,gBAAgB,CACjB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module TypeConverters\n */\n\nimport type { Primitives } from \"@itwin/appui-abstract\";\nimport { StandardTypeNames } from \"@itwin/appui-abstract\";\nimport type { LessGreaterOperatorProcessor } from \"./TypeConverter\";\nimport { TypeConverter } from \"./TypeConverter\";\nimport { TypeConverterManager } from \"./TypeConverterManager\";\n\n/**\n * Base Numeric Type Converter.\n * @public\n */\nexport abstract class NumericTypeConverterBase\n extends TypeConverter\n implements LessGreaterOperatorProcessor\n{\n public override get isLessGreaterType(): boolean {\n return true;\n }\n\n public isLessThan(a: Primitives.Numeric, b: Primitives.Numeric): boolean {\n return a < b;\n }\n\n public isLessThanOrEqualTo(\n a: Primitives.Numeric,\n b: Primitives.Numeric\n ): boolean {\n return a <= b;\n }\n\n public isGreaterThan(a: Primitives.Numeric, b: Primitives.Numeric): boolean {\n return a > b;\n }\n\n public isGreaterThanOrEqualTo(\n a: Primitives.Numeric,\n b: Primitives.Numeric\n ): boolean {\n return a >= b;\n }\n\n public sortCompare(\n a: Primitives.Numeric,\n b: Primitives.Numeric,\n _ignoreCase?: boolean\n ): number {\n return +a - +b;\n }\n}\n\n/**\n * Float Type Converter.\n * @public\n */\nexport class FloatTypeConverter extends NumericTypeConverterBase {\n private static parseString(value: string): number | undefined {\n const parsedValue = parseFloat(value);\n return Number.isNaN(parsedValue) ? undefined : parsedValue;\n }\n\n public override convertToString(value?: Primitives.Float) {\n if (value === undefined) return \"\";\n\n let numericValue = 0;\n if (typeof value === \"string\") {\n if (value === \"-\" || value === \"\" || value === \"-0.0\" || value === \"-0\") {\n // handle these semi-valid values as 0\n numericValue = 0;\n } else {\n numericValue = FloatTypeConverter.parseString(value) ?? 0;\n }\n } else {\n numericValue = value;\n }\n // this is close to calling `toFixed(2)`, but cuts of any trailing zeros\n let stringValue = (Math.round(100 * numericValue) / 100).toString();\n // because this is a _float_ converter, we want to emphasize the number is a float - make\n // sure there's a decimal part\n if (stringValue.indexOf(\".\") === -1) stringValue += \".0\";\n return stringValue;\n }\n\n public override convertFromString(value: string): number | undefined {\n return FloatTypeConverter.parseString(value);\n }\n}\nTypeConverterManager.registerConverter(\n StandardTypeNames.Float,\n FloatTypeConverter\n);\nTypeConverterManager.registerConverter(\n StandardTypeNames.Double,\n FloatTypeConverter\n);\nTypeConverterManager.registerConverter(\n StandardTypeNames.Number,\n FloatTypeConverter\n);\n\n/**\n * Int Type Converter.\n * @public\n */\nexport class IntTypeConverter extends NumericTypeConverterBase {\n private static parseString(value: string): number | undefined {\n const parsedValue = parseInt(value, 10);\n return Number.isNaN(parsedValue) ? undefined : parsedValue;\n }\n\n public override convertToString(value?: Primitives.Int) {\n if (value === undefined) return \"\";\n\n let numericValue = 0;\n if (typeof value === \"string\") {\n if (value === \"-\" || value === \"\" || value === \"-0\") {\n // handle these semi-valid values as 0\n numericValue = 0;\n } else {\n numericValue = IntTypeConverter.parseString(value) ?? 0;\n }\n } else {\n numericValue = value;\n }\n return Math.round(numericValue).toString();\n }\n\n public override convertFromString(value: string): number | undefined {\n return IntTypeConverter.parseString(value);\n }\n}\n\nTypeConverterManager.registerConverter(StandardTypeNames.Int, IntTypeConverter);\nTypeConverterManager.registerConverter(\n StandardTypeNames.Integer,\n IntTypeConverter\n);\n"]}
@@ -31,8 +31,7 @@ export class TypeConverter {
31
31
  }
32
32
  /** Converts a value associated with a property description to a string */
33
33
  convertPropertyToString(propertyDescription, value) {
34
- var _a;
35
- return this.convertToStringWithOptions(value, (_a = propertyDescription.converter) === null || _a === void 0 ? void 0 : _a.options);
34
+ return this.convertToStringWithOptions(value, propertyDescription.converter?.options);
36
35
  }
37
36
  /** Converts a string with a property record to a property value */
38
37
  async convertFromStringToPropertyValue(value, propertyRecord) {
@@ -1 +1 @@
1
- {"version":3,"file":"TypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/TypeConverter.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAWH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAiD5D;;;GAGG;AACH,MAAM,OAAgB,aAAa;IAGjC,6CAA6C;IACtC,eAAe,CAAC,KAAwB;QAC7C,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IAED,wEAAwE;IACjE,0BAA0B,CAC/B,KAAwB,EACxB,QAAiC;QAEjC,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,6CAA6C;IACtC,iBAAiB,CACtB,MAAc;QAKd,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,0EAA0E;IACnE,4BAA4B,CACjC,KAAa,EACb,QAAiC;QAKjC,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,0EAA0E;IACnE,uBAAuB,CAC5B,mBAAwC,EACxC,KAAwB;;QAExB,OAAO,IAAI,CAAC,0BAA0B,CACpC,KAAK,EACL,MAAA,mBAAmB,CAAC,SAAS,0CAAE,OAAO,CACvC,CAAC;IACJ,CAAC;IAED,mEAAmE;IAC5D,KAAK,CAAC,gCAAgC,CAC3C,KAAa,EACb,cAA+B;QAE/B,MAAM,gBAAgB,GACpB,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,SAAS;YACjD,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO;YAC3C,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,4BAA4B,CACzD,KAAK,EACL,gBAAgB,CACjB,CAAC;QACF,MAAM,aAAa,GAAmB;YACpC,WAAW,EAAE,mBAAmB,CAAC,SAAS;YAC1C,KAAK,EAAE,WAAW;YAClB,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,OAAO,aAAa,CAAC;IACvB,CAAC;IASD,mDAAmD;IAC5C,SAAS,CACd,MAAwB,EACxB,MAAwB;QAExB,OAAO,MAAM,KAAK,MAAM,CAAC;IAC3B,CAAC;IAED,uDAAuD;IAChD,YAAY,CACjB,MAAwB,EACxB,MAAwB;QAExB,OAAO,MAAM,KAAK,MAAM,CAAC;IAC3B,CAAC;IAED,2DAA2D;IACpD,MAAM,CAAC,KAAuB;QACnC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;IAC/C,CAAC;IAED,mEAAmE;IAC5D,SAAS,CAAC,KAAuB;QACtC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;IAC/C,CAAC;IAED,uDAAuD;IACvD,IAAW,YAAY;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,wDAAwD;IACxD,IAAW,iBAAiB;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,wDAAwD;IACxD,IAAW,aAAa;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,yDAAyD;IACzD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module TypeConverters\n */\n\n// cSpell:ignore valuetypes shortdate\n\nimport type {\n Primitives,\n PrimitiveValue,\n PropertyDescription,\n PropertyRecord,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { ConvertedPrimitives } from \"./valuetypes/ConvertedTypes\";\n\n/** Sort compare method for types that support sorting\n * @public\n */\nexport interface SortComparer {\n /** Sort function for two primitive values */\n sortCompare(\n valueA: Primitives.Value,\n valueB: Primitives.Value,\n ignoreCase?: boolean\n ): number;\n}\n\n/** Operators for all filterable types\n * @public\n */\nexport interface OperatorProcessor {\n /** Determines if two primitive values are equal */\n isEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if two primitive values are not equal */\n isNotEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n}\n\n/** Operators for Numeric types, DateTime, TimeSpan, or any type that supports these comparisons\n * @public\n */\nexport interface LessGreaterOperatorProcessor {\n /** Determines if a primitive values is less than another primitive value */\n isLessThan(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is less than or equal to another primitive value */\n isLessThanOrEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is greater than another primitive value */\n isGreaterThan(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is greater than or equal to another primitive value */\n isGreaterThanOrEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n}\n\n/** Operators for all filterable null-able types\n * @public\n */\nexport interface NullableOperatorProcessor {\n /** Determines if a primitive value is null or undefined */\n isNull(value: Primitives.Value): boolean;\n /** Determines if a primitive value is not null or not undefined */\n isNotNull(value: Primitives.Value): boolean;\n}\n\n/**\n * Type Converter base class.\n * @public\n */\nexport abstract class TypeConverter\n implements SortComparer, OperatorProcessor, NullableOperatorProcessor\n{\n /** Converts a primitive value to a string */\n public convertToString(value?: Primitives.Value): string | Promise<string> {\n if (value === undefined) return \"\";\n return value.toString();\n }\n\n /** Default implementation just calls convertToString with no options */\n public convertToStringWithOptions(\n value?: Primitives.Value,\n _options?: { [key: string]: any }\n ): string | Promise<string> {\n return this.convertToString(value);\n }\n\n /** Converts a string to a primitive value */\n public convertFromString(\n _value: string\n ):\n | ConvertedPrimitives.Value\n | undefined\n | Promise<ConvertedPrimitives.Value | undefined> {\n return undefined;\n }\n\n /** Default implementation just calls convertFromString with no options */\n public convertFromStringWithOptions(\n value: string,\n _options?: { [key: string]: any }\n ):\n | ConvertedPrimitives.Value\n | undefined\n | Promise<ConvertedPrimitives.Value | undefined> {\n return this.convertFromString(value);\n }\n\n /** Converts a value associated with a property description to a string */\n public convertPropertyToString(\n propertyDescription: PropertyDescription,\n value?: Primitives.Value\n ): string | Promise<string> {\n return this.convertToStringWithOptions(\n value,\n propertyDescription.converter?.options\n );\n }\n\n /** Converts a string with a property record to a property value */\n public async convertFromStringToPropertyValue(\n value: string,\n propertyRecord?: PropertyRecord\n ): Promise<PropertyValue> {\n const converterOptions =\n propertyRecord && propertyRecord.property.converter\n ? propertyRecord.property.converter.options\n : undefined;\n const stringValue = await this.convertFromStringWithOptions(\n value,\n converterOptions\n );\n const propertyValue: PrimitiveValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: stringValue,\n displayValue: \"\",\n };\n return propertyValue;\n }\n\n /** Sort function for two primitive values */\n public abstract sortCompare(\n valueA: Primitives.Value,\n valueB: Primitives.Value,\n _ignoreCase?: boolean\n ): number;\n\n /** Determines if two primitive values are equal */\n public isEqualTo(\n valueA: Primitives.Value,\n valueB: Primitives.Value\n ): boolean {\n return valueA === valueB;\n }\n\n /** Determines if two primitive values are not equal */\n public isNotEqualTo(\n valueA: Primitives.Value,\n valueB: Primitives.Value\n ): boolean {\n return valueA !== valueB;\n }\n\n /** Determines if a primitive value is null or undefined */\n public isNull(value: Primitives.Value): boolean {\n return value === null || value === undefined;\n }\n\n /** Determines if a primitive value is not null or not undefined */\n public isNotNull(value: Primitives.Value): boolean {\n return value !== null && value !== undefined;\n }\n\n /** Determines if the converter is for a string type */\n public get isStringType(): boolean {\n return false;\n }\n /** Determines if the converter is for a numeric type */\n public get isLessGreaterType(): boolean {\n return false;\n }\n /** Determines if the converter is for a boolean type */\n public get isBooleanType(): boolean {\n return false;\n }\n /** Determines if the converter is for a nullable type */\n public get isNullableType(): boolean {\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"TypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/TypeConverter.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAWH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAiD5D;;;GAGG;AACH,MAAM,OAAgB,aAAa;IAGjC,6CAA6C;IACtC,eAAe,CAAC,KAAwB;QAC7C,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IAED,wEAAwE;IACjE,0BAA0B,CAC/B,KAAwB,EACxB,QAAiC;QAEjC,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,6CAA6C;IACtC,iBAAiB,CACtB,MAAc;QAKd,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,0EAA0E;IACnE,4BAA4B,CACjC,KAAa,EACb,QAAiC;QAKjC,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,0EAA0E;IACnE,uBAAuB,CAC5B,mBAAwC,EACxC,KAAwB;QAExB,OAAO,IAAI,CAAC,0BAA0B,CACpC,KAAK,EACL,mBAAmB,CAAC,SAAS,EAAE,OAAO,CACvC,CAAC;IACJ,CAAC;IAED,mEAAmE;IAC5D,KAAK,CAAC,gCAAgC,CAC3C,KAAa,EACb,cAA+B;QAE/B,MAAM,gBAAgB,GACpB,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,SAAS;YACjD,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO;YAC3C,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,4BAA4B,CACzD,KAAK,EACL,gBAAgB,CACjB,CAAC;QACF,MAAM,aAAa,GAAmB;YACpC,WAAW,EAAE,mBAAmB,CAAC,SAAS;YAC1C,KAAK,EAAE,WAAW;YAClB,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,OAAO,aAAa,CAAC;IACvB,CAAC;IASD,mDAAmD;IAC5C,SAAS,CACd,MAAwB,EACxB,MAAwB;QAExB,OAAO,MAAM,KAAK,MAAM,CAAC;IAC3B,CAAC;IAED,uDAAuD;IAChD,YAAY,CACjB,MAAwB,EACxB,MAAwB;QAExB,OAAO,MAAM,KAAK,MAAM,CAAC;IAC3B,CAAC;IAED,2DAA2D;IACpD,MAAM,CAAC,KAAuB;QACnC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;IAC/C,CAAC;IAED,mEAAmE;IAC5D,SAAS,CAAC,KAAuB;QACtC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;IAC/C,CAAC;IAED,uDAAuD;IACvD,IAAW,YAAY;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,wDAAwD;IACxD,IAAW,iBAAiB;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,wDAAwD;IACxD,IAAW,aAAa;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,yDAAyD;IACzD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module TypeConverters\n */\n\n// cSpell:ignore valuetypes shortdate\n\nimport type {\n Primitives,\n PrimitiveValue,\n PropertyDescription,\n PropertyRecord,\n PropertyValue,\n} from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { ConvertedPrimitives } from \"./valuetypes/ConvertedTypes\";\n\n/** Sort compare method for types that support sorting\n * @public\n */\nexport interface SortComparer {\n /** Sort function for two primitive values */\n sortCompare(\n valueA: Primitives.Value,\n valueB: Primitives.Value,\n ignoreCase?: boolean\n ): number;\n}\n\n/** Operators for all filterable types\n * @public\n */\nexport interface OperatorProcessor {\n /** Determines if two primitive values are equal */\n isEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if two primitive values are not equal */\n isNotEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n}\n\n/** Operators for Numeric types, DateTime, TimeSpan, or any type that supports these comparisons\n * @public\n */\nexport interface LessGreaterOperatorProcessor {\n /** Determines if a primitive values is less than another primitive value */\n isLessThan(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is less than or equal to another primitive value */\n isLessThanOrEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is greater than another primitive value */\n isGreaterThan(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is greater than or equal to another primitive value */\n isGreaterThanOrEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n}\n\n/** Operators for all filterable null-able types\n * @public\n */\nexport interface NullableOperatorProcessor {\n /** Determines if a primitive value is null or undefined */\n isNull(value: Primitives.Value): boolean;\n /** Determines if a primitive value is not null or not undefined */\n isNotNull(value: Primitives.Value): boolean;\n}\n\n/**\n * Type Converter base class.\n * @public\n */\nexport abstract class TypeConverter\n implements SortComparer, OperatorProcessor, NullableOperatorProcessor\n{\n /** Converts a primitive value to a string */\n public convertToString(value?: Primitives.Value): string | Promise<string> {\n if (value === undefined) return \"\";\n return value.toString();\n }\n\n /** Default implementation just calls convertToString with no options */\n public convertToStringWithOptions(\n value?: Primitives.Value,\n _options?: { [key: string]: any }\n ): string | Promise<string> {\n return this.convertToString(value);\n }\n\n /** Converts a string to a primitive value */\n public convertFromString(\n _value: string\n ):\n | ConvertedPrimitives.Value\n | undefined\n | Promise<ConvertedPrimitives.Value | undefined> {\n return undefined;\n }\n\n /** Default implementation just calls convertFromString with no options */\n public convertFromStringWithOptions(\n value: string,\n _options?: { [key: string]: any }\n ):\n | ConvertedPrimitives.Value\n | undefined\n | Promise<ConvertedPrimitives.Value | undefined> {\n return this.convertFromString(value);\n }\n\n /** Converts a value associated with a property description to a string */\n public convertPropertyToString(\n propertyDescription: PropertyDescription,\n value?: Primitives.Value\n ): string | Promise<string> {\n return this.convertToStringWithOptions(\n value,\n propertyDescription.converter?.options\n );\n }\n\n /** Converts a string with a property record to a property value */\n public async convertFromStringToPropertyValue(\n value: string,\n propertyRecord?: PropertyRecord\n ): Promise<PropertyValue> {\n const converterOptions =\n propertyRecord && propertyRecord.property.converter\n ? propertyRecord.property.converter.options\n : undefined;\n const stringValue = await this.convertFromStringWithOptions(\n value,\n converterOptions\n );\n const propertyValue: PrimitiveValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: stringValue,\n displayValue: \"\",\n };\n return propertyValue;\n }\n\n /** Sort function for two primitive values */\n public abstract sortCompare(\n valueA: Primitives.Value,\n valueB: Primitives.Value,\n _ignoreCase?: boolean\n ): number;\n\n /** Determines if two primitive values are equal */\n public isEqualTo(\n valueA: Primitives.Value,\n valueB: Primitives.Value\n ): boolean {\n return valueA === valueB;\n }\n\n /** Determines if two primitive values are not equal */\n public isNotEqualTo(\n valueA: Primitives.Value,\n valueB: Primitives.Value\n ): boolean {\n return valueA !== valueB;\n }\n\n /** Determines if a primitive value is null or undefined */\n public isNull(value: Primitives.Value): boolean {\n return value === null || value === undefined;\n }\n\n /** Determines if a primitive value is not null or not undefined */\n public isNotNull(value: Primitives.Value): boolean {\n return value !== null && value !== undefined;\n }\n\n /** Determines if the converter is for a string type */\n public get isStringType(): boolean {\n return false;\n }\n /** Determines if the converter is for a numeric type */\n public get isLessGreaterType(): boolean {\n return false;\n }\n /** Determines if the converter is for a boolean type */\n public get isBooleanType(): boolean {\n return false;\n }\n /** Determines if the converter is for a nullable type */\n public get isNullableType(): boolean {\n return true;\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  /** @packageDocumentation
2
2
  * @module Date
3
3
  */
4
- /// <reference types="react" />
5
4
  import "./DateField.scss";
5
+ import * as React from "react";
6
6
  import type { DateFormatter } from "@itwin/appui-abstract";
7
7
  import { AlternateDateFormats, TimeDisplay } from "@itwin/appui-abstract";
8
8
  import type { CommonProps } from "@itwin/core-react";
@@ -30,5 +30,5 @@ export declare function formatInputDate(inputDate: Date, timeDisplay?: TimeDispl
30
30
  /** Date input component. This component is typically used by the [[DatePickerPopupButton]] to display and edit date and time.
31
31
  * @internal
32
32
  */
33
- export declare function DateField({ initialDate, onDateChange, readOnly, dateFormatter, timeDisplay, style, className, }: DateFieldProps): JSX.Element;
33
+ export declare function DateField({ initialDate, onDateChange, readOnly, dateFormatter, timeDisplay, style, className, }: DateFieldProps): React.JSX.Element;
34
34
  //# sourceMappingURL=DateField.d.ts.map