@itwin/core-react 4.12.0 → 4.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +1 -1
  3. package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
  4. package/lib/cjs/core-react/autosuggest/AutoSuggest.js +2 -2
  5. package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
  6. package/lib/cjs/core-react/base/Centered.d.ts +1 -0
  7. package/lib/cjs/core-react/base/Centered.d.ts.map +1 -1
  8. package/lib/cjs/core-react/base/Centered.js +2 -0
  9. package/lib/cjs/core-react/base/Centered.js.map +1 -1
  10. package/lib/cjs/core-react/base/Div.d.ts +2 -0
  11. package/lib/cjs/core-react/base/Div.d.ts.map +1 -1
  12. package/lib/cjs/core-react/base/Div.js +2 -0
  13. package/lib/cjs/core-react/base/Div.js.map +1 -1
  14. package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts +1 -0
  15. package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
  16. package/lib/cjs/core-react/base/DivWithOutsideClick.js +1 -0
  17. package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
  18. package/lib/cjs/core-react/base/FillCentered.d.ts +1 -0
  19. package/lib/cjs/core-react/base/FillCentered.d.ts.map +1 -1
  20. package/lib/cjs/core-react/base/FillCentered.js +2 -0
  21. package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
  22. package/lib/cjs/core-react/base/FlexWrapContainer.d.ts +1 -0
  23. package/lib/cjs/core-react/base/FlexWrapContainer.d.ts.map +1 -1
  24. package/lib/cjs/core-react/base/FlexWrapContainer.js +2 -0
  25. package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
  26. package/lib/cjs/core-react/base/Gap.d.ts +2 -0
  27. package/lib/cjs/core-react/base/Gap.d.ts.map +1 -1
  28. package/lib/cjs/core-react/base/Gap.js +3 -1
  29. package/lib/cjs/core-react/base/Gap.js.map +1 -1
  30. package/lib/cjs/core-react/base/ScrollView.d.ts +1 -0
  31. package/lib/cjs/core-react/base/ScrollView.d.ts.map +1 -1
  32. package/lib/cjs/core-react/base/ScrollView.js +2 -0
  33. package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
  34. package/lib/cjs/core-react/button/UnderlinedButton.d.ts +2 -0
  35. package/lib/cjs/core-react/button/UnderlinedButton.d.ts.map +1 -1
  36. package/lib/cjs/core-react/button/UnderlinedButton.js +2 -0
  37. package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
  38. package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts +4 -0
  39. package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
  40. package/lib/cjs/core-react/checklistbox/CheckListBox.js +4 -0
  41. package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
  42. package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
  43. package/lib/cjs/core-react/contextmenu/ContextMenu.js +1 -2
  44. package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
  45. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +3 -5
  46. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  47. package/lib/cjs/core-react/dialog/Dialog.d.ts +3 -0
  48. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  49. package/lib/cjs/core-react/dialog/Dialog.js +17 -3
  50. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  51. package/lib/cjs/core-react/dialog/GlobalDialog.d.ts +3 -0
  52. package/lib/cjs/core-react/dialog/GlobalDialog.d.ts.map +1 -1
  53. package/lib/cjs/core-react/dialog/GlobalDialog.js +7 -3
  54. package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
  55. package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts +4 -2
  56. package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  57. package/lib/cjs/core-react/elementseparator/ElementSeparator.js +4 -2
  58. package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
  59. package/lib/cjs/core-react/expandable/ExpandableList.d.ts +3 -3
  60. package/lib/cjs/core-react/expandable/ExpandableList.d.ts.map +1 -1
  61. package/lib/cjs/core-react/expandable/ExpandableList.js +5 -2
  62. package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
  63. package/lib/cjs/core-react/hocs/withOnOutsideClick.js +1 -2
  64. package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
  65. package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
  66. package/lib/cjs/core-react/icons/IconComponent.js +22 -12
  67. package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
  68. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +3 -2
  69. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
  70. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +3 -2
  71. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
  72. package/lib/cjs/core-react/inputs/InputLabel.d.ts +2 -0
  73. package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
  74. package/lib/cjs/core-react/inputs/InputLabel.js +5 -0
  75. package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
  76. package/lib/cjs/core-react/inputs/InputStatus.d.ts +1 -0
  77. package/lib/cjs/core-react/inputs/InputStatus.d.ts.map +1 -1
  78. package/lib/cjs/core-react/inputs/InputStatus.js +1 -0
  79. package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
  80. package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts +2 -0
  81. package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts.map +1 -1
  82. package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
  83. package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts +2 -0
  84. package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
  85. package/lib/cjs/core-react/inputs/iconinput/IconInput.js +3 -0
  86. package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
  87. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +3 -0
  88. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  89. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +1 -0
  90. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  91. package/lib/cjs/core-react/l10n/usePackageTranslation.js +1 -1
  92. package/lib/cjs/core-react/l10n/usePackageTranslation.js.map +1 -1
  93. package/lib/cjs/core-react/listbox/Listbox.d.ts +14 -14
  94. package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
  95. package/lib/cjs/core-react/listbox/Listbox.js +8 -10
  96. package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
  97. package/lib/cjs/core-react/loading/LoadingBar.d.ts +3 -2
  98. package/lib/cjs/core-react/loading/LoadingBar.d.ts.map +1 -1
  99. package/lib/cjs/core-react/loading/LoadingBar.js +2 -2
  100. package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
  101. package/lib/cjs/core-react/loading/LoadingPrompt.d.ts +3 -2
  102. package/lib/cjs/core-react/loading/LoadingPrompt.d.ts.map +1 -1
  103. package/lib/cjs/core-react/loading/LoadingPrompt.js +2 -2
  104. package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
  105. package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +4 -2
  106. package/lib/cjs/core-react/loading/LoadingSpinner.d.ts.map +1 -1
  107. package/lib/cjs/core-react/loading/LoadingSpinner.js +2 -2
  108. package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
  109. package/lib/cjs/core-react/loading/LoadingStatus.d.ts +3 -2
  110. package/lib/cjs/core-react/loading/LoadingStatus.d.ts.map +1 -1
  111. package/lib/cjs/core-react/loading/LoadingStatus.js +2 -2
  112. package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
  113. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  114. package/lib/cjs/core-react/messagebox/MessageBox.js +3 -1
  115. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  116. package/lib/cjs/core-react/notification/MessageRenderer.js +1 -1
  117. package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
  118. package/lib/cjs/core-react/popup/Popup.js +4 -8
  119. package/lib/cjs/core-react/popup/Popup.js.map +1 -1
  120. package/lib/cjs/core-react/radialmenu/Annulus.d.ts +7 -8
  121. package/lib/cjs/core-react/radialmenu/Annulus.d.ts.map +1 -1
  122. package/lib/cjs/core-react/radialmenu/Annulus.js +7 -8
  123. package/lib/cjs/core-react/radialmenu/Annulus.js.map +1 -1
  124. package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +0 -1
  125. package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
  126. package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
  127. package/lib/cjs/core-react/searchbox/SearchBox.d.ts +3 -3
  128. package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
  129. package/lib/cjs/core-react/searchbox/SearchBox.js +2 -2
  130. package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
  131. package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
  132. package/lib/cjs/core-react/settings/SettingsContainer.js +8 -4
  133. package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
  134. package/lib/cjs/core-react/settings/SettingsManager.d.ts +10 -7
  135. package/lib/cjs/core-react/settings/SettingsManager.d.ts.map +1 -1
  136. package/lib/cjs/core-react/settings/SettingsManager.js +14 -12
  137. package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
  138. package/lib/cjs/core-react/tabs/Tabs.d.ts +5 -5
  139. package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
  140. package/lib/cjs/core-react/tabs/Tabs.js +1 -0
  141. package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
  142. package/lib/cjs/core-react/tabs/VerticalTabs.d.ts +1 -0
  143. package/lib/cjs/core-react/tabs/VerticalTabs.d.ts.map +1 -1
  144. package/lib/cjs/core-react/tabs/VerticalTabs.js +2 -0
  145. package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
  146. package/lib/cjs/core-react/text/BlockText.d.ts +1 -0
  147. package/lib/cjs/core-react/text/BlockText.d.ts.map +1 -1
  148. package/lib/cjs/core-react/text/BlockText.js +2 -0
  149. package/lib/cjs/core-react/text/BlockText.js.map +1 -1
  150. package/lib/cjs/core-react/text/BodyText.d.ts +1 -1
  151. package/lib/cjs/core-react/text/BodyText.d.ts.map +1 -1
  152. package/lib/cjs/core-react/text/BodyText.js +2 -1
  153. package/lib/cjs/core-react/text/BodyText.js.map +1 -1
  154. package/lib/cjs/core-react/text/DisabledText.d.ts +1 -0
  155. package/lib/cjs/core-react/text/DisabledText.d.ts.map +1 -1
  156. package/lib/cjs/core-react/text/DisabledText.js +2 -1
  157. package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
  158. package/lib/cjs/core-react/text/MutedText.d.ts.map +1 -1
  159. package/lib/cjs/core-react/text/MutedText.js +1 -0
  160. package/lib/cjs/core-react/text/MutedText.js.map +1 -1
  161. package/lib/cjs/core-react/text/StyledText.d.ts +1 -0
  162. package/lib/cjs/core-react/text/StyledText.d.ts.map +1 -1
  163. package/lib/cjs/core-react/text/StyledText.js.map +1 -1
  164. package/lib/cjs/core-react/text/TextProps.d.ts +1 -0
  165. package/lib/cjs/core-react/text/TextProps.d.ts.map +1 -1
  166. package/lib/cjs/core-react/text/TextProps.js.map +1 -1
  167. package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  168. package/lib/cjs/core-react/tree/ExpansionToggle.js +1 -1
  169. package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
  170. package/lib/cjs/core-react/tree/Node.js +1 -2
  171. package/lib/cjs/core-react/tree/Node.js.map +1 -1
  172. package/lib/cjs/core-react/utils/IconWebComponent.js +1 -1
  173. package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
  174. package/lib/cjs/core-react/utils/getCssVariable.js +1 -1
  175. package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
  176. package/lib/cjs/core-react/utils/getObjectClassName.js +2 -3
  177. package/lib/cjs/core-react/utils/getObjectClassName.js.map +1 -1
  178. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +4 -1
  179. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
  180. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js +5 -2
  181. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
  182. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -1
  183. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +2 -3
  184. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  185. package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
  186. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +12 -16
  187. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  188. package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +1 -1
  189. package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
  190. package/lib/esm/core-react/autosuggest/AutoSuggest.js +1 -1
  191. package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
  192. package/lib/esm/core-react/base/Centered.d.ts +1 -0
  193. package/lib/esm/core-react/base/Centered.d.ts.map +1 -1
  194. package/lib/esm/core-react/base/Centered.js +2 -0
  195. package/lib/esm/core-react/base/Centered.js.map +1 -1
  196. package/lib/esm/core-react/base/Div.d.ts +2 -0
  197. package/lib/esm/core-react/base/Div.d.ts.map +1 -1
  198. package/lib/esm/core-react/base/Div.js +2 -0
  199. package/lib/esm/core-react/base/Div.js.map +1 -1
  200. package/lib/esm/core-react/base/DivWithOutsideClick.d.ts +1 -0
  201. package/lib/esm/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
  202. package/lib/esm/core-react/base/DivWithOutsideClick.js +1 -0
  203. package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
  204. package/lib/esm/core-react/base/FillCentered.d.ts +1 -0
  205. package/lib/esm/core-react/base/FillCentered.d.ts.map +1 -1
  206. package/lib/esm/core-react/base/FillCentered.js +2 -0
  207. package/lib/esm/core-react/base/FillCentered.js.map +1 -1
  208. package/lib/esm/core-react/base/FlexWrapContainer.d.ts +1 -0
  209. package/lib/esm/core-react/base/FlexWrapContainer.d.ts.map +1 -1
  210. package/lib/esm/core-react/base/FlexWrapContainer.js +2 -0
  211. package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
  212. package/lib/esm/core-react/base/Gap.d.ts +2 -0
  213. package/lib/esm/core-react/base/Gap.d.ts.map +1 -1
  214. package/lib/esm/core-react/base/Gap.js +3 -1
  215. package/lib/esm/core-react/base/Gap.js.map +1 -1
  216. package/lib/esm/core-react/base/ScrollView.d.ts +1 -0
  217. package/lib/esm/core-react/base/ScrollView.d.ts.map +1 -1
  218. package/lib/esm/core-react/base/ScrollView.js +2 -0
  219. package/lib/esm/core-react/base/ScrollView.js.map +1 -1
  220. package/lib/esm/core-react/button/UnderlinedButton.d.ts +2 -0
  221. package/lib/esm/core-react/button/UnderlinedButton.d.ts.map +1 -1
  222. package/lib/esm/core-react/button/UnderlinedButton.js +2 -0
  223. package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
  224. package/lib/esm/core-react/checklistbox/CheckListBox.d.ts +4 -0
  225. package/lib/esm/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
  226. package/lib/esm/core-react/checklistbox/CheckListBox.js +4 -0
  227. package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
  228. package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
  229. package/lib/esm/core-react/contextmenu/ContextMenu.js +1 -2
  230. package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
  231. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +3 -5
  232. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  233. package/lib/esm/core-react/dialog/Dialog.d.ts +3 -0
  234. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  235. package/lib/esm/core-react/dialog/Dialog.js +17 -3
  236. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  237. package/lib/esm/core-react/dialog/GlobalDialog.d.ts +3 -0
  238. package/lib/esm/core-react/dialog/GlobalDialog.d.ts.map +1 -1
  239. package/lib/esm/core-react/dialog/GlobalDialog.js +7 -3
  240. package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
  241. package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts +4 -2
  242. package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  243. package/lib/esm/core-react/elementseparator/ElementSeparator.js +4 -2
  244. package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
  245. package/lib/esm/core-react/expandable/ExpandableList.d.ts +3 -3
  246. package/lib/esm/core-react/expandable/ExpandableList.d.ts.map +1 -1
  247. package/lib/esm/core-react/expandable/ExpandableList.js +5 -2
  248. package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
  249. package/lib/esm/core-react/hocs/withOnOutsideClick.js +1 -2
  250. package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
  251. package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
  252. package/lib/esm/core-react/icons/IconComponent.js +21 -11
  253. package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
  254. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +3 -2
  255. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
  256. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +3 -2
  257. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
  258. package/lib/esm/core-react/inputs/InputLabel.d.ts +2 -0
  259. package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
  260. package/lib/esm/core-react/inputs/InputLabel.js +5 -0
  261. package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
  262. package/lib/esm/core-react/inputs/InputStatus.d.ts +1 -0
  263. package/lib/esm/core-react/inputs/InputStatus.d.ts.map +1 -1
  264. package/lib/esm/core-react/inputs/InputStatus.js +1 -0
  265. package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
  266. package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts +2 -0
  267. package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts.map +1 -1
  268. package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
  269. package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts +2 -0
  270. package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
  271. package/lib/esm/core-react/inputs/iconinput/IconInput.js +3 -0
  272. package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
  273. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +3 -0
  274. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  275. package/lib/esm/core-react/inputs/numberinput/NumberInput.js +1 -0
  276. package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  277. package/lib/esm/core-react/l10n/usePackageTranslation.js +1 -1
  278. package/lib/esm/core-react/l10n/usePackageTranslation.js.map +1 -1
  279. package/lib/esm/core-react/listbox/Listbox.d.ts +14 -14
  280. package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
  281. package/lib/esm/core-react/listbox/Listbox.js +8 -10
  282. package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
  283. package/lib/esm/core-react/loading/LoadingBar.d.ts +3 -2
  284. package/lib/esm/core-react/loading/LoadingBar.d.ts.map +1 -1
  285. package/lib/esm/core-react/loading/LoadingBar.js +2 -2
  286. package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
  287. package/lib/esm/core-react/loading/LoadingPrompt.d.ts +3 -2
  288. package/lib/esm/core-react/loading/LoadingPrompt.d.ts.map +1 -1
  289. package/lib/esm/core-react/loading/LoadingPrompt.js +2 -2
  290. package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
  291. package/lib/esm/core-react/loading/LoadingSpinner.d.ts +4 -2
  292. package/lib/esm/core-react/loading/LoadingSpinner.d.ts.map +1 -1
  293. package/lib/esm/core-react/loading/LoadingSpinner.js +2 -2
  294. package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
  295. package/lib/esm/core-react/loading/LoadingStatus.d.ts +3 -2
  296. package/lib/esm/core-react/loading/LoadingStatus.d.ts.map +1 -1
  297. package/lib/esm/core-react/loading/LoadingStatus.js +2 -2
  298. package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
  299. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  300. package/lib/esm/core-react/messagebox/MessageBox.js +3 -1
  301. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  302. package/lib/esm/core-react/notification/MessageRenderer.js +1 -1
  303. package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
  304. package/lib/esm/core-react/popup/Popup.js +4 -8
  305. package/lib/esm/core-react/popup/Popup.js.map +1 -1
  306. package/lib/esm/core-react/radialmenu/Annulus.d.ts +7 -8
  307. package/lib/esm/core-react/radialmenu/Annulus.d.ts.map +1 -1
  308. package/lib/esm/core-react/radialmenu/Annulus.js +7 -8
  309. package/lib/esm/core-react/radialmenu/Annulus.js.map +1 -1
  310. package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +0 -1
  311. package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
  312. package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
  313. package/lib/esm/core-react/searchbox/SearchBox.d.ts +3 -3
  314. package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
  315. package/lib/esm/core-react/searchbox/SearchBox.js +2 -2
  316. package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
  317. package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
  318. package/lib/esm/core-react/settings/SettingsContainer.js +8 -4
  319. package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
  320. package/lib/esm/core-react/settings/SettingsManager.d.ts +10 -7
  321. package/lib/esm/core-react/settings/SettingsManager.d.ts.map +1 -1
  322. package/lib/esm/core-react/settings/SettingsManager.js +13 -10
  323. package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
  324. package/lib/esm/core-react/tabs/Tabs.d.ts +5 -5
  325. package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
  326. package/lib/esm/core-react/tabs/Tabs.js +1 -0
  327. package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
  328. package/lib/esm/core-react/tabs/VerticalTabs.d.ts +1 -0
  329. package/lib/esm/core-react/tabs/VerticalTabs.d.ts.map +1 -1
  330. package/lib/esm/core-react/tabs/VerticalTabs.js +2 -0
  331. package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
  332. package/lib/esm/core-react/text/BlockText.d.ts +1 -0
  333. package/lib/esm/core-react/text/BlockText.d.ts.map +1 -1
  334. package/lib/esm/core-react/text/BlockText.js +2 -0
  335. package/lib/esm/core-react/text/BlockText.js.map +1 -1
  336. package/lib/esm/core-react/text/BodyText.d.ts +1 -1
  337. package/lib/esm/core-react/text/BodyText.d.ts.map +1 -1
  338. package/lib/esm/core-react/text/BodyText.js +2 -1
  339. package/lib/esm/core-react/text/BodyText.js.map +1 -1
  340. package/lib/esm/core-react/text/DisabledText.d.ts +1 -0
  341. package/lib/esm/core-react/text/DisabledText.d.ts.map +1 -1
  342. package/lib/esm/core-react/text/DisabledText.js +2 -1
  343. package/lib/esm/core-react/text/DisabledText.js.map +1 -1
  344. package/lib/esm/core-react/text/MutedText.d.ts.map +1 -1
  345. package/lib/esm/core-react/text/MutedText.js +1 -0
  346. package/lib/esm/core-react/text/MutedText.js.map +1 -1
  347. package/lib/esm/core-react/text/StyledText.d.ts +1 -0
  348. package/lib/esm/core-react/text/StyledText.d.ts.map +1 -1
  349. package/lib/esm/core-react/text/StyledText.js.map +1 -1
  350. package/lib/esm/core-react/text/TextProps.d.ts +1 -0
  351. package/lib/esm/core-react/text/TextProps.d.ts.map +1 -1
  352. package/lib/esm/core-react/text/TextProps.js.map +1 -1
  353. package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  354. package/lib/esm/core-react/tree/ExpansionToggle.js +1 -1
  355. package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
  356. package/lib/esm/core-react/tree/Node.js +1 -2
  357. package/lib/esm/core-react/tree/Node.js.map +1 -1
  358. package/lib/esm/core-react/utils/IconWebComponent.js +1 -1
  359. package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
  360. package/lib/esm/core-react/utils/getCssVariable.js +1 -1
  361. package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
  362. package/lib/esm/core-react/utils/getObjectClassName.js +2 -3
  363. package/lib/esm/core-react/utils/getObjectClassName.js.map +1 -1
  364. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +4 -1
  365. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
  366. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js +3 -1
  367. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
  368. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -1
  369. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +2 -3
  370. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  371. package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
  372. package/lib/esm/core-react/utils/hooks/useResizeObserver.js +13 -17
  373. package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  374. package/package.json +7 -31
@@ -6,6 +6,7 @@ import * as React from "react";
6
6
  import type { CommonProps } from "../utils/Props";
7
7
  /** Properties for the [[ImageCheckBox]] component
8
8
  * @public
9
+ * @deprecated in 4.12.x. Props of deprecated component {@link ImageCheckBox}.
9
10
  */
10
11
  export interface ImageCheckBoxProps extends CommonProps {
11
12
  /** Image for the "checked" state */
@@ -29,9 +30,9 @@ export interface ImageCheckBoxProps extends CommonProps {
29
30
  /** Provides ability to return reference to HTMLInputElement */
30
31
  inputRef?: React.Ref<HTMLInputElement>;
31
32
  }
32
- /**
33
- * ImageCheckBox React component shows a checked or unchecked image
33
+ /** ImageCheckBox React component shows a checked or unchecked image
34
34
  * @public
35
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).
35
36
  */
36
37
  export declare class ImageCheckBox extends React.PureComponent<ImageCheckBoxProps> {
37
38
  private _onChange;
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCheckBox.d.ts","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,oCAAoC;IACpC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACnC,8CAA8C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AA4C;IAC5C,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,CAAC;IACpC,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACxC;AAED;;;GAGG;AAEH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxE,OAAO,CAAC,SAAS,CAQf;IAEF,OAAO,CAAC,aAAa,CAGnB;IAEF,OAAO,CAAC,aAAa,CAGnB;IAEF,gBAAgB;IACA,MAAM;CAqCvB"}
@@ -9,10 +9,11 @@ import "./ImageCheckBox.scss";
9
9
  import classnames from "classnames";
10
10
  import * as React from "react";
11
11
  import { Icon } from "../icons/IconComponent";
12
- /**
13
- * ImageCheckBox React component shows a checked or unchecked image
12
+ /** ImageCheckBox React component shows a checked or unchecked image
14
13
  * @public
14
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).
15
15
  */
16
+ // eslint-disable-next-line deprecation/deprecation
16
17
  export class ImageCheckBox extends React.PureComponent {
17
18
  constructor() {
18
19
  super(...arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCheckBox.js","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,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KAAK,EACvB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAEzB,+BACE,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACpC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GACxB;YACF,8BAAM,SAAS,EAAE,UAAU;gBACzB,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACD,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Checkbox\n */\n\nimport \"./ImageCheckBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for the [[ImageCheckBox]] component\n * @public\n */\nexport interface ImageCheckBoxProps extends CommonProps {\n /** Image for the \"checked\" state */\n imageOn: string | React.ReactNode;\n /** Image for the \"unchecked\" (default) state */\n imageOff: string | React.ReactNode;\n /** Determine if the item is checked or not */\n checked?: boolean;\n /** Determine if the item is disabled or not */\n disabled?: boolean;\n /** Function called when item is clicked. */\n onClick?: (checked: boolean) => any;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Tooltip to be displayed when mouse is hovered over the checkbox */\n tooltip?: string;\n /** If true, draw a border around the image checkbox */\n border?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n inputRef?: React.Ref<HTMLInputElement>;\n}\n\n/**\n * ImageCheckBox React component shows a checked or unchecked image\n * @public\n */\nexport class ImageCheckBox extends React.PureComponent<ImageCheckBoxProps> {\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n\n // istanbul ignore else\n if (this.props.onClick) {\n this.props.onClick(e.target.checked);\n }\n };\n\n private _onInputClick = (e: React.MouseEvent<HTMLInputElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n private _onLabelClick = (e: React.MouseEvent<HTMLLabelElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n /** @internal */\n public override render() {\n const checkBoxClass = classnames(\n \"core-image-checkbox\",\n this.props.className\n );\n const imageClass = classnames(\n \"image\",\n this.props.border && \"image-checkbox-border\"\n );\n const iconSpec = this.props.checked\n ? this.props.imageOn\n : this.props.imageOff;\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/label-has-associated-control, jsx-a11y/no-noninteractive-element-interactions\n <label\n className={checkBoxClass}\n style={this.props.style}\n onClick={this._onLabelClick}\n title={this.props.tooltip}\n >\n <input\n type=\"checkbox\"\n className={this.props.inputClassName}\n style={this.props.inputStyle}\n checked={this.props.checked}\n disabled={this.props.disabled}\n onChange={this._onChange}\n onClick={this._onInputClick}\n ref={this.props.inputRef}\n />\n <span className={imageClass}>\n <Icon iconSpec={iconSpec} />\n </span>\n </label>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ImageCheckBox.js","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,O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E,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAEzB,+BACE,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACpC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GACxB;YACF,8BAAM,SAAS,EAAE,UAAU;gBACzB,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACD,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Checkbox\n */\n\nimport \"./ImageCheckBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for the [[ImageCheckBox]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link ImageCheckBox}.\n */\nexport interface ImageCheckBoxProps extends CommonProps {\n /** Image for the \"checked\" state */\n imageOn: string | React.ReactNode;\n /** Image for the \"unchecked\" (default) state */\n imageOff: string | React.ReactNode;\n /** Determine if the item is checked or not */\n checked?: boolean;\n /** Determine if the item is disabled or not */\n disabled?: boolean;\n /** Function called when item is clicked. */\n onClick?: (checked: boolean) => any;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Tooltip to be displayed when mouse is hovered over the checkbox */\n tooltip?: string;\n /** If true, draw a border around the image checkbox */\n border?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n inputRef?: React.Ref<HTMLInputElement>;\n}\n\n/** ImageCheckBox React component shows a checked or unchecked image\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class ImageCheckBox extends React.PureComponent<ImageCheckBoxProps> {\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n\n // istanbul ignore else\n if (this.props.onClick) {\n this.props.onClick(e.target.checked);\n }\n };\n\n private _onInputClick = (e: React.MouseEvent<HTMLInputElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n private _onLabelClick = (e: React.MouseEvent<HTMLLabelElement>) => {\n // istanbul ignore next\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n /** @internal */\n public override render() {\n const checkBoxClass = classnames(\n \"core-image-checkbox\",\n this.props.className\n );\n const imageClass = classnames(\n \"image\",\n this.props.border && \"image-checkbox-border\"\n );\n const iconSpec = this.props.checked\n ? this.props.imageOn\n : this.props.imageOff;\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/label-has-associated-control, jsx-a11y/no-noninteractive-element-interactions\n <label\n className={checkBoxClass}\n style={this.props.style}\n onClick={this._onLabelClick}\n title={this.props.tooltip}\n >\n <input\n type=\"checkbox\"\n className={this.props.inputClassName}\n style={this.props.inputStyle}\n checked={this.props.checked}\n disabled={this.props.disabled}\n onChange={this._onChange}\n onClick={this._onInputClick}\n ref={this.props.inputRef}\n />\n <span className={imageClass}>\n <Icon iconSpec={iconSpec} />\n </span>\n </label>\n );\n }\n}\n"]}
@@ -6,6 +6,7 @@ import type { CommonProps } from "../utils/Props";
6
6
  import type { LabeledComponentProps, MessagedComponentProps } from "./LabeledComponentProps";
7
7
  /** Properties for [[InputLabel]] components
8
8
  * @public
9
+ * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.
9
10
  */
10
11
  export interface InputLabelProps extends LabeledComponentProps, MessagedComponentProps, CommonProps {
11
12
  disabled?: boolean;
@@ -14,6 +15,7 @@ export interface InputLabelProps extends LabeledComponentProps, MessagedComponen
14
15
  }
15
16
  /** Text input wrapper that provides additional styling and labeling
16
17
  * @public
18
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
17
19
  */
18
20
  export declare class InputLabel extends React.PureComponent<InputLabelProps> {
19
21
  render(): React.ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"InputLabel.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAQH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,eACf,SAAQ,qBAAqB,EAC3B,sBAAsB,EACtB,WAAW;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAQD;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC;IAClD,MAAM,IAAI,KAAK,CAAC,YAAY;CAiD7C"}
1
+ {"version":3,"file":"InputLabel.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAQH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,eAEf,SAAQ,qBAAqB,EAE3B,sBAAsB,EACtB,WAAW;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAWD;;;GAGG;AAEH,qBAAa,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC;IAClD,MAAM,IAAI,KAAK,CAAC,YAAY;CAiD7C"}
@@ -11,13 +11,18 @@ import * as React from "react";
11
11
  import { Icon } from "../icons/IconComponent";
12
12
  import { InputStatus } from "./InputStatus";
13
13
  const inputLabelIconSpec = {
14
+ // eslint-disable-next-line deprecation/deprecation
14
15
  [InputStatus.Error]: React.createElement(SvgStatusError, null),
16
+ // eslint-disable-next-line deprecation/deprecation
15
17
  [InputStatus.Success]: React.createElement(SvgStatusSuccess, null),
18
+ // eslint-disable-next-line deprecation/deprecation
16
19
  [InputStatus.Warning]: React.createElement(SvgStatusWarning, null),
17
20
  };
18
21
  /** Text input wrapper that provides additional styling and labeling
19
22
  * @public
23
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
20
24
  */
25
+ // eslint-disable-next-line deprecation/deprecation
21
26
  export class InputLabel extends React.PureComponent {
22
27
  render() {
23
28
  const { label, status, className, style, labelClassName, labelStyle, message, messageClassName, messageStyle, } = this.props;
@@ -1 +1 @@
1
- {"version":3,"file":"InputLabel.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MA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AO,IAAI,CACV,6BACE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,IAElB,OAAO,CACJ,CACP,CACK,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport {\n SvgStatusError,\n SvgStatusSuccess,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { InputStatus } from \"./InputStatus\";\nimport type {\n LabeledComponentProps,\n MessagedComponentProps,\n} from \"./LabeledComponentProps\";\n\n/** Properties for [[InputLabel]] components\n * @public\n */\nexport interface InputLabelProps\n extends LabeledComponentProps,\n MessagedComponentProps,\n CommonProps {\n disabled?: boolean;\n /** Labeled content */\n children?: React.ReactNode;\n}\n\nconst inputLabelIconSpec: { [key: string]: IconSpec } = {\n [InputStatus.Error]: <SvgStatusError />,\n [InputStatus.Success]: <SvgStatusSuccess />,\n [InputStatus.Warning]: <SvgStatusWarning />,\n};\n\n/** Text input wrapper that provides additional styling and labeling\n * @public\n */\nexport class InputLabel extends React.PureComponent<InputLabelProps> {\n public override render(): React.ReactElement {\n const {\n label,\n status,\n className,\n style,\n labelClassName,\n labelStyle,\n message,\n messageClassName,\n messageStyle,\n } = this.props;\n\n return (\n <label\n style={style}\n className={classnames(\n \"uicore-inputs-labeled-input\",\n this.props.disabled && \"uicore-disabled\",\n status,\n className\n )}\n >\n {label && (\n <div\n className={classnames(\"uicore-label\", labelClassName)}\n style={labelStyle}\n >\n {\" \"}\n {label}{\" \"}\n </div>\n )}\n <div className={classnames(\"input\", { \"with-icon\": !!status })}>\n {this.props.children}\n {status && (\n <Icon className=\"icon\" iconSpec={inputLabelIconSpec[`{status}`]} />\n )}\n </div>\n {message && (\n <div\n className={classnames(\"uicore-message\", messageClassName)}\n style={messageStyle}\n >\n {message}\n </div>\n )}\n </label>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"InputLabel.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAqB5C,MAAM,kBAAkB,GAAgC;IACtD,mDAAmD;IACnD,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,oBAAC,cAAc,OAAG;IACvC,mDAAmD;IACnD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,oBAAC,gBAAgB,OAAG;IAC3C,mDAAmD;IACnD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,oBAAC,gBAAgB,OAAG;CAC5C,CAAC;AAEF;;;GAGG;AACH,mDAAmD;AACnD,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAClD,MAAM;QACpB,MAAM,EACJ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,cAAc,EACd,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,YAAY,GACb,GAAG,IAAI,CAAC,KAAK,CAAC;QAEf,OAAO,CACL,+BACE,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CACnB,6BAA6B,EAC7B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,iBAAiB,EACxC,MAAM,EACN,SAAS,CACV;YAEA,KAAK,IAAI,CACR,6BACE,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC,EACrD,KAAK,EAAE,UAAU;gBAEhB,GAAG;gBACH,KAAK;gBAAE,GAAG,CACP,CACP;YACD,6BAAK,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC3D,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACnB,MAAM,IAAI,CACT,oBAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAI,CACpE,CACG;YACL,OAAO,IAAI,CACV,6BACE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,IAElB,OAAO,CACJ,CACP,CACK,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport {\n SvgStatusError,\n SvgStatusSuccess,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { InputStatus } from \"./InputStatus\";\nimport type {\n LabeledComponentProps,\n MessagedComponentProps,\n} from \"./LabeledComponentProps\";\n\n/** Properties for [[InputLabel]] components\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.\n */\nexport interface InputLabelProps\n // eslint-disable-next-line deprecation/deprecation\n extends LabeledComponentProps,\n // eslint-disable-next-line deprecation/deprecation\n MessagedComponentProps,\n CommonProps {\n disabled?: boolean;\n /** Labeled content */\n children?: React.ReactNode;\n}\n\nconst inputLabelIconSpec: { [key: string]: IconSpec } = {\n // eslint-disable-next-line deprecation/deprecation\n [InputStatus.Error]: <SvgStatusError />,\n // eslint-disable-next-line deprecation/deprecation\n [InputStatus.Success]: <SvgStatusSuccess />,\n // eslint-disable-next-line deprecation/deprecation\n [InputStatus.Warning]: <SvgStatusWarning />,\n};\n\n/** Text input wrapper that provides additional styling and labeling\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class InputLabel extends React.PureComponent<InputLabelProps> {\n public override render(): React.ReactElement {\n const {\n label,\n status,\n className,\n style,\n labelClassName,\n labelStyle,\n message,\n messageClassName,\n messageStyle,\n } = this.props;\n\n return (\n <label\n style={style}\n className={classnames(\n \"uicore-inputs-labeled-input\",\n this.props.disabled && \"uicore-disabled\",\n status,\n className\n )}\n >\n {label && (\n <div\n className={classnames(\"uicore-label\", labelClassName)}\n style={labelStyle}\n >\n {\" \"}\n {label}{\" \"}\n </div>\n )}\n <div className={classnames(\"input\", { \"with-icon\": !!status })}>\n {this.props.children}\n {status && (\n <Icon className=\"icon\" iconSpec={inputLabelIconSpec[`{status}`]} />\n )}\n </div>\n {message && (\n <div\n className={classnames(\"uicore-message\", messageClassName)}\n style={messageStyle}\n >\n {message}\n </div>\n )}\n </label>\n );\n }\n}\n"]}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  /** Enum for Input status
5
5
  * @public
6
+ * @deprecated in 4.12.x. Enum used in a deprecated component {@link InputLabel}.
6
7
  */
7
8
  export declare enum InputStatus {
8
9
  Success = "success",
@@ -1 +1 @@
1
- {"version":3,"file":"InputStatus.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputStatus.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
1
+ {"version":3,"file":"InputStatus.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputStatus.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;;GAGG;AACH,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
@@ -7,6 +7,7 @@
7
7
  */
8
8
  /** Enum for Input status
9
9
  * @public
10
+ * @deprecated in 4.12.x. Enum used in a deprecated component {@link InputLabel}.
10
11
  */
11
12
  export var InputStatus;
12
13
  (function (InputStatus) {
@@ -1 +1 @@
1
- {"version":3,"file":"InputStatus.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputStatus.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\n/** Enum for Input status\n * @public\n */\nexport enum InputStatus {\n Success = \"success\",\n Warning = \"warning\",\n Error = \"error\",\n}\n"]}
1
+ {"version":3,"file":"InputStatus.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputStatus.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport type { InputLabel } from \"./InputLabel\";\n\n/** Enum for Input status\n * @public\n * @deprecated in 4.12.x. Enum used in a deprecated component {@link InputLabel}.\n */\nexport enum InputStatus {\n Success = \"success\",\n Warning = \"warning\",\n Error = \"error\",\n}\n"]}
@@ -5,6 +5,7 @@ import type * as React from "react";
5
5
  import type { InputStatus } from "./InputStatus";
6
6
  /** Properties for labeled components
7
7
  * @public
8
+ * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.
8
9
  */
9
10
  export interface LabeledComponentProps {
10
11
  /** Text that will be shown next to or above the input. */
@@ -22,6 +23,7 @@ export interface LabeledComponentProps {
22
23
  }
23
24
  /** Properties for components with messages
24
25
  * @public
26
+ * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.
25
27
  */
26
28
  export interface MessagedComponentProps {
27
29
  /** Optional text shown below the input. */
@@ -1 +1 @@
1
- {"version":3,"file":"LabeledComponentProps.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/LabeledComponentProps.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC"}
1
+ {"version":3,"file":"LabeledComponentProps.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/LabeledComponentProps.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IAEzD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LabeledComponentProps.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/LabeledComponentProps.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport type * as React from \"react\";\nimport type { InputStatus } from \"./InputStatus\";\n\n/** Properties for labeled components\n * @public\n */\nexport interface LabeledComponentProps {\n /** Text that will be shown next to or above the input. */\n label?: string;\n /** Input status like: \"Success\", \"Warning\" or \"Error\" */\n status?: InputStatus;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Custom CSS class name for the label */\n labelClassName?: string;\n /** Custom CSS Style for the label */\n labelStyle?: React.CSSProperties;\n}\n\n/** Properties for components with messages\n * @public\n */\nexport interface MessagedComponentProps {\n /** Optional text shown below the input. */\n message?: string;\n /** Custom CSS class name for the message */\n messageClassName?: string;\n /** Custom CSS Style for the message */\n messageStyle?: React.CSSProperties;\n}\n"]}
1
+ {"version":3,"file":"LabeledComponentProps.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/LabeledComponentProps.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport type * as React from \"react\";\nimport type { InputLabel } from \"./InputLabel\";\nimport type { InputStatus } from \"./InputStatus\";\n\n/** Properties for labeled components\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.\n */\nexport interface LabeledComponentProps {\n /** Text that will be shown next to or above the input. */\n label?: string;\n /** Input status like: \"Success\", \"Warning\" or \"Error\" */\n // eslint-disable-next-line deprecation/deprecation\n status?: InputStatus;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Custom CSS class name for the label */\n labelClassName?: string;\n /** Custom CSS Style for the label */\n labelStyle?: React.CSSProperties;\n}\n\n/** Properties for components with messages\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link InputLabel}.\n */\nexport interface MessagedComponentProps {\n /** Optional text shown below the input. */\n message?: string;\n /** Custom CSS class name for the message */\n messageClassName?: string;\n /** Custom CSS Style for the message */\n messageStyle?: React.CSSProperties;\n}\n"]}
@@ -6,6 +6,7 @@ import * as React from "react";
6
6
  import type { InputProps } from "../Input";
7
7
  /** Properties for the [[IconInput]] component
8
8
  * @public
9
+ * @deprecated in 4.12.x. Props of deprecated component {@link IconInput}.
9
10
  */
10
11
  export interface IconInputProps extends Omit<InputProps, "size"> {
11
12
  /** Icon displayed to the left of the Input field within the IconInput component */
@@ -19,6 +20,7 @@ export interface IconInputProps extends Omit<InputProps, "size"> {
19
20
  }
20
21
  /** Input component with icon to the left of the input field
21
22
  * @public
23
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/inputwithdecorations iTwinUI input decorations} instead.
22
24
  */
23
25
  export declare const IconInput: (props: IconInputProps) => React.ReactElement | null;
24
26
  //# sourceMappingURL=IconInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconInput.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/inputs/iconinput/IconInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAC9D,mFAAmF;IACnF,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1B;AAyBD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,YAAY,GAAG,IACnD,CAAC"}
1
+ {"version":3,"file":"IconInput.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/inputs/iconinput/IconInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAC9D,mFAAmF;IACnF,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1B;AA0BD;;;GAGG;AAEH,eAAO,MAAM,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,YAAY,GAAG,IACnD,CAAC"}
@@ -12,6 +12,7 @@ import { Input } from "../Input"; // NEEDSWORK - for nativeKeyHandler
12
12
  /** Input component with icon to the left of the input field
13
13
  * @public
14
14
  */
15
+ // eslint-disable-next-line deprecation/deprecation
15
16
  const ForwardRefIconInput = React.forwardRef(function ForwardRefIconInput(props, ref) {
16
17
  const { className, icon, containerClassName, size, ...otherProps } = props;
17
18
  // NEEDSWORK: still using core-react Input component because of `nativeKeyHandler` prop
@@ -21,6 +22,8 @@ const ForwardRefIconInput = React.forwardRef(function ForwardRefIconInput(props,
21
22
  });
22
23
  /** Input component with icon to the left of the input field
23
24
  * @public
25
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/inputwithdecorations iTwinUI input decorations} instead.
24
26
  */
27
+ // eslint-disable-next-line deprecation/deprecation
25
28
  export const IconInput = ForwardRefIconInput;
26
29
  //# sourceMappingURL=IconInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/iconinput/IconInput.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC,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,UAAU,CAAC,0BAA0B,EAAE,kBAAkB,CAAC;QAErE,oBAAC,KAAK,IACJ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,KAC1C,UAAU,GACd;QACF,6BAAK,SAAS,EAAC,qBAAqB,IAAE,IAAI,CAAO,CAC7C,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,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,OAAO,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC,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,UAAU,CAAC,0BAA0B,EAAE,kBAAkB,CAAC;QAErE,oBAAC,KAAK,IACJ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,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;AACnD,MAAM,CAAC,MAAM,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,wBAA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,GAAG,SAAS,EAAE,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5E,0HAA0H;IAC1H,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,gEAAgE;IAChE,gBAAgB,CAAC,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"}
@@ -155,6 +155,7 @@ const ForwardRefNumberInput = React.forwardRef(function ForwardRefNumberInput(pr
155
155
  });
156
156
  /** Input component for numbers with up and down buttons to increment and decrement the value.
157
157
  * @public
158
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
158
159
  */
159
160
  export const NumberInput = ForwardRefNumberInput;
160
161
  //# 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,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,UAA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C,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,IAAI,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,IAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,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,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,eAAe,GAChB,MAAM,4BAA4B,CAAC;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,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Q,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,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"]}
@@ -38,7 +38,7 @@ export function usePackageTranslation({ namespace, fallback, defaults, }) {
38
38
  return fallbackTranslation;
39
39
  }
40
40
  const defaultValue = getDefaultValue(defaults, key);
41
- return defaultValue !== null && defaultValue !== void 0 ? defaultValue : key;
41
+ return defaultValue ?? key;
42
42
  }, [localization, namespace, fallback, defaults, registered]);
43
43
  return { translate };
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"usePackageTranslation.js","sourceRoot":"","sources":["../../../../src/core-react/l10n/usePackageTranslation.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,QAAQ,GAKT;IACC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1D,KAAK,CAAC,SAAS,CAAC,GAA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ACtB,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"]}
1
+ {"version":3,"file":"usePackageTranslation.js","sourceRoot":"","sources":["../../../../src/core-react/l10n/usePackageTranslation.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,QAAQ,GAKT;IACC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,YAAY;YAAE,OAAO;QAE1B,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,aAAa,CAAC,KAAK,CAAC,CAAC;QACrB,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,YAAY,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAChD,IAAI,MAAM;gBAAE,OAAO;YACnB,aAAa,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CACjC,CAAC,GAAW,EAAE,EAAE;QACd,IAAI,YAAY,IAAI,UAAU,EAAE;YAC9B,OAAO,YAAY,CAAC,kBAAkB,CAAC,GAAG,SAAS,IAAI,GAAG,EAAE,CAAC,CAAC;SAC/D;QAED,MAAM,mBAAmB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,mBAAmB,KAAK,SAAS,EAAE;YACrC,OAAO,mBAAmB,CAAC;SAC5B;QAED,MAAM,YAAY,GAAG,eAAe,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACpD,OAAO,YAAY,IAAI,GAAG,CAAC;IAC7B,CAAC,EACD,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAC1D,CAAC;IACF,OAAO,EAAE,SAAS,EAAE,CAAC;AACvB,CAAC;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"]}
@@ -1,14 +1,14 @@
1
1
  import * as React from "react";
2
2
  import "./Listbox.scss";
3
3
  /** Ideas borrowed from https://reacttraining.com/reach-ui/listbox */
4
- /**
5
- * `Listbox` value.
4
+ /** `Listbox` value.
6
5
  * @alpha
6
+ * @deprecated in 4.12.x. Value used in a deprecated component {@link Listbox}.
7
7
  */
8
8
  export type ListboxValue = string;
9
- /**
10
- * `Listbox` Props.
9
+ /** `Listbox` Props.
11
10
  * @alpha
11
+ * @deprecated in 4.12.x. Props of deprecated component {@link Listbox}.
12
12
  */
13
13
  export interface ListboxProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {
14
14
  id?: string;
@@ -17,9 +17,9 @@ export interface ListboxProps extends React.DetailedHTMLProps<React.HTMLAttribut
17
17
  ariaLabelledBy?: any;
18
18
  onListboxValueChange?: (newValue: ListboxValue, isControlOrCommandPressed?: boolean) => void;
19
19
  }
20
- /**
21
- * `ListboxItem` Props.
20
+ /** `ListboxItem` Props.
22
21
  * @alpha
22
+ * @deprecated in 4.12.x. Props of deprecated component {@link ListboxItem}.
23
23
  */
24
24
  export interface ListboxItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
25
25
  /** The unique item's value. */
@@ -27,9 +27,9 @@ export interface ListboxItemProps extends React.DetailedHTMLProps<React.LiHTMLAt
27
27
  /** set if item is disabled. */
28
28
  disabled?: boolean;
29
29
  }
30
- /**
31
- * `Listbox` Context.
30
+ /** `Listbox` Context.
32
31
  * @alpha
32
+ * @deprecated in 4.12.x. Props of deprecated context {@link ListboxContext}.
33
33
  */
34
34
  export interface ListboxContextProps {
35
35
  listboxId?: string;
@@ -38,19 +38,19 @@ export interface ListboxContextProps {
38
38
  onListboxValueChange: (newValue: ListboxValue, isControlOrCommandPressed?: boolean) => void;
39
39
  listboxRef?: React.RefObject<HTMLUListElement>;
40
40
  }
41
- /**
42
- * Context set up by listbox for use by `ListboxItems` .
41
+ /** Context set up by listbox for use by `ListboxItems` .
43
42
  * @alpha
43
+ * @deprecated in 4.12.x. Context of deprecated component {@link Listbox}.
44
44
  */
45
45
  export declare const ListboxContext: React.Context<ListboxContextProps>;
46
- /**
47
- * Single select `Listbox` component
46
+ /** Single select `Listbox` component
48
47
  * @alpha
48
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
49
49
  */
50
50
  export declare function Listbox(props: ListboxProps): React.JSX.Element;
51
- /**
52
- * `ListboxItem` component.
51
+ /** `ListboxItem` component.
53
52
  * @alpha
53
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
54
54
  */
55
55
  export declare function ListboxItem(props: ListboxItemProps): React.JSX.Element;
56
56
  //# sourceMappingURL=Listbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Listbox.d.ts","sourceRoot":"","sources":["../../../../src/core-react/listbox/Listbox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,O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AK,EAAE,YAAY,qBA6M1C;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBA0DlD"}
@@ -7,11 +7,10 @@ import classnames from "classnames";
7
7
  import { Key } from "ts-key-enum";
8
8
  import "./Listbox.scss";
9
9
  import { Guid } from "@itwin/core-bentley";
10
- /**
11
- * Context set up by listbox for use by `ListboxItems` .
10
+ /** Context set up by listbox for use by `ListboxItems` .
12
11
  * @alpha
12
+ * @deprecated in 4.12.x. Context of deprecated component {@link Listbox}.
13
13
  */
14
- // istanbul ignore next
15
14
  export const ListboxContext = React.createContext({
16
15
  onListboxValueChange: (_newValue) => { },
17
16
  });
@@ -65,15 +64,15 @@ function processKeyboardNavigation(optionValues, itemIndex, key) {
65
64
  }
66
65
  return [newIndex, keyProcessed];
67
66
  }
68
- /**
69
- * Single select `Listbox` component
67
+ /** Single select `Listbox` component
70
68
  * @alpha
69
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
71
70
  */
72
71
  export function Listbox(props) {
73
72
  const { ariaLabel, ariaLabelledBy, id, children, selectedValue, className, onListboxValueChange, onKeyDown, ...otherProps } = props;
74
73
  const listRef = React.useRef(null);
75
74
  const [listId] = React.useState(() => {
76
- return id !== null && id !== void 0 ? id : Guid.createValue();
75
+ return id ?? Guid.createValue();
77
76
  });
78
77
  const optionValues = React.useMemo(() => getOptionValueArray(children), [children]);
79
78
  const classes = React.useMemo(() => classnames("core-listbox", className), [className]);
@@ -190,9 +189,9 @@ export function Listbox(props) {
190
189
  listboxRef: listRef,
191
190
  } }, children)));
192
191
  }
193
- /**
194
- * `ListboxItem` component.
192
+ /** `ListboxItem` component.
195
193
  * @alpha
194
+ * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
196
195
  */
197
196
  export function ListboxItem(props) {
198
197
  const { children, value, className, disabled, ...otherProps } = props;
@@ -202,10 +201,9 @@ export function ListboxItem(props) {
202
201
  const itemRef = React.useRef(null);
203
202
  const isSelected = listboxValue === value;
204
203
  const handleClick = React.useCallback((event) => {
205
- var _a, _b;
206
204
  event.preventDefault();
207
205
  // istanbul ignore next
208
- const selectedValue = (_b = (_a = event.currentTarget) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.value;
206
+ const selectedValue = event.currentTarget?.dataset?.value;
209
207
  // istanbul ignore else
210
208
  if (undefined !== selectedValue) {
211
209
  onListboxValueChange(selectedValue, event.ctrlKey);