@itwin/core-react 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (860) hide show
  1. package/CHANGELOG.md +1621 -1609
  2. package/ContributeGuidelines.md +99 -99
  3. package/LICENSE.md +9 -9
  4. package/README.md +11 -11
  5. package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
  6. package/lib/cjs/core-react/UiCore.js +9 -5
  7. package/lib/cjs/core-react/UiCore.js.map +1 -1
  8. package/lib/cjs/core-react/_geometry.scss +70 -70
  9. package/lib/cjs/core-react/_helpers.scss +52 -51
  10. package/lib/cjs/core-react/_math.scss +13 -13
  11. package/lib/cjs/core-react/_scrollbar.scss +55 -51
  12. package/lib/cjs/core-react/_typography.scss +44 -44
  13. package/lib/cjs/core-react/_z-index.scss +47 -65
  14. package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +1 -1
  15. package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
  16. package/lib/cjs/core-react/autosuggest/AutoSuggest.js +14 -15
  17. package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
  18. package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +79 -79
  19. package/lib/cjs/core-react/badge/Badge.d.ts +1 -1
  20. package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
  21. package/lib/cjs/core-react/badge/Badge.js +3 -3
  22. package/lib/cjs/core-react/badge/Badge.js.map +1 -1
  23. package/lib/cjs/core-react/badge/Badge.scss +13 -13
  24. package/lib/cjs/core-react/badge/BadgeUtilities.d.ts.map +1 -1
  25. package/lib/cjs/core-react/badge/BadgeUtilities.js +3 -3
  26. package/lib/cjs/core-react/badge/BadgeUtilities.js.map +1 -1
  27. package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +1 -1
  28. package/lib/cjs/core-react/badge/BetaBadge.js +3 -3
  29. package/lib/cjs/core-react/badge/BetaBadge.js.map +1 -1
  30. package/lib/cjs/core-react/badge/NewBadge.d.ts.map +1 -1
  31. package/lib/cjs/core-react/badge/NewBadge.js +4 -4
  32. package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
  33. package/lib/cjs/core-react/badge/NewBadge.scss +9 -9
  34. package/lib/cjs/core-react/base/Centered.js +3 -3
  35. package/lib/cjs/core-react/base/Centered.js.map +1 -1
  36. package/lib/cjs/core-react/base/Div.d.ts.map +1 -1
  37. package/lib/cjs/core-react/base/Div.js +3 -3
  38. package/lib/cjs/core-react/base/Div.js.map +1 -1
  39. package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
  40. package/lib/cjs/core-react/base/DivWithOutsideClick.js +4 -4
  41. package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
  42. package/lib/cjs/core-react/base/FillCentered.js +3 -3
  43. package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
  44. package/lib/cjs/core-react/base/FlexWrapContainer.js +3 -3
  45. package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
  46. package/lib/cjs/core-react/base/Gap.d.ts.map +1 -1
  47. package/lib/cjs/core-react/base/Gap.js +5 -5
  48. package/lib/cjs/core-react/base/Gap.js.map +1 -1
  49. package/lib/cjs/core-react/base/PointerEvents.js +3 -3
  50. package/lib/cjs/core-react/base/PointerEvents.js.map +1 -1
  51. package/lib/cjs/core-react/base/ScrollView.js +3 -3
  52. package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
  53. package/lib/cjs/core-react/base/base.scss +42 -42
  54. package/lib/cjs/core-react/base/classes.scss +27 -13
  55. package/lib/cjs/core-react/base/index.scss +5 -5
  56. package/lib/cjs/core-react/button/UnderlinedButton.d.ts.map +1 -1
  57. package/lib/cjs/core-react/button/UnderlinedButton.js +3 -3
  58. package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
  59. package/lib/cjs/core-react/button/UnderlinedButton.scss +32 -33
  60. package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
  61. package/lib/cjs/core-react/checklistbox/CheckListBox.js +4 -4
  62. package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
  63. package/lib/cjs/core-react/checklistbox/CheckListBox.scss +22 -22
  64. package/lib/cjs/core-react/classes.scss +11 -11
  65. package/lib/cjs/core-react/colorthemes.scss +61 -61
  66. package/lib/cjs/core-react/colorvariables.scss +131 -131
  67. package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts +7 -7
  68. package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
  69. package/lib/cjs/core-react/contextmenu/ContextMenu.js +43 -25
  70. package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
  71. package/lib/cjs/core-react/contextmenu/ContextMenu.scss +236 -236
  72. package/lib/cjs/core-react/contextmenu/ContextMenuDirection.d.ts.map +1 -1
  73. package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js +3 -3
  74. package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
  75. package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts +1 -1
  76. package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
  77. package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js +3 -3
  78. package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
  79. package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
  80. package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
  81. package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +16 -12
  82. package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
  83. package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts +2 -2
  84. package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
  85. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +37 -15
  86. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  87. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
  88. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +14 -12
  89. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  90. package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
  91. package/lib/cjs/core-react/contextmenu/PopupContextMenu.js +3 -3
  92. package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
  93. package/lib/cjs/core-react/contextmenu/TildeFinder.d.ts.map +1 -1
  94. package/lib/cjs/core-react/contextmenu/TildeFinder.js +15 -7
  95. package/lib/cjs/core-react/contextmenu/TildeFinder.js.map +1 -1
  96. package/lib/cjs/core-react/dialog/Dialog.d.ts +6 -5
  97. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  98. package/lib/cjs/core-react/dialog/Dialog.js +95 -88
  99. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  100. package/lib/cjs/core-react/dialog/Dialog.scss +245 -245
  101. package/lib/cjs/core-react/dialog/GlobalDialog.d.ts.map +1 -1
  102. package/lib/cjs/core-react/dialog/GlobalDialog.js +11 -8
  103. package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
  104. package/lib/cjs/core-react/dialog/SimpleDialog.d.ts +68 -0
  105. package/lib/cjs/core-react/dialog/SimpleDialog.d.ts.map +1 -0
  106. package/lib/cjs/core-react/dialog/SimpleDialog.js +51 -0
  107. package/lib/cjs/core-react/dialog/SimpleDialog.js.map +1 -0
  108. package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  109. package/lib/cjs/core-react/elementseparator/ElementSeparator.js +16 -10
  110. package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
  111. package/lib/cjs/core-react/elementseparator/ElementSeparator.scss +94 -85
  112. package/lib/cjs/core-react/enums/Alignment.js +3 -3
  113. package/lib/cjs/core-react/enums/Alignment.js.map +1 -1
  114. package/lib/cjs/core-react/enums/CheckBoxState.js +3 -3
  115. package/lib/cjs/core-react/enums/CheckBoxState.js.map +1 -1
  116. package/lib/cjs/core-react/enums/Orientation.js +3 -3
  117. package/lib/cjs/core-react/enums/Orientation.js.map +1 -1
  118. package/lib/cjs/core-react/enums/SortDirection.js +3 -3
  119. package/lib/cjs/core-react/enums/SortDirection.js.map +1 -1
  120. package/lib/cjs/core-react/enums/TimeFormat.js +3 -3
  121. package/lib/cjs/core-react/enums/TimeFormat.js.map +1 -1
  122. package/lib/cjs/core-react/expandable/ExpandableList.d.ts +1 -1
  123. package/lib/cjs/core-react/expandable/ExpandableList.d.ts.map +1 -1
  124. package/lib/cjs/core-react/expandable/ExpandableList.js +8 -5
  125. package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
  126. package/lib/cjs/core-react/expandable/ExpandableList.scss +9 -9
  127. package/lib/cjs/core-react/expandable/classes.scss +9 -7
  128. package/lib/cjs/core-react/expandable/index.scss +5 -5
  129. package/lib/cjs/core-react/expandable/list.scss +35 -35
  130. package/lib/cjs/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
  131. package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js +38 -15
  132. package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
  133. package/lib/cjs/core-react/focustrap/FocusTrap.d.ts.map +1 -1
  134. package/lib/cjs/core-react/focustrap/FocusTrap.js +33 -16
  135. package/lib/cjs/core-react/focustrap/FocusTrap.js.map +1 -1
  136. package/lib/cjs/core-react/hocs/withIsPressed.d.ts.map +1 -1
  137. package/lib/cjs/core-react/hocs/withIsPressed.js +4 -7
  138. package/lib/cjs/core-react/hocs/withIsPressed.js.map +1 -1
  139. package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
  140. package/lib/cjs/core-react/hocs/withOnOutsideClick.js +17 -13
  141. package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
  142. package/lib/cjs/core-react/hocs/withTimeout.d.ts.map +1 -1
  143. package/lib/cjs/core-react/hocs/withTimeout.js +6 -8
  144. package/lib/cjs/core-react/hocs/withTimeout.js.map +1 -1
  145. package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts +5 -1
  146. package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
  147. package/lib/cjs/core-react/icons/ConditionalIconItem.js +26 -9
  148. package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -1
  149. package/lib/cjs/core-react/icons/IconComponent.d.ts +1 -1
  150. package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
  151. package/lib/cjs/core-react/icons/IconComponent.js +21 -11
  152. package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
  153. package/lib/cjs/core-react/icons/IconComponent.scss +19 -20
  154. package/lib/cjs/core-react/icons/SvgPath.d.ts.map +1 -1
  155. package/lib/cjs/core-react/icons/SvgPath.js +4 -4
  156. package/lib/cjs/core-react/icons/SvgPath.js.map +1 -1
  157. package/lib/cjs/core-react/icons/SvgPath.scss +15 -15
  158. package/lib/cjs/core-react/icons/WebFontIcon.js +3 -3
  159. package/lib/cjs/core-react/icons/WebFontIcon.js.map +1 -1
  160. package/lib/cjs/core-react/icons/WebFontIcon.scss +17 -17
  161. package/lib/cjs/core-react/icons/classes.scss +18 -10
  162. package/lib/cjs/core-react/icons/index.scss +6 -6
  163. package/lib/cjs/core-react/icons/mixins.scss +25 -25
  164. package/lib/cjs/core-react/icons/variables.scss +12 -12
  165. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
  166. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +6 -4
  167. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
  168. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
  169. package/lib/cjs/core-react/index.scss +21 -21
  170. package/lib/cjs/core-react/inputs/Input.d.ts +1 -1
  171. package/lib/cjs/core-react/inputs/Input.d.ts.map +1 -1
  172. package/lib/cjs/core-react/inputs/Input.js +6 -7
  173. package/lib/cjs/core-react/inputs/Input.js.map +1 -1
  174. package/lib/cjs/core-react/inputs/InputLabel.d.ts +1 -1
  175. package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
  176. package/lib/cjs/core-react/inputs/InputLabel.js +10 -13
  177. package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
  178. package/lib/cjs/core-react/inputs/InputStatus.js +3 -3
  179. package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
  180. package/lib/cjs/core-react/inputs/LabeledComponentProps.js +3 -3
  181. package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
  182. package/lib/cjs/core-react/inputs/classes.scss +12 -8
  183. package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts +1 -1
  184. package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
  185. package/lib/cjs/core-react/inputs/iconinput/IconInput.js +3 -4
  186. package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
  187. package/lib/cjs/core-react/inputs/iconinput/IconInput.scss +34 -35
  188. package/lib/cjs/core-react/inputs/index.scss +9 -9
  189. package/lib/cjs/core-react/inputs/input-label.scss +90 -90
  190. package/lib/cjs/core-react/inputs/input.scss +58 -58
  191. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +2 -2
  192. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  193. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +25 -16
  194. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  195. package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +88 -88
  196. package/lib/cjs/core-react/inputs/variables.scss +38 -38
  197. package/lib/cjs/core-react/layout-variables.scss +15 -17
  198. package/lib/cjs/core-react/listbox/Listbox.d.ts +2 -2
  199. package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
  200. package/lib/cjs/core-react/listbox/Listbox.js +20 -14
  201. package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
  202. package/lib/cjs/core-react/listbox/Listbox.scss +54 -54
  203. package/lib/cjs/core-react/loading/LoadingBar.d.ts.map +1 -1
  204. package/lib/cjs/core-react/loading/LoadingBar.js +4 -4
  205. package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
  206. package/lib/cjs/core-react/loading/LoadingBar.scss +29 -29
  207. package/lib/cjs/core-react/loading/LoadingPrompt.d.ts.map +1 -1
  208. package/lib/cjs/core-react/loading/LoadingPrompt.js +9 -9
  209. package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
  210. package/lib/cjs/core-react/loading/LoadingPrompt.scss +33 -33
  211. package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +3 -3
  212. package/lib/cjs/core-react/loading/LoadingSpinner.d.ts.map +1 -1
  213. package/lib/cjs/core-react/loading/LoadingSpinner.js +5 -5
  214. package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
  215. package/lib/cjs/core-react/loading/LoadingSpinner.scss +26 -26
  216. package/lib/cjs/core-react/loading/LoadingStatus.d.ts.map +1 -1
  217. package/lib/cjs/core-react/loading/LoadingStatus.js +3 -3
  218. package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
  219. package/lib/cjs/core-react/loading/LoadingStatus.scss +20 -20
  220. package/lib/cjs/core-react/loading/index.scss +5 -5
  221. package/lib/cjs/core-react/loading/mixins.scss +57 -57
  222. package/lib/cjs/core-react/messagebox/MessageBox.d.ts +3 -3
  223. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  224. package/lib/cjs/core-react/messagebox/MessageBox.js +5 -5
  225. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  226. package/lib/cjs/core-react/messagebox/MessageBox.scss +56 -56
  227. package/lib/cjs/core-react/notification/MessageRenderer.d.ts.map +1 -1
  228. package/lib/cjs/core-react/notification/MessageRenderer.js +19 -13
  229. package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
  230. package/lib/cjs/core-react/notification/MessageType.d.ts.map +1 -1
  231. package/lib/cjs/core-react/notification/MessageType.js +3 -3
  232. package/lib/cjs/core-react/notification/MessageType.js.map +1 -1
  233. package/lib/cjs/core-react/popup/Popup.d.ts.map +1 -1
  234. package/lib/cjs/core-react/popup/Popup.js +50 -31
  235. package/lib/cjs/core-react/popup/Popup.js.map +1 -1
  236. package/lib/cjs/core-react/popup/Popup.scss +240 -240
  237. package/lib/cjs/core-react/radialmenu/Annulus.d.ts.map +1 -1
  238. package/lib/cjs/core-react/radialmenu/Annulus.js +4 -4
  239. package/lib/cjs/core-react/radialmenu/Annulus.js.map +1 -1
  240. package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +2 -2
  241. package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
  242. package/lib/cjs/core-react/radialmenu/RadialMenu.js +26 -11
  243. package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
  244. package/lib/cjs/core-react/radialmenu/RadialMenu.scss +55 -55
  245. package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
  246. package/lib/cjs/core-react/searchbox/SearchBox.js +17 -7
  247. package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
  248. package/lib/cjs/core-react/searchbox/SearchBox.scss +47 -47
  249. package/lib/cjs/core-react/settings/SettingsContainer.d.ts +1 -1
  250. package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
  251. package/lib/cjs/core-react/settings/SettingsContainer.js +54 -19
  252. package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
  253. package/lib/cjs/core-react/settings/SettingsContainer.scss +68 -68
  254. package/lib/cjs/core-react/settings/SettingsManager.d.ts +3 -3
  255. package/lib/cjs/core-react/settings/SettingsManager.d.ts.map +1 -1
  256. package/lib/cjs/core-react/settings/SettingsManager.js +7 -8
  257. package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
  258. package/lib/cjs/core-react/style/baseline.scss +11 -11
  259. package/lib/cjs/core-react/style/breakpoints.scss +59 -41
  260. package/lib/cjs/core-react/style/colors.scss +77 -77
  261. package/lib/cjs/core-react/style/index.scss +10 -10
  262. package/lib/cjs/core-react/style/mixins.scss +23 -27
  263. package/lib/cjs/core-react/style/opacity.scss +16 -16
  264. package/lib/cjs/core-react/style/themecolors.scss +133 -123
  265. package/lib/cjs/core-react/tabs/Tabs.d.ts +4 -4
  266. package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
  267. package/lib/cjs/core-react/tabs/Tabs.js +13 -11
  268. package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
  269. package/lib/cjs/core-react/tabs/VerticalTabs.d.ts.map +1 -1
  270. package/lib/cjs/core-react/tabs/VerticalTabs.js +3 -3
  271. package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
  272. package/lib/cjs/core-react/tabs/classes.scss +9 -7
  273. package/lib/cjs/core-react/tabs/index.scss +5 -5
  274. package/lib/cjs/core-react/tabs/tabs.scss +96 -96
  275. package/lib/cjs/core-react/tabs/vertical.scss +51 -51
  276. package/lib/cjs/core-react/text/BlockText.js +4 -4
  277. package/lib/cjs/core-react/text/BlockText.js.map +1 -1
  278. package/lib/cjs/core-react/text/BodyText.js +4 -4
  279. package/lib/cjs/core-react/text/BodyText.js.map +1 -1
  280. package/lib/cjs/core-react/text/DisabledText.js +4 -4
  281. package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
  282. package/lib/cjs/core-react/text/FilteredText.d.ts.map +1 -1
  283. package/lib/cjs/core-react/text/FilteredText.js +5 -5
  284. package/lib/cjs/core-react/text/FilteredText.js.map +1 -1
  285. package/lib/cjs/core-react/text/FilteredText.scss +10 -10
  286. package/lib/cjs/core-react/text/MutedText.js +4 -4
  287. package/lib/cjs/core-react/text/MutedText.js.map +1 -1
  288. package/lib/cjs/core-react/text/StyledText.js +3 -3
  289. package/lib/cjs/core-react/text/StyledText.js.map +1 -1
  290. package/lib/cjs/core-react/text/TextProps.d.ts.map +1 -1
  291. package/lib/cjs/core-react/text/TextProps.js +3 -3
  292. package/lib/cjs/core-react/text/TextProps.js.map +1 -1
  293. package/lib/cjs/core-react/text/block.scss +15 -15
  294. package/lib/cjs/core-react/text/body.scss +13 -13
  295. package/lib/cjs/core-react/text/classes.scss +18 -10
  296. package/lib/cjs/core-react/text/disabled.scss +9 -10
  297. package/lib/cjs/core-react/text/index.scss +10 -10
  298. package/lib/cjs/core-react/text/mixins.scss +24 -24
  299. package/lib/cjs/core-react/text/muted.scss +9 -10
  300. package/lib/cjs/core-react/tree/Branch.d.ts.map +1 -1
  301. package/lib/cjs/core-react/tree/Branch.js +3 -3
  302. package/lib/cjs/core-react/tree/Branch.js.map +1 -1
  303. package/lib/cjs/core-react/tree/Branch.scss +13 -13
  304. package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  305. package/lib/cjs/core-react/tree/ExpansionToggle.js +3 -3
  306. package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
  307. package/lib/cjs/core-react/tree/ExpansionToggle.scss +32 -32
  308. package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
  309. package/lib/cjs/core-react/tree/Node.js +12 -10
  310. package/lib/cjs/core-react/tree/Node.js.map +1 -1
  311. package/lib/cjs/core-react/tree/Node.scss +68 -68
  312. package/lib/cjs/core-react/tree/Placeholder.js +5 -5
  313. package/lib/cjs/core-react/tree/Placeholder.js.map +1 -1
  314. package/lib/cjs/core-react/tree/Placeholder.scss +17 -17
  315. package/lib/cjs/core-react/tree/Tree.d.ts.map +1 -1
  316. package/lib/cjs/core-react/tree/Tree.js +20 -11
  317. package/lib/cjs/core-react/tree/Tree.js.map +1 -1
  318. package/lib/cjs/core-react/tree/Tree.scss +21 -21
  319. package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
  320. package/lib/cjs/core-react/uistate/LocalStateStorage.js +7 -4
  321. package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -1
  322. package/lib/cjs/core-react/uistate/UiStateEntry.d.ts.map +1 -1
  323. package/lib/cjs/core-react/uistate/UiStateEntry.js +3 -3
  324. package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -1
  325. package/lib/cjs/core-react/uistate/UiStateStorage.d.ts.map +1 -1
  326. package/lib/cjs/core-react/uistate/UiStateStorage.js +3 -3
  327. package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -1
  328. package/lib/cjs/core-react/utils/IconHelper.d.ts +3 -1
  329. package/lib/cjs/core-react/utils/IconHelper.d.ts.map +1 -1
  330. package/lib/cjs/core-react/utils/IconHelper.js +35 -6
  331. package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
  332. package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
  333. package/lib/cjs/core-react/utils/IconWebComponent.js +71 -41
  334. package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
  335. package/lib/cjs/core-react/utils/Point.d.ts.map +1 -1
  336. package/lib/cjs/core-react/utils/Point.js +3 -3
  337. package/lib/cjs/core-react/utils/Point.js.map +1 -1
  338. package/lib/cjs/core-react/utils/Props.d.ts.map +1 -1
  339. package/lib/cjs/core-react/utils/Props.js +3 -3
  340. package/lib/cjs/core-react/utils/Props.js.map +1 -1
  341. package/lib/cjs/core-react/utils/Rectangle.d.ts.map +1 -1
  342. package/lib/cjs/core-react/utils/Rectangle.js +15 -7
  343. package/lib/cjs/core-react/utils/Rectangle.js.map +1 -1
  344. package/lib/cjs/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
  345. package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js +4 -2
  346. package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
  347. package/lib/cjs/core-react/utils/Size.d.ts.map +1 -1
  348. package/lib/cjs/core-react/utils/Size.js +4 -5
  349. package/lib/cjs/core-react/utils/Size.js.map +1 -1
  350. package/lib/cjs/core-react/utils/Timer.d.ts.map +1 -1
  351. package/lib/cjs/core-react/utils/Timer.js +3 -3
  352. package/lib/cjs/core-react/utils/Timer.js.map +1 -1
  353. package/lib/cjs/core-react/utils/UiGeometry.d.ts.map +1 -1
  354. package/lib/cjs/core-react/utils/UiGeometry.js +9 -5
  355. package/lib/cjs/core-react/utils/UiGeometry.js.map +1 -1
  356. package/lib/cjs/core-react/utils/flattenChildren.js +3 -3
  357. package/lib/cjs/core-react/utils/flattenChildren.js.map +1 -1
  358. package/lib/cjs/core-react/utils/getBestBWContrastColor.js +5 -5
  359. package/lib/cjs/core-react/utils/getBestBWContrastColor.js.map +1 -1
  360. package/lib/cjs/core-react/utils/getCssVariable.d.ts.map +1 -1
  361. package/lib/cjs/core-react/utils/getCssVariable.js +4 -4
  362. package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
  363. package/lib/cjs/core-react/utils/getDisplayName.d.ts.map +1 -1
  364. package/lib/cjs/core-react/utils/getDisplayName.js +3 -3
  365. package/lib/cjs/core-react/utils/getDisplayName.js.map +1 -1
  366. package/lib/cjs/core-react/utils/getUserColor.d.ts.map +1 -1
  367. package/lib/cjs/core-react/utils/getUserColor.js +5 -4
  368. package/lib/cjs/core-react/utils/getUserColor.js.map +1 -1
  369. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
  370. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js +4 -4
  371. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
  372. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
  373. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +22 -11
  374. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  375. package/lib/cjs/core-react/utils/hooks/useDisposable.d.ts.map +1 -1
  376. package/lib/cjs/core-react/utils/hooks/useDisposable.js +3 -3
  377. package/lib/cjs/core-react/utils/hooks/useDisposable.js.map +1 -1
  378. package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.d.ts.map +1 -1
  379. package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js +3 -3
  380. package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
  381. package/lib/cjs/core-react/utils/hooks/useEventListener.d.ts.map +1 -1
  382. package/lib/cjs/core-react/utils/hooks/useEventListener.js +3 -3
  383. package/lib/cjs/core-react/utils/hooks/useEventListener.js.map +1 -1
  384. package/lib/cjs/core-react/utils/hooks/useInterval.d.ts.map +1 -1
  385. package/lib/cjs/core-react/utils/hooks/useInterval.js +6 -4
  386. package/lib/cjs/core-react/utils/hooks/useInterval.js.map +1 -1
  387. package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.d.ts.map +1 -1
  388. package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.js +7 -4
  389. package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
  390. package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.d.ts.map +1 -1
  391. package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js +15 -6
  392. package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
  393. package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js +3 -3
  394. package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
  395. package/lib/cjs/core-react/utils/hooks/useRefEffect.d.ts +1 -1
  396. package/lib/cjs/core-react/utils/hooks/useRefEffect.d.ts.map +1 -1
  397. package/lib/cjs/core-react/utils/hooks/useRefEffect.js +3 -3
  398. package/lib/cjs/core-react/utils/hooks/useRefEffect.js.map +1 -1
  399. package/lib/cjs/core-react/utils/hooks/useRefState.js +3 -3
  400. package/lib/cjs/core-react/utils/hooks/useRefState.js.map +1 -1
  401. package/lib/cjs/core-react/utils/hooks/useRefs.d.ts.map +1 -1
  402. package/lib/cjs/core-react/utils/hooks/useRefs.js +8 -6
  403. package/lib/cjs/core-react/utils/hooks/useRefs.js.map +1 -1
  404. package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts +8 -8
  405. package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
  406. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +43 -32
  407. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  408. package/lib/cjs/core-react/utils/hooks/useTargeted.d.ts.map +1 -1
  409. package/lib/cjs/core-react/utils/hooks/useTargeted.js +7 -4
  410. package/lib/cjs/core-react/utils/hooks/useTargeted.js.map +1 -1
  411. package/lib/cjs/core-react/utils/hooks/useThrottledFn.js +3 -3
  412. package/lib/cjs/core-react/utils/hooks/useThrottledFn.js.map +1 -1
  413. package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.d.ts.map +1 -1
  414. package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js +3 -4
  415. package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
  416. package/lib/cjs/core-react/utils/isPromiseLike.d.ts.map +1 -1
  417. package/lib/cjs/core-react/utils/isPromiseLike.js +6 -4
  418. package/lib/cjs/core-react/utils/isPromiseLike.js.map +1 -1
  419. package/lib/cjs/core-react/utils/reuseOrCreatePromise.d.ts +14 -0
  420. package/lib/cjs/core-react/utils/reuseOrCreatePromise.d.ts.map +1 -0
  421. package/lib/cjs/core-react/utils/reuseOrCreatePromise.js +33 -0
  422. package/lib/cjs/core-react/utils/reuseOrCreatePromise.js.map +1 -0
  423. package/lib/cjs/core-react/utils/shallowDiffers.d.ts.map +1 -1
  424. package/lib/cjs/core-react/utils/shallowDiffers.js +3 -3
  425. package/lib/cjs/core-react/utils/shallowDiffers.js.map +1 -1
  426. package/lib/cjs/core-react/utils/typeUtils.js +3 -3
  427. package/lib/cjs/core-react/utils/typeUtils.js.map +1 -1
  428. package/lib/cjs/core-react.d.ts +3 -3
  429. package/lib/cjs/core-react.d.ts.map +1 -1
  430. package/lib/cjs/core-react.js +3 -3
  431. package/lib/cjs/core-react.js.map +1 -1
  432. package/lib/esm/core-react/UiCore.d.ts.map +1 -1
  433. package/lib/esm/core-react/UiCore.js +9 -5
  434. package/lib/esm/core-react/UiCore.js.map +1 -1
  435. package/lib/esm/core-react/_geometry.scss +70 -70
  436. package/lib/esm/core-react/_helpers.scss +52 -51
  437. package/lib/esm/core-react/_math.scss +13 -13
  438. package/lib/esm/core-react/_scrollbar.scss +55 -51
  439. package/lib/esm/core-react/_typography.scss +44 -44
  440. package/lib/esm/core-react/_z-index.scss +47 -65
  441. package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +1 -1
  442. package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
  443. package/lib/esm/core-react/autosuggest/AutoSuggest.js +14 -15
  444. package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
  445. package/lib/esm/core-react/autosuggest/AutoSuggest.scss +79 -79
  446. package/lib/esm/core-react/badge/Badge.d.ts +1 -1
  447. package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
  448. package/lib/esm/core-react/badge/Badge.js +3 -3
  449. package/lib/esm/core-react/badge/Badge.js.map +1 -1
  450. package/lib/esm/core-react/badge/Badge.scss +13 -13
  451. package/lib/esm/core-react/badge/BadgeUtilities.d.ts.map +1 -1
  452. package/lib/esm/core-react/badge/BadgeUtilities.js +3 -3
  453. package/lib/esm/core-react/badge/BadgeUtilities.js.map +1 -1
  454. package/lib/esm/core-react/badge/BetaBadge.d.ts.map +1 -1
  455. package/lib/esm/core-react/badge/BetaBadge.js +3 -3
  456. package/lib/esm/core-react/badge/BetaBadge.js.map +1 -1
  457. package/lib/esm/core-react/badge/NewBadge.d.ts.map +1 -1
  458. package/lib/esm/core-react/badge/NewBadge.js +4 -4
  459. package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
  460. package/lib/esm/core-react/badge/NewBadge.scss +9 -9
  461. package/lib/esm/core-react/base/Centered.js +3 -3
  462. package/lib/esm/core-react/base/Centered.js.map +1 -1
  463. package/lib/esm/core-react/base/Div.d.ts.map +1 -1
  464. package/lib/esm/core-react/base/Div.js +3 -3
  465. package/lib/esm/core-react/base/Div.js.map +1 -1
  466. package/lib/esm/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
  467. package/lib/esm/core-react/base/DivWithOutsideClick.js +4 -4
  468. package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
  469. package/lib/esm/core-react/base/FillCentered.js +3 -3
  470. package/lib/esm/core-react/base/FillCentered.js.map +1 -1
  471. package/lib/esm/core-react/base/FlexWrapContainer.js +3 -3
  472. package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
  473. package/lib/esm/core-react/base/Gap.d.ts.map +1 -1
  474. package/lib/esm/core-react/base/Gap.js +5 -5
  475. package/lib/esm/core-react/base/Gap.js.map +1 -1
  476. package/lib/esm/core-react/base/PointerEvents.js +3 -3
  477. package/lib/esm/core-react/base/PointerEvents.js.map +1 -1
  478. package/lib/esm/core-react/base/ScrollView.js +3 -3
  479. package/lib/esm/core-react/base/ScrollView.js.map +1 -1
  480. package/lib/esm/core-react/base/base.scss +42 -42
  481. package/lib/esm/core-react/base/classes.scss +27 -13
  482. package/lib/esm/core-react/base/index.scss +5 -5
  483. package/lib/esm/core-react/button/UnderlinedButton.d.ts.map +1 -1
  484. package/lib/esm/core-react/button/UnderlinedButton.js +3 -3
  485. package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
  486. package/lib/esm/core-react/button/UnderlinedButton.scss +32 -33
  487. package/lib/esm/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
  488. package/lib/esm/core-react/checklistbox/CheckListBox.js +4 -4
  489. package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
  490. package/lib/esm/core-react/checklistbox/CheckListBox.scss +22 -22
  491. package/lib/esm/core-react/classes.scss +11 -11
  492. package/lib/esm/core-react/colorthemes.scss +61 -61
  493. package/lib/esm/core-react/colorvariables.scss +131 -131
  494. package/lib/esm/core-react/contextmenu/ContextMenu.d.ts +7 -7
  495. package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
  496. package/lib/esm/core-react/contextmenu/ContextMenu.js +43 -25
  497. package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
  498. package/lib/esm/core-react/contextmenu/ContextMenu.scss +236 -236
  499. package/lib/esm/core-react/contextmenu/ContextMenuDirection.d.ts.map +1 -1
  500. package/lib/esm/core-react/contextmenu/ContextMenuDirection.js +3 -3
  501. package/lib/esm/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
  502. package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts +1 -1
  503. package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
  504. package/lib/esm/core-react/contextmenu/ContextMenuDivider.js +3 -3
  505. package/lib/esm/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
  506. package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
  507. package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
  508. package/lib/esm/core-react/contextmenu/ContextMenuItem.js +16 -12
  509. package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
  510. package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts +2 -2
  511. package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
  512. package/lib/esm/core-react/contextmenu/ContextSubMenu.js +37 -15
  513. package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  514. package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
  515. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +14 -12
  516. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  517. package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
  518. package/lib/esm/core-react/contextmenu/PopupContextMenu.js +3 -3
  519. package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
  520. package/lib/esm/core-react/contextmenu/TildeFinder.d.ts.map +1 -1
  521. package/lib/esm/core-react/contextmenu/TildeFinder.js +15 -7
  522. package/lib/esm/core-react/contextmenu/TildeFinder.js.map +1 -1
  523. package/lib/esm/core-react/dialog/Dialog.d.ts +6 -5
  524. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  525. package/lib/esm/core-react/dialog/Dialog.js +95 -88
  526. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  527. package/lib/esm/core-react/dialog/Dialog.scss +245 -245
  528. package/lib/esm/core-react/dialog/GlobalDialog.d.ts.map +1 -1
  529. package/lib/esm/core-react/dialog/GlobalDialog.js +11 -8
  530. package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
  531. package/lib/esm/core-react/dialog/SimpleDialog.d.ts +68 -0
  532. package/lib/esm/core-react/dialog/SimpleDialog.d.ts.map +1 -0
  533. package/lib/esm/core-react/dialog/SimpleDialog.js +47 -0
  534. package/lib/esm/core-react/dialog/SimpleDialog.js.map +1 -0
  535. package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  536. package/lib/esm/core-react/elementseparator/ElementSeparator.js +16 -10
  537. package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
  538. package/lib/esm/core-react/elementseparator/ElementSeparator.scss +94 -85
  539. package/lib/esm/core-react/enums/Alignment.js +3 -3
  540. package/lib/esm/core-react/enums/Alignment.js.map +1 -1
  541. package/lib/esm/core-react/enums/CheckBoxState.js +3 -3
  542. package/lib/esm/core-react/enums/CheckBoxState.js.map +1 -1
  543. package/lib/esm/core-react/enums/Orientation.js +3 -3
  544. package/lib/esm/core-react/enums/Orientation.js.map +1 -1
  545. package/lib/esm/core-react/enums/SortDirection.js +3 -3
  546. package/lib/esm/core-react/enums/SortDirection.js.map +1 -1
  547. package/lib/esm/core-react/enums/TimeFormat.js +3 -3
  548. package/lib/esm/core-react/enums/TimeFormat.js.map +1 -1
  549. package/lib/esm/core-react/expandable/ExpandableList.d.ts +1 -1
  550. package/lib/esm/core-react/expandable/ExpandableList.d.ts.map +1 -1
  551. package/lib/esm/core-react/expandable/ExpandableList.js +8 -5
  552. package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
  553. package/lib/esm/core-react/expandable/ExpandableList.scss +9 -9
  554. package/lib/esm/core-react/expandable/classes.scss +9 -7
  555. package/lib/esm/core-react/expandable/index.scss +5 -5
  556. package/lib/esm/core-react/expandable/list.scss +35 -35
  557. package/lib/esm/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
  558. package/lib/esm/core-react/focus/ItemKeyboardNavigator.js +38 -15
  559. package/lib/esm/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
  560. package/lib/esm/core-react/focustrap/FocusTrap.d.ts.map +1 -1
  561. package/lib/esm/core-react/focustrap/FocusTrap.js +33 -16
  562. package/lib/esm/core-react/focustrap/FocusTrap.js.map +1 -1
  563. package/lib/esm/core-react/hocs/withIsPressed.d.ts.map +1 -1
  564. package/lib/esm/core-react/hocs/withIsPressed.js +4 -7
  565. package/lib/esm/core-react/hocs/withIsPressed.js.map +1 -1
  566. package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
  567. package/lib/esm/core-react/hocs/withOnOutsideClick.js +17 -13
  568. package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
  569. package/lib/esm/core-react/hocs/withTimeout.d.ts.map +1 -1
  570. package/lib/esm/core-react/hocs/withTimeout.js +6 -8
  571. package/lib/esm/core-react/hocs/withTimeout.js.map +1 -1
  572. package/lib/esm/core-react/icons/ConditionalIconItem.d.ts +5 -1
  573. package/lib/esm/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
  574. package/lib/esm/core-react/icons/ConditionalIconItem.js +26 -9
  575. package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -1
  576. package/lib/esm/core-react/icons/IconComponent.d.ts +1 -1
  577. package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
  578. package/lib/esm/core-react/icons/IconComponent.js +22 -12
  579. package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
  580. package/lib/esm/core-react/icons/IconComponent.scss +19 -20
  581. package/lib/esm/core-react/icons/SvgPath.d.ts.map +1 -1
  582. package/lib/esm/core-react/icons/SvgPath.js +4 -4
  583. package/lib/esm/core-react/icons/SvgPath.js.map +1 -1
  584. package/lib/esm/core-react/icons/SvgPath.scss +15 -15
  585. package/lib/esm/core-react/icons/WebFontIcon.js +3 -3
  586. package/lib/esm/core-react/icons/WebFontIcon.js.map +1 -1
  587. package/lib/esm/core-react/icons/WebFontIcon.scss +17 -17
  588. package/lib/esm/core-react/icons/classes.scss +18 -10
  589. package/lib/esm/core-react/icons/index.scss +6 -6
  590. package/lib/esm/core-react/icons/mixins.scss +25 -25
  591. package/lib/esm/core-react/icons/variables.scss +12 -12
  592. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
  593. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +6 -4
  594. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
  595. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
  596. package/lib/esm/core-react/index.scss +21 -21
  597. package/lib/esm/core-react/inputs/Input.d.ts +1 -1
  598. package/lib/esm/core-react/inputs/Input.d.ts.map +1 -1
  599. package/lib/esm/core-react/inputs/Input.js +6 -7
  600. package/lib/esm/core-react/inputs/Input.js.map +1 -1
  601. package/lib/esm/core-react/inputs/InputLabel.d.ts +1 -1
  602. package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
  603. package/lib/esm/core-react/inputs/InputLabel.js +11 -14
  604. package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
  605. package/lib/esm/core-react/inputs/InputStatus.js +3 -3
  606. package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
  607. package/lib/esm/core-react/inputs/LabeledComponentProps.js +3 -3
  608. package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
  609. package/lib/esm/core-react/inputs/classes.scss +12 -8
  610. package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts +1 -1
  611. package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
  612. package/lib/esm/core-react/inputs/iconinput/IconInput.js +3 -4
  613. package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
  614. package/lib/esm/core-react/inputs/iconinput/IconInput.scss +34 -35
  615. package/lib/esm/core-react/inputs/index.scss +9 -9
  616. package/lib/esm/core-react/inputs/input-label.scss +90 -90
  617. package/lib/esm/core-react/inputs/input.scss +58 -58
  618. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +2 -2
  619. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  620. package/lib/esm/core-react/inputs/numberinput/NumberInput.js +26 -17
  621. package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  622. package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +88 -88
  623. package/lib/esm/core-react/inputs/variables.scss +38 -38
  624. package/lib/esm/core-react/layout-variables.scss +15 -17
  625. package/lib/esm/core-react/listbox/Listbox.d.ts +2 -2
  626. package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
  627. package/lib/esm/core-react/listbox/Listbox.js +20 -14
  628. package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
  629. package/lib/esm/core-react/listbox/Listbox.scss +54 -54
  630. package/lib/esm/core-react/loading/LoadingBar.d.ts.map +1 -1
  631. package/lib/esm/core-react/loading/LoadingBar.js +4 -4
  632. package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
  633. package/lib/esm/core-react/loading/LoadingBar.scss +29 -29
  634. package/lib/esm/core-react/loading/LoadingPrompt.d.ts.map +1 -1
  635. package/lib/esm/core-react/loading/LoadingPrompt.js +9 -9
  636. package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
  637. package/lib/esm/core-react/loading/LoadingPrompt.scss +33 -33
  638. package/lib/esm/core-react/loading/LoadingSpinner.d.ts +3 -3
  639. package/lib/esm/core-react/loading/LoadingSpinner.d.ts.map +1 -1
  640. package/lib/esm/core-react/loading/LoadingSpinner.js +5 -5
  641. package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
  642. package/lib/esm/core-react/loading/LoadingSpinner.scss +26 -26
  643. package/lib/esm/core-react/loading/LoadingStatus.d.ts.map +1 -1
  644. package/lib/esm/core-react/loading/LoadingStatus.js +3 -3
  645. package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
  646. package/lib/esm/core-react/loading/LoadingStatus.scss +20 -20
  647. package/lib/esm/core-react/loading/index.scss +5 -5
  648. package/lib/esm/core-react/loading/mixins.scss +57 -57
  649. package/lib/esm/core-react/messagebox/MessageBox.d.ts +3 -3
  650. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  651. package/lib/esm/core-react/messagebox/MessageBox.js +6 -6
  652. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  653. package/lib/esm/core-react/messagebox/MessageBox.scss +56 -56
  654. package/lib/esm/core-react/notification/MessageRenderer.d.ts.map +1 -1
  655. package/lib/esm/core-react/notification/MessageRenderer.js +19 -13
  656. package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
  657. package/lib/esm/core-react/notification/MessageType.d.ts.map +1 -1
  658. package/lib/esm/core-react/notification/MessageType.js +3 -3
  659. package/lib/esm/core-react/notification/MessageType.js.map +1 -1
  660. package/lib/esm/core-react/popup/Popup.d.ts.map +1 -1
  661. package/lib/esm/core-react/popup/Popup.js +50 -31
  662. package/lib/esm/core-react/popup/Popup.js.map +1 -1
  663. package/lib/esm/core-react/popup/Popup.scss +240 -240
  664. package/lib/esm/core-react/radialmenu/Annulus.d.ts.map +1 -1
  665. package/lib/esm/core-react/radialmenu/Annulus.js +4 -4
  666. package/lib/esm/core-react/radialmenu/Annulus.js.map +1 -1
  667. package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +2 -2
  668. package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
  669. package/lib/esm/core-react/radialmenu/RadialMenu.js +26 -11
  670. package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
  671. package/lib/esm/core-react/radialmenu/RadialMenu.scss +55 -55
  672. package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
  673. package/lib/esm/core-react/searchbox/SearchBox.js +17 -7
  674. package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
  675. package/lib/esm/core-react/searchbox/SearchBox.scss +47 -47
  676. package/lib/esm/core-react/settings/SettingsContainer.d.ts +1 -1
  677. package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
  678. package/lib/esm/core-react/settings/SettingsContainer.js +54 -19
  679. package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
  680. package/lib/esm/core-react/settings/SettingsContainer.scss +68 -68
  681. package/lib/esm/core-react/settings/SettingsManager.d.ts +3 -3
  682. package/lib/esm/core-react/settings/SettingsManager.d.ts.map +1 -1
  683. package/lib/esm/core-react/settings/SettingsManager.js +7 -8
  684. package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
  685. package/lib/esm/core-react/style/baseline.scss +11 -11
  686. package/lib/esm/core-react/style/breakpoints.scss +59 -41
  687. package/lib/esm/core-react/style/colors.scss +77 -77
  688. package/lib/esm/core-react/style/index.scss +10 -10
  689. package/lib/esm/core-react/style/mixins.scss +23 -27
  690. package/lib/esm/core-react/style/opacity.scss +16 -16
  691. package/lib/esm/core-react/style/themecolors.scss +133 -123
  692. package/lib/esm/core-react/tabs/Tabs.d.ts +4 -4
  693. package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
  694. package/lib/esm/core-react/tabs/Tabs.js +13 -11
  695. package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
  696. package/lib/esm/core-react/tabs/VerticalTabs.d.ts.map +1 -1
  697. package/lib/esm/core-react/tabs/VerticalTabs.js +3 -3
  698. package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
  699. package/lib/esm/core-react/tabs/classes.scss +9 -7
  700. package/lib/esm/core-react/tabs/index.scss +5 -5
  701. package/lib/esm/core-react/tabs/tabs.scss +96 -96
  702. package/lib/esm/core-react/tabs/vertical.scss +51 -51
  703. package/lib/esm/core-react/text/BlockText.js +4 -4
  704. package/lib/esm/core-react/text/BlockText.js.map +1 -1
  705. package/lib/esm/core-react/text/BodyText.js +4 -4
  706. package/lib/esm/core-react/text/BodyText.js.map +1 -1
  707. package/lib/esm/core-react/text/DisabledText.js +4 -4
  708. package/lib/esm/core-react/text/DisabledText.js.map +1 -1
  709. package/lib/esm/core-react/text/FilteredText.d.ts.map +1 -1
  710. package/lib/esm/core-react/text/FilteredText.js +5 -5
  711. package/lib/esm/core-react/text/FilteredText.js.map +1 -1
  712. package/lib/esm/core-react/text/FilteredText.scss +10 -10
  713. package/lib/esm/core-react/text/MutedText.js +4 -4
  714. package/lib/esm/core-react/text/MutedText.js.map +1 -1
  715. package/lib/esm/core-react/text/StyledText.js +3 -3
  716. package/lib/esm/core-react/text/StyledText.js.map +1 -1
  717. package/lib/esm/core-react/text/TextProps.d.ts.map +1 -1
  718. package/lib/esm/core-react/text/TextProps.js +3 -3
  719. package/lib/esm/core-react/text/TextProps.js.map +1 -1
  720. package/lib/esm/core-react/text/block.scss +15 -15
  721. package/lib/esm/core-react/text/body.scss +13 -13
  722. package/lib/esm/core-react/text/classes.scss +18 -10
  723. package/lib/esm/core-react/text/disabled.scss +9 -10
  724. package/lib/esm/core-react/text/index.scss +10 -10
  725. package/lib/esm/core-react/text/mixins.scss +24 -24
  726. package/lib/esm/core-react/text/muted.scss +9 -10
  727. package/lib/esm/core-react/tree/Branch.d.ts.map +1 -1
  728. package/lib/esm/core-react/tree/Branch.js +3 -3
  729. package/lib/esm/core-react/tree/Branch.js.map +1 -1
  730. package/lib/esm/core-react/tree/Branch.scss +13 -13
  731. package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  732. package/lib/esm/core-react/tree/ExpansionToggle.js +3 -3
  733. package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
  734. package/lib/esm/core-react/tree/ExpansionToggle.scss +32 -32
  735. package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
  736. package/lib/esm/core-react/tree/Node.js +12 -10
  737. package/lib/esm/core-react/tree/Node.js.map +1 -1
  738. package/lib/esm/core-react/tree/Node.scss +68 -68
  739. package/lib/esm/core-react/tree/Placeholder.js +5 -5
  740. package/lib/esm/core-react/tree/Placeholder.js.map +1 -1
  741. package/lib/esm/core-react/tree/Placeholder.scss +17 -17
  742. package/lib/esm/core-react/tree/Tree.d.ts.map +1 -1
  743. package/lib/esm/core-react/tree/Tree.js +20 -11
  744. package/lib/esm/core-react/tree/Tree.js.map +1 -1
  745. package/lib/esm/core-react/tree/Tree.scss +21 -21
  746. package/lib/esm/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
  747. package/lib/esm/core-react/uistate/LocalStateStorage.js +7 -4
  748. package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -1
  749. package/lib/esm/core-react/uistate/UiStateEntry.d.ts.map +1 -1
  750. package/lib/esm/core-react/uistate/UiStateEntry.js +3 -3
  751. package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -1
  752. package/lib/esm/core-react/uistate/UiStateStorage.d.ts.map +1 -1
  753. package/lib/esm/core-react/uistate/UiStateStorage.js +3 -3
  754. package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -1
  755. package/lib/esm/core-react/utils/IconHelper.d.ts +3 -1
  756. package/lib/esm/core-react/utils/IconHelper.d.ts.map +1 -1
  757. package/lib/esm/core-react/utils/IconHelper.js +35 -6
  758. package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
  759. package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
  760. package/lib/esm/core-react/utils/IconWebComponent.js +71 -41
  761. package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
  762. package/lib/esm/core-react/utils/Point.d.ts.map +1 -1
  763. package/lib/esm/core-react/utils/Point.js +3 -3
  764. package/lib/esm/core-react/utils/Point.js.map +1 -1
  765. package/lib/esm/core-react/utils/Props.d.ts.map +1 -1
  766. package/lib/esm/core-react/utils/Props.js +3 -3
  767. package/lib/esm/core-react/utils/Props.js.map +1 -1
  768. package/lib/esm/core-react/utils/Rectangle.d.ts.map +1 -1
  769. package/lib/esm/core-react/utils/Rectangle.js +15 -7
  770. package/lib/esm/core-react/utils/Rectangle.js.map +1 -1
  771. package/lib/esm/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
  772. package/lib/esm/core-react/utils/ScrollPositionMaintainer.js +4 -2
  773. package/lib/esm/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
  774. package/lib/esm/core-react/utils/Size.d.ts.map +1 -1
  775. package/lib/esm/core-react/utils/Size.js +4 -5
  776. package/lib/esm/core-react/utils/Size.js.map +1 -1
  777. package/lib/esm/core-react/utils/Timer.d.ts.map +1 -1
  778. package/lib/esm/core-react/utils/Timer.js +3 -3
  779. package/lib/esm/core-react/utils/Timer.js.map +1 -1
  780. package/lib/esm/core-react/utils/UiGeometry.d.ts.map +1 -1
  781. package/lib/esm/core-react/utils/UiGeometry.js +9 -5
  782. package/lib/esm/core-react/utils/UiGeometry.js.map +1 -1
  783. package/lib/esm/core-react/utils/flattenChildren.js +3 -3
  784. package/lib/esm/core-react/utils/flattenChildren.js.map +1 -1
  785. package/lib/esm/core-react/utils/getBestBWContrastColor.js +5 -5
  786. package/lib/esm/core-react/utils/getBestBWContrastColor.js.map +1 -1
  787. package/lib/esm/core-react/utils/getCssVariable.d.ts.map +1 -1
  788. package/lib/esm/core-react/utils/getCssVariable.js +4 -4
  789. package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
  790. package/lib/esm/core-react/utils/getDisplayName.d.ts.map +1 -1
  791. package/lib/esm/core-react/utils/getDisplayName.js +3 -3
  792. package/lib/esm/core-react/utils/getDisplayName.js.map +1 -1
  793. package/lib/esm/core-react/utils/getUserColor.d.ts.map +1 -1
  794. package/lib/esm/core-react/utils/getUserColor.js +5 -4
  795. package/lib/esm/core-react/utils/getUserColor.js.map +1 -1
  796. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
  797. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js +4 -4
  798. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
  799. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
  800. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +22 -11
  801. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  802. package/lib/esm/core-react/utils/hooks/useDisposable.d.ts.map +1 -1
  803. package/lib/esm/core-react/utils/hooks/useDisposable.js +3 -3
  804. package/lib/esm/core-react/utils/hooks/useDisposable.js.map +1 -1
  805. package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.d.ts.map +1 -1
  806. package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js +3 -3
  807. package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
  808. package/lib/esm/core-react/utils/hooks/useEventListener.d.ts.map +1 -1
  809. package/lib/esm/core-react/utils/hooks/useEventListener.js +3 -3
  810. package/lib/esm/core-react/utils/hooks/useEventListener.js.map +1 -1
  811. package/lib/esm/core-react/utils/hooks/useInterval.d.ts.map +1 -1
  812. package/lib/esm/core-react/utils/hooks/useInterval.js +6 -4
  813. package/lib/esm/core-react/utils/hooks/useInterval.js.map +1 -1
  814. package/lib/esm/core-react/utils/hooks/useLifecycleLogging.d.ts.map +1 -1
  815. package/lib/esm/core-react/utils/hooks/useLifecycleLogging.js +7 -4
  816. package/lib/esm/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
  817. package/lib/esm/core-react/utils/hooks/useOnOutsideClick.d.ts.map +1 -1
  818. package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js +15 -6
  819. package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
  820. package/lib/esm/core-react/utils/hooks/useProximityToMouse.js +3 -3
  821. package/lib/esm/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
  822. package/lib/esm/core-react/utils/hooks/useRefEffect.d.ts +1 -1
  823. package/lib/esm/core-react/utils/hooks/useRefEffect.d.ts.map +1 -1
  824. package/lib/esm/core-react/utils/hooks/useRefEffect.js +3 -3
  825. package/lib/esm/core-react/utils/hooks/useRefEffect.js.map +1 -1
  826. package/lib/esm/core-react/utils/hooks/useRefState.js +3 -3
  827. package/lib/esm/core-react/utils/hooks/useRefState.js.map +1 -1
  828. package/lib/esm/core-react/utils/hooks/useRefs.d.ts.map +1 -1
  829. package/lib/esm/core-react/utils/hooks/useRefs.js +8 -6
  830. package/lib/esm/core-react/utils/hooks/useRefs.js.map +1 -1
  831. package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts +8 -8
  832. package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
  833. package/lib/esm/core-react/utils/hooks/useResizeObserver.js +43 -32
  834. package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  835. package/lib/esm/core-react/utils/hooks/useTargeted.d.ts.map +1 -1
  836. package/lib/esm/core-react/utils/hooks/useTargeted.js +7 -4
  837. package/lib/esm/core-react/utils/hooks/useTargeted.js.map +1 -1
  838. package/lib/esm/core-react/utils/hooks/useThrottledFn.js +3 -3
  839. package/lib/esm/core-react/utils/hooks/useThrottledFn.js.map +1 -1
  840. package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.d.ts.map +1 -1
  841. package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js +3 -4
  842. package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
  843. package/lib/esm/core-react/utils/isPromiseLike.d.ts.map +1 -1
  844. package/lib/esm/core-react/utils/isPromiseLike.js +6 -4
  845. package/lib/esm/core-react/utils/isPromiseLike.js.map +1 -1
  846. package/lib/esm/core-react/utils/reuseOrCreatePromise.d.ts +14 -0
  847. package/lib/esm/core-react/utils/reuseOrCreatePromise.d.ts.map +1 -0
  848. package/lib/esm/core-react/utils/reuseOrCreatePromise.js +29 -0
  849. package/lib/esm/core-react/utils/reuseOrCreatePromise.js.map +1 -0
  850. package/lib/esm/core-react/utils/shallowDiffers.d.ts.map +1 -1
  851. package/lib/esm/core-react/utils/shallowDiffers.js +3 -3
  852. package/lib/esm/core-react/utils/shallowDiffers.js.map +1 -1
  853. package/lib/esm/core-react/utils/typeUtils.js +3 -3
  854. package/lib/esm/core-react/utils/typeUtils.js.map +1 -1
  855. package/lib/esm/core-react.d.ts +3 -3
  856. package/lib/esm/core-react.d.ts.map +1 -1
  857. package/lib/esm/core-react.js +6 -6
  858. package/lib/esm/core-react.js.map +1 -1
  859. package/lib/public/locales/en/UiCore.json +31 -31
  860. package/package.json +8 -17
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import { useEffect, useRef } from "react";
6
6
  /**
7
7
  * Logs to console information about component lifecycle: mounting, re-rendering and unmounting.
@@ -37,7 +37,10 @@ export function useLifecycleLogging(name, props, context) {
37
37
  return diff;
38
38
  }
39
39
  const propsDiff = getDiff(prevProps.current, props);
40
- const contextDiff = { from: context === undefined ? context : prevContext.current, to: context };
40
+ const contextDiff = {
41
+ from: context === undefined ? context : prevContext.current,
42
+ to: context,
43
+ };
41
44
  if (Object.keys(propsDiff).length > 0 && prevContext.current !== context) {
42
45
  // eslint-disable-next-line no-console
43
46
  console.log(`[useLifecycleLogging]: '${name}' Props and context changed: `, propsDiff, contextDiff);
@@ -1 +1 @@
1
- {"version":3,"file":"useLifecycleLogging.js","source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AC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACpD,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;QAEjG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,CAAC,OAAO,KAAK,OAAO,EAAE;YACxE,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,+BAA+B,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;SACrG;aAAM,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5C,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,mBAAmB,EAAE,SAAS,CAAC,CAAC;SAC5E;aAAM,IAAI,WAAW,CAAC,OAAO,KAAK,OAAO,EAAE;YAC1C,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,qBAAqB,EAAE,WAAW,CAAC,CAAC;SAChF;aAAM;YACL,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,0BAA0B,CAAC,CAAC;SACxE;QAED,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { useEffect, useRef } from \"react\";\r\n\r\n/**\r\n * Logs to console information about component lifecycle: mounting, re-rendering and unmounting.\r\n * @internal\r\n */\r\nexport function useLifecycleLogging(name: string, props: Record<string, any>, context?: Record<string, any>) {\r\n useEffect(() => {\r\n // eslint-disable-next-line no-console\r\n console.log(`[useLifecycleLogging]: '${name}' Component mounted.`);\r\n\r\n return () => {\r\n // eslint-disable-next-line no-console\r\n console.log(`[useLifecycleLogging]: '${name}' Component unmounted.`);\r\n };\r\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\r\n\r\n const prevProps = useRef(props);\r\n const prevContext = useRef(context);\r\n const firstRun = useRef(true);\r\n useEffect(() => {\r\n if (firstRun.current) {\r\n firstRun.current = false;\r\n return;\r\n }\r\n\r\n function getDiff(prev: Record<string, any>, current: Record<string, any>): Record<string, any> {\r\n const diff: Record<string, { from: any, to: any }> = {};\r\n for (const key of Object.keys(current)) {\r\n if (prev[key] !== current[key]) {\r\n diff[key] = {\r\n from: prev[key],\r\n to: current[key],\r\n };\r\n }\r\n }\r\n\r\n return diff;\r\n }\r\n\r\n const propsDiff = getDiff(prevProps.current, props);\r\n const contextDiff = { from: context === undefined ? context : prevContext.current, to: context };\r\n\r\n if (Object.keys(propsDiff).length > 0 && prevContext.current !== context) {\r\n // eslint-disable-next-line no-console\r\n console.log(`[useLifecycleLogging]: '${name}' Props and context changed: `, propsDiff, contextDiff);\r\n } else if (Object.keys(propsDiff).length > 0) {\r\n // eslint-disable-next-line no-console\r\n console.log(`[useLifecycleLogging]: '${name}' Props changed: `, propsDiff);\r\n } else if (prevContext.current !== context) {\r\n // eslint-disable-next-line no-console\r\n console.log(`[useLifecycleLogging]: '${name}' Context changed: `, contextDiff);\r\n } else {\r\n // eslint-disable-next-line no-console\r\n console.log(`[useLifecycleLogging]: '${name}' Component re-rendered.`);\r\n }\r\n\r\n prevProps.current = props;\r\n prevContext.current = context;\r\n });\r\n}\r\n"]}
1
+ {"version":3,"file":"useLifecycleLogging.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useLifecycleLogging.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OA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CAAC,CAAC,CAAC,WAAW,CAAC,OAAO;YAC3D,EAAE,EAAE,OAAO;SACZ,CAAC;QAEF,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,CAAC,OAAO,KAAK,OAAO,EAAE;YACxE,sCAAsC;YACtC,OAAO,CAAC,GAAG,CACT,2BAA2B,IAAI,+BAA+B,EAC9D,SAAS,EACT,WAAW,CACZ,CAAC;SACH;aAAM,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5C,sCAAsC;YACtC,OAAO,CAAC,GAAG,CACT,2BAA2B,IAAI,mBAAmB,EAClD,SAAS,CACV,CAAC;SACH;aAAM,IAAI,WAAW,CAAC,OAAO,KAAK,OAAO,EAAE;YAC1C,sCAAsC;YACtC,OAAO,CAAC,GAAG,CACT,2BAA2B,IAAI,qBAAqB,EACpD,WAAW,CACZ,CAAC;SACH;aAAM;YACL,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,0BAA0B,CAAC,CAAC;SACxE;QAED,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { useEffect, useRef } from \"react\";\n\n/**\n * Logs to console information about component lifecycle: mounting, re-rendering and unmounting.\n * @internal\n */\nexport function useLifecycleLogging(\n name: string,\n props: Record<string, any>,\n context?: Record<string, any>\n) {\n useEffect(() => {\n // eslint-disable-next-line no-console\n console.log(`[useLifecycleLogging]: '${name}' Component mounted.`);\n\n return () => {\n // eslint-disable-next-line no-console\n console.log(`[useLifecycleLogging]: '${name}' Component unmounted.`);\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const prevProps = useRef(props);\n const prevContext = useRef(context);\n const firstRun = useRef(true);\n useEffect(() => {\n if (firstRun.current) {\n firstRun.current = false;\n return;\n }\n\n function getDiff(\n prev: Record<string, any>,\n current: Record<string, any>\n ): Record<string, any> {\n const diff: Record<string, { from: any; to: any }> = {};\n for (const key of Object.keys(current)) {\n if (prev[key] !== current[key]) {\n diff[key] = {\n from: prev[key],\n to: current[key],\n };\n }\n }\n\n return diff;\n }\n\n const propsDiff = getDiff(prevProps.current, props);\n const contextDiff = {\n from: context === undefined ? context : prevContext.current,\n to: context,\n };\n\n if (Object.keys(propsDiff).length > 0 && prevContext.current !== context) {\n // eslint-disable-next-line no-console\n console.log(\n `[useLifecycleLogging]: '${name}' Props and context changed: `,\n propsDiff,\n contextDiff\n );\n } else if (Object.keys(propsDiff).length > 0) {\n // eslint-disable-next-line no-console\n console.log(\n `[useLifecycleLogging]: '${name}' Props changed: `,\n propsDiff\n );\n } else if (prevContext.current !== context) {\n // eslint-disable-next-line no-console\n console.log(\n `[useLifecycleLogging]: '${name}' Context changed: `,\n contextDiff\n );\n } else {\n // eslint-disable-next-line no-console\n console.log(`[useLifecycleLogging]: '${name}' Component re-rendered.`);\n }\n\n prevProps.current = props;\n prevContext.current = context;\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useOnOutsideClick.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useOnOutsideClick.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,cAAc;AACd,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,EACjD,cAAc,CAAC,EAAE,MAAM,IAAI;AAC3B,gFAAgF;AAChF,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,OAAO,sBAoE1D"}
1
+ {"version":3,"file":"useOnOutsideClick.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useOnOutsideClick.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,cAAc;AACd,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,EACjD,cAAc,CAAC,EAAE,MAAM,IAAI;AAC3B,gFAAgF;AAChF,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,OAAO,sBA6E1D"}
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  /** @packageDocumentation
6
6
  * @module Utilities
7
7
  */
@@ -29,7 +29,11 @@ outsideEventPredicate) {
29
29
  return;
30
30
  }
31
31
  const isOutsideEvent = !outsideEventPredicate || outsideEventPredicate(e);
32
- isDownOutside.current = (!!ref.current && (e.target instanceof Node) && !ref.current.contains(e.target)) && isOutsideEvent;
32
+ isDownOutside.current =
33
+ !!ref.current &&
34
+ e.target instanceof Node &&
35
+ !ref.current.contains(e.target) &&
36
+ isOutsideEvent;
33
37
  };
34
38
  if (hasPointerEventsSupport()) {
35
39
  document.addEventListener("pointerdown", listener);
@@ -53,8 +57,13 @@ outsideEventPredicate) {
53
57
  if (e.type === "mouseup" && !handleMouseEvents.current) {
54
58
  return;
55
59
  }
56
- onOutsideClick && isDownOutside.current && (!outsideEventPredicate || outsideEventPredicate(e)) &&
57
- ref.current && e.target instanceof Node && !ref.current.contains(e.target) && onOutsideClick();
60
+ onOutsideClick &&
61
+ isDownOutside.current &&
62
+ (!outsideEventPredicate || outsideEventPredicate(e)) &&
63
+ ref.current &&
64
+ e.target instanceof Node &&
65
+ !ref.current.contains(e.target) &&
66
+ onOutsideClick();
58
67
  isDownOutside.current = false;
59
68
  };
60
69
  if (hasPointerEventsSupport()) {
@@ -1 +1 @@
1
- {"version":3,"file":"useOnOutsideClick.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useOnOutsideClick.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,cAA2B;AAC3B,gFAAgF;AAChF,qBAAyD;IAEzD,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,sBAAsB,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAI,IAAI,CAAC,CAAC;IAClC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,QAAQ,GAAG,CAAC,CAAoB,EAAE,EAAE;YACxC,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,EAAE;gBAC3B,+CAA+C;gBAC/C,iBAAiB,CAAC,OAAO,GAAG,KAAK,CAAC;gBAClC,sBAAsB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;aACxC;iBAAM,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,CA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*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { hasPointerEventsSupport } from \"../../base/PointerEvents\";\r\nimport { Timer } from \"../Timer\";\r\n\r\n/** @public */\r\nexport type OutsideClickEvent = PointerEvent | MouseEvent | TouchEvent;\r\n\r\n/** Invokes onOutsideClick handler when user clicks outside of referenced element.\r\n * @public\r\n */\r\nexport function useOnOutsideClick<T extends Element>(\r\n onOutsideClick?: () => void,\r\n /** Invoked for intermediate events. Return `false` to prevent outside click. */\r\n outsideEventPredicate?: (e: OutsideClickEvent) => boolean,\r\n) {\r\n const handleMouseEvents = React.useRef(true);\r\n const handleMouseEventsTimer = React.useRef(new Timer(1000));\r\n const ref = React.useRef<T>(null);\r\n const isDownOutside = React.useRef(false);\r\n React.useEffect(() => {\r\n const listener = (e: OutsideClickEvent) => {\r\n if (e.type === \"touchstart\") {\r\n // Skip mouse event handlers after touch event.\r\n handleMouseEvents.current = false;\r\n handleMouseEventsTimer.current.start();\r\n } else if (e.type === \"mousedown\" && !handleMouseEvents.current) {\r\n return;\r\n }\r\n const isOutsideEvent = !outsideEventPredicate || outsideEventPredicate(e);\r\n isDownOutside.current = (!!ref.current && (e.target instanceof Node) && !ref.current.contains(e.target)) && isOutsideEvent;\r\n };\r\n if (hasPointerEventsSupport()) {\r\n document.addEventListener(\"pointerdown\", listener);\r\n } else {\r\n document.addEventListener(\"mousedown\", listener);\r\n document.addEventListener(\"touchstart\", listener);\r\n }\r\n return () => {\r\n if (hasPointerEventsSupport()) {\r\n document.removeEventListener(\"pointerdown\", listener);\r\n } else {\r\n document.removeEventListener(\"mousedown\", listener);\r\n document.removeEventListener(\"touchstart\", listener);\r\n }\r\n };\r\n }, [outsideEventPredicate]);\r\n React.useEffect(() => {\r\n const listener = (e: OutsideClickEvent) => {\r\n if (e.type === \"mouseup\" && !handleMouseEvents.current) {\r\n return;\r\n }\r\n onOutsideClick && isDownOutside.current && (!outsideEventPredicate || outsideEventPredicate(e)) &&\r\n ref.current && e.target instanceof Node && !ref.current.contains(e.target) && onOutsideClick();\r\n isDownOutside.current = false;\r\n };\r\n if (hasPointerEventsSupport()) {\r\n document.addEventListener(\"pointerup\", listener);\r\n } else {\r\n document.addEventListener(\"mouseup\", listener);\r\n document.addEventListener(\"touchend\", listener);\r\n }\r\n return () => {\r\n if (hasPointerEventsSupport()) {\r\n document.removeEventListener(\"pointerup\", listener);\r\n } else {\r\n document.removeEventListener(\"mouseup\", listener);\r\n document.removeEventListener(\"touchend\", listener);\r\n }\r\n };\r\n }, [onOutsideClick, outsideEventPredicate]);\r\n React.useEffect(() => {\r\n const listener = () => {\r\n handleMouseEvents.current = true;\r\n };\r\n const timer = handleMouseEventsTimer.current;\r\n timer.setOnExecute(listener);\r\n return () => {\r\n timer.setOnExecute(undefined);\r\n };\r\n }, []);\r\n return ref;\r\n}\r\n"]}
1
+ {"version":3,"file":"useOnOutsideClick.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useOnOutsideClick.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,cAA2B;AAC3B,gFAAgF;AAChF,qBAAyD;IAEzD,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,sBAAsB,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM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S,CAAC,GAAG,EAAE;QACnB,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,iBAAiB,CAAC,OAAO,GAAG,IAAI,CAAC;QACnC,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,sBAAsB,CAAC,OAAO,CAAC;QAC7C,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE;YACV,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAChC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,GAAG,CAAC;AACb,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 Utilities\n */\n\nimport * as React from \"react\";\nimport { hasPointerEventsSupport } from \"../../base/PointerEvents\";\nimport { Timer } from \"../Timer\";\n\n/** @public */\nexport type OutsideClickEvent = PointerEvent | MouseEvent | TouchEvent;\n\n/** Invokes onOutsideClick handler when user clicks outside of referenced element.\n * @public\n */\nexport function useOnOutsideClick<T extends Element>(\n onOutsideClick?: () => void,\n /** Invoked for intermediate events. Return `false` to prevent outside click. */\n outsideEventPredicate?: (e: OutsideClickEvent) => boolean\n) {\n const handleMouseEvents = React.useRef(true);\n const handleMouseEventsTimer = React.useRef(new Timer(1000));\n const ref = React.useRef<T>(null);\n const isDownOutside = React.useRef(false);\n React.useEffect(() => {\n const listener = (e: OutsideClickEvent) => {\n if (e.type === \"touchstart\") {\n // Skip mouse event handlers after touch event.\n handleMouseEvents.current = false;\n handleMouseEventsTimer.current.start();\n } else if (e.type === \"mousedown\" && !handleMouseEvents.current) {\n return;\n }\n const isOutsideEvent = !outsideEventPredicate || outsideEventPredicate(e);\n isDownOutside.current =\n !!ref.current &&\n e.target instanceof Node &&\n !ref.current.contains(e.target) &&\n isOutsideEvent;\n };\n if (hasPointerEventsSupport()) {\n document.addEventListener(\"pointerdown\", listener);\n } else {\n document.addEventListener(\"mousedown\", listener);\n document.addEventListener(\"touchstart\", listener);\n }\n return () => {\n if (hasPointerEventsSupport()) {\n document.removeEventListener(\"pointerdown\", listener);\n } else {\n document.removeEventListener(\"mousedown\", listener);\n document.removeEventListener(\"touchstart\", listener);\n }\n };\n }, [outsideEventPredicate]);\n React.useEffect(() => {\n const listener = (e: OutsideClickEvent) => {\n if (e.type === \"mouseup\" && !handleMouseEvents.current) {\n return;\n }\n onOutsideClick &&\n isDownOutside.current &&\n (!outsideEventPredicate || outsideEventPredicate(e)) &&\n ref.current &&\n e.target instanceof Node &&\n !ref.current.contains(e.target) &&\n onOutsideClick();\n isDownOutside.current = false;\n };\n if (hasPointerEventsSupport()) {\n document.addEventListener(\"pointerup\", listener);\n } else {\n document.addEventListener(\"mouseup\", listener);\n document.addEventListener(\"touchend\", listener);\n }\n return () => {\n if (hasPointerEventsSupport()) {\n document.removeEventListener(\"pointerup\", listener);\n } else {\n document.removeEventListener(\"mouseup\", listener);\n document.removeEventListener(\"touchend\", listener);\n }\n };\n }, [onOutsideClick, outsideEventPredicate]);\n React.useEffect(() => {\n const listener = () => {\n handleMouseEvents.current = true;\n };\n const timer = handleMouseEventsTimer.current;\n timer.setOnExecute(listener);\n return () => {\n timer.setOnExecute(undefined);\n };\n }, []);\n return ref;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  /** @packageDocumentation
6
6
  * @module Utilities
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useProximityToMouse.js","sourceRoot":"","sources":["../../../../../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EF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC5E,OAAO,oCAAoC,GAAG,cAAc,CAAC;AAC/D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,OAAe,EAAU,EAAE;IACnE,OAAO,yCAAyC,OAAO,GAAG,CAAC;AAC7D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAU,EAAE;IAC7D,OAAO,6BAA6B,OAAO,GAAG,CAAC;AACjD,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,UAAkB,EAAU,EAAE;IACrE,OAAO,QAAQ,UAAU,KAAK,CAAC;AACjC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Point } from \"../Point\";\r\nimport { Rectangle } from \"../Rectangle\";\r\n\r\n/** @internal */\r\nexport class WidgetElementSet extends Set<React.RefObject<Element>> {}\r\n\r\n/** Returns the proximity scale associated with the shortest distance from the element(s) to the mouse.\r\n * @internal\r\n */\r\nexport const useProximityToMouse = (\r\n elementSet: WidgetElementSet,\r\n snap: boolean = false,\r\n threshold = PROXIMITY_THRESHOLD_DEFAULT\r\n) => {\r\n const [proximityScale, setProximityScale] = React.useState(1.0);\r\n\r\n React.useEffect(() => {\r\n const handleDocumentPointerMove = (e: PointerEvent) => {\r\n let shortestProximity = Number.MAX_SAFE_INTEGER;\r\n\r\n for (const ref of elementSet) {\r\n // istanbul ignore else\r\n if (ref.current) {\r\n const clientRect = ref.current.getBoundingClientRect();\r\n const rectangle = Rectangle.create(clientRect);\r\n const point = new Point(e.pageX, e.pageY);\r\n shortestProximity = Math.min(\r\n rectangle.getShortestDistanceToPoint(point),\r\n shortestProximity\r\n );\r\n }\r\n }\r\n\r\n const scale = calculateProximityScale(shortestProximity, snap, threshold);\r\n if (scale !== proximityScale) setProximityScale(scale);\r\n };\r\n\r\n document.addEventListener(\"pointermove\", handleDocumentPointerMove);\r\n\r\n return () => {\r\n document.removeEventListener(\"pointermove\", handleDocumentPointerMove);\r\n };\r\n }, [elementSet, proximityScale, snap, threshold]);\r\n\r\n return proximityScale;\r\n};\r\n\r\n/** Default proximity threshold.\r\n * @internal\r\n */\r\nexport const PROXIMITY_THRESHOLD_DEFAULT = 100;\r\n\r\n/** Default toolbar opacity.\r\n * @internal\r\n */\r\nexport const TOOLBAR_OPACITY_DEFAULT = 0.5;\r\n\r\n/** Default toolbar box-shadow opacity.\r\n * @internal\r\n */\r\nexport const TOOLBAR_BOX_SHADOW_OPACITY_DEFAULT = 0.35;\r\n\r\n/** Default toolbar backdrop-filter blur.\r\n * @internal\r\n */\r\nexport const TOOLBAR_BACKDROP_FILTER_BLUR_DEFAULT = 10;\r\n\r\n/** Calculates a proximity scale for further calculations given the proximity and threshold.\r\n * @internal\r\n */\r\nexport const calculateProximityScale = (\r\n proximity: number,\r\n snap: boolean = false,\r\n threshold = PROXIMITY_THRESHOLD_DEFAULT\r\n): number => {\r\n let scale = (proximity < threshold ? threshold - proximity : 0) / threshold;\r\n if (snap && scale > 0) scale = 1.0;\r\n return scale;\r\n};\r\n\r\n/** Calculates a toolbar opacity based on a given proximity scale.\r\n * @internal\r\n */\r\nexport const calculateToolbarOpacity = (proximityScale: number): number => {\r\n return TOOLBAR_OPACITY_DEFAULT * proximityScale;\r\n};\r\n\r\n/** Calculates a box-shadow opacity based on a given proximity scale.\r\n * @internal\r\n */\r\nexport const calculateBoxShadowOpacity = (proximityScale: number): number => {\r\n return TOOLBAR_BOX_SHADOW_OPACITY_DEFAULT * proximityScale;\r\n};\r\n\r\n/** Calculates a backdrop-filter blur based on a given proximity scale.\r\n * @internal\r\n */\r\nexport const calculateBackdropFilterBlur = (proximityScale: number): number => {\r\n return TOOLBAR_BACKDROP_FILTER_BLUR_DEFAULT * proximityScale;\r\n};\r\n\r\n/** Gets the Toolbar background-color based on a given opacity.\r\n * @internal\r\n */\r\nexport const getToolbarBackgroundColor = (opacity: number): string => {\r\n return `hsl(var(--iui-color-background-hsl) / ${opacity})`;\r\n};\r\n\r\n/** Gets the Toolbar box-shadow based on a given opacity.\r\n * @internal\r\n */\r\nexport const getToolbarBoxShadow = (opacity: number): string => {\r\n return `0 1px 3px 0 rgba(0, 0, 0, ${opacity})`;\r\n};\r\n\r\n/** Gets the Toolbar backdrop-filter based on a given blur amount.\r\n * @internal\r\n */\r\nexport const getToolbarBackdropFilter = (filterBlur: number): string => {\r\n return `blur(${filterBlur}px)`;\r\n};\r\n"]}
1
+ {"version":3,"file":"useProximityToMouse.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useProximityToMouse.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,gBAAgB;AAChB,MAAM,OAAO,gBAAiB,SAAQ,GAA6B;CAAG;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,UAA4B,EAC5B,OAAgB,KAAK,EACrB,SAAS,GAAG,2BAA2B,EACvC,EAAE;IACF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEhE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,yBAAyB,GAAG,CAAC,CAAe,EAAE,EAAE;YACpD,IAAI,iBAAiB,GAAG,MAAM,CAAC,gB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uBAAuB,GAAG,CACrC,SAAiB,EACjB,OAAgB,KAAK,EACrB,SAAS,GAAG,2BAA2B,EAC/B,EAAE;IACV,IAAI,KAAK,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC5E,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC;QAAE,KAAK,GAAG,GAAG,CAAC;IACnC,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,cAAsB,EAAU,EAAE;IACxE,OAAO,uBAAuB,GAAG,cAAc,CAAC;AAClD,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC1E,OAAO,kCAAkC,GAAG,cAAc,CAAC;AAC7D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,cAAsB,EAAU,EAAE;IAC5E,OAAO,oCAAoC,GAAG,cAAc,CAAC;AAC/D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,OAAe,EAAU,EAAE;IACnE,OAAO,yCAAyC,OAAO,GAAG,CAAC;AAC7D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAU,EAAE;IAC7D,OAAO,6BAA6B,OAAO,GAAG,CAAC;AACjD,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,UAAkB,EAAU,EAAE;IACrE,OAAO,QAAQ,UAAU,KAAK,CAAC;AACjC,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 Utilities\n */\n\nimport * as React from \"react\";\nimport { Point } from \"../Point\";\nimport { Rectangle } from \"../Rectangle\";\n\n/** @internal */\nexport class WidgetElementSet extends Set<React.RefObject<Element>> {}\n\n/** Returns the proximity scale associated with the shortest distance from the element(s) to the mouse.\n * @internal\n */\nexport const useProximityToMouse = (\n elementSet: WidgetElementSet,\n snap: boolean = false,\n threshold = PROXIMITY_THRESHOLD_DEFAULT\n) => {\n const [proximityScale, setProximityScale] = React.useState(1.0);\n\n React.useEffect(() => {\n const handleDocumentPointerMove = (e: PointerEvent) => {\n let shortestProximity = Number.MAX_SAFE_INTEGER;\n\n for (const ref of elementSet) {\n // istanbul ignore else\n if (ref.current) {\n const clientRect = ref.current.getBoundingClientRect();\n const rectangle = Rectangle.create(clientRect);\n const point = new Point(e.pageX, e.pageY);\n shortestProximity = Math.min(\n rectangle.getShortestDistanceToPoint(point),\n shortestProximity\n );\n }\n }\n\n const scale = calculateProximityScale(shortestProximity, snap, threshold);\n if (scale !== proximityScale) setProximityScale(scale);\n };\n\n document.addEventListener(\"pointermove\", handleDocumentPointerMove);\n\n return () => {\n document.removeEventListener(\"pointermove\", handleDocumentPointerMove);\n };\n }, [elementSet, proximityScale, snap, threshold]);\n\n return proximityScale;\n};\n\n/** Default proximity threshold.\n * @internal\n */\nexport const PROXIMITY_THRESHOLD_DEFAULT = 100;\n\n/** Default toolbar opacity.\n * @internal\n */\nexport const TOOLBAR_OPACITY_DEFAULT = 0.5;\n\n/** Default toolbar box-shadow opacity.\n * @internal\n */\nexport const TOOLBAR_BOX_SHADOW_OPACITY_DEFAULT = 0.35;\n\n/** Default toolbar backdrop-filter blur.\n * @internal\n */\nexport const TOOLBAR_BACKDROP_FILTER_BLUR_DEFAULT = 10;\n\n/** Calculates a proximity scale for further calculations given the proximity and threshold.\n * @internal\n */\nexport const calculateProximityScale = (\n proximity: number,\n snap: boolean = false,\n threshold = PROXIMITY_THRESHOLD_DEFAULT\n): number => {\n let scale = (proximity < threshold ? threshold - proximity : 0) / threshold;\n if (snap && scale > 0) scale = 1.0;\n return scale;\n};\n\n/** Calculates a toolbar opacity based on a given proximity scale.\n * @internal\n */\nexport const calculateToolbarOpacity = (proximityScale: number): number => {\n return TOOLBAR_OPACITY_DEFAULT * proximityScale;\n};\n\n/** Calculates a box-shadow opacity based on a given proximity scale.\n * @internal\n */\nexport const calculateBoxShadowOpacity = (proximityScale: number): number => {\n return TOOLBAR_BOX_SHADOW_OPACITY_DEFAULT * proximityScale;\n};\n\n/** Calculates a backdrop-filter blur based on a given proximity scale.\n * @internal\n */\nexport const calculateBackdropFilterBlur = (proximityScale: number): number => {\n return TOOLBAR_BACKDROP_FILTER_BLUR_DEFAULT * proximityScale;\n};\n\n/** Gets the Toolbar background-color based on a given opacity.\n * @internal\n */\nexport const getToolbarBackgroundColor = (opacity: number): string => {\n return `hsl(var(--iui-color-background-hsl) / ${opacity})`;\n};\n\n/** Gets the Toolbar box-shadow based on a given opacity.\n * @internal\n */\nexport const getToolbarBoxShadow = (opacity: number): string => {\n return `0 1px 3px 0 rgba(0, 0, 0, ${opacity})`;\n};\n\n/** Gets the Toolbar backdrop-filter based on a given blur amount.\n * @internal\n */\nexport const getToolbarBackdropFilter = (filterBlur: number): string => {\n return `blur(${filterBlur}px)`;\n};\n"]}
@@ -4,5 +4,5 @@
4
4
  /** Returns callback ref that is easy to setup and cleanup (API wise similar to React.useEffect).
5
5
  * @internal
6
6
  */
7
- export declare function useRefEffect<T>(callback: (instance: T | null) => (void | (() => void)), deps: ReadonlyArray<any>): (instance: T | null) => void;
7
+ export declare function useRefEffect<T>(callback: (instance: T | null) => void | (() => void), deps: ReadonlyArray<any>): (instance: T | null) => void;
8
8
  //# sourceMappingURL=useRefEffect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRefEffect.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefEffect.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,cAE3E,CAAC,GAAG,IAAI,UAK7C"}
1
+ {"version":3,"file":"useRefEffect.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefEffect.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EACrD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,cAGY,CAAC,GAAG,IAAI,UAK7C"}
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  /** @packageDocumentation
6
6
  * @module Utilities
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useRefEffect.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefEffect.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,YAAY,CAAI,QAAuD,EAAE,IAAwB;IAC/G,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAsB,IAAI,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,QAAkB,EAAE,EAAE;QAC9C,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtC,OAAO,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;IACpD,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,kDAAkD;AAC9D,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport * as React from \"react\";\r\n\r\n/** Returns callback ref that is easy to setup and cleanup (API wise similar to React.useEffect).\r\n * @internal\r\n */\r\nexport function useRefEffect<T>(callback: (instance: T | null) => (void | (() => void)), deps: ReadonlyArray<any>) {\r\n const cleanup = React.useRef<(() => void) | null>(null);\r\n return React.useCallback((instance: T | null) => {\r\n cleanup.current && cleanup.current();\r\n const newCleanup = callback(instance);\r\n cleanup.current = !newCleanup ? null : newCleanup;\r\n }, deps); // eslint-disable-line react-hooks/exhaustive-deps\r\n}\r\n"]}
1
+ {"version":3,"file":"useRefEffect.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefEffect.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,QAAqD,EACrD,IAAwB;IAExB,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAsB,IAAI,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,QAAkB,EAAE,EAAE;QAC9C,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtC,OAAO,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;IACpD,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,kDAAkD;AAC9D,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 Utilities\n */\n\nimport * as React from \"react\";\n\n/** Returns callback ref that is easy to setup and cleanup (API wise similar to React.useEffect).\n * @internal\n */\nexport function useRefEffect<T>(\n callback: (instance: T | null) => void | (() => void),\n deps: ReadonlyArray<any>\n) {\n const cleanup = React.useRef<(() => void) | null>(null);\n return React.useCallback((instance: T | null) => {\n cleanup.current && cleanup.current();\n const newCleanup = callback(instance);\n cleanup.current = !newCleanup ? null : newCleanup;\n }, deps); // eslint-disable-line react-hooks/exhaustive-deps\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  /** @packageDocumentation
6
6
  * @module Utilities
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useRefState.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefState.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAK,CAAC;IAClD,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,QAAkB,EAAE,EAAE;QACnD,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACxB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport * as React from \"react\";\r\n\r\n/** Hook used to store an HTMLElement in state by using ref callback returned from hook.\r\n * *Example:*\r\n * ``` tsx\r\n * const [divElementRef, divElement] = useRefState<HTMLDivElement>();\r\n * const ownerDoc = divElement?.ownerDocument ?? document;\r\n *\r\n * return (\r\n * <div ref={divElementRef} >\r\n * ....\r\n * </div>\r\n * );\r\n * ```\r\n * }\r\n\r\n * @internal\r\n */\r\nexport function useRefState<T>(): [React.Ref<T>, T | undefined] {\r\n const [element, setElement] = React.useState<T>();\r\n const ref = React.useCallback((instance: T | null) => {\r\n setElement(instance || undefined);\r\n }, []);\r\n return [ref, element];\r\n}\r\n"]}
1
+ {"version":3,"file":"useRefState.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefState.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAK,CAAC;IAClD,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,QAAkB,EAAE,EAAE;QACnD,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACxB,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 Utilities\n */\n\nimport * as React from \"react\";\n\n/** Hook used to store an HTMLElement in state by using ref callback returned from hook.\n * *Example:*\n * ``` tsx\n * const [divElementRef, divElement] = useRefState<HTMLDivElement>();\n * const ownerDoc = divElement?.ownerDocument ?? document;\n *\n * return (\n * <div ref={divElementRef} >\n * ....\n * </div>\n * );\n * ```\n * }\n\n * @internal\n */\nexport function useRefState<T>(): [React.Ref<T>, T | undefined] {\n const [element, setElement] = React.useState<T>();\n const ref = React.useCallback((instance: T | null) => {\n setElement(instance || undefined);\n }, []);\n return [ref, element];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useRefs.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefs.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,cACrC,CAAC,GAAG,IAAI,UAY7C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAC5C,CAAC,GAAG,IAAI,UAY5B"}
1
+ {"version":3,"file":"useRefs.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefs.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,cAE5D,CAAC,GAAG,IAAI,UAetB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAC7C,CAAC,GAAG,IAAI,UAY3B"}
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  /** @packageDocumentation
6
6
  * @module Utilities
7
7
  */
@@ -26,13 +26,15 @@ export function useRefs(...refs) {
26
26
  }
27
27
  }
28
28
  }
29
- }, [...refs]); // eslint-disable-line react-hooks/exhaustive-deps
29
+ },
30
+ // eslint-disable-next-line react-hooks/exhaustive-deps
31
+ [...refs]);
30
32
  }
31
33
  /** Used to combine multiple refs for a class component.
32
34
  * @internal
33
35
  */
34
36
  export function mergeRefs(...refs) {
35
- return ((instance) => {
37
+ return (instance) => {
36
38
  for (const ref of refs) {
37
39
  // istanbul ignore else
38
40
  if (ref) {
@@ -44,6 +46,6 @@ export function mergeRefs(...refs) {
44
46
  }
45
47
  }
46
48
  }
47
- });
49
+ };
48
50
  }
49
51
  //# sourceMappingURL=useRefs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRefs.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefs.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,+BAA+B;AAC/B,SAAS,aAAa,CAAI,GAAiB;IACzC,OAAO,OAAO,GAAG,KAAK,UAAU,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAI,GAAG,IAA6C;IACzE,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,QAAkB,EAAE,EAAE;QAC9C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,uBAAuB;YACvB,IAAI,GAAG,EAAE;gBACP,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;oBACtB,GAAG,CAAC,QAAQ,CAAC,CAAC;iBACf;qBAAM;oBACJ,GAAwC,CAAC,OAAO,GAAG,QAAQ,CAAC;iBAC9D;aACF;SACF;IACH,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,kDAAkD;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAI,GAAG,IAAiC;IAC/D,OAAO,CAAC,CAAC,QAAkB,EAAE,EAAE;QAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,uBAAuB;YACvB,IAAI,GAAG,EAAE;gBACP,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;oBACtB,GAAG,CAAC,QAAQ,CAAC,CAAC;iBACf;qBAAM;oBACJ,GAAwC,CAAC,OAAO,GAAG,QAAQ,CAAC;iBAC9D;aACF;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport * as React from \"react\";\r\n\r\n/** Callback ref type guard. */\r\nfunction isRefCallback<T>(ref: React.Ref<T>): ref is (_: T | null) => void {\r\n return typeof ref === \"function\";\r\n}\r\n\r\n/** Hook used to combine multiple refs.\r\n * @internal\r\n */\r\nexport function useRefs<T>(...refs: ReadonlyArray<React.Ref<T> | undefined>) {\r\n return React.useCallback((instance: T | null) => {\r\n for (const ref of refs) {\r\n // istanbul ignore else\r\n if (ref) {\r\n if (isRefCallback(ref)) {\r\n ref(instance);\r\n } else {\r\n (ref as React.MutableRefObject<T | null>).current = instance;\r\n }\r\n }\r\n }\r\n }, [...refs]); // eslint-disable-line react-hooks/exhaustive-deps\r\n}\r\n\r\n/** Used to combine multiple refs for a class component.\r\n * @internal\r\n */\r\nexport function mergeRefs<T>(...refs: ReadonlyArray<React.Ref<T>>) {\r\n return ((instance: T | null) => {\r\n for (const ref of refs) {\r\n // istanbul ignore else\r\n if (ref) {\r\n if (isRefCallback(ref)) {\r\n ref(instance);\r\n } else {\r\n (ref as React.MutableRefObject<T | null>).current = instance;\r\n }\r\n }\r\n }\r\n });\r\n}\r\n"]}
1
+ {"version":3,"file":"useRefs.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useRefs.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,+BAA+B;AAC/B,SAAS,aAAa,CAAI,GAAiB;IACzC,OAAO,OAAO,GAAG,KAAK,UAAU,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAI,GAAG,IAA6C;IACzE,OAAO,KAAK,CAAC,WAAW,CACtB,CAAC,QAAkB,EAAE,EAAE;QACrB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,uBAAuB;YACvB,IAAI,GAAG,EAAE;gBACP,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;oBACtB,GAAG,CAAC,QAAQ,CAAC,CAAC;iBACf;qBAAM;oBACJ,GAAwC,CAAC,OAAO,GAAG,QAAQ,CAAC;iBAC9D;aACF;SACF;IACH,CAAC;IACD,uDAAuD;IACvD,CAAC,GAAG,IAAI,CAAC,CACV,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAI,GAAG,IAAiC;IAC/D,OAAO,CAAC,QAAkB,EAAE,EAAE;QAC5B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,uBAAuB;YACvB,IAAI,GAAG,EAAE;gBACP,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;oBACtB,GAAG,CAAC,QAAQ,CAAC,CAAC;iBACf;qBAAM;oBACJ,GAAwC,CAAC,OAAO,GAAG,QAAQ,CAAC;iBAC9D;aACF;SACF;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport * as React from \"react\";\n\n/** Callback ref type guard. */\nfunction isRefCallback<T>(ref: React.Ref<T>): ref is (_: T | null) => void {\n return typeof ref === \"function\";\n}\n\n/** Hook used to combine multiple refs.\n * @internal\n */\nexport function useRefs<T>(...refs: ReadonlyArray<React.Ref<T> | undefined>) {\n return React.useCallback(\n (instance: T | null) => {\n for (const ref of refs) {\n // istanbul ignore else\n if (ref) {\n if (isRefCallback(ref)) {\n ref(instance);\n } else {\n (ref as React.MutableRefObject<T | null>).current = instance;\n }\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [...refs]\n );\n}\n\n/** Used to combine multiple refs for a class component.\n * @internal\n */\nexport function mergeRefs<T>(...refs: ReadonlyArray<React.Ref<T>>) {\n return (instance: T | null) => {\n for (const ref of refs) {\n // istanbul ignore else\n if (ref) {\n if (isRefCallback(ref)) {\n ref(instance);\n } else {\n (ref as React.MutableRefObject<T | null>).current = instance;\n }\n }\n }\n };\n}\n"]}
@@ -3,14 +3,14 @@
3
3
  */
4
4
  import * as React from "react";
5
5
  /** Uses ResizeObserver API to notify about element bound changes.
6
- * @internal
7
- */
6
+ * @internal
7
+ */
8
8
  export declare function useResizeObserver<T extends Element>(onResize?: (width: number, height: number) => void): (instance: Element | null) => void;
9
9
  /** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector
10
10
  * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly
11
11
  * handles observing element in pop-out/child windows.
12
- * @internal
13
- */
12
+ * @internal
13
+ */
14
14
  export declare function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void): (number | undefined)[];
15
15
  /** Prop the ElementResizeObserver sends to the render function.
16
16
  * @public
@@ -23,17 +23,17 @@ export interface RenderPropsArgs {
23
23
  * observing element in pop-out/child windows.
24
24
  * @public
25
25
  */
26
- export declare function ElementResizeObserver({ watchedElement, render }: {
26
+ export declare function ElementResizeObserver({ watchedElement, render, }: {
27
27
  watchedElement: HTMLElement | null;
28
- render: (props: RenderPropsArgs) => JSX.Element;
29
- }): JSX.Element;
28
+ render: (props: RenderPropsArgs) => React.ReactElement;
29
+ }): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
30
30
  /** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when
31
31
  * the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then
32
32
  * the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report
33
33
  * size changes from its parent container.
34
34
  * @public
35
35
  */
36
- export declare function ResizableContainerObserver({ onResize, children }: {
36
+ export declare function ResizableContainerObserver({ onResize, children, }: {
37
37
  onResize: (width: number, height: number) => void;
38
38
  children?: React.ReactNode;
39
39
  }): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useResizeObserver.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;IAEI;AACJ,wBAAgB,iBAAiB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,EAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,0BA+GrD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,cAAc,EACd,MAAM,GACP,EAAE;IACD,cAAc,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,KAAK,CAAC,YAAY,CAAC;CACxD,sEAGA;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,eA2CA"}
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  /** @packageDocumentation
6
6
  * @module Utilities
7
7
  */
@@ -10,8 +10,8 @@ import { ResizeObserver } from "./ResizeObserverPolyfill";
10
10
  import { useRefEffect } from "./useRefEffect";
11
11
  import { useRefs } from "./useRefs";
12
12
  /** Uses ResizeObserver API to notify about element bound changes.
13
- * @internal
14
- */
13
+ * @internal
14
+ */
15
15
  export function useResizeObserver(onResize) {
16
16
  const [bounds, setBounds] = React.useState({ width: 0, height: 0 });
17
17
  const resizeObserver = React.useRef(null);
@@ -20,38 +20,40 @@ export function useResizeObserver(onResize) {
20
20
  const owningWindowRef = React.useRef(null);
21
21
  // istanbul ignore next
22
22
  const resizeObserverCleanup = () => {
23
- var _a;
24
23
  if (rafRef.current)
25
24
  owningWindowRef.current.cancelAnimationFrame(rafRef.current);
26
- (_a = resizeObserver.current) === null || _a === void 0 ? void 0 : _a.disconnect();
25
+ resizeObserver.current?.disconnect();
27
26
  resizeObserver.current = null;
28
27
  };
29
28
  React.useEffect(() => {
30
29
  isMountedRef.current = true;
31
30
  return () => {
32
- var _a;
33
31
  isMountedRef.current = false;
34
32
  if (rafRef.current)
35
33
  owningWindowRef.current.cancelAnimationFrame(rafRef.current);
36
- (_a = owningWindowRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener("beforeunload", resizeObserverCleanup);
34
+ owningWindowRef.current?.removeEventListener("beforeunload", resizeObserverCleanup);
37
35
  };
38
36
  }, []);
39
37
  const processResize = React.useCallback((target) => {
40
38
  const newBounds = target.getBoundingClientRect();
41
39
  // istanbul ignore else
42
- if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {
40
+ if (isMountedRef.current &&
41
+ (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {
43
42
  setBounds(newBounds);
44
43
  onResize && onResize(newBounds.width, newBounds.height);
45
44
  }
46
45
  }, [onResize, bounds.height, bounds.width]);
47
46
  const handleResize = React.useCallback((entries) => {
48
47
  // istanbul ignore if
49
- if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {
48
+ if (!isMountedRef.current ||
49
+ !Array.isArray(entries) ||
50
+ 0 === entries.length) {
50
51
  return;
51
52
  }
52
53
  const target = entries[0].target;
53
54
  // istanbul ignore next
54
- owningWindowRef.current && owningWindowRef.current.removeEventListener("beforeunload", resizeObserverCleanup);
55
+ owningWindowRef.current &&
56
+ owningWindowRef.current.removeEventListener("beforeunload", resizeObserverCleanup);
55
57
  owningWindowRef.current = target.ownerDocument.defaultView;
56
58
  // istanbul ignore else
57
59
  if (owningWindowRef.current) {
@@ -70,15 +72,16 @@ export function useResizeObserver(onResize) {
70
72
  setBounds(newBounds);
71
73
  }
72
74
  return () => {
73
- var _a;
74
- instance && ( /* istanbul ignore next */(_a = resizeObserver.current) === null || _a === void 0 ? void 0 : _a.unobserve(instance));
75
+ instance &&
76
+ /* istanbul ignore next */ resizeObserver.current?.unobserve(instance);
75
77
  resizeObserver.current = null;
76
78
  };
77
79
  }, [handleResize, onResize]);
78
80
  const handleRef = React.useCallback((instance) => {
79
81
  const newBounds = instance && instance.getBoundingClientRect();
80
82
  // istanbul ignore if
81
- if (newBounds && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {
83
+ if (newBounds &&
84
+ (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {
82
85
  setBounds(newBounds);
83
86
  onResize && onResize(newBounds.width, newBounds.height);
84
87
  }
@@ -89,11 +92,11 @@ export function useResizeObserver(onResize) {
89
92
  /** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector
90
93
  * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly
91
94
  * handles observing element in pop-out/child windows.
92
- * @internal
93
- */
95
+ * @internal
96
+ */
94
97
  export function useLayoutResizeObserver(inElement, onResize) {
95
- const inBoundingRect = inElement === null || inElement === void 0 ? void 0 : inElement.getBoundingClientRect();
96
- const [bounds, setBounds] = React.useState({ width: inBoundingRect === null || inBoundingRect === void 0 ? void 0 : inBoundingRect.width, height: inBoundingRect === null || inBoundingRect === void 0 ? void 0 : inBoundingRect.height });
98
+ const inBoundingRect = inElement?.getBoundingClientRect();
99
+ const [bounds, setBounds] = React.useState({ width: inBoundingRect?.width, height: inBoundingRect?.height });
97
100
  const [watchedElement, setWatchedElement] = React.useState(inElement);
98
101
  const resizeObserver = React.useRef(null);
99
102
  const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active
@@ -101,10 +104,9 @@ export function useLayoutResizeObserver(inElement, onResize) {
101
104
  const owningWindowRef = React.useRef(null);
102
105
  // istanbul ignore next
103
106
  const resizeObserverCleanup = () => {
104
- var _a;
105
107
  if (rafRef.current)
106
108
  owningWindowRef.current.cancelAnimationFrame(rafRef.current);
107
- (_a = resizeObserver.current) === null || _a === void 0 ? void 0 : _a.disconnect();
109
+ resizeObserver.current?.disconnect();
108
110
  resizeObserver.current = null;
109
111
  };
110
112
  React.useEffect(() => {
@@ -118,21 +120,27 @@ export function useLayoutResizeObserver(inElement, onResize) {
118
120
  }
119
121
  return () => {
120
122
  isMountedRef.current = false;
121
- (rafRef.current && owningWindowRef.current) && owningWindowRef.current.cancelAnimationFrame(rafRef.current);
122
- owningWindowRef.current && owningWindowRef.current.removeEventListener("beforeunload", resizeObserverCleanup);
123
+ rafRef.current &&
124
+ owningWindowRef.current &&
125
+ owningWindowRef.current.cancelAnimationFrame(rafRef.current);
126
+ owningWindowRef.current &&
127
+ owningWindowRef.current.removeEventListener("beforeunload", resizeObserverCleanup);
123
128
  };
124
129
  }, [onResize, inElement]);
125
130
  const processResize = React.useCallback((target) => {
126
131
  const newBounds = target.getBoundingClientRect();
127
132
  // istanbul ignore next
128
- if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {
133
+ if (isMountedRef.current &&
134
+ (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {
129
135
  onResize && onResize(newBounds.width, newBounds.height);
130
136
  setBounds(newBounds);
131
137
  }
132
138
  }, [bounds.height, bounds.width, onResize]);
133
139
  const handleResize = React.useCallback((entries) => {
134
140
  // istanbul ignore next
135
- if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {
141
+ if (!isMountedRef.current ||
142
+ !Array.isArray(entries) ||
143
+ 0 === entries.length) {
136
144
  return;
137
145
  }
138
146
  const target = entries[0].target;
@@ -155,9 +163,8 @@ export function useLayoutResizeObserver(inElement, onResize) {
155
163
  resizeObserver.current = new ResizeObserver(handleResize);
156
164
  resizeObserver.current.observe(watchedElement);
157
165
  return () => {
158
- var _a;
159
166
  // istanbul ignore next
160
- (_a = resizeObserver.current) === null || _a === void 0 ? void 0 : _a.disconnect();
167
+ resizeObserver.current?.disconnect();
161
168
  resizeObserver.current = null;
162
169
  };
163
170
  }, [handleResize, watchedElement]);
@@ -167,7 +174,7 @@ export function useLayoutResizeObserver(inElement, onResize) {
167
174
  * observing element in pop-out/child windows.
168
175
  * @public
169
176
  */
170
- export function ElementResizeObserver({ watchedElement, render }) {
177
+ export function ElementResizeObserver({ watchedElement, render, }) {
171
178
  const [width, height] = useLayoutResizeObserver(watchedElement);
172
179
  return render({ width, height });
173
180
  }
@@ -177,7 +184,7 @@ export function ElementResizeObserver({ watchedElement, render }) {
177
184
  * size changes from its parent container.
178
185
  * @public
179
186
  */
180
- export function ResizableContainerObserver({ onResize, children }) {
187
+ export function ResizableContainerObserver({ onResize, children, }) {
181
188
  const containerRef = React.useRef(null); // set to non-zero when requestAnimationFrame processing is active
182
189
  const [containerElement, setContainerElement] = React.useState(null);
183
190
  const isMountedRef = React.useRef(false);
@@ -188,15 +195,19 @@ export function ResizableContainerObserver({ onResize, children }) {
188
195
  if (!isMountedRef.current && containerRef.current) {
189
196
  isMountedRef.current = true;
190
197
  const hasParent = !!containerRef.current.parentElement;
191
- setContainerElement(hasChildren && hasParent ? containerRef.current : containerRef.current.parentElement);
198
+ setContainerElement(hasChildren && hasParent
199
+ ? containerRef.current
200
+ : containerRef.current.parentElement);
192
201
  }
193
202
  }, [hasChildren]);
194
203
  const processResize = React.useCallback((width, height) => {
195
204
  // istanbul ignore next
196
- onResize(width !== null && width !== void 0 ? width : 0, height !== null && height !== void 0 ? height : 0);
205
+ onResize(width ?? 0, height ?? 0);
197
206
  }, [onResize]);
198
207
  useLayoutResizeObserver(containerElement, processResize);
199
- const style = hasChildren ? { width: "100%", height: "100%" } : { display: "none" };
208
+ const style = hasChildren
209
+ ? { width: "100%", height: "100%" }
210
+ : { display: "none" };
200
211
  return (React.createElement("div", { ref: containerRef, className: "uicore-resizable-container", style: style }, hasChildren && children));
201
212
  }
202
213
  //# sourceMappingURL=useResizeObserver.js.map