@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
@@ -1 +1 @@
1
- {"version":3,"file":"ElementSeparator.js","sourceRoot":"","sources":["../../../../src/core-react/elementseparator/ElementSeparator.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAkCnD,SAAS,wBAAwB,CAC/B,WAAwB,EACxB,CAAoC;IAEpC,OAAO,WAAW,KAAK,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACxE,CAAC;AAED,MAAM,qBAAqB,GAAG,CAAC,SAAkB,EAAE,OAAmB,EAAE,EAAE;IACxE,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAE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S,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,GACxE,iCAAiC,CAAC,KAAK,CAAC,CAAC;IAE3C,MAAM,aAAa,GAAG,SAAS,IAAI,SAAS,CAAC;IAC7C,IAAI,CAAC,gBAAgB,IAAI,aAAa;QAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAE3E,iEAAiE;IACjE,MAAM,YAAY,GAAG,gBAAgB;QACnC,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,UAAU,GAAG,UAAU,CAC3B,wBAAwB,EACxB,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,UAAU;QAC1C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,kCAAkC,EACtC,KAAK,CAAC,SAAS,EACf,aAAa,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,YAAY,CACtE,CAAC;IAEF,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;IACtC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IAC1C,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,EAC1C,CAAC,WAAW,EAAE,aAAa,CAAC,CAC7B,CAAC;IACF,MAAM,MAAM,GAAwB;QAClC,GAAG,KAAK;QACR,GAAG,KAAK,CAAC,KAAK;KACf,CAAC;IAEF,OAAO,CACL,gCACE,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,EACrB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,gBACd,SAAS,CAAC,wBAAwB,CAAC,GAC/C,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementSeparator\n */\n\nimport \"./ElementSeparator.scss\";\nimport * as React from \"react\";\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport classnames from \"classnames\";\nimport { Orientation } from \"../enums/Orientation\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { useThrottledFn } from \"../utils/hooks/useThrottledFn\";\nimport { useTranslation } from \"../useTranslation\";\n\n/**\n * Results returned by onRatioChanged callback for determining new ratio and whether the ratio was updated.\n * @public\n */\nexport interface RatioChangeResult {\n ratio: number;\n}\n\n/** Properties of [[ElementSeparator]] React component\n * @public\n */\nexport interface ElementSeparatorProps extends CommonProps {\n /** Separator orientation */\n orientation: Orientation;\n /** Ratio between left cell and right cell */\n ratio: number;\n /** Area width or height (depending on orientation) in pixels */\n movableArea?: number;\n /** Separator width or height in pixels. 30 by default */\n separatorSize?: number;\n /** Callback to ratio changed event */\n onRatioChanged?: (ratio: number) => void | RatioChangeResult;\n /** Is resize handle hovered */\n isResizeHandleHovered?: boolean;\n /** Callback to hover event change */\n onResizeHandleHoverChanged?: (isHovered: boolean) => void;\n /** Is resize handle being dragged */\n isResizeHandleBeingDragged?: boolean;\n /** Callback to drag event change */\n onResizeHandleDragChanged?: (isDragStarted: boolean) => void;\n}\n\nfunction getCurrentGlobalPosition(\n orientation: Orientation,\n e: PointerEvent | React.PointerEvent\n) {\n return orientation === Orientation.Horizontal ? e.clientX : e.clientY;\n}\n\nconst useConditionalCleanup = (condition: boolean, cleanup: () => void) => {\n const conditionRef = useRef(condition);\n const cleanupRef = useRef(cleanup);\n\n conditionRef.current = condition;\n cleanupRef.current = cleanup;\n\n useEffect(() => {\n return () => {\n if (conditionRef.current) cleanupRef.current();\n };\n }, []);\n};\n\nconst useElementSeparatorPointerHandler = ({\n onResizeHandleDragChanged,\n onResizeHandleHoverChanged,\n isResizeHandleBeingDragged,\n isResizeHandleHovered,\n movableArea,\n ratio,\n orientation,\n onRatioChanged,\n}: ElementSeparatorProps) => {\n const globalPosition = useRef(0);\n const pointerOutOfBounds = useRef(false);\n\n const [isElementDragged, setIsDragged] = useState(false);\n const [isElementHovered, setIsHovered] = useState(false);\n const isGroupDragged = isResizeHandleBeingDragged ?? isElementDragged;\n const isGroupHovered = isResizeHandleHovered ?? isElementHovered;\n\n useConditionalCleanup(isElementDragged && !!onResizeHandleDragChanged, () =>\n onResizeHandleDragChanged!(false)\n );\n useConditionalCleanup(isElementHovered && !!onResizeHandleHoverChanged, () =>\n onResizeHandleHoverChanged!(false)\n );\n\n if (isGroupHovered && pointerOutOfBounds.current)\n pointerOutOfBounds.current = false;\n\n const stopDrag = useCallback(() => {\n // istanbul ignore else\n if (isGroupDragged) {\n setIsDragged(false);\n if (onResizeHandleDragChanged) onResizeHandleDragChanged(false);\n }\n }, [isGroupDragged, onResizeHandleDragChanged]);\n\n const startDrag = useCallback(\n (e: PointerEvent | React.PointerEvent) => {\n globalPosition.current = getCurrentGlobalPosition(orientation, e);\n\n // istanbul ignore else\n if (!isGroupDragged) {\n setIsDragged(true);\n if (onResizeHandleDragChanged) onResizeHandleDragChanged(true);\n }\n },\n [isGroupDragged, orientation, onResizeHandleDragChanged]\n );\n\n const onPointerUp = useCallback(() => {\n stopDrag();\n }, [stopDrag]);\n\n const onThrottledPointerMove = useThrottledFn(\n (e: PointerEvent | React.PointerEvent) => {\n if (!movableArea) {\n stopDrag();\n return;\n }\n\n const currentPosition = getCurrentGlobalPosition(orientation, e);\n const positionChange = currentPosition - globalPosition.current;\n\n // Should not need to recalculate if position on our movement axis does not change\n if (Math.abs(positionChange) < 1) return;\n\n const currentLocalPosition = movableArea * ratio + positionChange;\n const newRatio = currentLocalPosition / movableArea;\n\n globalPosition.current = currentPosition;\n if (pointerOutOfBounds.current || !onRatioChanged) return;\n\n const result = onRatioChanged(newRatio);\n if (\n result &&\n result.ratio === ratio &&\n !isGroupHovered &&\n !pointerOutOfBounds.current\n )\n pointerOutOfBounds.current = true;\n },\n 16,\n [stopDrag, isGroupHovered, ratio, movableArea, onRatioChanged, orientation]\n );\n\n useEffect(() => {\n return () => onThrottledPointerMove.cancel();\n }, [onThrottledPointerMove]);\n\n useLayoutEffect(() => {\n if (isElementDragged) {\n document.addEventListener(\"pointerup\", onPointerUp);\n document.addEventListener(\"pointermove\", onThrottledPointerMove);\n }\n\n return () => {\n document.removeEventListener(\"pointerup\", onPointerUp);\n document.removeEventListener(\"pointermove\", onThrottledPointerMove);\n };\n }, [isElementDragged, onPointerUp, onThrottledPointerMove]);\n\n const onPointerDown = useCallback(\n (e: PointerEvent | React.PointerEvent) => {\n if (!isGroupDragged) {\n startDrag(e);\n } else {\n stopDrag();\n }\n },\n [isGroupDragged, startDrag, stopDrag]\n );\n\n const onPointerOver = useCallback(() => {\n // istanbul ignore next\n if (isGroupHovered) return;\n\n setIsHovered(true);\n if (onResizeHandleHoverChanged) onResizeHandleHoverChanged(true);\n }, [isGroupHovered, onResizeHandleHoverChanged]);\n\n const onPointerOut = useCallback(() => {\n // istanbul ignore next\n if (!isGroupHovered) return;\n\n setIsHovered(false);\n if (onResizeHandleHoverChanged) onResizeHandleHoverChanged(false);\n }, [isGroupHovered, onResizeHandleHoverChanged]);\n\n return {\n isHovered: isGroupHovered,\n isDragged: isGroupDragged,\n onPointerDown,\n onPointerOver,\n onPointerOut,\n };\n};\n\nfunction getStyle(\n orientation: Orientation,\n separatorSize?: number\n): React.CSSProperties {\n separatorSize = separatorSize || 30;\n\n if (orientation === Orientation.Horizontal)\n return {\n width: separatorSize,\n margin: `0px ${-Math.floor(separatorSize / 2)}px`,\n };\n return {\n height: separatorSize,\n margin: `${-Math.floor(separatorSize / 2)}px 1px`,\n };\n}\n\n/** A movable button, which allows to change the ratio between left element and right element\n * @public\n */\nexport const ElementSeparator = (props: ElementSeparatorProps) => {\n const { translate } = useTranslation();\n\n const [hasHoverHappened, setHasHoverHappened] = useState(false);\n const { isDragged, isHovered, onPointerDown, onPointerOver, onPointerOut } =\n useElementSeparatorPointerHandler(props);\n\n const isHoverNeeded = isHovered || isDragged;\n if (!hasHoverHappened && isHoverNeeded) setHasHoverHappened(isHoverNeeded);\n\n // This is done to avoid fade-out animation when first rendering.\n const unhoverClass = hasHoverHappened\n ? \"core-element-separator-group-unhovered\"\n : \"\";\n\n const classNames = classnames(\n \"core-element-separator\",\n props.orientation === Orientation.Horizontal\n ? \"core-element-separator--horizontal\"\n : \"core-element-separator--vertical\",\n props.className,\n isHoverNeeded ? \"core-element-separator-group-hovered\" : unhoverClass\n );\n\n const orientation = props.orientation;\n const separatorSize = props.separatorSize;\n const style = useMemo(\n () => getStyle(orientation, separatorSize),\n [orientation, separatorSize]\n );\n const styles: React.CSSProperties = {\n ...style,\n ...props.style,\n };\n\n return (\n <button\n style={styles}\n className={classNames}\n onPointerDown={onPointerDown}\n onPointerOver={onPointerOver}\n onPointerOut={onPointerOut}\n aria-label={translate(\"elementSeparator.label\")}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"ElementSeparator.js","sourceRoot":"","sources":["../../../../src/core-react/elementseparator/ElementSeparator.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAoCxD,SAAS,wBAAwB,CAC/B,WAAwB,EACxB,CAAoC;IAEpC,OAAO,WAAW,KAAK,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CA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ACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementSeparator\n */\n\nimport \"./ElementSeparator.scss\";\nimport * as React from \"react\";\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport classnames from \"classnames\";\nimport { Orientation } from \"../enums/Orientation\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { useThrottledFn } from \"../utils/hooks/useThrottledFn\";\nimport { useTranslation } from \"../l10n/useTranslation\";\n\n/** Results returned by onRatioChanged callback for determining new ratio and whether the ratio was updated.\n * @public\n * @deprecated in 4.12.x. Interface used in a deprecated component {@link ElementSeparator}.\n */\nexport interface RatioChangeResult {\n ratio: number;\n}\n\n/** Properties of [[ElementSeparator]] React component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link ElementSeparator}.\n */\nexport interface ElementSeparatorProps extends CommonProps {\n /** Separator orientation */\n orientation: Orientation;\n /** Ratio between left cell and right cell */\n ratio: number;\n /** Area width or height (depending on orientation) in pixels */\n movableArea?: number;\n /** Separator width or height in pixels. 30 by default */\n separatorSize?: number;\n /** Callback to ratio changed event */\n // eslint-disable-next-line deprecation/deprecation\n onRatioChanged?: (ratio: number) => void | RatioChangeResult;\n /** Is resize handle hovered */\n isResizeHandleHovered?: boolean;\n /** Callback to hover event change */\n onResizeHandleHoverChanged?: (isHovered: boolean) => void;\n /** Is resize handle being dragged */\n isResizeHandleBeingDragged?: boolean;\n /** Callback to drag event change */\n onResizeHandleDragChanged?: (isDragStarted: boolean) => void;\n}\n\nfunction getCurrentGlobalPosition(\n orientation: Orientation,\n e: PointerEvent | React.PointerEvent\n) {\n return orientation === Orientation.Horizontal ? e.clientX : e.clientY;\n}\n\nconst useConditionalCleanup = (condition: boolean, cleanup: () => void) => {\n const conditionRef = useRef(condition);\n const cleanupRef = useRef(cleanup);\n\n conditionRef.current = condition;\n cleanupRef.current = cleanup;\n\n useEffect(() => {\n return () => {\n if (conditionRef.current) cleanupRef.current();\n };\n }, []);\n};\n\nconst useElementSeparatorPointerHandler = ({\n onResizeHandleDragChanged,\n onResizeHandleHoverChanged,\n isResizeHandleBeingDragged,\n isResizeHandleHovered,\n movableArea,\n ratio,\n orientation,\n onRatioChanged,\n}: // eslint-disable-next-line deprecation/deprecation\nElementSeparatorProps) => {\n const globalPosition = useRef(0);\n const pointerOutOfBounds = useRef(false);\n\n const [isElementDragged, setIsDragged] = useState(false);\n const [isElementHovered, setIsHovered] = useState(false);\n const isGroupDragged = isResizeHandleBeingDragged ?? isElementDragged;\n const isGroupHovered = isResizeHandleHovered ?? isElementHovered;\n\n useConditionalCleanup(isElementDragged && !!onResizeHandleDragChanged, () =>\n onResizeHandleDragChanged!(false)\n );\n useConditionalCleanup(isElementHovered && !!onResizeHandleHoverChanged, () =>\n onResizeHandleHoverChanged!(false)\n );\n\n if (isGroupHovered && pointerOutOfBounds.current)\n pointerOutOfBounds.current = false;\n\n const stopDrag = useCallback(() => {\n // istanbul ignore else\n if (isGroupDragged) {\n setIsDragged(false);\n if (onResizeHandleDragChanged) onResizeHandleDragChanged(false);\n }\n }, [isGroupDragged, onResizeHandleDragChanged]);\n\n const startDrag = useCallback(\n (e: PointerEvent | React.PointerEvent) => {\n globalPosition.current = getCurrentGlobalPosition(orientation, e);\n\n // istanbul ignore else\n if (!isGroupDragged) {\n setIsDragged(true);\n if (onResizeHandleDragChanged) onResizeHandleDragChanged(true);\n }\n },\n [isGroupDragged, orientation, onResizeHandleDragChanged]\n );\n\n const onPointerUp = useCallback(() => {\n stopDrag();\n }, [stopDrag]);\n\n const onThrottledPointerMove = useThrottledFn(\n (e: PointerEvent | React.PointerEvent) => {\n if (!movableArea) {\n stopDrag();\n return;\n }\n\n const currentPosition = getCurrentGlobalPosition(orientation, e);\n const positionChange = currentPosition - globalPosition.current;\n\n // Should not need to recalculate if position on our movement axis does not change\n if (Math.abs(positionChange) < 1) return;\n\n const currentLocalPosition = movableArea * ratio + positionChange;\n const newRatio = currentLocalPosition / movableArea;\n\n globalPosition.current = currentPosition;\n if (pointerOutOfBounds.current || !onRatioChanged) return;\n\n const result = onRatioChanged(newRatio);\n if (\n result &&\n result.ratio === ratio &&\n !isGroupHovered &&\n !pointerOutOfBounds.current\n )\n pointerOutOfBounds.current = true;\n },\n 16,\n [stopDrag, isGroupHovered, ratio, movableArea, onRatioChanged, orientation]\n );\n\n useEffect(() => {\n return () => onThrottledPointerMove.cancel();\n }, [onThrottledPointerMove]);\n\n useLayoutEffect(() => {\n if (isElementDragged) {\n document.addEventListener(\"pointerup\", onPointerUp);\n document.addEventListener(\"pointermove\", onThrottledPointerMove);\n }\n\n return () => {\n document.removeEventListener(\"pointerup\", onPointerUp);\n document.removeEventListener(\"pointermove\", onThrottledPointerMove);\n };\n }, [isElementDragged, onPointerUp, onThrottledPointerMove]);\n\n const onPointerDown = useCallback(\n (e: PointerEvent | React.PointerEvent) => {\n if (!isGroupDragged) {\n startDrag(e);\n } else {\n stopDrag();\n }\n },\n [isGroupDragged, startDrag, stopDrag]\n );\n\n const onPointerOver = useCallback(() => {\n // istanbul ignore next\n if (isGroupHovered) return;\n\n setIsHovered(true);\n if (onResizeHandleHoverChanged) onResizeHandleHoverChanged(true);\n }, [isGroupHovered, onResizeHandleHoverChanged]);\n\n const onPointerOut = useCallback(() => {\n // istanbul ignore next\n if (!isGroupHovered) return;\n\n setIsHovered(false);\n if (onResizeHandleHoverChanged) onResizeHandleHoverChanged(false);\n }, [isGroupHovered, onResizeHandleHoverChanged]);\n\n return {\n isHovered: isGroupHovered,\n isDragged: isGroupDragged,\n onPointerDown,\n onPointerOver,\n onPointerOut,\n };\n};\n\nfunction getStyle(\n orientation: Orientation,\n separatorSize?: number\n): React.CSSProperties {\n separatorSize = separatorSize || 30;\n\n if (orientation === Orientation.Horizontal)\n return {\n width: separatorSize,\n margin: `0px ${-Math.floor(separatorSize / 2)}px`,\n };\n return {\n height: separatorSize,\n margin: `${-Math.floor(separatorSize / 2)}px 1px`,\n };\n}\n\n/** A movable button, which allows to change the ratio between left element and right element\n * @public\n * @deprecated in 4.12.x. Basic components that need to be user-resized support this out of the box. Use {@link https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent pointer events} API to implement a custom resizer.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const ElementSeparator = (props: ElementSeparatorProps) => {\n const { translate } = useTranslation();\n\n const [hasHoverHappened, setHasHoverHappened] = useState(false);\n const { isDragged, isHovered, onPointerDown, onPointerOver, onPointerOut } =\n useElementSeparatorPointerHandler(props);\n\n const isHoverNeeded = isHovered || isDragged;\n if (!hasHoverHappened && isHoverNeeded) setHasHoverHappened(isHoverNeeded);\n\n // This is done to avoid fade-out animation when first rendering.\n const unhoverClass = hasHoverHappened\n ? \"core-element-separator-group-unhovered\"\n : \"\";\n\n const classNames = classnames(\n \"core-element-separator\",\n props.orientation === Orientation.Horizontal\n ? \"core-element-separator--horizontal\"\n : \"core-element-separator--vertical\",\n props.className,\n isHoverNeeded ? \"core-element-separator-group-hovered\" : unhoverClass\n );\n\n const orientation = props.orientation;\n const separatorSize = props.separatorSize;\n const style = useMemo(\n () => getStyle(orientation, separatorSize),\n [orientation, separatorSize]\n );\n const styles: React.CSSProperties = {\n ...style,\n ...props.style,\n };\n\n return (\n <button\n style={styles}\n className={classNames}\n onPointerDown={onPointerDown}\n onPointerOver={onPointerOver}\n onPointerOut={onPointerOut}\n aria-label={translate(\"elementSeparator.label\")}\n />\n );\n};\n"]}
@@ -5,6 +5,7 @@ import * as React from "react";
5
5
  import type { CommonProps } from "../utils/Props";
6
6
  /** Properties for [[ExpandableList]] component
7
7
  * @public
8
+ * @deprecated in 4.12.x. Props of deprecated component {@link ExpandableList}.
8
9
  */
9
10
  export interface ExpandableListProps extends CommonProps {
10
11
  /** Index of the default active block */
@@ -16,13 +17,12 @@ export interface ExpandableListProps extends CommonProps {
16
17
  /** Content */
17
18
  children?: React.ReactNode;
18
19
  }
19
- /** @internal */
20
20
  interface ExpandableListState {
21
21
  activeBlock: number;
22
22
  }
23
- /**
24
- * ExpandableList React component is a container for ExpandableBlock components.
23
+ /** ExpandableList React component is a container for ExpandableBlock components.
25
24
  * @public
25
+ * @deprecated in 4.12.x. Use a custom container and manage {@link https://itwinui.bentley.com/docs/expandableblock expandable block} state manually.
26
26
  */
27
27
  export declare class ExpandableList extends React.PureComponent<ExpandableListProps, ExpandableListState> {
28
28
  constructor(props: ExpandableListProps);
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandableList.d.ts","sourceRoot":"","sources":["../../../../src/core-react/expandable/ExpandableList.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iEAAiE;IACjE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,gBAAgB;AAChB,UAAU,mBAAmB;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK,CAAC,aAAa,CACrD,mBAAmB,EACnB,mBAAmB,CACpB;gBACa,KAAK,EAAE,mBAAmB;IAMtC,OAAc,YAAY,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAGtD;IAGF,OAAO,CAAC,kBAAkB,CAexB;IAEF,OAAO,CAAC,YAAY;IAYpB,gBAAgB;IACA,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;IASjD,MAAM,IAAI,KAAK,CAAC,YAAY;CAa7C"}
1
+ {"version":3,"file":"ExpandableList.d.ts","sourceRoot":"","sources":["../../../../src/core-react/expandable/ExpandableList.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iEAAiE;IACjE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,UAAU,mBAAmB;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK,CAAC,aAAa,CAErD,mBAAmB,EACnB,mBAAmB,CACpB;gBAEa,KAAK,EAAE,mBAAmB;IAOtC,OAAc,YAAY,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAGtD;IAGF,OAAO,CAAC,kBAAkB,CAexB;IAEF,OAAO,CAAC,YAAY;IAYpB,gBAAgB;IAEA,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;IASjD,MAAM,IAAI,KAAK,CAAC,YAAY;CAa7C"}
@@ -7,11 +7,12 @@
7
7
  */
8
8
  import classnames from "classnames";
9
9
  import * as React from "react";
10
- /**
11
- * ExpandableList React component is a container for ExpandableBlock components.
10
+ /** ExpandableList React component is a container for ExpandableBlock components.
12
11
  * @public
12
+ * @deprecated in 4.12.x. Use a custom container and manage {@link https://itwinui.bentley.com/docs/expandableblock expandable block} state manually.
13
13
  */
14
14
  class ExpandableList extends React.PureComponent {
15
+ // eslint-disable-next-line deprecation/deprecation
15
16
  constructor(props) {
16
17
  super(props);
17
18
  // set active block
@@ -39,6 +40,7 @@ class ExpandableList extends React.PureComponent {
39
40
  });
40
41
  }
41
42
  /** @internal */
43
+ // eslint-disable-next-line deprecation/deprecation
42
44
  componentDidUpdate(prevProps) {
43
45
  if (this.props.defaultActiveBlock !== prevProps.defaultActiveBlock &&
44
46
  this.props.defaultActiveBlock !== this.state.activeBlock) {
@@ -49,6 +51,7 @@ class ExpandableList extends React.PureComponent {
49
51
  return (React.createElement("div", { className: classnames("uicore-expandable-blocks-list", this.props.className), style: this.props.style }, this.renderBlocks()));
50
52
  }
51
53
  }
54
+ // eslint-disable-next-line deprecation/deprecation
52
55
  ExpandableList.defaultProps = {
53
56
  singleExpandOnly: false,
54
57
  defaultActiveBlock: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandableList.js","sourceRoot":"","sources":["../../../../src/core-react/expandable/ExpandableList.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B;;;GAGG;AACH,MAAa,cAAe,SAAQ,KAAK,CAAC,aAGzC;IACC,YAAY,KAA0B;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QAUf,mBAAmB;QACX,uBAAkB,GAAG,CAC3B,KAAa,EACb,QAAuC,EACvC,EAAE;YACF,IAAI,WAAW,GAAG,KAAK,CAAC;YAExB,IAAI,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,WAAW;gBACpE,WAAW,GAAG,CAAC,CAAC,CAAC;YAEnB,IAAI,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;YAE/B,uBAAuB;YACvB,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,oCAAoC;aACtE;QACH,CAAC,CAAC;QAxBA,I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AAiC;IACzD,gBAAgB,EAAE,KAAK;IACvB,kBAAkB,EAAE,CAAC;CACtB,AAHyB,CAGxB;SAbS,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 Expandable\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for [[ExpandableList]] component\n * @public\n */\nexport interface ExpandableListProps extends CommonProps {\n /** Index of the default active block */\n defaultActiveBlock?: number;\n /** Indicates whether to allow only one expanded block */\n singleExpandOnly?: boolean;\n /** Indicates whether the single expanded block is collapsible */\n singleIsCollapsible?: boolean;\n /** Content */\n children?: React.ReactNode;\n}\n\n/** @internal */\ninterface ExpandableListState {\n activeBlock: number;\n}\n\n/**\n * ExpandableList React component is a container for ExpandableBlock components.\n * @public\n */\nexport class ExpandableList extends React.PureComponent<\n ExpandableListProps,\n ExpandableListState\n> {\n constructor(props: ExpandableListProps) {\n super(props);\n\n this.state = { activeBlock: this.props.defaultActiveBlock! };\n }\n\n public static defaultProps: Partial<ExpandableListProps> = {\n singleExpandOnly: false,\n defaultActiveBlock: 0,\n };\n\n // set active block\n private _handleBlockToggle = (\n index: number,\n onToggle: (isExpanding: boolean) => any\n ) => {\n let activeBlock = index;\n\n if (this.props.singleIsCollapsible && index === this.state.activeBlock)\n activeBlock = -1;\n\n this.setState({ activeBlock });\n\n // istanbul ignore else\n if (onToggle) {\n onToggle(activeBlock === index); // fire the ExpandableBlock onToggle\n }\n };\n\n private renderBlocks() {\n return React.Children.map(this.props.children, (child: any, i) => {\n return React.cloneElement(child, {\n key: i,\n isExpanded: this.props.singleExpandOnly\n ? i === this.state.activeBlock\n : child.props.isExpanded,\n onToggle: this._handleBlockToggle.bind(this, i, child.props.onToggle),\n });\n });\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: ExpandableListProps) {\n if (\n this.props.defaultActiveBlock !== prevProps.defaultActiveBlock &&\n this.props.defaultActiveBlock !== this.state.activeBlock\n ) {\n this.setState((_, props) => ({ activeBlock: props.defaultActiveBlock! }));\n }\n }\n\n public override render(): React.ReactElement {\n return (\n <div\n className={classnames(\n \"uicore-expandable-blocks-list\",\n this.props.className\n )}\n style={this.props.style}\n >\n {this.renderBlocks()}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ExpandableList.js","sourceRoot":"","sources":["../../../../src/core-react/expandable/ExpandableList.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B;;;GAGG;AACH,MAAa,cAAe,SAAQ,KAAK,CAAC,aAIzC;IACC,mDAAmD;IACnD,YAAY,KAA0B;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QAWf,mBAAmB;QACX,uBAAkB,GAAG,CAC3B,KAAa,EACb,QAAuC,EACvC,EAAE;YACF,IAAI,WAAW,GAAG,KAAK,CAAC;YAExB,IAAI,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,WAAW;gBACpE,WAAW,GAAG,CAAC,CAAC,CAAC;YAEnB,IAAI,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;YAE/B,uBAAuB;YACvB,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,oCAAoC;aACtE;QACH,CAAC,CAAC;QAzBA,IAAI,CAAC,KAAK,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAmB,EAAE,CAAC;IAC/D,CAAC;IA0BO,YAAY;QAClB,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAU,EAAE,CAAC,EAAE,EAAE;YAC/D,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE;gBAC/B,GAAG,EAAE,CAAC;gBACN,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB;oBACrC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,WAAW;oBAC9B,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU;gBAC1B,QAAQ,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;aACtE,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB;IAChB,mDAAmD;IACnC,kBAAkB,CAAC,SAA8B;QAC/D,IACE,IAAI,CAAC,KAAK,CAAC,kBAAkB,KAAK,SAAS,CAAC,kBAAkB;YAC9D,IAAI,CAAC,KAAK,CAAC,kBAAkB,KAAK,IAAI,CAAC,KAAK,CAAC,WAAW,EACxD;YACA,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,kBAAmB,EAAE,CAAC,CAAC,CAAC;SAC3E;IACH,CAAC;IAEe,MAAM;QACpB,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CACnB,+BAA+B,EAC/B,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAEtB,IAAI,CAAC,YAAY,EAAE,CAChB,CACP,CAAC;IACJ,CAAC;;AA3DD,mDAAmD;AACrC,2BAAY,GAAiC;IACzD,gBAAgB,EAAE,KAAK;IACvB,kBAAkB,EAAE,CAAC;CACtB,AAHyB,CAGxB;SAhBS,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 Expandable\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for [[ExpandableList]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link ExpandableList}.\n */\nexport interface ExpandableListProps extends CommonProps {\n /** Index of the default active block */\n defaultActiveBlock?: number;\n /** Indicates whether to allow only one expanded block */\n singleExpandOnly?: boolean;\n /** Indicates whether the single expanded block is collapsible */\n singleIsCollapsible?: boolean;\n /** Content */\n children?: React.ReactNode;\n}\n\ninterface ExpandableListState {\n activeBlock: number;\n}\n\n/** ExpandableList React component is a container for ExpandableBlock components.\n * @public\n * @deprecated in 4.12.x. Use a custom container and manage {@link https://itwinui.bentley.com/docs/expandableblock expandable block} state manually.\n */\nexport class ExpandableList extends React.PureComponent<\n // eslint-disable-next-line deprecation/deprecation\n ExpandableListProps,\n ExpandableListState\n> {\n // eslint-disable-next-line deprecation/deprecation\n constructor(props: ExpandableListProps) {\n super(props);\n\n this.state = { activeBlock: this.props.defaultActiveBlock! };\n }\n\n // eslint-disable-next-line deprecation/deprecation\n public static defaultProps: Partial<ExpandableListProps> = {\n singleExpandOnly: false,\n defaultActiveBlock: 0,\n };\n\n // set active block\n private _handleBlockToggle = (\n index: number,\n onToggle: (isExpanding: boolean) => any\n ) => {\n let activeBlock = index;\n\n if (this.props.singleIsCollapsible && index === this.state.activeBlock)\n activeBlock = -1;\n\n this.setState({ activeBlock });\n\n // istanbul ignore else\n if (onToggle) {\n onToggle(activeBlock === index); // fire the ExpandableBlock onToggle\n }\n };\n\n private renderBlocks() {\n return React.Children.map(this.props.children, (child: any, i) => {\n return React.cloneElement(child, {\n key: i,\n isExpanded: this.props.singleExpandOnly\n ? i === this.state.activeBlock\n : child.props.isExpanded,\n onToggle: this._handleBlockToggle.bind(this, i, child.props.onToggle),\n });\n });\n }\n\n /** @internal */\n // eslint-disable-next-line deprecation/deprecation\n public override componentDidUpdate(prevProps: ExpandableListProps) {\n if (\n this.props.defaultActiveBlock !== prevProps.defaultActiveBlock &&\n this.props.defaultActiveBlock !== this.state.activeBlock\n ) {\n this.setState((_, props) => ({ activeBlock: props.defaultActiveBlock! }));\n }\n }\n\n public override render(): React.ReactElement {\n return (\n <div\n className={classnames(\n \"uicore-expandable-blocks-list\",\n this.props.className\n )}\n style={this.props.style}\n >\n {this.renderBlocks()}\n </div>\n );\n }\n}\n"]}
@@ -84,9 +84,8 @@ export const withOnOutsideClick = (Component, defaultOnOutsideClick, useCapture
84
84
  return defaultOnOutsideClick(e);
85
85
  }
86
86
  getParentDocument() {
87
- var _a, _b;
88
87
  // istanbul ignore next
89
- return (_b = (_a = this.outsideClickContainerDiv) === null || _a === void 0 ? void 0 : _a.ownerDocument) !== null && _b !== void 0 ? _b : document;
88
+ return this.outsideClickContainerDiv?.ownerDocument ?? document;
90
89
  }
91
90
  componentDidMount() {
92
91
  const outsideClickParentDocument = this.getParentDocument();
@@ -1 +1 @@
1
- {"version":3,"file":"withOnOutsideClick.js","sourceRoot":"","sources":["../../../../src/core-react/hocs/withOnOutsideClick.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,SAA8C,EAC9C,qBAAkD,EAClD,aAAsB,IAAI,EAC1B,mBAA4B,IAAI,EAChC,EAAE;IACF,OAAO,MAAM,kBAAmB,SAAQ,KAAK,CAAC,aAE7C;QAFM;;YAGL,gBAAgB;YACT,6BAAwB,GAA2B,IAAI,CAAC;YAC/D,gBAAgB;YACT,kBAAa,GAAG,KAAK,CAAC;YAiC7B,gBAAgB;YACT,wBAAmB,GAAG,CAAC,CAAa,EAAE,EAAE;gBAC7C,IACE,CAAC,IAAI,CAAC,wBAAwB;oBAC9B,CAAC,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ACF,0BAA0B,CAAC,gBAAgB,CACzC,WAAW,EACX,IAAI,CAAC,uBAAuB,EAC5B,UAAU,CACX,CAAC;aACH;;gBACC,0BAA0B,CAAC,gBAAgB,CACzC,OAAO,EACP,IAAI,CAAC,mBAAmB,EACxB,UAAU,CACX,CAAC;QACN,CAAC;QAED,gBAAgB;QACA,oBAAoB;YAClC,MAAM,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5D,IAAI,gBAAgB,EAAE;gBACpB,0BAA0B,CAAC,mBAAmB,CAC5C,aAAa,EACb,IAAI,CAAC,yBAAyB,EAC9B,UAAU,CACX,CAAC;gBACF,0BAA0B,CAAC,mBAAmB,CAC5C,WAAW,EACX,IAAI,CAAC,uBAAuB,EAC5B,UAAU,CACX,CAAC;aACH;;gBACC,0BAA0B,CAAC,mBAAmB,CAC5C,OAAO,EACP,IAAI,CAAC,mBAAmB,EACxB,UAAU,CACX,CAAC;QACN,CAAC;QAEe,MAAM;YACpB,MAAM,EAAE,cAAc,EAAE,8BAA8B,EAAE,GAAG,KAAK,EAAE,GAChE,IAAI,CAAC,KAAK,CAAC;YACb,OAAO,CACL,6BAAK,GAAG,EAAE,IAAI,CAAC,iCAAiC;gBAC9C,oBAAC,SAAS,OAAM,KAAwB,GAAI,CACxC,CACP,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport * as React from \"react\";\n\n/** Properties for [[withOnOutsideClick]] React higher-order component\n * @public\n */\nexport interface WithOnOutsideClickProps {\n /** Outside click callback function */\n onOutsideClick?: (event: MouseEvent) => any;\n /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */\n closeOnNestedPopupOutsideClick?: boolean;\n}\n\n/** withOnOutsideClick is a React higher-order component that adds outside click support.\n * @public\n */\nexport const withOnOutsideClick = <ComponentProps extends {}>(\n Component: React.ComponentType<ComponentProps>,\n defaultOnOutsideClick?: (event: MouseEvent) => any,\n useCapture: boolean = true,\n usePointerEvents: boolean = true\n) => {\n return class WithOnOutsideClick extends React.PureComponent<\n ComponentProps & WithOnOutsideClickProps\n > {\n /** @internal */\n public outsideClickContainerDiv?: HTMLDivElement | null = null;\n /** @internal */\n public isDownOutside = false;\n\n /** @internal */\n public 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 /** @internal */\n public onOutsideClick(e: MouseEvent) {\n // istanbul ignore else\n if (e.target instanceof Node && e.target.nodeType === Node.ELEMENT_NODE) {\n // istanbul ignore else\n if (\n !this.props.closeOnNestedPopupOutsideClick &&\n this.isInCorePopup(e.target as HTMLElement)\n )\n return;\n }\n\n if (this.props.onOutsideClick) return this.props.onOutsideClick(e);\n else if (defaultOnOutsideClick) return defaultOnOutsideClick(e);\n }\n\n /** @internal */\n public handleDocumentClick = (e: MouseEvent) => {\n if (\n !this.outsideClickContainerDiv ||\n !(e.target instanceof Node) ||\n this.outsideClickContainerDiv.contains(e.target)\n )\n return;\n\n return this.onOutsideClick(e);\n };\n\n /** @internal */\n public handleDocumentPointerDown = (e: PointerEvent) => {\n this.isDownOutside = true;\n // istanbul ignore else\n if (this.outsideClickContainerDiv) {\n // typically e.target test for instance of Node, but this is not working from pop out windows\n this.isDownOutside =\n !!e.target &&\n !this.outsideClickContainerDiv.contains(e.target as any);\n }\n };\n\n /** @internal */\n public handleDocumentPointerUp = (e: PointerEvent) => {\n let isUpOutside = true;\n // istanbul ignore else\n if (this.outsideClickContainerDiv) {\n // typically e.target test for instance of Node, but this is not working from pop out windows\n isUpOutside =\n !!e.target &&\n !this.outsideClickContainerDiv.contains(e.target as any);\n }\n\n const isOutsideClick = isUpOutside && this.isDownOutside;\n this.isDownOutside = false;\n isOutsideClick && this.onOutsideClick(e);\n };\n\n public handleOutsideClickContainerDivSet = (\n outsideClickContainerDiv: HTMLDivElement | null\n ) => {\n this.outsideClickContainerDiv = outsideClickContainerDiv;\n };\n\n public getParentDocument() {\n // istanbul ignore next\n return this.outsideClickContainerDiv?.ownerDocument ?? document;\n }\n\n public override componentDidMount() {\n const outsideClickParentDocument = this.getParentDocument();\n if (usePointerEvents) {\n outsideClickParentDocument.addEventListener(\n \"pointerdown\",\n this.handleDocumentPointerDown,\n useCapture\n );\n outsideClickParentDocument.addEventListener(\n \"pointerup\",\n this.handleDocumentPointerUp,\n useCapture\n );\n } else\n outsideClickParentDocument.addEventListener(\n \"click\",\n this.handleDocumentClick,\n useCapture\n );\n }\n\n /** @internal */\n public override componentWillUnmount() {\n const outsideClickParentDocument = this.getParentDocument();\n if (usePointerEvents) {\n outsideClickParentDocument.removeEventListener(\n \"pointerdown\",\n this.handleDocumentPointerDown,\n useCapture\n );\n outsideClickParentDocument.removeEventListener(\n \"pointerup\",\n this.handleDocumentPointerUp,\n useCapture\n );\n } else\n outsideClickParentDocument.removeEventListener(\n \"click\",\n this.handleDocumentClick,\n useCapture\n );\n }\n\n public override render() {\n const { onOutsideClick, closeOnNestedPopupOutsideClick, ...props } =\n this.props;\n return (\n <div ref={this.handleOutsideClickContainerDivSet}>\n <Component {...(props as ComponentProps)} />\n </div>\n );\n }\n };\n};\n"]}
1
+ {"version":3,"file":"withOnOutsideClick.js","sourceRoot":"","sources":["../../../../src/core-react/hocs/withOnOutsideClick.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,SAA8C,EAC9C,qBAAkD,EACl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gDM,iBAAiB;YACtB,uBAAuB;YACvB,OAAO,IAAI,CAAC,wBAAwB,EAAE,aAAa,IAAI,QAAQ,CAAC;QAClE,CAAC;QAEe,iBAAiB;YAC/B,MAAM,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5D,IAAI,gBAAgB,EAAE;gBACpB,0BAA0B,CAAC,gBAAgB,CACzC,aAAa,EACb,IAAI,CAAC,yBAAyB,EAC9B,UAAU,CACX,CAAC;gBACF,0BAA0B,CAAC,gBAAgB,CACzC,WAAW,EACX,IAAI,CAAC,uBAAuB,EAC5B,UAAU,CACX,CAAC;aACH;;gBACC,0BAA0B,CAAC,gBAAgB,CACzC,OAAO,EACP,IAAI,CAAC,mBAAmB,EACxB,UAAU,CACX,CAAC;QACN,CAAC;QAED,gBAAgB;QACA,oBAAoB;YAClC,MAAM,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5D,IAAI,gBAAgB,EAAE;gBACpB,0BAA0B,CAAC,mBAAmB,CAC5C,aAAa,EACb,IAAI,CAAC,yBAAyB,EAC9B,UAAU,CACX,CAAC;gBACF,0BAA0B,CAAC,mBAAmB,CAC5C,WAAW,EACX,IAAI,CAAC,uBAAuB,EAC5B,UAAU,CACX,CAAC;aACH;;gBACC,0BAA0B,CAAC,mBAAmB,CAC5C,OAAO,EACP,IAAI,CAAC,mBAAmB,EACxB,UAAU,CACX,CAAC;QACN,CAAC;QAEe,MAAM;YACpB,MAAM,EAAE,cAAc,EAAE,8BAA8B,EAAE,GAAG,KAAK,EAAE,GAChE,IAAI,CAAC,KAAK,CAAC;YACb,OAAO,CACL,6BAAK,GAAG,EAAE,IAAI,CAAC,iCAAiC;gBAC9C,oBAAC,SAAS,OAAM,KAAwB,GAAI,CACxC,CACP,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport * as React from \"react\";\n\n/** Properties for [[withOnOutsideClick]] React higher-order component\n * @public\n */\nexport interface WithOnOutsideClickProps {\n /** Outside click callback function */\n onOutsideClick?: (event: MouseEvent) => any;\n /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */\n closeOnNestedPopupOutsideClick?: boolean;\n}\n\n/** withOnOutsideClick is a React higher-order component that adds outside click support.\n * @public\n */\nexport const withOnOutsideClick = <ComponentProps extends {}>(\n Component: React.ComponentType<ComponentProps>,\n defaultOnOutsideClick?: (event: MouseEvent) => any,\n useCapture: boolean = true,\n usePointerEvents: boolean = true\n) => {\n return class WithOnOutsideClick extends React.PureComponent<\n ComponentProps & WithOnOutsideClickProps\n > {\n /** @internal */\n public outsideClickContainerDiv?: HTMLDivElement | null = null;\n /** @internal */\n public isDownOutside = false;\n\n /** @internal */\n public 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 /** @internal */\n public onOutsideClick(e: MouseEvent) {\n // istanbul ignore else\n if (e.target instanceof Node && e.target.nodeType === Node.ELEMENT_NODE) {\n // istanbul ignore else\n if (\n !this.props.closeOnNestedPopupOutsideClick &&\n this.isInCorePopup(e.target as HTMLElement)\n )\n return;\n }\n\n if (this.props.onOutsideClick) return this.props.onOutsideClick(e);\n else if (defaultOnOutsideClick) return defaultOnOutsideClick(e);\n }\n\n /** @internal */\n public handleDocumentClick = (e: MouseEvent) => {\n if (\n !this.outsideClickContainerDiv ||\n !(e.target instanceof Node) ||\n this.outsideClickContainerDiv.contains(e.target)\n )\n return;\n\n return this.onOutsideClick(e);\n };\n\n /** @internal */\n public handleDocumentPointerDown = (e: PointerEvent) => {\n this.isDownOutside = true;\n // istanbul ignore else\n if (this.outsideClickContainerDiv) {\n // typically e.target test for instance of Node, but this is not working from pop out windows\n this.isDownOutside =\n !!e.target &&\n !this.outsideClickContainerDiv.contains(e.target as any);\n }\n };\n\n /** @internal */\n public handleDocumentPointerUp = (e: PointerEvent) => {\n let isUpOutside = true;\n // istanbul ignore else\n if (this.outsideClickContainerDiv) {\n // typically e.target test for instance of Node, but this is not working from pop out windows\n isUpOutside =\n !!e.target &&\n !this.outsideClickContainerDiv.contains(e.target as any);\n }\n\n const isOutsideClick = isUpOutside && this.isDownOutside;\n this.isDownOutside = false;\n isOutsideClick && this.onOutsideClick(e);\n };\n\n public handleOutsideClickContainerDivSet = (\n outsideClickContainerDiv: HTMLDivElement | null\n ) => {\n this.outsideClickContainerDiv = outsideClickContainerDiv;\n };\n\n public getParentDocument() {\n // istanbul ignore next\n return this.outsideClickContainerDiv?.ownerDocument ?? document;\n }\n\n public override componentDidMount() {\n const outsideClickParentDocument = this.getParentDocument();\n if (usePointerEvents) {\n outsideClickParentDocument.addEventListener(\n \"pointerdown\",\n this.handleDocumentPointerDown,\n useCapture\n );\n outsideClickParentDocument.addEventListener(\n \"pointerup\",\n this.handleDocumentPointerUp,\n useCapture\n );\n } else\n outsideClickParentDocument.addEventListener(\n \"click\",\n this.handleDocumentClick,\n useCapture\n );\n }\n\n /** @internal */\n public override componentWillUnmount() {\n const outsideClickParentDocument = this.getParentDocument();\n if (usePointerEvents) {\n outsideClickParentDocument.removeEventListener(\n \"pointerdown\",\n this.handleDocumentPointerDown,\n useCapture\n );\n outsideClickParentDocument.removeEventListener(\n \"pointerup\",\n this.handleDocumentPointerUp,\n useCapture\n );\n } else\n outsideClickParentDocument.removeEventListener(\n \"click\",\n this.handleDocumentClick,\n useCapture\n );\n }\n\n public override render() {\n const { onOutsideClick, closeOnNestedPopupOutsideClick, ...props } =\n this.props;\n return (\n <div ref={this.handleOutsideClickContainerDivSet}>\n <Component {...(props as ComponentProps)} />\n </div>\n );\n }\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IconComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/icons/IconComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,sBAAsB,GACtB,KAAK,CAAC,SAAS,GACf,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAWD;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,4BA2EpC"}
1
+ {"version":3,"file":"IconComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/icons/IconComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,sBAAsB,GACtB,KAAK,CAAC,SAAS,GACf,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAWD;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,4BA6DpC"}
@@ -24,11 +24,9 @@ function getWebComponentSource(iconSpec) {
24
24
  export function Icon(props) {
25
25
  if (!props.iconSpec)
26
26
  return null;
27
- const iconString = typeof props.iconSpec === "string" ||
28
- props.iconSpec instanceof ConditionalStringValue
29
- ? ConditionalStringValue.getValue(props.iconSpec)
30
- : undefined;
31
- if (iconString) {
27
+ const iconSpecValue = getIconSpecValue(props.iconSpec);
28
+ if (typeof iconSpecValue === "string") {
29
+ const iconString = iconSpecValue;
32
30
  const webComponentString = getWebComponentSource(iconString);
33
31
  if (iconString.startsWith("data:") ||
34
32
  iconString.endsWith(".svg") ||
@@ -41,7 +39,7 @@ export function Icon(props) {
41
39
  // the esm build of dompurify has a default import but the cjs build does not
42
40
  // if there is a default export, use it (likely esm), otherwise use the namespace
43
41
  // istanbul ignore next
44
- const sanitizer = DOMPurify !== null && DOMPurify !== void 0 ? DOMPurify : DOMPurifyNS;
42
+ const sanitizer = DOMPurify ?? DOMPurifyNS;
45
43
  const sanitizerConfig = {
46
44
  ALLOWED_TAGS: ["svg-loader"],
47
45
  ADD_URI_SAFE_ATTR: definitiveIconString.startsWith("data:")
@@ -55,13 +53,25 @@ export function Icon(props) {
55
53
  React.createElement("div", { dangerouslySetInnerHTML: { __html: sanitizedIconString } }));
56
54
  return (React.createElement("i", { className: classnames("icon", "core-svg-icon", props.className) }, webComponentNode));
57
55
  }
56
+ // CSS icon
58
57
  return (React.createElement("i", { className: classnames("icon", iconString, props.className), style: props.style }));
59
58
  }
60
- if (ConditionalIconItem.isConditionalIconItem(props.iconSpec)) {
61
- return (React.createElement("i", { className: classnames("icon", "core-svg-icon", props.className), style: props.style }, ConditionalIconItem.getValue(props.iconSpec)));
59
+ // ReactNode icon
60
+ return (React.createElement("i", { className: classnames("icon", "core-svg-icon", props.className), style: props.style }, iconSpecValue));
61
+ }
62
+ function getIconSpecValue(iconSpec) {
63
+ let value = iconSpec;
64
+ while (true) {
65
+ if (ConditionalIconItem.isConditionalIconItem(value)) {
66
+ value = ConditionalIconItem.getValue(value);
67
+ continue;
68
+ }
69
+ if (value instanceof ConditionalStringValue) {
70
+ value = ConditionalStringValue.getValue(value);
71
+ break;
72
+ }
73
+ break;
62
74
  }
63
- return (React.createElement("i", { className: classnames("icon", "core-svg-icon", props.className), style: props.style }, props.iconSpec instanceof ConditionalStringValue
64
- ? undefined
65
- : props.iconSpec));
75
+ return value;
66
76
  }
67
77
  //# sourceMappingURL=IconComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconComponent.js","sourceRoot":"","sources":["../../../../src/core-react/icons/IconComponent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,SAAS,EAAE,KAAK,WAAW,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA0B5D,qDAAqD;AACrD,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACzD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAC1B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,IAAI,CAAC,KAAK,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,UAAU,GACd,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;QAClC,KAAK,CAAC,QAAQ,YAAY,sBAAsB;QAC9C,CAAC,CAAC,sBAAsB,CAA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AK,EAAE,KAAK,CAAC,KAAK,GAClB,CACH,CAAC;KACH;IAED,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;QAC7D,OAAO,CACL,2BACE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,EAC/D,KAAK,EAAE,KAAK,CAAC,KAAK,IAEjB,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC3C,CACL,CAAC;KACH;IAED,OAAO,CACL,2BACE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,EAC/D,KAAK,EAAE,KAAK,CAAC,KAAK,IAEjB,KAAK,CAAC,QAAQ,YAAY,sBAAsB;QAC/C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,KAAK,CAAC,QAAQ,CAChB,CACL,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Icon\n */\n\nimport \"./IconComponent.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"../utils/Props\";\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\nimport { ConditionalIconItem } from \"./ConditionalIconItem\";\n\n/** Prototype for an IconSpec which can be a string, ReactNode or ConditionalStringValue.\n * Strings are expected to be one of the following:\n * - Created by `IconSpecUtilities.createWebComponentIconSpec` in appui-abstract (deprecated).\n * - A URL to a SVG file (must end with \".svg\").\n * - A dataURI with MimeTypes `image/svg+xml` (ensure valid dataURI encoding) or `image/svg+xml;base64`;\n * - Anything else will be treated as a class name and be directly added to the `class` attribute.\n * @public\n */\nexport type IconSpec =\n | string\n | ConditionalStringValue\n | React.ReactNode\n | ConditionalIconItem;\n\n/** Properties for the [[Icon]] React component\n * @public\n */\nexport interface IconProps extends CommonProps {\n /** CSS class name or SvgPath for icon. This is optional because it is improperly\n * used to extend other interfaces and changing it would break existing API.\n */\n iconSpec?: IconSpec;\n}\n\n/** Get the SVG Source from an svg-loader IconSpec */\nfunction getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(\"webSvg:\") && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n}\n\n/** Icon Functional component displays an icon based on an [[IconSpec]].\n * @public\n */\nexport function Icon(props: IconProps) {\n if (!props.iconSpec) return null;\n\n const iconString =\n typeof props.iconSpec === \"string\" ||\n props.iconSpec instanceof ConditionalStringValue\n ? ConditionalStringValue.getValue(props.iconSpec)\n : undefined;\n\n if (iconString) {\n const webComponentString = getWebComponentSource(iconString);\n\n if (\n iconString.startsWith(\"data:\") ||\n iconString.endsWith(\".svg\") ||\n webComponentString\n ) {\n const definitiveIconString = webComponentString\n ? webComponentString\n : iconString;\n const svgLoader = `<svg-loader src=\"${definitiveIconString}\"></svg-loader>`;\n const svgDiv = `<div>${svgLoader}</div>`;\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;\n\n const sanitizerConfig = {\n ALLOWED_TAGS: [\"svg-loader\"],\n ADD_URI_SAFE_ATTR: definitiveIconString.startsWith(\"data:\")\n ? [\"src\"]\n : [],\n };\n\n const sanitizedIconString = sanitizer.sanitize(svgDiv, sanitizerConfig);\n const webComponentNode = (\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 <div dangerouslySetInnerHTML={{ __html: sanitizedIconString }}></div>\n );\n return (\n <i className={classnames(\"icon\", \"core-svg-icon\", props.className)}>\n {webComponentNode}\n </i>\n );\n }\n return (\n <i\n className={classnames(\"icon\", iconString, props.className)}\n style={props.style}\n />\n );\n }\n\n if (ConditionalIconItem.isConditionalIconItem(props.iconSpec)) {\n return (\n <i\n className={classnames(\"icon\", \"core-svg-icon\", props.className)}\n style={props.style}\n >\n {ConditionalIconItem.getValue(props.iconSpec)}\n </i>\n );\n }\n\n return (\n <i\n className={classnames(\"icon\", \"core-svg-icon\", props.className)}\n style={props.style}\n >\n {props.iconSpec instanceof ConditionalStringValue\n ? undefined\n : props.iconSpec}\n </i>\n );\n}\n"]}
1
+ {"version":3,"file":"IconComponent.js","sourceRoot":"","sources":["../../../../src/core-react/icons/IconComponent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,SAAS,EAAE,KAAK,WAAW,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA0B5D,qDAAqD;AACrD,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACzD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAC1B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,IAAI,CAAC,KAAK,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACrC,MAAM,UAAU,GAAG,aAAa,CAAC;QACjC,MAAM,kBAAkB,GAAG,qBAAqB,C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,SAAS,CAAC,EAC/D,KAAK,EAAE,KAAK,CAAC,KAAK,IAEjB,aAAa,CACZ,CACL,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CACvB,QAAkB;IAElB,IAAI,KAAK,GAAG,QAAQ,CAAC;IACrB,OAAO,IAAI,EAAE;QACX,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE;YACpD,KAAK,GAAG,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC5C,SAAS;SACV;QACD,IAAI,KAAK,YAAY,sBAAsB,EAAE;YAC3C,KAAK,GAAG,sBAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC/C,MAAM;SACP;QACD,MAAM;KACP;IACD,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 Icon\n */\n\nimport \"./IconComponent.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"../utils/Props\";\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\nimport { ConditionalIconItem } from \"./ConditionalIconItem\";\n\n/** Prototype for an IconSpec which can be a string, ReactNode or ConditionalStringValue.\n * Strings are expected to be one of the following:\n * - Created by `IconSpecUtilities.createWebComponentIconSpec` in appui-abstract (deprecated).\n * - A URL to a SVG file (must end with \".svg\").\n * - A dataURI with MimeTypes `image/svg+xml` (ensure valid dataURI encoding) or `image/svg+xml;base64`;\n * - Anything else will be treated as a class name and be directly added to the `class` attribute.\n * @public\n */\nexport type IconSpec =\n | string\n | ConditionalStringValue\n | React.ReactNode\n | ConditionalIconItem;\n\n/** Properties for the [[Icon]] React component\n * @public\n */\nexport interface IconProps extends CommonProps {\n /** CSS class name or SvgPath for icon. This is optional because it is improperly\n * used to extend other interfaces and changing it would break existing API.\n */\n iconSpec?: IconSpec;\n}\n\n/** Get the SVG Source from an svg-loader IconSpec */\nfunction getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(\"webSvg:\") && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n}\n\n/** Icon Functional component displays an icon based on an [[IconSpec]].\n * @public\n */\nexport function Icon(props: IconProps) {\n if (!props.iconSpec) return null;\n\n const iconSpecValue = getIconSpecValue(props.iconSpec);\n if (typeof iconSpecValue === \"string\") {\n const iconString = iconSpecValue;\n const webComponentString = getWebComponentSource(iconString);\n\n if (\n iconString.startsWith(\"data:\") ||\n iconString.endsWith(\".svg\") ||\n webComponentString\n ) {\n const definitiveIconString = webComponentString\n ? webComponentString\n : iconString;\n const svgLoader = `<svg-loader src=\"${definitiveIconString}\"></svg-loader>`;\n const svgDiv = `<div>${svgLoader}</div>`;\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;\n\n const sanitizerConfig = {\n ALLOWED_TAGS: [\"svg-loader\"],\n ADD_URI_SAFE_ATTR: definitiveIconString.startsWith(\"data:\")\n ? [\"src\"]\n : [],\n };\n\n const sanitizedIconString = sanitizer.sanitize(svgDiv, sanitizerConfig);\n const webComponentNode = (\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 <div dangerouslySetInnerHTML={{ __html: sanitizedIconString }}></div>\n );\n return (\n <i className={classnames(\"icon\", \"core-svg-icon\", props.className)}>\n {webComponentNode}\n </i>\n );\n }\n\n // CSS icon\n return (\n <i\n className={classnames(\"icon\", iconString, props.className)}\n style={props.style}\n />\n );\n }\n\n // ReactNode icon\n return (\n <i\n className={classnames(\"icon\", \"core-svg-icon\", props.className)}\n style={props.style}\n >\n {iconSpecValue}\n </i>\n );\n}\n\nfunction getIconSpecValue(\n iconSpec: IconSpec\n): Exclude<IconSpec, ConditionalIconItem | ConditionalStringValue> {\n let value = iconSpec;\n while (true) {\n if (ConditionalIconItem.isConditionalIconItem(value)) {\n value = ConditionalIconItem.getValue(value);\n continue;\n }\n if (value instanceof ConditionalStringValue) {\n value = ConditionalStringValue.getValue(value);\n break;\n }\n break;\n }\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 the [[ImageCheckBox]] component
8
8
  * @public
9
+ * @deprecated in 4.12.x. Props of deprecated component {@link ImageCheckBox}.
9
10
  */
10
11
  export interface ImageCheckBoxProps extends CommonProps {
11
12
  /** Image for the "checked" state */
@@ -29,9 +30,9 @@ export interface ImageCheckBoxProps extends CommonProps {
29
30
  /** Provides ability to return reference to HTMLInputElement */
30
31
  inputRef?: React.Ref<HTMLInputElement>;
31
32
  }
32
- /**
33
- * ImageCheckBox React component shows a checked or unchecked image
33
+ /** ImageCheckBox React component shows a checked or unchecked image
34
34
  * @public
35
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).
35
36
  */
36
37
  export declare class ImageCheckBox extends React.PureComponent<ImageCheckBoxProps> {
37
38
  private _onChange;
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCheckBox.d.ts","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,oCAAoC;IACpC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,gDAAg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AO,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,CAAC;IACpC,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACxC;AAED;;;GAGG;AAEH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxE,OAAO,CAAC,SAAS,CAQf;IAEF,OAAO,CAAC,aAAa,CAGnB;IAEF,OAAO,CAAC,aAAa,CAGnB;IAEF,gBAAgB;IACA,MAAM;CAqCvB"}
@@ -9,10 +9,11 @@ import "./ImageCheckBox.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
11
  import { Icon } from "../icons/IconComponent";
12
- /**
13
- * ImageCheckBox React component shows a checked or unchecked image
12
+ /** ImageCheckBox React component shows a checked or unchecked image
14
13
  * @public
14
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).
15
15
  */
16
+ // eslint-disable-next-line deprecation/deprecation
16
17
  export class ImageCheckBox extends React.PureComponent {
17
18
  constructor() {
18
19
  super(...arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCheckBox.js","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MA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zJ,+BACE,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAEzB,+BACE,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACpC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GACxB;YACF,8BAAM,SAAS,EAAE,UAAU;gBACzB,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACD,CACT,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 Checkbox\n */\n\nimport \"./ImageCheckBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for the [[ImageCheckBox]] component\n * @public\n */\nexport interface ImageCheckBoxProps extends CommonProps {\n /** Image for the \"checked\" state */\n imageOn: string | React.ReactNode;\n /** Image for the \"unchecked\" (default) state */\n imageOff: string | React.ReactNode;\n /** Determine if the item is checked or not */\n checked?: boolean;\n /** Determine if the item is disabled or not */\n disabled?: boolean;\n /** Function called when item is clicked. */\n onClick?: (checked: boolean) => any;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Tooltip to be displayed when mouse is hovered over the checkbox */\n tooltip?: string;\n /** If true, draw a border around the image checkbox */\n border?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n inputRef?: React.Ref<HTMLInputElement>;\n}\n\n/**\n * ImageCheckBox React component shows a checked or unchecked image\n * @public\n */\nexport class ImageCheckBox extends React.PureComponent<ImageCheckBoxProps> {\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n\n // istanbul ignore else\n if (this.props.onClick) {\n this.props.onClick(e.target.checked);\n }\n };\n\n private _onInputClick = (e: React.MouseEvent<HTMLInputElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n private _onLabelClick = (e: React.MouseEvent<HTMLLabelElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n /** @internal */\n public override render() {\n const checkBoxClass = classnames(\n \"core-image-checkbox\",\n this.props.className\n );\n const imageClass = classnames(\n \"image\",\n this.props.border && \"image-checkbox-border\"\n );\n const iconSpec = this.props.checked\n ? this.props.imageOn\n : this.props.imageOff;\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/label-has-associated-control, jsx-a11y/no-noninteractive-element-interactions\n <label\n className={checkBoxClass}\n style={this.props.style}\n onClick={this._onLabelClick}\n title={this.props.tooltip}\n >\n <input\n type=\"checkbox\"\n className={this.props.inputClassName}\n style={this.props.inputStyle}\n checked={this.props.checked}\n disabled={this.props.disabled}\n onChange={this._onChange}\n onClick={this._onInputClick}\n ref={this.props.inputRef}\n />\n <span className={imageClass}>\n <Icon iconSpec={iconSpec} />\n </span>\n </label>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ImageCheckBox.js","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;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I,CAAC,KAAK,CAAC,QAAQ,CAAC;QAExB,OAAO;QACL,yJAAyJ;QACzJ,+BACE,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAEzB,+BACE,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACpC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GACxB;YACF,8BAAM,SAAS,EAAE,UAAU;gBACzB,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACD,CACT,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 Checkbox\n */\n\nimport \"./ImageCheckBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for the [[ImageCheckBox]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link ImageCheckBox}.\n */\nexport interface ImageCheckBoxProps extends CommonProps {\n /** Image for the \"checked\" state */\n imageOn: string | React.ReactNode;\n /** Image for the \"unchecked\" (default) state */\n imageOff: string | React.ReactNode;\n /** Determine if the item is checked or not */\n checked?: boolean;\n /** Determine if the item is disabled or not */\n disabled?: boolean;\n /** Function called when item is clicked. */\n onClick?: (checked: boolean) => any;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Tooltip to be displayed when mouse is hovered over the checkbox */\n tooltip?: string;\n /** If true, draw a border around the image checkbox */\n border?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n inputRef?: React.Ref<HTMLInputElement>;\n}\n\n/** ImageCheckBox React component shows a checked or unchecked image\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class ImageCheckBox extends React.PureComponent<ImageCheckBoxProps> {\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n\n // istanbul ignore else\n if (this.props.onClick) {\n this.props.onClick(e.target.checked);\n }\n };\n\n private _onInputClick = (e: React.MouseEvent<HTMLInputElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n private _onLabelClick = (e: React.MouseEvent<HTMLLabelElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n /** @internal */\n public override render() {\n const checkBoxClass = classnames(\n \"core-image-checkbox\",\n this.props.className\n );\n const imageClass = classnames(\n \"image\",\n this.props.border && \"image-checkbox-border\"\n );\n const iconSpec = this.props.checked\n ? this.props.imageOn\n : this.props.imageOff;\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/label-has-associated-control, jsx-a11y/no-noninteractive-element-interactions\n <label\n className={checkBoxClass}\n style={this.props.style}\n onClick={this._onLabelClick}\n title={this.props.tooltip}\n >\n <input\n type=\"checkbox\"\n className={this.props.inputClassName}\n style={this.props.inputStyle}\n checked={this.props.checked}\n disabled={this.props.disabled}\n onChange={this._onChange}\n onClick={this._onInputClick}\n ref={this.props.inputRef}\n />\n <span className={imageClass}>\n <Icon iconSpec={iconSpec} />\n </span>\n </label>\n );\n }\n}\n"]}
@@ -6,6 +6,7 @@ import type { CommonProps } from "../utils/Props";
6
6
  import type { LabeledComponentProps, MessagedComponentProps } from "./LabeledComponentProps";
7
7
  /** Properties for [[InputLabel]] components
8
8
  * @public
9
+ * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.
9
10
  */
10
11
  export interface InputLabelProps extends LabeledComponentProps, MessagedComponentProps, CommonProps {
11
12
  disabled?: boolean;
@@ -14,6 +15,7 @@ export interface InputLabelProps extends LabeledComponentProps, MessagedComponen
14
15
  }
15
16
  /** Text input wrapper that provides additional styling and labeling
16
17
  * @public
18
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
17
19
  */
18
20
  export declare class InputLabel extends React.PureComponent<InputLabelProps> {
19
21
  render(): React.ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"InputLabel.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAQH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,eACf,SAAQ,qBAAqB,EAC3B,sBAAsB,EACtB,WAAW;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAQD;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC;IAClD,MAAM,IAAI,KAAK,CAAC,YAAY;CAiD7C"}
1
+ {"version":3,"file":"InputLabel.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAQH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,eAEf,SAAQ,qBAAqB,EAE3B,sBAAsB,EACtB,WAAW;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAWD;;;GAGG;AAEH,qBAAa,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC;IAClD,MAAM,IAAI,KAAK,CAAC,YAAY;CAiD7C"}
@@ -11,13 +11,18 @@ import * as React from "react";
11
11
  import { Icon } from "../icons/IconComponent";
12
12
  import { InputStatus } from "./InputStatus";
13
13
  const inputLabelIconSpec = {
14
+ // eslint-disable-next-line deprecation/deprecation
14
15
  [InputStatus.Error]: React.createElement(SvgStatusError, null),
16
+ // eslint-disable-next-line deprecation/deprecation
15
17
  [InputStatus.Success]: React.createElement(SvgStatusSuccess, null),
18
+ // eslint-disable-next-line deprecation/deprecation
16
19
  [InputStatus.Warning]: React.createElement(SvgStatusWarning, null),
17
20
  };
18
21
  /** Text input wrapper that provides additional styling and labeling
19
22
  * @public
23
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
20
24
  */
25
+ // eslint-disable-next-line deprecation/deprecation
21
26
  export class InputLabel extends React.PureComponent {
22
27
  render() {
23
28
  const { label, status, className, style, labelClassName, labelStyle, message, messageClassName, messageStyle, } = this.props;
@@ -1 +1 @@
1
- {"version":3,"file":"InputLabel.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;A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,EAAC,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAI,CACpE,CACG;YACL,OAAO,IAAI,CACV,6BACE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,IAElB,OAAO,CACJ,CACP,CACK,CACT,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 Inputs\n */\n\nimport {\n SvgStatusError,\n SvgStatusSuccess,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { InputStatus } from \"./InputStatus\";\nimport type {\n LabeledComponentProps,\n MessagedComponentProps,\n} from \"./LabeledComponentProps\";\n\n/** Properties for [[InputLabel]] components\n * @public\n */\nexport interface InputLabelProps\n extends LabeledComponentProps,\n MessagedComponentProps,\n CommonProps {\n disabled?: boolean;\n /** Labeled content */\n children?: React.ReactNode;\n}\n\nconst inputLabelIconSpec: { [key: string]: IconSpec } = {\n [InputStatus.Error]: <SvgStatusError />,\n [InputStatus.Success]: <SvgStatusSuccess />,\n [InputStatus.Warning]: <SvgStatusWarning />,\n};\n\n/** Text input wrapper that provides additional styling and labeling\n * @public\n */\nexport class InputLabel extends React.PureComponent<InputLabelProps> {\n public override render(): React.ReactElement {\n const {\n label,\n status,\n className,\n style,\n labelClassName,\n labelStyle,\n message,\n messageClassName,\n messageStyle,\n } = this.props;\n\n return (\n <label\n style={style}\n className={classnames(\n \"uicore-inputs-labeled-input\",\n this.props.disabled && \"uicore-disabled\",\n status,\n className\n )}\n >\n {label && (\n <div\n className={classnames(\"uicore-label\", labelClassName)}\n style={labelStyle}\n >\n {\" \"}\n {label}{\" \"}\n </div>\n )}\n <div className={classnames(\"input\", { \"with-icon\": !!status })}>\n {this.props.children}\n {status && (\n <Icon className=\"icon\" iconSpec={inputLabelIconSpec[`{status}`]} />\n )}\n </div>\n {message && (\n <div\n className={classnames(\"uicore-message\", messageClassName)}\n style={messageStyle}\n >\n {message}\n </div>\n )}\n </label>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"InputLabel.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAqB5C,MAAM,kBAAkB,GAAgC;IACtD,mDAAmD;IACnD,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,oBAAC,cAAc,OAAG;IACvC,mDAAmD;IACnD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,oBAAC,gBAAgB,OAAG;IAC3C,mDAAmD;IACnD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,oBAAC,gBAAgB,OAAG;CAC5C,CAAC;AAEF;;;GAGG;AACH,mDAAmD;AACnD,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAClD,MAAM;QACpB,MAAM,EACJ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,cAAc,EACd,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,YAAY,GACb,GAAG,IAAI,CAAC,KAAK,CAAC;QAEf,OAAO,CACL,+BACE,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CACnB,6BAA6B,EAC7B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,iBAAiB,EACxC,MAAM,EACN,SAAS,CACV;YAEA,KAAK,IAAI,CACR,6BACE,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC,EACrD,KAAK,EAAE,UAAU;gBAEhB,GAAG;gBACH,KAAK;gBAAE,GAAG,CACP,CACP;YACD,6BAAK,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC3D,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACnB,MAAM,IAAI,CACT,oBAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAI,CACpE,CACG;YACL,OAAO,IAAI,CACV,6BACE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,IAElB,OAAO,CACJ,CACP,CACK,CACT,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 Inputs\n */\n\nimport {\n SvgStatusError,\n SvgStatusSuccess,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { InputStatus } from \"./InputStatus\";\nimport type {\n LabeledComponentProps,\n MessagedComponentProps,\n} from \"./LabeledComponentProps\";\n\n/** Properties for [[InputLabel]] components\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.\n */\nexport interface InputLabelProps\n // eslint-disable-next-line deprecation/deprecation\n extends LabeledComponentProps,\n // eslint-disable-next-line deprecation/deprecation\n MessagedComponentProps,\n CommonProps {\n disabled?: boolean;\n /** Labeled content */\n children?: React.ReactNode;\n}\n\nconst inputLabelIconSpec: { [key: string]: IconSpec } = {\n // eslint-disable-next-line deprecation/deprecation\n [InputStatus.Error]: <SvgStatusError />,\n // eslint-disable-next-line deprecation/deprecation\n [InputStatus.Success]: <SvgStatusSuccess />,\n // eslint-disable-next-line deprecation/deprecation\n [InputStatus.Warning]: <SvgStatusWarning />,\n};\n\n/** Text input wrapper that provides additional styling and labeling\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class InputLabel extends React.PureComponent<InputLabelProps> {\n public override render(): React.ReactElement {\n const {\n label,\n status,\n className,\n style,\n labelClassName,\n labelStyle,\n message,\n messageClassName,\n messageStyle,\n } = this.props;\n\n return (\n <label\n style={style}\n className={classnames(\n \"uicore-inputs-labeled-input\",\n this.props.disabled && \"uicore-disabled\",\n status,\n className\n )}\n >\n {label && (\n <div\n className={classnames(\"uicore-label\", labelClassName)}\n style={labelStyle}\n >\n {\" \"}\n {label}{\" \"}\n </div>\n )}\n <div className={classnames(\"input\", { \"with-icon\": !!status })}>\n {this.props.children}\n {status && (\n <Icon className=\"icon\" iconSpec={inputLabelIconSpec[`{status}`]} />\n )}\n </div>\n {message && (\n <div\n className={classnames(\"uicore-message\", messageClassName)}\n style={messageStyle}\n >\n {message}\n </div>\n )}\n </label>\n );\n }\n}\n"]}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  /** Enum for Input status
5
5
  * @public
6
+ * @deprecated in 4.12.x. Enum used in a deprecated component {@link InputLabel}.
6
7
  */
7
8
  export declare enum InputStatus {
8
9
  Success = "success",
@@ -1 +1 @@
1
- {"version":3,"file":"InputStatus.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputStatus.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
1
+ {"version":3,"file":"InputStatus.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputStatus.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;;GAGG;AACH,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
@@ -7,6 +7,7 @@
7
7
  */
8
8
  /** Enum for Input status
9
9
  * @public
10
+ * @deprecated in 4.12.x. Enum used in a deprecated component {@link InputLabel}.
10
11
  */
11
12
  export var InputStatus;
12
13
  (function (InputStatus) {
@@ -1 +1 @@
1
- {"version":3,"file":"InputStatus.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputStatus.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB","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 Inputs\n */\n\n/** Enum for Input status\n * @public\n */\nexport enum InputStatus {\n Success = \"success\",\n Warning = \"warning\",\n Error = \"error\",\n}\n"]}
1
+ {"version":3,"file":"InputStatus.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputStatus.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB","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 Inputs\n */\n\nimport type { InputLabel } from \"./InputLabel\";\n\n/** Enum for Input status\n * @public\n * @deprecated in 4.12.x. Enum used in a deprecated component {@link InputLabel}.\n */\nexport enum InputStatus {\n Success = \"success\",\n Warning = \"warning\",\n Error = \"error\",\n}\n"]}
@@ -5,6 +5,7 @@ import type * as React from "react";
5
5
  import type { InputStatus } from "./InputStatus";
6
6
  /** Properties for labeled components
7
7
  * @public
8
+ * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.
8
9
  */
9
10
  export interface LabeledComponentProps {
10
11
  /** Text that will be shown next to or above the input. */
@@ -22,6 +23,7 @@ export interface LabeledComponentProps {
22
23
  }
23
24
  /** Properties for components with messages
24
25
  * @public
26
+ * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.
25
27
  */
26
28
  export interface MessagedComponentProps {
27
29
  /** Optional text shown below the input. */
@@ -1 +1 @@
1
- {"version":3,"file":"LabeledComponentProps.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/LabeledComponentProps.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC"}
1
+ {"version":3,"file":"LabeledComponentProps.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/LabeledComponentProps.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IAEzD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LabeledComponentProps.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/LabeledComponentProps.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 Inputs\n */\n\nimport type * as React from \"react\";\nimport type { InputStatus } from \"./InputStatus\";\n\n/** Properties for labeled components\n * @public\n */\nexport interface LabeledComponentProps {\n /** Text that will be shown next to or above the input. */\n label?: string;\n /** Input status like: \"Success\", \"Warning\" or \"Error\" */\n status?: InputStatus;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Custom CSS class name for the label */\n labelClassName?: string;\n /** Custom CSS Style for the label */\n labelStyle?: React.CSSProperties;\n}\n\n/** Properties for components with messages\n * @public\n */\nexport interface MessagedComponentProps {\n /** Optional text shown below the input. */\n message?: string;\n /** Custom CSS class name for the message */\n messageClassName?: string;\n /** Custom CSS Style for the message */\n messageStyle?: React.CSSProperties;\n}\n"]}
1
+ {"version":3,"file":"LabeledComponentProps.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/LabeledComponentProps.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 Inputs\n */\n\nimport type * as React from \"react\";\nimport type { InputLabel } from \"./InputLabel\";\nimport type { InputStatus } from \"./InputStatus\";\n\n/** Properties for labeled components\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.\n */\nexport interface LabeledComponentProps {\n /** Text that will be shown next to or above the input. */\n label?: string;\n /** Input status like: \"Success\", \"Warning\" or \"Error\" */\n // eslint-disable-next-line deprecation/deprecation\n status?: InputStatus;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Custom CSS class name for the label */\n labelClassName?: string;\n /** Custom CSS Style for the label */\n labelStyle?: React.CSSProperties;\n}\n\n/** Properties for components with messages\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.\n */\nexport interface MessagedComponentProps {\n /** Optional text shown below the input. */\n message?: string;\n /** Custom CSS class name for the message */\n messageClassName?: string;\n /** Custom CSS Style for the message */\n messageStyle?: React.CSSProperties;\n}\n"]}
@@ -6,6 +6,7 @@ import * as React from "react";
6
6
  import type { InputProps } from "../Input";
7
7
  /** Properties for the [[IconInput]] component
8
8
  * @public
9
+ * @deprecated in 4.12.x. Props of deprecated component {@link IconInput}.
9
10
  */
10
11
  export interface IconInputProps extends Omit<InputProps, "size"> {
11
12
  /** Icon displayed to the left of the Input field within the IconInput component */
@@ -19,6 +20,7 @@ export interface IconInputProps extends Omit<InputProps, "size"> {
19
20
  }
20
21
  /** Input component with icon to the left of the input field
21
22
  * @public
23
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/inputwithdecorations iTwinUI input decorations} instead.
22
24
  */
23
25
  export declare const IconInput: (props: IconInputProps) => React.ReactElement | null;
24
26
  //# sourceMappingURL=IconInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconInput.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/inputs/iconinput/IconInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAC9D,mFAAmF;IACnF,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1B;AAyBD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,YAAY,GAAG,IACnD,CAAC"}
1
+ {"version":3,"file":"IconInput.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/inputs/iconinput/IconInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAC9D,mFAAmF;IACnF,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1B;AA0BD;;;GAGG;AAEH,eAAO,MAAM,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,YAAY,GAAG,IACnD,CAAC"}
@@ -12,6 +12,7 @@ import { Input } from "../Input"; // NEEDSWORK - for nativeKeyHandler
12
12
  /** Input component with icon to the left of the input field
13
13
  * @public
14
14
  */
15
+ // eslint-disable-next-line deprecation/deprecation
15
16
  const ForwardRefIconInput = React.forwardRef(function ForwardRefIconInput(props, ref) {
16
17
  const { className, icon, containerClassName, size, ...otherProps } = props;
17
18
  // NEEDSWORK: still using core-react Input component because of `nativeKeyHandler` prop
@@ -21,6 +22,8 @@ const ForwardRefIconInput = React.forwardRef(function ForwardRefIconInput(props,
21
22
  });
22
23
  /** Input component with icon to the left of the input field
23
24
  * @public
25
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/inputwithdecorations iTwinUI input decorations} instead.
24
26
  */
27
+ // eslint-disable-next-line deprecation/deprecation
25
28
  export const IconInput = ForwardRefIconInput;
26
29
  //# sourceMappingURL=IconInput.js.map