@redneckz/wildless-cms-uni-blocks 0.14.778 → 0.14.787

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 (294) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +179 -122
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -1
  5. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +3 -2
  6. package/bundle/components/CalculatorDeposit/CalculatorDeposit.d.ts +1 -2
  7. package/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +31 -1
  8. package/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +1 -27
  9. package/bundle/components/CalculatorDeposit/normalize.d.ts +2 -3
  10. package/bundle/components/CalculatorDeposit/renderDepositParamsForm.d.ts +3 -3
  11. package/bundle/components/CalculatorDeposit/renderRegistrationType.d.ts +1 -1
  12. package/bundle/retail/components/Fields/AddressCourierField.d.ts +9 -0
  13. package/bundle/retail/inputs.d.ts +77 -76
  14. package/bundle/retail/model/LeadFormState.d.ts +2 -2
  15. package/bundle/ui-kit/Calculator/getDefaultParams.d.ts +11 -2
  16. package/bundle/ui-kit/Calculator/renderBinaryRadioButtonGroup.d.ts +1 -2
  17. package/bundle/ui-kit/Calculator/setDefaultParamsCalc.d.ts +1 -1
  18. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -1
  19. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  20. package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -1
  21. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +3 -2
  22. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -1
  23. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  24. package/dist/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.js +0 -3
  25. package/dist/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.js.map +1 -1
  26. package/dist/components/CalculatorCredit/CalculatorCredit.js +0 -2
  27. package/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  28. package/dist/components/CalculatorDeposit/CalculatorDeposit.d.ts +1 -2
  29. package/dist/components/CalculatorDeposit/CalculatorDeposit.js +16 -7
  30. package/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  31. package/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +31 -1
  32. package/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +1 -27
  33. package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  34. package/dist/components/CalculatorDeposit/normalize.d.ts +2 -3
  35. package/dist/components/CalculatorDeposit/normalize.js.map +1 -1
  36. package/dist/components/CalculatorDeposit/renderDepositParamsForm.d.ts +3 -3
  37. package/dist/components/CalculatorDeposit/renderDepositParamsForm.js +30 -41
  38. package/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
  39. package/dist/components/CalculatorDeposit/renderRegistrationType.d.ts +1 -1
  40. package/dist/components/CalculatorDeposit/renderRegistrationType.js +11 -7
  41. package/dist/components/CalculatorDeposit/renderRegistrationType.js.map +1 -1
  42. package/dist/components/CalculatorRefinancing/CalculatorRefinancing.js +1 -4
  43. package/dist/components/CalculatorRefinancing/CalculatorRefinancing.js.map +1 -1
  44. package/dist/components/Header/useChatBot.js +2 -1
  45. package/dist/components/Header/useChatBot.js.map +1 -1
  46. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +1 -1
  47. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  48. package/dist/retail/components/DocumentDialog/DocumentDialog.js +1 -1
  49. package/dist/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
  50. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
  51. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  52. package/dist/retail/components/Fields/AddressCourierField.d.ts +9 -0
  53. package/dist/retail/components/Fields/AddressCourierField.js +50 -0
  54. package/dist/retail/components/Fields/AddressCourierField.js.map +1 -0
  55. package/dist/retail/inputs.d.ts +77 -76
  56. package/dist/retail/inputs.js +6 -1
  57. package/dist/retail/inputs.js.map +1 -1
  58. package/dist/retail/model/LeadFormState.d.ts +2 -2
  59. package/dist/ui-kit/Calculator/getDefaultParams.d.ts +11 -2
  60. package/dist/ui-kit/Calculator/getDefaultParams.js +7 -1
  61. package/dist/ui-kit/Calculator/getDefaultParams.js.map +1 -1
  62. package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.d.ts +1 -2
  63. package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
  64. package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
  65. package/dist/ui-kit/Calculator/renderPaymentType.js +2 -0
  66. package/dist/ui-kit/Calculator/renderPaymentType.js.map +1 -1
  67. package/dist/ui-kit/Calculator/renderPayout.js +2 -0
  68. package/dist/ui-kit/Calculator/renderPayout.js.map +1 -1
  69. package/dist/ui-kit/Calculator/setDefaultParamsCalc.d.ts +1 -1
  70. package/lib/common.css +1 -1
  71. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -1
  72. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  73. package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -1
  74. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +3 -2
  75. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -1
  76. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  77. package/lib/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.js +0 -3
  78. package/lib/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.js.map +1 -1
  79. package/lib/components/CalculatorCredit/CalculatorCredit.js +0 -2
  80. package/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  81. package/lib/components/CalculatorDeposit/CalculatorDeposit.d.ts +1 -2
  82. package/lib/components/CalculatorDeposit/CalculatorDeposit.fixture.d.ts +1 -0
  83. package/lib/components/CalculatorDeposit/CalculatorDeposit.js +17 -8
  84. package/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  85. package/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +31 -1
  86. package/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +1 -27
  87. package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  88. package/lib/components/CalculatorDeposit/normalize.d.ts +2 -3
  89. package/lib/components/CalculatorDeposit/normalize.js.map +1 -1
  90. package/lib/components/CalculatorDeposit/renderDepositParamsForm.d.ts +3 -3
  91. package/lib/components/CalculatorDeposit/renderDepositParamsForm.js +32 -43
  92. package/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
  93. package/lib/components/CalculatorDeposit/renderRegistrationType.d.ts +1 -1
  94. package/lib/components/CalculatorDeposit/renderRegistrationType.js +11 -7
  95. package/lib/components/CalculatorDeposit/renderRegistrationType.js.map +1 -1
  96. package/lib/components/CalculatorRefinancing/CalculatorRefinancing.js +1 -4
  97. package/lib/components/CalculatorRefinancing/CalculatorRefinancing.js.map +1 -1
  98. package/lib/components/Header/useChatBot.js +2 -1
  99. package/lib/components/Header/useChatBot.js.map +1 -1
  100. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +1 -1
  101. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  102. package/lib/retail/components/DocumentDialog/DocumentDialog.js +1 -1
  103. package/lib/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
  104. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
  105. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  106. package/lib/retail/components/Fields/AddressCourierField.d.ts +9 -0
  107. package/lib/retail/components/Fields/AddressCourierField.js +48 -0
  108. package/lib/retail/components/Fields/AddressCourierField.js.map +1 -0
  109. package/lib/retail/inputs.d.ts +77 -76
  110. package/lib/retail/inputs.js +6 -1
  111. package/lib/retail/inputs.js.map +1 -1
  112. package/lib/retail/model/LeadFormState.d.ts +2 -2
  113. package/lib/ui-kit/Calculator/getDefaultParams.d.ts +11 -2
  114. package/lib/ui-kit/Calculator/getDefaultParams.js +7 -1
  115. package/lib/ui-kit/Calculator/getDefaultParams.js.map +1 -1
  116. package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.d.ts +1 -2
  117. package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
  118. package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
  119. package/lib/ui-kit/Calculator/renderPaymentType.js +2 -0
  120. package/lib/ui-kit/Calculator/renderPaymentType.js.map +1 -1
  121. package/lib/ui-kit/Calculator/renderPayout.js +2 -0
  122. package/lib/ui-kit/Calculator/renderPayout.js.map +1 -1
  123. package/lib/ui-kit/Calculator/setDefaultParamsCalc.d.ts +1 -1
  124. package/mobile/bundle/bundle.umd.js +177 -121
  125. package/mobile/bundle/bundle.umd.min.js +1 -1
  126. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -1
  127. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +3 -2
  128. package/mobile/bundle/components/CalculatorDeposit/CalculatorDeposit.d.ts +1 -2
  129. package/mobile/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +31 -1
  130. package/mobile/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +1 -27
  131. package/mobile/bundle/components/CalculatorDeposit/normalize.d.ts +2 -3
  132. package/mobile/bundle/components/CalculatorDeposit/renderDepositParamsForm.d.ts +3 -3
  133. package/mobile/bundle/components/CalculatorDeposit/renderRegistrationType.d.ts +1 -1
  134. package/mobile/bundle/retail/components/Fields/AddressCourierField.d.ts +9 -0
  135. package/mobile/bundle/retail/inputs.d.ts +77 -76
  136. package/mobile/bundle/retail/model/LeadFormState.d.ts +2 -2
  137. package/mobile/bundle/ui-kit/Calculator/getDefaultParams.d.ts +11 -2
  138. package/mobile/bundle/ui-kit/Calculator/renderBinaryRadioButtonGroup.d.ts +1 -2
  139. package/mobile/bundle/ui-kit/Calculator/setDefaultParamsCalc.d.ts +1 -1
  140. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -1
  141. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  142. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -1
  143. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +3 -2
  144. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -1
  145. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  146. package/mobile/dist/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.js +0 -3
  147. package/mobile/dist/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.js.map +1 -1
  148. package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js +0 -2
  149. package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  150. package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.d.ts +1 -2
  151. package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js +16 -7
  152. package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  153. package/mobile/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +31 -1
  154. package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +1 -27
  155. package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  156. package/mobile/dist/components/CalculatorDeposit/normalize.d.ts +2 -3
  157. package/mobile/dist/components/CalculatorDeposit/normalize.js.map +1 -1
  158. package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.d.ts +3 -3
  159. package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js +30 -41
  160. package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
  161. package/mobile/dist/components/CalculatorDeposit/renderRegistrationType.d.ts +1 -1
  162. package/mobile/dist/components/CalculatorDeposit/renderRegistrationType.js +11 -7
  163. package/mobile/dist/components/CalculatorDeposit/renderRegistrationType.js.map +1 -1
  164. package/mobile/dist/components/CalculatorRefinancing/CalculatorRefinancing.js +1 -4
  165. package/mobile/dist/components/CalculatorRefinancing/CalculatorRefinancing.js.map +1 -1
  166. package/mobile/dist/components/Header/useChatBot.js +2 -1
  167. package/mobile/dist/components/Header/useChatBot.js.map +1 -1
  168. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +1 -1
  169. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  170. package/mobile/dist/retail/components/DocumentDialog/DocumentDialog.js +1 -1
  171. package/mobile/dist/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
  172. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
  173. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  174. package/mobile/dist/retail/components/Fields/AddressCourierField.d.ts +9 -0
  175. package/mobile/dist/retail/components/Fields/AddressCourierField.js +50 -0
  176. package/mobile/dist/retail/components/Fields/AddressCourierField.js.map +1 -0
  177. package/mobile/dist/retail/inputs.d.ts +77 -76
  178. package/mobile/dist/retail/inputs.js +6 -1
  179. package/mobile/dist/retail/inputs.js.map +1 -1
  180. package/mobile/dist/retail/model/LeadFormState.d.ts +2 -2
  181. package/mobile/dist/ui-kit/Calculator/getDefaultParams.d.ts +11 -2
  182. package/mobile/dist/ui-kit/Calculator/getDefaultParams.js +7 -1
  183. package/mobile/dist/ui-kit/Calculator/getDefaultParams.js.map +1 -1
  184. package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.d.ts +1 -2
  185. package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
  186. package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
  187. package/mobile/dist/ui-kit/Calculator/renderPaymentType.js +2 -0
  188. package/mobile/dist/ui-kit/Calculator/renderPaymentType.js.map +1 -1
  189. package/mobile/dist/ui-kit/Calculator/renderPayout.js +2 -0
  190. package/mobile/dist/ui-kit/Calculator/renderPayout.js.map +1 -1
  191. package/mobile/dist/ui-kit/Calculator/setDefaultParamsCalc.d.ts +1 -1
  192. package/mobile/lib/common.css +1 -1
  193. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -1
  194. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  195. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -1
  196. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +3 -2
  197. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -1
  198. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  199. package/mobile/lib/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.js +0 -3
  200. package/mobile/lib/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.js.map +1 -1
  201. package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js +0 -2
  202. package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  203. package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.d.ts +1 -2
  204. package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js +17 -8
  205. package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  206. package/mobile/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +31 -1
  207. package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +1 -27
  208. package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  209. package/mobile/lib/components/CalculatorDeposit/normalize.d.ts +2 -3
  210. package/mobile/lib/components/CalculatorDeposit/normalize.js.map +1 -1
  211. package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.d.ts +3 -3
  212. package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js +32 -43
  213. package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
  214. package/mobile/lib/components/CalculatorDeposit/renderRegistrationType.d.ts +1 -1
  215. package/mobile/lib/components/CalculatorDeposit/renderRegistrationType.js +11 -7
  216. package/mobile/lib/components/CalculatorDeposit/renderRegistrationType.js.map +1 -1
  217. package/mobile/lib/components/CalculatorRefinancing/CalculatorRefinancing.js +1 -4
  218. package/mobile/lib/components/CalculatorRefinancing/CalculatorRefinancing.js.map +1 -1
  219. package/mobile/lib/components/Header/useChatBot.js +2 -1
  220. package/mobile/lib/components/Header/useChatBot.js.map +1 -1
  221. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +1 -1
  222. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  223. package/mobile/lib/retail/components/DocumentDialog/DocumentDialog.js +1 -1
  224. package/mobile/lib/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
  225. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
  226. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  227. package/mobile/lib/retail/components/Fields/AddressCourierField.d.ts +9 -0
  228. package/mobile/lib/retail/components/Fields/AddressCourierField.js +48 -0
  229. package/mobile/lib/retail/components/Fields/AddressCourierField.js.map +1 -0
  230. package/mobile/lib/retail/inputs.d.ts +77 -76
  231. package/mobile/lib/retail/inputs.js +6 -1
  232. package/mobile/lib/retail/inputs.js.map +1 -1
  233. package/mobile/lib/retail/model/LeadFormState.d.ts +2 -2
  234. package/mobile/lib/ui-kit/Calculator/getDefaultParams.d.ts +11 -2
  235. package/mobile/lib/ui-kit/Calculator/getDefaultParams.js +7 -1
  236. package/mobile/lib/ui-kit/Calculator/getDefaultParams.js.map +1 -1
  237. package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.d.ts +1 -2
  238. package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
  239. package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
  240. package/mobile/lib/ui-kit/Calculator/renderPaymentType.js +2 -0
  241. package/mobile/lib/ui-kit/Calculator/renderPaymentType.js.map +1 -1
  242. package/mobile/lib/ui-kit/Calculator/renderPayout.js +2 -0
  243. package/mobile/lib/ui-kit/Calculator/renderPayout.js.map +1 -1
  244. package/mobile/lib/ui-kit/Calculator/setDefaultParamsCalc.d.ts +1 -1
  245. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -0
  246. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -0
  247. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +13 -1
  248. package/mobile/src/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.tsx +0 -3
  249. package/mobile/src/components/CalculatorCredit/CalculatorCredit.tsx +0 -2
  250. package/mobile/src/components/CalculatorDeposit/CalculatorDeposit.tsx +38 -15
  251. package/mobile/src/components/CalculatorDeposit/CalculatorDepositContent.ts +41 -0
  252. package/mobile/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +3 -39
  253. package/mobile/src/components/CalculatorDeposit/normalize.tsx +1 -2
  254. package/mobile/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +65 -52
  255. package/mobile/src/components/CalculatorDeposit/renderRegistrationType.tsx +15 -8
  256. package/mobile/src/components/CalculatorRefinancing/CalculatorRefinancing.tsx +1 -4
  257. package/mobile/src/components/Header/useChatBot.ts +3 -2
  258. package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +1 -1
  259. package/mobile/src/retail/components/DocumentDialog/DocumentDialog.tsx +1 -1
  260. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +8 -3
  261. package/mobile/src/retail/components/Fields/AddressCourierField.tsx +74 -0
  262. package/mobile/src/retail/inputs.tsx +10 -1
  263. package/mobile/src/retail/model/LeadFormState.ts +2 -2
  264. package/mobile/src/ui-kit/Calculator/getDefaultParams.tsx +13 -6
  265. package/mobile/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +2 -11
  266. package/mobile/src/ui-kit/Calculator/renderPaymentType.tsx +2 -0
  267. package/mobile/src/ui-kit/Calculator/renderPayout.tsx +2 -0
  268. package/mobile/src/ui-kit/Calculator/setDefaultParamsCalc.tsx +1 -1
  269. package/package.json +1 -1
  270. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -0
  271. package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -0
  272. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +13 -1
  273. package/src/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.tsx +0 -3
  274. package/src/components/CalculatorCredit/CalculatorCredit.tsx +0 -2
  275. package/src/components/CalculatorDeposit/CalculatorDeposit.fixture.tsx +12 -0
  276. package/src/components/CalculatorDeposit/CalculatorDeposit.tsx +38 -15
  277. package/src/components/CalculatorDeposit/CalculatorDepositContent.ts +41 -0
  278. package/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +3 -39
  279. package/src/components/CalculatorDeposit/normalize.tsx +1 -2
  280. package/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +65 -52
  281. package/src/components/CalculatorDeposit/renderRegistrationType.tsx +15 -8
  282. package/src/components/CalculatorRefinancing/CalculatorRefinancing.tsx +1 -4
  283. package/src/components/Header/useChatBot.ts +3 -2
  284. package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +1 -1
  285. package/src/retail/components/DocumentDialog/DocumentDialog.tsx +1 -1
  286. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +8 -3
  287. package/src/retail/components/Fields/AddressCourierField.tsx +74 -0
  288. package/src/retail/inputs.tsx +10 -1
  289. package/src/retail/model/LeadFormState.ts +2 -2
  290. package/src/ui-kit/Calculator/getDefaultParams.tsx +13 -6
  291. package/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +2 -11
  292. package/src/ui-kit/Calculator/renderPaymentType.tsx +2 -0
  293. package/src/ui-kit/Calculator/renderPayout.tsx +2 -0
  294. package/src/ui-kit/Calculator/setDefaultParamsCalc.tsx +1 -1
@@ -1,4 +1,5 @@
1
- import { type DepositCalculatorSourceBookParams } from '../../components/CalculatorDeposit/getDepositCalculatorParams';
1
+ import { type DepositCalculatorSourceBookParams } from '../../components/CalculatorDeposit/CalculatorDepositContent';
2
+ import { type Option } from '../Select/Option';
2
3
  import { type CalcDefaultParamsProps } from './CalculatorProps';
3
4
 
4
5
  export const getDefaultParamsMin = (rateRows?: CalcDefaultParamsProps[]) =>
@@ -9,11 +10,17 @@ export const getDefaultParamsMin = (rateRows?: CalcDefaultParamsProps[]) =>
9
10
  export const getDefaultParamsMax = (
10
11
  rateRows: DepositCalculatorSourceBookParams[] = [],
11
12
  isNewClient = false,
12
- ) =>
13
- getDefaultParams(
14
- [(i: number, acc: number) => i > acc, (i, prev) => i?.minSum < prev?.minSum],
15
- rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)),
16
- );
13
+ extraPercents: Option[] = [],
14
+ ) => {
15
+ return {
16
+ ...getDefaultParams(
17
+ [(i: number, acc: number) => i > acc, (i, prev) => i?.minSum < prev?.minSum],
18
+ rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)),
19
+ ),
20
+ extraPercent: extraPercents.at(-1),
21
+ extraPercents,
22
+ };
23
+ };
17
24
 
18
25
  const getDefaultParams = (
19
26
  comparators: [
@@ -8,7 +8,6 @@ import { Text } from '../../ui-kit/Text/Text';
8
8
  export interface BinaryRadioButtonGroupProps {
9
9
  items: [truthy: RadioButtonItem, falsy: RadioButtonItem];
10
10
  title?: string;
11
- mobileTitle?: string;
12
11
  orientation?: ListOrientation;
13
12
  value?: boolean;
14
13
  className?: string;
@@ -19,27 +18,19 @@ export interface BinaryRadioButtonGroupProps {
19
18
  export const renderBinaryRadioButtonGroup = ({
20
19
  items,
21
20
  title,
22
- mobileTitle = title,
23
21
  orientation = 'horizontal',
24
22
  value,
25
23
  onChange,
26
24
  ...rest
27
25
  }: BinaryRadioButtonGroupProps) => (
28
- <div className="grid gap-s whitespace-nowrap">
26
+ <div className="grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2">
29
27
  {title ? (
30
- <div className="hidden @5xl:block" role="radiogroup" aria-label={title}>
28
+ <div role="radiogroup" aria-label={title}>
31
29
  <Text color="text-secondary-text" font="font-light">
32
30
  {title}
33
31
  </Text>
34
32
  </div>
35
33
  ) : null}
36
- {mobileTitle ? (
37
- <div className="@5xl:hidden" role="radiogroup" aria-label={mobileTitle}>
38
- <Text color="text-secondary-text" font="font-light">
39
- {mobileTitle}
40
- </Text>
41
- </div>
42
- ) : null}
43
34
 
44
35
  <RadioButtonGroup
45
36
  orientation={orientation}
@@ -6,6 +6,8 @@ import {
6
6
  export const renderPaymentType = (props: Partial<BinaryRadioButtonGroupProps>) =>
7
7
  renderBinaryRadioButtonGroup({
8
8
  ...props,
9
+ title: 'Тип платежа',
10
+ orientation: 'vertical',
9
11
  className: 'sm:flex-col',
10
12
  items: [
11
13
  { id: 'annuity', text: 'Аннуитетный' },
@@ -6,6 +6,8 @@ import {
6
6
  export const renderPayout = (props: Partial<BinaryRadioButtonGroupProps>) =>
7
7
  renderBinaryRadioButtonGroup({
8
8
  ...props,
9
+ title: 'Выплата процентов',
10
+ orientation: 'vertical',
9
11
  items: [
10
12
  { id: 'everyMonth', text: 'Ежемесячно' },
11
13
  { id: 'atEndTerm', text: 'В конце срока' },
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  type DepositCalculatorParams,
7
7
  type DepositCalculatorSourceBookParams,
8
- } from '../../components/CalculatorDeposit/getDepositCalculatorParams';
8
+ } from '../../components/CalculatorDeposit/CalculatorDepositContent';
9
9
  import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
10
10
  import { clamp } from '../../utils/clamp';
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.778",
3
+ "version": "0.14.787",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -29,6 +29,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
29
29
  nextStepLink = '/credit-lead',
30
30
  button,
31
31
  productType = 'credit',
32
+ data,
32
33
  ...rest
33
34
  }) => {
34
35
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
@@ -48,6 +49,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
48
49
  programId,
49
50
  nextStepLink,
50
51
  productType,
52
+ data,
51
53
  });
52
54
 
53
55
  const [, { field, onSubmit }] = useForm(initialFormState, {
@@ -1,3 +1,4 @@
1
+ import { type AspectsProps } from '../../model/AspectsProps';
1
2
  import { type TextProps, type TitleProps } from '../../model/HeadlineType';
2
3
  import { type LinkButtonVersion } from '../../model/LinkButtonVersion';
3
4
  import { type InputRetailSectionsType } from '../../retail/model/InputSectionsType';
@@ -13,6 +14,7 @@ export type ProductType = 'credit' | 'creditCard' | 'debitCard';
13
14
  * @title Форма заявки настраиваемая
14
15
  */
15
16
  export type ApplicationLeadFormContent = UniBlockContent &
17
+ AspectsProps &
16
18
  TitleProps &
17
19
  InputRetailSectionsType & {
18
20
  /** @title Кнопка */
@@ -1,6 +1,9 @@
1
1
  /* eslint-disable max-lines */
2
2
  import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
4
+ import { handleAspects } from '../../hooks/useAspects/handleAspects';
5
+ import { useAspects } from '../../hooks/useAspects/useAspects';
6
+ import { type AspectsProps } from '../../model/AspectsProps';
4
7
  import { createDraftTask } from '../../retail/api/createDraftTask';
5
8
  import { createUserProfile } from '../../retail/api/createUserProfile';
6
9
  import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
@@ -15,26 +18,30 @@ import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/Ver
15
18
  import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
16
19
  import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
17
20
  import { useDialog } from '../../ui-kit/DialogManager/useDialog';
21
+ import { type PreventableEventWithTarget } from '../../ui-kit/PreventableEvent';
18
22
  import { formatPhone } from '../../utils/formatPhone';
19
23
  import { type ProductType } from './ApplicationLeadFormContent';
20
24
  import { productTypeToConsentsMap } from './consents';
21
25
  import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
22
26
  import { useSaveUserData, type UserData } from './useSaveUserData';
23
27
 
24
- interface ApplicationLeadApiProps {
28
+ interface ApplicationLeadApiProps extends AspectsProps {
25
29
  programId: string;
26
30
  nextStepLink: string;
27
31
  productType: ProductType;
28
32
  }
29
33
 
34
+ // eslint-disable-next-line max-lines-per-function
30
35
  export const useApplicationLeadApi = ({
31
36
  programId,
32
37
  nextStepLink,
33
38
  productType,
39
+ data,
34
40
  }: ApplicationLeadApiProps) => {
35
41
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
36
42
  const [ok, setOK] = useState<boolean | undefined>();
37
43
  const saveUserData = useSaveUserData();
44
+ const aspects = useAspects();
38
45
 
39
46
  const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
40
47
  const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
@@ -57,6 +64,11 @@ export const useApplicationLeadApi = ({
57
64
  productType,
58
65
  saveUserData,
59
66
  });
67
+ handleAspects({
68
+ aspectsAttributes: data,
69
+ aspects,
70
+ ev: {} as PreventableEventWithTarget,
71
+ });
60
72
  verifyPhoneDialog.close();
61
73
  if (productType === 'debitCard') {
62
74
  openEsiaLoginDialog();
@@ -77,10 +77,7 @@ export const CalculatorBusinessDeposit = UniBlock<CalculatorBusinessDepositProp>
77
77
  <div className="flex flex-col sm:flex-row gap-y-m gap-x-5xl">
78
78
  {renderBusinessDepositParamsForm(calculatorParams, field)}
79
79
  {renderPayout({
80
- title: 'Выплата процентов',
81
- orientation: 'vertical',
82
80
  ...field('isMonthlyInterestPayment'),
83
- className: 'sm:flex-col',
84
81
  })}
85
82
  </div>
86
83
  </div>
@@ -78,8 +78,6 @@ export const CalculatorCredit = UniBlock<CalculatorDepositProps>(
78
78
 
79
79
  const calcParams = getCreditCalculatorParams(userInputParams, calcSource, paramsViewSettings);
80
80
  const paymentTypeElement = renderPaymentType({
81
- title: 'Тип платежа',
82
- orientation: 'vertical',
83
81
  ...field('isAnnuity'),
84
82
  });
85
83
  const { onChange: setMoneyValue } = field('moneyValue');
@@ -97,4 +97,16 @@ export default {
97
97
  <PopupManager />
98
98
  </div>
99
99
  ),
100
+ extraPercents: (
101
+ <div className="container grid grid-cols-12">
102
+ <CalculatorDeposit
103
+ {...calculator}
104
+ title="Калькулятор с задаными дефолтными значениями"
105
+ paramsViewSettings={{
106
+ isShowReplenish: true,
107
+ }}
108
+ />
109
+ <PopupManager />
110
+ </div>
111
+ ),
100
112
  };
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable max-lines, max-lines-per-function */
2
2
  import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type JSONRefObject } from '../../data/JSONRefObject';
4
- import { useForm } from '../../hooks/useForm/useForm';
4
+ import { useForm, type FormFieldRegisterer } from '../../hooks/useForm/useForm';
5
5
  import { Button } from '../../ui-kit/Button/Button';
6
6
  import { CalculatorLayout } from '../../ui-kit/Calculator/CalculatorLayout';
7
7
  import { CalculatorStyle } from '../../ui-kit/Calculator/CalculatorStyle';
@@ -20,13 +20,14 @@ import { UniBlock } from '../../UniBlock/UniBlock';
20
20
  import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
21
21
  import { style } from '../../utils/style';
22
22
  import { isDefaultParams } from '../CalculatorCredit/isDefaultParams';
23
- import { type CalculatorDepositContent } from './CalculatorDepositContent';
24
23
  import {
25
- getDepositCalculatorParams,
24
+ type CalculatorDepositContent,
26
25
  type DepositCalculatorData,
27
26
  type DepositCalculatorSourceBookParams,
28
- type TariffsButtonContent,
29
- } from './getDepositCalculatorParams';
27
+ type DepositParams,
28
+ type LinkButtonWithTypeContent,
29
+ } from './CalculatorDepositContent';
30
+ import { getDepositCalculatorParams } from './getDepositCalculatorParams';
30
31
  import { isRubles } from './isRubles';
31
32
  import { getRows, normalizeDepositParams } from './normalize';
32
33
  import { renderDepositParamsForm } from './renderDepositParamsForm';
@@ -38,6 +39,7 @@ const MAP = {
38
39
  isReplenish: 'isReplenish',
39
40
  isWithdrawn: 'isWithdrawn',
40
41
  moneyValue: 'minSum',
42
+ extraPercent: 'extraPercent',
41
43
  };
42
44
 
43
45
  const DEFAULT_CURRENCY: Option = {
@@ -47,11 +49,13 @@ const DEFAULT_CURRENCY: Option = {
47
49
 
48
50
  const DEPOSIT_DEFAULT_SUM = 20000;
49
51
  const DEPOSIT_DEFAULT_MONTHS = 1;
52
+ const DEPOSIT_DEFAULT_EXTRA_PERCENT = { text: 'Без учета надбавки', key: '0' };
50
53
 
51
54
  export interface CalculatorDepositProps extends CalculatorDepositContent, UniBlockProps {
52
55
  className?: string;
53
56
  calcSource?: DepositCalculatorData & JSONRefObject;
54
57
  }
58
+
55
59
  export const CalculatorDeposit = UniBlock<CalculatorDepositProps>(
56
60
  ({
57
61
  className,
@@ -67,7 +71,7 @@ export const CalculatorDeposit = UniBlock<CalculatorDepositProps>(
67
71
  const currencyOptions = rows?.map((_) => _.currency) ?? [DEFAULT_CURRENCY];
68
72
  const normalize = useCallback(normalizeDepositParams(rows), [rows]);
69
73
 
70
- const [userInputParams, { field }] = useForm(
74
+ const [userInputParams, { field }] = useForm<DepositParams>(
71
75
  {
72
76
  moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
73
77
  monthsValue: getMonthsDefaultValue(defaultParams, DEPOSIT_DEFAULT_MONTHS),
@@ -77,25 +81,30 @@ export const CalculatorDeposit = UniBlock<CalculatorDepositProps>(
77
81
  isWithdrawn: Boolean(defaultParams?.isWithdrawn),
78
82
  isNewClient: Boolean(defaultParams?.isNewClient),
79
83
  currency: DEFAULT_CURRENCY,
84
+ extraPercent: defaultParams?.extraPercent ?? DEPOSIT_DEFAULT_EXTRA_PERCENT,
80
85
  },
81
86
  { normalizer: normalize },
82
87
  );
83
88
 
84
- const currencyValue = field?.('currency')?.value ?? DEFAULT_CURRENCY;
85
- const isNewClient = field?.('isNewClient')?.value;
89
+ const currencyValue = getCurrencyValue(field);
90
+ const isNewClient = Boolean(field?.('isNewClient')?.value);
91
+ const extraPercents = rows?.find((_) => _?.extraPercents)?.extraPercents;
86
92
  const row = getRows(rows, currencyValue);
87
93
  const calcParams = getDepositCalculatorParams(userInputParams, row, paramsViewSettings);
88
94
  const { rate, income, finalSum, type = '' } = calcParams;
89
-
90
95
  const handleDefaultParamsCals = useCallback(() => {
91
96
  setDefaultParamsCalc({
92
97
  field,
93
- defParams: getDefaultParamsMax(row, isNewClient) as DepositCalculatorSourceBookParams,
98
+ defParams: getDefaultParamsMax(
99
+ row,
100
+ isNewClient,
101
+ extraPercents,
102
+ ) as DepositCalculatorSourceBookParams,
94
103
  calcParams,
95
104
  monthsValue: 'minMonths',
96
105
  map: MAP,
97
106
  });
98
- }, [field, rows]);
107
+ }, [field, rows, extraPercents]);
99
108
 
100
109
  useEffect(() => {
101
110
  if (!isDefaultParams(defaultParams) && row) {
@@ -103,7 +112,11 @@ export const CalculatorDeposit = UniBlock<CalculatorDepositProps>(
103
112
  }
104
113
  }, [defaultParams, rows]);
105
114
 
106
- const isMaxRate = rate === getDefaultParamsMax(row, isNewClient)?.rate;
115
+ const extraRate = field?.('extraPercent')?.value?.key;
116
+ const totalRate = getTotalRate(rate, extraRate);
117
+ const isMaxRate =
118
+ rate === getDefaultParamsMax(row, isNewClient)?.rate &&
119
+ extraRate === extraPercents?.at(-1)?.key;
107
120
 
108
121
  return (
109
122
  <CalculatorLayout className={className} title={title} {...rest}>
@@ -132,10 +145,14 @@ export const CalculatorDeposit = UniBlock<CalculatorDepositProps>(
132
145
  ...field('monthsValue'),
133
146
  value: calcParams.monthsValue,
134
147
  })}
135
- {renderDepositParamsForm({ ...calcParams, ...paramsViewSettings }, field)}
148
+ {renderDepositParamsForm(
149
+ { ...calcParams, ...paramsViewSettings },
150
+ field,
151
+ extraPercents,
152
+ )}
136
153
  </div>
137
154
  {renderRate({
138
- rate,
155
+ rate: totalRate,
139
156
  children: renderMaxRateButton(handleDefaultParamsCals, isMaxRate),
140
157
  })}
141
158
  {renderDepositResult({
@@ -154,7 +171,7 @@ export const CalculatorDeposit = UniBlock<CalculatorDepositProps>(
154
171
 
155
172
  const getStep = (key = '') => (isRubles(key) ? 1000 : 100);
156
173
 
157
- const getTariffButton = (buttons: TariffsButtonContent[] = [], btnType = '') => {
174
+ const getTariffButton = (buttons: LinkButtonWithTypeContent[] = [], btnType = '') => {
158
175
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
159
176
  const { type, ...button } = buttons.find((_) => _.type === btnType) ?? {};
160
177
 
@@ -167,3 +184,9 @@ const renderMaxRateButton = (handleDefaultParamsCals: () => void, isMaxRate = fa
167
184
  Показать максимальную ставку
168
185
  </Button>
169
186
  );
187
+
188
+ const getTotalRate = (rate: number, extraRate?: string): number =>
189
+ Number(rate) + Number(extraRate ?? 0);
190
+
191
+ const getCurrencyValue = (field: FormFieldRegisterer<DepositParams>) =>
192
+ field?.('currency')?.value ?? DEFAULT_CURRENCY;
@@ -1,11 +1,47 @@
1
1
  import {
2
+ type CalcDefaultParamsProps,
2
3
  type CalcValueProps,
3
4
  type CommonCalculatorProps,
4
5
  type CommonDefaultParams,
5
6
  } from '../../ui-kit/Calculator/CalculatorProps';
7
+ import type { LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
6
8
  import { type Option } from '../../ui-kit/Select/Option';
7
9
  import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
8
10
 
11
+ export interface DepositCalculatorUserInputParams extends CommonDepositParams, CalcValueProps {}
12
+
13
+ export interface DepositCalculatorParams
14
+ extends DepositCalculatorSourceBookParams,
15
+ DepositCalculatorUserInputParams {
16
+ availableMonths: number[];
17
+ defaultMonth: number;
18
+ income: number;
19
+ finalSum: number;
20
+ currency?: Option;
21
+ }
22
+
23
+ export type LinkButtonWithTypeContent = LinkButtonContent & {
24
+ type?: string;
25
+ };
26
+
27
+ export type DepositCalculatorRowsData = {
28
+ currency: Option;
29
+ rates?: DepositCalculatorSourceBookParams[];
30
+ extraPercents?: Option[];
31
+ };
32
+
33
+ export type DepositCalculatorData = {
34
+ rows?: DepositCalculatorRowsData[];
35
+ buttons?: LinkButtonWithTypeContent[];
36
+ };
37
+
38
+ export interface DepositCalculatorSourceBookParams
39
+ extends CommonDepositParams,
40
+ CalcDefaultParamsProps {
41
+ currency?: Option;
42
+ extraPercent?: Option;
43
+ }
44
+
9
45
  export interface CalculatorDepositParamsViewSettings {
10
46
  /**
11
47
  * @title Выплата процентов
@@ -23,6 +59,8 @@ export interface CalculatorDepositParamsViewSettings {
23
59
  isShowWithdrawn?: boolean;
24
60
  /** @title Новый клиент */
25
61
  isShowNewClient?: boolean;
62
+ /** @title Новый клиент */
63
+ isShowExtraPercent?: boolean;
26
64
  }
27
65
 
28
66
  export interface CommonDepositParams {
@@ -36,6 +74,8 @@ export interface CommonDepositParams {
36
74
  isRemoteRegistration?: boolean;
37
75
  /** @title Новый клиент */
38
76
  isNewClient?: boolean;
77
+ /** @title Дополнительный процент */
78
+ extraPercent?: Option;
39
79
  /** @title Валюта */
40
80
  currency?: Option;
41
81
  /** @hidden */
@@ -43,6 +83,7 @@ export interface CommonDepositParams {
43
83
  }
44
84
 
45
85
  export interface DepositDefaultParams extends CommonDefaultParams, CommonDepositParams {}
86
+
46
87
  export interface DepositParams extends DepositDefaultParams, CalcValueProps {}
47
88
 
48
89
  /**
@@ -1,15 +1,11 @@
1
- import {
2
- type CalcDefaultParamsProps,
3
- type CalcValueProps,
4
- } from '../../ui-kit/Calculator/CalculatorProps';
5
1
  import { checkRangeByKeys, getRangeByKeys } from '../../ui-kit/Calculator/rangeHelpers';
6
- import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
7
- import { type Option } from '../../ui-kit/Select/Option';
8
2
  import { arrayByRange } from '../../utils/arrayByRange';
9
3
  import { mergeIntervals } from '../../utils/mergeIntervals';
10
4
  import {
11
5
  type CalculatorDepositParamsViewSettings,
12
- type CommonDepositParams,
6
+ type DepositCalculatorParams,
7
+ type DepositCalculatorSourceBookParams,
8
+ type DepositCalculatorUserInputParams,
13
9
  } from './CalculatorDepositContent';
14
10
 
15
11
  const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParams = {
@@ -25,38 +21,6 @@ const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParams = {
25
21
  type: '',
26
22
  };
27
23
 
28
- export interface DepositCalculatorSourceBookParams
29
- extends CommonDepositParams,
30
- CalcDefaultParamsProps {
31
- currency?: Option;
32
- }
33
-
34
- export interface DepositCalculatorUserInputParams extends CommonDepositParams, CalcValueProps {}
35
-
36
- export interface DepositCalculatorParams
37
- extends DepositCalculatorSourceBookParams,
38
- DepositCalculatorUserInputParams {
39
- availableMonths: number[];
40
- defaultMonth: number;
41
- income: number;
42
- finalSum: number;
43
- currency?: Option;
44
- }
45
-
46
- export type TariffsButtonContent = LinkButtonContent & {
47
- type?: string;
48
- };
49
-
50
- export type DepositCalculatorRowsData = {
51
- currency: Option;
52
- rates: DepositCalculatorSourceBookParams[];
53
- };
54
-
55
- export type DepositCalculatorData = {
56
- rows?: DepositCalculatorRowsData[];
57
- buttons?: TariffsButtonContent[];
58
- };
59
-
60
24
  export const getDepositCalculatorParams = (
61
25
  userInputParams: DepositCalculatorUserInputParams,
62
26
  rows?: DepositCalculatorSourceBookParams[],
@@ -1,8 +1,7 @@
1
1
  import { getRangeByKeys } from '../../ui-kit/Calculator/rangeHelpers';
2
2
  import { type Option } from '../../ui-kit/Select/Option';
3
3
  import { clamp } from '../../utils/clamp';
4
- import { type DepositParams } from './CalculatorDepositContent';
5
- import { type DepositCalculatorRowsData } from './getDepositCalculatorParams';
4
+ import { type DepositCalculatorRowsData, type DepositParams } from './CalculatorDepositContent';
6
5
  import { isRubles } from './isRubles';
7
6
 
8
7
  export const normalizeDepositParams = (rows?: DepositCalculatorRowsData[]) => (_: DepositParams) =>
@@ -1,71 +1,84 @@
1
1
  import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
2
- import { renderBinaryRadioButtonGroup } from '../../ui-kit/Calculator/renderBinaryRadioButtonGroup';
2
+ import {
3
+ renderBinaryRadioButtonGroup,
4
+ type BinaryRadioButtonGroupProps,
5
+ } from '../../ui-kit/Calculator/renderBinaryRadioButtonGroup';
3
6
  import { renderPayout } from '../../ui-kit/Calculator/renderPayout';
4
7
  import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
5
- import { type CalculatorDepositParamsViewSettings } from './CalculatorDepositContent';
6
- import { type DepositCalculatorParams } from './getDepositCalculatorParams';
8
+ import { type Option } from '../../ui-kit/Select/Option';
9
+ import { Select, type SelectProps } from '../../ui-kit/Select/Select';
10
+ import { Text } from '../../ui-kit/Text/Text';
11
+ import {
12
+ type CalculatorDepositParamsViewSettings,
13
+ type DepositCalculatorParams,
14
+ } from './CalculatorDepositContent';
7
15
  import { renderRegistrationType } from './renderRegistrationType';
8
16
 
9
17
  export const renderDepositParamsForm = (
10
18
  params: DepositCalculatorParams & CalculatorDepositParamsViewSettings,
11
19
  field: FormFieldRegisterer<any>,
20
+ extraPercents?: Option[],
12
21
  ) => {
13
22
  const isCurrency = params?.currency?.key !== 'rub';
14
23
 
15
24
  return (
16
- <div className="grid gap-lg">
17
- <div className="flex gap-lg">
18
- {params.isShowReplenish
19
- ? renderBinaryRadioButtonGroup({
20
- title: 'Пополнение',
21
- ...field('isReplenish'),
22
- value: params.isReplenish,
23
- orientation: 'vertical',
24
- items: [
25
- { id: 'withReplenish', text: 'С пополнением' },
26
- { id: 'withoutReplenish', text: 'Без пополнения' },
27
- ],
28
- disabled: isCurrency,
29
- })
30
- : null}
31
- {params.isShowWithdrawn
32
- ? renderBinaryRadioButtonGroup({
33
- title: 'Снятие',
34
- ...field('isWithdrawn'),
35
- value: params.isWithdrawn,
36
- orientation: 'vertical',
37
- items: [
38
- { id: 'wthDrawn', text: 'Со снятием' },
39
- { id: 'noWithdrawn', text: 'Без снятия' },
40
- ],
41
- disabled: isCurrency,
42
- })
43
- : null}
44
- </div>
25
+ <div className="grid grid-cols-2 gap-lg">
26
+ {renderReplenish(field('isReplenish'), params, isCurrency)}
27
+ {renderWithdrawn(field('isWithdrawn'), params, isCurrency)}
45
28
  {renderSeparator(params.isShowReplenish || params.isShowWithdrawn)}
46
- <div className="flex gap-lg">
47
- {params.isShowMonthlyInterestPayment
48
- ? renderPayout({
49
- title: 'Выплата процентов',
50
- ...field('isMonthlyInterestPayment'),
51
- value: params.isMonthlyInterestPayment,
52
- orientation: 'vertical',
53
- })
54
- : null}
55
- {params.isShowRemoteRegistration
56
- ? renderRegistrationType({
57
- title: 'Оформление',
58
- ...field('isRemoteRegistration'),
59
- value: params.isRemoteRegistration,
60
- orientation: 'vertical',
61
- })
62
- : null}
63
- </div>
64
- {renderSeparator(params.isShowNewClient)}
29
+ {params.isShowMonthlyInterestPayment ? renderPayout(field('isMonthlyInterestPayment')) : null}
30
+ {renderRegistrationType(field('isRemoteRegistration'), params.isShowRemoteRegistration)}
31
+ {renderExtraPercents(field('extraPercent'), extraPercents)}
65
32
  {params.isShowNewClient ? <Checkbox text="Новый вкладчик" {...field('isNewClient')} /> : null}
66
33
  </div>
67
34
  );
68
35
  };
69
36
 
37
+ const renderReplenish = (
38
+ props: Partial<BinaryRadioButtonGroupProps>,
39
+ params: DepositCalculatorParams & CalculatorDepositParamsViewSettings,
40
+ isCurrency = false,
41
+ ) =>
42
+ params.isShowReplenish
43
+ ? renderBinaryRadioButtonGroup({
44
+ ...props,
45
+ title: 'Пополнение',
46
+ orientation: 'vertical',
47
+ items: [
48
+ { id: 'withReplenish', text: 'С пополнением' },
49
+ { id: 'withoutReplenish', text: 'Без пополнения' },
50
+ ],
51
+ disabled: isCurrency,
52
+ })
53
+ : null;
54
+
55
+ const renderWithdrawn = (
56
+ props: Partial<BinaryRadioButtonGroupProps>,
57
+ params: DepositCalculatorParams & CalculatorDepositParamsViewSettings,
58
+ isCurrency = false,
59
+ ) =>
60
+ params.isShowWithdrawn
61
+ ? renderBinaryRadioButtonGroup({
62
+ ...props,
63
+ title: 'Снятие',
64
+ orientation: 'vertical',
65
+ items: [
66
+ { id: 'wthDrawn', text: 'Со снятием' },
67
+ { id: 'noWithdrawn', text: 'Без снятия' },
68
+ ],
69
+ disabled: isCurrency,
70
+ })
71
+ : null;
72
+
70
73
  const renderSeparator = (isShow = false) =>
71
- isShow ? <div className="border-b border-main-divider w-full"></div> : null;
74
+ isShow ? <div className="border-b border-main-divider col-span-2 w-full"></div> : null;
75
+
76
+ const renderExtraPercents = (props: Partial<SelectProps>, extraPercents?: Option[]) =>
77
+ extraPercents?.length ? (
78
+ <div className="w-full space-y-s col-span-2">
79
+ <Text color="text-secondary-text" font="font-light">
80
+ Надбавка за операции по карте
81
+ </Text>
82
+ <Select options={extraPercents} {...props} />
83
+ </div>
84
+ ) : null;