@redneckz/wildless-cms-uni-blocks 0.10.6 → 0.10.7

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 (473) hide show
  1. package/bundle/bundle.umd.js +198 -266
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/Calculator/Rate.d.ts +1 -0
  4. package/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  5. package/bundle/components/Calculator/renderDaysInput.d.ts +2 -7
  6. package/bundle/components/Calculator/renderInterestPayment.d.ts +2 -9
  7. package/bundle/components/Calculator/renderMonthsInput.d.ts +3 -5
  8. package/bundle/components/Calculator/renderPaymentType.d.ts +2 -11
  9. package/bundle/components/Calculator/renderRegistrationType.d.ts +2 -9
  10. package/bundle/components/Calculator/renderWantedSumInput.d.ts +3 -7
  11. package/bundle/components/Carousel/itemsGap.d.ts +1 -0
  12. package/bundle/components/Carousel/itemsGap.mobile.d.ts +1 -0
  13. package/bundle/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  14. package/bundle/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  15. package/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  16. package/bundle/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  17. package/bundle/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  18. package/bundle/components/Headline/headlineVersionStyles.d.ts +1 -1
  19. package/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  20. package/bundle/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  21. package/bundle/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  22. package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
  23. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  24. package/dist/components/Blocks.mobile.js +4 -0
  25. package/dist/components/Blocks.mobile.js.map +1 -1
  26. package/dist/components/Calculator/BonusCalculatorForm.js +16 -18
  27. package/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  28. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  29. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  30. package/dist/components/Calculator/Calculator.js +4 -4
  31. package/dist/components/Calculator/Calculator.js.map +1 -1
  32. package/dist/components/Calculator/CreditCalculatorForm.js +27 -43
  33. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  34. package/dist/components/Calculator/DepositCalculatorForm.js +30 -33
  35. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  36. package/dist/components/Calculator/Rate.d.ts +1 -0
  37. package/dist/components/Calculator/Rate.js +1 -1
  38. package/dist/components/Calculator/Rate.js.map +1 -1
  39. package/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  40. package/dist/components/Calculator/renderBinaryRadioButtonGroup.js +8 -0
  41. package/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  42. package/dist/components/Calculator/renderDaysInput.d.ts +2 -7
  43. package/dist/components/Calculator/renderDaysInput.js +2 -9
  44. package/dist/components/Calculator/renderDaysInput.js.map +1 -1
  45. package/dist/components/Calculator/renderInterestPayment.d.ts +2 -9
  46. package/dist/components/Calculator/renderInterestPayment.js +8 -18
  47. package/dist/components/Calculator/renderInterestPayment.js.map +1 -1
  48. package/dist/components/Calculator/renderMonthsInput.d.ts +3 -5
  49. package/dist/components/Calculator/renderMonthsInput.js +2 -10
  50. package/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  51. package/dist/components/Calculator/renderPaymentType.d.ts +2 -11
  52. package/dist/components/Calculator/renderPaymentType.js +9 -19
  53. package/dist/components/Calculator/renderPaymentType.js.map +1 -1
  54. package/dist/components/Calculator/renderRegistrationType.d.ts +2 -9
  55. package/dist/components/Calculator/renderRegistrationType.js +8 -18
  56. package/dist/components/Calculator/renderRegistrationType.js.map +1 -1
  57. package/dist/components/Calculator/renderWantedSumInput.d.ts +3 -7
  58. package/dist/components/Calculator/renderWantedSumInput.js +4 -6
  59. package/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
  60. package/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
  61. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  62. package/dist/components/Carousel/Carousel.js +3 -3
  63. package/dist/components/Carousel/Carousel.js.map +1 -1
  64. package/dist/components/Carousel/itemsGap.d.ts +1 -0
  65. package/dist/components/Carousel/itemsGap.js +4 -0
  66. package/dist/components/Carousel/itemsGap.js.map +1 -0
  67. package/dist/components/Carousel/itemsGap.mobile.d.ts +1 -0
  68. package/dist/components/Carousel/itemsGap.mobile.js +4 -0
  69. package/dist/components/Carousel/itemsGap.mobile.js.map +1 -0
  70. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -10
  71. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  72. package/dist/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  73. package/dist/components/CarouselTariffsCard/descriptionSize.js +4 -0
  74. package/dist/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  75. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  76. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.js +4 -0
  77. package/dist/components/CarouselTariffsCard/descriptionSize.mobile.js.map +1 -0
  78. package/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  79. package/dist/components/CarouselTariffsCard/getPaddingStyle.js +5 -0
  80. package/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  81. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  82. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js +5 -0
  83. package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -0
  84. package/dist/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  85. package/dist/components/CarouselTariffsCard/renderCardInfo.js +12 -0
  86. package/dist/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  87. package/dist/components/Headline/Headline.js +2 -1
  88. package/dist/components/Headline/Headline.js.map +1 -1
  89. package/dist/components/Headline/headlineVersionStyles.d.ts +1 -1
  90. package/dist/components/Headline/headlineVersionStyles.js +6 -6
  91. package/dist/components/Headline/headlineVersionStyles.js.map +1 -1
  92. package/dist/hooks/useForm.js +2 -2
  93. package/dist/hooks/useForm.js.map +1 -1
  94. package/dist/ui-kit/Checkbox/Checkbox.js +4 -1
  95. package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  96. package/dist/ui-kit/InputRange/InputRange.js +22 -16
  97. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  98. package/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  99. package/dist/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  100. package/dist/ui-kit/InputRange/parseDecimal.js +9 -0
  101. package/dist/ui-kit/InputRange/parseDecimal.js.map +1 -0
  102. package/dist/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  103. package/dist/ui-kit/InputRange/renderRangeWithTicks.js +17 -0
  104. package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  105. package/dist/utils/getSanitizedValue.js +1 -1
  106. package/dist/utils/getSanitizedValue.js.map +1 -1
  107. package/dist/wlc.json +1 -2
  108. package/lib/common.css +1 -1
  109. package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
  110. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  111. package/lib/components/Blocks.mobile.js +4 -0
  112. package/lib/components/Blocks.mobile.js.map +1 -1
  113. package/lib/components/Calculator/BonusCalculatorForm.js +16 -18
  114. package/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  115. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  116. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  117. package/lib/components/Calculator/Calculator.js +4 -4
  118. package/lib/components/Calculator/Calculator.js.map +1 -1
  119. package/lib/components/Calculator/CreditCalculatorForm.js +27 -43
  120. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  121. package/lib/components/Calculator/DepositCalculatorForm.js +31 -34
  122. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  123. package/lib/components/Calculator/Rate.d.ts +1 -0
  124. package/lib/components/Calculator/Rate.js +1 -1
  125. package/lib/components/Calculator/Rate.js.map +1 -1
  126. package/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  127. package/lib/components/Calculator/renderBinaryRadioButtonGroup.js +5 -0
  128. package/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  129. package/lib/components/Calculator/renderDaysInput.d.ts +2 -7
  130. package/lib/components/Calculator/renderDaysInput.js +2 -9
  131. package/lib/components/Calculator/renderDaysInput.js.map +1 -1
  132. package/lib/components/Calculator/renderInterestPayment.d.ts +2 -9
  133. package/lib/components/Calculator/renderInterestPayment.js +8 -18
  134. package/lib/components/Calculator/renderInterestPayment.js.map +1 -1
  135. package/lib/components/Calculator/renderMonthsInput.d.ts +3 -5
  136. package/lib/components/Calculator/renderMonthsInput.js +2 -10
  137. package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  138. package/lib/components/Calculator/renderPaymentType.d.ts +2 -11
  139. package/lib/components/Calculator/renderPaymentType.js +8 -18
  140. package/lib/components/Calculator/renderPaymentType.js.map +1 -1
  141. package/lib/components/Calculator/renderRegistrationType.d.ts +2 -9
  142. package/lib/components/Calculator/renderRegistrationType.js +8 -18
  143. package/lib/components/Calculator/renderRegistrationType.js.map +1 -1
  144. package/lib/components/Calculator/renderWantedSumInput.d.ts +3 -7
  145. package/lib/components/Calculator/renderWantedSumInput.js +4 -6
  146. package/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
  147. package/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
  148. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  149. package/lib/components/Carousel/Carousel.fixture.mobile.d.ts +11 -0
  150. package/lib/components/Carousel/Carousel.js +2 -2
  151. package/lib/components/Carousel/Carousel.js.map +1 -1
  152. package/lib/components/Carousel/itemsGap.d.ts +1 -0
  153. package/lib/components/Carousel/itemsGap.js +2 -0
  154. package/lib/components/Carousel/itemsGap.js.map +1 -0
  155. package/lib/components/Carousel/itemsGap.mobile.d.ts +1 -0
  156. package/lib/components/Carousel/itemsGap.mobile.js +2 -0
  157. package/lib/components/Carousel/itemsGap.mobile.js.map +1 -0
  158. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.d.ts +9 -0
  159. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +5 -9
  160. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  161. package/lib/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  162. package/lib/components/CarouselTariffsCard/descriptionSize.js +2 -0
  163. package/lib/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  164. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
  165. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.js +2 -0
  166. package/lib/components/CarouselTariffsCard/descriptionSize.mobile.js.map +1 -0
  167. package/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  168. package/lib/components/CarouselTariffsCard/getPaddingStyle.js +2 -0
  169. package/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  170. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
  171. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js +2 -0
  172. package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -0
  173. package/lib/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  174. package/lib/components/CarouselTariffsCard/renderCardInfo.js +9 -0
  175. package/lib/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  176. package/lib/components/Headline/Headline.fixture.mobile.d.ts +22 -0
  177. package/lib/components/Headline/Headline.js +2 -1
  178. package/lib/components/Headline/Headline.js.map +1 -1
  179. package/lib/components/Headline/headlineVersionStyles.d.ts +1 -1
  180. package/lib/components/Headline/headlineVersionStyles.js +6 -6
  181. package/lib/components/Headline/headlineVersionStyles.js.map +1 -1
  182. package/lib/hooks/useForm.js +2 -2
  183. package/lib/hooks/useForm.js.map +1 -1
  184. package/lib/ui-kit/Checkbox/Checkbox.js +4 -1
  185. package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  186. package/lib/ui-kit/InputRange/InputRange.js +22 -16
  187. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  188. package/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  189. package/lib/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  190. package/lib/ui-kit/InputRange/parseDecimal.js +6 -0
  191. package/lib/ui-kit/InputRange/parseDecimal.js.map +1 -0
  192. package/lib/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  193. package/lib/ui-kit/InputRange/renderRangeWithTicks.js +14 -0
  194. package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  195. package/lib/utils/getSanitizedValue.js +1 -1
  196. package/lib/utils/getSanitizedValue.js.map +1 -1
  197. package/lib/wlc.json +1 -2
  198. package/mobile/bundle/bundle.umd.js +363 -265
  199. package/mobile/bundle/bundle.umd.min.js +1 -1
  200. package/mobile/bundle/components/Calculator/Rate.d.ts +1 -0
  201. package/mobile/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  202. package/mobile/bundle/components/Calculator/renderDaysInput.d.ts +2 -7
  203. package/mobile/bundle/components/Calculator/renderInterestPayment.d.ts +2 -9
  204. package/mobile/bundle/components/Calculator/renderMonthsInput.d.ts +3 -5
  205. package/mobile/bundle/components/Calculator/renderPaymentType.d.ts +2 -11
  206. package/mobile/bundle/components/Calculator/renderRegistrationType.d.ts +2 -9
  207. package/mobile/bundle/components/Calculator/renderWantedSumInput.d.ts +3 -7
  208. package/mobile/bundle/components/Carousel/itemsGap.d.ts +1 -0
  209. package/mobile/bundle/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  210. package/mobile/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  211. package/mobile/bundle/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  212. package/mobile/bundle/components/Headline/headlineVersionStyles.d.ts +1 -1
  213. package/mobile/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  214. package/mobile/bundle/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  215. package/mobile/bundle/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  216. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
  217. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  218. package/mobile/dist/components/Blocks.js +4 -0
  219. package/mobile/dist/components/Blocks.js.map +1 -1
  220. package/mobile/dist/components/Calculator/BonusCalculatorForm.js +16 -18
  221. package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  222. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  223. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  224. package/mobile/dist/components/Calculator/Calculator.js +4 -4
  225. package/mobile/dist/components/Calculator/Calculator.js.map +1 -1
  226. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +27 -43
  227. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  228. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +30 -33
  229. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  230. package/mobile/dist/components/Calculator/Rate.d.ts +1 -0
  231. package/mobile/dist/components/Calculator/Rate.js +1 -1
  232. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  233. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  234. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js +8 -0
  235. package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  236. package/mobile/dist/components/Calculator/renderDaysInput.d.ts +2 -7
  237. package/mobile/dist/components/Calculator/renderDaysInput.js +2 -9
  238. package/mobile/dist/components/Calculator/renderDaysInput.js.map +1 -1
  239. package/mobile/dist/components/Calculator/renderInterestPayment.d.ts +2 -9
  240. package/mobile/dist/components/Calculator/renderInterestPayment.js +8 -18
  241. package/mobile/dist/components/Calculator/renderInterestPayment.js.map +1 -1
  242. package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +3 -5
  243. package/mobile/dist/components/Calculator/renderMonthsInput.js +2 -10
  244. package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  245. package/mobile/dist/components/Calculator/renderPaymentType.d.ts +2 -11
  246. package/mobile/dist/components/Calculator/renderPaymentType.js +9 -19
  247. package/mobile/dist/components/Calculator/renderPaymentType.js.map +1 -1
  248. package/mobile/dist/components/Calculator/renderRegistrationType.d.ts +2 -9
  249. package/mobile/dist/components/Calculator/renderRegistrationType.js +8 -18
  250. package/mobile/dist/components/Calculator/renderRegistrationType.js.map +1 -1
  251. package/mobile/dist/components/Calculator/renderWantedSumInput.d.ts +3 -7
  252. package/mobile/dist/components/Calculator/renderWantedSumInput.js +4 -6
  253. package/mobile/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
  254. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
  255. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  256. package/mobile/dist/components/Carousel/Carousel.js +3 -3
  257. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  258. package/mobile/dist/components/Carousel/itemsGap.d.ts +1 -0
  259. package/mobile/dist/components/Carousel/itemsGap.js +4 -0
  260. package/mobile/dist/components/Carousel/itemsGap.js.map +1 -0
  261. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -10
  262. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  263. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  264. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.js +4 -0
  265. package/mobile/dist/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  266. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  267. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js +5 -0
  268. package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  269. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  270. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.js +12 -0
  271. package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  272. package/mobile/dist/components/Headline/Headline.js +2 -1
  273. package/mobile/dist/components/Headline/Headline.js.map +1 -1
  274. package/mobile/dist/components/Headline/headlineVersionStyles.d.ts +1 -1
  275. package/mobile/dist/components/Headline/headlineVersionStyles.js +6 -6
  276. package/mobile/dist/components/Headline/headlineVersionStyles.js.map +1 -1
  277. package/mobile/dist/hooks/useForm.js +2 -2
  278. package/mobile/dist/hooks/useForm.js.map +1 -1
  279. package/mobile/dist/ui-kit/Checkbox/Checkbox.js +4 -1
  280. package/mobile/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  281. package/mobile/dist/ui-kit/InputRange/InputRange.js +22 -16
  282. package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  283. package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  284. package/mobile/dist/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  285. package/mobile/dist/ui-kit/InputRange/parseDecimal.js +9 -0
  286. package/mobile/dist/ui-kit/InputRange/parseDecimal.js.map +1 -0
  287. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  288. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +17 -0
  289. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  290. package/mobile/dist/utils/getSanitizedValue.js +1 -1
  291. package/mobile/dist/utils/getSanitizedValue.js.map +1 -1
  292. package/mobile/dist/wlc.json +1 -2
  293. package/mobile/lib/common.css +1 -1
  294. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
  295. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  296. package/mobile/lib/components/Blocks.js +4 -0
  297. package/mobile/lib/components/Blocks.js.map +1 -1
  298. package/mobile/lib/components/Calculator/BonusCalculatorForm.js +16 -18
  299. package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  300. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
  301. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  302. package/mobile/lib/components/Calculator/Calculator.js +4 -4
  303. package/mobile/lib/components/Calculator/Calculator.js.map +1 -1
  304. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +27 -43
  305. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  306. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +31 -34
  307. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  308. package/mobile/lib/components/Calculator/Rate.d.ts +1 -0
  309. package/mobile/lib/components/Calculator/Rate.js +1 -1
  310. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  311. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
  312. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js +5 -0
  313. package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
  314. package/mobile/lib/components/Calculator/renderDaysInput.d.ts +2 -7
  315. package/mobile/lib/components/Calculator/renderDaysInput.js +2 -9
  316. package/mobile/lib/components/Calculator/renderDaysInput.js.map +1 -1
  317. package/mobile/lib/components/Calculator/renderInterestPayment.d.ts +2 -9
  318. package/mobile/lib/components/Calculator/renderInterestPayment.js +8 -18
  319. package/mobile/lib/components/Calculator/renderInterestPayment.js.map +1 -1
  320. package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +3 -5
  321. package/mobile/lib/components/Calculator/renderMonthsInput.js +2 -10
  322. package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  323. package/mobile/lib/components/Calculator/renderPaymentType.d.ts +2 -11
  324. package/mobile/lib/components/Calculator/renderPaymentType.js +8 -18
  325. package/mobile/lib/components/Calculator/renderPaymentType.js.map +1 -1
  326. package/mobile/lib/components/Calculator/renderRegistrationType.d.ts +2 -9
  327. package/mobile/lib/components/Calculator/renderRegistrationType.js +8 -18
  328. package/mobile/lib/components/Calculator/renderRegistrationType.js.map +1 -1
  329. package/mobile/lib/components/Calculator/renderWantedSumInput.d.ts +3 -7
  330. package/mobile/lib/components/Calculator/renderWantedSumInput.js +4 -6
  331. package/mobile/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
  332. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
  333. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  334. package/mobile/lib/components/Carousel/Carousel.js +2 -2
  335. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  336. package/mobile/lib/components/Carousel/itemsGap.d.ts +1 -0
  337. package/mobile/lib/components/Carousel/itemsGap.js +2 -0
  338. package/mobile/lib/components/Carousel/itemsGap.js.map +1 -0
  339. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +5 -9
  340. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  341. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
  342. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.js +2 -0
  343. package/mobile/lib/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
  344. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
  345. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js +2 -0
  346. package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
  347. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
  348. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.js +9 -0
  349. package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
  350. package/mobile/lib/components/Headline/Headline.js +2 -1
  351. package/mobile/lib/components/Headline/Headline.js.map +1 -1
  352. package/mobile/lib/components/Headline/headlineVersionStyles.d.ts +1 -1
  353. package/mobile/lib/components/Headline/headlineVersionStyles.js +6 -6
  354. package/mobile/lib/components/Headline/headlineVersionStyles.js.map +1 -1
  355. package/mobile/lib/hooks/useForm.js +2 -2
  356. package/mobile/lib/hooks/useForm.js.map +1 -1
  357. package/mobile/lib/ui-kit/Checkbox/Checkbox.js +4 -1
  358. package/mobile/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  359. package/mobile/lib/ui-kit/InputRange/InputRange.js +22 -16
  360. package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  361. package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
  362. package/mobile/lib/ui-kit/InputRange/parseDecimal.d.ts +1 -0
  363. package/mobile/lib/ui-kit/InputRange/parseDecimal.js +6 -0
  364. package/mobile/lib/ui-kit/InputRange/parseDecimal.js.map +1 -0
  365. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
  366. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +14 -0
  367. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
  368. package/mobile/lib/utils/getSanitizedValue.js +1 -1
  369. package/mobile/lib/utils/getSanitizedValue.js.map +1 -1
  370. package/mobile/lib/wlc.json +1 -2
  371. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
  372. package/mobile/src/components/Blocks.ts +4 -0
  373. package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +29 -33
  374. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +37 -57
  375. package/mobile/src/components/Calculator/Calculator.tsx +11 -5
  376. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +52 -87
  377. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +38 -66
  378. package/mobile/src/components/Calculator/Rate.tsx +14 -14
  379. package/mobile/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +35 -0
  380. package/mobile/src/components/Calculator/renderDaysInput.tsx +10 -31
  381. package/mobile/src/components/Calculator/renderInterestPayment.tsx +13 -52
  382. package/mobile/src/components/Calculator/renderMonthsInput.tsx +17 -39
  383. package/mobile/src/components/Calculator/renderPaymentType.tsx +13 -49
  384. package/mobile/src/components/Calculator/renderRegistrationType.tsx +13 -51
  385. package/mobile/src/components/Calculator/renderWantedSumInput.tsx +10 -27
  386. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
  387. package/mobile/src/components/Carousel/Carousel.tsx +2 -3
  388. package/mobile/src/components/Carousel/itemsGap.ts +1 -0
  389. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +7 -31
  390. package/mobile/src/components/CarouselTariffsCard/descriptionSize.tsx +1 -0
  391. package/mobile/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -0
  392. package/mobile/src/components/CarouselTariffsCard/renderCardInfo.tsx +31 -0
  393. package/mobile/src/components/Headline/Headline.tsx +10 -5
  394. package/mobile/src/components/Headline/headlineVersionStyles.ts +7 -7
  395. package/mobile/src/hooks/useForm.ts +17 -14
  396. package/mobile/src/ui-kit/Checkbox/Checkbox.tsx +5 -1
  397. package/mobile/src/ui-kit/InputRange/InputRange.tsx +56 -43
  398. package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
  399. package/mobile/src/ui-kit/InputRange/parseDecimal.ts +6 -0
  400. package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +62 -0
  401. package/mobile/src/utils/getSanitizedValue.ts +1 -1
  402. package/mobile/src/wlc.json +1 -2
  403. package/package.json +1 -1
  404. package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
  405. package/src/components/Blocks.mobile.ts +4 -0
  406. package/src/components/Calculator/BonusCalculatorForm.tsx +29 -33
  407. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +37 -57
  408. package/src/components/Calculator/Calculator.tsx +11 -5
  409. package/src/components/Calculator/CreditCalculatorForm.tsx +52 -87
  410. package/src/components/Calculator/DepositCalculatorForm.tsx +38 -66
  411. package/src/components/Calculator/Rate.tsx +14 -14
  412. package/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +35 -0
  413. package/src/components/Calculator/renderDaysInput.tsx +10 -31
  414. package/src/components/Calculator/renderInterestPayment.tsx +13 -52
  415. package/src/components/Calculator/renderMonthsInput.tsx +17 -39
  416. package/src/components/Calculator/renderPaymentType.tsx +13 -49
  417. package/src/components/Calculator/renderRegistrationType.tsx +13 -51
  418. package/src/components/Calculator/renderWantedSumInput.tsx +10 -27
  419. package/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
  420. package/src/components/Carousel/Carousel.fixture.mobile.tsx +93 -0
  421. package/src/components/Carousel/Carousel.tsx +2 -3
  422. package/src/components/Carousel/itemsGap.mobile.ts +1 -0
  423. package/src/components/Carousel/itemsGap.ts +1 -0
  424. package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.tsx +74 -0
  425. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +7 -31
  426. package/src/components/CarouselTariffsCard/descriptionSize.mobile.tsx +1 -0
  427. package/src/components/CarouselTariffsCard/descriptionSize.tsx +1 -0
  428. package/src/components/CarouselTariffsCard/getPaddingStyle.mobile.tsx +2 -0
  429. package/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -0
  430. package/src/components/CarouselTariffsCard/renderCardInfo.tsx +31 -0
  431. package/src/components/Headline/Headline.fixture.mobile.tsx +95 -0
  432. package/src/components/Headline/Headline.tsx +10 -5
  433. package/src/components/Headline/headlineVersionStyles.ts +7 -7
  434. package/src/hooks/useForm.ts +17 -14
  435. package/src/ui-kit/Checkbox/Checkbox.tsx +5 -1
  436. package/src/ui-kit/InputRange/InputRange.tsx +56 -43
  437. package/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
  438. package/src/ui-kit/InputRange/parseDecimal.ts +6 -0
  439. package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +62 -0
  440. package/src/utils/getSanitizedValue.ts +1 -1
  441. package/src/wlc.json +1 -2
  442. package/bundle/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  443. package/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  444. package/dist/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  445. package/dist/ui-kit/InputListRange/InputListRange.js +0 -41
  446. package/dist/ui-kit/InputListRange/InputListRange.js.map +0 -1
  447. package/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  448. package/dist/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  449. package/dist/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  450. package/lib/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  451. package/lib/ui-kit/InputListRange/InputListRange.js +0 -39
  452. package/lib/ui-kit/InputListRange/InputListRange.js.map +0 -1
  453. package/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  454. package/lib/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  455. package/lib/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  456. package/mobile/bundle/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  457. package/mobile/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  458. package/mobile/dist/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  459. package/mobile/dist/ui-kit/InputListRange/InputListRange.js +0 -41
  460. package/mobile/dist/ui-kit/InputListRange/InputListRange.js.map +0 -1
  461. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  462. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  463. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  464. package/mobile/lib/ui-kit/InputListRange/InputListRange.d.ts +0 -2
  465. package/mobile/lib/ui-kit/InputListRange/InputListRange.js +0 -39
  466. package/mobile/lib/ui-kit/InputListRange/InputListRange.js.map +0 -1
  467. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
  468. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js +0 -2
  469. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
  470. package/mobile/src/ui-kit/InputListRange/InputListRange.tsx +0 -99
  471. package/mobile/src/ui-kit/InputListRange/InputListRangeProps.ts +0 -11
  472. package/src/ui-kit/InputListRange/InputListRange.tsx +0 -99
  473. package/src/ui-kit/InputListRange/InputListRangeProps.ts +0 -11
@@ -32,22 +32,25 @@ export const useForm = <FormState extends Record<string, any>>(
32
32
 
33
33
  const handlersMap = useRef<Partial<Record<keyof FormState, (value: any) => void>>>({});
34
34
 
35
- const field: FormFieldRegisterer<FormState> = (fieldName) => {
36
- if (!handlersMap.current) {
37
- handlersMap.current = {};
38
- }
35
+ const field: FormFieldRegisterer<FormState> = useCallback(
36
+ (fieldName) => {
37
+ if (!handlersMap.current) {
38
+ handlersMap.current = {};
39
+ }
39
40
 
40
- handlersMap.current[fieldName] ||= (value) => {
41
- setFormState((prev) => ({ ...prev, [fieldName]: value }));
42
- setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
43
- };
41
+ handlersMap.current[fieldName] ||= (value) => {
42
+ setFormState((prev) => ({ ...prev, [fieldName]: value }));
43
+ setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
44
+ };
44
45
 
45
- return {
46
- value: formState[fieldName],
47
- isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
48
- onChange: handlersMap.current[fieldName],
49
- };
50
- };
46
+ return {
47
+ value: formState[fieldName],
48
+ isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
49
+ onChange: handlersMap.current[fieldName],
50
+ };
51
+ },
52
+ [formState, isDirtyForm, dirtyFieldsMap],
53
+ );
51
54
 
52
55
  const reset = useCallback(() => {
53
56
  setFormState(initialState);
@@ -18,10 +18,14 @@ export const Checkbox = JSX<CheckboxProps>(
18
18
  ({ className, value, text, disabled, isRadio, onChange }) => {
19
19
  const handleChange = useCallback(
20
20
  (e: PreventableEvent) => {
21
+ if (disabled) {
22
+ return;
23
+ }
24
+
21
25
  e.preventDefault();
22
26
  onChange && onChange(!value);
23
27
  },
24
- [onChange, value],
28
+ [onChange, disabled, value],
25
29
  );
26
30
 
27
31
  const icon = isRadio ? (
@@ -1,60 +1,72 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
3
4
  import { clamp } from '../../utils/clamp';
4
- import { getSanitizedValue } from '../../utils/getSanitizedValue';
5
+ import { style } from '../../utils/style';
6
+ import { Text } from '../Text/Text';
5
7
  import type { InputRangeProps } from './InputRangeProps';
8
+ import { parseDecimal } from './parseDecimal';
9
+ import { renderRangeWithTicks } from './renderRangeWithTicks';
6
10
 
7
11
  const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
8
12
 
13
+ const DEFAULT_MIN = 1;
14
+ const DEFAULT_MAX = 100;
15
+
9
16
  export const InputRange = JSX<InputRangeProps>(
10
17
  ({
11
18
  className,
12
19
  title,
13
20
  items = [],
14
- min = 1,
15
- max = 100,
21
+ list = [],
22
+ min = list.length ? 0 : DEFAULT_MIN,
23
+ max = list.length ? list.length - 1 : DEFAULT_MAX,
16
24
  step = 1,
17
- value = min,
25
+ value = list[0] || min,
18
26
  disabled = false,
19
27
  onChange,
20
28
  }) => {
21
- const handleChange: JSX.IntrinsicElements['input']['onChange'] = (e) => {
22
- if (!onChange) {
23
- return;
24
- }
29
+ const [isFocused, setFocused] = useState(false);
30
+
31
+ const handleChange = useCallback(
32
+ (e: { target?: { value?: string } }) => {
33
+ onChange && onChange(parseDecimal(e.target?.value));
34
+ },
35
+ [onChange],
36
+ );
25
37
 
26
- onChange(clamp(Number(getSanitizedValue(e.target.value as string)), min, max));
27
- };
38
+ const handleFocus = useCallback(() => {
39
+ setFocused(true);
40
+ }, []);
28
41
 
29
- const inputStyle = {
30
- backgroundSize: `${(((value - min) * 100) / (max - min)).toFixed(2)}% 100%`,
31
- };
42
+ const handleBlur = useCallback(() => {
43
+ setFocused(false);
44
+ onChange && onChange(list.length ? closestValue(list)(value) : clamp(value || 0, min, max));
45
+ }, [onChange, value]);
32
46
 
33
47
  return (
34
48
  <div className={className}>
35
49
  <label className="block relative">
36
- {title ? <span className="text-m-light text-primary-text">{title}</span> : null}
50
+ {title ? (
51
+ <Text size="text-m" font="font-light" color="text-primary-text">
52
+ {title}
53
+ </Text>
54
+ ) : null}
37
55
  <input
38
- className={`m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
39
- outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`}
40
- value={addSpacesBetweenNumbers(value)}
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)}
41
64
  disabled={disabled}
42
- onChange={handleChange}
43
- onBlur={handleChange}
65
+ onInput={handleChange as any}
66
+ onFocus={handleFocus}
67
+ onBlur={handleBlur}
44
68
  />
45
- <div className="absolute inset-x-0 -bottom-1 px-4 leading-[18px]">
46
- <input
47
- className="box-border w-full m-0 cursor-pointer slider"
48
- type="range"
49
- min={min}
50
- max={max}
51
- step={step}
52
- value={value}
53
- disabled={disabled}
54
- onChange={handleChange}
55
- style={inputStyle}
56
- />
57
- </div>
69
+ {renderRangeWithTicks({ list, min, max, step, disabled, value, onChange })}
58
70
  </label>
59
71
  {renderRangeCaption(items)}
60
72
  </div>
@@ -62,14 +74,15 @@ export const InputRange = JSX<InputRangeProps>(
62
74
  },
63
75
  );
64
76
 
65
- function renderRangeCaption(items: string[]) {
66
- return (
67
- <div className="flex justify-between my-2">
68
- {items.map((item, i) => (
69
- <span key={String(i)} className="text-s-light text-secondary-text">
70
- {item}
71
- </span>
72
- ))}
73
- </div>
74
- );
75
- }
77
+ const closestValue = (list: number[]) => (_: number) =>
78
+ list.reduce((prev, curr) => (Math.abs(curr - _) < Math.abs(prev - _) ? curr : prev));
79
+
80
+ const renderRangeCaption = (items: string[]) => (
81
+ <div className="flex justify-between my-2">
82
+ {items.map((item, i) => (
83
+ <Text key={String(i)} size="text-s-light" color="text-secondary-text">
84
+ {item}
85
+ </Text>
86
+ ))}
87
+ </div>
88
+ );
@@ -5,6 +5,7 @@ export interface InputRangeProps extends ListContent {
5
5
  items?: string[];
6
6
  min?: number;
7
7
  max?: number;
8
+ list?: number[];
8
9
  step?: number;
9
10
  value?: number;
10
11
  title?: string;
@@ -0,0 +1,6 @@
1
+ export function parseDecimal(value?: string) {
2
+ const rawValue = (value || '').replace(/\D/g, '');
3
+ const unsafeDecimal = parseInt(rawValue, 10);
4
+
5
+ return Number.isNaN(unsafeDecimal) ? 0 : unsafeDecimal;
6
+ }
@@ -0,0 +1,62 @@
1
+ import { parseDecimal } from './parseDecimal';
2
+
3
+ interface RangeWithTicksProps {
4
+ list: number[];
5
+ min: number;
6
+ max: number;
7
+ step: number;
8
+ disabled?: boolean;
9
+ value?: number;
10
+ onChange?: (value: number) => void;
11
+ }
12
+
13
+ export function renderRangeWithTicks({
14
+ list = [],
15
+ min,
16
+ max,
17
+ step,
18
+ value = list[0] || min,
19
+ disabled,
20
+ onChange,
21
+ }: RangeWithTicksProps) {
22
+ const rangeValue = list.length ? list.indexOf(value) : value;
23
+ const inputStyle = {
24
+ backgroundSize: `${(((rangeValue - min) * 100) / (max - min)).toFixed(2)}% 100%`,
25
+ };
26
+
27
+ return (
28
+ <div>
29
+ {list.length ? (
30
+ <div className="absolute w-full flex justify-between -bottom-[3px] px-4">
31
+ {list.map((_, i) => (
32
+ <div
33
+ key={String(i)}
34
+ className={`w-2 h-2 rounded-full ${
35
+ rangeValue <= i || disabled ? 'bg-gray' : 'bg-primary-main'
36
+ }`}
37
+ />
38
+ ))}
39
+ </div>
40
+ ) : null}
41
+ <div className="absolute inset-x-0 -bottom-1 px-4 leading-[18px]">
42
+ <input
43
+ className="box-border w-full m-0 cursor-pointer slider relative z-10"
44
+ style={inputStyle}
45
+ type="range"
46
+ min={min}
47
+ max={max}
48
+ step={step}
49
+ value={rangeValue}
50
+ disabled={disabled}
51
+ onInput={
52
+ ((e: { target?: { value?: string } }) => {
53
+ const rawValue = parseDecimal(e.target?.value);
54
+ const newValue = list.length ? list[rawValue] : rawValue;
55
+ onChange && onChange(newValue || 0);
56
+ }) as any
57
+ }
58
+ />
59
+ </div>
60
+ </div>
61
+ );
62
+ }
@@ -1 +1 @@
1
- export const getSanitizedValue = (_: string): string => _.split(/\s+/).join('');
1
+ export const getSanitizedValue = (_: string): string => _.replace(/\s/g, '');
package/src/wlc.json CHANGED
@@ -3,6 +3,5 @@
3
3
  "FORCED_DRAFT_FLOW": false,
4
4
  "YANDEX_MAP_API_KEY": "f4b40c1e-1891-45f2-b307-90c481af210b",
5
5
  "SITEMAP": "sayt-rshb",
6
- "CHAT_BOT": "personal",
7
- "BASE_PATH": "/natural/"
6
+ "CHAT_BOT": "personal"
8
7
  }
@@ -1,2 +0,0 @@
1
- import type { InputListRangeProps } from './InputListRangeProps';
2
- export declare const InputListRange: import("@redneckz/uni-jsx").UNIComponent<InputListRangeProps, any, any>;
@@ -1,10 +0,0 @@
1
- import type { ListContent } from '../List/ListContent';
2
- export interface InputListRangeProps extends ListContent {
3
- className?: string;
4
- items?: string[];
5
- list?: number[];
6
- value?: number;
7
- title?: string;
8
- disabled?: boolean;
9
- onChange?: (value: number) => void;
10
- }
@@ -1,2 +0,0 @@
1
- import type { InputListRangeProps } from './InputListRangeProps';
2
- export declare const InputListRange: import("@redneckz/uni-jsx").UNIComponent<InputListRangeProps, any, any>;
@@ -1,41 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.InputListRange = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const addSpacesBetweenNumbers_1 = require("../../utils/addSpacesBetweenNumbers");
6
- const clamp_1 = require("../../utils/clamp");
7
- const getSanitizedValue_1 = require("../../utils/getSanitizedValue");
8
- const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
9
- exports.InputListRange = (0, uni_jsx_1.JSX)(({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
10
- const min = 0;
11
- const max = list.length - 1;
12
- const step = 1;
13
- const handleTextChange = (e) => {
14
- if (!onChange) {
15
- return;
16
- }
17
- const newValue = parseInt(e.target.value);
18
- const closetValue = list.reduce(function (prev, curr) {
19
- return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
20
- });
21
- onChange(Number((0, getSanitizedValue_1.getSanitizedValue)(closetValue.toString())));
22
- };
23
- const handleRangeChange = (e) => {
24
- if (!onChange) {
25
- return;
26
- }
27
- const val = list.at((0, clamp_1.clamp)(parseInt(e.target.value), min, max)) || 0;
28
- onChange(Number((0, getSanitizedValue_1.getSanitizedValue)(val.toString())));
29
- };
30
- const valueIndex = list.findIndex((item) => item === value) || 0;
31
- const inputStyle = {
32
- backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
33
- };
34
- return ((0, jsx_runtime_1.jsxs)("div", { className: className, children: [(0, jsx_runtime_1.jsxs)("label", { className: "block relative", children: [title ? (0, jsx_runtime_1.jsx)("span", { className: "text-m-light text-primary-text", children: title }) : null, (0, jsx_runtime_1.jsx)("input", { className: `m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
35
- outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`, value: (0, addSpacesBetweenNumbers_1.addSpacesBetweenNumbers)(value), disabled: disabled, onChange: handleTextChange, onBlur: handleTextChange }), list.length ? ((0, jsx_runtime_1.jsx)("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map(renderTick(valueIndex, disabled)) })) : null, (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: (0, jsx_runtime_1.jsx)("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", type: "range", min: min, max: max, step: step, value: valueIndex, disabled: disabled, onChange: handleRangeChange, style: inputStyle }) })] }), renderRangeCaption(items)] }));
36
- });
37
- const renderTick = (valueIndex, disabled) => (value, i) => ((0, jsx_runtime_1.jsx)("span", { className: `w-2 h-2 rounded-full ${valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)));
38
- function renderRangeCaption(items) {
39
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-between my-2", children: items.map((item, i) => ((0, jsx_runtime_1.jsx)("span", { className: "text-s-light text-secondary-text", children: item }, String(i)))) }));
40
- }
41
- //# sourceMappingURL=InputListRange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputListRange.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRange.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iFAA8E;AAC9E,6CAA0C;AAC1C,qEAAkE;AAGlE,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAElE,QAAA,cAAc,GAAG,IAAA,aAAG,EAC/B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAA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E,QAAiB,EAAE,EAAE,CAAC,CAAC,KAAa,EAAE,CAAS,EAAE,EAAE,CACzF,CACE,iCAEE,SAAS,EAAE,wBACT,UAAU,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAC5C,EAAE,IAHG,MAAM,CAAC,CAAC,CAAC,CAId,CACH,CAAC;AAEJ,SAAS,kBAAkB,CAAC,KAAe;IACzC,OAAO,CACL,gCAAK,SAAS,EAAC,2BAA2B,YACvC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,iCAAsB,SAAS,EAAC,kCAAkC,YAC/D,IAAI,IADI,MAAM,CAAC,CAAC,CAAC,CAEb,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { ListContent } from '../List/ListContent';
2
- export interface InputListRangeProps extends ListContent {
3
- className?: string;
4
- items?: string[];
5
- list?: number[];
6
- value?: number;
7
- title?: string;
8
- disabled?: boolean;
9
- onChange?: (value: number) => void;
10
- }
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- //# sourceMappingURL=InputListRangeProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputListRangeProps.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRangeProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import type { InputListRangeProps } from './InputListRangeProps';
2
- export declare const InputListRange: import("@redneckz/uni-jsx").UNIComponent<InputListRangeProps, any, any>;
@@ -1,39 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers.js';
4
- import { clamp } from '../../utils/clamp.js';
5
- import { getSanitizedValue } from '../../utils/getSanitizedValue.js';
6
- const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
7
- export const InputListRange = JSX(({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
8
- const min = 0;
9
- const max = list.length - 1;
10
- const step = 1;
11
- const handleTextChange = (e) => {
12
- if (!onChange) {
13
- return;
14
- }
15
- const newValue = parseInt(e.target.value);
16
- const closetValue = list.reduce(function (prev, curr) {
17
- return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
18
- });
19
- onChange(Number(getSanitizedValue(closetValue.toString())));
20
- };
21
- const handleRangeChange = (e) => {
22
- if (!onChange) {
23
- return;
24
- }
25
- const val = list.at(clamp(parseInt(e.target.value), min, max)) || 0;
26
- onChange(Number(getSanitizedValue(val.toString())));
27
- };
28
- const valueIndex = list.findIndex((item) => item === value) || 0;
29
- const inputStyle = {
30
- backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
31
- };
32
- return (_jsxs("div", { className: className, children: [_jsxs("label", { className: "block relative", children: [title ? _jsx("span", { className: "text-m-light text-primary-text", children: title }) : null, _jsx("input", { className: `m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
33
- outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`, value: addSpacesBetweenNumbers(value), disabled: disabled, onChange: handleTextChange, onBlur: handleTextChange }), list.length ? (_jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map(renderTick(valueIndex, disabled)) })) : null, _jsx("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: _jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", type: "range", min: min, max: max, step: step, value: valueIndex, disabled: disabled, onChange: handleRangeChange, style: inputStyle }) })] }), renderRangeCaption(items)] }));
34
- });
35
- const renderTick = (valueIndex, disabled) => (value, i) => (_jsx("span", { className: `w-2 h-2 rounded-full ${valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)));
36
- function renderRangeCaption(items) {
37
- return (_jsx("div", { className: "flex justify-between my-2", children: items.map((item, i) => (_jsx("span", { className: "text-s-light text-secondary-text", children: item }, String(i)))) }));
38
- }
39
- //# sourceMappingURL=InputListRange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputListRange.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRange.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAE/E,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAC/B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3F,MAAM,GAAG,GAAG,CAAC,CAAC;IACd,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,CAAC,CAAC;IAEf,MAAM,gBAAgB,GAA+C,CAAC,CAAC,EAAE,EAAE;QACzE,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO;SACR;QACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1C,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,IAAI;YAClD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,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AC1B,MAAM,EAAE,gBAAgB,GACxB,EACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACb,cAAK,SAAS,EAAC,yDAAyD,YACrE,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,GACvC,CACP,CAAC,CAAC,CAAC,IAAI,EACR,cAAK,SAAS,EAAC,kDAAkD,YAC/D,gBACE,SAAS,EAAC,2DAA2D,EACrE,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,UAAU,GACjB,GACE,IACA,EACP,kBAAkB,CAAC,KAAK,CAAC,IACtB,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAE,QAAiB,EAAE,EAAE,CAAC,CAAC,KAAa,EAAE,CAAS,EAAE,EAAE,CACzF,CACE,eAEE,SAAS,EAAE,wBACT,UAAU,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAC5C,EAAE,IAHG,MAAM,CAAC,CAAC,CAAC,CAId,CACH,CAAC;AAEJ,SAAS,kBAAkB,CAAC,KAAe;IACzC,OAAO,CACL,cAAK,SAAS,EAAC,2BAA2B,YACvC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,eAAsB,SAAS,EAAC,kCAAkC,YAC/D,IAAI,IADI,MAAM,CAAC,CAAC,CAAC,CAEb,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { ListContent } from '../List/ListContent';
2
- export interface InputListRangeProps extends ListContent {
3
- className?: string;
4
- items?: string[];
5
- list?: number[];
6
- value?: number;
7
- title?: string;
8
- disabled?: boolean;
9
- onChange?: (value: number) => void;
10
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=InputListRangeProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputListRangeProps.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRangeProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import type { InputListRangeProps } from './InputListRangeProps';
2
- export declare const InputListRange: import("@redneckz/uni-jsx").UNIComponent<InputListRangeProps, any, any>;
@@ -1,10 +0,0 @@
1
- import type { ListContent } from '../List/ListContent';
2
- export interface InputListRangeProps extends ListContent {
3
- className?: string;
4
- items?: string[];
5
- list?: number[];
6
- value?: number;
7
- title?: string;
8
- disabled?: boolean;
9
- onChange?: (value: number) => void;
10
- }
@@ -1,2 +0,0 @@
1
- import type { InputListRangeProps } from './InputListRangeProps';
2
- export declare const InputListRange: import("@redneckz/uni-jsx").UNIComponent<InputListRangeProps, any, any>;
@@ -1,41 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.InputListRange = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const addSpacesBetweenNumbers_1 = require("../../utils/addSpacesBetweenNumbers");
6
- const clamp_1 = require("../../utils/clamp");
7
- const getSanitizedValue_1 = require("../../utils/getSanitizedValue");
8
- const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
9
- exports.InputListRange = (0, uni_jsx_1.JSX)(({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
10
- const min = 0;
11
- const max = list.length - 1;
12
- const step = 1;
13
- const handleTextChange = (e) => {
14
- if (!onChange) {
15
- return;
16
- }
17
- const newValue = parseInt(e.target.value);
18
- const closetValue = list.reduce(function (prev, curr) {
19
- return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
20
- });
21
- onChange(Number((0, getSanitizedValue_1.getSanitizedValue)(closetValue.toString())));
22
- };
23
- const handleRangeChange = (e) => {
24
- if (!onChange) {
25
- return;
26
- }
27
- const val = list.at((0, clamp_1.clamp)(parseInt(e.target.value), min, max)) || 0;
28
- onChange(Number((0, getSanitizedValue_1.getSanitizedValue)(val.toString())));
29
- };
30
- const valueIndex = list.findIndex((item) => item === value) || 0;
31
- const inputStyle = {
32
- backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
33
- };
34
- return ((0, jsx_runtime_1.jsxs)("div", { className: className, children: [(0, jsx_runtime_1.jsxs)("label", { className: "block relative", children: [title ? (0, jsx_runtime_1.jsx)("span", { className: "text-m-light text-primary-text", children: title }) : null, (0, jsx_runtime_1.jsx)("input", { className: `m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
35
- outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`, value: (0, addSpacesBetweenNumbers_1.addSpacesBetweenNumbers)(value), disabled: disabled, onChange: handleTextChange, onBlur: handleTextChange }), list.length ? ((0, jsx_runtime_1.jsx)("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map(renderTick(valueIndex, disabled)) })) : null, (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: (0, jsx_runtime_1.jsx)("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", type: "range", min: min, max: max, step: step, value: valueIndex, disabled: disabled, onChange: handleRangeChange, style: inputStyle }) })] }), renderRangeCaption(items)] }));
36
- });
37
- const renderTick = (valueIndex, disabled) => (value, i) => ((0, jsx_runtime_1.jsx)("span", { className: `w-2 h-2 rounded-full ${valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)));
38
- function renderRangeCaption(items) {
39
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-between my-2", children: items.map((item, i) => ((0, jsx_runtime_1.jsx)("span", { className: "text-s-light text-secondary-text", children: item }, String(i)))) }));
40
- }
41
- //# sourceMappingURL=InputListRange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputListRange.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRange.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iFAA8E;AAC9E,6CAA0C;AAC1C,qEAAkE;AAGlE,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAElE,QAAA,cAAc,GAAG,IAAA,aAAG,EAC/B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3F,MAAM,GAAG,GAAG,CAAC,CAAC;IACd,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,CAAC,CAAC;IAEf,MAAM,gBAAgB,GAA+C,CAAC,CAAC,EAAE,EAAE;QACzE,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO;SACR;QACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1C,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,IAAI;YAClD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7E,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,MAAM,CAAC,IAAA,qCAAiB,EAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF,MAAM,iBAAiB,G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EACR,gCAAK,SAAS,EAAC,kDAAkD,YAC/D,kCACE,SAAS,EAAC,2DAA2D,EACrE,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,UAAU,GACjB,GACE,IACA,EACP,kBAAkB,CAAC,KAAK,CAAC,IACtB,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAE,QAAiB,EAAE,EAAE,CAAC,CAAC,KAAa,EAAE,CAAS,EAAE,EAAE,CACzF,CACE,iCAEE,SAAS,EAAE,wBACT,UAAU,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAC5C,EAAE,IAHG,MAAM,CAAC,CAAC,CAAC,CAId,CACH,CAAC;AAEJ,SAAS,kBAAkB,CAAC,KAAe;IACzC,OAAO,CACL,gCAAK,SAAS,EAAC,2BAA2B,YACvC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,iCAAsB,SAAS,EAAC,kCAAkC,YAC/D,IAAI,IADI,MAAM,CAAC,CAAC,CAAC,CAEb,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { ListContent } from '../List/ListContent';
2
- export interface InputListRangeProps extends ListContent {
3
- className?: string;
4
- items?: string[];
5
- list?: number[];
6
- value?: number;
7
- title?: string;
8
- disabled?: boolean;
9
- onChange?: (value: number) => void;
10
- }
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- //# sourceMappingURL=InputListRangeProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputListRangeProps.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRangeProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import type { InputListRangeProps } from './InputListRangeProps';
2
- export declare const InputListRange: import("@redneckz/uni-jsx").UNIComponent<InputListRangeProps, any, any>;
@@ -1,39 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers.js';
4
- import { clamp } from '../../utils/clamp.js';
5
- import { getSanitizedValue } from '../../utils/getSanitizedValue.js';
6
- const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
7
- export const InputListRange = JSX(({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
8
- const min = 0;
9
- const max = list.length - 1;
10
- const step = 1;
11
- const handleTextChange = (e) => {
12
- if (!onChange) {
13
- return;
14
- }
15
- const newValue = parseInt(e.target.value);
16
- const closetValue = list.reduce(function (prev, curr) {
17
- return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
18
- });
19
- onChange(Number(getSanitizedValue(closetValue.toString())));
20
- };
21
- const handleRangeChange = (e) => {
22
- if (!onChange) {
23
- return;
24
- }
25
- const val = list.at(clamp(parseInt(e.target.value), min, max)) || 0;
26
- onChange(Number(getSanitizedValue(val.toString())));
27
- };
28
- const valueIndex = list.findIndex((item) => item === value) || 0;
29
- const inputStyle = {
30
- backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
31
- };
32
- return (_jsxs("div", { className: className, children: [_jsxs("label", { className: "block relative", children: [title ? _jsx("span", { className: "text-m-light text-primary-text", children: title }) : null, _jsx("input", { className: `m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
33
- outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`, value: addSpacesBetweenNumbers(value), disabled: disabled, onChange: handleTextChange, onBlur: handleTextChange }), list.length ? (_jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map(renderTick(valueIndex, disabled)) })) : null, _jsx("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: _jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", type: "range", min: min, max: max, step: step, value: valueIndex, disabled: disabled, onChange: handleRangeChange, style: inputStyle }) })] }), renderRangeCaption(items)] }));
34
- });
35
- const renderTick = (valueIndex, disabled) => (value, i) => (_jsx("span", { className: `w-2 h-2 rounded-full ${valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)));
36
- function renderRangeCaption(items) {
37
- return (_jsx("div", { className: "flex justify-between my-2", children: items.map((item, i) => (_jsx("span", { className: "text-s-light text-secondary-text", children: item }, String(i)))) }));
38
- }
39
- //# sourceMappingURL=InputListRange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputListRange.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRange.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAE/E,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAC/B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3F,MAAM,GAAG,GAAG,CAAC,CAAC;IACd,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CA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AAS,kBAAkB,CAAC,KAAe;IACzC,OAAO,CACL,cAAK,SAAS,EAAC,2BAA2B,YACvC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,eAAsB,SAAS,EAAC,kCAAkC,YAC/D,IAAI,IADI,MAAM,CAAC,CAAC,CAAC,CAEb,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { ListContent } from '../List/ListContent';
2
- export interface InputListRangeProps extends ListContent {
3
- className?: string;
4
- items?: string[];
5
- list?: number[];
6
- value?: number;
7
- title?: string;
8
- disabled?: boolean;
9
- onChange?: (value: number) => void;
10
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=InputListRangeProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputListRangeProps.js","sourceRoot":"","sources":["../../../src/ui-kit/InputListRange/InputListRangeProps.ts"],"names":[],"mappings":""}