@itwin/core-react 4.11.0 → 4.13.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 (494) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/ContributeGuidelines.md +2 -2
  3. package/lib/cjs/core-react/UiCore.d.ts +2 -6
  4. package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
  5. package/lib/cjs/core-react/UiCore.js +2 -18
  6. package/lib/cjs/core-react/UiCore.js.map +1 -1
  7. package/lib/cjs/core-react/UiCore.json +31 -0
  8. package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +1 -1
  9. package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
  10. package/lib/cjs/core-react/autosuggest/AutoSuggest.js +2 -2
  11. package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
  12. package/lib/cjs/core-react/badge/Badge.d.ts +6 -9
  13. package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
  14. package/lib/cjs/core-react/badge/Badge.js +10 -9
  15. package/lib/cjs/core-react/badge/Badge.js.map +1 -1
  16. package/lib/{esm/core-react/badge/BadgeUtilities.d.ts → cjs/core-react/badge/BadgeType.d.ts} +1 -9
  17. package/lib/cjs/core-react/badge/BadgeType.d.ts.map +1 -0
  18. package/lib/cjs/core-react/{useTranslation.js → badge/BadgeType.js} +9 -13
  19. package/lib/cjs/core-react/badge/BadgeType.js.map +1 -0
  20. package/lib/cjs/core-react/badge/NewBadge.d.ts +2 -3
  21. package/lib/cjs/core-react/badge/NewBadge.d.ts.map +1 -1
  22. package/lib/cjs/core-react/badge/NewBadge.js +6 -7
  23. package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
  24. package/lib/cjs/core-react/badge/NewBadge.scss +2 -3
  25. package/lib/cjs/core-react/badge/TechnicalPreviewBadge.d.ts +10 -0
  26. package/lib/cjs/core-react/badge/TechnicalPreviewBadge.d.ts.map +1 -0
  27. package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js +29 -0
  28. package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js.map +1 -0
  29. package/lib/cjs/core-react/badge/{Badge.scss → TechnicalPreviewBadge.scss} +1 -7
  30. package/lib/cjs/core-react/base/Centered.d.ts +1 -0
  31. package/lib/cjs/core-react/base/Centered.d.ts.map +1 -1
  32. package/lib/cjs/core-react/base/Centered.js +2 -0
  33. package/lib/cjs/core-react/base/Centered.js.map +1 -1
  34. package/lib/cjs/core-react/base/Div.d.ts +2 -0
  35. package/lib/cjs/core-react/base/Div.d.ts.map +1 -1
  36. package/lib/cjs/core-react/base/Div.js +2 -0
  37. package/lib/cjs/core-react/base/Div.js.map +1 -1
  38. package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts +1 -0
  39. package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
  40. package/lib/cjs/core-react/base/DivWithOutsideClick.js +1 -0
  41. package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
  42. package/lib/cjs/core-react/base/FillCentered.d.ts +1 -0
  43. package/lib/cjs/core-react/base/FillCentered.d.ts.map +1 -1
  44. package/lib/cjs/core-react/base/FillCentered.js +2 -0
  45. package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
  46. package/lib/cjs/core-react/base/FlexWrapContainer.d.ts +1 -0
  47. package/lib/cjs/core-react/base/FlexWrapContainer.d.ts.map +1 -1
  48. package/lib/cjs/core-react/base/FlexWrapContainer.js +2 -0
  49. package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
  50. package/lib/cjs/core-react/base/Gap.d.ts +2 -0
  51. package/lib/cjs/core-react/base/Gap.d.ts.map +1 -1
  52. package/lib/cjs/core-react/base/Gap.js +3 -1
  53. package/lib/cjs/core-react/base/Gap.js.map +1 -1
  54. package/lib/cjs/core-react/base/ScrollView.d.ts +1 -0
  55. package/lib/cjs/core-react/base/ScrollView.d.ts.map +1 -1
  56. package/lib/cjs/core-react/base/ScrollView.js +2 -0
  57. package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
  58. package/lib/cjs/core-react/button/UnderlinedButton.d.ts +2 -0
  59. package/lib/cjs/core-react/button/UnderlinedButton.d.ts.map +1 -1
  60. package/lib/cjs/core-react/button/UnderlinedButton.js +2 -0
  61. package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
  62. package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts +4 -0
  63. package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
  64. package/lib/cjs/core-react/checklistbox/CheckListBox.js +4 -0
  65. package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
  66. package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
  67. package/lib/cjs/core-react/contextmenu/ContextMenu.js +1 -2
  68. package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
  69. package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
  70. package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
  71. package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +3 -3
  72. package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
  73. package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
  74. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +3 -3
  75. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  76. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +3 -5
  77. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  78. package/lib/cjs/core-react/dialog/Dialog.d.ts +4 -0
  79. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  80. package/lib/cjs/core-react/dialog/Dialog.js +69 -53
  81. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  82. package/lib/cjs/core-react/dialog/GlobalDialog.d.ts +3 -0
  83. package/lib/cjs/core-react/dialog/GlobalDialog.d.ts.map +1 -1
  84. package/lib/cjs/core-react/dialog/GlobalDialog.js +7 -3
  85. package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
  86. package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts +4 -2
  87. package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  88. package/lib/cjs/core-react/elementseparator/ElementSeparator.js +5 -3
  89. package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
  90. package/lib/cjs/core-react/expandable/ExpandableList.d.ts +3 -3
  91. package/lib/cjs/core-react/expandable/ExpandableList.d.ts.map +1 -1
  92. package/lib/cjs/core-react/expandable/ExpandableList.js +5 -2
  93. package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
  94. package/lib/cjs/core-react/hocs/withOnOutsideClick.js +1 -2
  95. package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
  96. package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
  97. package/lib/cjs/core-react/icons/IconComponent.js +22 -12
  98. package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
  99. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +3 -2
  100. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
  101. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +3 -2
  102. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
  103. package/lib/cjs/core-react/inputs/InputLabel.d.ts +2 -0
  104. package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
  105. package/lib/cjs/core-react/inputs/InputLabel.js +5 -0
  106. package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
  107. package/lib/cjs/core-react/inputs/InputStatus.d.ts +1 -0
  108. package/lib/cjs/core-react/inputs/InputStatus.d.ts.map +1 -1
  109. package/lib/cjs/core-react/inputs/InputStatus.js +1 -0
  110. package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
  111. package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts +2 -0
  112. package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts.map +1 -1
  113. package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
  114. package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts +2 -0
  115. package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
  116. package/lib/cjs/core-react/inputs/iconinput/IconInput.js +3 -0
  117. package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
  118. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +3 -0
  119. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  120. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +1 -0
  121. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  122. package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts +20 -0
  123. package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts.map +1 -0
  124. package/lib/cjs/core-react/l10n/LocalizationProvider.js +29 -0
  125. package/lib/cjs/core-react/l10n/LocalizationProvider.js.map +1 -0
  126. package/lib/cjs/core-react/l10n/usePackageTranslation.d.ts +15 -0
  127. package/lib/cjs/core-react/l10n/usePackageTranslation.d.ts.map +1 -0
  128. package/lib/cjs/core-react/l10n/usePackageTranslation.js +64 -0
  129. package/lib/cjs/core-react/l10n/usePackageTranslation.js.map +1 -0
  130. package/lib/cjs/core-react/l10n/useTranslation.d.ts +7 -0
  131. package/lib/cjs/core-react/l10n/useTranslation.d.ts.map +1 -0
  132. package/lib/cjs/core-react/l10n/useTranslation.js +30 -0
  133. package/lib/cjs/core-react/l10n/useTranslation.js.map +1 -0
  134. package/lib/cjs/core-react/listbox/Listbox.d.ts +14 -14
  135. package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
  136. package/lib/cjs/core-react/listbox/Listbox.js +8 -10
  137. package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
  138. package/lib/cjs/core-react/loading/LoadingBar.d.ts +3 -2
  139. package/lib/cjs/core-react/loading/LoadingBar.d.ts.map +1 -1
  140. package/lib/cjs/core-react/loading/LoadingBar.js +2 -2
  141. package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
  142. package/lib/cjs/core-react/loading/LoadingPrompt.d.ts +3 -2
  143. package/lib/cjs/core-react/loading/LoadingPrompt.d.ts.map +1 -1
  144. package/lib/cjs/core-react/loading/LoadingPrompt.js +2 -2
  145. package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
  146. package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +4 -2
  147. package/lib/cjs/core-react/loading/LoadingSpinner.d.ts.map +1 -1
  148. package/lib/cjs/core-react/loading/LoadingSpinner.js +2 -2
  149. package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
  150. package/lib/cjs/core-react/loading/LoadingStatus.d.ts +3 -2
  151. package/lib/cjs/core-react/loading/LoadingStatus.d.ts.map +1 -1
  152. package/lib/cjs/core-react/loading/LoadingStatus.js +2 -2
  153. package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
  154. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  155. package/lib/cjs/core-react/messagebox/MessageBox.js +3 -1
  156. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  157. package/lib/cjs/core-react/notification/MessageRenderer.js +1 -1
  158. package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
  159. package/lib/cjs/core-react/popup/Popup.js +4 -8
  160. package/lib/cjs/core-react/popup/Popup.js.map +1 -1
  161. package/lib/cjs/core-react/radialmenu/Annulus.d.ts +7 -8
  162. package/lib/cjs/core-react/radialmenu/Annulus.d.ts.map +1 -1
  163. package/lib/cjs/core-react/radialmenu/Annulus.js +7 -8
  164. package/lib/cjs/core-react/radialmenu/Annulus.js.map +1 -1
  165. package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +0 -1
  166. package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
  167. package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
  168. package/lib/cjs/core-react/searchbox/SearchBox.d.ts +3 -3
  169. package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
  170. package/lib/cjs/core-react/searchbox/SearchBox.js +15 -9
  171. package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
  172. package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
  173. package/lib/cjs/core-react/settings/SettingsContainer.js +8 -4
  174. package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
  175. package/lib/cjs/core-react/settings/SettingsManager.d.ts +10 -7
  176. package/lib/cjs/core-react/settings/SettingsManager.d.ts.map +1 -1
  177. package/lib/cjs/core-react/settings/SettingsManager.js +14 -12
  178. package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
  179. package/lib/cjs/core-react/tabs/Tabs.d.ts +5 -5
  180. package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
  181. package/lib/cjs/core-react/tabs/Tabs.js +1 -0
  182. package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
  183. package/lib/cjs/core-react/tabs/VerticalTabs.d.ts +1 -0
  184. package/lib/cjs/core-react/tabs/VerticalTabs.d.ts.map +1 -1
  185. package/lib/cjs/core-react/tabs/VerticalTabs.js +2 -0
  186. package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
  187. package/lib/cjs/core-react/text/BlockText.d.ts +1 -0
  188. package/lib/cjs/core-react/text/BlockText.d.ts.map +1 -1
  189. package/lib/cjs/core-react/text/BlockText.js +2 -0
  190. package/lib/cjs/core-react/text/BlockText.js.map +1 -1
  191. package/lib/cjs/core-react/text/BodyText.d.ts +1 -1
  192. package/lib/cjs/core-react/text/BodyText.d.ts.map +1 -1
  193. package/lib/cjs/core-react/text/BodyText.js +2 -1
  194. package/lib/cjs/core-react/text/BodyText.js.map +1 -1
  195. package/lib/cjs/core-react/text/DisabledText.d.ts +1 -0
  196. package/lib/cjs/core-react/text/DisabledText.d.ts.map +1 -1
  197. package/lib/cjs/core-react/text/DisabledText.js +2 -1
  198. package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
  199. package/lib/cjs/core-react/text/MutedText.d.ts.map +1 -1
  200. package/lib/cjs/core-react/text/MutedText.js +1 -0
  201. package/lib/cjs/core-react/text/MutedText.js.map +1 -1
  202. package/lib/cjs/core-react/text/StyledText.d.ts +1 -0
  203. package/lib/cjs/core-react/text/StyledText.d.ts.map +1 -1
  204. package/lib/cjs/core-react/text/StyledText.js.map +1 -1
  205. package/lib/cjs/core-react/text/TextProps.d.ts +1 -0
  206. package/lib/cjs/core-react/text/TextProps.d.ts.map +1 -1
  207. package/lib/cjs/core-react/text/TextProps.js.map +1 -1
  208. package/lib/cjs/core-react/tree/ExpansionToggle.d.ts +1 -3
  209. package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  210. package/lib/cjs/core-react/tree/ExpansionToggle.js +9 -10
  211. package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
  212. package/lib/cjs/core-react/tree/Node.js +1 -2
  213. package/lib/cjs/core-react/tree/Node.js.map +1 -1
  214. package/lib/cjs/core-react/utils/IconWebComponent.d.ts +4 -2
  215. package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
  216. package/lib/cjs/core-react/utils/IconWebComponent.js +10 -6
  217. package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
  218. package/lib/cjs/core-react/utils/getCssVariable.js +1 -1
  219. package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
  220. package/lib/cjs/core-react/utils/getObjectClassName.js +2 -3
  221. package/lib/cjs/core-react/utils/getObjectClassName.js.map +1 -1
  222. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +4 -1
  223. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
  224. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js +5 -2
  225. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
  226. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -1
  227. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +2 -3
  228. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  229. package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
  230. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +12 -16
  231. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  232. package/lib/cjs/core-react.d.ts +3 -3
  233. package/lib/cjs/core-react.d.ts.map +1 -1
  234. package/lib/cjs/core-react.js +12 -9
  235. package/lib/cjs/core-react.js.map +1 -1
  236. package/lib/esm/core-react/UiCore.d.ts +2 -6
  237. package/lib/esm/core-react/UiCore.d.ts.map +1 -1
  238. package/lib/esm/core-react/UiCore.js +2 -18
  239. package/lib/esm/core-react/UiCore.js.map +1 -1
  240. package/lib/esm/core-react/UiCore.json +31 -0
  241. package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +1 -1
  242. package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
  243. package/lib/esm/core-react/autosuggest/AutoSuggest.js +1 -1
  244. package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
  245. package/lib/esm/core-react/badge/Badge.d.ts +6 -9
  246. package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
  247. package/lib/esm/core-react/badge/Badge.js +10 -9
  248. package/lib/esm/core-react/badge/Badge.js.map +1 -1
  249. package/lib/{cjs/core-react/badge/BadgeUtilities.d.ts → esm/core-react/badge/BadgeType.d.ts} +1 -9
  250. package/lib/esm/core-react/badge/BadgeType.d.ts.map +1 -0
  251. package/lib/esm/core-react/badge/BadgeType.js +13 -0
  252. package/lib/esm/core-react/badge/BadgeType.js.map +1 -0
  253. package/lib/esm/core-react/badge/NewBadge.d.ts +2 -3
  254. package/lib/esm/core-react/badge/NewBadge.d.ts.map +1 -1
  255. package/lib/esm/core-react/badge/NewBadge.js +6 -7
  256. package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
  257. package/lib/esm/core-react/badge/NewBadge.scss +2 -3
  258. package/lib/esm/core-react/badge/TechnicalPreviewBadge.d.ts +10 -0
  259. package/lib/esm/core-react/badge/TechnicalPreviewBadge.d.ts.map +1 -0
  260. package/lib/esm/core-react/badge/TechnicalPreviewBadge.js +25 -0
  261. package/lib/esm/core-react/badge/TechnicalPreviewBadge.js.map +1 -0
  262. package/lib/esm/core-react/badge/{Badge.scss → TechnicalPreviewBadge.scss} +1 -7
  263. package/lib/esm/core-react/base/Centered.d.ts +1 -0
  264. package/lib/esm/core-react/base/Centered.d.ts.map +1 -1
  265. package/lib/esm/core-react/base/Centered.js +2 -0
  266. package/lib/esm/core-react/base/Centered.js.map +1 -1
  267. package/lib/esm/core-react/base/Div.d.ts +2 -0
  268. package/lib/esm/core-react/base/Div.d.ts.map +1 -1
  269. package/lib/esm/core-react/base/Div.js +2 -0
  270. package/lib/esm/core-react/base/Div.js.map +1 -1
  271. package/lib/esm/core-react/base/DivWithOutsideClick.d.ts +1 -0
  272. package/lib/esm/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
  273. package/lib/esm/core-react/base/DivWithOutsideClick.js +1 -0
  274. package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
  275. package/lib/esm/core-react/base/FillCentered.d.ts +1 -0
  276. package/lib/esm/core-react/base/FillCentered.d.ts.map +1 -1
  277. package/lib/esm/core-react/base/FillCentered.js +2 -0
  278. package/lib/esm/core-react/base/FillCentered.js.map +1 -1
  279. package/lib/esm/core-react/base/FlexWrapContainer.d.ts +1 -0
  280. package/lib/esm/core-react/base/FlexWrapContainer.d.ts.map +1 -1
  281. package/lib/esm/core-react/base/FlexWrapContainer.js +2 -0
  282. package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
  283. package/lib/esm/core-react/base/Gap.d.ts +2 -0
  284. package/lib/esm/core-react/base/Gap.d.ts.map +1 -1
  285. package/lib/esm/core-react/base/Gap.js +3 -1
  286. package/lib/esm/core-react/base/Gap.js.map +1 -1
  287. package/lib/esm/core-react/base/ScrollView.d.ts +1 -0
  288. package/lib/esm/core-react/base/ScrollView.d.ts.map +1 -1
  289. package/lib/esm/core-react/base/ScrollView.js +2 -0
  290. package/lib/esm/core-react/base/ScrollView.js.map +1 -1
  291. package/lib/esm/core-react/button/UnderlinedButton.d.ts +2 -0
  292. package/lib/esm/core-react/button/UnderlinedButton.d.ts.map +1 -1
  293. package/lib/esm/core-react/button/UnderlinedButton.js +2 -0
  294. package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
  295. package/lib/esm/core-react/checklistbox/CheckListBox.d.ts +4 -0
  296. package/lib/esm/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
  297. package/lib/esm/core-react/checklistbox/CheckListBox.js +4 -0
  298. package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
  299. package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
  300. package/lib/esm/core-react/contextmenu/ContextMenu.js +1 -2
  301. package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
  302. package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
  303. package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
  304. package/lib/esm/core-react/contextmenu/ContextMenuItem.js +3 -3
  305. package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
  306. package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
  307. package/lib/esm/core-react/contextmenu/ContextSubMenu.js +3 -3
  308. package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  309. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +3 -5
  310. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  311. package/lib/esm/core-react/dialog/Dialog.d.ts +4 -0
  312. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  313. package/lib/esm/core-react/dialog/Dialog.js +69 -53
  314. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  315. package/lib/esm/core-react/dialog/GlobalDialog.d.ts +3 -0
  316. package/lib/esm/core-react/dialog/GlobalDialog.d.ts.map +1 -1
  317. package/lib/esm/core-react/dialog/GlobalDialog.js +7 -3
  318. package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
  319. package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts +4 -2
  320. package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  321. package/lib/esm/core-react/elementseparator/ElementSeparator.js +5 -3
  322. package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
  323. package/lib/esm/core-react/expandable/ExpandableList.d.ts +3 -3
  324. package/lib/esm/core-react/expandable/ExpandableList.d.ts.map +1 -1
  325. package/lib/esm/core-react/expandable/ExpandableList.js +5 -2
  326. package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
  327. package/lib/esm/core-react/hocs/withOnOutsideClick.js +1 -2
  328. package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
  329. package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
  330. package/lib/esm/core-react/icons/IconComponent.js +21 -11
  331. package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
  332. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +3 -2
  333. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
  334. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +3 -2
  335. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
  336. package/lib/esm/core-react/inputs/InputLabel.d.ts +2 -0
  337. package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
  338. package/lib/esm/core-react/inputs/InputLabel.js +5 -0
  339. package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
  340. package/lib/esm/core-react/inputs/InputStatus.d.ts +1 -0
  341. package/lib/esm/core-react/inputs/InputStatus.d.ts.map +1 -1
  342. package/lib/esm/core-react/inputs/InputStatus.js +1 -0
  343. package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
  344. package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts +2 -0
  345. package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts.map +1 -1
  346. package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
  347. package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts +2 -0
  348. package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
  349. package/lib/esm/core-react/inputs/iconinput/IconInput.js +3 -0
  350. package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
  351. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +3 -0
  352. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  353. package/lib/esm/core-react/inputs/numberinput/NumberInput.js +1 -0
  354. package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  355. package/lib/esm/core-react/l10n/LocalizationProvider.d.ts +20 -0
  356. package/lib/esm/core-react/l10n/LocalizationProvider.d.ts.map +1 -0
  357. package/lib/esm/core-react/l10n/LocalizationProvider.js +24 -0
  358. package/lib/esm/core-react/l10n/LocalizationProvider.js.map +1 -0
  359. package/lib/esm/core-react/l10n/usePackageTranslation.d.ts +15 -0
  360. package/lib/esm/core-react/l10n/usePackageTranslation.d.ts.map +1 -0
  361. package/lib/esm/core-react/l10n/usePackageTranslation.js +60 -0
  362. package/lib/esm/core-react/l10n/usePackageTranslation.js.map +1 -0
  363. package/lib/esm/core-react/l10n/useTranslation.d.ts +7 -0
  364. package/lib/esm/core-react/l10n/useTranslation.d.ts.map +1 -0
  365. package/lib/esm/core-react/l10n/useTranslation.js +26 -0
  366. package/lib/esm/core-react/l10n/useTranslation.js.map +1 -0
  367. package/lib/esm/core-react/listbox/Listbox.d.ts +14 -14
  368. package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
  369. package/lib/esm/core-react/listbox/Listbox.js +8 -10
  370. package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
  371. package/lib/esm/core-react/loading/LoadingBar.d.ts +3 -2
  372. package/lib/esm/core-react/loading/LoadingBar.d.ts.map +1 -1
  373. package/lib/esm/core-react/loading/LoadingBar.js +2 -2
  374. package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
  375. package/lib/esm/core-react/loading/LoadingPrompt.d.ts +3 -2
  376. package/lib/esm/core-react/loading/LoadingPrompt.d.ts.map +1 -1
  377. package/lib/esm/core-react/loading/LoadingPrompt.js +2 -2
  378. package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
  379. package/lib/esm/core-react/loading/LoadingSpinner.d.ts +4 -2
  380. package/lib/esm/core-react/loading/LoadingSpinner.d.ts.map +1 -1
  381. package/lib/esm/core-react/loading/LoadingSpinner.js +2 -2
  382. package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
  383. package/lib/esm/core-react/loading/LoadingStatus.d.ts +3 -2
  384. package/lib/esm/core-react/loading/LoadingStatus.d.ts.map +1 -1
  385. package/lib/esm/core-react/loading/LoadingStatus.js +2 -2
  386. package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
  387. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  388. package/lib/esm/core-react/messagebox/MessageBox.js +3 -1
  389. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  390. package/lib/esm/core-react/notification/MessageRenderer.js +1 -1
  391. package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
  392. package/lib/esm/core-react/popup/Popup.js +4 -8
  393. package/lib/esm/core-react/popup/Popup.js.map +1 -1
  394. package/lib/esm/core-react/radialmenu/Annulus.d.ts +7 -8
  395. package/lib/esm/core-react/radialmenu/Annulus.d.ts.map +1 -1
  396. package/lib/esm/core-react/radialmenu/Annulus.js +7 -8
  397. package/lib/esm/core-react/radialmenu/Annulus.js.map +1 -1
  398. package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +0 -1
  399. package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
  400. package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
  401. package/lib/esm/core-react/searchbox/SearchBox.d.ts +3 -3
  402. package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
  403. package/lib/esm/core-react/searchbox/SearchBox.js +15 -9
  404. package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
  405. package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
  406. package/lib/esm/core-react/settings/SettingsContainer.js +8 -4
  407. package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
  408. package/lib/esm/core-react/settings/SettingsManager.d.ts +10 -7
  409. package/lib/esm/core-react/settings/SettingsManager.d.ts.map +1 -1
  410. package/lib/esm/core-react/settings/SettingsManager.js +13 -10
  411. package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
  412. package/lib/esm/core-react/tabs/Tabs.d.ts +5 -5
  413. package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
  414. package/lib/esm/core-react/tabs/Tabs.js +1 -0
  415. package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
  416. package/lib/esm/core-react/tabs/VerticalTabs.d.ts +1 -0
  417. package/lib/esm/core-react/tabs/VerticalTabs.d.ts.map +1 -1
  418. package/lib/esm/core-react/tabs/VerticalTabs.js +2 -0
  419. package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
  420. package/lib/esm/core-react/text/BlockText.d.ts +1 -0
  421. package/lib/esm/core-react/text/BlockText.d.ts.map +1 -1
  422. package/lib/esm/core-react/text/BlockText.js +2 -0
  423. package/lib/esm/core-react/text/BlockText.js.map +1 -1
  424. package/lib/esm/core-react/text/BodyText.d.ts +1 -1
  425. package/lib/esm/core-react/text/BodyText.d.ts.map +1 -1
  426. package/lib/esm/core-react/text/BodyText.js +2 -1
  427. package/lib/esm/core-react/text/BodyText.js.map +1 -1
  428. package/lib/esm/core-react/text/DisabledText.d.ts +1 -0
  429. package/lib/esm/core-react/text/DisabledText.d.ts.map +1 -1
  430. package/lib/esm/core-react/text/DisabledText.js +2 -1
  431. package/lib/esm/core-react/text/DisabledText.js.map +1 -1
  432. package/lib/esm/core-react/text/MutedText.d.ts.map +1 -1
  433. package/lib/esm/core-react/text/MutedText.js +1 -0
  434. package/lib/esm/core-react/text/MutedText.js.map +1 -1
  435. package/lib/esm/core-react/text/StyledText.d.ts +1 -0
  436. package/lib/esm/core-react/text/StyledText.d.ts.map +1 -1
  437. package/lib/esm/core-react/text/StyledText.js.map +1 -1
  438. package/lib/esm/core-react/text/TextProps.d.ts +1 -0
  439. package/lib/esm/core-react/text/TextProps.d.ts.map +1 -1
  440. package/lib/esm/core-react/text/TextProps.js.map +1 -1
  441. package/lib/esm/core-react/tree/ExpansionToggle.d.ts +1 -3
  442. package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  443. package/lib/esm/core-react/tree/ExpansionToggle.js +9 -10
  444. package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
  445. package/lib/esm/core-react/tree/Node.js +1 -2
  446. package/lib/esm/core-react/tree/Node.js.map +1 -1
  447. package/lib/esm/core-react/utils/IconWebComponent.d.ts +4 -2
  448. package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
  449. package/lib/esm/core-react/utils/IconWebComponent.js +8 -5
  450. package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
  451. package/lib/esm/core-react/utils/getCssVariable.js +1 -1
  452. package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
  453. package/lib/esm/core-react/utils/getObjectClassName.js +2 -3
  454. package/lib/esm/core-react/utils/getObjectClassName.js.map +1 -1
  455. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +4 -1
  456. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
  457. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js +3 -1
  458. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
  459. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -1
  460. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +2 -3
  461. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  462. package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
  463. package/lib/esm/core-react/utils/hooks/useResizeObserver.js +13 -17
  464. package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  465. package/lib/esm/core-react.d.ts +3 -3
  466. package/lib/esm/core-react.d.ts.map +1 -1
  467. package/lib/esm/core-react.js +5 -4
  468. package/lib/esm/core-react.js.map +1 -1
  469. package/package.json +8 -33
  470. package/lib/cjs/core-react/badge/BadgeUtilities.d.ts.map +0 -1
  471. package/lib/cjs/core-react/badge/BadgeUtilities.js +0 -43
  472. package/lib/cjs/core-react/badge/BadgeUtilities.js.map +0 -1
  473. package/lib/cjs/core-react/badge/BetaBadge.d.ts +0 -10
  474. package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +0 -1
  475. package/lib/cjs/core-react/badge/BetaBadge.js +0 -23
  476. package/lib/cjs/core-react/badge/BetaBadge.js.map +0 -1
  477. package/lib/cjs/core-react/badge/new-feature-badge.svg +0 -1
  478. package/lib/cjs/core-react/badge/technical-preview-badge.svg +0 -1
  479. package/lib/cjs/core-react/useTranslation.d.ts +0 -10
  480. package/lib/cjs/core-react/useTranslation.d.ts.map +0 -1
  481. package/lib/cjs/core-react/useTranslation.js.map +0 -1
  482. package/lib/esm/core-react/badge/BadgeUtilities.d.ts.map +0 -1
  483. package/lib/esm/core-react/badge/BadgeUtilities.js +0 -39
  484. package/lib/esm/core-react/badge/BadgeUtilities.js.map +0 -1
  485. package/lib/esm/core-react/badge/BetaBadge.d.ts +0 -10
  486. package/lib/esm/core-react/badge/BetaBadge.d.ts.map +0 -1
  487. package/lib/esm/core-react/badge/BetaBadge.js +0 -19
  488. package/lib/esm/core-react/badge/BetaBadge.js.map +0 -1
  489. package/lib/esm/core-react/badge/new-feature-badge.svg +0 -1
  490. package/lib/esm/core-react/badge/technical-preview-badge.svg +0 -1
  491. package/lib/esm/core-react/useTranslation.d.ts +0 -10
  492. package/lib/esm/core-react/useTranslation.d.ts.map +0 -1
  493. package/lib/esm/core-react/useTranslation.js +0 -16
  494. package/lib/esm/core-react/useTranslation.js.map +0 -1
@@ -8,9 +8,9 @@
8
8
  import "./LoadingBar.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
- /**
12
- * A loading bar with optional percentage text.
11
+ /** A loading bar with optional percentage text.
13
12
  * @public
13
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-linear iTwinUI progress indicator} instead.
14
14
  */
15
15
  class LoadingBar extends React.PureComponent {
16
16
  render() {
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingBar.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingBar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B;;;GAGG;AACH,MAAa,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAKlD,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACzD,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,6BAAK,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;gBACnE,6BAAK,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAI,CAC/C;YACL,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAC5B,8BAAM,SAAS,EAAC,SAAS,IAAE,OAAO,CAAQ,CAC3C,CACG,CACP,CAAC;IACJ,CAAC;;AAjBa,uBAAY,GAA6B;IACrD,SAAS,EAAE,CAAC;CACb,CAAC;SAHS,UAAU;AAqBvB;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,KAAK,CAAC;AACf,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 Loading\n */\n\nimport \"./LoadingBar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for [[LoadingBar]] component\n * @public\n */\nexport interface LoadingBarProps extends CommonProps {\n /** Percent */\n percent: number;\n /** Show percentage (optional) */\n showPercentage?: boolean;\n /** Height (in pixels) of the loading bar */\n barHeight: number;\n}\n\n/**\n * A loading bar with optional percentage text.\n * @public\n */\nexport class LoadingBar extends React.PureComponent<LoadingBarProps> {\n public static defaultProps: Partial<LoadingBarProps> = {\n barHeight: 4,\n };\n\n public override render() {\n const percent = `${percentInRange(this.props.percent)}%`;\n const containerClass = classnames(this.props.className, \"core-lb\");\n return (\n <div className={containerClass} style={this.props.style}>\n <div className=\"lb-container\" style={{ height: this.props.barHeight }}>\n <div className=\"fill\" style={{ width: percent }} />\n </div>\n {this.props.showPercentage && (\n <span className=\"percent\">{percent}</span>\n )}\n </div>\n );\n }\n}\n\n/** Sanity check to keep percentage between 0 & 100\n * @internal\n */\nexport function percentInRange(percent: number): number {\n let value = Math.min(percent, 100);\n value = Math.max(value, 0);\n return value;\n}\n"]}
1
+ {"version":3,"file":"LoadingBar.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingBar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B;;;GAGG;AACH,MAAa,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAKlD,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACzD,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,6BAAK,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;gBACnE,6BAAK,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAI,CAC/C;YACL,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAC5B,8BAAM,SAAS,EAAC,SAAS,IAAE,OAAO,CAAQ,CAC3C,CACG,CACP,CAAC;IACJ,CAAC;;AAjBa,uBAAY,GAA6B;IACrD,SAAS,EAAE,CAAC;CACb,CAAC;SAHS,UAAU;AAqBvB;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,KAAK,CAAC;AACf,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 Loading\n */\n\nimport \"./LoadingBar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingBar]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link LoadingBar}.\n */\nexport interface LoadingBarProps extends CommonProps {\n /** Percent */\n percent: number;\n /** Show percentage (optional) */\n showPercentage?: boolean;\n /** Height (in pixels) of the loading bar */\n barHeight: number;\n}\n\n/** A loading bar with optional percentage text.\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-linear iTwinUI progress indicator} instead.\n */\nexport class LoadingBar extends React.PureComponent<LoadingBarProps> {\n public static defaultProps: Partial<LoadingBarProps> = {\n barHeight: 4,\n };\n\n public override render() {\n const percent = `${percentInRange(this.props.percent)}%`;\n const containerClass = classnames(this.props.className, \"core-lb\");\n return (\n <div className={containerClass} style={this.props.style}>\n <div className=\"lb-container\" style={{ height: this.props.barHeight }}>\n <div className=\"fill\" style={{ width: percent }} />\n </div>\n {this.props.showPercentage && (\n <span className=\"percent\">{percent}</span>\n )}\n </div>\n );\n }\n}\n\n/** Sanity check to keep percentage between 0 & 100\n * @internal\n */\nexport function percentInRange(percent: number): number {\n let value = Math.min(percent, 100);\n value = Math.max(value, 0);\n return value;\n}\n"]}
@@ -6,6 +6,7 @@ import * as React from "react";
6
6
  import type { CommonProps } from "../utils/Props";
7
7
  /** Properties for [[LoadingPrompt]] component
8
8
  * @public
9
+ * @deprecated in 4.12.x. Props of deprecated component {@link LoadingPrompt}.
9
10
  */
10
11
  export interface LoadingPromptProps extends CommonProps {
11
12
  /** Title */
@@ -29,9 +30,9 @@ export interface LoadingPromptProps extends CommonProps {
29
30
  /** Function called when Cancel button is clicked. */
30
31
  onCancel?: () => void;
31
32
  }
32
- /**
33
- * A component to display during loading that optionally shows percentage, status text and a cancel button.
33
+ /** A component to display during loading that optionally shows percentage, status text and a cancel button.
34
34
  * @public
35
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
35
36
  */
36
37
  export declare class LoadingPrompt extends React.PureComponent<LoadingPromptProps> {
37
38
  static defaultProps: Partial<LoadingPromptProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingPrompt.d.ts","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingPrompt.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,YAAY;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2IAA2I;IAC3I,aAAa,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,UAAU,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,mGAAmG;IACnG,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,sHAAsH;IACtH,cAAc,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxE,OAAc,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAQrD;IAEc,MAAM;CA2CvB"}
1
+ {"version":3,"file":"LoadingPrompt.d.ts","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingPrompt.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,YAAY;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2IAA2I;IAC3I,aAAa,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,UAAU,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,mGAAmG;IACnG,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,sHAAsH;IACtH,cAAc,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxE,OAAc,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAQrD;IAEc,MAAM;CA2CvB"}
@@ -12,9 +12,9 @@ import { Button, ProgressLinear } from "@itwin/itwinui-react";
12
12
  import { LoadingBar } from "./LoadingBar";
13
13
  import { LoadingSpinner } from "./LoadingSpinner";
14
14
  import { LoadingStatus } from "./LoadingStatus";
15
- /**
16
- * A component to display during loading that optionally shows percentage, status text and a cancel button.
15
+ /** A component to display during loading that optionally shows percentage, status text and a cancel button.
17
16
  * @public
17
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
18
18
  */
19
19
  class LoadingPrompt extends React.PureComponent {
20
20
  render() {
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingPrompt.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingPrompt.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA+BhD;;;GAGG;AACH,MAAa,aAAc,SAAQ,KAAK,CAAC,aAAiC;IAWxD,MAAM;QACpB,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;QAE/C,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EACjE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YAEvB,8BAAM,SAAS,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAQ;YAChD,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CACrB,8BAAM,SAAS,EAAC,SAAS,IAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAQ,CACtD;YACA,aAAa,IAAI,CAChB,oBAAC,UAAU,IACT,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,GACzC,CACH;YACA,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACzC,oBAAC,aAAa,IACZ,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAC9D,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAC1B,CACH;YACA,CAAC,aAAa;gBACb,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,CACjC,oBAAC,cAAc,IAAC,aAAa,SAAG,CACjC,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,OAAG,CACnB,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACxB,oBAAC,MAAM,IACL,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,aAGrB,CACV,CACG,CACP,CAAC;IACJ,CAAC;;AApDa,0BAAY,GAAgC;IACxD,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IACpB,oBAAoB,EAAE,KAAK;IAC3B,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,EAAE;CACX,CAAC;SATS,aAAa","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 Loading\n */\n\nimport \"./LoadingPrompt.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Button, ProgressLinear } from \"@itwin/itwinui-react\";\nimport { LoadingBar } from \"./LoadingBar\";\nimport { LoadingSpinner } from \"./LoadingSpinner\";\nimport { LoadingStatus } from \"./LoadingStatus\";\nimport type { CommonProps } from \"../utils/Props\";\n\n// cspell:ignore loadingprompt\n\n/** Properties for [[LoadingPrompt]] component\n * @public\n */\nexport interface LoadingPromptProps extends CommonProps {\n /** Title */\n title: string;\n /** Message displayed below the title (optional) */\n message?: string;\n /** Determine if a percentage bar is displayed (isDeterminate=true), otherwise a loading spinner or indeterminate progress bar is shown. */\n isDeterminate: boolean;\n /** Show current status and percentage. Default is false (not shown) */\n showStatus: boolean;\n /** Show cancel button. Default is false (not shown) */\n showCancel: boolean;\n /** Current loading status text (optional). Only shown if showStatus=true and isDeterminate=true */\n status: string;\n /** Current percentage. Only used if isDeterminate=true */\n percent: number;\n /** Show percentage at the end of the loading bar (optional). Only shown if isDeterminate=true and showStatus=false */\n showPercentage: boolean;\n /** Show indeterminate progress bar instead of loading spinner */\n showIndeterminateBar: boolean;\n /** Function called when Cancel button is clicked. */\n onCancel?: () => void;\n}\n\n/**\n * A component to display during loading that optionally shows percentage, status text and a cancel button.\n * @public\n */\nexport class LoadingPrompt extends React.PureComponent<LoadingPromptProps> {\n public static defaultProps: Partial<LoadingPromptProps> = {\n showPercentage: false,\n showStatus: false,\n showCancel: false,\n isDeterminate: false,\n showIndeterminateBar: false,\n percent: 0,\n status: \"\",\n };\n\n public override render() {\n const isDeterminate = this.props.isDeterminate;\n\n return (\n <div\n className={classnames(\"core-loadingprompt\", this.props.className)}\n style={this.props.style}\n >\n <span className=\"title\">{this.props.title}</span>\n {this.props.message && (\n <span className=\"message\">{this.props.message}</span>\n )}\n {isDeterminate && (\n <LoadingBar\n style={{ width: \"100%\" }}\n percent={this.props.percent}\n showPercentage={this.props.showPercentage}\n />\n )}\n {isDeterminate && this.props.showStatus && (\n <LoadingStatus\n style={{ marginTop: \".5em\", width: \"100%\", fontSize: \".75em\" }}\n percent={this.props.percent}\n message={this.props.status}\n />\n )}\n {!isDeterminate &&\n (this.props.showIndeterminateBar ? (\n <ProgressLinear indeterminate />\n ) : (\n <LoadingSpinner />\n ))}\n {this.props.showCancel && (\n <Button\n className=\"loading-prompt-cancel\"\n onClick={this.props.onCancel}\n >\n Cancel\n </Button>\n )}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"LoadingPrompt.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingPrompt.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAgChD;;;GAGG;AACH,MAAa,aAAc,SAAQ,KAAK,CAAC,aAAiC;IAWxD,MAAM;QACpB,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;QAE/C,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EACjE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YAEvB,8BAAM,SAAS,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAQ;YAChD,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CACrB,8BAAM,SAAS,EAAC,SAAS,IAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAQ,CACtD;YACA,aAAa,IAAI,CAChB,oBAAC,UAAU,IACT,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,GACzC,CACH;YACA,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACzC,oBAAC,aAAa,IACZ,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAC9D,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAC1B,CACH;YACA,CAAC,aAAa;gBACb,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,CACjC,oBAAC,cAAc,IAAC,aAAa,SAAG,CACjC,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,OAAG,CACnB,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACxB,oBAAC,MAAM,IACL,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,aAGrB,CACV,CACG,CACP,CAAC;IACJ,CAAC;;AApDa,0BAAY,GAAgC;IACxD,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IACpB,oBAAoB,EAAE,KAAK;IAC3B,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,EAAE;CACX,CAAC;SATS,aAAa","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 Loading\n */\n\nimport \"./LoadingPrompt.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Button, ProgressLinear } from \"@itwin/itwinui-react\";\nimport { LoadingBar } from \"./LoadingBar\";\nimport { LoadingSpinner } from \"./LoadingSpinner\";\nimport { LoadingStatus } from \"./LoadingStatus\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingPrompt]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link LoadingPrompt}.\n */\nexport interface LoadingPromptProps extends CommonProps {\n /** Title */\n title: string;\n /** Message displayed below the title (optional) */\n message?: string;\n /** Determine if a percentage bar is displayed (isDeterminate=true), otherwise a loading spinner or indeterminate progress bar is shown. */\n isDeterminate: boolean;\n /** Show current status and percentage. Default is false (not shown) */\n showStatus: boolean;\n /** Show cancel button. Default is false (not shown) */\n showCancel: boolean;\n /** Current loading status text (optional). Only shown if showStatus=true and isDeterminate=true */\n status: string;\n /** Current percentage. Only used if isDeterminate=true */\n percent: number;\n /** Show percentage at the end of the loading bar (optional). Only shown if isDeterminate=true and showStatus=false */\n showPercentage: boolean;\n /** Show indeterminate progress bar instead of loading spinner */\n showIndeterminateBar: boolean;\n /** Function called when Cancel button is clicked. */\n onCancel?: () => void;\n}\n\n/** A component to display during loading that optionally shows percentage, status text and a cancel button.\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.\n */\nexport class LoadingPrompt extends React.PureComponent<LoadingPromptProps> {\n public static defaultProps: Partial<LoadingPromptProps> = {\n showPercentage: false,\n showStatus: false,\n showCancel: false,\n isDeterminate: false,\n showIndeterminateBar: false,\n percent: 0,\n status: \"\",\n };\n\n public override render() {\n const isDeterminate = this.props.isDeterminate;\n\n return (\n <div\n className={classnames(\"core-loadingprompt\", this.props.className)}\n style={this.props.style}\n >\n <span className=\"title\">{this.props.title}</span>\n {this.props.message && (\n <span className=\"message\">{this.props.message}</span>\n )}\n {isDeterminate && (\n <LoadingBar\n style={{ width: \"100%\" }}\n percent={this.props.percent}\n showPercentage={this.props.showPercentage}\n />\n )}\n {isDeterminate && this.props.showStatus && (\n <LoadingStatus\n style={{ marginTop: \".5em\", width: \"100%\", fontSize: \".75em\" }}\n percent={this.props.percent}\n message={this.props.status}\n />\n )}\n {!isDeterminate &&\n (this.props.showIndeterminateBar ? (\n <ProgressLinear indeterminate />\n ) : (\n <LoadingSpinner />\n ))}\n {this.props.showCancel && (\n <Button\n className=\"loading-prompt-cancel\"\n onClick={this.props.onCancel}\n >\n Cancel\n </Button>\n )}\n </div>\n );\n }\n}\n"]}
@@ -7,10 +7,12 @@ import { ProgressRadial } from "@itwin/itwinui-react";
7
7
  type ProgressRadialProps = React.ComponentPropsWithoutRef<typeof ProgressRadial>;
8
8
  /** Type for ProgressRadialProps.size
9
9
  * @public
10
+ * @deprecated in 4.12.x. Type used in a deprecated component {@link LoadingSpinner}.
10
11
  */
11
12
  export type RadialSizeType = ProgressRadialProps["size"];
12
13
  /** Properties for [[LoadingSpinner]] component
13
14
  * @public
15
+ * @deprecated in 4.12.x. Props of deprecated component {@link LoadingSpinner}.
14
16
  */
15
17
  export interface LoadingSpinnerProps extends Omit<ProgressRadialProps, "size"> {
16
18
  /** Message (text) displayed */
@@ -23,9 +25,9 @@ export interface LoadingSpinnerProps extends Omit<ProgressRadialProps, "size"> {
23
25
  */
24
26
  size?: RadialSizeType;
25
27
  }
26
- /**
27
- * A loading spinner component that optionally shows a text message.
28
+ /** A loading spinner component that optionally shows a text message.
28
29
  * @public
30
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-radial iTwinUI progress indicator} instead.
29
31
  */
30
32
  export declare class LoadingSpinner extends React.PureComponent<LoadingSpinnerProps> {
31
33
  static defaultProps: Partial<LoadingSpinnerProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingSpinner.d.ts","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingSpinner.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC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CACvB;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC;IAC1E,OAAc,YAAY,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAEtD;IAEc,MAAM;CAcvB"}
@@ -8,9 +8,9 @@
8
8
  import "./LoadingSpinner.scss";
9
9
  import * as React from "react";
10
10
  import { ProgressRadial } from "@itwin/itwinui-react";
11
- /**
12
- * A loading spinner component that optionally shows a text message.
11
+ /** A loading spinner component that optionally shows a text message.
13
12
  * @public
13
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-radial iTwinUI progress indicator} instead.
14
14
  */
15
15
  class LoadingSpinner extends React.PureComponent {
16
16
  render() {
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA0BtD;;;GAGG;AACH,MAAa,cAAe,SAAQ,KAAK,CAAC,aAAkC;IAK1D,MAAM;QACpB,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5D,OAAO,CACL,6BAAK,SAAS,EAAC,SAAS;YACrB,OAAO,IAAI,YAAY,IAAI,CAC1B,8BAAM,SAAS,EAAC,gBAAgB,IAAE,OAAO,CAAQ,CAClD;YACD,oBAAC,cAAc,IAAC,IAAI,EAAE,IAAI,KAAM,IAAI,EAAE,aAAa,SAAG;YACrD,OAAO,IAAI,CAAC,YAAY,IAAI,CAC3B,8BAAM,SAAS,EAAC,mBAAmB,IAAE,OAAO,CAAQ,CACrD,CACG,CACP,CAAC;IACJ,CAAC;;AAjBa,2BAAY,GAAiC;IACzD,YAAY,EAAE,KAAK;CACpB,CAAC;SAHS,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 Loading\n */\n\nimport \"./LoadingSpinner.scss\";\nimport * as React from \"react\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\ntype ProgressRadialProps = React.ComponentPropsWithoutRef<\n typeof ProgressRadial\n>;\n\n/** Type for ProgressRadialProps.size\n * @public\n */\nexport type RadialSizeType = ProgressRadialProps[\"size\"];\n\n/** Properties for [[LoadingSpinner]] component\n * @public\n */\nexport interface LoadingSpinnerProps extends Omit<ProgressRadialProps, \"size\"> {\n /** Message (text) displayed */\n message?: string;\n /** Position the message above or below the spinner (defaults to bottom) */\n messageOnTop?: boolean;\n /**\n * Size of the progress indicator. Defaults to medium size.\n * @default ''\n */\n size?: RadialSizeType;\n}\n\n/**\n * A loading spinner component that optionally shows a text message.\n * @public\n */\nexport class LoadingSpinner extends React.PureComponent<LoadingSpinnerProps> {\n public static defaultProps: Partial<LoadingSpinnerProps> = {\n messageOnTop: false,\n };\n\n public override render() {\n const { message, messageOnTop, size, ...rest } = this.props;\n return (\n <div className=\"core-ls\">\n {message && messageOnTop && (\n <span className=\"ls-message-top\">{message}</span>\n )}\n <ProgressRadial size={size} {...rest} indeterminate />\n {message && !messageOnTop && (\n <span className=\"ls-message-bottom\">{message}</span>\n )}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA8BtD;;;GAGG;AACH,MAAa,cAAe,SAAQ,KAAK,CAAC,aAAkC;IAK1D,MAAM;QACpB,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5D,OAAO,CACL,6BAAK,SAAS,EAAC,SAAS;YACrB,OAAO,IAAI,YAAY,IAAI,CAC1B,8BAAM,SAAS,EAAC,gBAAgB,IAAE,OAAO,CAAQ,CAClD;YACD,oBAAC,cAAc,IAAC,IAAI,EAAE,IAAI,KAAM,IAAI,EAAE,aAAa,SAAG;YACrD,OAAO,IAAI,CAAC,YAAY,IAAI,CAC3B,8BAAM,SAAS,EAAC,mBAAmB,IAAE,OAAO,CAAQ,CACrD,CACG,CACP,CAAC;IACJ,CAAC;;AAjBa,2BAAY,GAAiC;IACzD,YAAY,EAAE,KAAK;CACpB,CAAC;SAHS,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 Loading\n */\n\nimport \"./LoadingSpinner.scss\";\nimport * as React from \"react\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\n/* eslint-disable deprecation/deprecation */\n\ntype ProgressRadialProps = React.ComponentPropsWithoutRef<\n typeof ProgressRadial\n>;\n\n/** Type for ProgressRadialProps.size\n * @public\n * @deprecated in 4.12.x. Type used in a deprecated component {@link LoadingSpinner}.\n */\nexport type RadialSizeType = ProgressRadialProps[\"size\"];\n\n/** Properties for [[LoadingSpinner]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link LoadingSpinner}.\n */\nexport interface LoadingSpinnerProps extends Omit<ProgressRadialProps, \"size\"> {\n /** Message (text) displayed */\n message?: string;\n /** Position the message above or below the spinner (defaults to bottom) */\n messageOnTop?: boolean;\n /**\n * Size of the progress indicator. Defaults to medium size.\n * @default ''\n */\n size?: RadialSizeType;\n}\n\n/** A loading spinner component that optionally shows a text message.\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-radial iTwinUI progress indicator} instead.\n */\nexport class LoadingSpinner extends React.PureComponent<LoadingSpinnerProps> {\n public static defaultProps: Partial<LoadingSpinnerProps> = {\n messageOnTop: false,\n };\n\n public override render() {\n const { message, messageOnTop, size, ...rest } = this.props;\n return (\n <div className=\"core-ls\">\n {message && messageOnTop && (\n <span className=\"ls-message-top\">{message}</span>\n )}\n <ProgressRadial size={size} {...rest} indeterminate />\n {message && !messageOnTop && (\n <span className=\"ls-message-bottom\">{message}</span>\n )}\n </div>\n );\n }\n}\n"]}
@@ -6,6 +6,7 @@ import * as React from "react";
6
6
  import type { CommonProps } from "../utils/Props";
7
7
  /** Properties for [[LoadingStatus]] component
8
8
  * @public
9
+ * @deprecated in 4.12.x. Props of deprecated component {@link LoadingStatus}.
9
10
  */
10
11
  export interface LoadingStatusProps extends CommonProps {
11
12
  /** Message (text) displayed */
@@ -13,9 +14,9 @@ export interface LoadingStatusProps extends CommonProps {
13
14
  /** Percent displayed (as text) */
14
15
  percent: number;
15
16
  }
16
- /**
17
- * A loading indicator that shows status text along with the percentage.
17
+ /** A loading indicator that shows status text along with the percentage.
18
18
  * @public
19
+ * @deprecated in 4.12.x. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
19
20
  */
20
21
  export declare class LoadingStatus extends React.PureComponent<LoadingStatusProps> {
21
22
  static defaultProps: Partial<LoadingStatusProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingStatus.d.ts","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingStatus.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxE,OAAc,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAGrD;IAGF,OAAO,CAAC,OAAO;IAMC,MAAM;CAavB"}
1
+ {"version":3,"file":"LoadingStatus.d.ts","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingStatus.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxE,OAAc,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAGrD;IAGF,OAAO,CAAC,OAAO;IAMC,MAAM;CAavB"}
@@ -8,9 +8,9 @@
8
8
  import "./LoadingStatus.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
- /**
12
- * A loading indicator that shows status text along with the percentage.
11
+ /** A loading indicator that shows status text along with the percentage.
13
12
  * @public
13
+ * @deprecated in 4.12.x. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
14
14
  */
15
15
  class LoadingStatus extends React.PureComponent {
16
16
  // sanity check to keep percentage between 0 & 100
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingStatus.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingStatus.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;;GAGG;AACH,MAAa,aAAc,SAAQ,KAAK,CAAC,aAAiC;IAMxE,kDAAkD;IAC1C,OAAO,CAAC,OAAe;QAC7B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,MAAM,cAAc,GAAG,UAAU,CAC/B,IAAI,CAAC,KAAK,CAAC,SAAS,EACpB,0BAA0B,CAC3B,CAAC;QACF,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,8BAAM,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAQ;YACpE,8BAAM,SAAS,EAAC,wBAAwB,IAAE,OAAO,CAAQ,CACrD,CACP,CAAC;IACJ,CAAC;;AAxBa,0BAAY,GAAgC;IACxD,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC;CACX,CAAC;SAJS,aAAa","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 Loading\n */\n\nimport \"./LoadingStatus.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for [[LoadingStatus]] component\n * @public\n */\nexport interface LoadingStatusProps extends CommonProps {\n /** Message (text) displayed */\n message: string;\n /** Percent displayed (as text) */\n percent: number;\n}\n\n/**\n * A loading indicator that shows status text along with the percentage.\n * @public\n */\nexport class LoadingStatus extends React.PureComponent<LoadingStatusProps> {\n public static defaultProps: Partial<LoadingStatusProps> = {\n message: \"\",\n percent: 0,\n };\n\n // sanity check to keep percentage between 0 & 100\n private inRange(percent: number): number {\n let value = Math.min(percent, 100);\n value = Math.max(value, 0);\n return value;\n }\n\n public override render() {\n const percent = `${this.inRange(this.props.percent)}%`;\n const containerClass = classnames(\n this.props.className,\n \"loading-status-container\"\n );\n return (\n <div className={containerClass} style={this.props.style}>\n <span className=\"loading-status-message\">{this.props.message}</span>\n <span className=\"loading-status-percent\">{percent}</span>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"LoadingStatus.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingStatus.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B;;;GAGG;AACH,MAAa,aAAc,SAAQ,KAAK,CAAC,aAAiC;IAMxE,kDAAkD;IAC1C,OAAO,CAAC,OAAe;QAC7B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,MAAM,cAAc,GAAG,UAAU,CAC/B,IAAI,CAAC,KAAK,CAAC,SAAS,EACpB,0BAA0B,CAC3B,CAAC;QACF,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,8BAAM,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAQ;YACpE,8BAAM,SAAS,EAAC,wBAAwB,IAAE,OAAO,CAAQ,CACrD,CACP,CAAC;IACJ,CAAC;;AAxBa,0BAAY,GAAgC;IACxD,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC;CACX,CAAC;SAJS,aAAa","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 Loading\n */\n\nimport \"./LoadingStatus.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingStatus]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link LoadingStatus}.\n */\nexport interface LoadingStatusProps extends CommonProps {\n /** Message (text) displayed */\n message: string;\n /** Percent displayed (as text) */\n percent: number;\n}\n\n/** A loading indicator that shows status text along with the percentage.\n * @public\n * @deprecated in 4.12.x. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.\n */\nexport class LoadingStatus extends React.PureComponent<LoadingStatusProps> {\n public static defaultProps: Partial<LoadingStatusProps> = {\n message: \"\",\n percent: 0,\n };\n\n // sanity check to keep percentage between 0 & 100\n private inRange(percent: number): number {\n let value = Math.min(percent, 100);\n value = Math.max(value, 0);\n return value;\n }\n\n public override render() {\n const percent = `${this.inRange(this.props.percent)}%`;\n const containerClass = classnames(\n this.props.className,\n \"loading-status-container\"\n );\n return (\n <div className={containerClass} style={this.props.style}>\n <span className=\"loading-status-message\">{this.props.message}</span>\n <span className=\"loading-status-percent\">{percent}</span>\n </div>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageBox.d.ts","sourceRoot":"","sources":["../../../../src/core-react/messagebox/MessageBox.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAclD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,6BAA6B;IAC7B,QAAQ,EAAE,eAAe,CAAC;IAC1B,oCAAoC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,2FAA2F;IAC3F,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IACpC,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IA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AAK,CAAC,aAAa,CAAC,qBAAqB,CAAC;IAC9E;;OAEG;WACW,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM;IACjE;;;;OAIG;WACW,gBAAgB,CAC5B,QAAQ,EAAE,eAAe,EAEzB,MAAM,CAAC,EAAE,OAAO,GACf,MAAM;IAmCT;;;;OAIG;WAGW,OAAO,CAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ;IA4B5D,MAAM,IAAI,KAAK,CAAC,YAAY;CA0B7C"}
@@ -17,7 +17,9 @@ import { Dialog } from "../dialog/Dialog";
17
17
  */
18
18
  class MessageBox extends React.PureComponent {
19
19
  render() {
20
- return (React.createElement(Dialog, { title: this.props.title, buttonCluster: this.props.buttonCluster, opened: this.props.opened, onClose: this.props.onClose, onEscape: this.props.onEscape, modal: this.props.modal, className: this.props.className, style: this.props.style, width: this.props.width },
20
+ return (
21
+ // eslint-disable-next-line deprecation/deprecation
22
+ React.createElement(Dialog, { title: this.props.title, buttonCluster: this.props.buttonCluster, opened: this.props.opened, onClose: this.props.onClose, onEscape: this.props.onEscape, modal: this.props.modal, className: this.props.className, style: this.props.style, width: this.props.width },
21
23
  React.createElement(MessageContainer, { severity: this.props.severity, className: this.props.contentClassName, style: this.props.contentStyle }, this.props.children)));
22
24
  }
23
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MessageBox.js","sourceRoot":"","sources":["../../../../src/core-react/messagebox/MessageBox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB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BAC3B,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,oBAAC,qBAAqB,OAAG,CAAC,CAAC,CAAC,oBAAC,eAAe,OAAG,CAAC;gBACpE,MAAM;YACR,KAAK,eAAe,CAAC,OAAO;gBAC1B,QAAQ,GAAG,oBAAC,gBAAgB,OAAG,CAAC,CAAC,8CAA8C;gBAC/E,MAAM;YACR,KAAK,eAAe,CAAC,KAAK;gBACxB,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,oBAAC,oBAAoB,OAAG,CAAC,CAAC,CAAC,oBAAC,cAAc,OAAG,CAAC;gBAClE,MAAM;YACR,KAAK,eAAe,CAAC,KAAK;gBACxB,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,oBAAC,uBAAuB,OAAG,CAAC,CAAC,CAAC,oBAAC,iBAAiB,OAAG,CAAC;gBACxE,MAAM;SACT;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEe,MAAM;QACpB,MAAM,aAAa,GAAG,UAAU,CAC9B,MAAM,EACN,uBAAuB,EACvB,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CACvD,CAAC;QAEF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B;YACzC,6BAAK,SAAS,EAAE,aAAa;gBAC3B,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACxB;YACN,6BACE,SAAS,EAAE,UAAU,CACnB,0BAA0B,EAC1B,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAEtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACF,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Dialog\n */\n\nimport \"./MessageBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { DialogButtonDef } from \"@itwin/appui-abstract\";\nimport { MessageSeverity } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"../utils/Props\";\nimport {\n SvgHelpCircular,\n SvgHelpCircularHollow,\n SvgInfoCircular,\n SvgInfoCircularHollow,\n SvgStatusError,\n SvgStatusErrorHollow,\n SvgStatusRejected,\n SvgStatusRejectedHollow,\n SvgStatusSuccess,\n SvgStatusSuccessHollow,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { Dialog } from \"../dialog/Dialog\";\n\n/** Properties for the [[MessageBox]] component\n * @public\n */\nexport interface MessageBoxProps extends CommonProps {\n /** Severity of MessageBox */\n severity: MessageSeverity;\n /** whether to show dialog or not */\n opened: boolean;\n /** List of [[DialogButtonDef]] objects specifying buttons and associated onClick events */\n buttonCluster: DialogButtonDef[];\n /** Title to show in title bar of dialog */\n title?: string | React.ReactElement;\n /** onClick event for X button for dialog */\n onClose?: () => void;\n /** 'keyup' event for <Esc> key */\n onEscape?: () => void;\n /** minimum width that the dialog may be resized to. Default: 400 */\n minWidth?: number;\n /** minimum height that the dialog may be resized to. Default: 400 */\n minHeight?: number;\n /** initial width of dialog.\n * Displayed in px if value is a number, otherwise displayed in specified CSS unit.\n * Default: \"50%\"\n */\n width?: string | number;\n /** initial height of dialog.\n * Displayed in px if value is a number, otherwise displayed in specified CSS unit.\n * Default: \"\"\n */\n height?: string | number;\n /** Whether to show background overlay. Default: true */\n modal?: boolean;\n /** Custom CSS class name for the content */\n contentClassName?: string;\n /** Custom CSS Style for the content */\n contentStyle?: React.CSSProperties;\n /** Message content */\n children?: React.ReactNode;\n}\n\n/** Message Box React component.\n * @public\n */\nexport class MessageBox extends React.PureComponent<MessageBoxProps> {\n public static defaultProps: Partial<MessageBoxProps> = {\n minWidth: 400,\n minHeight: 400,\n width: \"512px\",\n modal: true,\n };\n\n public override render(): React.ReactElement {\n return (\n <Dialog\n title={this.props.title}\n buttonCluster={this.props.buttonCluster}\n opened={this.props.opened}\n onClose={this.props.onClose}\n onEscape={this.props.onEscape}\n modal={this.props.modal}\n className={this.props.className}\n style={this.props.style}\n width={this.props.width}\n >\n <MessageContainer\n severity={this.props.severity}\n className={this.props.contentClassName}\n style={this.props.contentStyle}\n >\n {this.props.children}\n </MessageContainer>\n </Dialog>\n );\n }\n}\n\n/** Properties for the [[MessageContainer]] component\n * @public\n */\nexport interface MessageContainerProps extends CommonProps {\n severity: MessageSeverity;\n /** Message Content */\n children?: React.ReactNode;\n}\n\n/** Message Container React component.\n * @public\n */\nexport class MessageContainer extends React.PureComponent<MessageContainerProps> {\n /** Returns the class name corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n */\n public static getIconClassName(severity: MessageSeverity): string;\n /** Returns the class name associated with the WebFont icon corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n * @param hollow Should the icon be hollow\n * @deprecated in 4.0. Hollow parameter ignored, WebFont is not returned, only the color.\n */\n public static getIconClassName(\n severity: MessageSeverity,\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n hollow?: boolean\n ): string;\n /* istanbul ignore next */\n public static getIconClassName(\n severity: MessageSeverity,\n _hollow?: boolean\n ): string {\n let iconClassName = \"\";\n\n switch (severity) {\n case MessageSeverity.None:\n iconClassName = \"\";\n break;\n case MessageSeverity.Success:\n iconClassName = \"core-message-box-success\";\n break;\n case MessageSeverity.Information:\n iconClassName = \"core-message-box-information\";\n break;\n case MessageSeverity.Question:\n iconClassName = \"core-message-box-question\";\n break;\n case MessageSeverity.Warning:\n iconClassName = \"core-message-box-warning\";\n break;\n case MessageSeverity.Error:\n iconClassName = \"core-message-box-error\";\n break;\n case MessageSeverity.Fatal:\n iconClassName = \"core-message-box-fatal\";\n break;\n }\n\n return iconClassName;\n }\n\n /** Returns the React icon corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n * @param hollow set to true to return the hollow form of the icon.\n * @returns IconSpec\n */\n /* ignore for unit tests and replace with visual testing */\n /* istanbul ignore next */\n public static getIcon(severity: MessageSeverity, hollow?: boolean): IconSpec {\n let iconSpec: IconSpec = \"\";\n switch (severity) {\n case MessageSeverity.None:\n iconSpec = \"\";\n break;\n case MessageSeverity.Success:\n iconSpec = hollow ? <SvgStatusSuccessHollow /> : <SvgStatusSuccess />;\n break;\n case MessageSeverity.Information:\n iconSpec = hollow ? <SvgInfoCircularHollow /> : <SvgInfoCircular />;\n break;\n case MessageSeverity.Question:\n iconSpec = hollow ? <SvgHelpCircularHollow /> : <SvgHelpCircular />;\n break;\n case MessageSeverity.Warning:\n iconSpec = <SvgStatusWarning />; // TODO - need icon-status-warning-hollow icon\n break;\n case MessageSeverity.Error:\n iconSpec = hollow ? <SvgStatusErrorHollow /> : <SvgStatusError />;\n break;\n case MessageSeverity.Fatal:\n iconSpec = hollow ? <SvgStatusRejectedHollow /> : <SvgStatusRejected />;\n break;\n }\n return iconSpec;\n }\n\n public override render(): React.ReactElement {\n const iconClassName = classnames(\n \"icon\",\n \"core-message-box-icon\",\n MessageContainer.getIconClassName(this.props.severity)\n );\n\n const iconSpec = MessageContainer.getIcon(this.props.severity);\n\n return (\n <div className=\"core-message-box-container\">\n <div className={iconClassName}>\n <Icon iconSpec={iconSpec} />\n </div>\n <div\n className={classnames(\n \"core-message-box-content\",\n this.props.className\n )}\n style={this.props.style}\n >\n {this.props.children}\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"MessageBox.js","sourceRoot":"","sources":["../../../../src/core-react/messagebox/MessageBox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,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IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAEtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACF,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Dialog\n */\n\nimport \"./MessageBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { DialogButtonDef } from \"@itwin/appui-abstract\";\nimport { MessageSeverity } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"../utils/Props\";\nimport {\n SvgHelpCircular,\n SvgHelpCircularHollow,\n SvgInfoCircular,\n SvgInfoCircularHollow,\n SvgStatusError,\n SvgStatusErrorHollow,\n SvgStatusRejected,\n SvgStatusRejectedHollow,\n SvgStatusSuccess,\n SvgStatusSuccessHollow,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { Dialog } from \"../dialog/Dialog\";\n\n/** Properties for the [[MessageBox]] component\n * @public\n */\nexport interface MessageBoxProps extends CommonProps {\n /** Severity of MessageBox */\n severity: MessageSeverity;\n /** whether to show dialog or not */\n opened: boolean;\n /** List of [[DialogButtonDef]] objects specifying buttons and associated onClick events */\n buttonCluster: DialogButtonDef[];\n /** Title to show in title bar of dialog */\n title?: string | React.ReactElement;\n /** onClick event for X button for dialog */\n onClose?: () => void;\n /** 'keyup' event for <Esc> key */\n onEscape?: () => void;\n /** minimum width that the dialog may be resized to. Default: 400 */\n minWidth?: number;\n /** minimum height that the dialog may be resized to. Default: 400 */\n minHeight?: number;\n /** initial width of dialog.\n * Displayed in px if value is a number, otherwise displayed in specified CSS unit.\n * Default: \"50%\"\n */\n width?: string | number;\n /** initial height of dialog.\n * Displayed in px if value is a number, otherwise displayed in specified CSS unit.\n * Default: \"\"\n */\n height?: string | number;\n /** Whether to show background overlay. Default: true */\n modal?: boolean;\n /** Custom CSS class name for the content */\n contentClassName?: string;\n /** Custom CSS Style for the content */\n contentStyle?: React.CSSProperties;\n /** Message content */\n children?: React.ReactNode;\n}\n\n/** Message Box React component.\n * @public\n */\nexport class MessageBox extends React.PureComponent<MessageBoxProps> {\n public static defaultProps: Partial<MessageBoxProps> = {\n minWidth: 400,\n minHeight: 400,\n width: \"512px\",\n modal: true,\n };\n\n public override render(): React.ReactElement {\n return (\n // eslint-disable-next-line deprecation/deprecation\n <Dialog\n title={this.props.title}\n buttonCluster={this.props.buttonCluster}\n opened={this.props.opened}\n onClose={this.props.onClose}\n onEscape={this.props.onEscape}\n modal={this.props.modal}\n className={this.props.className}\n style={this.props.style}\n width={this.props.width}\n >\n <MessageContainer\n severity={this.props.severity}\n className={this.props.contentClassName}\n style={this.props.contentStyle}\n >\n {this.props.children}\n </MessageContainer>\n </Dialog>\n );\n }\n}\n\n/** Properties for the [[MessageContainer]] component\n * @public\n */\nexport interface MessageContainerProps extends CommonProps {\n severity: MessageSeverity;\n /** Message Content */\n children?: React.ReactNode;\n}\n\n/** Message Container React component.\n * @public\n */\nexport class MessageContainer extends React.PureComponent<MessageContainerProps> {\n /** Returns the class name corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n */\n public static getIconClassName(severity: MessageSeverity): string;\n /** Returns the class name associated with the WebFont icon corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n * @param hollow Should the icon be hollow\n * @deprecated in 4.0. Hollow parameter ignored, WebFont is not returned, only the color.\n */\n public static getIconClassName(\n severity: MessageSeverity,\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n hollow?: boolean\n ): string;\n /* istanbul ignore next */\n public static getIconClassName(\n severity: MessageSeverity,\n _hollow?: boolean\n ): string {\n let iconClassName = \"\";\n\n switch (severity) {\n case MessageSeverity.None:\n iconClassName = \"\";\n break;\n case MessageSeverity.Success:\n iconClassName = \"core-message-box-success\";\n break;\n case MessageSeverity.Information:\n iconClassName = \"core-message-box-information\";\n break;\n case MessageSeverity.Question:\n iconClassName = \"core-message-box-question\";\n break;\n case MessageSeverity.Warning:\n iconClassName = \"core-message-box-warning\";\n break;\n case MessageSeverity.Error:\n iconClassName = \"core-message-box-error\";\n break;\n case MessageSeverity.Fatal:\n iconClassName = \"core-message-box-fatal\";\n break;\n }\n\n return iconClassName;\n }\n\n /** Returns the React icon corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n * @param hollow set to true to return the hollow form of the icon.\n * @returns IconSpec\n */\n /* ignore for unit tests and replace with visual testing */\n /* istanbul ignore next */\n public static getIcon(severity: MessageSeverity, hollow?: boolean): IconSpec {\n let iconSpec: IconSpec = \"\";\n switch (severity) {\n case MessageSeverity.None:\n iconSpec = \"\";\n break;\n case MessageSeverity.Success:\n iconSpec = hollow ? <SvgStatusSuccessHollow /> : <SvgStatusSuccess />;\n break;\n case MessageSeverity.Information:\n iconSpec = hollow ? <SvgInfoCircularHollow /> : <SvgInfoCircular />;\n break;\n case MessageSeverity.Question:\n iconSpec = hollow ? <SvgHelpCircularHollow /> : <SvgHelpCircular />;\n break;\n case MessageSeverity.Warning:\n iconSpec = <SvgStatusWarning />; // TODO - need icon-status-warning-hollow icon\n break;\n case MessageSeverity.Error:\n iconSpec = hollow ? <SvgStatusErrorHollow /> : <SvgStatusError />;\n break;\n case MessageSeverity.Fatal:\n iconSpec = hollow ? <SvgStatusRejectedHollow /> : <SvgStatusRejected />;\n break;\n }\n return iconSpec;\n }\n\n public override render(): React.ReactElement {\n const iconClassName = classnames(\n \"icon\",\n \"core-message-box-icon\",\n MessageContainer.getIconClassName(this.props.severity)\n );\n\n const iconSpec = MessageContainer.getIcon(this.props.severity);\n\n return (\n <div className=\"core-message-box-container\">\n <div className={iconClassName}>\n <Icon iconSpec={iconSpec} />\n </div>\n <div\n className={classnames(\n \"core-message-box-content\",\n this.props.className\n )}\n style={this.props.style}\n >\n {this.props.children}\n </div>\n </div>\n );\n }\n}\n"]}
@@ -21,7 +21,7 @@ export function MessageRenderer(props) {
21
21
  // the esm build of dompurify has a default import but the cjs build does not
22
22
  // if there is a default export, use it (likely esm), otherwise use the namespace
23
23
  // istanbul ignore next
24
- const sanitizer = DOMPurify !== null && DOMPurify !== void 0 ? DOMPurify : DOMPurifyNS; // `sanitizer` is default function name for "jam3/no-sanitizer-with-danger" ESLint rule
24
+ const sanitizer = DOMPurify ?? DOMPurifyNS; // `sanitizer` is default function name for "jam3/no-sanitizer-with-danger" ESLint rule
25
25
  let validAnchors = false;
26
26
  let hasAnchors = false;
27
27
  // verify that the tag has proper relationships
@@ -1 +1 @@
1
- {"version":3,"file":"MessageRenderer.js","sourceRoot":"","sources":["../../../../src/core-react/notification/MessageRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,EAAE,KAAK,WAAW,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAe9D;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,IAAI,WAAW,GAAG,IAAI,CAAC;IACvB,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IAElD,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE;QACrC,WAAW,GAAG,CACZ,oBAAC,UAAU,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAG,KAAK,CAAC,OAAO,CAAc,CACrE,CAAC;KACH;SAAM,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;QACvC,6EAA6E;QAC7E,iFAAiF;QACjF,uBAAuB;QACvB,MAAM,SAAS,GAAG,SAAS,aAAT,S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C1B,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;aAClC;SACF;QAED,IAAI,aAAa,CAAC;QAClB,IAAI,UAAU,IAAI,YAAY,EAAE;YAC9B,uDAAuD;YACvD,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE;gBAC1D,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACrB,CAAC,CAAC;SACJ;aAAM;YACL,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SAC7D;QAED,WAAW,GAAG,CACZ,oBAAC,UAAU,IACT,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,iFAAiF;YACjF,yDAAyD;YACzD,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClD,CACH,CAAC;KACH;SAAM;QACL,0BAA0B;QAC1B,IAAI,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC;YAC/B,WAAW,GAAG,CACZ,oBAAC,UAAU,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,IACnC,KAAK,CAAC,OAAO,CAAC,SAAS,CACb,CACd,CAAC;KACL;IAED,OAAO,WAAW,CAAC;AACrB,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 Notification\n */\n\nimport * as React from \"react\";\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\nimport type { MessageType } from \"./MessageType\";\nimport { isHTMLElement, isReactMessage } from \"./MessageType\";\nimport type { ClassNameProps } from \"../utils/Props\";\n\n// cSpell:ignore dompurify\n\n/** Properties for the [[MessageRenderer]] component\n * @public\n */\nexport interface MessageRendererProps extends ClassNameProps {\n /** Message to render */\n message: MessageType;\n /** Indicates whether to use a `span` or `div` element for rendering */\n useSpan?: boolean;\n}\n\n/** React component renders a string, HTMLElement or React node in a `div` or `span`\n * @public\n */\nexport function MessageRenderer(props: MessageRendererProps) {\n let messageNode = null;\n const OutElement = props.useSpan ? \"span\" : \"div\";\n\n if (typeof props.message === \"string\") {\n messageNode = (\n <OutElement className={props.className}>{props.message}</OutElement>\n );\n } else if (isHTMLElement(props.message)) {\n // the esm build of dompurify has a default import but the cjs build does not\n // if there is a default export, use it (likely esm), otherwise use the namespace\n // istanbul ignore next\n const sanitizer = DOMPurify ?? DOMPurifyNS; // `sanitizer` is default function name for \"jam3/no-sanitizer-with-danger\" ESLint rule\n\n let validAnchors = false;\n let hasAnchors = false;\n\n // verify that the tag has proper relationships\n const isAnchorValid = (anchor: HTMLAnchorElement): boolean => {\n return (\n anchor.hasAttribute(\"rel\") &&\n (anchor.rel.includes(\"noopener\") || anchor.rel.includes(\"noreferrer\"))\n );\n };\n\n // recursively check child elements for valid anchor tags\n const checkChildAnchors = (parent: Element) => {\n const children = Array.from(parent.children);\n for (const child of children) {\n if (\n child.hasAttribute(\"target\") &&\n (child as HTMLAnchorElement).target === \"_blank\"\n ) {\n hasAnchors = true;\n validAnchors = isAnchorValid(child as HTMLAnchorElement);\n if (!validAnchors) {\n return;\n }\n }\n checkChildAnchors(child);\n }\n };\n\n // check for anchor tags in the message that have target _blank also have a relationship that avoids security holes\n // https://web.dev/external-anchors-use-rel-noopener/\n // first check the message element\n /* istanbul ignore else */\n if (\n props.message.hasAttribute(\"target\") &&\n (props.message as HTMLAnchorElement).target === \"_blank\"\n ) {\n hasAnchors = true;\n validAnchors = isAnchorValid(props.message as HTMLAnchorElement);\n } else {\n // if the message element is not an anchor, recursively verify it's children\n if (props.message.children) {\n checkChildAnchors(props.message);\n }\n }\n\n let sanitizedHtml;\n if (hasAnchors && validAnchors) {\n // all anchors are valid. do not remove the target attr\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML, {\n ADD_ATTR: [\"target\"],\n });\n } else {\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML);\n }\n\n messageNode = (\n <OutElement\n className={props.className}\n // we can safely disable jam3/no-sanitizer-with-danger as we are sanitizing above\n // eslint-disable-next-line jam3/no-sanitizer-with-danger\n dangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n />\n );\n } else {\n /* istanbul ignore else */\n if (isReactMessage(props.message))\n messageNode = (\n <OutElement className={props.className}>\n {props.message.reactNode}\n </OutElement>\n );\n }\n\n return messageNode;\n}\n"]}
1
+ {"version":3,"file":"MessageRenderer.js","sourceRoot":"","sources":["../../../../src/core-react/notification/MessageRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,EAAE,KAAK,WAAW,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAe9D;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,IAAI,WAAW,GAAG,IAAI,CAAC;IACvB,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IAElD,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE;QACrC,WAAW,GAAG,CACZ,oBAAC,UAAU,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAG,KAAK,CAAC,OAAO,CAAc,CACrE,CAAC;KACH;SAAM,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;QACvC,6EAA6E;QAC7E,iFAAiF;QACjF,uBAAuB;QACvB,MAAM,SAAS,GAAG,SAAS,IAAI,WAAW,CAAC,CAAC,uFAAuF;QAEnI,IAAI,YAAY,GAAG,KAAK,CAAC;QACzB,IAAI,UAAU,GAAG,KAAK,CAAC;QAEvB,+CAA+C;QAC/C,MAAM,aAAa,GAAG,CAAC,MAAyB,EAAW,EAAE;YAC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AO,CAAC,SAAS,EAAE;gBAC1D,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACrB,CAAC,CAAC;SACJ;aAAM;YACL,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SAC7D;QAED,WAAW,GAAG,CACZ,oBAAC,UAAU,IACT,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,iFAAiF;YACjF,yDAAyD;YACzD,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClD,CACH,CAAC;KACH;SAAM;QACL,0BAA0B;QAC1B,IAAI,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC;YAC/B,WAAW,GAAG,CACZ,oBAAC,UAAU,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,IACnC,KAAK,CAAC,OAAO,CAAC,SAAS,CACb,CACd,CAAC;KACL;IAED,OAAO,WAAW,CAAC;AACrB,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 Notification\n */\n\nimport * as React from \"react\";\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\nimport type { MessageType } from \"./MessageType\";\nimport { isHTMLElement, isReactMessage } from \"./MessageType\";\nimport type { ClassNameProps } from \"../utils/Props\";\n\n// cSpell:ignore dompurify\n\n/** Properties for the [[MessageRenderer]] component\n * @public\n */\nexport interface MessageRendererProps extends ClassNameProps {\n /** Message to render */\n message: MessageType;\n /** Indicates whether to use a `span` or `div` element for rendering */\n useSpan?: boolean;\n}\n\n/** React component renders a string, HTMLElement or React node in a `div` or `span`\n * @public\n */\nexport function MessageRenderer(props: MessageRendererProps) {\n let messageNode = null;\n const OutElement = props.useSpan ? \"span\" : \"div\";\n\n if (typeof props.message === \"string\") {\n messageNode = (\n <OutElement className={props.className}>{props.message}</OutElement>\n );\n } else if (isHTMLElement(props.message)) {\n // the esm build of dompurify has a default import but the cjs build does not\n // if there is a default export, use it (likely esm), otherwise use the namespace\n // istanbul ignore next\n const sanitizer = DOMPurify ?? DOMPurifyNS; // `sanitizer` is default function name for \"jam3/no-sanitizer-with-danger\" ESLint rule\n\n let validAnchors = false;\n let hasAnchors = false;\n\n // verify that the tag has proper relationships\n const isAnchorValid = (anchor: HTMLAnchorElement): boolean => {\n return (\n anchor.hasAttribute(\"rel\") &&\n (anchor.rel.includes(\"noopener\") || anchor.rel.includes(\"noreferrer\"))\n );\n };\n\n // recursively check child elements for valid anchor tags\n const checkChildAnchors = (parent: Element) => {\n const children = Array.from(parent.children);\n for (const child of children) {\n if (\n child.hasAttribute(\"target\") &&\n (child as HTMLAnchorElement).target === \"_blank\"\n ) {\n hasAnchors = true;\n validAnchors = isAnchorValid(child as HTMLAnchorElement);\n if (!validAnchors) {\n return;\n }\n }\n checkChildAnchors(child);\n }\n };\n\n // check for anchor tags in the message that have target _blank also have a relationship that avoids security holes\n // https://web.dev/external-anchors-use-rel-noopener/\n // first check the message element\n /* istanbul ignore else */\n if (\n props.message.hasAttribute(\"target\") &&\n (props.message as HTMLAnchorElement).target === \"_blank\"\n ) {\n hasAnchors = true;\n validAnchors = isAnchorValid(props.message as HTMLAnchorElement);\n } else {\n // if the message element is not an anchor, recursively verify it's children\n if (props.message.children) {\n checkChildAnchors(props.message);\n }\n }\n\n let sanitizedHtml;\n if (hasAnchors && validAnchors) {\n // all anchors are valid. do not remove the target attr\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML, {\n ADD_ATTR: [\"target\"],\n });\n } else {\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML);\n }\n\n messageNode = (\n <OutElement\n className={props.className}\n // we can safely disable jam3/no-sanitizer-with-danger as we are sanitizing above\n // eslint-disable-next-line jam3/no-sanitizer-with-danger\n dangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n />\n );\n } else {\n /* istanbul ignore else */\n if (isReactMessage(props.message))\n messageNode = (\n <OutElement className={props.className}>\n {props.message.reactNode}\n </OutElement>\n );\n }\n\n return messageNode;\n}\n"]}
@@ -18,7 +18,6 @@ import { Rectangle } from "../utils/Rectangle";
18
18
  */
19
19
  class Popup extends React.Component {
20
20
  constructor(props) {
21
- var _a, _b;
22
21
  super(props);
23
22
  this._popup = null;
24
23
  this._bindWindowEvents = () => {
@@ -218,7 +217,7 @@ class Popup extends React.Component {
218
217
  this.setState({ animationEnded: true });
219
218
  }
220
219
  };
221
- const parentDocument = (_b = (_a = this.props.target) === null || _a === void 0 ? void 0 : _a.ownerDocument) !== null && _b !== void 0 ? _b : document;
220
+ const parentDocument = this.props.target?.ownerDocument ?? document;
222
221
  this.state = {
223
222
  animationEnded: false,
224
223
  isOpen: this.props.isOpen,
@@ -234,19 +233,17 @@ class Popup extends React.Component {
234
233
  }
235
234
  }
236
235
  getParentWindow() {
237
- var _a;
238
236
  // istanbul ignore next
239
- return (_a = this.state.parentDocument.defaultView) !== null && _a !== void 0 ? _a : window;
237
+ return this.state.parentDocument.defaultView ?? window;
240
238
  }
241
239
  componentDidUpdate(previousProps, prevState) {
242
- var _a, _b;
243
240
  if (this.state.position !== prevState.position) {
244
241
  this.setState({ animationEnded: false });
245
242
  }
246
243
  if (this.props.target !== previousProps.target) {
247
244
  // istanbul ignore next
248
245
  {
249
- const parentDocument = (_b = (_a = this.props.target) === null || _a === void 0 ? void 0 : _a.ownerDocument) !== null && _b !== void 0 ? _b : document;
246
+ const parentDocument = this.props.target?.ownerDocument ?? document;
250
247
  if (parentDocument !== this.state.parentDocument) {
251
248
  this._unBindWindowEvents();
252
249
  this.setState({ parentDocument });
@@ -440,9 +437,8 @@ class Popup extends React.Component {
440
437
  React.createElement(FocusTrap, { active: !!this.props.moveFocus, initialFocusElement: this.props.focusTarget, returnFocusOnDeactivate: true }, this.props.children)), this.getContainer());
441
438
  }
442
439
  getContainer() {
443
- var _a;
444
440
  // istanbul ignore next
445
- return ((_a = this.state.parentDocument.body.querySelector('[data-root-container="appui-root-id"]')) !== null && _a !== void 0 ? _a : this.state.parentDocument.body);
441
+ return (this.state.parentDocument.body.querySelector('[data-root-container="appui-root-id"]') ?? this.state.parentDocument.body);
446
442
  }
447
443
  }
448
444
  Popup.defaultProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"Popup.js","sourceRoot":"","sources":["../../../../src/core-react/popup/Popup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,cAAc,CAAC;AACtB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAsF/C;;GAEG;AACH,MAAa,KAAM,SAAQ,KAAK,CAAC,SAAiC;IAGhE,YAAY,KAAiB;;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC;QAHP,WAAM,GAAuB,IAAI,CAAC;QAuFlC,sBAAiB,GAAG,GAAG,EAAE;YAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YAC5C,YAAY,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACvE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACtD,YAAY,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACtE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YACpD,YAAY,CAAC,gBAAgB,CAA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C,CAAC,CAAC;AAClE,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 Popup\n */\n\nimport \"./Popup.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Key } from \"ts-key-enum\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { Rectangle } from \"../utils/Rectangle\";\n\n// cSpell:ignore focustrap focusable alertdialog\n\n/** @internal */\ninterface PopupPoint {\n x: number;\n y: number;\n}\n\n/** Properties for the [[Popup]] component\n * @public\n */\nexport interface PopupProps extends CommonProps {\n /** Show or hide the box shadow (defaults to true) */\n showShadow: boolean;\n /** Show or hide the arrow (defaults to false) */\n showArrow: boolean;\n /** Indicates whether the popup is shown or not (defaults to false) */\n isOpen: boolean;\n /** Direction (relative to the target) to which the popup is expanded (defaults to Bottom) */\n position: RelativePosition;\n /** Top position (absolute positioning - defaults to 0) */\n top: number;\n /** Left position (absolute positioning - defaults to 0) */\n left: number;\n /** Function called when the popup is opened */\n onOpen?: () => void;\n /** Function called when user clicks outside the popup */\n onOutsideClick?: (e: MouseEvent) => void;\n /** Function called when the popup is closed */\n onClose?: () => void;\n /** Function called when the popup is closed on Enter */\n onEnter?: () => void;\n /** Function called when the wheel is used */\n onWheel?: (e: WheelEvent) => void;\n /** Function called when the right mouse button is pressed */\n onContextMenu?: (e: MouseEvent) => void;\n /** Offset from the parent (defaults to 4) */\n offset: number;\n /** Target element to position popup */\n target?: HTMLElement | null;\n /** Role - if not specified \"dialog\" is used */\n role?: \"dialog\" | \"alert\" | \"alertdialog\";\n /** accessibility label */\n ariaLabel?: string;\n /** set focus to popup - default to not set focus */\n moveFocus?: boolean;\n /** Element to receive focus, specified by React.RefObject or CSS selector string. If undefined and moveFocus is true then focus is moved to first focusable element. */\n focusTarget?: React.RefObject<HTMLElement> | string;\n /** Indicates whether the popup is pinned. */\n isPinned?: boolean;\n /** Indicates whether to use animation for open/close (defaults to true) */\n animate?: boolean;\n /** Indicates whether to close the popup when Enter is pressed (defaults to true) */\n closeOnEnter?: boolean;\n /** Indicates whether to close the popup when the wheel is used (defaults to true) */\n closeOnWheel?: boolean;\n /** Indicates whether to close the popup when the right mouse button is pressed (defaults to true) */\n closeOnContextMenu?: boolean;\n /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */\n closeOnNestedPopupOutsideClick?: boolean;\n /** If true the children are mounted once and unmounted when this component is unmounted. If false the\n * children are unmounted each time the popup is closed. */\n keepContentsMounted?: boolean;\n\n /**\n * If true the popup will remain open and will be repositioned when window resize events occur, default to false.\n * @beta\n * */\n repositionOnResize?: boolean;\n\n /** Content */\n children?: React.ReactNode;\n}\n\n/** @internal */\ninterface PopupState {\n isOpen: boolean;\n top: number;\n left: number;\n position: RelativePosition;\n parentDocument: Document;\n animationEnded: boolean;\n}\n\n/** Popup React component displays a popup relative to an optional target element.\n * @public\n */\nexport class Popup extends React.Component<PopupProps, PopupState> {\n private _popup: HTMLElement | null = null;\n\n constructor(props: PopupProps) {\n super(props);\n const parentDocument = this.props.target?.ownerDocument ?? document;\n\n this.state = {\n animationEnded: false,\n isOpen: this.props.isOpen,\n top: 0,\n left: 0,\n position: this.props.position,\n parentDocument,\n };\n }\n\n public static defaultProps: Partial<PopupProps> = {\n position: RelativePosition.Bottom,\n showShadow: true,\n showArrow: false,\n isOpen: false,\n offset: 4,\n top: -1,\n left: -1,\n };\n\n public override componentDidMount() {\n if (this.props.isOpen) {\n this._onShow();\n }\n }\n\n private getParentWindow() {\n // istanbul ignore next\n return this.state.parentDocument.defaultView ?? window;\n }\n\n public override componentDidUpdate(\n previousProps: PopupProps,\n prevState: PopupState\n ) {\n if (this.state.position !== prevState.position) {\n this.setState({ animationEnded: false });\n }\n\n if (this.props.target !== previousProps.target) {\n // istanbul ignore next\n {\n const parentDocument = this.props.target?.ownerDocument ?? document;\n if (parentDocument !== this.state.parentDocument) {\n this._unBindWindowEvents();\n this.setState({ parentDocument });\n }\n }\n }\n\n if (this.props.isOpen === previousProps.isOpen) {\n if (this.props.isOpen) {\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n if (\n Math.abs(this.state.left - point.x) < 3 &&\n Math.abs(this.state.top - point.y) < 3 &&\n this.state.position === position\n )\n return;\n\n this.setState({\n left: point.x,\n top: point.y,\n position,\n });\n }\n return;\n }\n\n if (this.props.isOpen) {\n this._onShow();\n } else {\n this._onClose();\n }\n }\n\n public override componentWillUnmount() {\n this._unBindWindowEvents();\n }\n\n private _bindWindowEvents = () => {\n const activeWindow = this.getParentWindow();\n activeWindow.addEventListener(\"pointerdown\", this._handleOutsideClick);\n activeWindow.addEventListener(\"resize\", this._resize);\n activeWindow.addEventListener(\"contextmenu\", this._handleContextMenu);\n activeWindow.addEventListener(\"scroll\", this._hide);\n activeWindow.addEventListener(\"wheel\", this._handleWheel);\n activeWindow.addEventListener(\"keydown\", this._handleKeyboard);\n };\n\n private _unBindWindowEvents = () => {\n const activeWindow = this.getParentWindow();\n activeWindow.removeEventListener(\"pointerdown\", this._handleOutsideClick);\n activeWindow.removeEventListener(\"resize\", this._resize);\n activeWindow.removeEventListener(\"contextmenu\", this._handleContextMenu);\n activeWindow.removeEventListener(\"scroll\", this._hide);\n activeWindow.removeEventListener(\"wheel\", this._handleWheel);\n activeWindow.removeEventListener(\"keydown\", this._handleKeyboard);\n };\n\n private _handleWheel = (event: WheelEvent) => {\n if (this._popup && this._popup.contains(event.target as Node)) return;\n\n if (this.props.onWheel) return this.props.onWheel(event);\n\n const closeOnWheel =\n this.props.closeOnWheel !== undefined ? this.props.closeOnWheel : true;\n if (closeOnWheel) this._hide();\n };\n\n private isInCorePopup(element: HTMLElement): boolean {\n if (element.nodeName === \"DIV\") {\n if (element.classList && element.classList.contains(\"core-popup\"))\n return true;\n if (element.parentElement && this.isInCorePopup(element.parentElement))\n return true;\n } else {\n // istanbul ignore else\n if (element.parentElement && this.isInCorePopup(element.parentElement))\n return true;\n }\n return false;\n }\n\n private _handleOutsideClick = (event: MouseEvent): void => {\n if (this._popup && this._popup.contains(event.target as Node)) return;\n\n if (this.props.isPinned) return;\n\n if (\n !this.props.closeOnNestedPopupOutsideClick &&\n this.isInCorePopup(event.target as HTMLElement)\n )\n return;\n\n if (this.props.onOutsideClick) return this.props.onOutsideClick(event);\n\n if (this.props.target && this.props.target.contains(event.target as Node))\n return;\n\n this._onClose();\n };\n\n private _handleContextMenu = (event: MouseEvent) => {\n if (this._popup && this._popup.contains(event.target as Node)) return;\n\n if (this.props.onContextMenu) return this.props.onContextMenu(event);\n\n const closeOnContextMenu =\n this.props.closeOnContextMenu !== undefined\n ? this.props.closeOnContextMenu\n : true;\n if (closeOnContextMenu) this._hide();\n };\n\n private _handleKeyboard = (event: KeyboardEvent): void => {\n if (this.props.isPinned) return;\n\n if (\n event.key === Key.Escape.valueOf() ||\n event.key === Key.Enter.valueOf()\n ) {\n const closeOnEnter =\n this.props.closeOnEnter !== undefined ? this.props.closeOnEnter : true;\n if (event.key === Key.Enter.valueOf()) {\n if (closeOnEnter) this._onClose(true);\n else this.props.onEnter && this.props.onEnter();\n } else {\n this._onClose(false);\n }\n }\n };\n\n private _resize = () => {\n if (this.props.repositionOnResize) {\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n this.setState({ left: point.x, top: point.y, position });\n } else {\n this._hide(); // legacy behavior\n }\n };\n\n private _hide = () => {\n if (this.props.isPinned) return;\n\n this._onClose();\n };\n\n private _onShow() {\n this._bindWindowEvents();\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n\n this.setState(\n { left: point.x, top: point.y, isOpen: true, position },\n () => {\n if (this.props.onOpen) this.props.onOpen();\n }\n );\n }\n\n private _onClose(enterKey?: boolean) {\n if (!this.state.isOpen) return;\n\n this._unBindWindowEvents();\n\n this.setState({ isOpen: false }, () => {\n if (enterKey && this.props.onEnter) this.props.onEnter();\n if (this.props.onClose) this.props.onClose();\n });\n }\n\n private _isPositionAbsolute(): boolean {\n return this.props.top !== -1 && this.props.left !== -1;\n }\n\n private _getClassNameByPosition(position: RelativePosition): string {\n if (!this._isPositionAbsolute()) {\n switch (position) {\n case RelativePosition.TopLeft:\n return \"core-popup-top-left\";\n case RelativePosition.TopRight:\n return \"core-popup-top-right\";\n case RelativePosition.BottomLeft:\n return \"core-popup-bottom-left\";\n case RelativePosition.BottomRight:\n return \"core-popup-bottom-right\";\n case RelativePosition.Top:\n return \"core-popup-top\";\n case RelativePosition.Left:\n return \"core-popup-left\";\n case RelativePosition.Right:\n return \"core-popup-right\";\n case RelativePosition.Bottom:\n return \"core-popup-bottom\";\n case RelativePosition.LeftTop:\n return \"core-popup-left-top\";\n case RelativePosition.RightTop:\n return \"core-popup-right-top\";\n }\n }\n\n return \"\";\n }\n\n private _getPopupDimensions(): { popupWidth: number; popupHeight: number } {\n let popupWidth = 0;\n let popupHeight = 0;\n // istanbul ignore else\n if (this._popup) {\n const activeWindow = this.getParentWindow();\n const style = activeWindow.getComputedStyle(this._popup);\n const borderLeftWidth = parsePxString(style.borderLeftWidth);\n const borderRightWidth = parsePxString(style.borderRightWidth);\n const borderTopWidth = parsePxString(style.borderTopWidth);\n const borderBottomWidth = parsePxString(style.borderBottomWidth);\n popupWidth = this._popup.clientWidth + borderLeftWidth + borderRightWidth;\n popupHeight =\n this._popup.clientHeight + borderTopWidth + borderBottomWidth;\n }\n\n return { popupWidth, popupHeight };\n }\n\n private _getPosition = (position: RelativePosition) => {\n const activeWindow = this.getParentWindow();\n const { target, offset, top, left } = this.props;\n const offsetArrow = this.props.showArrow ? 6 : 0;\n\n // absolute position\n if (this._isPositionAbsolute()) return { x: left, y: top };\n\n // sanity check\n const point = { x: 0, y: 0 };\n if (!this._popup || !target) return point;\n\n // relative position\n const scrollY = activeWindow.scrollY;\n const scrollX = activeWindow.scrollX;\n\n const container = this.getContainer();\n const containerBounds = container.getBoundingClientRect();\n const targetRect = Rectangle.create(target.getBoundingClientRect()).offset({\n x: -containerBounds.left,\n y: -containerBounds.top,\n });\n\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n\n switch (position) {\n case RelativePosition.Top:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x =\n scrollX +\n targetRect.left +\n targetRect.getWidth() / 2 -\n popupWidth / 2;\n break;\n\n case RelativePosition.TopLeft:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x = scrollX + targetRect.left;\n break;\n\n case RelativePosition.TopRight:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x = scrollX + targetRect.right - popupWidth;\n break;\n\n case RelativePosition.Bottom:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x =\n scrollX +\n targetRect.left +\n targetRect.getWidth() / 2 -\n popupWidth / 2;\n break;\n\n case RelativePosition.BottomLeft:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x = scrollX + targetRect.left;\n break;\n\n case RelativePosition.BottomRight:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x = scrollX + targetRect.right - popupWidth;\n break;\n\n case RelativePosition.Left:\n point.y =\n scrollY +\n targetRect.top +\n targetRect.getHeight() / 2 -\n popupHeight / 2;\n point.x = scrollX + targetRect.left - popupWidth - offset - offsetArrow;\n break;\n\n case RelativePosition.LeftTop:\n point.y = scrollY + targetRect.top;\n point.x = scrollX + targetRect.left - popupWidth - offset - offsetArrow;\n break;\n\n case RelativePosition.Right:\n point.y =\n scrollY +\n targetRect.top +\n targetRect.getHeight() / 2 -\n popupHeight / 2;\n point.x = scrollX + targetRect.right + offset + offsetArrow;\n break;\n\n case RelativePosition.RightTop:\n point.y = scrollY + targetRect.top;\n point.x = scrollX + targetRect.right + offset + offsetArrow;\n break;\n }\n\n return point;\n };\n\n private _toggleRelativePosition(): RelativePosition {\n const { target, position, offset } = this.props;\n\n if (!this._popup || !target) return position;\n\n // istanbul ignore if\n if (this._isPositionAbsolute()) return position;\n\n let newPosition = position;\n\n interface Rect {\n left: number;\n top: number;\n right: number;\n bottom: number;\n }\n\n const activeWindow = this.getParentWindow();\n\n // Note: Cannot use DOMRect yet since it's experimental and not available in all browsers (Nov. 2018)\n const viewportRect: Rect = {\n left: activeWindow.scrollX,\n top: activeWindow.scrollY,\n right: activeWindow.scrollX + activeWindow.innerWidth,\n bottom: activeWindow.scrollY + activeWindow.innerHeight,\n };\n const targetRect = target.getBoundingClientRect();\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n const containerStyle = activeWindow.getComputedStyle(target);\n const offsetArrow = this.props.showArrow\n ? /* istanbul ignore next */ 10\n : 2;\n\n const bottomMargin = parseMargin(containerStyle.marginBottom);\n if (\n targetRect.bottom + popupHeight + bottomMargin + offsetArrow + offset >\n viewportRect.bottom\n ) {\n if (newPosition === RelativePosition.Bottom)\n newPosition = RelativePosition.Top;\n else if (newPosition === RelativePosition.BottomLeft)\n newPosition = RelativePosition.TopLeft;\n else if (newPosition === RelativePosition.BottomRight)\n newPosition = RelativePosition.TopRight;\n }\n\n const topMargin = parseMargin(containerStyle.marginTop);\n if (\n targetRect.top - popupHeight - topMargin - offsetArrow - offset <\n viewportRect.top\n ) {\n if (newPosition === RelativePosition.Top)\n newPosition = RelativePosition.Bottom;\n else if (newPosition === RelativePosition.TopLeft)\n newPosition = RelativePosition.BottomLeft;\n else if (newPosition === RelativePosition.TopRight)\n newPosition = RelativePosition.BottomRight;\n }\n\n const leftMargin = parseMargin(containerStyle.marginLeft);\n if (\n targetRect.left - popupWidth - leftMargin - offsetArrow - offset <\n viewportRect.left\n ) {\n if (newPosition === RelativePosition.Left)\n newPosition = RelativePosition.Right;\n else if (newPosition === RelativePosition.LeftTop)\n newPosition = RelativePosition.RightTop;\n }\n\n const rightMargin = parseMargin(containerStyle.marginRight);\n if (\n targetRect.right + popupWidth + rightMargin + offsetArrow + offset >\n viewportRect.right\n ) {\n if (newPosition === RelativePosition.Right)\n newPosition = RelativePosition.Left;\n else if (newPosition === RelativePosition.RightTop)\n newPosition = RelativePosition.LeftTop;\n }\n\n return newPosition;\n }\n\n // fit the popup within the extents of the view port\n private _fitPopup = (point: PopupPoint) => {\n const fittedPoint = point;\n\n // istanbul ignore if\n if (!this._popup) {\n return fittedPoint;\n }\n\n // const popupRect = this._popup.getBoundingClientRect();\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n const { innerWidth, innerHeight } = window;\n\n // istanbul ignore if\n if (fittedPoint.y + popupHeight > innerHeight) {\n fittedPoint.y = innerHeight - popupHeight;\n }\n\n // istanbul ignore if\n if (fittedPoint.x + popupWidth > innerWidth) {\n fittedPoint.x = innerWidth - popupWidth;\n }\n\n // istanbul ignore if\n if (fittedPoint.y < 0) {\n fittedPoint.y = 0;\n }\n\n if (fittedPoint.x < 0) {\n fittedPoint.x = 0;\n }\n\n return fittedPoint;\n };\n\n private _handleAnimationEnd = (\n event: React.AnimationEvent<HTMLDivElement>\n ) => {\n if (event.target === this._popup) {\n this.setState({ animationEnded: true });\n }\n };\n\n public override render() {\n const animate =\n this.props.animate !== undefined ? this.props.animate : true;\n const className = classnames(\n \"core-popup\",\n this._getClassNameByPosition(this.state.position),\n this.props.showShadow && \"core-popup-shadow\",\n this.props.showArrow && \"arrow\",\n !animate && \"core-popup-animation-none\",\n this.props.className,\n this.state.animationEnded && \"core-animation-ended\",\n !this.props.isOpen &&\n this.props.keepContentsMounted &&\n \"core-popup-hidden\"\n );\n\n const style: React.CSSProperties = {\n top: this.state.top,\n left: this.state.left,\n ...this.props.style,\n };\n\n const role = this.props.role ? this.props.role : \"dialog\"; // accessibility property\n\n if (!this.props.isOpen && !this.props.keepContentsMounted) {\n return null;\n }\n\n return ReactDOM.createPortal(\n <div\n className={className}\n data-testid=\"core-popup\"\n ref={(element) => {\n this._popup = element;\n }}\n style={style}\n role={role}\n aria-modal={true}\n tabIndex={-1}\n aria-label={this.props.ariaLabel}\n onAnimationEnd={this._handleAnimationEnd}\n >\n <FocusTrap\n active={!!this.props.moveFocus}\n initialFocusElement={this.props.focusTarget}\n returnFocusOnDeactivate={true}\n >\n {this.props.children}\n </FocusTrap>\n </div>,\n this.getContainer()\n );\n }\n\n private getContainer() {\n // istanbul ignore next\n return (\n this.state.parentDocument.body.querySelector(\n '[data-root-container=\"appui-root-id\"]'\n ) ?? this.state.parentDocument.body\n );\n }\n}\n\nfunction parsePxString(pxStr: string): number {\n const parsed = parseInt(pxStr, 10);\n return parsed || 0;\n}\n\nfunction parseMargin(value: string) {\n return value ? /* istanbul ignore next */ parseFloat(value) : 0;\n}\n"]}
1
+ {"version":3,"file":"Popup.js","sourceRoot":"","sources":["../../../../src/core-react/popup/Popup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,cAAc,CAAC;AACtB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAsF/C;;GAEG;AACH,MAAa,KAAM,SAAQ,KAAK,CAAC,SAAiC;IAGhE,YAAY,KAAiB;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC;QAHP,WAAM,GAAuB,IAAI,CAAC;QAuFlC,sBAAiB,GAAG,GAAG,EAAE;YAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YAC5C,YAAY,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,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Aa;IAClC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,MAAM,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,CAAC,CAAC,0BAA0B,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,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 Popup\n */\n\nimport \"./Popup.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Key } from \"ts-key-enum\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { Rectangle } from \"../utils/Rectangle\";\n\n// cSpell:ignore focustrap focusable alertdialog\n\n/** @internal */\ninterface PopupPoint {\n x: number;\n y: number;\n}\n\n/** Properties for the [[Popup]] component\n * @public\n */\nexport interface PopupProps extends CommonProps {\n /** Show or hide the box shadow (defaults to true) */\n showShadow: boolean;\n /** Show or hide the arrow (defaults to false) */\n showArrow: boolean;\n /** Indicates whether the popup is shown or not (defaults to false) */\n isOpen: boolean;\n /** Direction (relative to the target) to which the popup is expanded (defaults to Bottom) */\n position: RelativePosition;\n /** Top position (absolute positioning - defaults to 0) */\n top: number;\n /** Left position (absolute positioning - defaults to 0) */\n left: number;\n /** Function called when the popup is opened */\n onOpen?: () => void;\n /** Function called when user clicks outside the popup */\n onOutsideClick?: (e: MouseEvent) => void;\n /** Function called when the popup is closed */\n onClose?: () => void;\n /** Function called when the popup is closed on Enter */\n onEnter?: () => void;\n /** Function called when the wheel is used */\n onWheel?: (e: WheelEvent) => void;\n /** Function called when the right mouse button is pressed */\n onContextMenu?: (e: MouseEvent) => void;\n /** Offset from the parent (defaults to 4) */\n offset: number;\n /** Target element to position popup */\n target?: HTMLElement | null;\n /** Role - if not specified \"dialog\" is used */\n role?: \"dialog\" | \"alert\" | \"alertdialog\";\n /** accessibility label */\n ariaLabel?: string;\n /** set focus to popup - default to not set focus */\n moveFocus?: boolean;\n /** Element to receive focus, specified by React.RefObject or CSS selector string. If undefined and moveFocus is true then focus is moved to first focusable element. */\n focusTarget?: React.RefObject<HTMLElement> | string;\n /** Indicates whether the popup is pinned. */\n isPinned?: boolean;\n /** Indicates whether to use animation for open/close (defaults to true) */\n animate?: boolean;\n /** Indicates whether to close the popup when Enter is pressed (defaults to true) */\n closeOnEnter?: boolean;\n /** Indicates whether to close the popup when the wheel is used (defaults to true) */\n closeOnWheel?: boolean;\n /** Indicates whether to close the popup when the right mouse button is pressed (defaults to true) */\n closeOnContextMenu?: boolean;\n /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */\n closeOnNestedPopupOutsideClick?: boolean;\n /** If true the children are mounted once and unmounted when this component is unmounted. If false the\n * children are unmounted each time the popup is closed. */\n keepContentsMounted?: boolean;\n\n /**\n * If true the popup will remain open and will be repositioned when window resize events occur, default to false.\n * @beta\n * */\n repositionOnResize?: boolean;\n\n /** Content */\n children?: React.ReactNode;\n}\n\n/** @internal */\ninterface PopupState {\n isOpen: boolean;\n top: number;\n left: number;\n position: RelativePosition;\n parentDocument: Document;\n animationEnded: boolean;\n}\n\n/** Popup React component displays a popup relative to an optional target element.\n * @public\n */\nexport class Popup extends React.Component<PopupProps, PopupState> {\n private _popup: HTMLElement | null = null;\n\n constructor(props: PopupProps) {\n super(props);\n const parentDocument = this.props.target?.ownerDocument ?? document;\n\n this.state = {\n animationEnded: false,\n isOpen: this.props.isOpen,\n top: 0,\n left: 0,\n position: this.props.position,\n parentDocument,\n };\n }\n\n public static defaultProps: Partial<PopupProps> = {\n position: RelativePosition.Bottom,\n showShadow: true,\n showArrow: false,\n isOpen: false,\n offset: 4,\n top: -1,\n left: -1,\n };\n\n public override componentDidMount() {\n if (this.props.isOpen) {\n this._onShow();\n }\n }\n\n private getParentWindow() {\n // istanbul ignore next\n return this.state.parentDocument.defaultView ?? window;\n }\n\n public override componentDidUpdate(\n previousProps: PopupProps,\n prevState: PopupState\n ) {\n if (this.state.position !== prevState.position) {\n this.setState({ animationEnded: false });\n }\n\n if (this.props.target !== previousProps.target) {\n // istanbul ignore next\n {\n const parentDocument = this.props.target?.ownerDocument ?? document;\n if (parentDocument !== this.state.parentDocument) {\n this._unBindWindowEvents();\n this.setState({ parentDocument });\n }\n }\n }\n\n if (this.props.isOpen === previousProps.isOpen) {\n if (this.props.isOpen) {\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n if (\n Math.abs(this.state.left - point.x) < 3 &&\n Math.abs(this.state.top - point.y) < 3 &&\n this.state.position === position\n )\n return;\n\n this.setState({\n left: point.x,\n top: point.y,\n position,\n });\n }\n return;\n }\n\n if (this.props.isOpen) {\n this._onShow();\n } else {\n this._onClose();\n }\n }\n\n public override componentWillUnmount() {\n this._unBindWindowEvents();\n }\n\n private _bindWindowEvents = () => {\n const activeWindow = this.getParentWindow();\n activeWindow.addEventListener(\"pointerdown\", this._handleOutsideClick);\n activeWindow.addEventListener(\"resize\", this._resize);\n activeWindow.addEventListener(\"contextmenu\", this._handleContextMenu);\n activeWindow.addEventListener(\"scroll\", this._hide);\n activeWindow.addEventListener(\"wheel\", this._handleWheel);\n activeWindow.addEventListener(\"keydown\", this._handleKeyboard);\n };\n\n private _unBindWindowEvents = () => {\n const activeWindow = this.getParentWindow();\n activeWindow.removeEventListener(\"pointerdown\", this._handleOutsideClick);\n activeWindow.removeEventListener(\"resize\", this._resize);\n activeWindow.removeEventListener(\"contextmenu\", this._handleContextMenu);\n activeWindow.removeEventListener(\"scroll\", this._hide);\n activeWindow.removeEventListener(\"wheel\", this._handleWheel);\n activeWindow.removeEventListener(\"keydown\", this._handleKeyboard);\n };\n\n private _handleWheel = (event: WheelEvent) => {\n if (this._popup && this._popup.contains(event.target as Node)) return;\n\n if (this.props.onWheel) return this.props.onWheel(event);\n\n const closeOnWheel =\n this.props.closeOnWheel !== undefined ? this.props.closeOnWheel : true;\n if (closeOnWheel) this._hide();\n };\n\n private isInCorePopup(element: HTMLElement): boolean {\n if (element.nodeName === \"DIV\") {\n if (element.classList && element.classList.contains(\"core-popup\"))\n return true;\n if (element.parentElement && this.isInCorePopup(element.parentElement))\n return true;\n } else {\n // istanbul ignore else\n if (element.parentElement && this.isInCorePopup(element.parentElement))\n return true;\n }\n return false;\n }\n\n private _handleOutsideClick = (event: MouseEvent): void => {\n if (this._popup && this._popup.contains(event.target as Node)) return;\n\n if (this.props.isPinned) return;\n\n if (\n !this.props.closeOnNestedPopupOutsideClick &&\n this.isInCorePopup(event.target as HTMLElement)\n )\n return;\n\n if (this.props.onOutsideClick) return this.props.onOutsideClick(event);\n\n if (this.props.target && this.props.target.contains(event.target as Node))\n return;\n\n this._onClose();\n };\n\n private _handleContextMenu = (event: MouseEvent) => {\n if (this._popup && this._popup.contains(event.target as Node)) return;\n\n if (this.props.onContextMenu) return this.props.onContextMenu(event);\n\n const closeOnContextMenu =\n this.props.closeOnContextMenu !== undefined\n ? this.props.closeOnContextMenu\n : true;\n if (closeOnContextMenu) this._hide();\n };\n\n private _handleKeyboard = (event: KeyboardEvent): void => {\n if (this.props.isPinned) return;\n\n if (\n event.key === Key.Escape.valueOf() ||\n event.key === Key.Enter.valueOf()\n ) {\n const closeOnEnter =\n this.props.closeOnEnter !== undefined ? this.props.closeOnEnter : true;\n if (event.key === Key.Enter.valueOf()) {\n if (closeOnEnter) this._onClose(true);\n else this.props.onEnter && this.props.onEnter();\n } else {\n this._onClose(false);\n }\n }\n };\n\n private _resize = () => {\n if (this.props.repositionOnResize) {\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n this.setState({ left: point.x, top: point.y, position });\n } else {\n this._hide(); // legacy behavior\n }\n };\n\n private _hide = () => {\n if (this.props.isPinned) return;\n\n this._onClose();\n };\n\n private _onShow() {\n this._bindWindowEvents();\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n\n this.setState(\n { left: point.x, top: point.y, isOpen: true, position },\n () => {\n if (this.props.onOpen) this.props.onOpen();\n }\n );\n }\n\n private _onClose(enterKey?: boolean) {\n if (!this.state.isOpen) return;\n\n this._unBindWindowEvents();\n\n this.setState({ isOpen: false }, () => {\n if (enterKey && this.props.onEnter) this.props.onEnter();\n if (this.props.onClose) this.props.onClose();\n });\n }\n\n private _isPositionAbsolute(): boolean {\n return this.props.top !== -1 && this.props.left !== -1;\n }\n\n private _getClassNameByPosition(position: RelativePosition): string {\n if (!this._isPositionAbsolute()) {\n switch (position) {\n case RelativePosition.TopLeft:\n return \"core-popup-top-left\";\n case RelativePosition.TopRight:\n return \"core-popup-top-right\";\n case RelativePosition.BottomLeft:\n return \"core-popup-bottom-left\";\n case RelativePosition.BottomRight:\n return \"core-popup-bottom-right\";\n case RelativePosition.Top:\n return \"core-popup-top\";\n case RelativePosition.Left:\n return \"core-popup-left\";\n case RelativePosition.Right:\n return \"core-popup-right\";\n case RelativePosition.Bottom:\n return \"core-popup-bottom\";\n case RelativePosition.LeftTop:\n return \"core-popup-left-top\";\n case RelativePosition.RightTop:\n return \"core-popup-right-top\";\n }\n }\n\n return \"\";\n }\n\n private _getPopupDimensions(): { popupWidth: number; popupHeight: number } {\n let popupWidth = 0;\n let popupHeight = 0;\n // istanbul ignore else\n if (this._popup) {\n const activeWindow = this.getParentWindow();\n const style = activeWindow.getComputedStyle(this._popup);\n const borderLeftWidth = parsePxString(style.borderLeftWidth);\n const borderRightWidth = parsePxString(style.borderRightWidth);\n const borderTopWidth = parsePxString(style.borderTopWidth);\n const borderBottomWidth = parsePxString(style.borderBottomWidth);\n popupWidth = this._popup.clientWidth + borderLeftWidth + borderRightWidth;\n popupHeight =\n this._popup.clientHeight + borderTopWidth + borderBottomWidth;\n }\n\n return { popupWidth, popupHeight };\n }\n\n private _getPosition = (position: RelativePosition) => {\n const activeWindow = this.getParentWindow();\n const { target, offset, top, left } = this.props;\n const offsetArrow = this.props.showArrow ? 6 : 0;\n\n // absolute position\n if (this._isPositionAbsolute()) return { x: left, y: top };\n\n // sanity check\n const point = { x: 0, y: 0 };\n if (!this._popup || !target) return point;\n\n // relative position\n const scrollY = activeWindow.scrollY;\n const scrollX = activeWindow.scrollX;\n\n const container = this.getContainer();\n const containerBounds = container.getBoundingClientRect();\n const targetRect = Rectangle.create(target.getBoundingClientRect()).offset({\n x: -containerBounds.left,\n y: -containerBounds.top,\n });\n\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n\n switch (position) {\n case RelativePosition.Top:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x =\n scrollX +\n targetRect.left +\n targetRect.getWidth() / 2 -\n popupWidth / 2;\n break;\n\n case RelativePosition.TopLeft:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x = scrollX + targetRect.left;\n break;\n\n case RelativePosition.TopRight:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x = scrollX + targetRect.right - popupWidth;\n break;\n\n case RelativePosition.Bottom:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x =\n scrollX +\n targetRect.left +\n targetRect.getWidth() / 2 -\n popupWidth / 2;\n break;\n\n case RelativePosition.BottomLeft:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x = scrollX + targetRect.left;\n break;\n\n case RelativePosition.BottomRight:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x = scrollX + targetRect.right - popupWidth;\n break;\n\n case RelativePosition.Left:\n point.y =\n scrollY +\n targetRect.top +\n targetRect.getHeight() / 2 -\n popupHeight / 2;\n point.x = scrollX + targetRect.left - popupWidth - offset - offsetArrow;\n break;\n\n case RelativePosition.LeftTop:\n point.y = scrollY + targetRect.top;\n point.x = scrollX + targetRect.left - popupWidth - offset - offsetArrow;\n break;\n\n case RelativePosition.Right:\n point.y =\n scrollY +\n targetRect.top +\n targetRect.getHeight() / 2 -\n popupHeight / 2;\n point.x = scrollX + targetRect.right + offset + offsetArrow;\n break;\n\n case RelativePosition.RightTop:\n point.y = scrollY + targetRect.top;\n point.x = scrollX + targetRect.right + offset + offsetArrow;\n break;\n }\n\n return point;\n };\n\n private _toggleRelativePosition(): RelativePosition {\n const { target, position, offset } = this.props;\n\n if (!this._popup || !target) return position;\n\n // istanbul ignore if\n if (this._isPositionAbsolute()) return position;\n\n let newPosition = position;\n\n interface Rect {\n left: number;\n top: number;\n right: number;\n bottom: number;\n }\n\n const activeWindow = this.getParentWindow();\n\n // Note: Cannot use DOMRect yet since it's experimental and not available in all browsers (Nov. 2018)\n const viewportRect: Rect = {\n left: activeWindow.scrollX,\n top: activeWindow.scrollY,\n right: activeWindow.scrollX + activeWindow.innerWidth,\n bottom: activeWindow.scrollY + activeWindow.innerHeight,\n };\n const targetRect = target.getBoundingClientRect();\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n const containerStyle = activeWindow.getComputedStyle(target);\n const offsetArrow = this.props.showArrow\n ? /* istanbul ignore next */ 10\n : 2;\n\n const bottomMargin = parseMargin(containerStyle.marginBottom);\n if (\n targetRect.bottom + popupHeight + bottomMargin + offsetArrow + offset >\n viewportRect.bottom\n ) {\n if (newPosition === RelativePosition.Bottom)\n newPosition = RelativePosition.Top;\n else if (newPosition === RelativePosition.BottomLeft)\n newPosition = RelativePosition.TopLeft;\n else if (newPosition === RelativePosition.BottomRight)\n newPosition = RelativePosition.TopRight;\n }\n\n const topMargin = parseMargin(containerStyle.marginTop);\n if (\n targetRect.top - popupHeight - topMargin - offsetArrow - offset <\n viewportRect.top\n ) {\n if (newPosition === RelativePosition.Top)\n newPosition = RelativePosition.Bottom;\n else if (newPosition === RelativePosition.TopLeft)\n newPosition = RelativePosition.BottomLeft;\n else if (newPosition === RelativePosition.TopRight)\n newPosition = RelativePosition.BottomRight;\n }\n\n const leftMargin = parseMargin(containerStyle.marginLeft);\n if (\n targetRect.left - popupWidth - leftMargin - offsetArrow - offset <\n viewportRect.left\n ) {\n if (newPosition === RelativePosition.Left)\n newPosition = RelativePosition.Right;\n else if (newPosition === RelativePosition.LeftTop)\n newPosition = RelativePosition.RightTop;\n }\n\n const rightMargin = parseMargin(containerStyle.marginRight);\n if (\n targetRect.right + popupWidth + rightMargin + offsetArrow + offset >\n viewportRect.right\n ) {\n if (newPosition === RelativePosition.Right)\n newPosition = RelativePosition.Left;\n else if (newPosition === RelativePosition.RightTop)\n newPosition = RelativePosition.LeftTop;\n }\n\n return newPosition;\n }\n\n // fit the popup within the extents of the view port\n private _fitPopup = (point: PopupPoint) => {\n const fittedPoint = point;\n\n // istanbul ignore if\n if (!this._popup) {\n return fittedPoint;\n }\n\n // const popupRect = this._popup.getBoundingClientRect();\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n const { innerWidth, innerHeight } = window;\n\n // istanbul ignore if\n if (fittedPoint.y + popupHeight > innerHeight) {\n fittedPoint.y = innerHeight - popupHeight;\n }\n\n // istanbul ignore if\n if (fittedPoint.x + popupWidth > innerWidth) {\n fittedPoint.x = innerWidth - popupWidth;\n }\n\n // istanbul ignore if\n if (fittedPoint.y < 0) {\n fittedPoint.y = 0;\n }\n\n if (fittedPoint.x < 0) {\n fittedPoint.x = 0;\n }\n\n return fittedPoint;\n };\n\n private _handleAnimationEnd = (\n event: React.AnimationEvent<HTMLDivElement>\n ) => {\n if (event.target === this._popup) {\n this.setState({ animationEnded: true });\n }\n };\n\n public override render() {\n const animate =\n this.props.animate !== undefined ? this.props.animate : true;\n const className = classnames(\n \"core-popup\",\n this._getClassNameByPosition(this.state.position),\n this.props.showShadow && \"core-popup-shadow\",\n this.props.showArrow && \"arrow\",\n !animate && \"core-popup-animation-none\",\n this.props.className,\n this.state.animationEnded && \"core-animation-ended\",\n !this.props.isOpen &&\n this.props.keepContentsMounted &&\n \"core-popup-hidden\"\n );\n\n const style: React.CSSProperties = {\n top: this.state.top,\n left: this.state.left,\n ...this.props.style,\n };\n\n const role = this.props.role ? this.props.role : \"dialog\"; // accessibility property\n\n if (!this.props.isOpen && !this.props.keepContentsMounted) {\n return null;\n }\n\n return ReactDOM.createPortal(\n <div\n className={className}\n data-testid=\"core-popup\"\n ref={(element) => {\n this._popup = element;\n }}\n style={style}\n role={role}\n aria-modal={true}\n tabIndex={-1}\n aria-label={this.props.ariaLabel}\n onAnimationEnd={this._handleAnimationEnd}\n >\n <FocusTrap\n active={!!this.props.moveFocus}\n initialFocusElement={this.props.focusTarget}\n returnFocusOnDeactivate={true}\n >\n {this.props.children}\n </FocusTrap>\n </div>,\n this.getContainer()\n );\n }\n\n private getContainer() {\n // istanbul ignore next\n return (\n this.state.parentDocument.body.querySelector(\n '[data-root-container=\"appui-root-id\"]'\n ) ?? this.state.parentDocument.body\n );\n }\n}\n\nfunction parsePxString(pxStr: string): number {\n const parsed = parseInt(pxStr, 10);\n return parsed || 0;\n}\n\nfunction parseMargin(value: string) {\n return value ? /* istanbul ignore next */ parseFloat(value) : 0;\n}\n"]}