@skbkontur/react-ui 4.2.1 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/cjs/components/Autocomplete/Autocomplete.d.ts +9 -17
  3. package/cjs/components/Autocomplete/Autocomplete.js +10 -6
  4. package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  5. package/cjs/components/Button/Button.d.ts +4 -5
  6. package/cjs/components/Button/Button.js +8 -3
  7. package/cjs/components/Button/Button.js.map +1 -1
  8. package/cjs/components/Button/Button.mixins.js +1 -1
  9. package/cjs/components/Button/Button.mixins.js.map +1 -1
  10. package/cjs/components/Button/Button.styles.js +18 -18
  11. package/cjs/components/Button/Button.styles.js.map +1 -1
  12. package/cjs/components/Center/Center.d.ts +4 -3
  13. package/cjs/components/Center/Center.js +9 -3
  14. package/cjs/components/Center/Center.js.map +1 -1
  15. package/cjs/components/Checkbox/Checkbox.md +48 -0
  16. package/cjs/components/ComboBox/ComboBox.d.ts +8 -13
  17. package/cjs/components/ComboBox/ComboBox.js +12 -2
  18. package/cjs/components/ComboBox/ComboBox.js.map +1 -1
  19. package/cjs/components/CurrencyInput/CurrencyInput.d.ts +6 -9
  20. package/cjs/components/CurrencyInput/CurrencyInput.js +19 -6
  21. package/cjs/components/CurrencyInput/CurrencyInput.js.map +1 -1
  22. package/cjs/components/CurrencyInput/CurrencyInputKeyboardActions.d.ts +2 -0
  23. package/cjs/components/CurrencyInput/CurrencyInputKeyboardActions.js +14 -2
  24. package/cjs/components/CurrencyInput/CurrencyInputKeyboardActions.js.map +1 -1
  25. package/cjs/components/CurrencyLabel/CurrencyLabel.d.ts +3 -9
  26. package/cjs/components/CurrencyLabel/CurrencyLabel.js +15 -15
  27. package/cjs/components/CurrencyLabel/CurrencyLabel.js.map +1 -1
  28. package/cjs/components/DateInput/DateFragmentsView.js +1 -1
  29. package/cjs/components/DateInput/DateFragmentsView.js.map +1 -1
  30. package/cjs/components/DateInput/DateInput.d.ts +8 -11
  31. package/cjs/components/DateInput/DateInput.js +11 -3
  32. package/cjs/components/DateInput/DateInput.js.map +1 -1
  33. package/cjs/components/DatePicker/DatePicker.d.ts +7 -9
  34. package/cjs/components/DatePicker/DatePicker.js +12 -6
  35. package/cjs/components/DatePicker/DatePicker.js.map +1 -1
  36. package/cjs/components/DropdownMenu/DropdownMenu.d.ts +5 -5
  37. package/cjs/components/DropdownMenu/DropdownMenu.js +9 -3
  38. package/cjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
  39. package/cjs/components/FileUploader/FileUploader.md +8 -1
  40. package/cjs/components/FxInput/FxInput.d.ts +6 -6
  41. package/cjs/components/FxInput/FxInput.js +13 -10
  42. package/cjs/components/FxInput/FxInput.js.map +1 -1
  43. package/cjs/components/Gapped/Gapped.d.ts +7 -8
  44. package/cjs/components/Gapped/Gapped.js +12 -6
  45. package/cjs/components/Gapped/Gapped.js.map +1 -1
  46. package/cjs/components/GlobalLoader/GlobalLoader.d.ts +7 -14
  47. package/cjs/components/GlobalLoader/GlobalLoader.js +13 -9
  48. package/cjs/components/GlobalLoader/GlobalLoader.js.map +1 -1
  49. package/cjs/components/Hint/Hint.d.ts +8 -12
  50. package/cjs/components/Hint/Hint.js +15 -5
  51. package/cjs/components/Hint/Hint.js.map +1 -1
  52. package/cjs/components/Hint/Hint.md +14 -0
  53. package/cjs/components/Input/Input.d.ts +4 -3
  54. package/cjs/components/Input/Input.js +7 -4
  55. package/cjs/components/Input/Input.js.map +1 -1
  56. package/cjs/components/Kebab/Kebab.d.ts +7 -11
  57. package/cjs/components/Kebab/Kebab.js +14 -5
  58. package/cjs/components/Kebab/Kebab.js.map +1 -1
  59. package/cjs/components/Link/Link.d.ts +4 -4
  60. package/cjs/components/Link/Link.js +11 -4
  61. package/cjs/components/Link/Link.js.map +1 -1
  62. package/cjs/components/Loader/Loader.d.ts +7 -4
  63. package/cjs/components/Loader/Loader.js +14 -4
  64. package/cjs/components/Loader/Loader.js.map +1 -1
  65. package/cjs/components/Modal/Modal.d.ts +4 -3
  66. package/cjs/components/Modal/Modal.js +8 -3
  67. package/cjs/components/Modal/Modal.js.map +1 -1
  68. package/cjs/components/Modal/ModalFooter.js +1 -1
  69. package/cjs/components/Modal/ModalFooter.js.map +1 -1
  70. package/cjs/components/Modal/ModalHeader.js +1 -1
  71. package/cjs/components/Modal/ModalHeader.js.map +1 -1
  72. package/cjs/components/Paging/Paging.d.ts +6 -9
  73. package/cjs/components/Paging/Paging.js +15 -5
  74. package/cjs/components/Paging/Paging.js.map +1 -1
  75. package/cjs/components/Paging/PagingDefaultComponent.d.ts +1 -1
  76. package/cjs/components/Paging/PagingDefaultComponent.js.map +1 -1
  77. package/cjs/components/PasswordInput/PasswordInput.d.ts +4 -3
  78. package/cjs/components/PasswordInput/PasswordInput.js +8 -3
  79. package/cjs/components/PasswordInput/PasswordInput.js.map +1 -1
  80. package/cjs/components/Radio/Radio.d.ts +4 -3
  81. package/cjs/components/Radio/Radio.js +8 -3
  82. package/cjs/components/Radio/Radio.js.map +1 -1
  83. package/cjs/components/RadioGroup/RadioGroup.d.ts +2 -4
  84. package/cjs/components/RadioGroup/RadioGroup.js +4 -2
  85. package/cjs/components/RadioGroup/RadioGroup.js.map +1 -1
  86. package/cjs/components/ScrollContainer/ScrollContainer.d.ts +7 -8
  87. package/cjs/components/ScrollContainer/ScrollContainer.helpers.js +4 -4
  88. package/cjs/components/ScrollContainer/ScrollContainer.helpers.js.map +1 -1
  89. package/cjs/components/ScrollContainer/ScrollContainer.js +12 -6
  90. package/cjs/components/ScrollContainer/ScrollContainer.js.map +1 -1
  91. package/cjs/components/Select/Select.d.ts +3 -12
  92. package/cjs/components/Select/Select.js +6 -1
  93. package/cjs/components/Select/Select.js.map +1 -1
  94. package/cjs/components/Select/Select.styles.js +4 -4
  95. package/cjs/components/Select/Select.styles.js.map +1 -1
  96. package/cjs/components/SidePage/SidePage.d.ts +5 -6
  97. package/cjs/components/SidePage/SidePage.js +8 -1
  98. package/cjs/components/SidePage/SidePage.js.map +1 -1
  99. package/cjs/components/Spinner/Spinner.d.ts +4 -2
  100. package/cjs/components/Spinner/Spinner.js +9 -3
  101. package/cjs/components/Spinner/Spinner.js.map +1 -1
  102. package/cjs/components/Sticky/Sticky.d.ts +5 -4
  103. package/cjs/components/Sticky/Sticky.js +9 -2
  104. package/cjs/components/Sticky/Sticky.js.map +1 -1
  105. package/cjs/components/Tabs/Tab.d.ts +4 -4
  106. package/cjs/components/Tabs/Tab.js +11 -13
  107. package/cjs/components/Tabs/Tab.js.map +1 -1
  108. package/cjs/components/Tabs/Tabs.d.ts +4 -4
  109. package/cjs/components/Tabs/Tabs.js +12 -3
  110. package/cjs/components/Tabs/Tabs.js.map +1 -1
  111. package/cjs/components/Textarea/Textarea.d.ts +8 -10
  112. package/cjs/components/Textarea/Textarea.js +10 -6
  113. package/cjs/components/Textarea/Textarea.js.map +1 -1
  114. package/cjs/components/Toast/Toast.js.map +1 -1
  115. package/cjs/components/Toggle/Toggle.d.ts +5 -6
  116. package/cjs/components/Toggle/Toggle.js +10 -4
  117. package/cjs/components/Toggle/Toggle.js.map +1 -1
  118. package/cjs/components/TokenInput/TokenInput.d.ts +19 -16
  119. package/cjs/components/TokenInput/TokenInput.js +75 -57
  120. package/cjs/components/TokenInput/TokenInput.js.map +1 -1
  121. package/cjs/components/Tooltip/Tooltip.d.ts +13 -19
  122. package/cjs/components/Tooltip/Tooltip.js +27 -24
  123. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  124. package/cjs/components/TooltipMenu/TooltipMenu.d.ts +5 -4
  125. package/cjs/components/TooltipMenu/TooltipMenu.js +11 -5
  126. package/cjs/components/TooltipMenu/TooltipMenu.js.map +1 -1
  127. package/cjs/internal/BGRuler.d.ts +13 -15
  128. package/cjs/internal/BGRuler.js +16 -8
  129. package/cjs/internal/BGRuler.js.map +1 -1
  130. package/cjs/internal/Calendar/Calendar.d.ts +4 -13
  131. package/cjs/internal/Calendar/Calendar.js +10 -5
  132. package/cjs/internal/Calendar/Calendar.js.map +1 -1
  133. package/cjs/internal/Calendar/DayCellView.styles.js +1 -1
  134. package/cjs/internal/Calendar/DayCellView.styles.js.map +1 -1
  135. package/cjs/internal/Calendar/Month.js +16 -11
  136. package/cjs/internal/Calendar/Month.js.map +1 -1
  137. package/cjs/internal/CommonWrapper/CommonWrapper.d.ts +1 -1
  138. package/cjs/internal/CommonWrapper/CommonWrapper.js.map +1 -1
  139. package/cjs/internal/ComponentCombinator.d.ts +6 -8
  140. package/cjs/internal/ComponentCombinator.js +6 -2
  141. package/cjs/internal/ComponentCombinator.js.map +1 -1
  142. package/cjs/internal/ComponentTable.d.ts +5 -6
  143. package/cjs/internal/ComponentTable.js +11 -2
  144. package/cjs/internal/ComponentTable.js.map +1 -1
  145. package/cjs/internal/CustomComboBox/ComboBoxMenu.d.ts +4 -4
  146. package/cjs/internal/CustomComboBox/ComboBoxMenu.js +7 -1
  147. package/cjs/internal/CustomComboBox/ComboBoxMenu.js.map +1 -1
  148. package/cjs/internal/CustomComboBox/ComboBoxView.d.ts +4 -12
  149. package/cjs/internal/CustomComboBox/ComboBoxView.js +18 -10
  150. package/cjs/internal/CustomComboBox/ComboBoxView.js.map +1 -1
  151. package/cjs/internal/DateSelect/DateSelect.d.ts +4 -6
  152. package/cjs/internal/DateSelect/DateSelect.js +15 -9
  153. package/cjs/internal/DateSelect/DateSelect.js.map +1 -1
  154. package/cjs/internal/DropdownContainer/DropdownContainer.d.ts +4 -7
  155. package/cjs/internal/DropdownContainer/DropdownContainer.js +8 -5
  156. package/cjs/internal/DropdownContainer/DropdownContainer.js.map +1 -1
  157. package/cjs/internal/HideBodyVerticalScroll/HideBodyVerticalScroll.js +2 -1
  158. package/cjs/internal/HideBodyVerticalScroll/HideBodyVerticalScroll.js.map +1 -1
  159. package/cjs/internal/InputLikeText/InputLikeText.d.ts +4 -3
  160. package/cjs/internal/InputLikeText/InputLikeText.js +7 -2
  161. package/cjs/internal/InputLikeText/InputLikeText.js.map +1 -1
  162. package/cjs/internal/InternalMenu/InternalMenu.d.ts +3 -9
  163. package/cjs/internal/InternalMenu/InternalMenu.js +36 -14
  164. package/cjs/internal/InternalMenu/InternalMenu.js.map +1 -1
  165. package/cjs/internal/InternalMenu/InternalMenu.styles.js +2 -1
  166. package/cjs/internal/InternalMenu/InternalMenu.styles.js.map +1 -1
  167. package/cjs/internal/MaskedInput/MaskedInput.d.ts +5 -2
  168. package/cjs/internal/MaskedInput/MaskedInput.js +17 -6
  169. package/cjs/internal/MaskedInput/MaskedInput.js.map +1 -1
  170. package/cjs/internal/Menu/Menu.d.ts +4 -7
  171. package/cjs/internal/Menu/Menu.js +14 -4
  172. package/cjs/internal/Menu/Menu.js.map +1 -1
  173. package/cjs/internal/Popup/Popup.d.ts +11 -17
  174. package/cjs/internal/Popup/Popup.js +38 -19
  175. package/cjs/internal/Popup/Popup.js.map +1 -1
  176. package/cjs/internal/Popup/PopupHelper.d.ts +1 -1
  177. package/cjs/internal/Popup/PopupHelper.js.map +1 -1
  178. package/cjs/internal/Popup/PopupPin.d.ts +1 -1
  179. package/cjs/internal/Popup/PopupPin.js.map +1 -1
  180. package/cjs/internal/PopupMenu/PopupMenu.d.ts +8 -11
  181. package/cjs/internal/PopupMenu/PopupMenu.js +8 -1
  182. package/cjs/internal/PopupMenu/PopupMenu.js.map +1 -1
  183. package/cjs/internal/RenderLayer/RenderLayer.d.ts +6 -4
  184. package/cjs/internal/RenderLayer/RenderLayer.js +15 -4
  185. package/cjs/internal/RenderLayer/RenderLayer.js.map +1 -1
  186. package/cjs/internal/ThemePlayground/VariableValue.d.ts +5 -4
  187. package/cjs/internal/ThemePlayground/VariableValue.js +6 -1
  188. package/cjs/internal/ThemePlayground/VariableValue.js.map +1 -1
  189. package/cjs/internal/ZIndex/ZIndex.d.ts +7 -11
  190. package/cjs/internal/ZIndex/ZIndex.js +10 -3
  191. package/cjs/internal/ZIndex/ZIndex.js.map +1 -1
  192. package/cjs/internal/themes/DefaultTheme.js +1 -1
  193. package/cjs/internal/themes/DefaultTheme.js.map +1 -1
  194. package/cjs/lib/InstanceWithAnchorElement.d.ts +1 -1
  195. package/cjs/lib/InstanceWithAnchorElement.js.map +1 -1
  196. package/cjs/lib/SSRSafe.d.ts +2 -1
  197. package/cjs/lib/SSRSafe.js +9 -1
  198. package/cjs/lib/SSRSafe.js.map +1 -1
  199. package/cjs/lib/createPropsGetter.d.ts +2 -1
  200. package/cjs/lib/createPropsGetter.js +2 -0
  201. package/cjs/lib/createPropsGetter.js.map +1 -1
  202. package/cjs/lib/listenFocusOutside.d.ts +1 -1
  203. package/cjs/lib/listenFocusOutside.js.map +1 -1
  204. package/cjs/lib/rootNode/getRootNode.d.ts +3 -3
  205. package/cjs/lib/rootNode/getRootNode.js +7 -7
  206. package/cjs/lib/rootNode/getRootNode.js.map +1 -1
  207. package/cjs/lib/rootNode/rootNodeDecorator.d.ts +7 -7
  208. package/cjs/lib/rootNode/rootNodeDecorator.js.map +1 -1
  209. package/cjs/typings/event-types.d.ts +2 -2
  210. package/components/Autocomplete/Autocomplete/Autocomplete.js +22 -12
  211. package/components/Autocomplete/Autocomplete/Autocomplete.js.map +1 -1
  212. package/components/Autocomplete/Autocomplete.d.ts +9 -17
  213. package/components/Button/Button/Button.js +11 -5
  214. package/components/Button/Button/Button.js.map +1 -1
  215. package/components/Button/Button.d.ts +4 -5
  216. package/components/Button/Button.mixins/Button.mixins.js +1 -1
  217. package/components/Button/Button.mixins/Button.mixins.js.map +1 -1
  218. package/components/Button/Button.styles/Button.styles.js +18 -18
  219. package/components/Button/Button.styles/Button.styles.js.map +1 -1
  220. package/components/Center/Center/Center.js +7 -5
  221. package/components/Center/Center/Center.js.map +1 -1
  222. package/components/Center/Center.d.ts +4 -3
  223. package/components/Checkbox/Checkbox.md +48 -0
  224. package/components/ComboBox/ComboBox/ComboBox.js +3 -1
  225. package/components/ComboBox/ComboBox/ComboBox.js.map +1 -1
  226. package/components/ComboBox/ComboBox.d.ts +8 -13
  227. package/components/CurrencyInput/CurrencyInput/CurrencyInput.js +28 -18
  228. package/components/CurrencyInput/CurrencyInput/CurrencyInput.js.map +1 -1
  229. package/components/CurrencyInput/CurrencyInput.d.ts +6 -9
  230. package/components/CurrencyInput/CurrencyInputKeyboardActions/CurrencyInputKeyboardActions.js +4 -2
  231. package/components/CurrencyInput/CurrencyInputKeyboardActions/CurrencyInputKeyboardActions.js.map +1 -1
  232. package/components/CurrencyInput/CurrencyInputKeyboardActions.d.ts +2 -0
  233. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js +21 -15
  234. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js.map +1 -1
  235. package/components/CurrencyLabel/CurrencyLabel.d.ts +3 -9
  236. package/components/DateInput/DateFragmentsView/DateFragmentsView.js +1 -0
  237. package/components/DateInput/DateFragmentsView/DateFragmentsView.js.map +1 -1
  238. package/components/DateInput/DateInput/DateInput.js +17 -4
  239. package/components/DateInput/DateInput/DateInput.js.map +1 -1
  240. package/components/DateInput/DateInput.d.ts +8 -11
  241. package/components/DatePicker/DatePicker/DatePicker.js +12 -9
  242. package/components/DatePicker/DatePicker/DatePicker.js.map +1 -1
  243. package/components/DatePicker/DatePicker.d.ts +7 -9
  244. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js +8 -2
  245. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js.map +1 -1
  246. package/components/DropdownMenu/DropdownMenu.d.ts +5 -5
  247. package/components/FileUploader/FileUploader.md +8 -1
  248. package/components/FxInput/FxInput/FxInput.js +11 -9
  249. package/components/FxInput/FxInput/FxInput.js.map +1 -1
  250. package/components/FxInput/FxInput.d.ts +6 -6
  251. package/components/Gapped/Gapped/Gapped.js +17 -8
  252. package/components/Gapped/Gapped/Gapped.js.map +1 -1
  253. package/components/Gapped/Gapped.d.ts +7 -8
  254. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js +35 -16
  255. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js.map +1 -1
  256. package/components/GlobalLoader/GlobalLoader.d.ts +7 -14
  257. package/components/Hint/Hint/Hint.js +30 -18
  258. package/components/Hint/Hint/Hint.js.map +1 -1
  259. package/components/Hint/Hint.d.ts +8 -12
  260. package/components/Hint/Hint.md +14 -0
  261. package/components/Input/Input/Input.js +9 -7
  262. package/components/Input/Input/Input.js.map +1 -1
  263. package/components/Input/Input.d.ts +4 -3
  264. package/components/Kebab/Kebab/Kebab.js +19 -8
  265. package/components/Kebab/Kebab/Kebab.js.map +1 -1
  266. package/components/Kebab/Kebab.d.ts +7 -11
  267. package/components/Link/Link/Link.js +9 -6
  268. package/components/Link/Link/Link.js.map +1 -1
  269. package/components/Link/Link.d.ts +4 -4
  270. package/components/Loader/Loader/Loader.js +22 -17
  271. package/components/Loader/Loader/Loader.js.map +1 -1
  272. package/components/Loader/Loader.d.ts +7 -4
  273. package/components/Modal/Modal/Modal.js +3 -1
  274. package/components/Modal/Modal/Modal.js.map +1 -1
  275. package/components/Modal/Modal.d.ts +4 -3
  276. package/components/Modal/ModalFooter/ModalFooter.js +2 -2
  277. package/components/Modal/ModalFooter/ModalFooter.js.map +1 -1
  278. package/components/Modal/ModalHeader/ModalHeader.js +2 -2
  279. package/components/Modal/ModalHeader/ModalHeader.js.map +1 -1
  280. package/components/Paging/Paging/Paging.js +24 -14
  281. package/components/Paging/Paging/Paging.js.map +1 -1
  282. package/components/Paging/Paging.d.ts +6 -9
  283. package/components/Paging/PagingDefaultComponent/PagingDefaultComponent.js.map +1 -1
  284. package/components/Paging/PagingDefaultComponent.d.ts +1 -1
  285. package/components/PasswordInput/PasswordInput/PasswordInput.js +7 -5
  286. package/components/PasswordInput/PasswordInput/PasswordInput.js.map +1 -1
  287. package/components/PasswordInput/PasswordInput.d.ts +4 -3
  288. package/components/Radio/Radio/Radio.js +7 -5
  289. package/components/Radio/Radio/Radio.js.map +1 -1
  290. package/components/Radio/Radio.d.ts +4 -3
  291. package/components/RadioGroup/RadioGroup/RadioGroup.js +10 -10
  292. package/components/RadioGroup/RadioGroup/RadioGroup.js.map +1 -1
  293. package/components/RadioGroup/RadioGroup.d.ts +2 -4
  294. package/components/ScrollContainer/ScrollContainer/ScrollContainer.js +11 -7
  295. package/components/ScrollContainer/ScrollContainer/ScrollContainer.js.map +1 -1
  296. package/components/ScrollContainer/ScrollContainer.d.ts +7 -8
  297. package/components/ScrollContainer/ScrollContainer.helpers/ScrollContainer.helpers.js +4 -4
  298. package/components/ScrollContainer/ScrollContainer.helpers/ScrollContainer.helpers.js.map +1 -1
  299. package/components/Select/Select/Select.js +4 -3
  300. package/components/Select/Select/Select.js.map +1 -1
  301. package/components/Select/Select.d.ts +3 -12
  302. package/components/Select/Select.styles/Select.styles.js +4 -4
  303. package/components/Select/Select.styles/Select.styles.js.map +1 -1
  304. package/components/SidePage/SidePage/SidePage.js +14 -9
  305. package/components/SidePage/SidePage/SidePage.js.map +1 -1
  306. package/components/SidePage/SidePage.d.ts +5 -6
  307. package/components/Spinner/Spinner/Spinner.js +7 -5
  308. package/components/Spinner/Spinner/Spinner.js.map +1 -1
  309. package/components/Spinner/Spinner.d.ts +4 -2
  310. package/components/Sticky/Sticky/Sticky.js +7 -4
  311. package/components/Sticky/Sticky/Sticky.js.map +1 -1
  312. package/components/Sticky/Sticky.d.ts +5 -4
  313. package/components/Tabs/Tab/Tab.js +15 -7
  314. package/components/Tabs/Tab/Tab.js.map +1 -1
  315. package/components/Tabs/Tab.d.ts +4 -4
  316. package/components/Tabs/Tabs/Tabs.js +10 -8
  317. package/components/Tabs/Tabs/Tabs.js.map +1 -1
  318. package/components/Tabs/Tabs.d.ts +4 -4
  319. package/components/Textarea/Textarea/Textarea.js +19 -14
  320. package/components/Textarea/Textarea/Textarea.js.map +1 -1
  321. package/components/Textarea/Textarea.d.ts +8 -10
  322. package/components/Toast/Toast/Toast.js.map +1 -1
  323. package/components/Toggle/Toggle/Toggle.js +12 -7
  324. package/components/Toggle/Toggle/Toggle.js.map +1 -1
  325. package/components/Toggle/Toggle.d.ts +5 -6
  326. package/components/TokenInput/TokenInput/TokenInput.js +107 -77
  327. package/components/TokenInput/TokenInput/TokenInput.js.map +1 -1
  328. package/components/TokenInput/TokenInput.d.ts +19 -16
  329. package/components/Tooltip/Tooltip/Tooltip.js +60 -47
  330. package/components/Tooltip/Tooltip/Tooltip.js.map +1 -1
  331. package/components/Tooltip/Tooltip.d.ts +13 -19
  332. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js +15 -13
  333. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js.map +1 -1
  334. package/components/TooltipMenu/TooltipMenu.d.ts +5 -4
  335. package/internal/BGRuler/BGRuler.js +11 -6
  336. package/internal/BGRuler/BGRuler.js.map +1 -1
  337. package/internal/BGRuler.d.ts +13 -15
  338. package/internal/Calendar/Calendar/Calendar.js +11 -5
  339. package/internal/Calendar/Calendar/Calendar.js.map +1 -1
  340. package/internal/Calendar/Calendar.d.ts +4 -13
  341. package/internal/Calendar/DayCellView.styles/DayCellView.styles.js +1 -1
  342. package/internal/Calendar/DayCellView.styles/DayCellView.styles.js.map +1 -1
  343. package/internal/Calendar/Month/Month.js +20 -11
  344. package/internal/Calendar/Month/Month.js.map +1 -1
  345. package/internal/CommonWrapper/CommonWrapper/CommonWrapper.js.map +1 -1
  346. package/internal/CommonWrapper/CommonWrapper.d.ts +1 -1
  347. package/internal/ComponentCombinator/ComponentCombinator.js +8 -5
  348. package/internal/ComponentCombinator/ComponentCombinator.js.map +1 -1
  349. package/internal/ComponentCombinator.d.ts +6 -8
  350. package/internal/ComponentTable/ComponentTable.js +16 -4
  351. package/internal/ComponentTable/ComponentTable.js.map +1 -1
  352. package/internal/ComponentTable.d.ts +5 -6
  353. package/internal/CustomComboBox/ComboBoxMenu/ComboBoxMenu.js +4 -2
  354. package/internal/CustomComboBox/ComboBoxMenu/ComboBoxMenu.js.map +1 -1
  355. package/internal/CustomComboBox/ComboBoxMenu.d.ts +4 -4
  356. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js +21 -10
  357. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js.map +1 -1
  358. package/internal/CustomComboBox/ComboBoxView.d.ts +4 -12
  359. package/internal/DateSelect/DateSelect/DateSelect.js +14 -11
  360. package/internal/DateSelect/DateSelect/DateSelect.js.map +1 -1
  361. package/internal/DateSelect/DateSelect.d.ts +4 -6
  362. package/internal/DropdownContainer/DropdownContainer/DropdownContainer.js +6 -10
  363. package/internal/DropdownContainer/DropdownContainer/DropdownContainer.js.map +1 -1
  364. package/internal/DropdownContainer/DropdownContainer.d.ts +4 -7
  365. package/internal/HideBodyVerticalScroll/HideBodyVerticalScroll/HideBodyVerticalScroll.js +2 -1
  366. package/internal/HideBodyVerticalScroll/HideBodyVerticalScroll/HideBodyVerticalScroll.js.map +1 -1
  367. package/internal/InputLikeText/InputLikeText/InputLikeText.js +4 -2
  368. package/internal/InputLikeText/InputLikeText/InputLikeText.js.map +1 -1
  369. package/internal/InputLikeText/InputLikeText.d.ts +4 -3
  370. package/internal/InternalMenu/InternalMenu/InternalMenu.js +37 -16
  371. package/internal/InternalMenu/InternalMenu/InternalMenu.js.map +1 -1
  372. package/internal/InternalMenu/InternalMenu.d.ts +3 -9
  373. package/internal/InternalMenu/InternalMenu.styles/InternalMenu.styles.js +1 -1
  374. package/internal/InternalMenu/InternalMenu.styles/InternalMenu.styles.js.map +1 -1
  375. package/internal/MaskedInput/MaskedInput/MaskedInput.js +12 -6
  376. package/internal/MaskedInput/MaskedInput/MaskedInput.js.map +1 -1
  377. package/internal/MaskedInput/MaskedInput.d.ts +5 -2
  378. package/internal/Menu/Menu/Menu.js +16 -4
  379. package/internal/Menu/Menu/Menu.js.map +1 -1
  380. package/internal/Menu/Menu.d.ts +4 -7
  381. package/internal/Popup/Popup/Popup.js +52 -35
  382. package/internal/Popup/Popup/Popup.js.map +1 -1
  383. package/internal/Popup/Popup.d.ts +11 -17
  384. package/internal/Popup/PopupHelper/PopupHelper.js.map +1 -1
  385. package/internal/Popup/PopupHelper.d.ts +1 -1
  386. package/internal/Popup/PopupPin/PopupPin.js.map +1 -1
  387. package/internal/Popup/PopupPin.d.ts +1 -1
  388. package/internal/PopupMenu/PopupMenu/PopupMenu.js +12 -4
  389. package/internal/PopupMenu/PopupMenu/PopupMenu.js.map +1 -1
  390. package/internal/PopupMenu/PopupMenu.d.ts +8 -11
  391. package/internal/RenderLayer/RenderLayer/RenderLayer.js +18 -11
  392. package/internal/RenderLayer/RenderLayer/RenderLayer.js.map +1 -1
  393. package/internal/RenderLayer/RenderLayer.d.ts +6 -4
  394. package/internal/ThemePlayground/VariableValue/VariableValue.js +4 -2
  395. package/internal/ThemePlayground/VariableValue/VariableValue.js.map +1 -1
  396. package/internal/ThemePlayground/VariableValue.d.ts +5 -4
  397. package/internal/ZIndex/ZIndex/ZIndex.js +15 -13
  398. package/internal/ZIndex/ZIndex/ZIndex.js.map +1 -1
  399. package/internal/ZIndex/ZIndex.d.ts +7 -11
  400. package/internal/themes/DefaultTheme/DefaultTheme.js +6 -6
  401. package/internal/themes/DefaultTheme/DefaultTheme.js.map +1 -1
  402. package/lib/InstanceWithAnchorElement/InstanceWithAnchorElement.js.map +1 -1
  403. package/lib/InstanceWithAnchorElement.d.ts +1 -1
  404. package/lib/SSRSafe/SSRSafe.js +7 -0
  405. package/lib/SSRSafe/SSRSafe.js.map +1 -1
  406. package/lib/SSRSafe.d.ts +2 -1
  407. package/lib/createPropsGetter/createPropsGetter.js.map +1 -1
  408. package/lib/createPropsGetter.d.ts +2 -1
  409. package/lib/listenFocusOutside/listenFocusOutside.js.map +1 -1
  410. package/lib/listenFocusOutside.d.ts +1 -1
  411. package/lib/rootNode/getRootNode/getRootNode.js +8 -8
  412. package/lib/rootNode/getRootNode/getRootNode.js.map +1 -1
  413. package/lib/rootNode/getRootNode.d.ts +3 -3
  414. package/lib/rootNode/rootNodeDecorator/rootNodeDecorator.js.map +1 -1
  415. package/lib/rootNode/rootNodeDecorator.d.ts +7 -7
  416. package/package.json +2 -2
  417. package/typings/event-types.d.ts +2 -2
@@ -6,9 +6,9 @@ import { CommonProps, CommonWrapperRestProps } from '../../internal/CommonWrappe
6
6
  import { Selection } from './SelectionHelper';
7
7
  export interface CurrencyInputProps extends CommonProps, Override<InputProps, {
8
8
  /** Значение */
9
- value: Nullable<number>;
9
+ value?: Nullable<number>;
10
10
  /** Убрать лишние нули после запятой */
11
- hideTrailingZeros: boolean;
11
+ hideTrailingZeros?: boolean;
12
12
  /** Кол-во цифр после запятой */
13
13
  fractionDigits?: Nullable<number>;
14
14
  /** Отрицательные значения */
@@ -32,6 +32,7 @@ export interface CurrencyInputState {
32
32
  export declare const CurrencyInputDataTids: {
33
33
  readonly root: "CurrencyInput__root";
34
34
  };
35
+ declare type DefaultProps = Required<Pick<CurrencyInputProps, 'align' | 'fractionDigits' | 'hideTrailingZeros' | 'value' | 'inputMode'>>;
35
36
  /**
36
37
  * Поле для денежных сумм (и других числовых значений).
37
38
  * Принимает любые свойства `Input`.
@@ -65,13 +66,8 @@ export declare class CurrencyInput extends React.PureComponent<CurrencyInputProp
65
66
  onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
66
67
  onSubmit: PropTypes.Requireable<(...args: any[]) => any>;
67
68
  };
68
- static defaultProps: {
69
- align: string;
70
- fractionDigits: number;
71
- hideTrailingZeros: boolean;
72
- value: null;
73
- inputMode: string;
74
- };
69
+ static defaultProps: DefaultProps;
70
+ private getProps;
75
71
  state: CurrencyInputState;
76
72
  private input;
77
73
  private tempSelectionForOnChange;
@@ -107,3 +103,4 @@ export declare class CurrencyInput extends React.PureComponent<CurrencyInputProp
107
103
  private handleBlur;
108
104
  private refInput;
109
105
  }
106
+ export {};
@@ -9,6 +9,7 @@ var _Input = require("../Input");
9
9
 
10
10
  var _CommonWrapper = require("../../internal/CommonWrapper");
11
11
  var _rootNode = require("../../lib/rootNode");
12
+ var _createPropsGetter = require("../../lib/createPropsGetter");
12
13
 
13
14
  var _constants = require("./constants");
14
15
  var _SelectionHelper = require("./SelectionHelper");
@@ -48,7 +49,11 @@ var _CurrencyInputKeyboardActions = require("./CurrencyInputKeyboardActions");va
48
49
 
49
50
 
50
51
  var CurrencyInputDataTids = {
51
- root: 'CurrencyInput__root' };
52
+ root: 'CurrencyInput__root' };exports.CurrencyInputDataTids = CurrencyInputDataTids;
53
+
54
+
55
+
56
+
52
57
 
53
58
 
54
59
  /**
@@ -58,7 +63,7 @@ var CurrencyInputDataTids = {
58
63
  * Максимальная длина числа - **15 цифр** (с десятичным разделителем в любом месте).
59
64
  * <br/>
60
65
  * Если `fractionDigits=15`, то в целой части допускается **0**.
61
- */exports.CurrencyInputDataTids = CurrencyInputDataTids;var
66
+ */var
62
67
 
63
68
  CurrencyInput = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/function (_React$PureComponent) {(0, _inheritsLoose2.default)(CurrencyInput, _React$PureComponent);function CurrencyInput() {var _this;for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;_this.
64
69
 
@@ -96,9 +101,11 @@ CurrencyInput = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
96
101
 
97
102
 
98
103
 
104
+
105
+ getProps = (0, _createPropsGetter.createPropsGetter)(CurrencyInput.defaultProps);_this.
99
106
 
100
107
  state = (0, _extends2.default)({},
101
- _this.getState(_this.props.value, _this.props.fractionDigits, _this.props.hideTrailingZeros), {
108
+ _this.getState(_this.getProps().value, _this.getProps().fractionDigits, _this.getProps().hideTrailingZeros), {
102
109
  focused: false });_this.
103
110
 
104
111
 
@@ -143,6 +150,7 @@ CurrencyInput = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
143
150
 
144
151
 
145
152
 
153
+
146
154
 
147
155
 
148
156
  renderMain = function (props) {
@@ -152,6 +160,7 @@ CurrencyInput = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
152
160
  _react.default.createElement(_Input.Input, (0, _extends2.default)({
153
161
  "data-tid": CurrencyInputDataTids.root },
154
162
  rest, {
163
+ align: _this.getProps().align,
155
164
  value: _this.state.formatted,
156
165
  onBlur: _this.handleBlur,
157
166
  onFocus: _this.handleFocus,
@@ -292,6 +301,10 @@ CurrencyInput = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
292
301
  selection: _SelectionHelper.SelectionHelper.forward(selection.start, inputEnd) });
293
302
 
294
303
  return;
304
+ }
305
+ case _CurrencyInputKeyboardActions.CURRENCY_INPUT_ACTIONS.Comma:{
306
+ _this.inputValue(selection.start, selection.end, ',');
307
+ return;
295
308
  }}
296
309
 
297
310
  };_this.
@@ -343,7 +356,7 @@ CurrencyInput = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
343
356
  inputValue = function (start, end, value) {
344
357
  var result = _CurrencyInputHelper.CurrencyInputHelper.safeInsert(_this.state.formatted, start, end, value, {
345
358
  integerDigits: _this.props.integerDigits,
346
- fractionDigits: _this.props.fractionDigits,
359
+ fractionDigits: _this.getProps().fractionDigits,
347
360
  unsigned: !_this.props.signed });
348
361
 
349
362
  if (result) {
@@ -435,7 +448,7 @@ CurrencyInput = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
435
448
  var value = _CurrencyHelper.CurrencyHelper.parse(_this.state.formatted);
436
449
 
437
450
  _this.setState((0, _extends2.default)({},
438
- _this.getState(value, _this.props.fractionDigits, _this.props.hideTrailingZeros), {
451
+ _this.getState(value, _this.getProps().fractionDigits, _this.getProps().hideTrailingZeros), {
439
452
  focused: false }));
440
453
 
441
454
 
@@ -446,7 +459,7 @@ CurrencyInput = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
446
459
 
447
460
  refInput = function (element) {
448
461
  _this.input = element;
449
- };return _this;}var _proto = CurrencyInput.prototype;_proto.componentDidMount = function componentDidMount() {var _this$props = this.props,maxLength = _this$props.maxLength,integerDigits = _this$props.integerDigits,fractionDigits = _this$props.fractionDigits;(0, _warning.default)(maxLength === undefined, "[CurrencyInput]: Prop 'maxLength' has been deprecated. See 'integerDigits' and 'fractionDigits'");(0, _warning.default)((integerDigits || 0) + (fractionDigits || 0) <= _constants.MAX_SAFE_DIGITS, "[CurrencyInput]: Sum of 'integerDigits' and 'fractionDigits' exceeds " + _constants.MAX_SAFE_DIGITS + "." + "\nSee https://tech.skbkontur.ru/react-ui/#/CurrencyInput?id=why15");};_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {var _this$props2 = this.props,value = _this$props2.value,fractionDigits = _this$props2.fractionDigits,hideTrailingZeros = _this$props2.hideTrailingZeros;if (isValidNumber(value) && isNumeric(value) && Number(value) !== _CurrencyHelper.CurrencyHelper.parse(prevState.formatted) || prevProps.fractionDigits !== fractionDigits) {this.setState(this.getState(value, fractionDigits, hideTrailingZeros));}if (this.state.focused && this.input) {var _this$state$selection = this.state.selection,start = _this$state$selection.start,end = _this$state$selection.end;this.input.setSelectionRange(start, end);}if (prevState.selection !== this.state.selection) {this.scrollInput();}};_proto.render = function render() {return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), this.renderMain);};_proto.getState = function getState(value, fractionDigits, hideTrailingZeros) {return { formatted: _CurrencyHelper.CurrencyHelper.format(value, { fractionDigits: fractionDigits, hideTrailingZeros: hideTrailingZeros }), selection: _SelectionHelper.SelectionHelper.fromPosition(0) };};_proto.setSelectionFromEvent = function setSelectionFromEvent(event) {var selection = getInputSelectionFromEvent(event.target);var normilized = _CurrencyInputHelper.CurrencyInputHelper.normalizeSelection(this.state.formatted, selection);this.setState({ selection: normilized });} // for IE11
462
+ };return _this;}var _proto = CurrencyInput.prototype;_proto.componentDidMount = function componentDidMount() {var _this$props = this.props,maxLength = _this$props.maxLength,integerDigits = _this$props.integerDigits;var fractionDigits = this.getProps().fractionDigits;(0, _warning.default)(maxLength === undefined, "[CurrencyInput]: Prop 'maxLength' has been deprecated. See 'integerDigits' and 'fractionDigits'");(0, _warning.default)((integerDigits || 0) + (fractionDigits || 0) <= _constants.MAX_SAFE_DIGITS, "[CurrencyInput]: Sum of 'integerDigits' and 'fractionDigits' exceeds " + _constants.MAX_SAFE_DIGITS + "." + "\nSee https://tech.skbkontur.ru/react-ui/#/CurrencyInput?id=why15");};_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {var _this$getProps = this.getProps(),value = _this$getProps.value,fractionDigits = _this$getProps.fractionDigits,hideTrailingZeros = _this$getProps.hideTrailingZeros;if (isValidNumber(value) && isNumeric(value) && Number(value) !== _CurrencyHelper.CurrencyHelper.parse(prevState.formatted) || prevProps.fractionDigits !== fractionDigits) {this.setState(this.getState(value, fractionDigits, hideTrailingZeros));}if (this.state.focused && this.input) {var _this$state$selection = this.state.selection,start = _this$state$selection.start,end = _this$state$selection.end;this.input.setSelectionRange(start, end);}if (prevState.selection !== this.state.selection) {this.scrollInput();}};_proto.render = function render() {return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), this.renderMain);};_proto.getState = function getState(value, fractionDigits, hideTrailingZeros) {return { formatted: _CurrencyHelper.CurrencyHelper.format(value, { fractionDigits: fractionDigits, hideTrailingZeros: hideTrailingZeros }), selection: _SelectionHelper.SelectionHelper.fromPosition(0) };};_proto.setSelectionFromEvent = function setSelectionFromEvent(event) {var selection = getInputSelectionFromEvent(event.target);var normilized = _CurrencyInputHelper.CurrencyInputHelper.normalizeSelection(this.state.formatted, selection);this.setState({ selection: normilized });} // for IE11
450
463
  ;return CurrencyInput;}(_react.default.PureComponent), _class2.__KONTUR_REACT_UI__ = 'CurrencyInput', _class2.propTypes = { align: _propTypes.default.oneOf(['left', 'center', 'right']), autoFocus: _propTypes.default.bool, borderless: _propTypes.default.bool, disabled: _propTypes.default.bool, error: _propTypes.default.bool, fractionDigits: _propTypes.default.number, hideTrailingZeros: _propTypes.default.bool, leftIcon: _propTypes.default.element, placeholder: _propTypes.default.string, signed: _propTypes.default.bool, size: _propTypes.default.oneOf(['small', 'medium', 'large']), value: function value(props) {(0, _warning.default)(isValidNumber(props.value), "[CurrencyInput]: Prop value is not a valid number");}, warning: _propTypes.default.bool, width: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), onBlur: _propTypes.default.func, onValueChange: _propTypes.default.func.isRequired, onFocus: _propTypes.default.func, onMouseEnter: _propTypes.default.func, onMouseLeave: _propTypes.default.func, onMouseOver: _propTypes.default.func, onSubmit: _propTypes.default.func }, _class2.defaultProps = { align: 'right', fractionDigits: 2, hideTrailingZeros: false, value: null, inputMode: 'decimal' }, _temp)) || _class;exports.CurrencyInput = CurrencyInput;
451
464
 
452
465
  function getInputSelectionFromEvent(input) {
@@ -1 +1 @@
1
- {"version":3,"sources":["CurrencyInput.tsx"],"names":["CurrencyInputDataTids","root","CurrencyInput","rootNode","state","getState","props","value","fractionDigits","hideTrailingZeros","focused","tempSelectionForOnChange","SelectionHelper","fromPosition","renderMain","signed","onSubmit","integerDigits","rest","formatted","handleBlur","handleFocus","handleMouseUp","handleKeyDown","handleValueChange","handlePaste","handleCopy","handleCut","onMouseEnter","onMouseLeave","onMouseOver","refInput","getPlaceholder","focus","input","blur","debouncedSetSelectionFromEvent","setSelectionFromEvent","event","isIE11","persist","selection","getSelection","target","onKeyDown","defaultPrevented","action","CURRENCY_INPUT_ACTIONS","Ignore","Unknown","preventDefault","Submit","Backspace","inputValue","CurrencyInputHelper","moveCursor","end","Delete","start","MoveCursorLeft","MoveCursorRight","Home","setState","End","length","ExtendSelectionLeft","extendSelection","ExtendSelectionRight","FullSelection","forward","ExtendSelectionToStart","backward","ExtendSelectionToEnd","inputEnd","scrollInput","node","getNode","scrollWidth","clientWidth","PAD","SHIFT","selected","position","direction","charsCount","charWidth","frame","Math","ceil","frameStart","scrollLeft","frameEnd","getInputSelectionFromEvent","step","extended","result","safeInsert","unsigned","parsedValue","CurrencyHelper","parse","onValueChange","blink","getOnChangeDelta","oldValue","substring","substr","delta","data","clipboardData","getData","formatForClipboard","setData","selectionStart","selectionEnd","selectionDirection","valueLength","onFocus","onBlur","element","componentDidMount","maxLength","undefined","MAX_SAFE_DIGITS","componentDidUpdate","prevProps","prevState","isValidNumber","isNumeric","Number","setSelectionRange","render","setRootNode","format","normilized","normalizeSelection","React","PureComponent","__KONTUR_REACT_UI__","propTypes","align","PropTypes","oneOf","autoFocus","bool","borderless","disabled","error","number","leftIcon","placeholder","string","size","warning","width","oneOfType","func","isRequired","defaultProps","inputMode","HTMLInputElement","Error","isNaN","parseFloat","isFinite"],"mappings":"ueAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,IAAMA,qBAAqB,GAAG;AACnCC,EAAAA,IAAI,EAAE,qBAD6B,EAA9B;;;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;AAEaC,a,OADZC,kB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCQC,IAAAA,K;AACF,UAAKC,QAAL,CAAc,MAAKC,KAAL,CAAWC,KAAzB,EAAgC,MAAKD,KAAL,CAAWE,cAA3C,EAA2D,MAAKF,KAAL,CAAWG,iBAAtE,C;AACHC,MAAAA,OAAO,EAAE,K;;;;AAIHC,IAAAA,wB,GAAsCC,iCAAgBC,YAAhB,CAA6B,CAA7B,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CvCC,IAAAA,U,GAAa,UAACR,KAAD,EAAuD;AACzE,UAAQE,cAAR,GAAwFF,KAAxF,CAAQE,cAAR,CAAwBO,MAAxB,GAAwFT,KAAxF,CAAwBS,MAAxB,CAAgCC,QAAhC,GAAwFV,KAAxF,CAAgCU,QAAhC,CAA0CC,aAA1C,GAAwFX,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Y,GAAe,EAC3BlB,KAAK,EAAE,OADoB,EAE3BpI,cAAc,EAAE,CAFW,EAG3BC,iBAAiB,EAAE,KAHQ,EAI3BF,KAAK,EAAE,IAJoB,EAK3BwJ,SAAS,EAAE,SALgB,E;;AAwW/B,SAASnE,0BAAT,CAAoC1D,KAApC,EAAmE;AACjE,MAAI,EAAEA,KAAK,YAAY8H,gBAAnB,CAAJ,EAA0C;AACxC,UAAM,IAAIC,KAAJ,CAAU,+BAAV,CAAN;AACD;;AAED,SAAO;AACLvG,IAAAA,KAAK,EAAExB,KAAK,CAAC+E,cADR;AAELzD,IAAAA,GAAG,EAAEtB,KAAK,CAACgF,YAFN;AAGL/B,IAAAA,SAAS,EAAEjD,KAAK,CAACiF,kBAHZ,EAAP;;AAKD;;AAED,SAASa,SAAT,CAAmBzH,KAAnB,EAA6D;AAC3D,SAAO,CAAC2J,KAAK,CAACC,UAAU,CAAC5J,KAAD,CAAX,CAAN,IAAuC6J,QAAQ,CAAC7J,KAAD,CAAtD;AACD;;AAED,SAASwH,aAAT,CAAuBxH,KAAvB,EAAgD;AAC9C,SAAO,CAAC2J,KAAK,CAACjC,MAAM,CAAC1H,KAAD,CAAP,CAAb;AACD;;AAED,IAAMyB,cAAc,GAAG,SAAjBA,cAAiB,CAAC1B,KAAD,EAA+B;AACpD,MAAI,uBAAWA,KAAK,CAACgJ,WAAjB,CAAJ,EAAmC;AACjC,WAAOnD,+BAAekC,MAAf,CAAsB,CAAtB,EAAyB;AAC9B7H,MAAAA,cAAc,EAAEF,KAAK,CAACE,cADQ;AAE9BC,MAAAA,iBAAiB,EAAEH,KAAK,CAACG,iBAFK,EAAzB,CAAP;;AAID;;AAED,SAAOH,KAAK,CAACgJ,WAAb;AACD,CATD","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport warning from 'warning';\nimport debounce from 'lodash.debounce';\n\nimport { isNonNullable, isNullable } from '../../lib/utils';\nimport { isIE11 } from '../../lib/client';\nimport { Input, InputProps } from '../Input';\nimport { Nullable, Override } from '../../typings/utility-types';\nimport { CommonProps, CommonWrapper, CommonWrapperRestProps } from '../../internal/CommonWrapper';\nimport { TSetRootNode, rootNode } from '../../lib/rootNode';\n\nimport { MAX_SAFE_DIGITS } from './constants';\nimport { Selection, SelectionDirection, SelectionHelper } from './SelectionHelper';\nimport { CurrencyHelper } from './CurrencyHelper';\nimport { CurrencyInputHelper } from './CurrencyInputHelper';\nimport { CURRENCY_INPUT_ACTIONS, extractAction } from './CurrencyInputKeyboardActions';\n\nexport interface CurrencyInputProps\n extends CommonProps,\n Override<\n InputProps,\n {\n /** Значение */\n value: Nullable<number>;\n /** Убрать лишние нули после запятой */\n hideTrailingZeros: boolean;\n /** Кол-во цифр после запятой */\n fractionDigits?: Nullable<number>;\n /** Отрицательные значения */\n signed?: boolean;\n /**\n * Допустимое кол-во цифр целой части.\n * Если передан **0**, или `fractionDigits=15`, то и в целой части допускается только **0**.\n */\n integerDigits?: Nullable<number>;\n /** Вызывается при изменении `value` */\n onValueChange: (value: Nullable<number>) => void;\n /** onSubmit */\n onSubmit?: () => void;\n }\n > {}\n\nexport interface CurrencyInputState {\n formatted: string;\n selection: Selection;\n focused: boolean;\n}\n\nexport const CurrencyInputDataTids = {\n root: 'CurrencyInput__root',\n} as const;\n\n/**\n * Поле для денежных сумм (и других числовых значений).\n * Принимает любые свойства `Input`.\n *\n * Максимальная длина числа - **15 цифр** (с десятичным разделителем в любом месте).\n * <br/>\n * Если `fractionDigits=15`, то в целой части допускается **0**.\n */\n@rootNode\nexport class CurrencyInput extends React.PureComponent<CurrencyInputProps, CurrencyInputState> {\n public static __KONTUR_REACT_UI__ = 'CurrencyInput';\n\n public static propTypes = {\n align: PropTypes.oneOf(['left', 'center', 'right']),\n autoFocus: PropTypes.bool,\n borderless: PropTypes.bool,\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n fractionDigits: PropTypes.number,\n hideTrailingZeros: PropTypes.bool,\n leftIcon: PropTypes.element,\n placeholder: PropTypes.string,\n signed: PropTypes.bool,\n size: PropTypes.oneOf(['small', 'medium', 'large']),\n value: (props: CurrencyInputProps) => {\n warning(isValidNumber(props.value), `[CurrencyInput]: Prop value is not a valid number`);\n },\n warning: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n onBlur: PropTypes.func,\n onValueChange: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onMouseLeave: PropTypes.func,\n onMouseOver: PropTypes.func,\n onSubmit: PropTypes.func,\n };\n\n public static defaultProps = {\n align: 'right',\n fractionDigits: 2,\n hideTrailingZeros: false,\n value: null,\n inputMode: 'decimal',\n };\n\n public state: CurrencyInputState = {\n ...this.getState(this.props.value, this.props.fractionDigits, this.props.hideTrailingZeros),\n focused: false,\n };\n\n private input: Nullable<Input>;\n private tempSelectionForOnChange: Selection = SelectionHelper.fromPosition(0);\n private setRootNode!: TSetRootNode;\n\n public componentDidMount(): void {\n const { maxLength, integerDigits, fractionDigits } = this.props;\n warning(\n maxLength === undefined,\n `[CurrencyInput]: Prop 'maxLength' has been deprecated. See 'integerDigits' and 'fractionDigits'`,\n );\n warning(\n (integerDigits || 0) + (fractionDigits || 0) <= MAX_SAFE_DIGITS,\n `[CurrencyInput]: Sum of 'integerDigits' and 'fractionDigits' exceeds ${MAX_SAFE_DIGITS}.` +\n `\\nSee https://tech.skbkontur.ru/react-ui/#/CurrencyInput?id=why15`,\n );\n }\n\n public componentDidUpdate(prevProps: CurrencyInputProps, prevState: CurrencyInputState) {\n const { value, fractionDigits, hideTrailingZeros } = this.props;\n if (\n (isValidNumber(value) && isNumeric(value) && Number(value) !== CurrencyHelper.parse(prevState.formatted)) ||\n prevProps.fractionDigits !== fractionDigits\n ) {\n this.setState(this.getState(value, fractionDigits, hideTrailingZeros));\n }\n if (this.state.focused && this.input) {\n const { start, end } = this.state.selection;\n\n this.input.setSelectionRange(start, end);\n }\n if (prevState.selection !== this.state.selection) {\n this.scrollInput();\n }\n }\n\n public render() {\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n {this.renderMain}\n </CommonWrapper>\n );\n }\n\n public renderMain = (props: CommonWrapperRestProps<CurrencyInputProps>) => {\n const { fractionDigits, signed, onSubmit, integerDigits, hideTrailingZeros, ...rest } = props;\n\n return (\n <Input\n data-tid={CurrencyInputDataTids.root}\n {...rest}\n value={this.state.formatted}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onMouseUp={this.handleMouseUp}\n onKeyDown={this.handleKeyDown}\n onValueChange={this.handleValueChange}\n onPaste={this.handlePaste}\n onCopy={this.handleCopy}\n onCut={this.handleCut}\n onMouseEnter={this.props.onMouseEnter}\n onMouseLeave={this.props.onMouseLeave}\n onMouseOver={this.props.onMouseOver}\n ref={this.refInput}\n placeholder={this.state.focused ? '' : getPlaceholder(props)}\n />\n );\n };\n\n /**\n * @public\n */\n public focus = () => {\n if (this.input) {\n this.input.focus();\n }\n };\n\n /**\n * @public\n */\n public blur = () => {\n if (this.input) {\n this.input.blur();\n }\n };\n\n private getState(value: Nullable<number>, fractionDigits: Nullable<number>, hideTrailingZeros: boolean) {\n return {\n formatted: CurrencyHelper.format(value, { fractionDigits, hideTrailingZeros }),\n selection: SelectionHelper.fromPosition(0),\n };\n }\n\n private setSelectionFromEvent(event: React.MouseEvent<HTMLInputElement>) {\n const selection = getInputSelectionFromEvent(event.target);\n const normilized = CurrencyInputHelper.normalizeSelection(this.state.formatted, selection);\n this.setState({ selection: normilized });\n }\n\n // for IE11\n private readonly debouncedSetSelectionFromEvent = debounce(this.setSelectionFromEvent, 300);\n\n private handleMouseUp = (event: React.MouseEvent<HTMLInputElement>) => {\n if (isIE11) {\n event.persist();\n this.debouncedSetSelectionFromEvent(event);\n } else {\n this.setSelectionFromEvent(event);\n }\n };\n\n private handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const selection = this.getSelection(event.target);\n this.tempSelectionForOnChange = selection;\n\n if (this.props.onKeyDown) {\n this.props.onKeyDown(event);\n if (event.defaultPrevented) {\n return;\n }\n }\n\n const action = extractAction(event);\n\n if (action === CURRENCY_INPUT_ACTIONS.Ignore) {\n return;\n }\n\n if (action !== CURRENCY_INPUT_ACTIONS.Unknown) {\n event.preventDefault();\n }\n\n switch (action) {\n case CURRENCY_INPUT_ACTIONS.Submit: {\n if (this.props.onSubmit) {\n this.props.onSubmit();\n }\n return;\n }\n case CURRENCY_INPUT_ACTIONS.Backspace: {\n this.inputValue(CurrencyInputHelper.moveCursor(this.state.formatted, selection, -1), selection.end, '');\n return;\n }\n case CURRENCY_INPUT_ACTIONS.Delete: {\n this.inputValue(selection.start, CurrencyInputHelper.moveCursor(this.state.formatted, selection, +1), '');\n return;\n }\n case CURRENCY_INPUT_ACTIONS.MoveCursorLeft: {\n this.moveCursor(selection, -1);\n return;\n }\n case CURRENCY_INPUT_ACTIONS.MoveCursorRight: {\n this.moveCursor(selection, +1);\n return;\n }\n case CURRENCY_INPUT_ACTIONS.Home: {\n this.setState({ selection: SelectionHelper.fromPosition(0) });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.End: {\n const end = this.state.formatted.length;\n this.setState({ selection: SelectionHelper.fromPosition(end) });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.ExtendSelectionLeft: {\n this.extendSelection(selection, -1);\n return;\n }\n case CURRENCY_INPUT_ACTIONS.ExtendSelectionRight: {\n this.extendSelection(selection, +1);\n return;\n }\n case CURRENCY_INPUT_ACTIONS.FullSelection: {\n this.setState({\n selection: SelectionHelper.forward(0, this.state.formatted.length),\n });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.ExtendSelectionToStart: {\n this.setState({\n selection: SelectionHelper.backward(0, selection.start),\n });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.ExtendSelectionToEnd: {\n const inputEnd = this.state.formatted.length;\n this.setState({\n selection: SelectionHelper.forward(selection.start, inputEnd),\n });\n return;\n }\n }\n };\n\n private scrollInput = () => {\n const node = this.input?.getNode();\n if (!node || node.scrollWidth === node.clientWidth) {\n return;\n }\n const PAD = 1;\n const SHIFT = 3;\n\n const selection = this.state.selection;\n const selected = selection.start !== selection.end;\n const position = selected && selection.direction === 'forward' ? selection.end : selection.start;\n const charsCount = this.state.formatted.length;\n const charWidth = node.scrollWidth / charsCount;\n const frame = Math.ceil(node.clientWidth / charWidth);\n const frameStart = Math.ceil(node.scrollLeft / charWidth);\n const frameEnd = frameStart + frame;\n\n if (position < frameStart + PAD) {\n node.scrollLeft = (position - SHIFT) * charWidth;\n }\n if (position > frameEnd - PAD) {\n node.scrollLeft = (position - frame + SHIFT) * charWidth;\n }\n };\n\n private getSelection = (input: EventTarget): Selection => {\n const selection = getInputSelectionFromEvent(input);\n return {\n start: selection.start,\n end: selection.end,\n direction: this.state.selection.direction,\n };\n };\n\n private moveCursor = (selection: Selection, step: number) => {\n const position = CurrencyInputHelper.moveCursor(this.state.formatted, selection, step);\n this.setState({ selection: SelectionHelper.fromPosition(position) });\n };\n\n private extendSelection = (selection: Selection, step: number) => {\n const extended = CurrencyInputHelper.extendSelection(this.state.formatted, selection, step);\n this.setState({ selection: extended });\n };\n\n private inputValue = (start: number, end: number, value: string) => {\n const result = CurrencyInputHelper.safeInsert(this.state.formatted, start, end, value, {\n integerDigits: this.props.integerDigits,\n fractionDigits: this.props.fractionDigits,\n unsigned: !this.props.signed,\n });\n if (result) {\n const formatted = result.value;\n const selection = SelectionHelper.fromPosition(result.position);\n this.setState({ formatted, selection }, () => {\n const parsedValue = CurrencyHelper.parse(formatted);\n if (this.props.value !== parsedValue) {\n this.props.onValueChange(parsedValue);\n }\n });\n return true;\n }\n\n if (this.input) {\n this.input.blink();\n }\n return false;\n };\n\n private getOnChangeDelta = (value: string) => {\n const selection = this.tempSelectionForOnChange;\n const oldValue = this.state.formatted;\n if (selection.start !== selection.end) {\n return value.substring(selection.start, value.length - (oldValue.length - selection.end));\n } else if (value.length > oldValue.length) {\n return value.substr(selection.start, value.length - oldValue.length);\n }\n return null;\n };\n\n private handleValueChange = (value: string): void => {\n const selection = this.tempSelectionForOnChange;\n const delta = this.getOnChangeDelta(value);\n if (isNonNullable(delta) && !this.inputValue(selection.start, selection.end, delta)) {\n this.setState({ selection });\n }\n };\n\n private handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n const data = event.clipboardData.getData('text');\n const selection = this.getSelection(event.target);\n this.inputValue(selection.start, selection.end, data);\n event.preventDefault();\n };\n\n private handleCopy = (event: React.ClipboardEvent<HTMLInputElement>) => {\n const selection = this.getSelection(event.target);\n if (selection.start !== selection.end) {\n const substring = this.state.formatted.substring(selection.start, selection.end);\n const data = CurrencyHelper.formatForClipboard(substring);\n event.clipboardData.setData('text', data);\n }\n event.preventDefault();\n };\n\n private handleCut = (event: React.ClipboardEvent<HTMLInputElement>) => {\n const selection = this.getSelection(event.target);\n if (selection.start !== selection.end) {\n const substring = this.state.formatted.substring(selection.start, selection.end);\n const data = CurrencyHelper.formatForClipboard(substring);\n event.clipboardData.setData('text', data);\n this.inputValue(selection.start, selection.end, '');\n }\n event.preventDefault();\n };\n\n private handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n const { selectionStart, selectionEnd, selectionDirection } = event.target;\n const valueLength = event.target.value.length;\n\n const selection = {\n start: selectionStart !== selectionEnd ? selectionStart || 0 : selectionStart || valueLength,\n end: selectionEnd !== selectionStart ? selectionEnd || 0 : selectionEnd || valueLength,\n direction: (selectionDirection as SelectionDirection) || 'none',\n };\n\n this.setState({\n focused: true,\n selection,\n });\n\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n\n private handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n const value = CurrencyHelper.parse(this.state.formatted);\n\n this.setState({\n ...this.getState(value, this.props.fractionDigits, this.props.hideTrailingZeros),\n focused: false,\n });\n\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n };\n\n private refInput = (element: Nullable<Input>) => {\n this.input = element;\n };\n}\n\nfunction getInputSelectionFromEvent(input: EventTarget): Selection {\n if (!(input instanceof HTMLInputElement)) {\n throw new Error('input is not HTMLInputElement');\n }\n\n return {\n start: input.selectionStart!,\n end: input.selectionEnd!,\n direction: input.selectionDirection as SelectionDirection,\n };\n}\n\nfunction isNumeric(value: unknown): value is number | string {\n return !isNaN(parseFloat(value as string)) && isFinite(value as number);\n}\n\nfunction isValidNumber(value: unknown): boolean {\n return !isNaN(Number(value));\n}\n\nconst getPlaceholder = (props: CurrencyInputProps) => {\n if (isNullable(props.placeholder)) {\n return CurrencyHelper.format(0, {\n fractionDigits: props.fractionDigits,\n hideTrailingZeros: props.hideTrailingZeros,\n });\n }\n\n return props.placeholder;\n};\n"]}
1
+ {"version":3,"sources":["CurrencyInput.tsx"],"names":["CurrencyInputDataTids","root","CurrencyInput","rootNode","getProps","defaultProps","state","getState","value","fractionDigits","hideTrailingZeros","focused","tempSelectionForOnChange","SelectionHelper","fromPosition","renderMain","props","signed","onSubmit","integerDigits","rest","align","formatted","handleBlur","handleFocus","handleMouseUp","handleKeyDown","handleValueChange","handlePaste","handleCopy","handleCut","onMouseEnter","onMouseLeave","onMouseOver","refInput","getPlaceholder","focus","input","blur","debouncedSetSelectionFromEvent","setSelectionFromEvent","event","isIE11","persist","selection","getSelection","target","onKeyDown","defaultPrevented","action","CURRENCY_INPUT_ACTIONS","Ignore","Unknown","preventDefault","Submit","Backspace","inputValue","CurrencyInputHelper","moveCursor","end","Delete","start","MoveCursorLeft","MoveCursorRight","Home","setState","End","length","ExtendSelectionLeft","extendSelection","ExtendSelectionRight","FullSelection","forward","ExtendSelectionToStart","backward","ExtendSelectionToEnd","inputEnd","Comma","scrollInput","node","getNode","scrollWidth","clientWidth","PAD","SHIFT","selected","position","direction","charsCount","charWidth","frame","Math","ceil","frameStart","scrollLeft","frameEnd","getInputSelectionFromEvent","step","extended","result","safeInsert","unsigned","parsedValue","CurrencyHelper","parse","onValueChange","blink","getOnChangeDelta","oldValue","substring","substr","delta","data","clipboardData","getData","formatForClipboard","setData","selectionStart","selectionEnd","selectionDirection","valueLength","onFocus","onBlur","element","componentDidMount","maxLength","undefined","MAX_SAFE_DIGITS","componentDidUpdate","prevProps","prevState","isValidNumber","isNumeric","Number","setSelectionRange","render","setRootNode","format","normilized","normalizeSelection","React","PureComponent","__KONTUR_REACT_UI__","propTypes","PropTypes","oneOf","autoFocus","bool","borderless","disabled","error","number","leftIcon","placeholder","string","size","warning","width","oneOfType","func","isRequired","inputMode","HTMLInputElement","Error","isNaN","parseFloat","isFinite"],"mappings":"ueAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,IAAMA,qBAAqB,GAAG;AACnCC,EAAAA,IAAI,EAAE,qBAD6B,EAA9B,C;;;;;;;AAQP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;AAEaC,a,OADZC,kB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCSC,IAAAA,Q,GAAW,0CAAkBF,aAAa,CAACG,YAAhC,C;;AAEZC,IAAAA,K;AACF,UAAKC,QAAL,CAAc,MAAKH,QAAL,GAAgBI,KAA9B,EAAqC,MAAKJ,QAAL,GAAgBK,cAArD,EAAqE,MAAKL,QAAL,GAAgBM,iBAArF,C;AACHC,MAAAA,OAAO,EAAE,K;;;;AAIHC,IAAAA,wB,GAAsCC,iCAAgBC,YAAhB,CAA6B,CAA7B,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CvCC,IAAAA,U,GAAa,UAACC,KAAD,EAAuD;AACzE,UAAQP,cAAR,GAAwFO,KAAxF,CAAQP,cAAR,CAAwBQ,MAAxB,GAAwFD,KAAxF,CAAwBC,MAAxB,CAAgCC,QAAhC,GAAwFF,KAAxF,CAAgCE,QAAhC,CAA0CC,aAA1C,GAAwFH,KAAxF,CAA0CG,aAA1C,CAAyDT,iBAAzD,GAAwFM,KAAxF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AP;;AAID;;AAED,SAAOM,KAAK,CAACyI,WAAb;AACD,CATD","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport warning from 'warning';\nimport debounce from 'lodash.debounce';\n\nimport { isNonNullable, isNullable } from '../../lib/utils';\nimport { isIE11 } from '../../lib/client';\nimport { Input, InputProps } from '../Input';\nimport { Nullable, Override } from '../../typings/utility-types';\nimport { CommonProps, CommonWrapper, CommonWrapperRestProps } from '../../internal/CommonWrapper';\nimport { TSetRootNode, rootNode } from '../../lib/rootNode';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\n\nimport { MAX_SAFE_DIGITS } from './constants';\nimport { Selection, SelectionDirection, SelectionHelper } from './SelectionHelper';\nimport { CurrencyHelper } from './CurrencyHelper';\nimport { CurrencyInputHelper } from './CurrencyInputHelper';\nimport { CURRENCY_INPUT_ACTIONS, extractAction } from './CurrencyInputKeyboardActions';\n\nexport interface CurrencyInputProps\n extends CommonProps,\n Override<\n InputProps,\n {\n /** Значение */\n value?: Nullable<number>;\n /** Убрать лишние нули после запятой */\n hideTrailingZeros?: boolean;\n /** Кол-во цифр после запятой */\n fractionDigits?: Nullable<number>;\n /** Отрицательные значения */\n signed?: boolean;\n /**\n * Допустимое кол-во цифр целой части.\n * Если передан **0**, или `fractionDigits=15`, то и в целой части допускается только **0**.\n */\n integerDigits?: Nullable<number>;\n /** Вызывается при изменении `value` */\n onValueChange: (value: Nullable<number>) => void;\n /** onSubmit */\n onSubmit?: () => void;\n }\n > {}\n\nexport interface CurrencyInputState {\n formatted: string;\n selection: Selection;\n focused: boolean;\n}\n\nexport const CurrencyInputDataTids = {\n root: 'CurrencyInput__root',\n} as const;\n\ntype DefaultProps = Required<\n Pick<CurrencyInputProps, 'align' | 'fractionDigits' | 'hideTrailingZeros' | 'value' | 'inputMode'>\n>;\n\n/**\n * Поле для денежных сумм (и других числовых значений).\n * Принимает любые свойства `Input`.\n *\n * Максимальная длина числа - **15 цифр** (с десятичным разделителем в любом месте).\n * <br/>\n * Если `fractionDigits=15`, то в целой части допускается **0**.\n */\n@rootNode\nexport class CurrencyInput extends React.PureComponent<CurrencyInputProps, CurrencyInputState> {\n public static __KONTUR_REACT_UI__ = 'CurrencyInput';\n\n public static propTypes = {\n align: PropTypes.oneOf(['left', 'center', 'right']),\n autoFocus: PropTypes.bool,\n borderless: PropTypes.bool,\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n fractionDigits: PropTypes.number,\n hideTrailingZeros: PropTypes.bool,\n leftIcon: PropTypes.element,\n placeholder: PropTypes.string,\n signed: PropTypes.bool,\n size: PropTypes.oneOf(['small', 'medium', 'large']),\n value: (props: CurrencyInputProps) => {\n warning(isValidNumber(props.value), `[CurrencyInput]: Prop value is not a valid number`);\n },\n warning: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n onBlur: PropTypes.func,\n onValueChange: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onMouseLeave: PropTypes.func,\n onMouseOver: PropTypes.func,\n onSubmit: PropTypes.func,\n };\n\n public static defaultProps: DefaultProps = {\n align: 'right',\n fractionDigits: 2,\n hideTrailingZeros: false,\n value: null,\n inputMode: 'decimal',\n };\n\n private getProps = createPropsGetter(CurrencyInput.defaultProps);\n\n public state: CurrencyInputState = {\n ...this.getState(this.getProps().value, this.getProps().fractionDigits, this.getProps().hideTrailingZeros),\n focused: false,\n };\n\n private input: Nullable<Input>;\n private tempSelectionForOnChange: Selection = SelectionHelper.fromPosition(0);\n private setRootNode!: TSetRootNode;\n\n public componentDidMount(): void {\n const { maxLength, integerDigits } = this.props;\n const fractionDigits = this.getProps().fractionDigits;\n warning(\n maxLength === undefined,\n `[CurrencyInput]: Prop 'maxLength' has been deprecated. See 'integerDigits' and 'fractionDigits'`,\n );\n warning(\n (integerDigits || 0) + (fractionDigits || 0) <= MAX_SAFE_DIGITS,\n `[CurrencyInput]: Sum of 'integerDigits' and 'fractionDigits' exceeds ${MAX_SAFE_DIGITS}.` +\n `\\nSee https://tech.skbkontur.ru/react-ui/#/CurrencyInput?id=why15`,\n );\n }\n\n public componentDidUpdate(prevProps: CurrencyInputProps, prevState: CurrencyInputState) {\n const { value, fractionDigits, hideTrailingZeros } = this.getProps();\n if (\n (isValidNumber(value) && isNumeric(value) && Number(value) !== CurrencyHelper.parse(prevState.formatted)) ||\n prevProps.fractionDigits !== fractionDigits\n ) {\n this.setState(this.getState(value, fractionDigits, hideTrailingZeros));\n }\n if (this.state.focused && this.input) {\n const { start, end } = this.state.selection;\n\n this.input.setSelectionRange(start, end);\n }\n if (prevState.selection !== this.state.selection) {\n this.scrollInput();\n }\n }\n\n public render() {\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n {this.renderMain}\n </CommonWrapper>\n );\n }\n\n public renderMain = (props: CommonWrapperRestProps<CurrencyInputProps>) => {\n const { fractionDigits, signed, onSubmit, integerDigits, hideTrailingZeros, ...rest } = props;\n\n return (\n <Input\n data-tid={CurrencyInputDataTids.root}\n {...rest}\n align={this.getProps().align}\n value={this.state.formatted}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onMouseUp={this.handleMouseUp}\n onKeyDown={this.handleKeyDown}\n onValueChange={this.handleValueChange}\n onPaste={this.handlePaste}\n onCopy={this.handleCopy}\n onCut={this.handleCut}\n onMouseEnter={this.props.onMouseEnter}\n onMouseLeave={this.props.onMouseLeave}\n onMouseOver={this.props.onMouseOver}\n ref={this.refInput}\n placeholder={this.state.focused ? '' : getPlaceholder(props)}\n />\n );\n };\n\n /**\n * @public\n */\n public focus = () => {\n if (this.input) {\n this.input.focus();\n }\n };\n\n /**\n * @public\n */\n public blur = () => {\n if (this.input) {\n this.input.blur();\n }\n };\n\n private getState(value: Nullable<number>, fractionDigits: Nullable<number>, hideTrailingZeros: boolean) {\n return {\n formatted: CurrencyHelper.format(value, { fractionDigits, hideTrailingZeros }),\n selection: SelectionHelper.fromPosition(0),\n };\n }\n\n private setSelectionFromEvent(event: React.MouseEvent<HTMLInputElement>) {\n const selection = getInputSelectionFromEvent(event.target);\n const normilized = CurrencyInputHelper.normalizeSelection(this.state.formatted, selection);\n this.setState({ selection: normilized });\n }\n\n // for IE11\n private readonly debouncedSetSelectionFromEvent = debounce(this.setSelectionFromEvent, 300);\n\n private handleMouseUp = (event: React.MouseEvent<HTMLInputElement>) => {\n if (isIE11) {\n event.persist();\n this.debouncedSetSelectionFromEvent(event);\n } else {\n this.setSelectionFromEvent(event);\n }\n };\n\n private handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const selection = this.getSelection(event.target);\n this.tempSelectionForOnChange = selection;\n\n if (this.props.onKeyDown) {\n this.props.onKeyDown(event);\n if (event.defaultPrevented) {\n return;\n }\n }\n\n const action = extractAction(event);\n\n if (action === CURRENCY_INPUT_ACTIONS.Ignore) {\n return;\n }\n\n if (action !== CURRENCY_INPUT_ACTIONS.Unknown) {\n event.preventDefault();\n }\n\n switch (action) {\n case CURRENCY_INPUT_ACTIONS.Submit: {\n if (this.props.onSubmit) {\n this.props.onSubmit();\n }\n return;\n }\n case CURRENCY_INPUT_ACTIONS.Backspace: {\n this.inputValue(CurrencyInputHelper.moveCursor(this.state.formatted, selection, -1), selection.end, '');\n return;\n }\n case CURRENCY_INPUT_ACTIONS.Delete: {\n this.inputValue(selection.start, CurrencyInputHelper.moveCursor(this.state.formatted, selection, +1), '');\n return;\n }\n case CURRENCY_INPUT_ACTIONS.MoveCursorLeft: {\n this.moveCursor(selection, -1);\n return;\n }\n case CURRENCY_INPUT_ACTIONS.MoveCursorRight: {\n this.moveCursor(selection, +1);\n return;\n }\n case CURRENCY_INPUT_ACTIONS.Home: {\n this.setState({ selection: SelectionHelper.fromPosition(0) });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.End: {\n const end = this.state.formatted.length;\n this.setState({ selection: SelectionHelper.fromPosition(end) });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.ExtendSelectionLeft: {\n this.extendSelection(selection, -1);\n return;\n }\n case CURRENCY_INPUT_ACTIONS.ExtendSelectionRight: {\n this.extendSelection(selection, +1);\n return;\n }\n case CURRENCY_INPUT_ACTIONS.FullSelection: {\n this.setState({\n selection: SelectionHelper.forward(0, this.state.formatted.length),\n });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.ExtendSelectionToStart: {\n this.setState({\n selection: SelectionHelper.backward(0, selection.start),\n });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.ExtendSelectionToEnd: {\n const inputEnd = this.state.formatted.length;\n this.setState({\n selection: SelectionHelper.forward(selection.start, inputEnd),\n });\n return;\n }\n case CURRENCY_INPUT_ACTIONS.Comma: {\n this.inputValue(selection.start, selection.end, ',');\n return;\n }\n }\n };\n\n private scrollInput = () => {\n const node = this.input?.getNode();\n if (!node || node.scrollWidth === node.clientWidth) {\n return;\n }\n const PAD = 1;\n const SHIFT = 3;\n\n const selection = this.state.selection;\n const selected = selection.start !== selection.end;\n const position = selected && selection.direction === 'forward' ? selection.end : selection.start;\n const charsCount = this.state.formatted.length;\n const charWidth = node.scrollWidth / charsCount;\n const frame = Math.ceil(node.clientWidth / charWidth);\n const frameStart = Math.ceil(node.scrollLeft / charWidth);\n const frameEnd = frameStart + frame;\n\n if (position < frameStart + PAD) {\n node.scrollLeft = (position - SHIFT) * charWidth;\n }\n if (position > frameEnd - PAD) {\n node.scrollLeft = (position - frame + SHIFT) * charWidth;\n }\n };\n\n private getSelection = (input: EventTarget): Selection => {\n const selection = getInputSelectionFromEvent(input);\n return {\n start: selection.start,\n end: selection.end,\n direction: this.state.selection.direction,\n };\n };\n\n private moveCursor = (selection: Selection, step: number) => {\n const position = CurrencyInputHelper.moveCursor(this.state.formatted, selection, step);\n this.setState({ selection: SelectionHelper.fromPosition(position) });\n };\n\n private extendSelection = (selection: Selection, step: number) => {\n const extended = CurrencyInputHelper.extendSelection(this.state.formatted, selection, step);\n this.setState({ selection: extended });\n };\n\n private inputValue = (start: number, end: number, value: string) => {\n const result = CurrencyInputHelper.safeInsert(this.state.formatted, start, end, value, {\n integerDigits: this.props.integerDigits,\n fractionDigits: this.getProps().fractionDigits,\n unsigned: !this.props.signed,\n });\n if (result) {\n const formatted = result.value;\n const selection = SelectionHelper.fromPosition(result.position);\n this.setState({ formatted, selection }, () => {\n const parsedValue = CurrencyHelper.parse(formatted);\n if (this.props.value !== parsedValue) {\n this.props.onValueChange(parsedValue);\n }\n });\n return true;\n }\n\n if (this.input) {\n this.input.blink();\n }\n return false;\n };\n\n private getOnChangeDelta = (value: string) => {\n const selection = this.tempSelectionForOnChange;\n const oldValue = this.state.formatted;\n if (selection.start !== selection.end) {\n return value.substring(selection.start, value.length - (oldValue.length - selection.end));\n } else if (value.length > oldValue.length) {\n return value.substr(selection.start, value.length - oldValue.length);\n }\n return null;\n };\n\n private handleValueChange = (value: string): void => {\n const selection = this.tempSelectionForOnChange;\n const delta = this.getOnChangeDelta(value);\n if (isNonNullable(delta) && !this.inputValue(selection.start, selection.end, delta)) {\n this.setState({ selection });\n }\n };\n\n private handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n const data = event.clipboardData.getData('text');\n const selection = this.getSelection(event.target);\n this.inputValue(selection.start, selection.end, data);\n event.preventDefault();\n };\n\n private handleCopy = (event: React.ClipboardEvent<HTMLInputElement>) => {\n const selection = this.getSelection(event.target);\n if (selection.start !== selection.end) {\n const substring = this.state.formatted.substring(selection.start, selection.end);\n const data = CurrencyHelper.formatForClipboard(substring);\n event.clipboardData.setData('text', data);\n }\n event.preventDefault();\n };\n\n private handleCut = (event: React.ClipboardEvent<HTMLInputElement>) => {\n const selection = this.getSelection(event.target);\n if (selection.start !== selection.end) {\n const substring = this.state.formatted.substring(selection.start, selection.end);\n const data = CurrencyHelper.formatForClipboard(substring);\n event.clipboardData.setData('text', data);\n this.inputValue(selection.start, selection.end, '');\n }\n event.preventDefault();\n };\n\n private handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n const { selectionStart, selectionEnd, selectionDirection } = event.target;\n const valueLength = event.target.value.length;\n\n const selection = {\n start: selectionStart !== selectionEnd ? selectionStart || 0 : selectionStart || valueLength,\n end: selectionEnd !== selectionStart ? selectionEnd || 0 : selectionEnd || valueLength,\n direction: (selectionDirection as SelectionDirection) || 'none',\n };\n\n this.setState({\n focused: true,\n selection,\n });\n\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n\n private handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n const value = CurrencyHelper.parse(this.state.formatted);\n\n this.setState({\n ...this.getState(value, this.getProps().fractionDigits, this.getProps().hideTrailingZeros),\n focused: false,\n });\n\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n };\n\n private refInput = (element: Nullable<Input>) => {\n this.input = element;\n };\n}\n\nfunction getInputSelectionFromEvent(input: EventTarget): Selection {\n if (!(input instanceof HTMLInputElement)) {\n throw new Error('input is not HTMLInputElement');\n }\n\n return {\n start: input.selectionStart!,\n end: input.selectionEnd!,\n direction: input.selectionDirection as SelectionDirection,\n };\n}\n\nfunction isNumeric(value: unknown): value is number | string {\n return !isNaN(parseFloat(value as string)) && isFinite(value as number);\n}\n\nfunction isValidNumber(value: unknown): boolean {\n return !isNaN(Number(value));\n}\n\nconst getPlaceholder = (props: CurrencyInputProps) => {\n if (isNullable(props.placeholder)) {\n return CurrencyHelper.format(0, {\n fractionDigits: props.fractionDigits,\n hideTrailingZeros: props.hideTrailingZeros,\n });\n }\n\n return props.placeholder;\n};\n"]}
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ export declare const commaAliases: ((e: import("react").KeyboardEvent<HTMLElement> | KeyboardEvent) => boolean)[];
2
3
  export declare const CURRENCY_INPUT_ACTIONS: {
3
4
  Unknown: number;
4
5
  Ignore: number;
@@ -14,5 +15,6 @@ export declare const CURRENCY_INPUT_ACTIONS: {
14
15
  Backspace: number;
15
16
  Delete: number;
16
17
  Submit: number;
18
+ Comma: number;
17
19
  };
18
20
  export declare const extractAction: (x0: import("react").KeyboardEvent<HTMLElement>) => unknown;
@@ -1,6 +1,15 @@
1
- "use strict";exports.__esModule = true;exports.extractAction = exports.CURRENCY_INPUT_ACTIONS = void 0;var Keyboard = _interopRequireWildcard(require("../../lib/events/keyboard/identifiers"));
1
+ "use strict";exports.__esModule = true;exports.extractAction = exports.commaAliases = exports.CURRENCY_INPUT_ACTIONS = void 0;var Keyboard = _interopRequireWildcard(require("../../lib/events/keyboard/identifiers"));
2
2
  var _extractKeyboardAction = require("../../lib/extractKeyboardAction");function _getRequireWildcardCache(nodeInterop) {if (typeof WeakMap !== "function") return null;var cacheBabelInterop = new WeakMap();var cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
3
3
 
4
+ var commaAliases = [
5
+ Keyboard.isCodeComma,
6
+ Keyboard.isCodePeriod,
7
+ Keyboard.isCodeSlash,
8
+ Keyboard.isCodeBackslash,
9
+ Keyboard.isCodeIntlBackslash,
10
+ Keyboard.isCodeNumpadDivide];exports.commaAliases = commaAliases;
11
+
12
+
4
13
  var CURRENCY_INPUT_ACTIONS = {
5
14
  Unknown: 0,
6
15
  Ignore: 1,
@@ -18,7 +27,9 @@ var CURRENCY_INPUT_ACTIONS = {
18
27
 
19
28
  Backspace: 31,
20
29
  Delete: 32,
21
- Submit: 33 };exports.CURRENCY_INPUT_ACTIONS = CURRENCY_INPUT_ACTIONS;
30
+ Submit: 33,
31
+
32
+ Comma: 34 };exports.CURRENCY_INPUT_ACTIONS = CURRENCY_INPUT_ACTIONS;
22
33
 
23
34
 
24
35
  var extractAction = new _extractKeyboardAction.KeyboardActionExctracterBuilder().
@@ -35,4 +46,5 @@ add(CURRENCY_INPUT_ACTIONS.End, Keyboard.isUnmodified(Keyboard.isKeyEnd)).
35
46
  add(CURRENCY_INPUT_ACTIONS.Backspace, Keyboard.isKeyBackspace).
36
47
  add(CURRENCY_INPUT_ACTIONS.Delete, Keyboard.isKeyDelete).
37
48
  add(CURRENCY_INPUT_ACTIONS.Ignore, function (e) {return Keyboard.isModified()(e) || Keyboard.isKeyTab(e);}).
49
+ add(CURRENCY_INPUT_ACTIONS.Comma, Keyboard.someKeys.apply(Keyboard, commaAliases)).
38
50
  build(CURRENCY_INPUT_ACTIONS.Unknown);exports.extractAction = extractAction;
@@ -1 +1 @@
1
- {"version":3,"sources":["CurrencyInputKeyboardActions.tsx"],"names":["CURRENCY_INPUT_ACTIONS","Unknown","Ignore","MoveCursorLeft","MoveCursorRight","Home","End","ExtendSelectionLeft","ExtendSelectionRight","FullSelection","ExtendSelectionToStart","ExtendSelectionToEnd","Backspace","Delete","Submit","extractAction","KeyboardActionExctracterBuilder","add","Keyboard","isKeyEnter","isModShift","isKeyArrowLeft","isKeyArrowRight","isShortcutSelectAll","isKeyHome","isKeyEnd","isUnmodified","isKeyBackspace","isKeyDelete","e","isModified","isKeyTab","build"],"mappings":"uGAAA;AACA,wE;;AAEO,IAAMA,sBAAsB,GAAG;AACpCC,EAAAA,OAAO,EAAE,CAD2B;AAEpCC,EAAAA,MAAM,EAAE,CAF4B;;AAIpCC,EAAAA,cAAc,EAAE,EAJoB;AAKpCC,EAAAA,eAAe,EAAE,EALmB;AAMpCC,EAAAA,IAAI,EAAE,EAN8B;AAOp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jB,sBAAsB,CAACM,GAVD,EAUMY,QAAQ,CAACQ,YAAT,CAAsBR,QAAQ,CAACO,QAA/B,CAVN;AAW1BR,GAX0B,CAWtBjB,sBAAsB,CAACY,SAXD,EAWYM,QAAQ,CAACS,cAXrB;AAY1BV,GAZ0B,CAYtBjB,sBAAsB,CAACa,MAZD,EAYSK,QAAQ,CAACU,WAZlB;AAa1BX,GAb0B,CAatBjB,sBAAsB,CAACE,MAbD,EAaS,UAAC2B,CAAD,UAAOX,QAAQ,CAACY,UAAT,GAAsBD,CAAtB,KAA4BX,QAAQ,CAACa,QAAT,CAAkBF,CAAlB,CAAnC,EAbT;AAc1BG,KAd0B,CAcpBhC,sBAAsB,CAACC,OAdH,CAAtB,C","sourcesContent":["import * as Keyboard from '../../lib/events/keyboard/identifiers';\nimport { KeyboardActionExctracterBuilder } from '../../lib/extractKeyboardAction';\n\nexport const CURRENCY_INPUT_ACTIONS = {\n Unknown: 0,\n Ignore: 1,\n\n MoveCursorLeft: 11,\n MoveCursorRight: 12,\n Home: 13,\n End: 14,\n\n ExtendSelectionLeft: 21,\n ExtendSelectionRight: 22,\n FullSelection: 23,\n ExtendSelectionToStart: 24,\n ExtendSelectionToEnd: 25,\n\n Backspace: 31,\n Delete: 32,\n Submit: 33,\n};\n\nexport const extractAction = new KeyboardActionExctracterBuilder()\n .add(CURRENCY_INPUT_ACTIONS.Submit, Keyboard.isKeyEnter)\n .add(CURRENCY_INPUT_ACTIONS.ExtendSelectionLeft, Keyboard.isModShift(Keyboard.isKeyArrowLeft))\n .add(CURRENCY_INPUT_ACTIONS.ExtendSelectionRight, Keyboard.isModShift(Keyboard.isKeyArrowRight))\n .add(CURRENCY_INPUT_ACTIONS.FullSelection, Keyboard.isShortcutSelectAll)\n .add(CURRENCY_INPUT_ACTIONS.ExtendSelectionToStart, Keyboard.isModShift(Keyboard.isKeyHome))\n .add(CURRENCY_INPUT_ACTIONS.ExtendSelectionToEnd, Keyboard.isModShift(Keyboard.isKeyEnd))\n .add(CURRENCY_INPUT_ACTIONS.MoveCursorLeft, Keyboard.isKeyArrowLeft)\n .add(CURRENCY_INPUT_ACTIONS.MoveCursorRight, Keyboard.isKeyArrowRight)\n .add(CURRENCY_INPUT_ACTIONS.Home, Keyboard.isUnmodified(Keyboard.isKeyHome))\n .add(CURRENCY_INPUT_ACTIONS.End, Keyboard.isUnmodified(Keyboard.isKeyEnd))\n .add(CURRENCY_INPUT_ACTIONS.Backspace, Keyboard.isKeyBackspace)\n .add(CURRENCY_INPUT_ACTIONS.Delete, Keyboard.isKeyDelete)\n .add(CURRENCY_INPUT_ACTIONS.Ignore, (e) => Keyboard.isModified()(e) || Keyboard.isKeyTab(e))\n .build(CURRENCY_INPUT_ACTIONS.Unknown);\n"]}
1
+ {"version":3,"sources":["CurrencyInputKeyboardActions.tsx"],"names":["commaAliases","Keyboard","isCodeComma","isCodePeriod","isCodeSlash","isCodeBackslash","isCodeIntlBackslash","isCodeNumpadDivide","CURRENCY_INPUT_ACTIONS","Unknown","Ignore","MoveCursorLeft","MoveCursorRight","Home","End","ExtendSelectionLeft","ExtendSelectionRight","FullSelection","ExtendSelectionToStart","ExtendSelectionToEnd","Backspace","Delete","Submit","Comma","extractAction","KeyboardActionExctracterBuilder","add","isKeyEnter","isModShift","isKeyArrowLeft","isKeyArrowRight","isShortcutSelectAll","isKeyHome","isKeyEnd","isUnmodified","isKeyBackspace","isKeyDelete","e","isModified","isKeyTab","someKeys","build"],"mappings":"8HAAA;AACA,wE;;AAEO,IAAMA,YAAY,GAAG;AAC1BC,QAAQ,CAACC,WADiB;AAE1BD,QAAQ,CAACE,YAFiB;AAG1BF,QAAQ,CAACG,WAHiB;AAI1BH,QAAQ,CAACI,eAJiB;AAK1BJ,QAAQ,CAACK,mBALiB;AAM1BL,QAAQ,CAACM,kBANiB,CAArB,C;;;AASA,IAAMC,sBAAsB,GAAG;AACpCC,EAAAA,OAAO,EAAE,CAD2B;AAEpCC,EAAAA,MAAM,EAAE,CAF4B;;AAI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B,sBAAsB,CAACI,eARD,EAQkBX,QAAQ,CAAC6B,eAR3B;AAS1BJ,GAT0B,CAStBlB,sBAAsB,CAACK,IATD,EASOZ,QAAQ,CAACiC,YAAT,CAAsBjC,QAAQ,CAAC+B,SAA/B,CATP;AAU1BN,GAV0B,CAUtBlB,sBAAsB,CAACM,GAVD,EAUMb,QAAQ,CAACiC,YAAT,CAAsBjC,QAAQ,CAACgC,QAA/B,CAVN;AAW1BP,GAX0B,CAWtBlB,sBAAsB,CAACY,SAXD,EAWYnB,QAAQ,CAACkC,cAXrB;AAY1BT,GAZ0B,CAYtBlB,sBAAsB,CAACa,MAZD,EAYSpB,QAAQ,CAACmC,WAZlB;AAa1BV,GAb0B,CAatBlB,sBAAsB,CAACE,MAbD,EAaS,UAAC2B,CAAD,UAAOpC,QAAQ,CAACqC,UAAT,GAAsBD,CAAtB,KAA4BpC,QAAQ,CAACsC,QAAT,CAAkBF,CAAlB,CAAnC,EAbT;AAc1BX,GAd0B,CActBlB,sBAAsB,CAACe,KAdD,EAcQtB,QAAQ,CAACuC,QAAT,OAAAvC,QAAQ,EAAaD,YAAb,CAdhB;AAe1ByC,KAf0B,CAepBjC,sBAAsB,CAACC,OAfH,CAAtB,C","sourcesContent":["import * as Keyboard from '../../lib/events/keyboard/identifiers';\nimport { KeyboardActionExctracterBuilder } from '../../lib/extractKeyboardAction';\n\nexport const commaAliases = [\n Keyboard.isCodeComma,\n Keyboard.isCodePeriod,\n Keyboard.isCodeSlash,\n Keyboard.isCodeBackslash,\n Keyboard.isCodeIntlBackslash,\n Keyboard.isCodeNumpadDivide,\n];\n\nexport const CURRENCY_INPUT_ACTIONS = {\n Unknown: 0,\n Ignore: 1,\n\n MoveCursorLeft: 11,\n MoveCursorRight: 12,\n Home: 13,\n End: 14,\n\n ExtendSelectionLeft: 21,\n ExtendSelectionRight: 22,\n FullSelection: 23,\n ExtendSelectionToStart: 24,\n ExtendSelectionToEnd: 25,\n\n Backspace: 31,\n Delete: 32,\n Submit: 33,\n\n Comma: 34,\n};\n\nexport const extractAction = new KeyboardActionExctracterBuilder()\n .add(CURRENCY_INPUT_ACTIONS.Submit, Keyboard.isKeyEnter)\n .add(CURRENCY_INPUT_ACTIONS.ExtendSelectionLeft, Keyboard.isModShift(Keyboard.isKeyArrowLeft))\n .add(CURRENCY_INPUT_ACTIONS.ExtendSelectionRight, Keyboard.isModShift(Keyboard.isKeyArrowRight))\n .add(CURRENCY_INPUT_ACTIONS.FullSelection, Keyboard.isShortcutSelectAll)\n .add(CURRENCY_INPUT_ACTIONS.ExtendSelectionToStart, Keyboard.isModShift(Keyboard.isKeyHome))\n .add(CURRENCY_INPUT_ACTIONS.ExtendSelectionToEnd, Keyboard.isModShift(Keyboard.isKeyEnd))\n .add(CURRENCY_INPUT_ACTIONS.MoveCursorLeft, Keyboard.isKeyArrowLeft)\n .add(CURRENCY_INPUT_ACTIONS.MoveCursorRight, Keyboard.isKeyArrowRight)\n .add(CURRENCY_INPUT_ACTIONS.Home, Keyboard.isUnmodified(Keyboard.isKeyHome))\n .add(CURRENCY_INPUT_ACTIONS.End, Keyboard.isUnmodified(Keyboard.isKeyEnd))\n .add(CURRENCY_INPUT_ACTIONS.Backspace, Keyboard.isKeyBackspace)\n .add(CURRENCY_INPUT_ACTIONS.Delete, Keyboard.isKeyDelete)\n .add(CURRENCY_INPUT_ACTIONS.Ignore, (e) => Keyboard.isModified()(e) || Keyboard.isKeyTab(e))\n .add(CURRENCY_INPUT_ACTIONS.Comma, Keyboard.someKeys(...commaAliases))\n .build(CURRENCY_INPUT_ACTIONS.Unknown);\n"]}
@@ -5,23 +5,17 @@ export interface CurrencyLabelProps extends CommonProps {
5
5
  * Минимальное количество отображаемых знаков после запятой
6
6
  * @default 2
7
7
  */
8
- fractionDigits: number;
8
+ fractionDigits?: number;
9
9
  value: number;
10
10
  currencySymbol?: React.ReactNode;
11
11
  }
12
- export declare const defaultProps: {
13
- fractionDigits: number;
14
- };
15
12
  export declare const CurrencyLabelDataTids: {
16
13
  readonly root: "CurrencyLabel__root";
17
14
  };
18
15
  export declare const CurrencyLabel: {
19
- (props: CurrencyLabelProps): JSX.Element;
16
+ ({ value, fractionDigits, currencySymbol, ...rest }: CurrencyLabelProps): JSX.Element;
20
17
  __KONTUR_REACT_UI__: string;
21
- defaultProps: {
22
- fractionDigits: number;
23
- };
24
18
  propTypes: {
25
- fractionDigits: (props: CurrencyLabelProps & typeof defaultProps) => Error | null;
19
+ fractionDigits: ({ fractionDigits, value }: CurrencyLabelProps) => Error | null;
26
20
  };
27
21
  };
@@ -1,8 +1,8 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.defaultProps = exports.CurrencyLabelDataTids = exports.CurrencyLabel = void 0;var _react = _interopRequireDefault(require("react"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.CurrencyLabelDataTids = exports.CurrencyLabel = void 0;var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _react = _interopRequireDefault(require("react"));
2
2
 
3
3
  var _constants = require("../CurrencyInput/constants");
4
4
  var _CurrencyHelper = require("../CurrencyInput/CurrencyHelper");
5
- var _CommonWrapper = require("../../internal/CommonWrapper");
5
+ var _CommonWrapper = require("../../internal/CommonWrapper");var _excluded = ["value", "fractionDigits", "currencySymbol"];
6
6
 
7
7
 
8
8
 
@@ -14,18 +14,20 @@ var _CommonWrapper = require("../../internal/CommonWrapper");
14
14
 
15
15
 
16
16
 
17
- var defaultProps = {
18
- fractionDigits: 2 };exports.defaultProps = defaultProps;
19
-
17
+ var FRACTION_DIGITS_DEFAULT = 2;
20
18
 
21
19
  var CurrencyLabelDataTids = {
22
20
  root: 'CurrencyLabel__root' };exports.CurrencyLabelDataTids = CurrencyLabelDataTids;
23
21
 
24
22
 
25
- var CurrencyLabel = function CurrencyLabel(props) {
26
- var value = props.value,fractionDigits = props.fractionDigits,currencySymbol = props.currencySymbol;
23
+ var CurrencyLabel = function CurrencyLabel(_ref)
24
+
25
+
26
+
27
+
28
+ {var value = _ref.value,_ref$fractionDigits = _ref.fractionDigits,fractionDigits = _ref$fractionDigits === void 0 ? FRACTION_DIGITS_DEFAULT : _ref$fractionDigits,currencySymbol = _ref.currencySymbol,rest = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
27
29
  return /*#__PURE__*/(
28
- _react.default.createElement(_CommonWrapper.CommonWrapper, props, /*#__PURE__*/
30
+ _react.default.createElement(_CommonWrapper.CommonWrapper, rest, /*#__PURE__*/
29
31
  _react.default.createElement("span", { "data-tid": CurrencyLabelDataTids.root },
30
32
  _CurrencyHelper.CurrencyHelper.format(value, { fractionDigits: fractionDigits }),
31
33
  currencySymbol && String.fromCharCode(0xa0) /* &nbsp; */,
@@ -37,26 +39,24 @@ var CurrencyLabel = function CurrencyLabel(props) {
37
39
 
38
40
  CurrencyLabel.__KONTUR_REACT_UI__ = 'CurrencyLabel';
39
41
 
40
- CurrencyLabel.defaultProps = defaultProps;
41
-
42
42
  CurrencyLabel.propTypes = {
43
- fractionDigits: function fractionDigits(props) {
44
- if (props.fractionDigits > _constants.MAX_SAFE_DIGITS) {
43
+ fractionDigits: function fractionDigits(_ref2) {var _ref2$fractionDigits = _ref2.fractionDigits,_fractionDigits = _ref2$fractionDigits === void 0 ? FRACTION_DIGITS_DEFAULT : _ref2$fractionDigits,value = _ref2.value;
44
+ if (_fractionDigits > _constants.MAX_SAFE_DIGITS) {
45
45
  return new Error(
46
46
  "[CurrencyLabel]: Prop 'fractionDigits' exceeds " + _constants.MAX_SAFE_DIGITS + "." + "\nSee https://tech.skbkontur.ru/react-ui/#/CurrencyInput?id=why15");
47
47
 
48
48
 
49
49
  }
50
50
 
51
- var _ref = _CurrencyHelper.CurrencyHelper.destructString(String(props.value)) || { fraction: '' },fraction = _ref.fraction;
52
- if (fraction.length > props.fractionDigits) {
51
+ var _ref3 = _CurrencyHelper.CurrencyHelper.destructString(String(value)) || { fraction: '' },fraction = _ref3.fraction;
52
+ if (fraction.length > _fractionDigits) {
53
53
  return new Error(
54
54
  "[CurrencyLabel]: Prop 'fractionDigits' less than fractional part of the 'value' property," + "'value' will not be cutted");
55
55
 
56
56
 
57
57
  }
58
58
 
59
- if (!Number.isInteger(props.fractionDigits)) {
59
+ if (!Number.isInteger(_fractionDigits)) {
60
60
  return new Error("[CurrencyLabel]: Prop 'fractionDigits' is not integer, fraction part of these property will not be used");
61
61
 
62
62
 
@@ -1 +1 @@
1
- {"version":3,"sources":["CurrencyLabel.tsx"],"names":["defaultProps","fractionDigits","CurrencyLabelDataTids","root","CurrencyLabel","props","value","currencySymbol","CurrencyHelper","format","String","fromCharCode","__KONTUR_REACT_UI__","propTypes","MAX_SAFE_DIGITS","Error","destructString","fraction","length","Number","isInteger"],"mappings":"kNAAA;;AAEA;AACA;AACA;;;;;;;;;;;;AAYO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,cAAc,EAAE,CADU,EAArB,C;;;AAIA,IAAMC,qBAAqB,GAAG;AACnCC,EAAAA,IAAI,EAAE,qBAD6B,EAA9B,C;;;AAIA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAA4C;AACvE,MAAQC,KAAR,GAAkDD,KAAlD,CAAQC,KAAR,CAAeL,cAAf,GAAkDI,KAAlD,CAAeJ,cAAf,CAA+BM,cAA/B,GAAkDF,KAAlD,CAA+BE,cAA/B;AACA;AACE,iCAAC,4BAAD,EAAmBF,KAAnB;AACE,2CAAM,YAAUH,qBAAqB,CAACC,IAAtC;AACGK,mCAAeC,MAAf,CAAsBH,KAAtB,EAA6B,EAAEL,cAAc,EAAdA,cAAF,EAA7B,CADH;AAEGM,IAAAA,cAAc,IAAIG,MAAM,CAACC,YAAP,CAAoB,IAApB,CAFrB,CAE+C,YAF/C;AAGGJ,IAAAA,cAHH,CADF,CADF;;;;AASD,CAXM,C;;AAaPH,aAAa,CAACQ,mBAAd,GAAoC,eAApC;;AAEAR,aAAa,CAACJ,YAAd,GAA6BA,YAA7B;;AAEAI,aAAa,CAACS,SAAd,GAA0B;AACxBZ,EAAAA,cAAc,EAAE,wBAACI,KAAD,EAAqD;AACnE,QAAIA,KAAK,CAACJ,cAAN,GAAuBa,0BAA3B,EAA4C;AAC1C,aAAO,IAAIC,KAAJ;AACL,0DAAkDD,0BAAlD,4EADK,CAAP;;;AAID;;AAED,eAAqBN,+BAAeQ,cAAf,CAA8BN,MAAM,CAACL,KAAK,CAACC,KAAP,CAApC,KAAsD,EAAEW,QAAQ,EAAE,EAAZ,EAA3E,CAAQA,QAAR,QAAQA,QAAR;AACA,QAAIA,QAAQ,CAACC,MAAT,GAAkBb,KAAK,CAACJ,cAA5B,EAA4C;AAC1C,aAAO,IAAIc,KAAJ;AACL,gIADK,CAAP;;;AAID;;AAED,QAAI,CAACI,MAAM,CAACC,SAAP,CAAiBf,KAAK,CAACJ,cAAvB,CAAL,EAA6C;AAC3C,aAAO,IAAIc,KAAJ,2GAAP;;;AAGD;;AAED,WAAO,IAAP;AACD,GAxBuB,EAA1B","sourcesContent":["import React from 'react';\n\nimport { MAX_SAFE_DIGITS } from '../CurrencyInput/constants';\nimport { CurrencyHelper } from '../CurrencyInput/CurrencyHelper';\nimport { CommonWrapper, CommonProps } from '../../internal/CommonWrapper';\n\nexport interface CurrencyLabelProps extends CommonProps {\n /**\n * Минимальное количество отображаемых знаков после запятой\n * @default 2\n */\n fractionDigits: number;\n value: number;\n currencySymbol?: React.ReactNode;\n}\n\nexport const defaultProps = {\n fractionDigits: 2,\n};\n\nexport const CurrencyLabelDataTids = {\n root: 'CurrencyLabel__root',\n} as const;\n\nexport const CurrencyLabel = (props: CurrencyLabelProps): JSX.Element => {\n const { value, fractionDigits, currencySymbol } = props;\n return (\n <CommonWrapper {...props}>\n <span data-tid={CurrencyLabelDataTids.root}>\n {CurrencyHelper.format(value, { fractionDigits })}\n {currencySymbol && String.fromCharCode(0xa0) /* &nbsp; */}\n {currencySymbol}\n </span>\n </CommonWrapper>\n );\n};\n\nCurrencyLabel.__KONTUR_REACT_UI__ = 'CurrencyLabel';\n\nCurrencyLabel.defaultProps = defaultProps;\n\nCurrencyLabel.propTypes = {\n fractionDigits: (props: CurrencyLabelProps & typeof defaultProps) => {\n if (props.fractionDigits > MAX_SAFE_DIGITS) {\n return new Error(\n `[CurrencyLabel]: Prop 'fractionDigits' exceeds ${MAX_SAFE_DIGITS}.` +\n `\\nSee https://tech.skbkontur.ru/react-ui/#/CurrencyInput?id=why15`,\n );\n }\n\n const { fraction } = CurrencyHelper.destructString(String(props.value)) || { fraction: '' };\n if (fraction.length > props.fractionDigits) {\n return new Error(\n `[CurrencyLabel]: Prop 'fractionDigits' less than fractional part of the 'value' property,` +\n `'value' will not be cutted`,\n );\n }\n\n if (!Number.isInteger(props.fractionDigits)) {\n return new Error(\n `[CurrencyLabel]: Prop 'fractionDigits' is not integer, fraction part of these property will not be used`,\n );\n }\n\n return null;\n },\n};\n"]}
1
+ {"version":3,"sources":["CurrencyLabel.tsx"],"names":["FRACTION_DIGITS_DEFAULT","CurrencyLabelDataTids","root","CurrencyLabel","value","fractionDigits","currencySymbol","rest","CurrencyHelper","format","String","fromCharCode","__KONTUR_REACT_UI__","propTypes","MAX_SAFE_DIGITS","Error","destructString","fraction","length","Number","isInteger"],"mappings":"uTAAA;;AAEA;AACA;AACA,6D;;;;;;;;;;;;AAYA,IAAMA,uBAAuB,GAAG,CAAhC;;AAEO,IAAMC,qBAAqB,GAAG;AACnCC,EAAAA,IAAI,EAAE,qBAD6B,EAA9B,C;;;AAIA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB;;;;;AAKU,KAJrCC,KAIqC,QAJrCA,KAIqC,4BAHrCC,cAGqC,CAHrCA,cAGqC,oCAHpBL,uBAGoB,uBAFrCM,cAEqC,QAFrCA,cAEqC,CADlCC,IACkC;AACrC;AACE,iCAAC,4BAAD,EAAmBA,IAAnB;AACE,2CAAM,YAAUN,qBAAqB,CAACC,IAAtC;AACGM,mCAAeC,MAAf,CAAsBL,KAAtB,EAA6B,EAAEC,cAAc,EAAdA,cAAF,EAA7B,CADH;AAEGC,IAAAA,cAAc,IAAII,MAAM,CAACC,YAAP,CAAoB,IAApB,CAFrB,CAE+C,YAF/C;AAGGL,IAAAA,cAHH,CADF,CADF;;;;AASD,CAfM,C;;AAiBPH,aAAa,CAACS,mBAAd,GAAoC,eAApC;;AAEAT,aAAa,CAACU,SAAd,GAA0B;AACxBR,EAAAA,cAAc,EAAE,+BAA6E,kCAA1EA,cAA0E,CAA1EA,eAA0E,qCAAzDL,uBAAyD,wBAAhCI,KAAgC,SAAhCA,KAAgC;AAC3F,QAAIC,eAAc,GAAGS,0BAArB,EAAsC;AACpC,aAAO,IAAIC,KAAJ;AACL,0DAAkDD,0BAAlD,4EADK,CAAP;;;AAID;;AAED,gBAAqBN,+BAAeQ,cAAf,CAA8BN,MAAM,CAACN,KAAD,CAApC,KAAgD,EAAEa,QAAQ,EAAE,EAAZ,EAArE,CAAQA,QAAR,SAAQA,QAAR;AACA,QAAIA,QAAQ,CAACC,MAAT,GAAkBb,eAAtB,EAAsC;AACpC,aAAO,IAAIU,KAAJ;AACL,gIADK,CAAP;;;AAID;;AAED,QAAI,CAACI,MAAM,CAACC,SAAP,CAAiBf,eAAjB,CAAL,EAAuC;AACrC,aAAO,IAAIU,KAAJ,2GAAP;;;AAGD;;AAED,WAAO,IAAP;AACD,GAxBuB,EAA1B","sourcesContent":["import React from 'react';\n\nimport { MAX_SAFE_DIGITS } from '../CurrencyInput/constants';\nimport { CurrencyHelper } from '../CurrencyInput/CurrencyHelper';\nimport { CommonWrapper, CommonProps } from '../../internal/CommonWrapper';\n\nexport interface CurrencyLabelProps extends CommonProps {\n /**\n * Минимальное количество отображаемых знаков после запятой\n * @default 2\n */\n fractionDigits?: number;\n value: number;\n currencySymbol?: React.ReactNode;\n}\n\nconst FRACTION_DIGITS_DEFAULT = 2;\n\nexport const CurrencyLabelDataTids = {\n root: 'CurrencyLabel__root',\n} as const;\n\nexport const CurrencyLabel = ({\n value,\n fractionDigits = FRACTION_DIGITS_DEFAULT,\n currencySymbol,\n ...rest\n}: CurrencyLabelProps): JSX.Element => {\n return (\n <CommonWrapper {...rest}>\n <span data-tid={CurrencyLabelDataTids.root}>\n {CurrencyHelper.format(value, { fractionDigits })}\n {currencySymbol && String.fromCharCode(0xa0) /* &nbsp; */}\n {currencySymbol}\n </span>\n </CommonWrapper>\n );\n};\n\nCurrencyLabel.__KONTUR_REACT_UI__ = 'CurrencyLabel';\n\nCurrencyLabel.propTypes = {\n fractionDigits: ({ fractionDigits = FRACTION_DIGITS_DEFAULT, value }: CurrencyLabelProps) => {\n if (fractionDigits > MAX_SAFE_DIGITS) {\n return new Error(\n `[CurrencyLabel]: Prop 'fractionDigits' exceeds ${MAX_SAFE_DIGITS}.` +\n `\\nSee https://tech.skbkontur.ru/react-ui/#/CurrencyInput?id=why15`,\n );\n }\n\n const { fraction } = CurrencyHelper.destructString(String(value)) || { fraction: '' };\n if (fraction.length > fractionDigits) {\n return new Error(\n `[CurrencyLabel]: Prop 'fractionDigits' less than fractional part of the 'value' property,` +\n `'value' will not be cutted`,\n );\n }\n\n if (!Number.isInteger(fractionDigits)) {\n return new Error(\n `[CurrencyLabel]: Prop 'fractionDigits' is not integer, fraction part of these property will not be used`,\n );\n }\n\n return null;\n },\n};\n"]}
@@ -98,4 +98,4 @@ DateFragmentsView = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose
98
98
 
99
99
  rootRef = function (el) {
100
100
  _this.rootNode = el;
101
- };return _this;}var _proto = DateFragmentsView.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = theme;return _this2.renderMain();});};_proto.renderMain = function renderMain() {var _this3 = this;return /*#__PURE__*/_react.default.createElement("span", { ref: this.rootRef, className: _DateFragmentsView.styles.root(this.theme) }, this.props.fragments.map(function (fragment, index) {return fragment.type === _types.InternalDateComponentType.Separator ? _this3.renderSeparator(fragment, index) : _this3.renderDateComponent(fragment, index);}));};_proto.renderSeparator = function renderSeparator(fragment, index) {var _cx;var separatorClassName = (0, _Emotion.cx)((_cx = {}, _cx[_DateFragmentsView.styles.mask(this.theme)] = true, _cx[_DateFragmentsView.styles.delimiterFilled()] = this.props.fragments[index + 1].value !== null, _cx));return /*#__PURE__*/_react.default.createElement("span", { key: index, className: separatorClassName }, fragment.value);};_proto.renderDateComponent = function renderDateComponent(fragment, index) {var _this$props = this.props,inputMode = _this$props.inputMode,onSelectDateComponent = _this$props.onSelectDateComponent,selected = _this$props.selected;var type = fragment.type,value = fragment.value,length = fragment.length,valueWithPad = fragment.valueWithPad;var valueMask = value === null || selected === type && inputMode ? value : valueWithPad || value;var lengthMask = _InternalDateValidator.InternalDateValidator.testParseToNumber(valueMask) ? Math.max(length - valueMask.toString().length, 0) : length;var handleMouseUp = function handleMouseUp(e) {if (document.activeElement && document.activeElement.contains(e.currentTarget)) {onSelectDateComponent(type, e);}};return /*#__PURE__*/_react.default.createElement("span", { key: index, "data-fragment": "", onMouseUp: handleMouseUp }, valueMask, /*#__PURE__*/_react.default.createElement("span", { className: _DateFragmentsView.styles.mask(this.theme) }, Array(lengthMask).fill('').map(function (_, i) {return /*#__PURE__*/_react.default.createElement(_MaskCharLowLine.MaskCharLowLine, { key: i });})));};return DateFragmentsView;}(_react.default.Component);exports.DateFragmentsView = DateFragmentsView;
101
+ };return _this;}var _proto = DateFragmentsView.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = theme;return _this2.renderMain();});};_proto.renderMain = function renderMain() {var _this3 = this;return /*#__PURE__*/_react.default.createElement("span", { ref: this.rootRef, className: _DateFragmentsView.styles.root(this.theme) }, this.props.fragments.map(function (fragment, index) {return fragment.type === _types.InternalDateComponentType.Separator ? _this3.renderSeparator(fragment, index) : _this3.renderDateComponent(fragment, index);}));};_proto.renderSeparator = function renderSeparator(fragment, index) {var _cx;var separatorClassName = (0, _Emotion.cx)((_cx = {}, _cx[_DateFragmentsView.styles.mask(this.theme)] = true, _cx[_DateFragmentsView.styles.delimiterFilled()] = this.props.fragments[index + 1].value !== null, _cx));return /*#__PURE__*/_react.default.createElement("span", { key: index, className: separatorClassName }, fragment.value);};_proto.renderDateComponent = function renderDateComponent(fragment, index) {var _this$props = this.props,inputMode = _this$props.inputMode,onSelectDateComponent = _this$props.onSelectDateComponent,selected = _this$props.selected;var type = fragment.type,value = fragment.value,length = fragment.length,valueWithPad = fragment.valueWithPad;var valueMask = value === null || selected === type && inputMode ? value : valueWithPad || value;var lengthMask = _InternalDateValidator.InternalDateValidator.testParseToNumber(valueMask) ? Math.max(length - valueMask.toString().length, 0) : length;var handleMouseUp = function handleMouseUp(e) {if (document.activeElement && document.activeElement.contains(e.currentTarget)) {onSelectDateComponent(type, e);}};return /*#__PURE__*/_react.default.createElement("span", { key: index, "data-fragment": "", onMouseUp: handleMouseUp }, valueMask, /*#__PURE__*/_react.default.createElement("span", { "data-tid": "DateFragmentsView__placeholder", className: _DateFragmentsView.styles.mask(this.theme) }, Array(lengthMask).fill('').map(function (_, i) {return /*#__PURE__*/_react.default.createElement(_MaskCharLowLine.MaskCharLowLine, { key: i });})));};return DateFragmentsView;}(_react.default.Component);exports.DateFragmentsView = DateFragmentsView;
@@ -1 +1 @@
1
- {"version":3,"sources":["DateFragmentsView.tsx"],"names":["DateFragmentsView","rootNode","isFragment","el","fragments","Array","from","querySelectorAll","some","fragment","contains","getRootNode","rootRef","render","theme","renderMain","styles","root","props","map","index","type","InternalDateComponentType","Separator","renderSeparator","renderDateComponent","separatorClassName","mask","delimiterFilled","value","inputMode","onSelectDateComponent","selected","length","valueWithPad","valueMask","lengthMask","InternalDateValidator","testParseToNumber","Math","max","toString","handleMouseUp","e","document","activeElement","currentTarget","fill","_","i","React","Component"],"mappings":"6PAAA;;AAEA;A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B,EAAgF,CAC9Ef,qBAAqB,CAACV,IAAD,EAAOsB,CAAP,CAArB,CACD,CACF,CAJD,CAMA,oBACE,uCAAM,GAAG,EAAEvB,KAAX,EAAkB,iBAAc,EAAhC,EAAmC,SAAS,EAAEsB,aAA9C,IACGP,SADH,eAEE,uCAAM,SAAS,EAAEnB,0BAAOW,IAAP,CAAY,KAAKb,KAAjB,CAAjB,IACGT,KAAK,CAAC+B,UAAD,CAAL,CACEW,IADF,CACO,EADP,EAEE5B,GAFF,CAEM,UAAC6B,CAAD,EAAIC,CAAJ,uBACH,6BAAC,gCAAD,IAAiB,GAAG,EAAEA,CAAtB,GADG,EAFN,CADH,CAFF,CADF,CAYD,C,4BA9EoCC,eAAMC,S","sourcesContent":["import React from 'react';\n\nimport { MaskCharLowLine } from '../../internal/MaskCharLowLine';\nimport { InternalDateValidator } from '../../lib/date/InternalDateValidator';\nimport { InternalDateComponentType, InternalDateFragment } from '../../lib/date/types';\nimport { Theme } from '../../lib/theming/Theme';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { cx } from '../../lib/theming/Emotion';\n\nimport { styles } from './DateFragmentsView.styles';\n\ninterface DateFragmentViewProps {\n selected: InternalDateComponentType | null;\n fragments: InternalDateFragment[];\n inputMode: boolean;\n onSelectDateComponent: (type: InternalDateComponentType, e: React.MouseEvent<HTMLSpanElement>) => void;\n}\n\nexport class DateFragmentsView extends React.Component<DateFragmentViewProps, {}> {\n private theme!: Theme;\n private rootNode: HTMLSpanElement | null = null;\n\n public isFragment = (el: HTMLElement | EventTarget): boolean => {\n if (this.rootNode) {\n // NOTE: NodeList doesn't support method 'forEach' in IE11\n const fragments: HTMLSpanElement[] = Array.from(this.rootNode.querySelectorAll('[data-fragment]'));\n return fragments.some((fragment) => fragment === el || fragment.contains(el as HTMLSpanElement));\n }\n return false;\n };\n\n public getRootNode = () => this.rootNode;\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain() {\n return (\n <span ref={this.rootRef} className={styles.root(this.theme)}>\n {this.props.fragments.map((fragment, index) =>\n fragment.type === InternalDateComponentType.Separator\n ? this.renderSeparator(fragment, index)\n : this.renderDateComponent(fragment, index),\n )}\n </span>\n );\n }\n\n private renderSeparator(fragment: InternalDateFragment, index: number): JSX.Element {\n const separatorClassName = cx({\n [styles.mask(this.theme)]: true,\n [styles.delimiterFilled()]: this.props.fragments[index + 1].value !== null,\n });\n\n return (\n <span key={index} className={separatorClassName}>\n {fragment.value}\n </span>\n );\n }\n\n private renderDateComponent(fragment: InternalDateFragment, index: number): JSX.Element {\n const { inputMode, onSelectDateComponent, selected } = this.props;\n const { type, value, length, valueWithPad } = fragment;\n\n const valueMask = value === null || (selected === type && inputMode) ? value : valueWithPad || value;\n const lengthMask = InternalDateValidator.testParseToNumber(valueMask)\n ? Math.max(length - valueMask!.toString().length, 0)\n : length;\n\n const handleMouseUp = (e: React.MouseEvent<HTMLSpanElement>) => {\n if (document.activeElement && document.activeElement.contains(e.currentTarget)) {\n onSelectDateComponent(type, e);\n }\n };\n\n return (\n <span key={index} data-fragment=\"\" onMouseUp={handleMouseUp}>\n {valueMask}\n <span className={styles.mask(this.theme)}>\n {Array(lengthMask)\n .fill('')\n .map((_, i) => (\n <MaskCharLowLine key={i} />\n ))}\n </span>\n </span>\n );\n }\n\n private rootRef = (el: HTMLSpanElement | null) => {\n this.rootNode = el;\n };\n}\n"]}
1
+ {"version":3,"sources":["DateFragmentsView.tsx"],"names":["DateFragmentsView","rootNode","isFragment","el","fragments","Array","from","querySelectorAll","some","fragment","contains","getRootNode","rootRef","render","theme","renderMain","styles","root","props","map","index","type","InternalDateComponentType","Separator","renderSeparator","renderDateComponent","separatorClassName","mask","delimiterFilled","value","inputMode","onSelectDateComponent","selected","length","valueWithPad","valueMask","lengthMask","InternalDateValidator","testParseToNumber","Math","max","toString","handleMouseUp","e","document","activeElement","currentTarget","fill","_","i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AgCiC,CAAC,CAACG,aAAlC,CAA9B,EAAgF,CAC9Ef,qBAAqB,CAACV,IAAD,EAAOsB,CAAP,CAArB,CACD,CACF,CAJD,CAMA,oBACE,uCAAM,GAAG,EAAEvB,KAAX,EAAkB,iBAAc,EAAhC,EAAmC,SAAS,EAAEsB,aAA9C,IACGP,SADH,eAEE,uCAAM,YAAS,gCAAf,EAAgD,SAAS,EAAEnB,0BAAOW,IAAP,CAAY,KAAKb,KAAjB,CAA3D,IACGT,KAAK,CAAC+B,UAAD,CAAL,CACEW,IADF,CACO,EADP,EAEE5B,GAFF,CAEM,UAAC6B,CAAD,EAAIC,CAAJ,uBACH,6BAAC,gCAAD,IAAiB,GAAG,EAAEA,CAAtB,GADG,EAFN,CADH,CAFF,CADF,CAYD,C,4BA9EoCC,eAAMC,S","sourcesContent":["import React from 'react';\n\nimport { MaskCharLowLine } from '../../internal/MaskCharLowLine';\nimport { InternalDateValidator } from '../../lib/date/InternalDateValidator';\nimport { InternalDateComponentType, InternalDateFragment } from '../../lib/date/types';\nimport { Theme } from '../../lib/theming/Theme';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { cx } from '../../lib/theming/Emotion';\n\nimport { styles } from './DateFragmentsView.styles';\n\ninterface DateFragmentViewProps {\n selected: InternalDateComponentType | null;\n fragments: InternalDateFragment[];\n inputMode: boolean;\n onSelectDateComponent: (type: InternalDateComponentType, e: React.MouseEvent<HTMLSpanElement>) => void;\n}\n\nexport class DateFragmentsView extends React.Component<DateFragmentViewProps, {}> {\n private theme!: Theme;\n private rootNode: HTMLSpanElement | null = null;\n\n public isFragment = (el: HTMLElement | EventTarget): boolean => {\n if (this.rootNode) {\n // NOTE: NodeList doesn't support method 'forEach' in IE11\n const fragments: HTMLSpanElement[] = Array.from(this.rootNode.querySelectorAll('[data-fragment]'));\n return fragments.some((fragment) => fragment === el || fragment.contains(el as HTMLSpanElement));\n }\n return false;\n };\n\n public getRootNode = () => this.rootNode;\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain() {\n return (\n <span ref={this.rootRef} className={styles.root(this.theme)}>\n {this.props.fragments.map((fragment, index) =>\n fragment.type === InternalDateComponentType.Separator\n ? this.renderSeparator(fragment, index)\n : this.renderDateComponent(fragment, index),\n )}\n </span>\n );\n }\n\n private renderSeparator(fragment: InternalDateFragment, index: number): JSX.Element {\n const separatorClassName = cx({\n [styles.mask(this.theme)]: true,\n [styles.delimiterFilled()]: this.props.fragments[index + 1].value !== null,\n });\n\n return (\n <span key={index} className={separatorClassName}>\n {fragment.value}\n </span>\n );\n }\n\n private renderDateComponent(fragment: InternalDateFragment, index: number): JSX.Element {\n const { inputMode, onSelectDateComponent, selected } = this.props;\n const { type, value, length, valueWithPad } = fragment;\n\n const valueMask = value === null || (selected === type && inputMode) ? value : valueWithPad || value;\n const lengthMask = InternalDateValidator.testParseToNumber(valueMask)\n ? Math.max(length - valueMask!.toString().length, 0)\n : length;\n\n const handleMouseUp = (e: React.MouseEvent<HTMLSpanElement>) => {\n if (document.activeElement && document.activeElement.contains(e.currentTarget)) {\n onSelectDateComponent(type, e);\n }\n };\n\n return (\n <span key={index} data-fragment=\"\" onMouseUp={handleMouseUp}>\n {valueMask}\n <span data-tid=\"DateFragmentsView__placeholder\" className={styles.mask(this.theme)}>\n {Array(lengthMask)\n .fill('')\n .map((_, i) => (\n <MaskCharLowLine key={i} />\n ))}\n </span>\n </span>\n );\n }\n\n private rootRef = (el: HTMLSpanElement | null) => {\n this.rootNode = el;\n };\n}\n"]}