@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
@@ -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;;GAE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AS,CAAC;IAClC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACnC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,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"}
@@ -12,10 +12,11 @@ require("./ImageCheckBox.scss");
12
12
  const classnames_1 = require("classnames");
13
13
  const React = require("react");
14
14
  const IconComponent_1 = require("../icons/IconComponent");
15
- /**
16
- * ImageCheckBox React component shows a checked or unchecked image
15
+ /** ImageCheckBox React component shows a checked or unchecked image
17
16
  * @public
17
+ * @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).
18
18
  */
19
+ // eslint-disable-next-line deprecation/deprecation
19
20
  class ImageCheckBox extends React.PureComponent {
20
21
  constructor() {
21
22
  super(...arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCheckBox.js","sourceRoot":"","sources":["../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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,oBAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACD,CACT,CAAC;IACJ,CAAC;CACF;AA3DD,sCA2DC","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/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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,oBAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACD,CACT,CAAC;IACJ,CAAC;CACF;AA3DD,sCA2DC","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"}
@@ -14,13 +14,18 @@ const React = require("react");
14
14
  const IconComponent_1 = require("../icons/IconComponent");
15
15
  const InputStatus_1 = require("./InputStatus");
16
16
  const inputLabelIconSpec = {
17
+ // eslint-disable-next-line deprecation/deprecation
17
18
  [InputStatus_1.InputStatus.Error]: React.createElement(itwinui_icons_react_1.SvgStatusError, null),
19
+ // eslint-disable-next-line deprecation/deprecation
18
20
  [InputStatus_1.InputStatus.Success]: React.createElement(itwinui_icons_react_1.SvgStatusSuccess, null),
21
+ // eslint-disable-next-line deprecation/deprecation
19
22
  [InputStatus_1.InputStatus.Warning]: React.createElement(itwinui_icons_react_1.SvgStatusWarning, null),
20
23
  };
21
24
  /** Text input wrapper that provides additional styling and labeling
22
25
  * @public
26
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
23
27
  */
28
+ // eslint-disable-next-line deprecation/deprecation
24
29
  class InputLabel extends React.PureComponent {
25
30
  render() {
26
31
  const { label, status, className, style, labelClassName, labelStyle, message, messageClassName, messageStyle, } = this.props;
@@ -1 +1 @@
1
- {"version":3,"file":"InputLabel.js","sourceRoot":"","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SAAS,EAAE,IAAA,oBAAU,EAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,IAElB,OAAO,CACJ,CACP,CACK,CACT,CAAC;IACJ,CAAC;CACF;AAlDD,gCAkDC","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,oEAIoC;AACpC,2CAAoC;AACpC,+BAA+B;AAE/B,0DAA8C;AAE9C,+CAA4C;AAqB5C,MAAM,kBAAkB,GAAgC;IACtD,mDAAmD;IACnD,CAAC,yBAAW,CAAC,KAAK,CAAC,EAAE,oBAAC,oCAAc,OAAG;IACvC,mDAAmD;IACnD,CAAC,yBAAW,CAAC,OAAO,CAAC,EAAE,oBAAC,sCAAgB,OAAG;IAC3C,mDAAmD;IACnD,CAAC,yBAAW,CAAC,OAAO,CAAC,EAAE,oBAAC,sCAAgB,OAAG;CAC5C,CAAC;AAEF;;;GAGG;AACH,mDAAmD;AACnD,MAAa,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,IAAA,oBAAU,EACnB,6BAA6B,EAC7B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,iBAAiB,EACxC,MAAM,EACN,SAAS,CACV;YAEA,KAAK,IAAI,CACR,6BACE,SAAS,EAAE,IAAA,oBAAU,EAAC,cAAc,EAAE,cAAc,CAAC,EACrD,KAAK,EAAE,UAAU;gBAEhB,GAAG;gBACH,KAAK;gBAAE,GAAG,CACP,CACP;YACD,6BAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,OAAO,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC3D,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACnB,MAAM,IAAI,CACT,oBAAC,oBAAI,IAAC,SAAS,EAAC,MAAM,EAAC,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAI,CACpE,CACG;YACL,OAAO,IAAI,CACV,6BACE,SAAS,EAAE,IAAA,oBAAU,EAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,IAElB,OAAO,CACJ,CACP,CACK,CACT,CAAC;IACJ,CAAC;CACF;AAlDD,gCAkDC","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"}
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.InputStatus = void 0;
11
11
  /** Enum for Input status
12
12
  * @public
13
+ * @deprecated in 4.12.x. Enum used in a deprecated component {@link InputLabel}.
13
14
  */
14
15
  var InputStatus;
15
16
  (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,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,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,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,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"}
@@ -15,6 +15,7 @@ const Input_1 = require("../Input"); // NEEDSWORK - for nativeKeyHandler
15
15
  /** Input component with icon to the left of the input field
16
16
  * @public
17
17
  */
18
+ // eslint-disable-next-line deprecation/deprecation
18
19
  const ForwardRefIconInput = React.forwardRef(function ForwardRefIconInput(props, ref) {
19
20
  const { className, icon, containerClassName, size, ...otherProps } = props;
20
21
  // NEEDSWORK: still using core-react Input component because of `nativeKeyHandler` prop
@@ -24,6 +25,8 @@ const ForwardRefIconInput = React.forwardRef(function ForwardRefIconInput(props,
24
25
  });
25
26
  /** Input component with icon to the left of the input field
26
27
  * @public
28
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/inputwithdecorations iTwinUI input decorations} instead.
27
29
  */
30
+ // eslint-disable-next-line deprecation/deprecation
28
31
  exports.IconInput = ForwardRefIconInput;
29
32
  //# sourceMappingURL=IconInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/iconinput/IconInput.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,4BAA0B;AAC1B,2CAAoC;AACpC,+BAA+B;AAE/B,oCAAiC,CAAC,mCAAmC;AAgBrE;;GAEG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,SAAS,mBAAmB,CAAC,KAAK,EAAE,GAAG;IACrC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAE3E,uFAAuF;IACvF,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,oBAAU,EAAC,0BAA0B,EAAE,kBAAkB,CAAC;QAErE,oBAAC,aAAK,IACJ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,oBAAU,EAAC,YAAY,EAAE,SAAS,CAAC,KAC1C,UAAU,GACd;QACF,6BAAK,SAAS,EAAC,qBAAqB,IAAE,IAAI,CAAO,CAC7C,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;GAEG;AACU,QAAA,SAAS,GACpB,mBAAmB,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 Inputs\n */\n\nimport \"./IconInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { InputProps } from \"../Input\";\nimport { Input } from \"../Input\"; // NEEDSWORK - for nativeKeyHandler\n\n/** Properties for the [[IconInput]] component\n * @public\n */\nexport interface IconInputProps extends Omit<InputProps, \"size\"> {\n /** Icon displayed to the left of the Input field within the IconInput component */\n icon: React.ReactNode;\n /** CSS class name for the IconInput component container div */\n containerClassName?: string;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /** Modify size of the input. */\n size?: \"small\" | \"large\";\n}\n\n/** Input component with icon to the left of the input field\n * @public\n */\nconst ForwardRefIconInput = React.forwardRef<HTMLInputElement, IconInputProps>(\n function ForwardRefIconInput(props, ref) {\n const { className, icon, containerClassName, size, ...otherProps } = props;\n\n // NEEDSWORK: still using core-react Input component because of `nativeKeyHandler` prop\n return (\n <div\n className={classnames(\"core-iconInput-container\", containerClassName)}\n >\n <Input\n ref={ref}\n className={classnames(\"core-input\", className)}\n {...otherProps}\n />\n <div className=\"core-iconInput-icon\">{icon}</div>\n </div>\n );\n }\n);\n\n/** Input component with icon to the left of the input field\n * @public\n */\nexport const IconInput: (props: IconInputProps) => React.ReactElement | null =\n ForwardRefIconInput;\n"]}
1
+ {"version":3,"file":"IconInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/iconinput/IconInput.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,4BAA0B;AAC1B,2CAAoC;AACpC,+BAA+B;AAE/B,oCAAiC,CAAC,mCAAmC;AAiBrE;;GAEG;AACH,mDAAmD;AACnD,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,SAAS,mBAAmB,CAAC,KAAK,EAAE,GAAG;IACrC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAE3E,uFAAuF;IACvF,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,oBAAU,EAAC,0BAA0B,EAAE,kBAAkB,CAAC;QAErE,oBAAC,aAAK,IACJ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,oBAAU,EAAC,YAAY,EAAE,SAAS,CAAC,KAC1C,UAAU,GACd;QACF,6BAAK,SAAS,EAAC,qBAAqB,IAAE,IAAI,CAAO,CAC7C,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACH,mDAAmD;AACtC,QAAA,SAAS,GACpB,mBAAmB,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 Inputs\n */\n\nimport \"./IconInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { InputProps } from \"../Input\";\nimport { Input } from \"../Input\"; // NEEDSWORK - for nativeKeyHandler\n\n/** Properties for the [[IconInput]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link IconInput}.\n */\nexport interface IconInputProps extends Omit<InputProps, \"size\"> {\n /** Icon displayed to the left of the Input field within the IconInput component */\n icon: React.ReactNode;\n /** CSS class name for the IconInput component container div */\n containerClassName?: string;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /** Modify size of the input. */\n size?: \"small\" | \"large\";\n}\n\n/** Input component with icon to the left of the input field\n * @public\n */\n// eslint-disable-next-line deprecation/deprecation\nconst ForwardRefIconInput = React.forwardRef<HTMLInputElement, IconInputProps>(\n function ForwardRefIconInput(props, ref) {\n const { className, icon, containerClassName, size, ...otherProps } = props;\n\n // NEEDSWORK: still using core-react Input component because of `nativeKeyHandler` prop\n return (\n <div\n className={classnames(\"core-iconInput-container\", containerClassName)}\n >\n <Input\n ref={ref}\n className={classnames(\"core-input\", className)}\n {...otherProps}\n />\n <div className=\"core-iconInput-icon\">{icon}</div>\n </div>\n );\n }\n);\n\n/** Input component with icon to the left of the input field\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/inputwithdecorations iTwinUI input decorations} instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const IconInput: (props: IconInputProps) => React.ReactElement | null =\n ForwardRefIconInput;\n"]}
@@ -7,10 +7,12 @@ import { Input } from "@itwin/itwinui-react";
7
7
  type InputProps = React.ComponentPropsWithoutRef<typeof Input>;
8
8
  /** Step function prototype for [[NumberInput]] component
9
9
  * @public
10
+ * @deprecated in 4.12.x. Interface used in a deprecated component {@link NumberInput}.
10
11
  */
11
12
  export type StepFunctionProp = number | ((direction: string) => number | undefined);
12
13
  /** Properties for the [[NumberInput]] component
13
14
  * @public
15
+ * @deprecated in 4.12.x. Props of deprecated component {@link NumberInput}.
14
16
  */
15
17
  export interface NumberInputProps extends Omit<InputProps, "min" | "max" | "step" | "onChange"> {
16
18
  /** Numeric value, set to `undefined` to show placeholder text */
@@ -47,6 +49,7 @@ export interface NumberInputProps extends Omit<InputProps, "min" | "max" | "step
47
49
  }
48
50
  /** Input component for numbers with up and down buttons to increment and decrement the value.
49
51
  * @public
52
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
50
53
  */
51
54
  export declare const NumberInput: (props: NumberInputProps) => React.ReactElement | null;
52
55
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAS7C,KAAK,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,KAAK,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GA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AC,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AA0QD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,CAExB,KAAK,EAAE,gBAAgB,KACpB,KAAK,CAAC,YAAY,GAAG,IAA4B,CAAC"}
@@ -158,6 +158,7 @@ const ForwardRefNumberInput = React.forwardRef(function ForwardRefNumberInput(pr
158
158
  });
159
159
  /** Input component for numbers with up and down buttons to increment and decrement the value.
160
160
  * @public
161
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
161
162
  */
162
163
  exports.NumberInput = ForwardRefNumberInput;
163
164
  //# sourceMappingURL=NumberInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,8BAA4B;AAC5B,2CAAoC;AACpC,+BAA+B;AAC/B,6CAAkC;AAClC,wDAA6C;AAC7C,6DAAiD;AACjD,oEAKoC;AAiDpC,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAG5C,SAAS,qBAAqB,CAAC,KAAK,EAAE,GAAG;IACzC,MAAM,EACJ,kBAAkB,EAClB,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,EACH,SAAS,EACT,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IACV,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE5C;;;;;;OAMG;IACH,MAAM,aAAa,GAAG,KAAK,CAAC,WAA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AAI,+BAA+B,EACnD,UAAU,IAAI,4BAA4B,CAC3C,CAAC;IAEF,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,oBAAC,gCAAU,OAAG,CAAC,CAAC,CAAC,oBAAC,qCAAe,OAAG,CAAC;IACxE,MAAM,SAAS,GAAG,gBAAgB,CAAC,CAAC,CAAC,oBAAC,kCAAY,OAAG,CAAC,CAAC,CAAC,oBAAC,uCAAiB,OAAG,CAAC;IAE9E,OAAO,CACL,6BAAK,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,cAAc;QACrD,oBAAC,qBAAK,IACJ,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,IAAA,oBAAU,EAAC,YAAY,EAAE,SAAS,CAAC,KAC1C,UAAU,GACd;QACF,6BACE,SAAS,EAAE,IAAA,oBAAU,EACnB,qCAAqC,EACrC,gBAAgB,IAAI,+BAA+B,CACpD;YAGD,6BACE,SAAS,EAAC,sDAAsD,EAChE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,OAAO,GAAI,CACvB;YAEN,6BACE,SAAS,EAAC,wDAAwD,EAClE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,WAAW,GAES,qBAAqB,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 Inputs\n */\n\nimport \"./NumberInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { Icon } from \"../../icons/IconComponent\";\nimport {\n SvgCaretDown,\n SvgCaretDownSmall,\n SvgCaretUp,\n SvgCaretUpSmall,\n} from \"@itwin/itwinui-icons-react\";\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Input>;\n\n/** Step function prototype for [[NumberInput]] component\n * @public\n */\nexport type StepFunctionProp =\n | number\n | ((direction: string) => number | undefined);\n\n/** Properties for the [[NumberInput]] component\n * @public\n */\nexport interface NumberInputProps\n extends Omit<InputProps, \"min\" | \"max\" | \"step\" | \"onChange\"> {\n /** Numeric value, set to `undefined` to show placeholder text */\n value?: number;\n /** CSS class name for the NumberInput component container div */\n containerClassName?: string;\n /** Style for component container div. */\n containerStyle?: React.CSSProperties;\n /** number or function\tNumber.MIN_SAFE_INTEGER */\n min?: number;\n /** number or function\tdefaults to Number.MAX_SAFE_INTEGER */\n max?: number;\n /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */\n step?: StepFunctionProp;\n /** number of decimal places, defaults to 0 */\n precision?: number;\n /** function parseFloat */\n parse?: (value: string) => number | null | undefined;\n /** function optional formatting function that takes the number value and the internal formatted value in case function just adds prefix or suffix. */\n format?: (num: number | null | undefined, formattedValue: string) => string;\n /** Set to true to \"snap\" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */\n snap?: boolean;\n /** Function to call when value is changed. */\n onChange?: (value: number | undefined, stringValue: string) => void;\n /** if true up/down buttons are shown larger and side by side */\n showTouchButtons?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /**\n * Makes this component behave as controlled component.\n * @internal\n */\n isControlled?: boolean;\n}\n\nconst ForwardRefNumberInput = React.forwardRef<\n HTMLInputElement,\n NumberInputProps\n>(function ForwardRefNumberInput(props, ref) {\n const {\n containerClassName,\n className,\n value,\n min,\n max,\n precision,\n format,\n parse,\n onChange,\n onBlur,\n onKeyDown,\n step,\n snap,\n showTouchButtons,\n containerStyle,\n isControlled,\n ...otherProps\n } = props;\n const currentValueRef = React.useRef(value);\n\n /**\n * Used internally to parse the argument x to it's numeric representation.\n * If the argument cannot be converted to finite number returns 0; If a\n * \"precision\" prop is specified uses it round the number with that\n * precision (no fixed precision here because the return value is float, not\n * string).\n */\n const parseInternal = React.useCallback(\n (x: string) => {\n let n: number | undefined | null;\n\n if (parse) n = parse(x);\n if (undefined === n || null === n) {\n n = parseFloat(x);\n if (isNaN(n) || !isFinite(n)) {\n n = 0;\n }\n }\n\n const localPrecision = undefined === precision ? 10 : precision;\n const q = Math.pow(10, localPrecision);\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n n = Math.min(Math.max(n, localMin), localMax);\n n = Math.round(n * q) / q;\n\n return n;\n },\n [parse, precision, min, max]\n );\n\n /**\n * This is used internally to format a number to its display representation.\n * It will invoke the format function if one is provided.\n */\n const formatInternal = React.useCallback(\n (num: number | undefined | null) => {\n const localPrecision =\n undefined === precision || null === precision ? 0 : precision;\n const str =\n undefined === num || null === num ? \"\" : num.toFixed(localPrecision);\n\n if (format) return format(num, str);\n\n return str;\n },\n [format, precision]\n );\n\n const [formattedValue, setFormattedValue] = React.useState(() =>\n formatInternal(value)\n );\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = value;\n const currentFormattedValue = formatInternal(currentValueRef.current);\n setFormattedValue(currentFormattedValue);\n }, [formatInternal, value]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = event.currentTarget.value;\n setFormattedValue(newVal);\n isControlled && onChange && onChange(parseInternal(newVal), newVal);\n },\n [isControlled, onChange, parseInternal]\n );\n\n const updateValue = React.useCallback(\n (newVal: number) => {\n const newFormattedVal = formatInternal(newVal);\n onChange && onChange(newVal, newFormattedVal);\n setFormattedValue(newFormattedVal);\n },\n [onChange, formatInternal]\n );\n\n const updateValueFromString = React.useCallback(\n (strValue: string) => {\n const newVal = parseInternal(strValue);\n updateValue(newVal);\n },\n [parseInternal, updateValue]\n );\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n const newVal = parseInternal(event.target.value);\n onBlur && onBlur(event);\n updateValue(newVal);\n },\n [parseInternal, updateValue, onBlur]\n );\n\n const getIncrementValue = React.useCallback(\n (increment: boolean) => {\n if (typeof step === \"function\") {\n const stepVal = step(increment ? \"up\" : \"down\");\n return stepVal ? stepVal : 1;\n }\n\n return !step ? 1 : step;\n },\n [step]\n );\n\n /**\n * The internal method that actually sets the new value on the input\n */\n const applyStep = React.useCallback(\n (increment: boolean) => {\n const incrementValue = getIncrementValue(increment);\n\n let num =\n parseInternal(formattedValue) +\n (increment ? incrementValue : -incrementValue);\n if (snap) {\n num = Math.round(num / incrementValue) * incrementValue;\n }\n\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n num = Math.min(Math.max(num, localMin), localMax);\n\n updateValue(num);\n },\n [\n formattedValue,\n getIncrementValue,\n max,\n min,\n parseInternal,\n snap,\n updateValue,\n ]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (event.key === Key.Enter.valueOf()) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.Escape.valueOf()) {\n setFormattedValue(formatInternal(currentValueRef.current));\n event.preventDefault();\n } else if (event.key === Key.ArrowDown.valueOf()) {\n applyStep(false);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.ArrowUp.valueOf()) {\n applyStep(true);\n event.preventDefault();\n event.stopPropagation();\n }\n onKeyDown && onKeyDown(event);\n },\n [applyStep, formatInternal, updateValueFromString, onKeyDown]\n );\n\n const handleDownClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(false);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleUpClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(true);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n event.currentTarget.select();\n },\n []\n );\n\n const isDisabled = !!otherProps.disabled;\n const containerClasses = classnames(\n \"core-number-input-container\",\n containerClassName,\n showTouchButtons && \"core-number-buttons-for-touch\",\n isDisabled && \"core-number-input-disabled\"\n );\n\n const caretUp = showTouchButtons ? <SvgCaretUp /> : <SvgCaretUpSmall />;\n const caretDown = showTouchButtons ? <SvgCaretDown /> : <SvgCaretDownSmall />;\n\n return (\n <div className={containerClasses} style={containerStyle}>\n <Input\n ref={ref}\n value={formattedValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n size=\"small\"\n className={classnames(\"core-input\", className)}\n {...otherProps}\n />\n <div\n className={classnames(\n \"core-number-input-buttons-container\",\n showTouchButtons && \"core-number-buttons-for-touch\"\n )}\n >\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-up\"\n tabIndex={-1}\n onClick={handleUpClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretUp} />\n </div>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-down\"\n tabIndex={-1}\n onClick={handleDownClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretDown} />\n </div>\n </div>\n </div>\n );\n});\n\n/** Input component for numbers with up and down buttons to increment and decrement the value.\n * @public\n */\nexport const NumberInput: (\n props: NumberInputProps\n) => React.ReactElement | null = ForwardRefNumberInput;\n"]}
1
+ {"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,8BAA4B;AAC5B,2CAAoC;AACpC,+BAA+B;AAC/B,6CAAkC;AAClC,wDAA6C;AAC7C,6DAAiD;AACjD,oEAKoC;AAoDpC,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAI5C,SAAS,qBAAqB,CAAC,KAAK,EAAE,GAAG;IACzC,MAAM,EACJ,kBAAkB,EAClB,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,EACH,SAAS,EACT,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IACV,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE5C;;;;;;OAMG;IACH,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CACrC,CAAC,CAAS,EAAE,EAAE;QACZ,IAAI,CAA4B,CAAC;QAEjC,IAAI,KAAK;YAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,SAAS,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE;YACjC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAClB,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;gBAC5B,CAAC,GAAG,CAAC,CAAC;aACP;SACF;QAED,MAAM,cAAc,GAAG,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAChE,MAAM,CAAC,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Aa,EACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,IAAA,oBAAU,EAAC,YAAY,EAAE,SAAS,CAAC,KAC1C,UAAU,GACd;QACF,6BACE,SAAS,EAAE,IAAA,oBAAU,EACnB,qCAAqC,EACrC,gBAAgB,IAAI,+BAA+B,CACpD;YAGD,6BACE,SAAS,EAAC,sDAAsD,EAChE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,OAAO,GAAI,CACvB;YAEN,6BACE,SAAS,EAAC,wDAAwD,EAClE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,WAAW,GAGS,qBAAqB,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 Inputs\n */\n\nimport \"./NumberInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { Icon } from \"../../icons/IconComponent\";\nimport {\n SvgCaretDown,\n SvgCaretDownSmall,\n SvgCaretUp,\n SvgCaretUpSmall,\n} from \"@itwin/itwinui-icons-react\";\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Input>;\n\n/** Step function prototype for [[NumberInput]] component\n * @public\n * @deprecated in 4.12.x. Interface used in a deprecated component {@link NumberInput}.\n */\nexport type StepFunctionProp =\n | number\n | ((direction: string) => number | undefined);\n\n/** Properties for the [[NumberInput]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link NumberInput}.\n */\nexport interface NumberInputProps\n extends Omit<InputProps, \"min\" | \"max\" | \"step\" | \"onChange\"> {\n /** Numeric value, set to `undefined` to show placeholder text */\n value?: number;\n /** CSS class name for the NumberInput component container div */\n containerClassName?: string;\n /** Style for component container div. */\n containerStyle?: React.CSSProperties;\n /** number or function\tNumber.MIN_SAFE_INTEGER */\n min?: number;\n /** number or function\tdefaults to Number.MAX_SAFE_INTEGER */\n max?: number;\n /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */\n // eslint-disable-next-line deprecation/deprecation\n step?: StepFunctionProp;\n /** number of decimal places, defaults to 0 */\n precision?: number;\n /** function parseFloat */\n parse?: (value: string) => number | null | undefined;\n /** function optional formatting function that takes the number value and the internal formatted value in case function just adds prefix or suffix. */\n format?: (num: number | null | undefined, formattedValue: string) => string;\n /** Set to true to \"snap\" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */\n snap?: boolean;\n /** Function to call when value is changed. */\n onChange?: (value: number | undefined, stringValue: string) => void;\n /** if true up/down buttons are shown larger and side by side */\n showTouchButtons?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /**\n * Makes this component behave as controlled component.\n * @internal\n */\n isControlled?: boolean;\n}\n\nconst ForwardRefNumberInput = React.forwardRef<\n HTMLInputElement,\n // eslint-disable-next-line deprecation/deprecation\n NumberInputProps\n>(function ForwardRefNumberInput(props, ref) {\n const {\n containerClassName,\n className,\n value,\n min,\n max,\n precision,\n format,\n parse,\n onChange,\n onBlur,\n onKeyDown,\n step,\n snap,\n showTouchButtons,\n containerStyle,\n isControlled,\n ...otherProps\n } = props;\n const currentValueRef = React.useRef(value);\n\n /**\n * Used internally to parse the argument x to it's numeric representation.\n * If the argument cannot be converted to finite number returns 0; If a\n * \"precision\" prop is specified uses it round the number with that\n * precision (no fixed precision here because the return value is float, not\n * string).\n */\n const parseInternal = React.useCallback(\n (x: string) => {\n let n: number | undefined | null;\n\n if (parse) n = parse(x);\n if (undefined === n || null === n) {\n n = parseFloat(x);\n if (isNaN(n) || !isFinite(n)) {\n n = 0;\n }\n }\n\n const localPrecision = undefined === precision ? 10 : precision;\n const q = Math.pow(10, localPrecision);\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n n = Math.min(Math.max(n, localMin), localMax);\n n = Math.round(n * q) / q;\n\n return n;\n },\n [parse, precision, min, max]\n );\n\n /**\n * This is used internally to format a number to its display representation.\n * It will invoke the format function if one is provided.\n */\n const formatInternal = React.useCallback(\n (num: number | undefined | null) => {\n const localPrecision =\n undefined === precision || null === precision ? 0 : precision;\n const str =\n undefined === num || null === num ? \"\" : num.toFixed(localPrecision);\n\n if (format) return format(num, str);\n\n return str;\n },\n [format, precision]\n );\n\n const [formattedValue, setFormattedValue] = React.useState(() =>\n formatInternal(value)\n );\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = value;\n const currentFormattedValue = formatInternal(currentValueRef.current);\n setFormattedValue(currentFormattedValue);\n }, [formatInternal, value]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = event.currentTarget.value;\n setFormattedValue(newVal);\n isControlled && onChange && onChange(parseInternal(newVal), newVal);\n },\n [isControlled, onChange, parseInternal]\n );\n\n const updateValue = React.useCallback(\n (newVal: number) => {\n const newFormattedVal = formatInternal(newVal);\n onChange && onChange(newVal, newFormattedVal);\n setFormattedValue(newFormattedVal);\n },\n [onChange, formatInternal]\n );\n\n const updateValueFromString = React.useCallback(\n (strValue: string) => {\n const newVal = parseInternal(strValue);\n updateValue(newVal);\n },\n [parseInternal, updateValue]\n );\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n const newVal = parseInternal(event.target.value);\n onBlur && onBlur(event);\n updateValue(newVal);\n },\n [parseInternal, updateValue, onBlur]\n );\n\n const getIncrementValue = React.useCallback(\n (increment: boolean) => {\n if (typeof step === \"function\") {\n const stepVal = step(increment ? \"up\" : \"down\");\n return stepVal ? stepVal : 1;\n }\n\n return !step ? 1 : step;\n },\n [step]\n );\n\n /**\n * The internal method that actually sets the new value on the input\n */\n const applyStep = React.useCallback(\n (increment: boolean) => {\n const incrementValue = getIncrementValue(increment);\n\n let num =\n parseInternal(formattedValue) +\n (increment ? incrementValue : -incrementValue);\n if (snap) {\n num = Math.round(num / incrementValue) * incrementValue;\n }\n\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n num = Math.min(Math.max(num, localMin), localMax);\n\n updateValue(num);\n },\n [\n formattedValue,\n getIncrementValue,\n max,\n min,\n parseInternal,\n snap,\n updateValue,\n ]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (event.key === Key.Enter.valueOf()) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.Escape.valueOf()) {\n setFormattedValue(formatInternal(currentValueRef.current));\n event.preventDefault();\n } else if (event.key === Key.ArrowDown.valueOf()) {\n applyStep(false);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.ArrowUp.valueOf()) {\n applyStep(true);\n event.preventDefault();\n event.stopPropagation();\n }\n onKeyDown && onKeyDown(event);\n },\n [applyStep, formatInternal, updateValueFromString, onKeyDown]\n );\n\n const handleDownClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(false);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleUpClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(true);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n event.currentTarget.select();\n },\n []\n );\n\n const isDisabled = !!otherProps.disabled;\n const containerClasses = classnames(\n \"core-number-input-container\",\n containerClassName,\n showTouchButtons && \"core-number-buttons-for-touch\",\n isDisabled && \"core-number-input-disabled\"\n );\n\n const caretUp = showTouchButtons ? <SvgCaretUp /> : <SvgCaretUpSmall />;\n const caretDown = showTouchButtons ? <SvgCaretDown /> : <SvgCaretDownSmall />;\n\n return (\n <div className={containerClasses} style={containerStyle}>\n <Input\n ref={ref}\n value={formattedValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n size=\"small\"\n className={classnames(\"core-input\", className)}\n {...otherProps}\n />\n <div\n className={classnames(\n \"core-number-input-buttons-container\",\n showTouchButtons && \"core-number-buttons-for-touch\"\n )}\n >\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-up\"\n tabIndex={-1}\n onClick={handleUpClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretUp} />\n </div>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-down\"\n tabIndex={-1}\n onClick={handleDownClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretDown} />\n </div>\n </div>\n </div>\n );\n});\n\n/** Input component for numbers with up and down buttons to increment and decrement the value.\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.\n */\nexport const NumberInput: (\n // eslint-disable-next-line deprecation/deprecation\n props: NumberInputProps\n) => React.ReactElement | null = ForwardRefNumberInput;\n"]}
@@ -0,0 +1,20 @@
1
+ /** @packageDocumentation
2
+ * @module Utilities
3
+ */
4
+ import * as React from "react";
5
+ import type { Localization as CoreLocalization } from "@itwin/core-common";
6
+ type Localization = Pick<CoreLocalization, "getLocalizedString" | "registerNamespace">;
7
+ interface LocalizationProviderProps {
8
+ children?: React.ReactNode;
9
+ localization: Localization;
10
+ }
11
+ /** Provides localization capability to the components.
12
+ * @alpha
13
+ */
14
+ export declare function LocalizationProvider(props: LocalizationProviderProps): React.JSX.Element;
15
+ /** Returns localization context.
16
+ * @internal
17
+ */
18
+ export declare function useLocalization(): Localization | undefined;
19
+ export {};
20
+ //# sourceMappingURL=LocalizationProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalizationProvider.d.ts","sourceRoot":"","sources":["../../../../src/core-react/l10n/LocalizationProvider.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,KAAK,YAAY,GAAG,IAAI,CACtB,gBAAgB,EAChB,oBAAoB,GAAG,mBAAmB,CAC3C,CAAC;AAMF,UAAU,yBAAyB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,qBAOpE;AAED;;GAEG;AACH,wBAAgB,eAAe,6BAG9B"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLocalization = exports.LocalizationProvider = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ /** @packageDocumentation
9
+ * @module Utilities
10
+ */
11
+ const React = require("react");
12
+ const LocalizationContext = React.createContext(undefined);
13
+ /** Provides localization capability to the components.
14
+ * @alpha
15
+ */
16
+ function LocalizationProvider(props) {
17
+ const { children, localization } = props;
18
+ return (React.createElement(LocalizationContext.Provider, { value: localization }, children));
19
+ }
20
+ exports.LocalizationProvider = LocalizationProvider;
21
+ /** Returns localization context.
22
+ * @internal
23
+ */
24
+ function useLocalization() {
25
+ const localization = React.useContext(LocalizationContext);
26
+ return localization;
27
+ }
28
+ exports.useLocalization = useLocalization;
29
+ //# sourceMappingURL=LocalizationProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalizationProvider.js","sourceRoot":"","sources":["../../../../src/core-react/l10n/LocalizationProvider.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,+BAA+B;AAQ/B,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAC7C,SAAS,CACV,CAAC;AAOF;;GAEG;AACH,SAAgB,oBAAoB,CAAC,KAAgC;IACnE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACzC,OAAO,CACL,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC9C,QAAQ,CACoB,CAChC,CAAC;AACJ,CAAC;AAPD,oDAOC;AAED;;GAEG;AACH,SAAgB,eAAe;IAC7B,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAC3D,OAAO,YAAY,CAAC;AACtB,CAAC;AAHD,0CAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\nimport * as React from \"react\";\nimport type { Localization as CoreLocalization } from \"@itwin/core-common\";\n\ntype Localization = Pick<\n CoreLocalization,\n \"getLocalizedString\" | \"registerNamespace\"\n>;\n\nconst LocalizationContext = React.createContext<Localization | undefined>(\n undefined\n);\n\ninterface LocalizationProviderProps {\n children?: React.ReactNode;\n localization: Localization;\n}\n\n/** Provides localization capability to the components.\n * @alpha\n */\nexport function LocalizationProvider(props: LocalizationProviderProps) {\n const { children, localization } = props;\n return (\n <LocalizationContext.Provider value={localization}>\n {children}\n </LocalizationContext.Provider>\n );\n}\n\n/** Returns localization context.\n * @internal\n */\nexport function useLocalization() {\n const localization = React.useContext(LocalizationContext);\n return localization;\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /** Used by AppUI packages internally to define package specific `useTranslation` hook.
2
+ * Uses a localization provider to translate the provided key with a specified namespace. Multiple fallback layers are used to resolve the translation:
3
+ * - Return value of a specified `fallback` function.
4
+ * - Default value looked up from a specified `defaults` object.
5
+ * - Lastly `key` argument of the translation function is returned.
6
+ * @internal
7
+ */
8
+ export declare function usePackageTranslation({ namespace, fallback, defaults, }: {
9
+ namespace: string;
10
+ fallback: (key: string) => string | undefined;
11
+ defaults: object;
12
+ }): {
13
+ translate: (key: string) => string;
14
+ };
15
+ //# sourceMappingURL=usePackageTranslation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePackageTranslation.d.ts","sourceRoot":"","sources":["../../../../src/core-react/l10n/usePackageTranslation.tsx"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,EAAE,MAAM,CAAC;CAClB;qBAkBS,MAAM;EAgBf"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usePackageTranslation = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ const React = require("react");
9
+ const LocalizationProvider_1 = require("./LocalizationProvider");
10
+ /** Used by AppUI packages internally to define package specific `useTranslation` hook.
11
+ * Uses a localization provider to translate the provided key with a specified namespace. Multiple fallback layers are used to resolve the translation:
12
+ * - Return value of a specified `fallback` function.
13
+ * - Default value looked up from a specified `defaults` object.
14
+ * - Lastly `key` argument of the translation function is returned.
15
+ * @internal
16
+ */
17
+ function usePackageTranslation({ namespace, fallback, defaults, }) {
18
+ const localization = (0, LocalizationProvider_1.useLocalization)();
19
+ const [registered, setRegistered] = React.useState(false);
20
+ React.useEffect(() => {
21
+ if (!localization)
22
+ return;
23
+ let ignore = false;
24
+ setRegistered(false);
25
+ void (async () => {
26
+ await localization.registerNamespace(namespace);
27
+ if (ignore)
28
+ return;
29
+ setRegistered(true);
30
+ })();
31
+ return () => {
32
+ ignore = true;
33
+ };
34
+ }, [localization, namespace]);
35
+ const translate = React.useCallback((key) => {
36
+ if (localization && registered) {
37
+ return localization.getLocalizedString(`${namespace}:${key}`);
38
+ }
39
+ const fallbackTranslation = fallback(key);
40
+ if (fallbackTranslation !== undefined) {
41
+ return fallbackTranslation;
42
+ }
43
+ const defaultValue = getDefaultValue(defaults, key);
44
+ return defaultValue ?? key;
45
+ }, [localization, namespace, fallback, defaults, registered]);
46
+ return { translate };
47
+ }
48
+ exports.usePackageTranslation = usePackageTranslation;
49
+ function getDefaultValue(defaults, propertyKey) {
50
+ const keys = propertyKey.split(".");
51
+ let prop = defaults;
52
+ for (const key of keys) {
53
+ if (!(key in prop)) {
54
+ prop = undefined;
55
+ break;
56
+ }
57
+ prop = prop[key];
58
+ }
59
+ if (typeof prop !== "string") {
60
+ return undefined;
61
+ }
62
+ return prop;
63
+ }
64
+ //# sourceMappingURL=usePackageTranslation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePackageTranslation.js","sourceRoot":"","sources":["../../../../src/core-react/l10n/usePackageTranslation.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,+BAA+B;AAC/B,iEAAyD;AAEzD;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,E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CD,sDA0CC;AAED,SAAS,eAAe,CAAC,QAAgB,EAAE,WAAmB;IAC5D,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,IAAI,GAAQ,QAAQ,CAAC;IACzB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE;YAClB,IAAI,GAAG,SAAS,CAAC;YACjB,MAAM;SACP;QACD,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;KAClB;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { useLocalization } from \"./LocalizationProvider\";\n\n/** Used by AppUI packages internally to define package specific `useTranslation` hook.\n * Uses a localization provider to translate the provided key with a specified namespace. Multiple fallback layers are used to resolve the translation:\n * - Return value of a specified `fallback` function.\n * - Default value looked up from a specified `defaults` object.\n * - Lastly `key` argument of the translation function is returned.\n * @internal\n */\nexport function usePackageTranslation({\n namespace,\n fallback,\n defaults,\n}: {\n namespace: string;\n fallback: (key: string) => string | undefined;\n defaults: object;\n}) {\n const localization = useLocalization();\n const [registered, setRegistered] = React.useState(false);\n React.useEffect(() => {\n if (!localization) return;\n\n let ignore = false;\n setRegistered(false);\n void (async () => {\n await localization.registerNamespace(namespace);\n if (ignore) return;\n setRegistered(true);\n })();\n return () => {\n ignore = true;\n };\n }, [localization, namespace]);\n const translate = React.useCallback(\n (key: string) => {\n if (localization && registered) {\n return localization.getLocalizedString(`${namespace}:${key}`);\n }\n\n const fallbackTranslation = fallback(key);\n if (fallbackTranslation !== undefined) {\n return fallbackTranslation;\n }\n\n const defaultValue = getDefaultValue(defaults, key);\n return defaultValue ?? key;\n },\n [localization, namespace, fallback, defaults, registered]\n );\n return { translate };\n}\n\nfunction getDefaultValue(defaults: object, propertyKey: string) {\n const keys = propertyKey.split(\".\");\n let prop: any = defaults;\n for (const key of keys) {\n if (!(key in prop)) {\n prop = undefined;\n break;\n }\n prop = prop[key];\n }\n if (typeof prop !== \"string\") {\n return undefined;\n }\n return prop;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ /** Returns a translation function to localize package components.
2
+ * @internal
3
+ */
4
+ export declare function useTranslation(): {
5
+ translate: (key: string) => string;
6
+ };
7
+ //# sourceMappingURL=useTranslation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../../src/core-react/l10n/useTranslation.tsx"],"names":[],"mappings":"AASA;;GAEG;AACH,wBAAgB,cAAc;;EAc7B"}