@skbkontur/react-ui 0.0.0-68e286f9fe → 0.0.0-6911f001e4

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 (800) hide show
  1. package/CHANGELOG.md +182 -0
  2. package/README.md +6 -6
  3. package/cjs/components/Autocomplete/Autocomplete.d.ts +18 -4
  4. package/cjs/components/Autocomplete/Autocomplete.js +73 -15
  5. package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  6. package/cjs/components/Button/Button.d.ts +4 -1
  7. package/cjs/components/Button/Button.js +47 -17
  8. package/cjs/components/Button/Button.js.map +1 -1
  9. package/cjs/components/Button/Button.styles.d.ts +6 -0
  10. package/cjs/components/Button/Button.styles.js +107 -75
  11. package/cjs/components/Button/Button.styles.js.map +1 -1
  12. package/cjs/components/Button/ButtonArrow.js +13 -14
  13. package/cjs/components/Button/ButtonArrow.js.map +1 -1
  14. package/cjs/components/Calendar/Calendar.d.ts +2 -0
  15. package/cjs/components/Calendar/Calendar.js +1 -0
  16. package/cjs/components/Calendar/Calendar.js.map +1 -1
  17. package/cjs/components/Center/Center.d.ts +2 -0
  18. package/cjs/components/Center/Center.js +1 -0
  19. package/cjs/components/Center/Center.js.map +1 -1
  20. package/cjs/components/Checkbox/Checkbox.d.ts +4 -4
  21. package/cjs/components/Checkbox/Checkbox.js +16 -19
  22. package/cjs/components/Checkbox/Checkbox.js.map +1 -1
  23. package/cjs/components/ComboBox/ComboBox.d.ts +20 -7
  24. package/cjs/components/ComboBox/ComboBox.js +19 -1
  25. package/cjs/components/ComboBox/ComboBox.js.map +1 -1
  26. package/cjs/components/CurrencyInput/CurrencyInput.d.ts +5 -0
  27. package/cjs/components/CurrencyInput/CurrencyInput.js +9 -1
  28. package/cjs/components/CurrencyInput/CurrencyInput.js.map +1 -1
  29. package/cjs/components/CurrencyInput/constants.js +1 -2
  30. package/cjs/components/CurrencyInput/constants.js.map +1 -1
  31. package/cjs/components/CurrencyLabel/CurrencyLabel.js +2 -3
  32. package/cjs/components/CurrencyLabel/CurrencyLabel.js.map +1 -1
  33. package/cjs/components/DateInput/DateInput.d.ts +5 -1
  34. package/cjs/components/DateInput/DateInput.js +9 -4
  35. package/cjs/components/DateInput/DateInput.js.map +1 -1
  36. package/cjs/components/DatePicker/DatePicker.d.ts +2 -0
  37. package/cjs/components/DatePicker/DatePicker.js +1 -0
  38. package/cjs/components/DatePicker/DatePicker.js.map +1 -1
  39. package/cjs/components/DatePicker/MobilePicker.js +1 -0
  40. package/cjs/components/DatePicker/MobilePicker.js.map +1 -1
  41. package/cjs/components/DateRangePicker/DateRangePicker.js +1 -0
  42. package/cjs/components/DateRangePicker/DateRangePicker.js.map +1 -1
  43. package/cjs/components/Dropdown/Dropdown.d.ts +2 -0
  44. package/cjs/components/Dropdown/Dropdown.js +1 -0
  45. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  46. package/cjs/components/DropdownMenu/DropdownMenu.d.ts +4 -2
  47. package/cjs/components/DropdownMenu/DropdownMenu.js +1 -0
  48. package/cjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
  49. package/cjs/components/FileUploader/FileUploader.js +1 -0
  50. package/cjs/components/FileUploader/FileUploader.js.map +1 -1
  51. package/cjs/components/FxInput/FxInput.d.ts +12 -2
  52. package/cjs/components/FxInput/FxInput.js +141 -58
  53. package/cjs/components/FxInput/FxInput.js.map +1 -1
  54. package/cjs/components/FxInput/FxInputRestoreBtn.js +2 -3
  55. package/cjs/components/FxInput/FxInputRestoreBtn.js.map +1 -1
  56. package/cjs/components/Gapped/Gapped.d.ts +2 -0
  57. package/cjs/components/Gapped/Gapped.js +1 -0
  58. package/cjs/components/Gapped/Gapped.js.map +1 -1
  59. package/cjs/components/GlobalLoader/GlobalLoader.d.ts +2 -0
  60. package/cjs/components/GlobalLoader/GlobalLoader.js +1 -0
  61. package/cjs/components/GlobalLoader/GlobalLoader.js.map +1 -1
  62. package/cjs/components/Group/Group.d.ts +2 -0
  63. package/cjs/components/Group/Group.js +1 -0
  64. package/cjs/components/Group/Group.js.map +1 -1
  65. package/cjs/components/Hint/Hint.d.ts +2 -0
  66. package/cjs/components/Hint/Hint.js +1 -0
  67. package/cjs/components/Hint/Hint.js.map +1 -1
  68. package/cjs/components/Input/Input.d.ts +6 -5
  69. package/cjs/components/Input/Input.js +17 -47
  70. package/cjs/components/Input/Input.js.map +1 -1
  71. package/cjs/components/Input/Input.styles.d.ts +0 -1
  72. package/cjs/components/Input/Input.styles.js +8 -19
  73. package/cjs/components/Input/Input.styles.js.map +1 -1
  74. package/cjs/components/Kebab/Kebab.d.ts +4 -1
  75. package/cjs/components/Kebab/Kebab.js +10 -5
  76. package/cjs/components/Kebab/Kebab.js.map +1 -1
  77. package/cjs/components/Link/Link.d.ts +2 -0
  78. package/cjs/components/Link/Link.js +10 -1
  79. package/cjs/components/Link/Link.js.map +1 -1
  80. package/cjs/components/Loader/Loader.d.ts +3 -0
  81. package/cjs/components/Loader/Loader.js +6 -1
  82. package/cjs/components/Loader/Loader.js.map +1 -1
  83. package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.d.ts +1 -0
  84. package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.js +107 -78
  85. package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.js.map +1 -1
  86. package/cjs/components/MaskedInput/FixedIMaskInput.js +3 -2
  87. package/cjs/components/MaskedInput/FixedIMaskInput.js.map +1 -1
  88. package/cjs/components/MaskedInput/MaskedInput.d.ts +9 -0
  89. package/cjs/components/MaskedInput/MaskedInput.js +43 -4
  90. package/cjs/components/MaskedInput/MaskedInput.js.map +1 -1
  91. package/cjs/components/MenuItem/MenuItem.d.ts +3 -0
  92. package/cjs/components/MenuItem/MenuItem.js +15 -2
  93. package/cjs/components/MenuItem/MenuItem.js.map +1 -1
  94. package/cjs/components/MenuItem/MenuItem.styles.d.ts +3 -1
  95. package/cjs/components/MenuItem/MenuItem.styles.js +35 -21
  96. package/cjs/components/MenuItem/MenuItem.styles.js.map +1 -1
  97. package/cjs/components/Modal/Modal.styles.d.ts +1 -0
  98. package/cjs/components/Modal/Modal.styles.js +36 -28
  99. package/cjs/components/Modal/Modal.styles.js.map +1 -1
  100. package/cjs/components/Modal/ModalBody.d.ts +2 -0
  101. package/cjs/components/Modal/ModalBody.js +1 -0
  102. package/cjs/components/Modal/ModalBody.js.map +1 -1
  103. package/cjs/components/Modal/ModalHeader.d.ts +5 -0
  104. package/cjs/components/Modal/ModalHeader.js +8 -1
  105. package/cjs/components/Modal/ModalHeader.js.map +1 -1
  106. package/cjs/components/Paging/DotsIcon.d.ts +3 -0
  107. package/cjs/components/Paging/DotsIcon.js +13 -0
  108. package/cjs/components/Paging/DotsIcon.js.map +1 -0
  109. package/cjs/components/Paging/ForwardIcon.d.ts +3 -0
  110. package/cjs/components/Paging/ForwardIcon.js +13 -1
  111. package/cjs/components/Paging/ForwardIcon.js.map +1 -1
  112. package/cjs/components/Paging/NavigationHelper.d.ts +3 -2
  113. package/cjs/components/Paging/NavigationHelper.js +8 -6
  114. package/cjs/components/Paging/NavigationHelper.js.map +1 -1
  115. package/cjs/components/Paging/Paging.d.ts +13 -1
  116. package/cjs/components/Paging/Paging.js +120 -24
  117. package/cjs/components/Paging/Paging.js.map +1 -1
  118. package/cjs/components/Paging/Paging.styles.d.ts +24 -1
  119. package/cjs/components/Paging/Paging.styles.js +151 -22
  120. package/cjs/components/Paging/Paging.styles.js.map +1 -1
  121. package/cjs/components/Paging/PagingHelper.d.ts +1 -1
  122. package/cjs/components/Paging/PagingHelper.js +18 -11
  123. package/cjs/components/Paging/PagingHelper.js.map +1 -1
  124. package/cjs/components/PasswordInput/PasswordInput.d.ts +5 -5
  125. package/cjs/components/PasswordInput/PasswordInput.js +21 -22
  126. package/cjs/components/PasswordInput/PasswordInput.js.map +1 -1
  127. package/cjs/components/Radio/Radio.d.ts +4 -1
  128. package/cjs/components/Radio/Radio.js +7 -4
  129. package/cjs/components/Radio/Radio.js.map +1 -1
  130. package/cjs/components/RadioGroup/RadioGroup.d.ts +2 -0
  131. package/cjs/components/RadioGroup/RadioGroup.js +1 -0
  132. package/cjs/components/RadioGroup/RadioGroup.js.map +1 -1
  133. package/cjs/components/ScrollContainer/ScrollContainer.d.ts +2 -0
  134. package/cjs/components/ScrollContainer/ScrollContainer.js +1 -0
  135. package/cjs/components/ScrollContainer/ScrollContainer.js.map +1 -1
  136. package/cjs/components/Select/Select.d.ts +4 -1
  137. package/cjs/components/Select/Select.js +11 -6
  138. package/cjs/components/Select/Select.js.map +1 -1
  139. package/cjs/components/SidePage/SidePage.js +3 -1
  140. package/cjs/components/SidePage/SidePage.js.map +1 -1
  141. package/cjs/components/SidePage/SidePage.styles.d.ts +3 -1
  142. package/cjs/components/SidePage/SidePage.styles.js +52 -38
  143. package/cjs/components/SidePage/SidePage.styles.js.map +1 -1
  144. package/cjs/components/SidePage/SidePageBody.d.ts +2 -0
  145. package/cjs/components/SidePage/SidePageBody.js +1 -0
  146. package/cjs/components/SidePage/SidePageBody.js.map +1 -1
  147. package/cjs/components/SidePage/SidePageContainer.d.ts +2 -0
  148. package/cjs/components/SidePage/SidePageContainer.js +1 -0
  149. package/cjs/components/SidePage/SidePageContainer.js.map +1 -1
  150. package/cjs/components/SidePage/SidePageFooter.d.ts +2 -0
  151. package/cjs/components/SidePage/SidePageFooter.js +1 -0
  152. package/cjs/components/SidePage/SidePageFooter.js.map +1 -1
  153. package/cjs/components/SidePage/SidePageHeader.d.ts +12 -2
  154. package/cjs/components/SidePage/SidePageHeader.js +60 -19
  155. package/cjs/components/SidePage/SidePageHeader.js.map +1 -1
  156. package/cjs/components/SingleToast/SingleToast.d.ts +32 -2
  157. package/cjs/components/SingleToast/SingleToast.js +58 -3
  158. package/cjs/components/SingleToast/SingleToast.js.map +1 -1
  159. package/cjs/components/Spinner/Spinner.d.ts +2 -0
  160. package/cjs/components/Spinner/Spinner.js +1 -0
  161. package/cjs/components/Spinner/Spinner.js.map +1 -1
  162. package/cjs/components/Sticky/Sticky.d.ts +2 -0
  163. package/cjs/components/Sticky/Sticky.js +1 -0
  164. package/cjs/components/Sticky/Sticky.js.map +1 -1
  165. package/cjs/components/Switcher/Switcher.d.ts +2 -0
  166. package/cjs/components/Switcher/Switcher.js +1 -0
  167. package/cjs/components/Switcher/Switcher.js.map +1 -1
  168. package/cjs/components/Tabs/Indicator.d.ts +2 -0
  169. package/cjs/components/Tabs/Indicator.js +1 -0
  170. package/cjs/components/Tabs/Indicator.js.map +1 -1
  171. package/cjs/components/Tabs/Tab.d.ts +2 -0
  172. package/cjs/components/Tabs/Tab.js +1 -0
  173. package/cjs/components/Tabs/Tab.js.map +1 -1
  174. package/cjs/components/Tabs/Tabs.d.ts +2 -0
  175. package/cjs/components/Tabs/Tabs.js +1 -0
  176. package/cjs/components/Tabs/Tabs.js.map +1 -1
  177. package/cjs/components/Textarea/Textarea.d.ts +4 -1
  178. package/cjs/components/Textarea/Textarea.js +9 -4
  179. package/cjs/components/Textarea/Textarea.js.map +1 -1
  180. package/cjs/components/Textarea/Textarea.styles.js +3 -3
  181. package/cjs/components/Textarea/Textarea.styles.js.map +1 -1
  182. package/cjs/components/Toast/Toast.d.ts +56 -9
  183. package/cjs/components/Toast/Toast.js +104 -11
  184. package/cjs/components/Toast/Toast.js.map +1 -1
  185. package/cjs/components/Toast/ToastView.d.ts +7 -1
  186. package/cjs/components/Toast/ToastView.js +22 -5
  187. package/cjs/components/Toast/ToastView.js.map +1 -1
  188. package/cjs/components/Toast/ToastView.styles.d.ts +4 -0
  189. package/cjs/components/Toast/ToastView.styles.js +43 -9
  190. package/cjs/components/Toast/ToastView.styles.js.map +1 -1
  191. package/cjs/components/Toggle/Toggle.d.ts +4 -1
  192. package/cjs/components/Toggle/Toggle.js +6 -5
  193. package/cjs/components/Toggle/Toggle.js.map +1 -1
  194. package/cjs/components/Token/Token.d.ts +2 -0
  195. package/cjs/components/Token/Token.js +1 -0
  196. package/cjs/components/Token/Token.js.map +1 -1
  197. package/cjs/components/TokenInput/TokenInput.d.ts +6 -1
  198. package/cjs/components/TokenInput/TokenInput.js +43 -30
  199. package/cjs/components/TokenInput/TokenInput.js.map +1 -1
  200. package/cjs/components/Tooltip/Tooltip.d.ts +12 -5
  201. package/cjs/components/Tooltip/Tooltip.js +100 -13
  202. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  203. package/cjs/components/Tooltip/Tooltip.styles.d.ts +7 -1
  204. package/cjs/components/Tooltip/Tooltip.styles.js +50 -12
  205. package/cjs/components/Tooltip/Tooltip.styles.js.map +1 -1
  206. package/cjs/components/TooltipMenu/TooltipMenu.d.ts +4 -2
  207. package/cjs/components/TooltipMenu/TooltipMenu.js +1 -0
  208. package/cjs/components/TooltipMenu/TooltipMenu.js.map +1 -1
  209. package/cjs/index.d.ts +1 -0
  210. package/cjs/index.js +1 -0
  211. package/cjs/index.js.map +1 -1
  212. package/cjs/internal/ClearCrossIcon/ClearCrossIcon.styles.js +4 -4
  213. package/cjs/internal/ClearCrossIcon/ClearCrossIcon.styles.js.map +1 -1
  214. package/cjs/internal/CommonWrapper/CommonWrapper.d.ts +2 -0
  215. package/cjs/internal/CommonWrapper/CommonWrapper.js +1 -0
  216. package/cjs/internal/CommonWrapper/CommonWrapper.js.map +1 -1
  217. package/cjs/internal/CustomComboBox/ComboBoxView.d.ts +8 -4
  218. package/cjs/internal/CustomComboBox/ComboBoxView.js +35 -25
  219. package/cjs/internal/CustomComboBox/ComboBoxView.js.map +1 -1
  220. package/cjs/internal/CustomComboBox/CustomComboBox.d.ts +7 -2
  221. package/cjs/internal/CustomComboBox/CustomComboBox.js +17 -5
  222. package/cjs/internal/CustomComboBox/CustomComboBox.js.map +1 -1
  223. package/cjs/internal/CustomComboBox/getComboBoxTheme.d.ts +2 -1
  224. package/cjs/internal/CustomComboBox/getComboBoxTheme.js +10 -7
  225. package/cjs/internal/CustomComboBox/getComboBoxTheme.js.map +1 -1
  226. package/cjs/internal/DateSelect/DateSelect.js +1 -1
  227. package/cjs/internal/DateSelect/DateSelect.js.map +1 -1
  228. package/cjs/internal/FocusTrap/FocusTrap.d.ts +2 -0
  229. package/cjs/internal/FocusTrap/FocusTrap.js +1 -0
  230. package/cjs/internal/FocusTrap/FocusTrap.js.map +1 -1
  231. package/cjs/internal/IgnoreLayerClick/IgnoreLayerClick.js +1 -0
  232. package/cjs/internal/IgnoreLayerClick/IgnoreLayerClick.js.map +1 -1
  233. package/cjs/internal/InputLikeText/InputLikeText.d.ts +4 -3
  234. package/cjs/internal/InputLikeText/InputLikeText.js +13 -14
  235. package/cjs/internal/InputLikeText/InputLikeText.js.map +1 -1
  236. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.d.ts +1 -0
  237. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.js +23 -21
  238. package/cjs/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.js.map +1 -1
  239. package/cjs/internal/Menu/Menu.d.ts +2 -0
  240. package/cjs/internal/Menu/Menu.js +1 -0
  241. package/cjs/internal/Menu/Menu.js.map +1 -1
  242. package/cjs/internal/MenuMessage/MenuMessage.js +13 -1
  243. package/cjs/internal/MenuMessage/MenuMessage.js.map +1 -1
  244. package/cjs/internal/MenuMessage/MenuMessage.styles.d.ts +3 -1
  245. package/cjs/internal/MenuMessage/MenuMessage.styles.js +24 -8
  246. package/cjs/internal/MenuMessage/MenuMessage.styles.js.map +1 -1
  247. package/cjs/internal/MobilePopup/MobilePopup.d.ts +9 -0
  248. package/cjs/internal/MobilePopup/MobilePopup.js +24 -1
  249. package/cjs/internal/MobilePopup/MobilePopup.js.map +1 -1
  250. package/cjs/internal/MobilePopup/MobilePopup.styles.d.ts +7 -3
  251. package/cjs/internal/MobilePopup/MobilePopup.styles.js +55 -19
  252. package/cjs/internal/MobilePopup/MobilePopup.styles.js.map +1 -1
  253. package/cjs/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.d.ts +8 -1
  254. package/cjs/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.js +36 -18
  255. package/cjs/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.js.map +1 -1
  256. package/cjs/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.d.ts +3 -0
  257. package/cjs/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.js +23 -3
  258. package/cjs/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.js.map +1 -1
  259. package/cjs/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.d.ts +3 -0
  260. package/cjs/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.js +31 -33
  261. package/cjs/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.js.map +1 -1
  262. package/cjs/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.d.ts +3 -2
  263. package/cjs/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.js +22 -13
  264. package/cjs/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.js.map +1 -1
  265. package/cjs/internal/Popup/Popup.d.ts +2 -0
  266. package/cjs/internal/Popup/Popup.js +14 -3
  267. package/cjs/internal/Popup/Popup.js.map +1 -1
  268. package/cjs/internal/Popup/PopupPinNew.d.ts +31 -0
  269. package/cjs/internal/Popup/PopupPinNew.js +180 -0
  270. package/cjs/internal/Popup/PopupPinNew.js.map +1 -0
  271. package/cjs/internal/Popup/PopupPinNew.styles.d.ts +7 -0
  272. package/cjs/internal/Popup/PopupPinNew.styles.js +33 -0
  273. package/cjs/internal/Popup/PopupPinNew.styles.js.map +1 -0
  274. package/cjs/internal/PopupMenu/PopupMenu.d.ts +2 -0
  275. package/cjs/internal/PopupMenu/PopupMenu.js +1 -0
  276. package/cjs/internal/PopupMenu/PopupMenu.js.map +1 -1
  277. package/cjs/internal/RenderLayer/RenderLayer.d.ts +2 -0
  278. package/cjs/internal/RenderLayer/RenderLayer.js +1 -0
  279. package/cjs/internal/RenderLayer/RenderLayer.js.map +1 -1
  280. package/cjs/internal/ThemePlayground/Playground.js +5 -1
  281. package/cjs/internal/ThemePlayground/Playground.js.map +1 -1
  282. package/cjs/internal/ThemePlayground/Playground.styles.js +5 -8
  283. package/cjs/internal/ThemePlayground/Playground.styles.js.map +1 -1
  284. package/cjs/internal/ThemePlayground/ShowcaseGroup.js +12 -1
  285. package/cjs/internal/ThemePlayground/ShowcaseGroup.js.map +1 -1
  286. package/cjs/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  287. package/cjs/internal/ZIndex/ZIndex.d.ts +2 -0
  288. package/cjs/internal/ZIndex/ZIndex.js +1 -0
  289. package/cjs/internal/ZIndex/ZIndex.js.map +1 -1
  290. package/cjs/internal/icons2022/UiMenuDots3HIcon/UiMenuDots3HIcon16Regular.d.ts +2 -0
  291. package/cjs/internal/icons2022/UiMenuDots3HIcon/UiMenuDots3HIcon16Regular.js +16 -0
  292. package/cjs/internal/icons2022/UiMenuDots3HIcon/UiMenuDots3HIcon16Regular.js.map +1 -0
  293. package/cjs/internal/themes/BasicTheme.d.ts +147 -28
  294. package/cjs/internal/themes/BasicTheme.js +800 -33
  295. package/cjs/internal/themes/BasicTheme.js.map +1 -1
  296. package/cjs/internal/themes/DarkTheme5_4.d.ts +1 -0
  297. package/cjs/internal/themes/DarkTheme5_4.js +18 -0
  298. package/cjs/internal/themes/DarkTheme5_4.js.map +1 -0
  299. package/cjs/internal/themes/LightTheme5_4.d.ts +1 -0
  300. package/cjs/internal/themes/LightTheme5_4.js +18 -0
  301. package/cjs/internal/themes/LightTheme5_4.js.map +1 -0
  302. package/cjs/internal/themes/consts.d.ts +8 -0
  303. package/cjs/internal/themes/consts.js +8 -0
  304. package/cjs/internal/themes/consts.js.map +1 -0
  305. package/cjs/lib/__stories__/Blink.creevey.mts +90 -0
  306. package/cjs/lib/blink.d.ts +15 -0
  307. package/cjs/lib/blink.js +65 -0
  308. package/cjs/lib/blink.js.map +1 -0
  309. package/cjs/lib/delay.mts +3 -0
  310. package/cjs/lib/featureFlagsContext/FeatureFlagsHelpers.d.ts +6 -0
  311. package/cjs/lib/featureFlagsContext/ReactUIFeatureFlagsContext.d.ts +6 -0
  312. package/cjs/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js +13 -1
  313. package/cjs/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js.map +1 -1
  314. package/cjs/lib/rootNode/rootNodeDecorator.d.ts +2 -1
  315. package/cjs/lib/rootNode/rootNodeDecorator.js +1 -0
  316. package/cjs/lib/rootNode/rootNodeDecorator.js.map +1 -1
  317. package/cjs/lib/size/SizeControlContext.d.ts +6 -0
  318. package/cjs/lib/size/SizeControlContext.js +16 -0
  319. package/cjs/lib/size/SizeControlContext.js.map +1 -0
  320. package/cjs/lib/size/SizeDecorator.d.ts +33 -0
  321. package/cjs/lib/size/SizeDecorator.js +41 -0
  322. package/cjs/lib/size/SizeDecorator.js.map +1 -0
  323. package/cjs/lib/size/constants.d.ts +2 -0
  324. package/cjs/lib/size/constants.js +3 -0
  325. package/cjs/lib/size/constants.js.map +1 -0
  326. package/cjs/lib/size/index.d.ts +1 -0
  327. package/cjs/lib/size/index.js +1 -0
  328. package/cjs/lib/size/index.js.map +1 -0
  329. package/cjs/lib/size/useSizeControl.d.ts +2 -0
  330. package/cjs/lib/size/useSizeControl.js +10 -0
  331. package/cjs/lib/size/useSizeControl.js.map +1 -0
  332. package/cjs/lib/theming/ThemeVersions.d.ts +1 -1
  333. package/cjs/lib/theming/ThemeVersions.js.map +1 -1
  334. package/cjs/lib/theming/themes/DarkTheme.d.ts +1 -0
  335. package/cjs/lib/theming/themes/DarkTheme.js +4 -2
  336. package/cjs/lib/theming/themes/DarkTheme.js.map +1 -1
  337. package/cjs/lib/theming/themes/LightTheme.d.ts +1 -0
  338. package/cjs/lib/theming/themes/LightTheme.js +4 -2
  339. package/cjs/lib/theming/themes/LightTheme.js.map +1 -1
  340. package/cjs/lib/utils.d.ts +13 -0
  341. package/cjs/lib/utils.js +34 -1
  342. package/cjs/lib/utils.js.map +1 -1
  343. package/components/Autocomplete/Autocomplete/Autocomplete.js +72 -32
  344. package/components/Autocomplete/Autocomplete/Autocomplete.js.map +1 -1
  345. package/components/Autocomplete/Autocomplete.d.ts +18 -4
  346. package/components/Button/Button/Button.js +45 -24
  347. package/components/Button/Button/Button.js.map +1 -1
  348. package/components/Button/Button.d.ts +4 -1
  349. package/components/Button/Button.styles/Button.styles.js +78 -60
  350. package/components/Button/Button.styles/Button.styles.js.map +1 -1
  351. package/components/Button/Button.styles.d.ts +6 -0
  352. package/components/Button/ButtonArrow/ButtonArrow.js +1 -3
  353. package/components/Button/ButtonArrow/ButtonArrow.js.map +1 -1
  354. package/components/Calendar/Calendar/Calendar.js.map +1 -1
  355. package/components/Calendar/Calendar.d.ts +2 -0
  356. package/components/Center/Center/Center.js.map +1 -1
  357. package/components/Center/Center.d.ts +2 -0
  358. package/components/Checkbox/Checkbox/Checkbox.js +12 -13
  359. package/components/Checkbox/Checkbox/Checkbox.js.map +1 -1
  360. package/components/Checkbox/Checkbox.d.ts +4 -4
  361. package/components/ComboBox/ComboBox/ComboBox.js +1 -1
  362. package/components/ComboBox/ComboBox/ComboBox.js.map +1 -1
  363. package/components/ComboBox/ComboBox.d.ts +20 -7
  364. package/components/CurrencyInput/CurrencyInput/CurrencyInput.js +6 -2
  365. package/components/CurrencyInput/CurrencyInput/CurrencyInput.js.map +1 -1
  366. package/components/CurrencyInput/CurrencyInput.d.ts +5 -0
  367. package/components/CurrencyInput/constants/constants.js +0 -1
  368. package/components/CurrencyInput/constants/constants.js.map +1 -1
  369. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js +1 -1
  370. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js.map +1 -1
  371. package/components/DateInput/DateInput/DateInput.js +9 -8
  372. package/components/DateInput/DateInput/DateInput.js.map +1 -1
  373. package/components/DateInput/DateInput.d.ts +5 -1
  374. package/components/DatePicker/DatePicker/DatePicker.js.map +1 -1
  375. package/components/DatePicker/DatePicker.d.ts +2 -0
  376. package/components/DatePicker/MobilePicker/MobilePicker.js +1 -0
  377. package/components/DatePicker/MobilePicker/MobilePicker.js.map +1 -1
  378. package/components/DateRangePicker/DateRangePicker/DateRangePicker.js +1 -0
  379. package/components/DateRangePicker/DateRangePicker/DateRangePicker.js.map +1 -1
  380. package/components/Dropdown/Dropdown/Dropdown.js.map +1 -1
  381. package/components/Dropdown/Dropdown.d.ts +2 -0
  382. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js.map +1 -1
  383. package/components/DropdownMenu/DropdownMenu.d.ts +4 -2
  384. package/components/FileUploader/FileUploader/FileUploader.js +1 -0
  385. package/components/FileUploader/FileUploader/FileUploader.js.map +1 -1
  386. package/components/FxInput/FxInput/FxInput.js +121 -65
  387. package/components/FxInput/FxInput/FxInput.js.map +1 -1
  388. package/components/FxInput/FxInput.d.ts +12 -2
  389. package/components/FxInput/FxInputRestoreBtn/FxInputRestoreBtn.js +2 -2
  390. package/components/FxInput/FxInputRestoreBtn/FxInputRestoreBtn.js.map +1 -1
  391. package/components/Gapped/Gapped/Gapped.js.map +1 -1
  392. package/components/Gapped/Gapped.d.ts +2 -0
  393. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js.map +1 -1
  394. package/components/GlobalLoader/GlobalLoader.d.ts +2 -0
  395. package/components/Group/Group/Group.js.map +1 -1
  396. package/components/Group/Group.d.ts +2 -0
  397. package/components/Hint/Hint/Hint.js.map +1 -1
  398. package/components/Hint/Hint.d.ts +2 -0
  399. package/components/Input/Input/Input.js +23 -52
  400. package/components/Input/Input/Input.js.map +1 -1
  401. package/components/Input/Input.d.ts +6 -5
  402. package/components/Input/Input.styles/Input.styles.js +9 -13
  403. package/components/Input/Input.styles/Input.styles.js.map +1 -1
  404. package/components/Input/Input.styles.d.ts +0 -1
  405. package/components/Kebab/Kebab/Kebab.js +7 -7
  406. package/components/Kebab/Kebab/Kebab.js.map +1 -1
  407. package/components/Kebab/Kebab.d.ts +4 -1
  408. package/components/Link/Link/Link.js +4 -1
  409. package/components/Link/Link/Link.js.map +1 -1
  410. package/components/Link/Link.d.ts +2 -0
  411. package/components/Loader/Loader/Loader.js +2 -1
  412. package/components/Loader/Loader/Loader.js.map +1 -1
  413. package/components/Loader/Loader.d.ts +3 -0
  414. package/components/MaskedInput/ColorableInputElement/ColorableInputElement/ColorableInputElement.js +81 -66
  415. package/components/MaskedInput/ColorableInputElement/ColorableInputElement/ColorableInputElement.js.map +1 -1
  416. package/components/MaskedInput/ColorableInputElement/ColorableInputElement.d.ts +1 -0
  417. package/components/MaskedInput/FixedIMaskInput/FixedIMaskInput.js +3 -2
  418. package/components/MaskedInput/FixedIMaskInput/FixedIMaskInput.js.map +1 -1
  419. package/components/MaskedInput/MaskedInput/MaskedInput.js +28 -2
  420. package/components/MaskedInput/MaskedInput/MaskedInput.js.map +1 -1
  421. package/components/MaskedInput/MaskedInput.d.ts +9 -0
  422. package/components/MenuItem/MenuItem/MenuItem.js +12 -1
  423. package/components/MenuItem/MenuItem/MenuItem.js.map +1 -1
  424. package/components/MenuItem/MenuItem.d.ts +3 -0
  425. package/components/MenuItem/MenuItem.styles/MenuItem.styles.js +25 -19
  426. package/components/MenuItem/MenuItem.styles/MenuItem.styles.js.map +1 -1
  427. package/components/MenuItem/MenuItem.styles.d.ts +3 -1
  428. package/components/Modal/Modal.styles/Modal.styles.js +31 -28
  429. package/components/Modal/Modal.styles/Modal.styles.js.map +1 -1
  430. package/components/Modal/Modal.styles.d.ts +1 -0
  431. package/components/Modal/ModalBody/ModalBody.js.map +1 -1
  432. package/components/Modal/ModalBody.d.ts +2 -0
  433. package/components/Modal/ModalHeader/ModalHeader.js +3 -1
  434. package/components/Modal/ModalHeader/ModalHeader.js.map +1 -1
  435. package/components/Modal/ModalHeader.d.ts +5 -0
  436. package/components/Paging/DotsIcon/DotsIcon.js +14 -0
  437. package/components/Paging/DotsIcon/DotsIcon.js.map +1 -0
  438. package/components/Paging/DotsIcon/package.json +6 -0
  439. package/components/Paging/DotsIcon.d.ts +3 -0
  440. package/components/Paging/ForwardIcon/ForwardIcon.js +15 -1
  441. package/components/Paging/ForwardIcon/ForwardIcon.js.map +1 -1
  442. package/components/Paging/ForwardIcon.d.ts +3 -0
  443. package/components/Paging/NavigationHelper/NavigationHelper.js +9 -8
  444. package/components/Paging/NavigationHelper/NavigationHelper.js.map +1 -1
  445. package/components/Paging/NavigationHelper.d.ts +3 -2
  446. package/components/Paging/Paging/Paging.js +95 -25
  447. package/components/Paging/Paging/Paging.js.map +1 -1
  448. package/components/Paging/Paging.d.ts +13 -1
  449. package/components/Paging/Paging.styles/Paging.styles.js +77 -16
  450. package/components/Paging/Paging.styles/Paging.styles.js.map +1 -1
  451. package/components/Paging/Paging.styles.d.ts +24 -1
  452. package/components/Paging/PagingHelper/PagingHelper.js +16 -8
  453. package/components/Paging/PagingHelper/PagingHelper.js.map +1 -1
  454. package/components/Paging/PagingHelper.d.ts +1 -1
  455. package/components/PasswordInput/PasswordInput/PasswordInput.js +13 -19
  456. package/components/PasswordInput/PasswordInput/PasswordInput.js.map +1 -1
  457. package/components/PasswordInput/PasswordInput.d.ts +5 -5
  458. package/components/Radio/Radio/Radio.js +7 -7
  459. package/components/Radio/Radio/Radio.js.map +1 -1
  460. package/components/Radio/Radio.d.ts +4 -1
  461. package/components/RadioGroup/RadioGroup/RadioGroup.js.map +1 -1
  462. package/components/RadioGroup/RadioGroup.d.ts +2 -0
  463. package/components/ScrollContainer/ScrollContainer/ScrollContainer.js.map +1 -1
  464. package/components/ScrollContainer/ScrollContainer.d.ts +2 -0
  465. package/components/Select/Select/Select.js +17 -15
  466. package/components/Select/Select/Select.js.map +1 -1
  467. package/components/Select/Select.d.ts +4 -1
  468. package/components/SidePage/SidePage/SidePage.js +2 -2
  469. package/components/SidePage/SidePage/SidePage.js.map +1 -1
  470. package/components/SidePage/SidePage.styles/SidePage.styles.js +41 -35
  471. package/components/SidePage/SidePage.styles/SidePage.styles.js.map +1 -1
  472. package/components/SidePage/SidePage.styles.d.ts +3 -1
  473. package/components/SidePage/SidePageBody/SidePageBody.js.map +1 -1
  474. package/components/SidePage/SidePageBody.d.ts +2 -0
  475. package/components/SidePage/SidePageContainer/SidePageContainer.js.map +1 -1
  476. package/components/SidePage/SidePageContainer.d.ts +2 -0
  477. package/components/SidePage/SidePageFooter/SidePageFooter.js.map +1 -1
  478. package/components/SidePage/SidePageFooter.d.ts +2 -0
  479. package/components/SidePage/SidePageHeader/SidePageHeader.js +61 -39
  480. package/components/SidePage/SidePageHeader/SidePageHeader.js.map +1 -1
  481. package/components/SidePage/SidePageHeader.d.ts +12 -2
  482. package/components/SingleToast/SingleToast/SingleToast.js +37 -12
  483. package/components/SingleToast/SingleToast/SingleToast.js.map +1 -1
  484. package/components/SingleToast/SingleToast.d.ts +32 -2
  485. package/components/Spinner/Spinner/Spinner.js.map +1 -1
  486. package/components/Spinner/Spinner.d.ts +2 -0
  487. package/components/Sticky/Sticky/Sticky.js.map +1 -1
  488. package/components/Sticky/Sticky.d.ts +2 -0
  489. package/components/Switcher/Switcher/Switcher.js.map +1 -1
  490. package/components/Switcher/Switcher.d.ts +2 -0
  491. package/components/Tabs/Indicator/Indicator.js.map +1 -1
  492. package/components/Tabs/Indicator.d.ts +2 -0
  493. package/components/Tabs/Tab/Tab.js.map +1 -1
  494. package/components/Tabs/Tab.d.ts +2 -0
  495. package/components/Tabs/Tabs/Tabs.js.map +1 -1
  496. package/components/Tabs/Tabs.d.ts +2 -0
  497. package/components/Textarea/Textarea/Textarea.js +7 -6
  498. package/components/Textarea/Textarea/Textarea.js.map +1 -1
  499. package/components/Textarea/Textarea.d.ts +4 -1
  500. package/components/Textarea/Textarea.styles/Textarea.styles.js +1 -1
  501. package/components/Textarea/Textarea.styles/Textarea.styles.js.map +1 -1
  502. package/components/Toast/Toast/Toast.js +86 -23
  503. package/components/Toast/Toast/Toast.js.map +1 -1
  504. package/components/Toast/Toast.d.ts +56 -9
  505. package/components/Toast/ToastView/ToastView.js +17 -5
  506. package/components/Toast/ToastView/ToastView.js.map +1 -1
  507. package/components/Toast/ToastView.d.ts +7 -1
  508. package/components/Toast/ToastView.styles/ToastView.styles.js +17 -5
  509. package/components/Toast/ToastView.styles/ToastView.styles.js.map +1 -1
  510. package/components/Toast/ToastView.styles.d.ts +4 -0
  511. package/components/Toggle/Toggle/Toggle.js +10 -10
  512. package/components/Toggle/Toggle/Toggle.js.map +1 -1
  513. package/components/Toggle/Toggle.d.ts +4 -1
  514. package/components/Token/Token/Token.js.map +1 -1
  515. package/components/Token/Token.d.ts +2 -0
  516. package/components/TokenInput/TokenInput/TokenInput.js +47 -42
  517. package/components/TokenInput/TokenInput/TokenInput.js.map +1 -1
  518. package/components/TokenInput/TokenInput.d.ts +6 -1
  519. package/components/Tooltip/Tooltip/Tooltip.js +69 -19
  520. package/components/Tooltip/Tooltip/Tooltip.js.map +1 -1
  521. package/components/Tooltip/Tooltip.d.ts +12 -5
  522. package/components/Tooltip/Tooltip.styles/Tooltip.styles.js +22 -4
  523. package/components/Tooltip/Tooltip.styles/Tooltip.styles.js.map +1 -1
  524. package/components/Tooltip/Tooltip.styles.d.ts +7 -1
  525. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js.map +1 -1
  526. package/components/TooltipMenu/TooltipMenu.d.ts +4 -2
  527. package/index.d.ts +1 -0
  528. package/index.js +1 -0
  529. package/index.js.map +1 -1
  530. package/internal/ClearCrossIcon/ClearCrossIcon.styles/ClearCrossIcon.styles.js +1 -1
  531. package/internal/ClearCrossIcon/ClearCrossIcon.styles/ClearCrossIcon.styles.js.map +1 -1
  532. package/internal/CommonWrapper/CommonWrapper/CommonWrapper.js.map +1 -1
  533. package/internal/CommonWrapper/CommonWrapper.d.ts +2 -0
  534. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js +46 -45
  535. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js.map +1 -1
  536. package/internal/CustomComboBox/ComboBoxView.d.ts +8 -4
  537. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js +12 -7
  538. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js.map +1 -1
  539. package/internal/CustomComboBox/CustomComboBox.d.ts +7 -2
  540. package/internal/CustomComboBox/getComboBoxTheme/getComboBoxTheme.js +5 -3
  541. package/internal/CustomComboBox/getComboBoxTheme/getComboBoxTheme.js.map +1 -1
  542. package/internal/CustomComboBox/getComboBoxTheme.d.ts +2 -1
  543. package/internal/DateSelect/DateSelect/DateSelect.js +1 -1
  544. package/internal/DateSelect/DateSelect/DateSelect.js.map +1 -1
  545. package/internal/FocusTrap/FocusTrap/FocusTrap.js.map +1 -1
  546. package/internal/FocusTrap/FocusTrap.d.ts +2 -0
  547. package/internal/IgnoreLayerClick/IgnoreLayerClick/IgnoreLayerClick.js.map +1 -1
  548. package/internal/InputLikeText/InputLikeText/InputLikeText.js +17 -28
  549. package/internal/InputLikeText/InputLikeText/InputLikeText.js.map +1 -1
  550. package/internal/InputLikeText/InputLikeText.d.ts +4 -3
  551. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout/InternalTextareaWithLayout.js +21 -16
  552. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout/InternalTextareaWithLayout.js.map +1 -1
  553. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.d.ts +1 -0
  554. package/internal/Menu/Menu/Menu.js.map +1 -1
  555. package/internal/Menu/Menu.d.ts +2 -0
  556. package/internal/MenuMessage/MenuMessage/MenuMessage.js +12 -1
  557. package/internal/MenuMessage/MenuMessage/MenuMessage.js.map +1 -1
  558. package/internal/MenuMessage/MenuMessage.styles/MenuMessage.styles.js +12 -6
  559. package/internal/MenuMessage/MenuMessage.styles/MenuMessage.styles.js.map +1 -1
  560. package/internal/MenuMessage/MenuMessage.styles.d.ts +3 -1
  561. package/internal/MobilePopup/MobilePopup/MobilePopup.js +19 -6
  562. package/internal/MobilePopup/MobilePopup/MobilePopup.js.map +1 -1
  563. package/internal/MobilePopup/MobilePopup.d.ts +9 -0
  564. package/internal/MobilePopup/MobilePopup.styles/MobilePopup.styles.js +24 -12
  565. package/internal/MobilePopup/MobilePopup.styles/MobilePopup.styles.js.map +1 -1
  566. package/internal/MobilePopup/MobilePopup.styles.d.ts +7 -3
  567. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter/MobilePopupFooter.js +23 -9
  568. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter/MobilePopupFooter.js.map +1 -1
  569. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.d.ts +8 -1
  570. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles/MobilePopupFooter.styles.js +11 -2
  571. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles/MobilePopupFooter.styles.js.map +1 -1
  572. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.d.ts +3 -0
  573. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader/MobilePopupHeader.js +29 -23
  574. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader/MobilePopupHeader.js.map +1 -1
  575. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.d.ts +3 -0
  576. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles/MobilePopupHeader.styles.js +12 -9
  577. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles/MobilePopupHeader.styles.js.map +1 -1
  578. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.d.ts +3 -2
  579. package/internal/Popup/Popup/Popup.js +10 -3
  580. package/internal/Popup/Popup/Popup.js.map +1 -1
  581. package/internal/Popup/Popup.d.ts +2 -0
  582. package/internal/Popup/PopupPinNew/PopupPinNew.js +146 -0
  583. package/internal/Popup/PopupPinNew/PopupPinNew.js.map +1 -0
  584. package/internal/Popup/PopupPinNew/package.json +6 -0
  585. package/internal/Popup/PopupPinNew.d.ts +31 -0
  586. package/internal/Popup/PopupPinNew.styles/PopupPinNew.styles.js +20 -0
  587. package/internal/Popup/PopupPinNew.styles/PopupPinNew.styles.js.map +1 -0
  588. package/internal/Popup/PopupPinNew.styles/package.json +6 -0
  589. package/internal/Popup/PopupPinNew.styles.d.ts +7 -0
  590. package/internal/PopupMenu/PopupMenu/PopupMenu.js.map +1 -1
  591. package/internal/PopupMenu/PopupMenu.d.ts +2 -0
  592. package/internal/RenderLayer/RenderLayer/RenderLayer.js.map +1 -1
  593. package/internal/RenderLayer/RenderLayer.d.ts +2 -0
  594. package/internal/ThemePlayground/Playground/Playground.js +8 -5
  595. package/internal/ThemePlayground/Playground/Playground.js.map +1 -1
  596. package/internal/ThemePlayground/Playground.styles/Playground.styles.js +4 -4
  597. package/internal/ThemePlayground/Playground.styles/Playground.styles.js.map +1 -1
  598. package/internal/ThemePlayground/ShowcaseGroup/ShowcaseGroup.js +6 -1
  599. package/internal/ThemePlayground/ShowcaseGroup/ShowcaseGroup.js.map +1 -1
  600. package/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  601. package/internal/ZIndex/ZIndex/ZIndex.js.map +1 -1
  602. package/internal/ZIndex/ZIndex.d.ts +2 -0
  603. package/internal/icons2022/UiMenuDots3HIcon/UiMenuDots3HIcon16Regular/UiMenuDots3HIcon16Regular.js +21 -0
  604. package/internal/icons2022/UiMenuDots3HIcon/UiMenuDots3HIcon16Regular/UiMenuDots3HIcon16Regular.js.map +1 -0
  605. package/internal/icons2022/UiMenuDots3HIcon/UiMenuDots3HIcon16Regular/package.json +6 -0
  606. package/internal/icons2022/UiMenuDots3HIcon/UiMenuDots3HIcon16Regular.d.ts +2 -0
  607. package/internal/themes/BasicTheme/BasicTheme.js +267 -44
  608. package/internal/themes/BasicTheme/BasicTheme.js.map +1 -1
  609. package/internal/themes/BasicTheme.d.ts +147 -28
  610. package/internal/themes/DarkTheme5_4/DarkTheme5_4.js +17 -0
  611. package/internal/themes/DarkTheme5_4/DarkTheme5_4.js.map +1 -0
  612. package/internal/themes/DarkTheme5_4/package.json +6 -0
  613. package/internal/themes/DarkTheme5_4.d.ts +1 -0
  614. package/internal/themes/LightTheme5_4/LightTheme5_4.js +17 -0
  615. package/internal/themes/LightTheme5_4/LightTheme5_4.js.map +1 -0
  616. package/internal/themes/LightTheme5_4/package.json +6 -0
  617. package/internal/themes/LightTheme5_4.d.ts +1 -0
  618. package/internal/themes/consts/consts.js +9 -0
  619. package/internal/themes/consts/consts.js.map +1 -0
  620. package/internal/themes/consts/package.json +6 -0
  621. package/internal/themes/consts.d.ts +8 -0
  622. package/lib/__stories__/Blink.creevey.mts +90 -0
  623. package/lib/blink/blink.js +63 -0
  624. package/lib/blink/blink.js.map +1 -0
  625. package/lib/blink/package.json +6 -0
  626. package/lib/blink.d.ts +15 -0
  627. package/lib/delay.d.mts +1 -0
  628. package/lib/delay.mts +3 -0
  629. package/lib/featureFlagsContext/FeatureFlagsHelpers.d.ts +6 -0
  630. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext/ReactUIFeatureFlagsContext.js +7 -1
  631. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext/ReactUIFeatureFlagsContext.js.map +1 -1
  632. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.d.ts +6 -0
  633. package/lib/rootNode/rootNodeDecorator/rootNodeDecorator.js.map +1 -1
  634. package/lib/rootNode/rootNodeDecorator.d.ts +2 -1
  635. package/lib/size/SizeControlContext/SizeControlContext.js +7 -0
  636. package/lib/size/SizeControlContext/SizeControlContext.js.map +1 -0
  637. package/lib/size/SizeControlContext/package.json +6 -0
  638. package/lib/size/SizeControlContext.d.ts +6 -0
  639. package/lib/size/SizeDecorator/SizeDecorator.js +41 -0
  640. package/lib/size/SizeDecorator/SizeDecorator.js.map +1 -0
  641. package/lib/size/SizeDecorator/package.json +6 -0
  642. package/lib/size/SizeDecorator.d.ts +33 -0
  643. package/lib/size/constants/constants.js +1 -0
  644. package/lib/size/constants/constants.js.map +1 -0
  645. package/lib/size/constants/package.json +6 -0
  646. package/lib/size/constants.d.ts +2 -0
  647. package/lib/size/index/index.js +1 -0
  648. package/lib/size/index/index.js.map +1 -0
  649. package/lib/size/index/package.json +6 -0
  650. package/lib/size/index.d.ts +1 -0
  651. package/lib/size/package.json +6 -0
  652. package/lib/size/useSizeControl/package.json +6 -0
  653. package/lib/size/useSizeControl/useSizeControl.js +7 -0
  654. package/lib/size/useSizeControl/useSizeControl.js.map +1 -0
  655. package/lib/size/useSizeControl.d.ts +2 -0
  656. package/lib/theming/ThemeVersions/ThemeVersions.js.map +1 -1
  657. package/lib/theming/ThemeVersions.d.ts +1 -1
  658. package/lib/theming/themes/DarkTheme/DarkTheme.js +3 -1
  659. package/lib/theming/themes/DarkTheme/DarkTheme.js.map +1 -1
  660. package/lib/theming/themes/DarkTheme.d.ts +1 -0
  661. package/lib/theming/themes/LightTheme/LightTheme.js +3 -1
  662. package/lib/theming/themes/LightTheme/LightTheme.js.map +1 -1
  663. package/lib/theming/themes/LightTheme.d.ts +1 -0
  664. package/lib/utils/utils.js +26 -0
  665. package/lib/utils/utils.js.map +1 -1
  666. package/lib/utils.d.ts +13 -0
  667. package/package.json +9 -15
  668. package/cjs/components/Autocomplete/Autocomplete.md +0 -113
  669. package/cjs/components/Button/Button.md +0 -261
  670. package/cjs/components/Calendar/Calendar.md +0 -276
  671. package/cjs/components/Calendar/CalendarDay.md +0 -70
  672. package/cjs/components/Center/Center.md +0 -26
  673. package/cjs/components/Checkbox/Checkbox.md +0 -171
  674. package/cjs/components/ComboBox/ComboBox.md +0 -574
  675. package/cjs/components/CurrencyInput/CurrencyInput.md +0 -39
  676. package/cjs/components/CurrencyLabel/CurrencyLabel.md +0 -29
  677. package/cjs/components/DateInput/DateInput.md +0 -111
  678. package/cjs/components/DatePicker/DatePicker.md +0 -368
  679. package/cjs/components/Dropdown/Dropdown.md +0 -45
  680. package/cjs/components/DropdownMenu/DropdownMenu.md +0 -290
  681. package/cjs/components/FileUploader/FileUploader.md +0 -131
  682. package/cjs/components/FxInput/FxInput.md +0 -31
  683. package/cjs/components/Gapped/Gapped.md +0 -44
  684. package/cjs/components/GlobalLoader/GlobalLoader.md +0 -97
  685. package/cjs/components/Group/Group.md +0 -19
  686. package/cjs/components/Hint/Hint.md +0 -86
  687. package/cjs/components/Input/Input.md +0 -86
  688. package/cjs/components/Kebab/Kebab.md +0 -306
  689. package/cjs/components/Link/Link.md +0 -182
  690. package/cjs/components/Loader/Loader.md +0 -33
  691. package/cjs/components/MaskedInput/MaskedInput.md +0 -114
  692. package/cjs/components/MenuFooter/MenuFooter.md +0 -27
  693. package/cjs/components/MenuHeader/MenuHeader.md +0 -35
  694. package/cjs/components/MenuItem/MenuItem.md +0 -139
  695. package/cjs/components/MenuSeparator/MenuSeparator.md +0 -14
  696. package/cjs/components/MiniModal/MiniModal.md +0 -231
  697. package/cjs/components/Modal/Modal.md +0 -56
  698. package/cjs/components/Paging/Paging.md +0 -57
  699. package/cjs/components/PasswordInput/PasswordInput.md +0 -29
  700. package/cjs/components/Radio/Radio.md +0 -57
  701. package/cjs/components/RadioGroup/RadioGroup.md +0 -44
  702. package/cjs/components/ResponsiveLayout/ResponsiveLayout.md +0 -75
  703. package/cjs/components/ScrollContainer/ScrollContainer.md +0 -224
  704. package/cjs/components/Select/Select.md +0 -113
  705. package/cjs/components/SidePage/SidePage.md +0 -65
  706. package/cjs/components/SingleToast/SingleToast.md +0 -36
  707. package/cjs/components/Spinner/Spinner.md +0 -36
  708. package/cjs/components/Sticky/Sticky.md +0 -28
  709. package/cjs/components/Switcher/Switcher.md +0 -111
  710. package/cjs/components/Tabs/Tab.md +0 -73
  711. package/cjs/components/Tabs/Tabs.md +0 -54
  712. package/cjs/components/Textarea/Textarea.md +0 -58
  713. package/cjs/components/Toast/Toast.md +0 -69
  714. package/cjs/components/Toggle/Toggle.md +0 -110
  715. package/cjs/components/Token/Token.md +0 -48
  716. package/cjs/components/TokenInput/TokenInput.md +0 -277
  717. package/cjs/components/Tooltip/Tooltip.md +0 -322
  718. package/cjs/components/TooltipMenu/TooltipMenu.md +0 -241
  719. package/cjs/internal/DataTids/DATATIDS.md +0 -12
  720. package/cjs/internal/DataTids/DataTids.d.ts +0 -12
  721. package/cjs/internal/DataTids/DataTids.js +0 -50
  722. package/cjs/internal/DataTids/DataTids.js.map +0 -1
  723. package/cjs/internal/DataTids/DataTids.styles.d.ts +0 -7
  724. package/cjs/internal/DataTids/DataTids.styles.js +0 -42
  725. package/cjs/internal/DataTids/DataTids.styles.js.map +0 -1
  726. package/cjs/internal/DataTids/componentsDataTids.d.ts +0 -5
  727. package/cjs/internal/DataTids/componentsDataTids.js +0 -15
  728. package/cjs/internal/DataTids/componentsDataTids.js.map +0 -1
  729. package/cjs/internal/ThemePlayground/Playground.md +0 -7
  730. package/cjs/lib/featureFlagsContext/FEATUREFLAGSCONTEXT.md +0 -64
  731. package/cjs/lib/locale/LOCALECONTEXT.md +0 -222
  732. package/cjs/lib/theming/ThemeContext.md +0 -265
  733. package/components/Autocomplete/Autocomplete.md +0 -113
  734. package/components/Button/Button.md +0 -261
  735. package/components/Calendar/Calendar.md +0 -276
  736. package/components/Calendar/CalendarDay.md +0 -70
  737. package/components/Center/Center.md +0 -26
  738. package/components/Checkbox/Checkbox.md +0 -171
  739. package/components/ComboBox/ComboBox.md +0 -574
  740. package/components/CurrencyInput/CurrencyInput.md +0 -39
  741. package/components/CurrencyLabel/CurrencyLabel.md +0 -29
  742. package/components/DateInput/DateInput.md +0 -111
  743. package/components/DatePicker/DatePicker.md +0 -368
  744. package/components/Dropdown/Dropdown.md +0 -45
  745. package/components/DropdownMenu/DropdownMenu.md +0 -290
  746. package/components/FileUploader/FileUploader.md +0 -131
  747. package/components/FxInput/FxInput.md +0 -31
  748. package/components/Gapped/Gapped.md +0 -44
  749. package/components/GlobalLoader/GlobalLoader.md +0 -97
  750. package/components/Group/Group.md +0 -19
  751. package/components/Hint/Hint.md +0 -86
  752. package/components/Input/Input.md +0 -86
  753. package/components/Kebab/Kebab.md +0 -306
  754. package/components/Link/Link.md +0 -182
  755. package/components/Loader/Loader.md +0 -33
  756. package/components/MaskedInput/MaskedInput.md +0 -114
  757. package/components/MenuFooter/MenuFooter.md +0 -27
  758. package/components/MenuHeader/MenuHeader.md +0 -35
  759. package/components/MenuItem/MenuItem.md +0 -139
  760. package/components/MenuSeparator/MenuSeparator.md +0 -14
  761. package/components/MiniModal/MiniModal.md +0 -231
  762. package/components/Modal/Modal.md +0 -56
  763. package/components/Paging/Paging.md +0 -57
  764. package/components/PasswordInput/PasswordInput.md +0 -29
  765. package/components/Radio/Radio.md +0 -57
  766. package/components/RadioGroup/RadioGroup.md +0 -44
  767. package/components/ResponsiveLayout/ResponsiveLayout.md +0 -75
  768. package/components/ScrollContainer/ScrollContainer.md +0 -224
  769. package/components/Select/Select.md +0 -113
  770. package/components/SidePage/SidePage.md +0 -65
  771. package/components/SingleToast/SingleToast.md +0 -36
  772. package/components/Spinner/Spinner.md +0 -36
  773. package/components/Sticky/Sticky.md +0 -28
  774. package/components/Switcher/Switcher.md +0 -111
  775. package/components/Tabs/Tab.md +0 -73
  776. package/components/Tabs/Tabs.md +0 -54
  777. package/components/Textarea/Textarea.md +0 -58
  778. package/components/Toast/Toast.md +0 -69
  779. package/components/Toggle/Toggle.md +0 -110
  780. package/components/Token/Token.md +0 -48
  781. package/components/TokenInput/TokenInput.md +0 -277
  782. package/components/Tooltip/Tooltip.md +0 -322
  783. package/components/TooltipMenu/TooltipMenu.md +0 -241
  784. package/internal/DataTids/DATATIDS.md +0 -12
  785. package/internal/DataTids/DataTids/DataTids.js +0 -69
  786. package/internal/DataTids/DataTids/DataTids.js.map +0 -1
  787. package/internal/DataTids/DataTids/package.json +0 -6
  788. package/internal/DataTids/DataTids.d.ts +0 -12
  789. package/internal/DataTids/DataTids.styles/DataTids.styles.js +0 -20
  790. package/internal/DataTids/DataTids.styles/DataTids.styles.js.map +0 -1
  791. package/internal/DataTids/DataTids.styles/package.json +0 -6
  792. package/internal/DataTids/DataTids.styles.d.ts +0 -7
  793. package/internal/DataTids/componentsDataTids/componentsDataTids.js +0 -12
  794. package/internal/DataTids/componentsDataTids/componentsDataTids.js.map +0 -1
  795. package/internal/DataTids/componentsDataTids/package.json +0 -6
  796. package/internal/DataTids/componentsDataTids.d.ts +0 -5
  797. package/internal/ThemePlayground/Playground.md +0 -7
  798. package/lib/featureFlagsContext/FEATUREFLAGSCONTEXT.md +0 -64
  799. package/lib/locale/LOCALECONTEXT.md +0 -222
  800. package/lib/theming/ThemeContext.md +0 -265
@@ -1,15 +1,16 @@
1
1
  "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.ColorableInputElement = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
2
2
 
3
3
  var _react = _interopRequireWildcard(require("react"));
4
- var _globalObject = require("@skbkontur/global-object");
5
4
  var _lodash = _interopRequireDefault(require("lodash.debounce"));
6
5
 
7
6
  var _ThemeContext = require("../../../lib/theming/ThemeContext");
8
7
 
9
8
  var _forwardRefAndName = require("../../../lib/forwardRefAndName");
10
9
  var _Emotion = require("../../../lib/theming/Emotion");
10
+ var _utils = require("../../../lib/utils");
11
+
12
+ var _ColorableInputElement = require("./ColorableInputElement.styles");var _excluded = ["children", "onInput", "onFocus", "onBlur", "showOnFocus", "alwaysShowMask"]; /* eslint react-hooks/exhaustive-deps: 2 */
11
13
 
12
- var _ColorableInputElement = require("./ColorableInputElement.styles");var _excluded = ["children", "onInput", "onFocus", "onBlur", "showOnFocus"]; /* eslint react-hooks/exhaustive-deps: 2 */
13
14
 
14
15
 
15
16
 
@@ -23,61 +24,86 @@ var _ColorableInputElement = require("./ColorableInputElement.styles");var _excl
23
24
 
24
25
  var ColorableInputElement = exports.ColorableInputElement = (0, _forwardRefAndName.forwardRefAndName)(
25
26
  'ColorableInputElement',
26
- function ColorableInputElement(props, ref) {
27
+ function ColorableInputElement(props, ref) {var _props$style3;
27
28
  var inputRef = (0, _react.useRef)(null);
28
29
  var spanRef = (0, _react.useRef)(null);
29
30
  var focused = (0, _react.useRef)(false);
30
- var inputStyle = _react.default.useRef();
31
+ var updateActiveTimer = (0, _react.useRef)();
31
32
  var theme = (0, _react.useContext)(_ThemeContext.ThemeContext);
32
- var _useState = (0, _react.useState)(true),active = _useState[0],setActive = _useState[1];
33
-
34
- var children = props.children,onInput = props.onInput,onFocus = props.onFocus,onBlur = props.onBlur,showOnFocus = props.showOnFocus,inputProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
35
-
36
- (0, _react.useImperativeHandle)(
37
- ref,
38
- function () {return {
39
- input: inputRef.current,
40
- getRootNode: function getRootNode() {return inputRef.current;}
41
- };},
42
- []
43
- );
44
-
45
- (0, _react.useEffect)(updateActive, []);
33
+ var _useState = (0, _react.useState)(
34
+ Boolean(props.alwaysShowMask || !props.placeholder && (props.value || props.defaultValue))
35
+ ),active = _useState[0],setActive = _useState[1];
36
+
37
+ var children = props.children,onInput = props.onInput,onFocus = props.onFocus,onBlur = props.onBlur,showOnFocus = props.showOnFocus,alwaysShowMask = props.alwaysShowMask,inputProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
38
+
39
+ var stopUpdateActive = (0, _react.useCallback)(function () {
40
+ clearTimeout(updateActiveTimer.current);
41
+ }, []);
42
+
43
+ var updateActive = (0, _react.useCallback)(function () {
44
+ stopUpdateActive();
45
+ updateActiveTimer.current = setTimeout(function () {
46
+ var nextActive = true;
47
+ if (inputRef.current) {var _inputRef$current2;
48
+ var _inputRef$current = inputRef.current,clientWidth = _inputRef$current.clientWidth,scrollWidth = _inputRef$current.scrollWidth;
49
+ var scrollable = scrollWidth > clientWidth;
50
+
51
+ var placeholderShown = (_inputRef$current2 = inputRef.current) == null || (_inputRef$current2 = _inputRef$current2.parentElement) == null ? void 0 : _inputRef$current2.querySelector(':placeholder-shown');
52
+
53
+ nextActive = !(scrollable || placeholderShown);
54
+ }
55
+ setActive(nextActive);
56
+ }, 0);
57
+ }, [stopUpdateActive]);
58
+
59
+ var paintText = (0, _react.useCallback)(function () {var _inputRef$current4, _shadow, _shadow2, _props$style, _props$style2;
60
+ var win = (0, _utils.tryGetWindow)(inputRef.current);
61
+ var doc = (0, _utils.tryGetDocument)(inputRef.current);
62
+ if (!spanRef.current || !inputRef.current || !(0, _utils.isWindow)(win) || !(0, _utils.isDocument)(doc) || !active) {var _inputRef$current3;
63
+ inputRef.current && (inputRef.current.style.backgroundImage = '');
64
+ (_inputRef$current3 = inputRef.current) == null || _inputRef$current3.classList.remove(_ColorableInputElement.globalClasses.input);
46
65
 
47
- var paintText = (0, _react.useCallback)(function () {var _inputRef$current, _shadow;
48
- if (!spanRef.current || !inputRef.current || !inputStyle.current || !(0, _globalObject.isBrowser)(_globalObject.globalObject)) {
49
66
  return;
50
67
  }
51
68
 
52
- (_inputRef$current = inputRef.current) == null || _inputRef$current.classList.add(_ColorableInputElement.globalClasses.input);
69
+ (_inputRef$current4 = inputRef.current) == null || _inputRef$current4.classList.add(_ColorableInputElement.globalClasses.input);
53
70
 
54
71
  var shadow = spanRef.current.shadowRoot;
55
- var typedValueElement = (_shadow = shadow) == null ? void 0 : _shadow.getElementById('span');
72
+ var typedValueElement = (_shadow = shadow) == null ? void 0 : _shadow.getElementById('typed-value');
73
+ var fullValueElement = (_shadow2 = shadow) == null ? void 0 : _shadow2.getElementById('full-value');
56
74
 
57
- if (!typedValueElement) {
75
+ if (!typedValueElement || !fullValueElement) {
58
76
  shadow = spanRef.current.attachShadow({ mode: 'open' });
59
77
 
60
- typedValueElement = _globalObject.globalObject.document.createElement('span');
61
- typedValueElement.setAttribute('id', 'span');
78
+ typedValueElement = doc.createElement('span');
79
+ fullValueElement = doc.createElement('span');
80
+ typedValueElement.setAttribute('id', 'typed-value');
81
+ fullValueElement.setAttribute('id', 'full-value');
62
82
 
63
- shadow.appendChild(typedValueElement);
83
+ shadow.append(typedValueElement, fullValueElement);
64
84
  }
65
85
 
66
- var style = inputStyle.current;
86
+ var style = getComputedStyle(inputRef.current);
67
87
 
68
88
  typedValueElement.textContent =
69
89
  (inputRef.current.getAttribute('data-unmasked-value') || focused.current) &&
70
90
  inputRef.current.getAttribute('data-typed-value') ||
71
91
  '';
72
92
 
93
+ fullValueElement.textContent = inputRef.current.value || inputRef.current.defaultValue || '';
94
+
73
95
  var inputRect = inputRef.current.getBoundingClientRect();
74
- var filledRect = spanRef.current.getBoundingClientRect();
96
+ var typedValueRect = typedValueElement.getBoundingClientRect();
97
+ var fullValueRect = fullValueElement.getBoundingClientRect();
75
98
 
76
- var threshold = filledRect.width / (inputRect.width / 100);
99
+ var threshold = typedValueRect.width / (inputRect.width / 100);
77
100
  var degree = style.fontStyle === 'italic' ? 100 : 90;
101
+ var restValueWidth = 1 - Math.min(fullValueRect.width / inputRect.width, 1);
78
102
 
79
103
  var typedValueColor = theme.inputTextColor;
80
104
  var maskColor = theme.inputPlaceholderColor;
105
+ var indent = 0;
106
+
81
107
  if (props.disabled) {
82
108
  typedValueColor = theme.inputTextColorDisabled;
83
109
  maskColor = theme.inputTextColorDisabled;
@@ -85,43 +111,77 @@ var ColorableInputElement = exports.ColorableInputElement = (0, _forwardRefAndNa
85
111
  if (props.showOnFocus) {
86
112
  maskColor = focused.current ? maskColor : 'transparent';
87
113
  }
114
+ if (((_props$style = props.style) == null ? void 0 : _props$style.textAlign) === 'right') {
115
+ indent = 100 * restValueWidth;
116
+ }
117
+ if (((_props$style2 = props.style) == null ? void 0 : _props$style2.textAlign) === 'center') {
118
+ indent = 50 * restValueWidth;
119
+ }
88
120
 
89
121
  inputRef.current.style.backgroundImage = "\n linear-gradient(\n " +
90
122
 
91
123
  degree + "deg,\n " +
92
- typedValueColor + " " + threshold + "%,\n " +
93
- maskColor + " " + threshold + "%\n )";
124
+ typedValueColor + " " + (threshold + indent) + "%,\n " +
125
+ maskColor + " " + (threshold + indent) + "%\n )";
94
126
 
95
127
  }, [
128
+ active,
96
129
  props.showOnFocus,
97
130
  props.disabled,
98
131
  theme.inputTextColor,
99
132
  theme.inputPlaceholderColor,
100
- theme.inputTextColorDisabled]
133
+ theme.inputTextColorDisabled, (_props$style3 =
134
+ props.style) == null ? void 0 : _props$style3.textAlign]
101
135
  );
102
136
 
103
137
  var debouncedPaintText = (0, _react.useCallback)(function () {return (0, _lodash.default)(paintText);}, [paintText])();
104
138
 
105
- var activation = (0, _react.useCallback)(function () {
106
- if (active) {
139
+ var handleInput = (0, _react.useCallback)(
140
+ function (e) {
107
141
  debouncedPaintText();
108
- } else {var _inputRef$current2;
109
- debouncedPaintText.cancel();
110
- inputRef.current && (inputRef.current.style.backgroundImage = '');
111
- (_inputRef$current2 = inputRef.current) == null || _inputRef$current2.classList.remove(_ColorableInputElement.globalClasses.input);
112
- }
113
- }, [debouncedPaintText, active]);
142
+
143
+ onInput == null || onInput(e);
144
+ },
145
+ [debouncedPaintText, onInput]
146
+ );
147
+
148
+ var handleFocus = (0, _react.useCallback)(
149
+ function (e) {
150
+ updateActive();
151
+
152
+ focused.current = true;
153
+
154
+ onFocus == null || onFocus(e);
155
+ },
156
+ [onFocus, updateActive]
157
+ );
158
+
159
+ var handleBlur = (0, _react.useCallback)(
160
+ function (e) {
161
+ updateActive();
162
+
163
+ focused.current = false;
164
+
165
+ onBlur == null || onBlur(e);
166
+ },
167
+ [onBlur, updateActive]
168
+ );
169
+
170
+ (0, _react.useImperativeHandle)(
171
+ ref,
172
+ function () {return {
173
+ input: inputRef.current,
174
+ getRootNode: function getRootNode() {return inputRef.current;}
175
+ };},
176
+ []
177
+ );
114
178
 
115
179
  (0, _react.useEffect)(function () {
116
- activation();
180
+ debouncedPaintText();
117
181
  updateActive();
118
- }, [props.value, props.defaultValue, theme, activation]);
119
182
 
120
- (0, _react.useEffect)(function () {
121
- if (inputRef.current) {
122
- inputStyle.current = getComputedStyle(inputRef.current);
123
- }
124
- });
183
+ return stopUpdateActive;
184
+ }, [updateActive, props.value, props.defaultValue, theme, debouncedPaintText, stopUpdateActive]);
125
185
 
126
186
  return /*#__PURE__*/(
127
187
  _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/
@@ -136,36 +196,5 @@ var ColorableInputElement = exports.ColorableInputElement = (0, _forwardRefAndNa
136
196
  active && /*#__PURE__*/_react.default.createElement("span", { style: { visibility: 'hidden', position: 'absolute', whiteSpace: 'pre' }, ref: spanRef })
137
197
  ));
138
198
 
139
-
140
- function handleInput(e) {var _inputRef$current3;
141
- var isActive = !((_inputRef$current3 = inputRef.current) != null && (_inputRef$current3 = _inputRef$current3.parentElement) != null && _inputRef$current3.querySelector(':placeholder-shown'));
142
- setActive(isActive);
143
-
144
- activation();
145
-
146
- onInput == null || onInput(e);
147
- }
148
-
149
- function handleFocus(e) {
150
- setTimeout(updateActive);
151
-
152
- focused.current = true;
153
-
154
- onFocus == null || onFocus(e);
155
- }
156
-
157
- function handleBlur(e) {
158
- updateActive();
159
-
160
- focused.current = false;
161
-
162
- onBlur == null || onBlur(e);
163
- }
164
-
165
- function updateActive() {
166
- setTimeout(function () {var _inputRef$current4;
167
- setActive(!((_inputRef$current4 = inputRef.current) != null && (_inputRef$current4 = _inputRef$current4.parentElement) != null && _inputRef$current4.querySelector(':placeholder-shown')));
168
- });
169
- }
170
199
  }
171
200
  );
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_globalObject","_lodash","_interopRequireDefault","_ThemeContext","_forwardRefAndName","_Emotion","_ColorableInputElement","_excluded","ColorableInputElement","exports","forwardRefAndName","props","ref","inputRef","useRef","spanRef","focused","inputStyle","React","theme","useContext","ThemeContext","_useState","useState","active","setActive","children","onInput","onFocus","onBlur","showOnFocus","inputProps","_objectWithoutPropertiesLoose2","default","useImperativeHandle","input","current","getRootNode","useEffect","updateActive","paintText","useCallback","_inputRef$current","_shadow","isBrowser","globalObject","classList","add","globalClasses","shadow","shadowRoot","typedValueElement","getElementById","attachShadow","mode","document","createElement","setAttribute","appendChild","style","textContent","getAttribute","inputRect","getBoundingClientRect","filledRect","threshold","width","degree","fontStyle","typedValueColor","inputTextColor","maskColor","inputPlaceholderColor","disabled","inputTextColorDisabled","backgroundImage","debouncedPaintText","debounce","activation","_inputRef$current2","cancel","remove","value","defaultValue","getComputedStyle","Fragment","cloneElement","_extends2","handleInput","handleFocus","handleBlur","className","cx","visibility","position","whiteSpace","e","_inputRef$current3","isActive","parentElement","querySelector","setTimeout","_inputRef$current4"],"sources":["ColorableInputElement.tsx"],"sourcesContent":["/* eslint react-hooks/exhaustive-deps: 2 */\nimport type { ForwardedRef } from 'react';\nimport React, { useContext, useEffect, useImperativeHandle, useRef, useCallback, useState } from 'react';\nimport { globalObject, isBrowser } from '@skbkontur/global-object';\nimport debounce from 'lodash.debounce';\n\nimport { ThemeContext } from '../../../lib/theming/ThemeContext';\nimport type { InputElement, InputElementProps } from '../../Input';\nimport { forwardRefAndName } from '../../../lib/forwardRefAndName';\nimport { cx } from '../../../lib/theming/Emotion';\n\nimport { globalClasses } from './ColorableInputElement.styles';\n\nexport type ColorableInputElementProps = InputElementProps & {\n showOnFocus?: boolean;\n children: React.ReactElement;\n};\n\n// Возможно придётся включить.\n// Иногда, на тяжёлых страницах, текст рендерится итеративно.\n// Из-за этого могут оставаться артефакты при покраске компонента, которые пропадут только после фокуса.\n// setInterval(() => window.requestAnimationFrame(() => dictionary.forEach((paint) => paint())), 1000);\n\nexport const ColorableInputElement = forwardRefAndName(\n 'ColorableInputElement',\n function ColorableInputElement(props: ColorableInputElementProps, ref: ForwardedRef<InputElement>) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const spanRef = useRef<HTMLSpanElement | null>(null);\n const focused = useRef(false);\n const inputStyle = React.useRef<CSSStyleDeclaration>();\n const theme = useContext(ThemeContext);\n const [active, setActive] = useState(true);\n\n const { children, onInput, onFocus, onBlur, showOnFocus, ...inputProps } = props;\n\n useImperativeHandle(\n ref,\n () => ({\n input: inputRef.current,\n getRootNode: () => inputRef.current,\n }),\n [],\n );\n\n useEffect(updateActive, []);\n\n const paintText = useCallback(() => {\n if (!spanRef.current || !inputRef.current || !inputStyle.current || !isBrowser(globalObject)) {\n return;\n }\n\n inputRef.current?.classList.add(globalClasses.input);\n\n let shadow = spanRef.current.shadowRoot;\n let typedValueElement = shadow?.getElementById('span');\n\n if (!typedValueElement) {\n shadow = spanRef.current.attachShadow({ mode: 'open' });\n\n typedValueElement = globalObject.document.createElement('span');\n typedValueElement.setAttribute('id', 'span');\n\n shadow.appendChild(typedValueElement);\n }\n\n const style = inputStyle.current;\n\n typedValueElement.textContent =\n ((inputRef.current.getAttribute('data-unmasked-value') || focused.current) &&\n inputRef.current.getAttribute('data-typed-value')) ||\n '';\n\n const inputRect = inputRef.current.getBoundingClientRect();\n const filledRect = spanRef.current.getBoundingClientRect();\n\n const threshold = filledRect.width / (inputRect.width / 100);\n const degree = style.fontStyle === 'italic' ? 100 : 90;\n\n let typedValueColor = theme.inputTextColor;\n let maskColor = theme.inputPlaceholderColor;\n if (props.disabled) {\n typedValueColor = theme.inputTextColorDisabled;\n maskColor = theme.inputTextColorDisabled;\n }\n if (props.showOnFocus) {\n maskColor = focused.current ? maskColor : 'transparent';\n }\n\n inputRef.current.style.backgroundImage = `\n linear-gradient(\n ${degree}deg,\n ${typedValueColor} ${threshold}%,\n ${maskColor} ${threshold}%\n )`;\n }, [\n props.showOnFocus,\n props.disabled,\n theme.inputTextColor,\n theme.inputPlaceholderColor,\n theme.inputTextColorDisabled,\n ]);\n\n const debouncedPaintText = useCallback(() => debounce(paintText), [paintText])();\n\n const activation = useCallback(() => {\n if (active) {\n debouncedPaintText();\n } else {\n debouncedPaintText.cancel();\n inputRef.current && (inputRef.current.style.backgroundImage = '');\n inputRef.current?.classList.remove(globalClasses.input);\n }\n }, [debouncedPaintText, active]);\n\n useEffect(() => {\n activation();\n updateActive();\n }, [props.value, props.defaultValue, theme, activation]);\n\n useEffect(() => {\n if (inputRef.current) {\n inputStyle.current = getComputedStyle(inputRef.current);\n }\n });\n\n return (\n <>\n {React.cloneElement(children, {\n ...inputProps,\n onInput: handleInput,\n onFocus: handleFocus,\n onBlur: handleBlur,\n inputRef,\n className: cx(props.className, active && globalClasses.input),\n })}\n {active && <span style={{ visibility: 'hidden', position: 'absolute', whiteSpace: 'pre' }} ref={spanRef} />}\n </>\n );\n\n function handleInput(e: React.ChangeEvent<HTMLInputElement>) {\n const isActive = !inputRef.current?.parentElement?.querySelector(':placeholder-shown');\n setActive(isActive);\n\n activation();\n\n onInput?.(e);\n }\n\n function handleFocus(e: React.FocusEvent<HTMLInputElement>) {\n setTimeout(updateActive);\n\n focused.current = true;\n\n onFocus?.(e);\n }\n\n function handleBlur(e: React.FocusEvent<HTMLInputElement>) {\n updateActive();\n\n focused.current = false;\n\n onBlur?.(e);\n }\n\n function updateActive() {\n setTimeout(() => {\n setActive(!inputRef.current?.parentElement?.querySelector(':placeholder-shown'));\n });\n }\n },\n);\n"],"mappings":";;AAEA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;;AAEA,IAAAI,aAAA,GAAAJ,OAAA;;AAEA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;;AAEA,IAAAO,sBAAA,GAAAP,OAAA,mCAA+D,IAAAQ,SAAA,gEAX/D;;;;;;;AAkBA;AACA;AACA;AACA;;AAEO,IAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,IAAAE,oCAAiB;EACpD,uBAAuB;EACvB,SAASF,qBAAqBA,CAACG,KAAiC,EAAEC,GAA+B,EAAE;IACjG,IAAMC,QAAQ,GAAG,IAAAC,aAAM,EAA0B,IAAI,CAAC;IACtD,IAAMC,OAAO,GAAG,IAAAD,aAAM,EAAyB,IAAI,CAAC;IACpD,IAAME,OAAO,GAAG,IAAAF,aAAM,EAAC,KAAK,CAAC;IAC7B,IAAMG,UAAU,GAAGC,cAAK,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AO,CAAGoE,CAAC,CAAC;IACd;;IAEA,SAASN,UAAUA,CAACM,CAAqC,EAAE;MACzDzD,YAAY,CAAC,CAAC;;MAEdvB,OAAO,CAACoB,OAAO,GAAG,KAAK;;MAEvBP,MAAM,YAANA,MAAM,CAAGmE,CAAC,CAAC;IACb;;IAEA,SAASzD,YAAYA,CAAA,EAAG;MACtB8D,UAAU,CAAC,YAAM,KAAAC,kBAAA;QACf7E,SAAS,CAAC,GAAA6E,kBAAA,GAACzF,QAAQ,CAACuB,OAAO,cAAAkE,kBAAA,GAAhBA,kBAAA,CAAkBH,aAAa,aAA/BG,kBAAA,CAAiCF,aAAa,CAAC,oBAAoB,CAAC,EAAC;MAClF,CAAC,CAAC;IACJ;EACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_lodash","_interopRequireDefault","_ThemeContext","_forwardRefAndName","_Emotion","_utils","_ColorableInputElement","_excluded","ColorableInputElement","exports","forwardRefAndName","props","ref","_props$style3","inputRef","useRef","spanRef","focused","updateActiveTimer","theme","useContext","ThemeContext","_useState","useState","Boolean","alwaysShowMask","placeholder","value","defaultValue","active","setActive","children","onInput","onFocus","onBlur","showOnFocus","inputProps","_objectWithoutPropertiesLoose2","default","stopUpdateActive","useCallback","clearTimeout","current","updateActive","setTimeout","nextActive","_inputRef$current2","_inputRef$current","clientWidth","scrollWidth","scrollable","placeholderShown","parentElement","querySelector","paintText","_inputRef$current4","_shadow","_shadow2","_props$style","_props$style2","win","tryGetWindow","doc","tryGetDocument","isWindow","isDocument","_inputRef$current3","style","backgroundImage","classList","remove","globalClasses","input","add","shadow","shadowRoot","typedValueElement","getElementById","fullValueElement","attachShadow","mode","createElement","setAttribute","append","getComputedStyle","textContent","getAttribute","inputRect","getBoundingClientRect","typedValueRect","fullValueRect","threshold","width","degree","fontStyle","restValueWidth","Math","min","typedValueColor","inputTextColor","maskColor","inputPlaceholderColor","indent","disabled","inputTextColorDisabled","textAlign","debouncedPaintText","debounce","handleInput","e","handleFocus","handleBlur","useImperativeHandle","getRootNode","useEffect","Fragment","React","cloneElement","_extends2","className","cx","visibility","position","whiteSpace"],"sources":["ColorableInputElement.tsx"],"sourcesContent":["/* eslint react-hooks/exhaustive-deps: 2 */\nimport type { ForwardedRef } from 'react';\nimport React, { useEffect, useContext, useImperativeHandle, useRef, useCallback, useState } from 'react';\nimport debounce from 'lodash.debounce';\n\nimport { ThemeContext } from '../../../lib/theming/ThemeContext';\nimport type { InputElement, InputElementProps } from '../../Input';\nimport { forwardRefAndName } from '../../../lib/forwardRefAndName';\nimport { cx } from '../../../lib/theming/Emotion';\nimport { isDocument, isWindow, tryGetDocument, tryGetWindow } from '../../../lib/utils';\n\nimport { globalClasses } from './ColorableInputElement.styles';\n\nexport type ColorableInputElementProps = InputElementProps & {\n alwaysShowMask?: boolean;\n showOnFocus?: boolean;\n children: React.ReactElement;\n};\n\n// Возможно придётся включить.\n// Иногда, на тяжёлых страницах, текст рендерится итеративно.\n// Из-за этого могут оставаться артефакты при покраске компонента, которые пропадут только после фокуса.\n// setInterval(() => window.requestAnimationFrame(() => dictionary.forEach((paint) => paint())), 1000);\n\nexport const ColorableInputElement = forwardRefAndName(\n 'ColorableInputElement',\n function ColorableInputElement(props: ColorableInputElementProps, ref: ForwardedRef<InputElement>) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const spanRef = useRef<HTMLSpanElement | null>(null);\n const focused = useRef(false);\n const updateActiveTimer = useRef<ReturnType<typeof setTimeout>>();\n const theme = useContext(ThemeContext);\n const [active, setActive] = useState(\n Boolean(props.alwaysShowMask || (!props.placeholder && (props.value || props.defaultValue))),\n );\n\n const { children, onInput, onFocus, onBlur, showOnFocus, alwaysShowMask, ...inputProps } = props;\n\n const stopUpdateActive = useCallback(() => {\n clearTimeout(updateActiveTimer.current);\n }, []);\n\n const updateActive = useCallback(() => {\n stopUpdateActive();\n updateActiveTimer.current = setTimeout(() => {\n let nextActive = true;\n if (inputRef.current) {\n const { clientWidth, scrollWidth } = inputRef.current;\n const scrollable = scrollWidth > clientWidth;\n\n const placeholderShown = inputRef.current?.parentElement?.querySelector(':placeholder-shown');\n\n nextActive = !(scrollable || placeholderShown);\n }\n setActive(nextActive);\n }, 0);\n }, [stopUpdateActive]);\n\n const paintText = useCallback(() => {\n const win = tryGetWindow(inputRef.current);\n const doc = tryGetDocument(inputRef.current);\n if (!spanRef.current || !inputRef.current || !isWindow(win) || !isDocument(doc) || !active) {\n inputRef.current && (inputRef.current.style.backgroundImage = '');\n inputRef.current?.classList.remove(globalClasses.input);\n\n return;\n }\n\n inputRef.current?.classList.add(globalClasses.input);\n\n let shadow = spanRef.current.shadowRoot;\n let typedValueElement = shadow?.getElementById('typed-value');\n let fullValueElement = shadow?.getElementById('full-value');\n\n if (!typedValueElement || !fullValueElement) {\n shadow = spanRef.current.attachShadow({ mode: 'open' });\n\n typedValueElement = doc.createElement('span');\n fullValueElement = doc.createElement('span');\n typedValueElement.setAttribute('id', 'typed-value');\n fullValueElement.setAttribute('id', 'full-value');\n\n shadow.append(typedValueElement, fullValueElement);\n }\n\n const style = getComputedStyle(inputRef.current);\n\n typedValueElement.textContent =\n ((inputRef.current.getAttribute('data-unmasked-value') || focused.current) &&\n inputRef.current.getAttribute('data-typed-value')) ||\n '';\n\n fullValueElement.textContent = inputRef.current.value || inputRef.current.defaultValue || '';\n\n const inputRect = inputRef.current.getBoundingClientRect();\n const typedValueRect = typedValueElement.getBoundingClientRect();\n const fullValueRect = fullValueElement.getBoundingClientRect();\n\n const threshold = typedValueRect.width / (inputRect.width / 100);\n const degree = style.fontStyle === 'italic' ? 100 : 90;\n const restValueWidth = 1 - Math.min(fullValueRect.width / inputRect.width, 1);\n\n let typedValueColor = theme.inputTextColor;\n let maskColor = theme.inputPlaceholderColor;\n let indent = 0;\n\n if (props.disabled) {\n typedValueColor = theme.inputTextColorDisabled;\n maskColor = theme.inputTextColorDisabled;\n }\n if (props.showOnFocus) {\n maskColor = focused.current ? maskColor : 'transparent';\n }\n if (props.style?.textAlign === 'right') {\n indent = 100 * restValueWidth;\n }\n if (props.style?.textAlign === 'center') {\n indent = 50 * restValueWidth;\n }\n\n inputRef.current.style.backgroundImage = `\n linear-gradient(\n ${degree}deg,\n ${typedValueColor} ${threshold + indent}%,\n ${maskColor} ${threshold + indent}%\n )`;\n }, [\n active,\n props.showOnFocus,\n props.disabled,\n theme.inputTextColor,\n theme.inputPlaceholderColor,\n theme.inputTextColorDisabled,\n props.style?.textAlign,\n ]);\n\n const debouncedPaintText = useCallback(() => debounce(paintText), [paintText])();\n\n const handleInput = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n debouncedPaintText();\n\n onInput?.(e);\n },\n [debouncedPaintText, onInput],\n );\n\n const handleFocus = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n updateActive();\n\n focused.current = true;\n\n onFocus?.(e);\n },\n [onFocus, updateActive],\n );\n\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n updateActive();\n\n focused.current = false;\n\n onBlur?.(e);\n },\n [onBlur, updateActive],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n input: inputRef.current,\n getRootNode: () => inputRef.current,\n }),\n [],\n );\n\n useEffect(() => {\n debouncedPaintText();\n updateActive();\n\n return stopUpdateActive;\n }, [updateActive, props.value, props.defaultValue, theme, debouncedPaintText, stopUpdateActive]);\n\n return (\n <>\n {React.cloneElement(children, {\n ...inputProps,\n onInput: handleInput,\n onFocus: handleFocus,\n onBlur: handleBlur,\n inputRef,\n className: cx(props.className, active && globalClasses.input),\n })}\n {active && <span style={{ visibility: 'hidden', position: 'absolute', whiteSpace: 'pre' }} ref={spanRef} />}\n </>\n );\n },\n);\n"],"mappings":";;AAEA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;;AAEA,IAAAG,aAAA,GAAAH,OAAA;;AAEA,IAAAI,kBAAA,GAAAJ,OAA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AAE,EAAEsD,UAAU,EAAE,QAAQ,EAAEC,QAAQ,EAAE,UAAU,EAAEC,UAAU,EAAE,KAAK,CAAC,CAAE,EAAC/G,GAAG,EAAEI,OAAQ,EAAE;MAC1G,CAAC;;EAEP;AACF,CAAC","ignoreList":[]}
@@ -204,8 +204,9 @@ var FixedIMaskInput = exports.FixedIMaskInput = (0, _forwardRefAndName.forwardRe
204
204
 
205
205
  function handleInput(e) {var _imaskRef$current10;
206
206
  var maskRef = (_imaskRef$current10 = imaskRef.current) == null ? void 0 : _imaskRef$current10.maskRef;
207
- if (restProps.unmask && maskRef && maskRef.rawInputValue === '' && maskRef.unmaskedValue !== '') {
208
- // Для случаев, когда в value остаются только зафиксированные - {} - очищаем value полностью
207
+ if (maskRef && maskRef.rawInputValue === '') {
208
+ // в случае, когда пользователь стер все из инпута, очищаем value полностью
209
+ // иначе в value остаются символы маски
209
210
  props.onAccept == null || props.onAccept('', maskRef, e.nativeEvent);
210
211
  }
211
212
 
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactImask","_forwardRefAndName","_identifiers","_MouseDrag","_excluded","FixedIMaskInput","exports","forwardRefAndName","props","ref","inputRef","restProps","_objectWithoutPropertiesLoose2","default","imaskRef","useRef","focused","useEffect","_imaskRef$current","current","element","fillTypedValue","mouseDrag","MouseDrag","listen","onMouseDragEnd","e","_imaskRef$current2","_imaskRef$current3","direction","mouseDragStartEvent","selectionStart","selectionEnd","pageX","_getSelection","getSelection","start","end","setSelection","useImperativeHandle","createElement","IMaskInput","_extends2","onKeyDown","handleKeyDown","onFocus","handleFocus","onBlur","handleBlur","onMouseUp","handleMouseUp","onAccept","handleAccept","onInput","handleInput","getTypedValue","_imaskRef$current4","_ref","maskRef","masked","_ref$_value","_value","_ref$displayValue","displayValue","getMaxCaretPosition","value","slice","_imaskRef$current5","_imaskRef$current6","_imaskRef$current7","setAttribute","unmaskedValue","maskChars","push","placeholderChar","blocks","Object","values","forEach","_ref2","split","RegExp","join","length","Infinity","normalizeSelection","_getSelection2","max","getNormalizedRange","calc","Math","min","selectionDirection","_imaskRef$current8","_len","arguments","_ref3","Array","_key","setSelectionRange","jumpCaret","prev","headDirection","_imaskRef$current9","word","valueOf","wordRegExp","next","match","reduce","s","a","pos","concat","calcSelection","_getSelection3","isSelectionMode","isModShift","tail","head","someKeys","isKeyArrowLeft","isKeyArrowUp","isKeyHome","step","isKeyArrowHorizontal","increment","isShortcutJumpCaret","setTimeout","_len2","args","_key2","apply","_imaskRef$current10","unmask","rawInputValue","nativeEvent","nearest","isShortcutSelectAll","preventDefault","isKeyArrow","isKeyEnd","_calcSelection"],"sources":["FixedIMaskInput.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useRef } from 'react';\nimport type { InputMask, MaskedPatternOptions } from '@skbkontur/imask';\nimport type { IMaskInputProps } from '@skbkontur/react-imask';\nimport { IMaskInput } from '@skbkontur/react-imask';\n\nimport { forwardRefAndName } from '../../lib/forwardRefAndName';\nimport {\n isKeyArrow,\n isKeyArrowHorizontal,\n isKeyArrowLeft,\n isKeyArrowUp,\n isKeyEnd,\n isKeyHome,\n isModShift,\n isShortcutJumpCaret,\n isShortcutSelectAll,\n someKeys,\n} from '../../lib/events/keyboard/identifiers';\nimport { MouseDrag } from '../../lib/events/MouseDrag';\n\nexport type FixedIMaskInputProps = IMaskInputProps<HTMLInputElement>;\n\ntype HeadDirection = 'left' | 'right';\ntype SelectionDirection = 'forward' | 'backward' | 'none';\ntype SelectionSet = [number, number, SelectionDirection];\n\ninterface IMaskRefType {\n maskRef: InputMask<MaskedPatternOptions>;\n element: HTMLInputElement;\n}\n\nexport const FixedIMaskInput = forwardRefAndName(\n 'FixedIMaskInput',\n function FixedIMaskInput(props: FixedIMaskInputProps, ref: React.Ref<IMaskRefType | null>) {\n const { inputRef, ...restProps } = props;\n const imaskRef = useRef<IMaskRefType>(null);\n const focused = useRef(false);\n\n useEffect(() => {\n if (imaskRef.current?.element) {\n fillTypedValue();\n const mouseDrag = MouseDrag.listen(imaskRef.current.element).onMouseDragEnd((e) => {\n let direction: SelectionDirection = 'none';\n\n if (\n mouseDrag.mouseDragStartEvent &&\n imaskRef.current?.element.selectionStart !== imaskRef.current?.element.selectionEnd\n ) {\n direction = mouseDrag.mouseDragStartEvent.pageX > e.pageX ? 'backward' : 'forward';\n }\n\n const [start, end] = getSelection();\n setSelection(start, end, direction);\n });\n }\n }, []);\n\n useImperativeHandle(ref, () => imaskRef.current, []);\n\n return (\n <IMaskInput\n {...restProps}\n ref={imaskRef}\n inputRef={inputRef}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onMouseUp={handleMouseUp}\n onAccept={handleAccept}\n onInput={handleInput}\n />\n );\n\n function getTypedValue() {\n const { _value = '', displayValue = '' } = imaskRef.current?.maskRef.masked || {};\n const end = getMaxCaretPosition();\n const value = _value !== '' || focused.current === true ? displayValue : '';\n\n return value.slice(0, end);\n }\n\n function fillTypedValue() {\n imaskRef.current?.element.setAttribute('data-typed-value', getTypedValue());\n imaskRef.current?.element.setAttribute('data-unmasked-value', imaskRef.current?.maskRef.unmaskedValue);\n }\n\n function getMaxCaretPosition(): number {\n const maskChars = [];\n if (imaskRef.current) {\n maskChars.push(imaskRef.current.maskRef.masked.placeholderChar);\n if (imaskRef.current.maskRef.masked.blocks) {\n (Object.values(imaskRef.current.maskRef.masked.blocks) as Array<{ placeholderChar?: string }>).forEach(\n ({ placeholderChar }) => placeholderChar && maskChars.push(placeholderChar),\n );\n }\n return imaskRef.current.element.value.split(new RegExp(maskChars.join('|')))[0].length;\n }\n\n return Infinity;\n }\n\n function normalizeSelection() {\n const [start, end] = getSelection();\n const max = getMaxCaretPosition();\n if (end > max) {\n setSelection(start, max);\n }\n }\n\n function getNormalizedRange(calc: number | unknown) {\n return typeof calc === 'number' ? Math.min(getMaxCaretPosition(), Math.max(0, calc)) : 0;\n }\n\n function getSelection(): SelectionSet {\n if (imaskRef.current) {\n return [\n imaskRef.current.element.selectionStart || 0,\n imaskRef.current.element.selectionEnd || 0,\n imaskRef.current.element.selectionDirection || 'none',\n ];\n }\n return [0, 0, 'none'];\n }\n\n function setSelection(...[start, end, direction]: Parameters<HTMLInputElement['setSelectionRange']>) {\n imaskRef.current?.element.setSelectionRange(\n getNormalizedRange(start),\n getNormalizedRange(end),\n direction || 'none',\n );\n }\n\n function jumpCaret(prev: number, headDirection: HeadDirection) {\n const word = /а-яa-z0-9_/.valueOf();\n const wordRegExp = new RegExp(`([${word}])+[\\\\s]*|([^${word}])+`, 'gi');\n let next = headDirection === 'right' ? prev : 0;\n imaskRef.current?.element.value.match(wordRegExp)?.reduce<number[]>((s, a) => {\n const pos = a.length + (s.slice(-1)[0] || 0);\n if (headDirection === 'right' && next === prev && next < pos) {\n next = getNormalizedRange(pos);\n } else if (headDirection === 'left' && prev > pos) {\n next = getNormalizedRange(pos);\n }\n return [...s, pos];\n }, []);\n return next;\n }\n\n /**\n * Вычислят положение каретки при управлении клавишами\n * @param e\n */\n function calcSelection(e: React.KeyboardEvent<HTMLInputElement>): SelectionSet {\n const [start, end, direction] = getSelection();\n const isSelectionMode = isModShift()(e);\n let tail = start !== end && direction === 'backward' ? end : start;\n let head = start !== end && direction === 'backward' ? start : end;\n const headDirection: HeadDirection = someKeys(isKeyArrowLeft, isKeyArrowUp, isKeyHome)(e) ? 'left' : 'right';\n const step = isKeyArrowHorizontal(e) ? 1 : Infinity;\n const increment = headDirection === 'left' ? -step : step;\n if (isShortcutJumpCaret(e)) {\n head = jumpCaret(head, headDirection);\n } else if (head !== tail && !isSelectionMode && isKeyArrowHorizontal(e)) {\n head = headDirection === 'right' ? Math.max(tail, head) : Math.min(tail, head);\n } else {\n head = head + increment;\n }\n if (isSelectionMode) {\n const start = Math.min(tail, head);\n const end = Math.max(tail, head);\n return [getNormalizedRange(start), getNormalizedRange(end), end === head ? 'forward' : 'backward'];\n }\n tail = head;\n return [getNormalizedRange(tail), getNormalizedRange(head), 'none'];\n }\n\n function handleMouseUp(e: React.MouseEvent<HTMLInputElement>) {\n normalizeSelection();\n\n props.onMouseUp?.(e);\n }\n\n function handleFocus(e: React.FocusEvent<HTMLInputElement>) {\n focused.current = true;\n fillTypedValue();\n\n setTimeout(normalizeSelection);\n\n props.onFocus?.(e);\n }\n\n function handleBlur(e: React.FocusEvent<HTMLInputElement>) {\n focused.current = false;\n fillTypedValue();\n\n props.onBlur?.(e);\n }\n\n function handleAccept(...args: Parameters<Required<IMaskInputProps<HTMLInputElement>>['onAccept']>) {\n fillTypedValue();\n\n props.onAccept?.(...args);\n }\n\n function handleInput(e: React.ChangeEvent<HTMLInputElement>) {\n const maskRef = imaskRef.current?.maskRef;\n if (restProps.unmask && maskRef && maskRef.rawInputValue === '' && maskRef.unmaskedValue !== '') {\n // Для случаев, когда в value остаются только зафиксированные - {} - очищаем value полностью\n props.onAccept?.('', maskRef, e.nativeEvent as InputEvent);\n }\n\n props.onInput?.(e);\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n const nearest = getMaxCaretPosition();\n if (isShortcutSelectAll(e)) {\n e.preventDefault();\n setSelection(0, nearest);\n } else if (isKeyArrow(e) || isKeyEnd(e) || isKeyHome(e)) {\n e.preventDefault();\n const [start, end, direction] = calcSelection(e);\n setSelection(start, end, direction);\n }\n\n props.onKeyDown?.(e);\n }\n },\n);\n"],"mappings":"kdAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;;;AAGA,IAAAC,WAAA,GAAAD,OAAA;;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;;;;;;;;;;;;AAYA,IAAAI,UAAA,GAAAJ,OAAA,+BAAuD,IAAAK,SAAA;;;;;;;;;;;;;AAahD,IAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,oCAAiB;EAC9C,iBAAiB;EACjB,SAASF,eAAeA,CAACG,KAA2B,EAAEC,GAAmC,EAAE;IACzF,IAAQC,QA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AE;QAC/F;QACA/D,KAAK,CAAC2C,QAAQ,YAAd3C,KAAK,CAAC2C,QAAQ,CAAG,EAAE,EAAEO,OAAO,EAAEhC,CAAC,CAAC8G,WAAyB,CAAC;MAC5D;;MAEAhI,KAAK,CAAC6C,OAAO,YAAb7C,KAAK,CAAC6C,OAAO,CAAG3B,CAAC,CAAC;IACpB;;IAEA,SAASkB,aAAaA,CAAClB,CAAwC,EAAE;MAC/D,IAAM+G,OAAO,GAAGzE,mBAAmB,CAAC,CAAC;MACrC,IAAI,IAAA0E,gCAAmB,EAAChH,CAAC,CAAC,EAAE;QAC1BA,CAAC,CAACiH,cAAc,CAAC,CAAC;QAClBrG,YAAY,CAAC,CAAC,EAAEmG,OAAO,CAAC;MAC1B,CAAC,MAAM,IAAI,IAAAG,uBAAU,EAAClH,CAAC,CAAC,IAAI,IAAAmH,qBAAQ,EAACnH,CAAC,CAAC,IAAI,IAAAiG,sBAAS,EAACjG,CAAC,CAAC,EAAE;QACvDA,CAAC,CAACiH,cAAc,CAAC,CAAC;QAClB,IAAAG,cAAA,GAAgC5B,aAAa,CAACxF,CAAC,CAAC,CAAzCU,KAAK,GAAA0G,cAAA,IAAEzG,GAAG,GAAAyG,cAAA,IAAEjH,SAAS,GAAAiH,cAAA;QAC5BxG,YAAY,CAACF,KAAK,EAAEC,GAAG,EAAER,SAAS,CAAC;MACrC;;MAEArB,KAAK,CAACmC,SAAS,YAAfnC,KAAK,CAACmC,SAAS,CAAGjB,CAAC,CAAC;IACtB;EACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactImask","_forwardRefAndName","_identifiers","_MouseDrag","_excluded","FixedIMaskInput","exports","forwardRefAndName","props","ref","inputRef","restProps","_objectWithoutPropertiesLoose2","default","imaskRef","useRef","focused","useEffect","_imaskRef$current","current","element","fillTypedValue","mouseDrag","MouseDrag","listen","onMouseDragEnd","e","_imaskRef$current2","_imaskRef$current3","direction","mouseDragStartEvent","selectionStart","selectionEnd","pageX","_getSelection","getSelection","start","end","setSelection","useImperativeHandle","createElement","IMaskInput","_extends2","onKeyDown","handleKeyDown","onFocus","handleFocus","onBlur","handleBlur","onMouseUp","handleMouseUp","onAccept","handleAccept","onInput","handleInput","getTypedValue","_imaskRef$current4","_ref","maskRef","masked","_ref$_value","_value","_ref$displayValue","displayValue","getMaxCaretPosition","value","slice","_imaskRef$current5","_imaskRef$current6","_imaskRef$current7","setAttribute","unmaskedValue","maskChars","push","placeholderChar","blocks","Object","values","forEach","_ref2","split","RegExp","join","length","Infinity","normalizeSelection","_getSelection2","max","getNormalizedRange","calc","Math","min","selectionDirection","_imaskRef$current8","_len","arguments","_ref3","Array","_key","setSelectionRange","jumpCaret","prev","headDirection","_imaskRef$current9","word","valueOf","wordRegExp","next","match","reduce","s","a","pos","concat","calcSelection","_getSelection3","isSelectionMode","isModShift","tail","head","someKeys","isKeyArrowLeft","isKeyArrowUp","isKeyHome","step","isKeyArrowHorizontal","increment","isShortcutJumpCaret","setTimeout","_len2","args","_key2","apply","_imaskRef$current10","rawInputValue","nativeEvent","nearest","isShortcutSelectAll","preventDefault","isKeyArrow","isKeyEnd","_calcSelection"],"sources":["FixedIMaskInput.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useRef } from 'react';\nimport type { InputMask, MaskedPatternOptions } from '@skbkontur/imask';\nimport type { IMaskInputProps } from '@skbkontur/react-imask';\nimport { IMaskInput } from '@skbkontur/react-imask';\n\nimport { forwardRefAndName } from '../../lib/forwardRefAndName';\nimport {\n isKeyArrow,\n isKeyArrowHorizontal,\n isKeyArrowLeft,\n isKeyArrowUp,\n isKeyEnd,\n isKeyHome,\n isModShift,\n isShortcutJumpCaret,\n isShortcutSelectAll,\n someKeys,\n} from '../../lib/events/keyboard/identifiers';\nimport { MouseDrag } from '../../lib/events/MouseDrag';\n\nexport type FixedIMaskInputProps = IMaskInputProps<HTMLInputElement>;\n\ntype HeadDirection = 'left' | 'right';\ntype SelectionDirection = 'forward' | 'backward' | 'none';\ntype SelectionSet = [number, number, SelectionDirection];\n\ninterface IMaskRefType {\n maskRef: InputMask<MaskedPatternOptions>;\n element: HTMLInputElement;\n}\n\nexport const FixedIMaskInput = forwardRefAndName(\n 'FixedIMaskInput',\n function FixedIMaskInput(props: FixedIMaskInputProps, ref: React.Ref<IMaskRefType | null>) {\n const { inputRef, ...restProps } = props;\n const imaskRef = useRef<IMaskRefType>(null);\n const focused = useRef(false);\n\n useEffect(() => {\n if (imaskRef.current?.element) {\n fillTypedValue();\n const mouseDrag = MouseDrag.listen(imaskRef.current.element).onMouseDragEnd((e) => {\n let direction: SelectionDirection = 'none';\n\n if (\n mouseDrag.mouseDragStartEvent &&\n imaskRef.current?.element.selectionStart !== imaskRef.current?.element.selectionEnd\n ) {\n direction = mouseDrag.mouseDragStartEvent.pageX > e.pageX ? 'backward' : 'forward';\n }\n\n const [start, end] = getSelection();\n setSelection(start, end, direction);\n });\n }\n }, []);\n\n useImperativeHandle(ref, () => imaskRef.current, []);\n\n return (\n <IMaskInput\n {...restProps}\n ref={imaskRef}\n inputRef={inputRef}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onMouseUp={handleMouseUp}\n onAccept={handleAccept}\n onInput={handleInput}\n />\n );\n\n function getTypedValue() {\n const { _value = '', displayValue = '' } = imaskRef.current?.maskRef.masked || {};\n const end = getMaxCaretPosition();\n const value = _value !== '' || focused.current === true ? displayValue : '';\n\n return value.slice(0, end);\n }\n\n function fillTypedValue() {\n imaskRef.current?.element.setAttribute('data-typed-value', getTypedValue());\n imaskRef.current?.element.setAttribute('data-unmasked-value', imaskRef.current?.maskRef.unmaskedValue);\n }\n\n function getMaxCaretPosition(): number {\n const maskChars = [];\n if (imaskRef.current) {\n maskChars.push(imaskRef.current.maskRef.masked.placeholderChar);\n if (imaskRef.current.maskRef.masked.blocks) {\n (Object.values(imaskRef.current.maskRef.masked.blocks) as Array<{ placeholderChar?: string }>).forEach(\n ({ placeholderChar }) => placeholderChar && maskChars.push(placeholderChar),\n );\n }\n return imaskRef.current.element.value.split(new RegExp(maskChars.join('|')))[0].length;\n }\n\n return Infinity;\n }\n\n function normalizeSelection() {\n const [start, end] = getSelection();\n const max = getMaxCaretPosition();\n if (end > max) {\n setSelection(start, max);\n }\n }\n\n function getNormalizedRange(calc: number | unknown) {\n return typeof calc === 'number' ? Math.min(getMaxCaretPosition(), Math.max(0, calc)) : 0;\n }\n\n function getSelection(): SelectionSet {\n if (imaskRef.current) {\n return [\n imaskRef.current.element.selectionStart || 0,\n imaskRef.current.element.selectionEnd || 0,\n imaskRef.current.element.selectionDirection || 'none',\n ];\n }\n return [0, 0, 'none'];\n }\n\n function setSelection(...[start, end, direction]: Parameters<HTMLInputElement['setSelectionRange']>) {\n imaskRef.current?.element.setSelectionRange(\n getNormalizedRange(start),\n getNormalizedRange(end),\n direction || 'none',\n );\n }\n\n function jumpCaret(prev: number, headDirection: HeadDirection) {\n const word = /а-яa-z0-9_/.valueOf();\n const wordRegExp = new RegExp(`([${word}])+[\\\\s]*|([^${word}])+`, 'gi');\n let next = headDirection === 'right' ? prev : 0;\n imaskRef.current?.element.value.match(wordRegExp)?.reduce<number[]>((s, a) => {\n const pos = a.length + (s.slice(-1)[0] || 0);\n if (headDirection === 'right' && next === prev && next < pos) {\n next = getNormalizedRange(pos);\n } else if (headDirection === 'left' && prev > pos) {\n next = getNormalizedRange(pos);\n }\n return [...s, pos];\n }, []);\n return next;\n }\n\n /**\n * Вычислят положение каретки при управлении клавишами\n * @param e\n */\n function calcSelection(e: React.KeyboardEvent<HTMLInputElement>): SelectionSet {\n const [start, end, direction] = getSelection();\n const isSelectionMode = isModShift()(e);\n let tail = start !== end && direction === 'backward' ? end : start;\n let head = start !== end && direction === 'backward' ? start : end;\n const headDirection: HeadDirection = someKeys(isKeyArrowLeft, isKeyArrowUp, isKeyHome)(e) ? 'left' : 'right';\n const step = isKeyArrowHorizontal(e) ? 1 : Infinity;\n const increment = headDirection === 'left' ? -step : step;\n if (isShortcutJumpCaret(e)) {\n head = jumpCaret(head, headDirection);\n } else if (head !== tail && !isSelectionMode && isKeyArrowHorizontal(e)) {\n head = headDirection === 'right' ? Math.max(tail, head) : Math.min(tail, head);\n } else {\n head = head + increment;\n }\n if (isSelectionMode) {\n const start = Math.min(tail, head);\n const end = Math.max(tail, head);\n return [getNormalizedRange(start), getNormalizedRange(end), end === head ? 'forward' : 'backward'];\n }\n tail = head;\n return [getNormalizedRange(tail), getNormalizedRange(head), 'none'];\n }\n\n function handleMouseUp(e: React.MouseEvent<HTMLInputElement>) {\n normalizeSelection();\n\n props.onMouseUp?.(e);\n }\n\n function handleFocus(e: React.FocusEvent<HTMLInputElement>) {\n focused.current = true;\n fillTypedValue();\n\n setTimeout(normalizeSelection);\n\n props.onFocus?.(e);\n }\n\n function handleBlur(e: React.FocusEvent<HTMLInputElement>) {\n focused.current = false;\n fillTypedValue();\n\n props.onBlur?.(e);\n }\n\n function handleAccept(...args: Parameters<Required<IMaskInputProps<HTMLInputElement>>['onAccept']>) {\n fillTypedValue();\n\n props.onAccept?.(...args);\n }\n\n function handleInput(e: React.ChangeEvent<HTMLInputElement>) {\n const maskRef = imaskRef.current?.maskRef;\n if (maskRef && maskRef.rawInputValue === '') {\n // в случае, когда пользователь стер все из инпута, очищаем value полностью\n // иначе в value остаются символы маски\n props.onAccept?.('', maskRef, e.nativeEvent as InputEvent);\n }\n\n props.onInput?.(e);\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n const nearest = getMaxCaretPosition();\n if (isShortcutSelectAll(e)) {\n e.preventDefault();\n setSelection(0, nearest);\n } else if (isKeyArrow(e) || isKeyEnd(e) || isKeyHome(e)) {\n e.preventDefault();\n const [start, end, direction] = calcSelection(e);\n setSelection(start, end, direction);\n }\n\n props.onKeyDown?.(e);\n }\n },\n);\n"],"mappings":"kdAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;;;AAGA,IAAAC,WAAA,GA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import type { IMaskInputProps } from '@skbkontur/react-imask';
2
2
  import type { InputProps, InputType } from '../Input';
3
3
  import { Input } from '../Input';
4
+ export type MaskedInputOnBeforePasteValue = (value: string) => string;
4
5
  export interface MaskedProps {
5
6
  /** Паттерн маски */
6
7
  mask: string;
@@ -21,6 +22,13 @@ export interface MaskedProps {
21
22
  * @param blink вспыхнуть акцентным цвтетом.
22
23
  */
23
24
  onUnexpectedInput?: (value: string, blink: () => void) => void;
25
+ /** Задает обработчик вставки значения в инпут.
26
+ * В value будет передано значение из буфера обмена.
27
+ * Возвращаемое значение будет использовано как значение инпута.
28
+ * Используется для фильтрации значения при вставке из буфера обмена.
29
+ * @param value значение вставки.
30
+ */
31
+ onBeforePasteValue?: MaskedInputOnBeforePasteValue;
24
32
  /** Убирает из value символы, не введённые пользователем
25
33
  * @default false */
26
34
  unmask?: boolean;
@@ -33,6 +41,7 @@ export interface MaskedProps {
33
41
  imaskProps?: IMaskInputProps<HTMLInputElement>;
34
42
  }
35
43
  export type MaskInputType = Exclude<InputType, 'number' | 'date' | 'time' | 'password'>;
44
+ export declare const getSafeMaskInputType: (type?: InputType) => MaskInputType | undefined;
36
45
  export interface MaskedInputProps extends MaskedProps, Omit<InputProps, 'showClearIcon' | 'mask' | 'maxLength' | 'type' | 'alwaysShowMask' | 'onUnexpectedInput' | 'maskChar'> {
37
46
  type?: MaskInputType;
38
47
  }
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.MaskedInput = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _react = _interopRequireWildcard(require("react"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.getSafeMaskInputType = exports.MaskedInput = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _react = _interopRequireWildcard(require("react"));
2
2
 
3
3
 
4
4
 
@@ -12,7 +12,7 @@ var _ThemeContext = require("../../lib/theming/ThemeContext");
12
12
  var _MaskedInput = require("./MaskedInput.styles");
13
13
  var _MaskedInput2 = require("./MaskedInput.helpers");
14
14
  var _ColorableInputElement = require("./ColorableInputElement");
15
- var _FixedIMaskInput = require("./FixedIMaskInput");var _excluded = ["mask", "maskChar", "formatChars", "alwaysShowMask", "colored", "imaskProps", "unmask", "onValueChange", "onUnexpectedInput", "onChange", "element", "className"];
15
+ var _FixedIMaskInput = require("./FixedIMaskInput");var _excluded = ["mask", "maskChar", "formatChars", "alwaysShowMask", "colored", "imaskProps", "unmask", "onValueChange", "onUnexpectedInput", "onChange", "onBeforePasteValue", "element", "className", "maxLength"];
16
16
 
17
17
 
18
18
 
@@ -54,6 +54,32 @@ var _FixedIMaskInput = require("./FixedIMaskInput");var _excluded = ["mask", "ma
54
54
 
55
55
 
56
56
 
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+ var getSafeMaskInputType = exports.getSafeMaskInputType = function getSafeMaskInputType(type) {
69
+ if (!type) {
70
+ return type;
71
+ }
72
+
73
+ switch (type) {
74
+ case 'number':
75
+ case 'date':
76
+ case 'time':
77
+ case 'password':
78
+ return 'text';
79
+ default:
80
+ return type;
81
+ }
82
+ };
57
83
 
58
84
 
59
85
 
@@ -85,7 +111,10 @@ var MaskedInput = exports.MaskedInput = (0, _forwardRefAndName.forwardRefAndName
85
111
 
86
112
 
87
113
 
88
- props.mask,maskChar = props.maskChar,formatChars = props.formatChars,_props$alwaysShowMask = props.alwaysShowMask,alwaysShowMask = _props$alwaysShowMask === void 0 ? false : _props$alwaysShowMask,_props$colored = props.colored,colored = _props$colored === void 0 ? true : _props$colored,_props$imaskProps = props.imaskProps,customIMaskProps = _props$imaskProps === void 0 ? {} : _props$imaskProps,_props$unmask = props.unmask,unmask = _props$unmask === void 0 ? false : _props$unmask,onValueChange = props.onValueChange,onUnexpectedInput = props.onUnexpectedInput,onChange = props.onChange,element = props.element,className = props.className,inputProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
114
+
115
+
116
+
117
+ props.mask,maskChar = props.maskChar,formatChars = props.formatChars,_props$alwaysShowMask = props.alwaysShowMask,alwaysShowMask = _props$alwaysShowMask === void 0 ? false : _props$alwaysShowMask,_props$colored = props.colored,colored = _props$colored === void 0 ? true : _props$colored,_props$imaskProps = props.imaskProps,customIMaskProps = _props$imaskProps === void 0 ? {} : _props$imaskProps,_props$unmask = props.unmask,unmask = _props$unmask === void 0 ? false : _props$unmask,onValueChange = props.onValueChange,onUnexpectedInput = props.onUnexpectedInput,onChange = props.onChange,onBeforePasteValue = props.onBeforePasteValue,element = props.element,className = props.className,maxLength = props.maxLength,inputProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
89
118
  var theme = (0, _react.useContext)(_ThemeContext.ThemeContext);
90
119
 
91
120
  var inputRef = (0, _react.useRef)(null);
@@ -131,10 +160,11 @@ var MaskedInput = exports.MaskedInput = (0, _forwardRefAndName.forwardRefAndName
131
160
  onBlur: handleBlur,
132
161
  onInput: handleInput,
133
162
  onKeyDown: handleKeyDown,
163
+ onPaste: handlePaste,
134
164
  className: (0, _Emotion.cx)(_MaskedInput.globalClasses.root, uiFontGlobalClassesRoot, className, _MaskedInput.styles.root(theme)),
135
165
  element:
136
166
  colored ? /*#__PURE__*/
137
- _react.default.createElement(_ColorableInputElement.ColorableInputElement, { showOnFocus: false }, /*#__PURE__*/
167
+ _react.default.createElement(_ColorableInputElement.ColorableInputElement, { showOnFocus: false, alwaysShowMask: alwaysShowMask }, /*#__PURE__*/
138
168
  _react.default.createElement(_FixedIMaskInput.FixedIMaskInput, (0, _extends2.default)({}, imaskProps, { onAccept: handleAccept }))
139
169
  ) : /*#__PURE__*/
140
170
 
@@ -144,6 +174,15 @@ var MaskedInput = exports.MaskedInput = (0, _forwardRefAndName.forwardRefAndName
144
174
  ));
145
175
 
146
176
 
177
+ function handlePaste(event) {
178
+ if (onBeforePasteValue && onValueChange) {var _event$clipboardData$, _event$clipboardData;
179
+ event.preventDefault();
180
+ onValueChange == null || onValueChange(onBeforePasteValue((_event$clipboardData$ = (_event$clipboardData = event.clipboardData) == null ? void 0 : _event$clipboardData.getData('text')) != null ? _event$clipboardData$ : ''));
181
+ }
182
+
183
+ props.onPaste == null || props.onPaste(event);
184
+ }
185
+
147
186
  function getCompatibleIMaskProps() {
148
187
  return (0, _extends2.default)({
149
188
  mask: mask.replace(/0/g, '{\\0}'),