@redneckz/wildless-cms-uni-blocks 0.10.9 → 0.10.10

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 (539) hide show
  1. package/bin/migration-scripts/0.10.10.js +44 -0
  2. package/bundle/bundle.umd.js +145 -147
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Filtration/FiltrationContent.d.ts +2 -6
  5. package/bundle/components/OfficeMap/useOfficeMap.d.ts +2 -0
  6. package/bundle/hooks/useForm.d.ts +8 -4
  7. package/bundle/hooks/useNormalizedInput.d.ts +11 -0
  8. package/bundle/ui-kit/ControlProps.d.ts +1 -1
  9. package/bundle/ui-kit/CurrencyInput/CurrencyInput.d.ts +2 -2
  10. package/bundle/ui-kit/Input/Input.d.ts +1 -1
  11. package/bundle/ui-kit/Input/InputProps.d.ts +4 -5
  12. package/bundle/ui-kit/InputRange/InputRangeProps.d.ts +2 -4
  13. package/bundle/ui-kit/NumberInput/NumberInput.d.ts +8 -0
  14. package/bundle/ui-kit/PhoneInput/PhoneInput.d.ts +1 -1
  15. package/bundle/utils/identity.d.ts +1 -0
  16. package/bundle/utils/toLocalNumberFormat.d.ts +1 -0
  17. package/dist/components/ApplicationForm/ApplicationFormDeposit.js +1 -1
  18. package/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  19. package/dist/components/ApplicationForm/renderAcquiringDataOrganization.js +1 -1
  20. package/dist/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  21. package/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js +1 -1
  22. package/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +1 -1
  23. package/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  24. package/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  25. package/dist/components/ApplicationForm/renderWedDataOrganization.js +1 -1
  26. package/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  27. package/dist/components/Calculator/CalculatorValueBlock.js +2 -2
  28. package/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
  29. package/dist/components/Calculator/renderInitialFeeInput.js +3 -3
  30. package/dist/components/Calculator/renderInitialFeeInput.js.map +1 -1
  31. package/dist/components/Calculator/renderProposal.js +2 -2
  32. package/dist/components/Calculator/renderProposal.js.map +1 -1
  33. package/dist/components/Calculator/renderRealEstateValue.js +2 -2
  34. package/dist/components/Calculator/renderRealEstateValue.js.map +1 -1
  35. package/dist/components/Calculator/renderWantedSumInput.js +3 -3
  36. package/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
  37. package/dist/components/CardTransfer/CardTransfer.js +10 -8
  38. package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  39. package/dist/components/ContentPage/ContentPage.page.json +0 -1
  40. package/dist/components/Filtration/Filtration.js +1 -1
  41. package/dist/components/Filtration/Filtration.js.map +1 -1
  42. package/dist/components/Filtration/FiltrationContent.d.ts +2 -6
  43. package/dist/components/Filtration/renderFormItem.js.map +1 -1
  44. package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +2 -2
  45. package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
  46. package/dist/components/OfficeMap/OfficeMap.js +2 -2
  47. package/dist/components/OfficeMap/OfficeMap.js.map +1 -1
  48. package/dist/components/OfficeMap/useOfficeMap.d.ts +2 -0
  49. package/dist/components/OfficeMap/useOfficeMap.js +1 -2
  50. package/dist/components/OfficeMap/useOfficeMap.js.map +1 -1
  51. package/dist/components/PictureText/PictureText.js +2 -2
  52. package/dist/components/PictureText/PictureText.js.map +1 -1
  53. package/dist/hooks/useForm.d.ts +8 -4
  54. package/dist/hooks/useForm.js +5 -3
  55. package/dist/hooks/useForm.js.map +1 -1
  56. package/dist/hooks/useNormalizedInput.d.ts +11 -0
  57. package/dist/hooks/useNormalizedInput.js +23 -0
  58. package/dist/hooks/useNormalizedInput.js.map +1 -0
  59. package/dist/hooks/useSWRResource.js +2 -1
  60. package/dist/hooks/useSWRResource.js.map +1 -1
  61. package/dist/services/search/useSearch.js +3 -2
  62. package/dist/services/search/useSearch.js.map +1 -1
  63. package/dist/ui-kit/ControlProps.d.ts +1 -1
  64. package/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +2 -2
  65. package/dist/ui-kit/CurrencyInput/CurrencyInput.js +3 -16
  66. package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  67. package/dist/ui-kit/Input/Input.d.ts +1 -1
  68. package/dist/ui-kit/Input/Input.js +3 -2
  69. package/dist/ui-kit/Input/Input.js.map +1 -1
  70. package/dist/ui-kit/Input/InputProps.d.ts +4 -5
  71. package/dist/ui-kit/InputRange/InputRange.js +9 -11
  72. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  73. package/dist/ui-kit/InputRange/InputRangeProps.d.ts +2 -4
  74. package/dist/ui-kit/NumberInput/NumberInput.d.ts +8 -0
  75. package/dist/ui-kit/NumberInput/NumberInput.js +22 -0
  76. package/dist/ui-kit/NumberInput/NumberInput.js.map +1 -0
  77. package/dist/ui-kit/PhoneInput/PhoneInput.d.ts +1 -1
  78. package/dist/ui-kit/PhoneInput/PhoneInput.js +2 -2
  79. package/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  80. package/dist/ui-kit/SearchDialog/SearchDialog.js +1 -1
  81. package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  82. package/dist/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.js +5 -3
  83. package/dist/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.js.map +1 -1
  84. package/dist/utils/identity.d.ts +1 -0
  85. package/dist/utils/identity.js +5 -0
  86. package/dist/utils/identity.js.map +1 -0
  87. package/dist/utils/toLocalNumberFormat.d.ts +1 -0
  88. package/dist/utils/toLocalNumberFormat.js +8 -0
  89. package/dist/utils/toLocalNumberFormat.js.map +1 -0
  90. package/lib/common.css +1 -1
  91. package/lib/components/ApplicationForm/ApplicationFormDeposit.js +1 -1
  92. package/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  93. package/lib/components/ApplicationForm/renderAcquiringDataOrganization.js +1 -1
  94. package/lib/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  95. package/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js +1 -1
  96. package/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +1 -1
  97. package/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  98. package/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  99. package/lib/components/ApplicationForm/renderWedDataOrganization.js +1 -1
  100. package/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  101. package/lib/components/Calculator/CalculatorValueBlock.js +2 -2
  102. package/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
  103. package/lib/components/Calculator/renderInitialFeeInput.js +3 -3
  104. package/lib/components/Calculator/renderInitialFeeInput.js.map +1 -1
  105. package/lib/components/Calculator/renderProposal.js +2 -2
  106. package/lib/components/Calculator/renderProposal.js.map +1 -1
  107. package/lib/components/Calculator/renderRealEstateValue.js +2 -2
  108. package/lib/components/Calculator/renderRealEstateValue.js.map +1 -1
  109. package/lib/components/Calculator/renderWantedSumInput.js +3 -3
  110. package/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
  111. package/lib/components/CardTransfer/CardTransfer.js +10 -8
  112. package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  113. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.d.ts +1 -0
  114. package/lib/components/CarouselCatalogCard/CarouselCatalogCard.fixture.d.ts +1 -0
  115. package/lib/components/CarouselEventCard/CarouselEventCard.fixture.d.ts +1 -0
  116. package/lib/components/CarouselLinks/CarouselLinks.fixture.d.ts +1 -0
  117. package/lib/components/CarouselProductCard/CarouselProductCard.fixture.d.ts +1 -0
  118. package/lib/components/CarouselProgramsCard/CarouselProgramsCard.fixture.d.ts +1 -0
  119. package/lib/components/CarouselRichTextCard/CarouselRichTextCard.fixture.d.ts +1 -0
  120. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.d.ts +1 -0
  121. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.d.ts +1 -0
  122. package/lib/components/ContentPage/ContentPage.page.json +0 -1
  123. package/lib/components/Filtration/Filtration.fixture.d.ts +1 -0
  124. package/lib/components/Filtration/Filtration.js +1 -1
  125. package/lib/components/Filtration/Filtration.js.map +1 -1
  126. package/lib/components/Filtration/FiltrationContent.d.ts +2 -6
  127. package/lib/components/Filtration/renderFormItem.js.map +1 -1
  128. package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +2 -2
  129. package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
  130. package/lib/components/OfficeMap/OfficeMap.js +2 -2
  131. package/lib/components/OfficeMap/OfficeMap.js.map +1 -1
  132. package/lib/components/OfficeMap/useOfficeMap.d.ts +2 -0
  133. package/lib/components/OfficeMap/useOfficeMap.js +1 -2
  134. package/lib/components/OfficeMap/useOfficeMap.js.map +1 -1
  135. package/lib/components/PictureText/PictureText.js +2 -2
  136. package/lib/components/PictureText/PictureText.js.map +1 -1
  137. package/lib/components/RollupItem/RollupItem.fixture.d.ts +1 -0
  138. package/lib/components/RollupItem/RollupItem.fixture.mobile.d.ts +1 -0
  139. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +1 -0
  140. package/lib/components/Video/Video.fixture.d.ts +1 -0
  141. package/lib/hooks/useForm.d.ts +8 -4
  142. package/lib/hooks/useForm.js +5 -3
  143. package/lib/hooks/useForm.js.map +1 -1
  144. package/lib/hooks/useNormalizedInput.d.ts +11 -0
  145. package/lib/hooks/useNormalizedInput.js +20 -0
  146. package/lib/hooks/useNormalizedInput.js.map +1 -0
  147. package/lib/hooks/useSWRResource.js +2 -1
  148. package/lib/hooks/useSWRResource.js.map +1 -1
  149. package/lib/services/search/useSearch.js +3 -2
  150. package/lib/services/search/useSearch.js.map +1 -1
  151. package/lib/ui-kit/ControlProps.d.ts +1 -1
  152. package/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +2 -2
  153. package/lib/ui-kit/CurrencyInput/CurrencyInput.js +3 -16
  154. package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  155. package/lib/ui-kit/Heading/Heading.fixture.d.ts +1 -0
  156. package/lib/ui-kit/Heading/Heading.fixture.mobile.d.ts +1 -0
  157. package/lib/ui-kit/Input/Input.d.ts +1 -1
  158. package/lib/ui-kit/Input/Input.js +3 -2
  159. package/lib/ui-kit/Input/Input.js.map +1 -1
  160. package/lib/ui-kit/Input/InputProps.d.ts +4 -5
  161. package/lib/ui-kit/InputRange/InputRange.js +10 -12
  162. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  163. package/lib/ui-kit/InputRange/InputRangeProps.d.ts +2 -4
  164. package/lib/ui-kit/LinkButton/LinkButton.fixture.d.ts +1 -0
  165. package/lib/ui-kit/NumberInput/NumberInput.d.ts +8 -0
  166. package/lib/ui-kit/NumberInput/NumberInput.fixture.d.ts +7 -0
  167. package/lib/ui-kit/NumberInput/NumberInput.js +20 -0
  168. package/lib/ui-kit/NumberInput/NumberInput.js.map +1 -0
  169. package/lib/ui-kit/PhoneInput/PhoneInput.d.ts +1 -1
  170. package/lib/ui-kit/PhoneInput/PhoneInput.js +2 -2
  171. package/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  172. package/lib/ui-kit/RichText/RichText.fixture.d.ts +1 -0
  173. package/lib/ui-kit/SearchDialog/SearchDialog.js +1 -1
  174. package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  175. package/lib/ui-kit/Select/Select.fixture.d.ts +1 -0
  176. package/lib/ui-kit/SlideCheckbox/SlideCheckbox.fixture.d.ts +1 -0
  177. package/lib/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.js +5 -3
  178. package/lib/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.js.map +1 -1
  179. package/lib/ui-kit/Tags/Tags.fixture.d.ts +1 -0
  180. package/lib/utils/identity.d.ts +1 -0
  181. package/lib/utils/identity.js +2 -0
  182. package/lib/utils/identity.js.map +1 -0
  183. package/lib/utils/toLocalNumberFormat.d.ts +1 -0
  184. package/lib/utils/toLocalNumberFormat.js +5 -0
  185. package/lib/utils/toLocalNumberFormat.js.map +1 -0
  186. package/mobile/bundle/bundle.umd.js +44 -39
  187. package/mobile/bundle/bundle.umd.min.js +1 -1
  188. package/mobile/bundle/components/Filtration/FiltrationContent.d.ts +2 -6
  189. package/mobile/bundle/components/OfficeMap/useOfficeMap.d.ts +2 -0
  190. package/mobile/bundle/hooks/useForm.d.ts +8 -4
  191. package/mobile/bundle/hooks/useNormalizedInput.d.ts +11 -0
  192. package/mobile/bundle/ui-kit/ControlProps.d.ts +1 -1
  193. package/mobile/bundle/ui-kit/CurrencyInput/CurrencyInput.d.ts +2 -2
  194. package/mobile/bundle/ui-kit/Input/Input.d.ts +1 -1
  195. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +4 -5
  196. package/mobile/bundle/ui-kit/InputRange/InputRangeProps.d.ts +2 -4
  197. package/mobile/bundle/ui-kit/NumberInput/NumberInput.d.ts +8 -0
  198. package/mobile/bundle/ui-kit/PhoneInput/PhoneInput.d.ts +1 -1
  199. package/mobile/bundle/utils/identity.d.ts +1 -0
  200. package/mobile/bundle/utils/toLocalNumberFormat.d.ts +1 -0
  201. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js +1 -1
  202. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  203. package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.js +1 -1
  204. package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  205. package/mobile/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js +1 -1
  206. package/mobile/dist/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +1 -1
  207. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  208. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  209. package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js +1 -1
  210. package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  211. package/mobile/dist/components/Calculator/CalculatorValueBlock.js +2 -2
  212. package/mobile/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
  213. package/mobile/dist/components/Calculator/renderInitialFeeInput.js +3 -3
  214. package/mobile/dist/components/Calculator/renderInitialFeeInput.js.map +1 -1
  215. package/mobile/dist/components/Calculator/renderProposal.js +2 -2
  216. package/mobile/dist/components/Calculator/renderProposal.js.map +1 -1
  217. package/mobile/dist/components/Calculator/renderRealEstateValue.js +2 -2
  218. package/mobile/dist/components/Calculator/renderRealEstateValue.js.map +1 -1
  219. package/mobile/dist/components/Calculator/renderWantedSumInput.js +3 -3
  220. package/mobile/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
  221. package/mobile/dist/components/CardTransfer/CardTransfer.js +10 -8
  222. package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  223. package/mobile/dist/components/ContentPage/ContentPage.page.json +0 -1
  224. package/mobile/dist/components/Filtration/Filtration.js +1 -1
  225. package/mobile/dist/components/Filtration/Filtration.js.map +1 -1
  226. package/mobile/dist/components/Filtration/FiltrationContent.d.ts +2 -6
  227. package/mobile/dist/components/Filtration/renderFormItem.js.map +1 -1
  228. package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +2 -2
  229. package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
  230. package/mobile/dist/components/OfficeMap/OfficeMap.js +2 -2
  231. package/mobile/dist/components/OfficeMap/OfficeMap.js.map +1 -1
  232. package/mobile/dist/components/OfficeMap/useOfficeMap.d.ts +2 -0
  233. package/mobile/dist/components/OfficeMap/useOfficeMap.js +1 -2
  234. package/mobile/dist/components/OfficeMap/useOfficeMap.js.map +1 -1
  235. package/mobile/dist/components/PictureText/PictureText.js +2 -2
  236. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  237. package/mobile/dist/hooks/useForm.d.ts +8 -4
  238. package/mobile/dist/hooks/useForm.js +5 -3
  239. package/mobile/dist/hooks/useForm.js.map +1 -1
  240. package/mobile/dist/hooks/useNormalizedInput.d.ts +11 -0
  241. package/mobile/dist/hooks/useNormalizedInput.js +23 -0
  242. package/mobile/dist/hooks/useNormalizedInput.js.map +1 -0
  243. package/mobile/dist/hooks/useSWRResource.js +2 -1
  244. package/mobile/dist/hooks/useSWRResource.js.map +1 -1
  245. package/mobile/dist/services/search/useSearch.js +3 -2
  246. package/mobile/dist/services/search/useSearch.js.map +1 -1
  247. package/mobile/dist/ui-kit/ControlProps.d.ts +1 -1
  248. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +2 -2
  249. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +3 -16
  250. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  251. package/mobile/dist/ui-kit/Input/Input.d.ts +1 -1
  252. package/mobile/dist/ui-kit/Input/Input.js +3 -2
  253. package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
  254. package/mobile/dist/ui-kit/Input/InputProps.d.ts +4 -5
  255. package/mobile/dist/ui-kit/InputRange/InputRange.js +9 -11
  256. package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  257. package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +2 -4
  258. package/mobile/dist/ui-kit/NumberInput/NumberInput.d.ts +8 -0
  259. package/mobile/dist/ui-kit/NumberInput/NumberInput.js +22 -0
  260. package/mobile/dist/ui-kit/NumberInput/NumberInput.js.map +1 -0
  261. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.d.ts +1 -1
  262. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js +2 -2
  263. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  264. package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js +1 -1
  265. package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  266. package/mobile/dist/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.js +5 -3
  267. package/mobile/dist/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.js.map +1 -1
  268. package/mobile/dist/utils/identity.d.ts +1 -0
  269. package/mobile/dist/utils/identity.js +5 -0
  270. package/mobile/dist/utils/identity.js.map +1 -0
  271. package/mobile/dist/utils/toLocalNumberFormat.d.ts +1 -0
  272. package/mobile/dist/utils/toLocalNumberFormat.js +8 -0
  273. package/mobile/dist/utils/toLocalNumberFormat.js.map +1 -0
  274. package/mobile/lib/common.css +1 -1
  275. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js +1 -1
  276. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  277. package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.js +1 -1
  278. package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.js.map +1 -1
  279. package/mobile/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js +1 -1
  280. package/mobile/lib/components/ApplicationForm/renderBusinessCardDataOrganization.js.map +1 -1
  281. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  282. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  283. package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js +1 -1
  284. package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
  285. package/mobile/lib/components/Calculator/CalculatorValueBlock.js +2 -2
  286. package/mobile/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
  287. package/mobile/lib/components/Calculator/renderInitialFeeInput.js +3 -3
  288. package/mobile/lib/components/Calculator/renderInitialFeeInput.js.map +1 -1
  289. package/mobile/lib/components/Calculator/renderProposal.js +2 -2
  290. package/mobile/lib/components/Calculator/renderProposal.js.map +1 -1
  291. package/mobile/lib/components/Calculator/renderRealEstateValue.js +2 -2
  292. package/mobile/lib/components/Calculator/renderRealEstateValue.js.map +1 -1
  293. package/mobile/lib/components/Calculator/renderWantedSumInput.js +3 -3
  294. package/mobile/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
  295. package/mobile/lib/components/CardTransfer/CardTransfer.js +10 -8
  296. package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  297. package/mobile/lib/components/ContentPage/ContentPage.page.json +0 -1
  298. package/mobile/lib/components/Filtration/Filtration.js +1 -1
  299. package/mobile/lib/components/Filtration/Filtration.js.map +1 -1
  300. package/mobile/lib/components/Filtration/FiltrationContent.d.ts +2 -6
  301. package/mobile/lib/components/Filtration/renderFormItem.js.map +1 -1
  302. package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +2 -2
  303. package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
  304. package/mobile/lib/components/OfficeMap/OfficeMap.js +2 -2
  305. package/mobile/lib/components/OfficeMap/OfficeMap.js.map +1 -1
  306. package/mobile/lib/components/OfficeMap/useOfficeMap.d.ts +2 -0
  307. package/mobile/lib/components/OfficeMap/useOfficeMap.js +1 -2
  308. package/mobile/lib/components/OfficeMap/useOfficeMap.js.map +1 -1
  309. package/mobile/lib/components/PictureText/PictureText.js +2 -2
  310. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  311. package/mobile/lib/hooks/useForm.d.ts +8 -4
  312. package/mobile/lib/hooks/useForm.js +5 -3
  313. package/mobile/lib/hooks/useForm.js.map +1 -1
  314. package/mobile/lib/hooks/useNormalizedInput.d.ts +11 -0
  315. package/mobile/lib/hooks/useNormalizedInput.js +20 -0
  316. package/mobile/lib/hooks/useNormalizedInput.js.map +1 -0
  317. package/mobile/lib/hooks/useSWRResource.js +2 -1
  318. package/mobile/lib/hooks/useSWRResource.js.map +1 -1
  319. package/mobile/lib/services/search/useSearch.js +3 -2
  320. package/mobile/lib/services/search/useSearch.js.map +1 -1
  321. package/mobile/lib/ui-kit/ControlProps.d.ts +1 -1
  322. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +2 -2
  323. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +3 -16
  324. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  325. package/mobile/lib/ui-kit/Input/Input.d.ts +1 -1
  326. package/mobile/lib/ui-kit/Input/Input.js +3 -2
  327. package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
  328. package/mobile/lib/ui-kit/Input/InputProps.d.ts +4 -5
  329. package/mobile/lib/ui-kit/InputRange/InputRange.js +10 -12
  330. package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  331. package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +2 -4
  332. package/mobile/lib/ui-kit/NumberInput/NumberInput.d.ts +8 -0
  333. package/mobile/lib/ui-kit/NumberInput/NumberInput.js +20 -0
  334. package/mobile/lib/ui-kit/NumberInput/NumberInput.js.map +1 -0
  335. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.d.ts +1 -1
  336. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js +2 -2
  337. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  338. package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js +1 -1
  339. package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  340. package/mobile/lib/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.js +5 -3
  341. package/mobile/lib/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.js.map +1 -1
  342. package/mobile/lib/utils/identity.d.ts +1 -0
  343. package/mobile/lib/utils/identity.js +2 -0
  344. package/mobile/lib/utils/identity.js.map +1 -0
  345. package/mobile/lib/utils/toLocalNumberFormat.d.ts +1 -0
  346. package/mobile/lib/utils/toLocalNumberFormat.js +5 -0
  347. package/mobile/lib/utils/toLocalNumberFormat.js.map +1 -0
  348. package/mobile/src/components/ApplicationForm/ApplicationFormDeposit.tsx +2 -2
  349. package/mobile/src/components/ApplicationForm/renderAcquiringDataOrganization.tsx +4 -4
  350. package/mobile/src/components/ApplicationForm/renderBusinessCardDataOrganization.tsx +4 -4
  351. package/mobile/src/components/ApplicationForm/renderCreditDataOrganization.tsx +6 -10
  352. package/mobile/src/components/ApplicationForm/renderWedDataOrganization.tsx +4 -4
  353. package/mobile/src/components/Calculator/CalculatorValueBlock.tsx +2 -2
  354. package/mobile/src/components/Calculator/renderInitialFeeInput.tsx +3 -3
  355. package/mobile/src/components/Calculator/renderProposal.tsx +2 -2
  356. package/mobile/src/components/Calculator/renderRealEstateValue.tsx +2 -2
  357. package/mobile/src/components/Calculator/renderWantedSumInput.tsx +3 -3
  358. package/mobile/src/components/CardTransfer/CardTransfer.tsx +16 -12
  359. package/mobile/src/components/ContentPage/ContentPage.page.json +0 -1
  360. package/mobile/src/components/Filtration/Filtration.tsx +1 -1
  361. package/mobile/src/components/Filtration/FiltrationContent.ts +2 -7
  362. package/mobile/src/components/Filtration/renderFormItem.tsx +1 -1
  363. package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +2 -2
  364. package/mobile/src/components/OfficeMap/OfficeMap.tsx +2 -2
  365. package/mobile/src/components/OfficeMap/useOfficeMap.ts +1 -3
  366. package/mobile/src/components/PictureText/PictureText.tsx +2 -2
  367. package/mobile/src/hooks/useForm.ts +16 -8
  368. package/mobile/src/hooks/useNormalizedInput.ts +33 -0
  369. package/mobile/src/hooks/useSWRResource.ts +3 -1
  370. package/mobile/src/services/search/useSearch.ts +3 -2
  371. package/mobile/src/ui-kit/ControlProps.ts +1 -1
  372. package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +12 -38
  373. package/mobile/src/ui-kit/Input/Input.tsx +33 -16
  374. package/mobile/src/ui-kit/Input/InputProps.ts +4 -5
  375. package/mobile/src/ui-kit/InputRange/InputRange.tsx +43 -49
  376. package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +2 -4
  377. package/mobile/src/ui-kit/NumberInput/NumberInput.tsx +35 -0
  378. package/mobile/src/ui-kit/PhoneInput/PhoneInput.tsx +2 -3
  379. package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +1 -1
  380. package/mobile/src/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.tsx +9 -5
  381. package/mobile/src/utils/identity.ts +1 -0
  382. package/mobile/src/utils/toLocalNumberFormat.ts +7 -0
  383. package/package.json +3 -3
  384. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +1 -0
  385. package/src/components/ApplicationForm/ApplicationFormDeposit.tsx +2 -2
  386. package/src/components/ApplicationForm/renderAcquiringDataOrganization.tsx +4 -4
  387. package/src/components/ApplicationForm/renderBusinessCardDataOrganization.tsx +4 -4
  388. package/src/components/ApplicationForm/renderCreditDataOrganization.tsx +6 -10
  389. package/src/components/ApplicationForm/renderWedDataOrganization.tsx +4 -4
  390. package/src/components/Bonus/Bonus.fixture.tsx +2 -1
  391. package/src/components/BusinessBlock/BusinessBlock.fixture.tsx +1 -0
  392. package/src/components/ButtonBlock/ButtonBlock.fixture.tsx +1 -0
  393. package/src/components/Calculator/Calculator.fixture.tsx +1 -1
  394. package/src/components/Calculator/CalculatorValueBlock.tsx +2 -2
  395. package/src/components/Calculator/renderInitialFeeInput.tsx +3 -3
  396. package/src/components/Calculator/renderProposal.tsx +2 -2
  397. package/src/components/Calculator/renderRealEstateValue.tsx +2 -2
  398. package/src/components/Calculator/renderWantedSumInput.tsx +3 -3
  399. package/src/components/CardTransfer/CardTransfer.fixture.tsx +1 -0
  400. package/src/components/CardTransfer/CardTransfer.tsx +16 -12
  401. package/src/components/Carousel/Carousel.fixture.mobile.tsx +2 -1
  402. package/src/components/Carousel/Carousel.fixture.tsx +2 -1
  403. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.tsx +2 -0
  404. package/src/components/CarouselCard/CarouselCard.fixture.tsx +1 -0
  405. package/src/components/CarouselCatalogCard/CarouselCatalogCard.fixture.tsx +2 -0
  406. package/src/components/CarouselEventCard/CarouselEventCard.fixture.tsx +3 -1
  407. package/src/components/CarouselInvestmentCard/CarouselInvestmentCard.fixture.tsx +2 -1
  408. package/src/components/CarouselLinks/CarouselLinks.fixture.tsx +2 -0
  409. package/src/components/CarouselProductCard/CarouselProductCard.fixture.tsx +2 -0
  410. package/src/components/CarouselProgramsCard/CarouselProgramsCard.fixture.tsx +2 -0
  411. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx +2 -1
  412. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +2 -1
  413. package/src/components/CarouselRichTextCard/CarouselRichTextCard.fixture.tsx +2 -0
  414. package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.tsx +2 -0
  415. package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +2 -0
  416. package/src/components/ComparisonTable/ComparisonTable.fixture.mobile.tsx +2 -1
  417. package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +2 -1
  418. package/src/components/ContactsBlock/ContactsBlock.fixture.tsx +2 -7
  419. package/src/components/ContentPage/ContentPage.page.json +0 -1
  420. package/src/components/ErrorBlock/ErrorBlock.fixture.tsx +2 -1
  421. package/src/components/ExchangeRateOffice/ExchangeRateOffice.fixture.tsx +1 -0
  422. package/src/components/Filtration/Filtration.fixture.tsx +2 -0
  423. package/src/components/Filtration/Filtration.tsx +1 -1
  424. package/src/components/Filtration/FiltrationContent.ts +2 -7
  425. package/src/components/Filtration/renderFormItem.tsx +1 -1
  426. package/src/components/Footer/Footer.fixture.mobile.tsx +1 -0
  427. package/src/components/Footer/Footer.fixture.tsx +1 -0
  428. package/src/components/Header/Header.fixture.mobile.tsx +1 -0
  429. package/src/components/Header/Header.fixture.tsx +1 -0
  430. package/src/components/Headline/Headline.fixture.mobile.tsx +2 -1
  431. package/src/components/Headline/Headline.fixture.tsx +2 -1
  432. package/src/components/HorizontalLayout/HorizontalLayout.fixture.tsx +2 -1
  433. package/src/components/ImgBlock/ImgBlock.fixture.mobile.tsx +2 -1
  434. package/src/components/ImgBlock/ImgBlock.fixture.tsx +2 -1
  435. package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.fixture.tsx +1 -0
  436. package/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +2 -2
  437. package/src/components/InvestmentInfo/InvestmentInfo.fixture.tsx +1 -0
  438. package/src/components/LinkDocs/LinkDocs.fixture.mobile.tsx +1 -0
  439. package/src/components/LinkDocs/LinkDocs.fixture.tsx +1 -0
  440. package/src/components/LinkList/LinkList.fixture.tsx +1 -0
  441. package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +2 -1
  442. package/src/components/OfficeMap/OfficeMap.fixture.tsx +1 -0
  443. package/src/components/OfficeMap/OfficeMap.tsx +2 -2
  444. package/src/components/OfficeMap/useOfficeMap.ts +1 -3
  445. package/src/components/OfficeServicesBlock/OfficeServicesBlock.fixture.tsx +1 -0
  446. package/src/components/ParagraphBlock/ParagraphBlock.fixture.tsx +1 -0
  447. package/src/components/PictureText/PictureText.fixture.tsx +2 -1
  448. package/src/components/PictureText/PictureText.tsx +2 -2
  449. package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +2 -1
  450. package/src/components/ProductBlock/ProductBlock.fixture.tsx +2 -1
  451. package/src/components/ProductGallery/ProductGallery.fixture.tsx +2 -1
  452. package/src/components/ProductTile/ProductTile.fixture.tsx +2 -1
  453. package/src/components/PromoTile/PromoTile.fixture.tsx +1 -0
  454. package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.fixture.tsx +1 -0
  455. package/src/components/RichTextBlock/RichTextBlock.fixture.mobile.tsx +1 -0
  456. package/src/components/RichTextBlock/RichTextBlock.fixture.tsx +1 -0
  457. package/src/components/RollupItem/RollupItem.fixture.mobile.tsx +2 -1
  458. package/src/components/RollupItem/RollupItem.fixture.tsx +2 -0
  459. package/src/components/SafeDepositRental/SafeDepositRental.fixture.tsx +1 -0
  460. package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +1 -0
  461. package/src/components/StepsBlock/StepsBlock.fixture.tsx +1 -0
  462. package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +2 -0
  463. package/src/components/Tabs/Tabs.fixture.tsx +1 -0
  464. package/src/components/TariffsTable/TariffsTable.fixture.mobile.tsx +1 -0
  465. package/src/components/TariffsTable/TariffsTable.fixture.tsx +1 -0
  466. package/src/components/TextBlock/TextBlock.fixture.mobile.tsx +2 -1
  467. package/src/components/TextBlock/TextBlock.fixture.tsx +2 -1
  468. package/src/components/Tile/Tile.fixture.tsx +2 -1
  469. package/src/components/VerticalLayout/VerticalLayout.fixture.mobile.tsx +2 -1
  470. package/src/components/VerticalLayout/VerticalLayout.fixture.tsx +2 -1
  471. package/src/components/Video/Video.fixture.tsx +2 -0
  472. package/src/hooks/useForm.ts +16 -8
  473. package/src/hooks/useNormalizedInput.ts +33 -0
  474. package/src/hooks/useSWRResource.ts +3 -1
  475. package/src/services/search/useSearch.ts +3 -2
  476. package/src/ui-kit/Button/Button.fixture.tsx +1 -0
  477. package/src/ui-kit/ControlProps.ts +1 -1
  478. package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +12 -38
  479. package/src/ui-kit/Heading/Heading.fixture.mobile.tsx +2 -0
  480. package/src/ui-kit/Heading/Heading.fixture.tsx +2 -0
  481. package/src/ui-kit/Icon/Icon.fixture.tsx +2 -1
  482. package/src/ui-kit/Input/Input.tsx +33 -16
  483. package/src/ui-kit/Input/InputProps.ts +4 -5
  484. package/src/ui-kit/InputRange/InputRange.tsx +43 -49
  485. package/src/ui-kit/InputRange/InputRangeProps.ts +2 -4
  486. package/src/ui-kit/LinkButton/LinkButton.fixture.tsx +2 -0
  487. package/src/ui-kit/List/List.fixture.tsx +1 -0
  488. package/src/ui-kit/LocationDialog/LocationDialog.fixture.tsx +2 -1
  489. package/src/ui-kit/NumberInput/NumberInput.fixture.tsx +31 -0
  490. package/src/ui-kit/NumberInput/NumberInput.tsx +35 -0
  491. package/src/ui-kit/PhoneInput/PhoneInput.tsx +2 -3
  492. package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.fixture.tsx +1 -0
  493. package/src/ui-kit/RichText/RichText.fixture.tsx +2 -0
  494. package/src/ui-kit/SearchDialog/SearchDialog.tsx +1 -1
  495. package/src/ui-kit/Select/Select.fixture.tsx +2 -0
  496. package/src/ui-kit/SlideCheckbox/SlideCheckbox.fixture.tsx +2 -0
  497. package/src/ui-kit/SlideCheckboxGroup/SlideCheckboxGroup.tsx +9 -5
  498. package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +2 -1
  499. package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.tsx +2 -1
  500. package/src/ui-kit/Tags/Tags.fixture.tsx +2 -0
  501. package/src/utils/identity.ts +1 -0
  502. package/src/utils/toLocalNumberFormat.ts +7 -0
  503. package/tailwind.config.cjs +1 -1
  504. package/bundle/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +0 -5
  505. package/bundle/utils/addSpacesBetweenNumbers.d.ts +0 -1
  506. package/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +0 -5
  507. package/dist/ui-kit/CurrencyInput/CurrencyInputProps.js +0 -2
  508. package/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +0 -1
  509. package/dist/utils/addSpacesBetweenNumbers.d.ts +0 -1
  510. package/dist/utils/addSpacesBetweenNumbers.js +0 -5
  511. package/dist/utils/addSpacesBetweenNumbers.js.map +0 -1
  512. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +0 -5
  513. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +0 -2
  514. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +0 -1
  515. package/lib/utils/addSpacesBetweenNumbers.d.ts +0 -1
  516. package/lib/utils/addSpacesBetweenNumbers.js +0 -2
  517. package/lib/utils/addSpacesBetweenNumbers.js.map +0 -1
  518. package/mobile/bundle/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +0 -5
  519. package/mobile/bundle/utils/addSpacesBetweenNumbers.d.ts +0 -1
  520. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +0 -5
  521. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.js +0 -2
  522. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +0 -1
  523. package/mobile/dist/utils/addSpacesBetweenNumbers.d.ts +0 -1
  524. package/mobile/dist/utils/addSpacesBetweenNumbers.js +0 -5
  525. package/mobile/dist/utils/addSpacesBetweenNumbers.js.map +0 -1
  526. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +0 -5
  527. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +0 -2
  528. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +0 -1
  529. package/mobile/lib/utils/addSpacesBetweenNumbers.d.ts +0 -1
  530. package/mobile/lib/utils/addSpacesBetweenNumbers.js +0 -2
  531. package/mobile/lib/utils/addSpacesBetweenNumbers.js.map +0 -1
  532. package/mobile/src/components/Gallery/Gallery.ui.json +0 -1
  533. package/mobile/src/components/MiniGallery/MiniGallery.ui.json +0 -1
  534. package/mobile/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +0 -6
  535. package/mobile/src/utils/addSpacesBetweenNumbers.ts +0 -2
  536. package/src/components/Gallery/Gallery.ui.json +0 -1
  537. package/src/components/MiniGallery/MiniGallery.ui.json +0 -1
  538. package/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +0 -6
  539. package/src/utils/addSpacesBetweenNumbers.ts +0 -2
@@ -1,5 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useForm } from '../../hooks/useForm';
3
3
  import { useLink } from '../../hooks/useLink';
4
4
  import type { UniBlockProps } from '../../model/JSXBlock';
5
5
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
@@ -7,15 +7,19 @@ import { getDisabledButtonClasses } from '../../ui-kit/Button/getDisabledButtonC
7
7
  import { getRegularButtonClasses } from '../../ui-kit/Button/getRegularButtonClasses';
8
8
  import { CurrencyInput } from '../../ui-kit/CurrencyInput/CurrencyInput';
9
9
  import { Heading } from '../../ui-kit/Heading/Heading';
10
- import { getSanitizedValue } from '../../utils/getSanitizedValue';
10
+ import { style } from '../../utils/style';
11
11
  import type { CardTransferContent } from './CardTransferContent';
12
12
 
13
- const AMOUNT_KEY = 'amount';
14
- const FORM_URL = 'https://www.rshb.ru/p2p/';
15
13
  const DEFAULT_TITLE = 'Укажите сумму перевода';
16
14
  const DEFAULT_LABEL = 'Сумма перевода';
17
15
  const DEFAULT_PLACEHOLDER = '1500';
18
16
 
17
+ const FORM_URL = 'https://www.rshb.ru/p2p/';
18
+ const AMOUNT_KEY = 'amount';
19
+ const INITIAL_FORM_STATE = {
20
+ [AMOUNT_KEY]: 1500,
21
+ };
22
+
19
23
  export interface CardTransferProps extends CardTransferContent, UniBlockProps {}
20
24
 
21
25
  export const CardTransfer = JSX<CardTransferProps>(
@@ -27,9 +31,10 @@ export const CardTransfer = JSX<CardTransferProps>(
27
31
  button,
28
32
  ...rest
29
33
  }) => {
30
- const [value, setValue] = useState<string>('');
31
- const handleChange = useCallback((_: string) => setValue(_), []);
32
- const isDisabled = !Number(getSanitizedValue(value));
34
+ const [{ amount }, { field }] = useForm(INITIAL_FORM_STATE);
35
+
36
+ const isDisabled = amount <= 0;
37
+
33
38
  const buttonStyle = isDisabled
34
39
  ? getDisabledButtonClasses({ version: button?.version })
35
40
  : getRegularButtonClasses({ className: 'text-white', version: button?.version });
@@ -37,21 +42,20 @@ export const CardTransfer = JSX<CardTransferProps>(
37
42
  const link = useLink();
38
43
 
39
44
  return (
40
- <BlockWrapper className={`p-default flex flex-col items-center ${className}`} {...rest}>
45
+ <BlockWrapper className={style('p-default flex flex-col items-center', className)} {...rest}>
41
46
  {title ? <Heading className="max-w-[684px] pb-9" headingType="h2" title={title} /> : null}
42
47
  <form className="w-[468px]" method="POST" action={FORM_URL}>
43
48
  <CurrencyInput
44
49
  name={AMOUNT_KEY}
45
- value={value}
46
- onChange={handleChange}
47
- valid={value === '' || !isDisabled}
50
+ valid={!isDisabled}
48
51
  placeholder={placeholder}
49
52
  label={label}
53
+ {...field(AMOUNT_KEY, { parse: Number, format: String })}
50
54
  />
51
55
  {button?.text ? (
52
56
  <button
53
57
  type="submit"
54
- className={`w-full p-4 mt-6 ${buttonStyle} `}
58
+ className={style('w-full p-4 mt-6', buttonStyle)}
55
59
  disabled={isDisabled}
56
60
  {...link(button)}
57
61
  >
@@ -17,7 +17,6 @@
17
17
  "jsonLd": "json",
18
18
  "date": "2022-04-08",
19
19
  "style": ["bg-main-divider"],
20
- "likeControl": true,
21
20
  "slots": {
22
21
  "header": [
23
22
  {
@@ -24,7 +24,7 @@ export const Filtration: JSXBlock<FiltrationProps> = JSX<FiltrationProps>(
24
24
  </div>
25
25
  {resetButton ? (
26
26
  <div>
27
- <Button className="w-72" onClick={reset} {...resetButton} />
27
+ <Button className="w-72 ml-3" onClick={reset} {...resetButton} />
28
28
  </div>
29
29
  ) : null}
30
30
  </form>
@@ -46,7 +46,6 @@ export type StringArray = {
46
46
  };
47
47
  };
48
48
 
49
- // TODO: Make customizable to implement arbitrary filtration blocks
50
49
  export type FiltrationSchema = {
51
50
  /** @title Тип недвижимости */
52
51
  propertyType?: StringArray;
@@ -62,13 +61,9 @@ export type FiltrationSchema = {
62
61
  * @title Кнопка сброса
63
62
  */
64
63
  export type ResetButton = {
65
- /**
66
- * @title Текст кнопки
67
- */
64
+ /** @title Текст кнопки */
68
65
  text: string;
69
- /**
70
- * @title Цвет кнопки
71
- */
66
+ /** @title Цвет кнопки */
72
67
  version: ButtonVersion;
73
68
  };
74
69
 
@@ -30,7 +30,7 @@ const renderCheckboxes = (key: string, field: FormFieldRegisterer<any>) => (item
30
30
  </Text>
31
31
  </div>
32
32
  ) : null}
33
- <SlideCheckboxGroup items={options} multiple {...field(key)} />
33
+ <SlideCheckboxGroup items={options} multiple {...field<string, string[] | undefined>(key)} />
34
34
  </div>
35
35
  );
36
36
  };
@@ -5,7 +5,7 @@ import { Button } from '../../ui-kit/Button/Button';
5
5
  import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
6
6
  import { renderArrows } from '../../ui-kit/Button/renderArrows';
7
7
  import { Img } from '../../ui-kit/Img/Img';
8
- import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
8
+ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
9
9
  import type { CardItem, InsuranceAmountBlockTab } from './InsuranceAmountBlockContent';
10
10
 
11
11
  export interface InsuranceAmountBlockInnerProps extends InsuranceAmountBlockTab {
@@ -122,7 +122,7 @@ function renderNavButton({ slide, i, isActive, onClick }: NavButtonProps) {
122
122
  function renderValueBlock(title: string, sum: number) {
123
123
  return (
124
124
  <div className="flex flex-col text-left whitespace-pre">
125
- <span className="text-h6">{addSpacesBetweenNumbers(sum)} ₽</span>
125
+ <span className="text-h6">{toLocalNumberFormat(2)(sum)} ₽</span>
126
126
  <span className="text-secondary-text text-l mt-1">{title}</span>
127
127
  </div>
128
128
  );
@@ -2,17 +2,17 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../model/JSXBlock';
3
3
  import { Icon } from '../../ui-kit/Icon/Icon';
4
4
  import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
5
+ import { OFFICE_MAP } from './mockOfficeMap';
5
6
  import { nearbyOffices } from './nearbyOffices';
6
7
  import type { OfficeMapContent, WorkScheduleWeek } from './OfficeMapContent';
7
8
  import { renderCurrentDaySchedule, renderDay, renderNearbyOffice } from './renderFunctions';
8
- import { useOfficeMap } from './useOfficeMap';
9
9
 
10
10
  export interface OfficeMapProps extends OfficeMapContent, UniBlockProps {}
11
11
  export const OfficeMap = JSX<UniBlockProps>(({ className = '' }) => {
12
12
  // TODO: useOfficeMap endpoint had use /api/v1/branches. This endpoint now is`t correct/
13
13
  // TODO: useOfficeMap has return MOCK OBJECT!
14
14
  // TODO: Fix this when endpoint /api/v1/branches (or new endpoint) had returning right data
15
- const resultOfficeMap = useOfficeMap('000');
15
+ const resultOfficeMap = OFFICE_MAP;
16
16
  const { name, address, gpsLatitude, gpsLongitude, workSchedule } =
17
17
  resultOfficeMap as OfficeMapContent;
18
18
  const {
@@ -12,9 +12,7 @@ export function useOfficeMap(regionCode?: string) {
12
12
  fetchOfficeMap,
13
13
  );
14
14
 
15
- console.warn('Hook useOfficeMap RETURNs MOCK object for testing', data);
16
-
17
- return OFFICE_MAP;
15
+ return data || OFFICE_MAP;
18
16
  }
19
17
 
20
18
  function fetchOfficeMap(url?: string) {
@@ -2,7 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../model/JSXBlock';
3
3
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
4
4
  import { Img } from '../../ui-kit/Img/Img';
5
- import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
5
+ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
6
6
  import { Headline } from '../Headline/Headline';
7
7
  import type { PictureTextContent } from './PictureTextContent';
8
8
  import { renderBenefit } from './renderBenefit';
@@ -54,7 +54,7 @@ function renderValueBlock(title: string, sum = 0, isAnotherBlock = false) {
54
54
  return (
55
55
  <div className={`flex justify-between items-center gap-2 w-full whitespace-pre ${widthStyle}`}>
56
56
  <span className="text-secondary-text text-l-light">{title}</span>
57
- <span className="text-primary-main text-h6">{addSpacesBetweenNumbers(sum)} ₽</span>
57
+ <span className="text-primary-main text-h6">{toLocalNumberFormat(2)(sum)} ₽</span>
58
58
  </div>
59
59
  );
60
60
  }
@@ -1,15 +1,21 @@
1
1
  import { useCallback, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { ControlProps } from '../ui-kit/ControlProps';
2
3
  import type { PreventableEvent } from '../ui-kit/PreventableEvent';
4
+ import { identity } from '../utils/identity';
3
5
 
4
- export interface FieldProps<V> {
5
- value?: V;
6
+ export interface FieldProps<V> extends ControlProps<V> {
6
7
  isDirty?: boolean;
7
- onChange?: (value: V) => void;
8
8
  }
9
9
 
10
- export type FormFieldRegisterer<FormState> = <N extends keyof FormState>(
10
+ type Options<In, Out> = {
11
+ parse?: (_: In) => Out;
12
+ format?: (_: Out) => In;
13
+ };
14
+
15
+ export type FormFieldRegisterer<FormState> = <N extends keyof FormState, V = FormState[N]>(
11
16
  fieldName: N,
12
- ) => FieldProps<FormState[N]>;
17
+ options?: Options<V, FormState[N]>,
18
+ ) => FieldProps<V extends undefined ? FormState[N] : V>;
13
19
 
14
20
  export const useForm = <FormState extends Record<string, any>>(
15
21
  initialState: FormState,
@@ -33,18 +39,20 @@ export const useForm = <FormState extends Record<string, any>>(
33
39
  const handlersMap = useRef<Partial<Record<keyof FormState, (value: any) => void>>>({});
34
40
 
35
41
  const field: FormFieldRegisterer<FormState> = useCallback(
36
- (fieldName) => {
42
+ (fieldName, options) => {
43
+ const { parse = identity, format = identity } = options || {};
44
+
37
45
  if (!handlersMap.current) {
38
46
  handlersMap.current = {};
39
47
  }
40
48
 
41
49
  handlersMap.current[fieldName] ||= (value) => {
42
- setFormState((prev) => ({ ...prev, [fieldName]: value }));
50
+ setFormState((prev) => ({ ...prev, [fieldName]: parse(value) }));
43
51
  setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
44
52
  };
45
53
 
46
54
  return {
47
- value: formState[fieldName],
55
+ value: format(formState[fieldName]) as any,
48
56
  isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
49
57
  onChange: handlersMap.current[fieldName],
50
58
  };
@@ -0,0 +1,33 @@
1
+ import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { InputProps } from '../ui-kit/Input/InputProps';
3
+
4
+ interface UseNormalizedInputOptions<V, R> {
5
+ normalize: (v: V | undefined) => V;
6
+ format?: (v: V | undefined) => R;
7
+ }
8
+
9
+ export const useNormalizedInput = <V, P extends InputProps<V>, R = V>(
10
+ props: P,
11
+ { normalize, format }: UseNormalizedInputOptions<V, R>,
12
+ ) => {
13
+ const { value, onFocus, onBlur, onChange } = props;
14
+
15
+ const [isFocused, setIsFocused] = useState(false);
16
+
17
+ const handleFocus = useCallback((e) => {
18
+ setIsFocused(true);
19
+ onFocus && onFocus(e);
20
+ }, []);
21
+
22
+ const handleBlur = useCallback(() => {
23
+ setIsFocused(false);
24
+ onChange && onChange(normalize(value));
25
+ onBlur && onBlur();
26
+ }, [onChange, value]);
27
+
28
+ return {
29
+ value: (isFocused || !format ? value : format(value)) as R,
30
+ onFocus: handleFocus,
31
+ onBlur: handleBlur,
32
+ };
33
+ };
@@ -2,10 +2,12 @@ import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
2
  import type { Fallback } from '../model/Fallback';
3
3
  import { fetchJSONUnsafe } from '../utils/fetchJSON';
4
4
 
5
+ const EMPTY_VALUE = {};
6
+
5
7
  export function useSWRResource<Data>(filename: string, fallback: Fallback = {}): Data {
6
8
  const { data } = useAsyncData<Data>(`/wcms-resources/${filename}.json`, fetchJSONUnsafe, {
7
9
  fallback,
8
10
  });
9
11
 
10
- return data || ({} as Data);
12
+ return data || (EMPTY_VALUE as Data);
11
13
  }
@@ -6,6 +6,7 @@ import { useDebouncedEffect } from '../../utils/useDebouncedEffect';
6
6
  import { CorpusItem, search, SearchIndex } from './search';
7
7
 
8
8
  const SEARCH_INDEX_FILENAME = 'search.index.json';
9
+ const DEFAULT_BASE_PATH = ['/'];
9
10
 
10
11
  export type SearchResult = Array<CorpusItem[]>; // List of pages (CorpusItem) per base path from "basePathList"
11
12
 
@@ -21,7 +22,7 @@ export interface SearchInputProps {
21
22
  }
22
23
 
23
24
  export const useSearch = ({
24
- basePathList = ['/'],
25
+ basePathList = DEFAULT_BASE_PATH,
25
26
  initialQuery = '',
26
27
  wasOpened,
27
28
  }: SearchParams): [SearchResult | null, SearchInputProps] => {
@@ -35,7 +36,7 @@ export const useSearch = ({
35
36
 
36
37
  const key = useMemo(
37
38
  () => basePathList.map((_) => (wasOpened ? _ : null)), // Load search index on very first search
38
- [wasOpened, ...basePathList],
39
+ [wasOpened, basePathList],
39
40
  );
40
41
 
41
42
  const { data } = useAsyncData(key, fetchSearchIndex);
@@ -1,4 +1,4 @@
1
1
  export interface ControlProps<T> {
2
2
  value?: T;
3
- onChange?: (value: T | undefined) => void;
3
+ onChange?: (value: T) => void;
4
4
  }
@@ -1,39 +1,13 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
- import { clamp } from '../../utils/clamp';
4
- import { Input } from '../Input/Input';
5
- import { adjustValue, localNumberFormat } from './adjustValue';
6
- import type { CurrencyInputProps } from './CurrencyInputProps';
7
-
8
- export const CurrencyInput = JSX<CurrencyInputProps>(
9
- ({ className = '', value = '', onChange, minValue = 0, maxValue = 300000, ...inputProps }) => {
10
- const handleChange = useCallback(
11
- (inputValue: string) => {
12
- const adjustedVal = adjustValue(inputValue);
13
- const clampVal = getClampValue(adjustedVal, clamp(Number(adjustedVal), minValue, maxValue));
14
- onChange && onChange(clampVal);
15
- },
16
- [onChange],
17
- );
18
-
19
- const handleBlur = useCallback(() => {
20
- onChange && onChange(localNumberFormat(value));
21
- }, [onChange, value]);
22
-
23
- return (
24
- <Input
25
- className={className}
26
- inputClassName="w-full"
27
- value={value}
28
- onChange={handleChange}
29
- onBlur={handleBlur}
30
- {...inputProps}
31
- >
32
- <span className="text-xl-light absolute right-4 bottom-4">₽</span>
33
- </Input>
34
- );
35
- },
36
- );
37
-
38
- const getClampValue = (val: string, clampVal: number): string =>
39
- Number(val) === clampVal ? val : String(clampVal);
2
+ import { NumberInput, NumberInputProps } from '../NumberInput/NumberInput';
3
+ import { Text } from '../Text/Text';
4
+
5
+ export const CurrencyInput = JSX<NumberInputProps>((props) => (
6
+ <NumberInput {...props} fractionDigits={2}>
7
+ <div className="absolute right-4 bottom-4">
8
+ <Text size="text-xl" font="font-light">
9
+ ₽
10
+ </Text>
11
+ </div>
12
+ </NumberInput>
13
+ ));
@@ -1,21 +1,26 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { style } from '../../utils/style';
4
+ import { Text } from '../Text/Text';
4
5
  import type { InputProps } from './InputProps';
5
6
 
6
7
  export const Input = JSX<InputProps>(
7
8
  ({
9
+ key,
8
10
  className = '',
9
11
  inputClassName = '',
10
12
  id,
11
13
  name,
12
14
  type = 'text',
13
15
  label,
16
+ placeholder,
14
17
  value = '',
15
18
  valid = true,
16
19
  children,
17
20
  onChange,
18
- ...inputProps
21
+ onFocus,
22
+ onBlur,
23
+ pattern,
19
24
  }) => {
20
25
  const handleChange = useCallback(
21
26
  (e: { target?: { value?: string } }) => {
@@ -31,21 +36,33 @@ export const Input = JSX<InputProps>(
31
36
 
32
37
  return (
33
38
  <div className={style('relative', className)}>
34
- {label ? <label className="block text-m-light mb-2">{label}</label> : null}
35
- <input
36
- className={style(
37
- 'w-full border rounded-md text-primary-text outline-none p-4',
38
- paddingStyle,
39
- validStyle,
40
- inputClassName,
41
- )}
42
- id={id}
43
- name={name || id}
44
- type={type}
45
- value={value}
46
- onInput={handleChange as any}
47
- {...inputProps}
48
- />
39
+ <label>
40
+ {label ? (
41
+ <div className="mb-2">
42
+ <Text size="text-m" font="font-light">
43
+ {label}
44
+ </Text>
45
+ </div>
46
+ ) : null}
47
+ <input
48
+ key={key}
49
+ className={style(
50
+ 'w-full border rounded-md text-primary-text outline-none p-4',
51
+ paddingStyle,
52
+ validStyle,
53
+ inputClassName,
54
+ )}
55
+ id={id}
56
+ name={name || id}
57
+ placeholder={placeholder}
58
+ type={type}
59
+ value={value}
60
+ onInput={handleChange as any}
61
+ onFocus={onFocus}
62
+ onBlur={onBlur}
63
+ pattern={pattern}
64
+ />
65
+ </label>
49
66
  {children}
50
67
  </div>
51
68
  );
@@ -1,7 +1,8 @@
1
1
  import type { LabelProps } from '../../model/HeadlineType';
2
2
  import type { InputTypes } from '../../model/InputTypes';
3
+ import type { ControlProps } from '../ControlProps';
3
4
 
4
- export type InputProps = LabelProps & {
5
+ export interface InputProps<V = string> extends ControlProps<V>, LabelProps {
5
6
  className?: string;
6
7
  inputClassName?: string;
7
8
  id?: string;
@@ -9,10 +10,8 @@ export type InputProps = LabelProps & {
9
10
  type?: InputTypes;
10
11
  placeholder?: string;
11
12
  pattern?: string;
12
- value?: string;
13
- onChange?: (value: string) => void;
14
- onInput?: (event: any) => void;
15
13
  onFocus?: (event: any) => void;
16
14
  onBlur?: () => void;
17
15
  valid?: boolean;
18
- };
16
+ disabled?: boolean;
17
+ }
@@ -1,8 +1,9 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
3
- import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useNormalizedInput } from '../../hooks/useNormalizedInput';
4
4
  import { clamp } from '../../utils/clamp';
5
5
  import { style } from '../../utils/style';
6
+ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
6
7
  import { Text } from '../Text/Text';
7
8
  import type { InputRangeProps } from './InputRangeProps';
8
9
  import { parseDecimal } from './parseDecimal';
@@ -13,8 +14,8 @@ const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
13
14
  const DEFAULT_MIN = 1;
14
15
  const DEFAULT_MAX = 100;
15
16
 
16
- export const InputRange = JSX<InputRangeProps>(
17
- ({
17
+ export const InputRange = JSX<InputRangeProps>((props) => {
18
+ const {
18
19
  className,
19
20
  title,
20
21
  items = [],
@@ -25,54 +26,47 @@ export const InputRange = JSX<InputRangeProps>(
25
26
  value = list[0] || min,
26
27
  disabled = false,
27
28
  onChange,
28
- }) => {
29
- const [isFocused, setFocused] = useState(false);
29
+ } = props;
30
30
 
31
- const handleChange = useCallback(
32
- (e: { target?: { value?: string } }) => {
33
- onChange && onChange(parseDecimal(e.target?.value));
34
- },
35
- [onChange],
36
- );
31
+ const normalizedProps = useNormalizedInput(props, {
32
+ normalize: (_: number | undefined = 0) =>
33
+ list.length ? closestValue(list)(_) : clamp(_, min, max),
34
+ format: toLocalNumberFormat(),
35
+ });
37
36
 
38
- const handleFocus = useCallback(() => {
39
- setFocused(true);
40
- }, []);
37
+ const handleChange = useCallback(
38
+ (e: { target?: { value?: string } }) => {
39
+ onChange && onChange(parseDecimal(e.target?.value));
40
+ },
41
+ [onChange],
42
+ );
41
43
 
42
- const handleBlur = useCallback(() => {
43
- setFocused(false);
44
- onChange && onChange(list.length ? closestValue(list)(value) : clamp(value || 0, min, max));
45
- }, [onChange, value]);
46
-
47
- return (
48
- <div className={className}>
49
- <label className="block relative">
50
- {title ? (
51
- <Text size="text-m" font="font-light" color="text-primary-text">
52
- {title}
53
- </Text>
54
- ) : null}
55
- <input
56
- className={style(
57
- 'm-0 mt-2 font-sans text-h3 w-full h-14',
58
- 'border border-solid border-gray rounded-md outline-none',
59
- 'p-0 pl-4 box-border',
60
- 'text-primary-text hover:border-primary-hover focus:border-primary-text',
61
- DISABLED_INPUT_CLASSES,
62
- )}
63
- value={isFocused ? value : addSpacesBetweenNumbers(value)}
64
- disabled={disabled}
65
- onInput={handleChange as any}
66
- onFocus={handleFocus}
67
- onBlur={handleBlur}
68
- />
69
- {renderRangeWithTicks({ list, min, max, step, disabled, value, onChange })}
70
- </label>
71
- {renderRangeCaption(items)}
72
- </div>
73
- );
74
- },
75
- );
44
+ return (
45
+ <div className={className}>
46
+ <label className="block relative">
47
+ {title ? (
48
+ <Text size="text-m" font="font-light" color="text-primary-text">
49
+ {title}
50
+ </Text>
51
+ ) : null}
52
+ <input
53
+ className={style(
54
+ 'm-0 mt-2 font-sans text-h3 w-full h-14',
55
+ 'border border-solid border-gray rounded-md outline-none',
56
+ 'p-0 pl-4 box-border',
57
+ 'text-primary-text hover:border-primary-hover focus:border-primary-text',
58
+ DISABLED_INPUT_CLASSES,
59
+ )}
60
+ disabled={disabled}
61
+ onInput={handleChange as any}
62
+ {...normalizedProps}
63
+ />
64
+ {renderRangeWithTicks({ list, min, max, step, disabled, value, onChange })}
65
+ </label>
66
+ {renderRangeCaption(items)}
67
+ </div>
68
+ );
69
+ });
76
70
 
77
71
  const closestValue = (list: number[]) => (_: number) =>
78
72
  list.reduce((prev, curr) => (Math.abs(curr - _) < Math.abs(prev - _) ? curr : prev));
@@ -1,14 +1,12 @@
1
+ import type { InputProps } from '../Input/InputProps';
1
2
  import type { ListContent } from '../List/ListContent';
2
3
 
3
- export interface InputRangeProps extends ListContent {
4
- className?: string;
4
+ export interface InputRangeProps extends ListContent, InputProps<number> {
5
5
  items?: string[];
6
6
  min?: number;
7
7
  max?: number;
8
8
  list?: number[];
9
9
  step?: number;
10
- value?: number;
11
10
  title?: string;
12
11
  disabled?: boolean;
13
- onChange?: (value: number) => void;
14
12
  }
@@ -0,0 +1,35 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useNormalizedInput } from '../../hooks/useNormalizedInput';
4
+ import { clamp } from '../../utils/clamp';
5
+ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
6
+ import { Input } from '../Input/Input';
7
+ import type { InputProps } from '../Input/InputProps';
8
+
9
+ export interface NumberInputProps extends InputProps<string> {
10
+ min?: number;
11
+ max?: number;
12
+ defaultValue?: string;
13
+ fractionDigits?: number;
14
+ }
15
+
16
+ export const NumberInput = JSX<NumberInputProps>((props) => {
17
+ const { onChange, min, max, defaultValue = '0', fractionDigits = 0, ...inputProps } = props;
18
+ const normalizedProps = useNormalizedInput(props, {
19
+ normalize: (_: string | undefined = defaultValue) =>
20
+ min && max ? String(clamp(Number(sanitizeNumberStr(_)), min, max)) : sanitizeNumberStr(_),
21
+ format: toLocalNumberFormat(fractionDigits),
22
+ });
23
+
24
+ const handleChange = useCallback(
25
+ (_: string) => onChange && onChange(sanitizeNumberStr(_)),
26
+ [onChange],
27
+ );
28
+
29
+ return <Input onChange={handleChange} {...inputProps} {...normalizedProps} />;
30
+ });
31
+
32
+ const sanitizeNumberStr = (_ = ''): string =>
33
+ _.replaceAll(',', '.')
34
+ .replace(/[^\d.]/g, '')
35
+ .replace(/([^.]*\.[^.]*)\./, '$1');