@redneckz/wildless-cms-uni-blocks 0.14.699 → 0.14.701

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 (283) hide show
  1. package/bundle/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  2. package/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  3. package/bundle/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  4. package/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
  5. package/bundle/api/RetailAPI/updateUserTask.d.ts +13 -9
  6. package/bundle/bundle.umd.js +271 -50
  7. package/bundle/bundle.umd.min.js +1 -1
  8. package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  9. package/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  10. package/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  11. package/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  12. package/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  13. package/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  14. package/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  15. package/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
  16. package/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  17. package/dist/api/RetailAPI/draftTasksKZO.js +9 -0
  18. package/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
  19. package/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  20. package/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
  21. package/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  22. package/dist/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  23. package/dist/api/RetailAPI/getPaymentSystems.js +1 -4
  24. package/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  25. package/dist/api/RetailAPI/getTaskById.d.ts +6 -0
  26. package/dist/api/RetailAPI/getTaskById.js +9 -0
  27. package/dist/api/RetailAPI/getTaskById.js.map +1 -0
  28. package/dist/api/RetailAPI/updateUserTask.d.ts +13 -9
  29. package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  30. package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  31. package/dist/components/ApplicationLeadForm/getInitialFormState.js +1 -1
  32. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  33. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  34. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  35. package/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  36. package/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
  37. package/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  38. package/dist/components/CreditCardForm/formStateMap.js +1 -1
  39. package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  40. package/dist/components/GrantSupport/GrantSupport.js +1 -1
  41. package/dist/components/GrantSupport/GrantSupport.js.map +1 -1
  42. package/dist/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js +1 -1
  43. package/dist/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js.map +1 -1
  44. package/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  45. package/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
  46. package/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  47. package/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  48. package/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
  49. package/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  50. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  51. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
  52. package/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  53. package/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  54. package/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
  55. package/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  56. package/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  57. package/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
  58. package/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  59. package/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
  60. package/dist/ui-kit/DraftDialog/utils.js +85 -0
  61. package/dist/ui-kit/DraftDialog/utils.js.map +1 -0
  62. package/dist/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  63. package/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  64. package/dist/ui-kit/FormField/Fields/PaymentSystemField.js +3 -1
  65. package/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  66. package/dist/ui-kit/FormField/getObjectValidator.js +10 -10
  67. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  68. package/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  69. package/lib/api/RetailAPI/draftTasksKZO.js +6 -0
  70. package/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
  71. package/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  72. package/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
  73. package/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  74. package/lib/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  75. package/lib/api/RetailAPI/getPaymentSystems.js +1 -4
  76. package/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  77. package/lib/api/RetailAPI/getTaskById.d.ts +6 -0
  78. package/lib/api/RetailAPI/getTaskById.js +6 -0
  79. package/lib/api/RetailAPI/getTaskById.js.map +1 -0
  80. package/lib/api/RetailAPI/updateUserTask.d.ts +13 -9
  81. package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  82. package/lib/common.css +1 -1
  83. package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  84. package/lib/components/ApplicationLeadForm/getInitialFormState.js +1 -1
  85. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  86. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  87. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  88. package/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  89. package/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
  90. package/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  91. package/lib/components/CreditCardForm/formStateMap.js +1 -1
  92. package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  93. package/lib/components/GrantSupport/GrantSupport.js +1 -1
  94. package/lib/components/GrantSupport/GrantSupport.js.map +1 -1
  95. package/lib/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js +1 -1
  96. package/lib/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js.map +1 -1
  97. package/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  98. package/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
  99. package/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  100. package/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  101. package/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
  102. package/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  103. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  104. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
  105. package/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  106. package/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  107. package/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
  108. package/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  109. package/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  110. package/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
  111. package/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  112. package/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
  113. package/lib/ui-kit/DraftDialog/utils.js +78 -0
  114. package/lib/ui-kit/DraftDialog/utils.js.map +1 -0
  115. package/lib/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  116. package/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  117. package/lib/ui-kit/FormField/Fields/PaymentSystemField.js +4 -2
  118. package/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  119. package/lib/ui-kit/FormField/getObjectValidator.js +10 -10
  120. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  121. package/mobile/bundle/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  122. package/mobile/bundle/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  123. package/mobile/bundle/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  124. package/mobile/bundle/api/RetailAPI/getTaskById.d.ts +6 -0
  125. package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +13 -9
  126. package/mobile/bundle/bundle.umd.js +271 -50
  127. package/mobile/bundle/bundle.umd.min.js +1 -1
  128. package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  129. package/mobile/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  130. package/mobile/bundle/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  131. package/mobile/bundle/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  132. package/mobile/bundle/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  133. package/mobile/bundle/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  134. package/mobile/bundle/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  135. package/mobile/bundle/ui-kit/DraftDialog/utils.d.ts +138 -0
  136. package/mobile/dist/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  137. package/mobile/dist/api/RetailAPI/draftTasksKZO.js +9 -0
  138. package/mobile/dist/api/RetailAPI/draftTasksKZO.js.map +1 -0
  139. package/mobile/dist/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  140. package/mobile/dist/api/RetailAPI/getLastTaskStatus.js +9 -0
  141. package/mobile/dist/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  142. package/mobile/dist/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  143. package/mobile/dist/api/RetailAPI/getPaymentSystems.js +1 -4
  144. package/mobile/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  145. package/mobile/dist/api/RetailAPI/getTaskById.d.ts +6 -0
  146. package/mobile/dist/api/RetailAPI/getTaskById.js +9 -0
  147. package/mobile/dist/api/RetailAPI/getTaskById.js.map +1 -0
  148. package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +13 -9
  149. package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  150. package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  151. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +1 -1
  152. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  153. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  154. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  155. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  156. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js +19 -0
  157. package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  158. package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -1
  159. package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  160. package/mobile/dist/components/GrantSupport/GrantSupport.js +1 -1
  161. package/mobile/dist/components/GrantSupport/GrantSupport.js.map +1 -1
  162. package/mobile/dist/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js +1 -1
  163. package/mobile/dist/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js.map +1 -1
  164. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  165. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js +10 -0
  166. package/mobile/dist/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  167. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  168. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js +43 -0
  169. package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  170. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  171. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js +22 -0
  172. package/mobile/dist/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  173. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  174. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js +65 -0
  175. package/mobile/dist/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  176. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  177. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js +16 -0
  178. package/mobile/dist/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  179. package/mobile/dist/ui-kit/DraftDialog/utils.d.ts +138 -0
  180. package/mobile/dist/ui-kit/DraftDialog/utils.js +85 -0
  181. package/mobile/dist/ui-kit/DraftDialog/utils.js.map +1 -0
  182. package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  183. package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  184. package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js +3 -1
  185. package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  186. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +10 -10
  187. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  188. package/mobile/lib/api/RetailAPI/draftTasksKZO.d.ts +26 -0
  189. package/mobile/lib/api/RetailAPI/draftTasksKZO.js +6 -0
  190. package/mobile/lib/api/RetailAPI/draftTasksKZO.js.map +1 -0
  191. package/mobile/lib/api/RetailAPI/getLastTaskStatus.d.ts +6 -0
  192. package/mobile/lib/api/RetailAPI/getLastTaskStatus.js +6 -0
  193. package/mobile/lib/api/RetailAPI/getLastTaskStatus.js.map +1 -0
  194. package/mobile/lib/api/RetailAPI/getPaymentSystems.d.ts +2 -4
  195. package/mobile/lib/api/RetailAPI/getPaymentSystems.js +1 -4
  196. package/mobile/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  197. package/mobile/lib/api/RetailAPI/getTaskById.d.ts +6 -0
  198. package/mobile/lib/api/RetailAPI/getTaskById.js +6 -0
  199. package/mobile/lib/api/RetailAPI/getTaskById.js.map +1 -0
  200. package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +13 -9
  201. package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  202. package/mobile/lib/common.css +1 -1
  203. package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +8 -8
  204. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +1 -1
  205. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  206. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +32 -21
  207. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  208. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +9 -0
  209. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js +16 -0
  210. package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -0
  211. package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -1
  212. package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  213. package/mobile/lib/components/GrantSupport/GrantSupport.js +1 -1
  214. package/mobile/lib/components/GrantSupport/GrantSupport.js.map +1 -1
  215. package/mobile/lib/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js +1 -1
  216. package/mobile/lib/ui-kit/ApplicationFormLayout/ApplicationFormLayout.js.map +1 -1
  217. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.d.ts +7 -0
  218. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js +8 -0
  219. package/mobile/lib/ui-kit/DraftDialog/DraftActionButton.js.map +1 -0
  220. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.d.ts +7 -0
  221. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js +41 -0
  222. package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -0
  223. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.d.ts +4 -0
  224. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js +20 -0
  225. package/mobile/lib/ui-kit/DraftDialog/EmptyDraftDialog.js.map +1 -0
  226. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.d.ts +3 -0
  227. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js +62 -0
  228. package/mobile/lib/ui-kit/DraftDialog/parseDraftTask.js.map +1 -0
  229. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.d.ts +10 -0
  230. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js +13 -0
  231. package/mobile/lib/ui-kit/DraftDialog/useDraftDialog.js.map +1 -0
  232. package/mobile/lib/ui-kit/DraftDialog/utils.d.ts +138 -0
  233. package/mobile/lib/ui-kit/DraftDialog/utils.js +78 -0
  234. package/mobile/lib/ui-kit/DraftDialog/utils.js.map +1 -0
  235. package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js +1 -1
  236. package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
  237. package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js +4 -2
  238. package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
  239. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +10 -10
  240. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  241. package/mobile/src/api/RetailAPI/draftTasksKZO.ts +33 -0
  242. package/mobile/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
  243. package/mobile/src/api/RetailAPI/getPaymentSystems.ts +3 -10
  244. package/mobile/src/api/RetailAPI/getTaskById.ts +12 -0
  245. package/mobile/src/api/RetailAPI/updateUserTask.ts +14 -9
  246. package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +8 -8
  247. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -1
  248. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
  249. package/mobile/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
  250. package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -1
  251. package/mobile/src/components/GrantSupport/GrantSupport.tsx +1 -1
  252. package/mobile/src/ui-kit/ApplicationFormLayout/ApplicationFormLayout.tsx +1 -1
  253. package/mobile/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
  254. package/mobile/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
  255. package/mobile/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
  256. package/mobile/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
  257. package/mobile/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
  258. package/mobile/src/ui-kit/DraftDialog/utils.ts +148 -0
  259. package/mobile/src/ui-kit/FormField/Fields/CardCategoryField.tsx +1 -1
  260. package/mobile/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +14 -6
  261. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +10 -10
  262. package/package.json +1 -1
  263. package/src/api/RetailAPI/draftTasksKZO.ts +33 -0
  264. package/src/api/RetailAPI/getLastTaskStatus.ts +21 -0
  265. package/src/api/RetailAPI/getPaymentSystems.ts +3 -10
  266. package/src/api/RetailAPI/getTaskById.ts +12 -0
  267. package/src/api/RetailAPI/updateUserTask.ts +14 -9
  268. package/src/components/ApplicationLeadForm/LeadFormState.ts +8 -8
  269. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -1
  270. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +31 -33
  271. package/src/components/ApplicationLeadForm/useSaveUserData.ts +29 -0
  272. package/src/components/CreditCardForm/formStateMap.tsx +1 -1
  273. package/src/components/GrantSupport/GrantSupport.tsx +1 -1
  274. package/src/ui-kit/ApplicationFormLayout/ApplicationFormLayout.tsx +1 -1
  275. package/src/ui-kit/DraftDialog/DraftActionButton.tsx +32 -0
  276. package/src/ui-kit/DraftDialog/DraftDialog.tsx +91 -0
  277. package/src/ui-kit/DraftDialog/EmptyDraftDialog.tsx +47 -0
  278. package/src/ui-kit/DraftDialog/parseDraftTask.ts +123 -0
  279. package/src/ui-kit/DraftDialog/useDraftDialog.tsx +21 -0
  280. package/src/ui-kit/DraftDialog/utils.ts +148 -0
  281. package/src/ui-kit/FormField/Fields/CardCategoryField.tsx +1 -1
  282. package/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +14 -6
  283. package/src/ui-kit/FormField/getObjectValidator.tsx +10 -10
@@ -1210,7 +1210,7 @@
1210
1210
 
1211
1211
  const ApplicationFormLayout = JSX((props) => {
1212
1212
  const { className, title, children, ...rest } = props;
1213
- return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-lg", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, children] }) }));
1213
+ return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container space-y-lg", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, children] }) }));
1214
1214
  });
1215
1215
 
1216
1216
  function useDialog(Dialog, initialProps = {}) {
@@ -1632,14 +1632,14 @@
1632
1632
  birthday: defaultValidator('Укажите дату рождения'),
1633
1633
  limitedBirthday: limitedBirthdayValidator(),
1634
1634
  birthPlace: defaultValidator('Укажите место рождения'),
1635
- education: defaultValidator('Выберите ваше образование'),
1636
- housing: defaultValidator('Выберите тип жилья'),
1637
- employment: defaultValidator('Выберите информацию о трудоустройстве'),
1638
- organization: defaultValidator('Выберите тип организации'),
1639
- amountWorkers: defaultValidator('Выберите информацию о количестве сотрудников'),
1640
- employerActivities: defaultValidator('Выберите вид деятельности организации'),
1641
- employerOrganization: defaultValidator('Выберите вид организации'),
1642
- positionOrganization: defaultValidator('Выберите вашу должность'),
1635
+ education: defaultSelectValidator('Выберите ваше образование'),
1636
+ housing: defaultSelectValidator('Выберите тип жилья'),
1637
+ employment: defaultSelectValidator('Выберите информацию о трудоустройстве'),
1638
+ organization: defaultSelectValidator('Выберите тип организации'),
1639
+ amountWorkers: defaultSelectValidator('Выберите информацию о количестве сотрудников'),
1640
+ employerActivities: defaultSelectValidator('Выберите вид деятельности организации'),
1641
+ employerOrganization: defaultSelectValidator('Выберите вид организации'),
1642
+ positionOrganization: defaultSelectValidator('Выберите вашу должность'),
1643
1643
  dulSerie: serieValidator('Укажите серию паспорта'),
1644
1644
  dulNumber: numberValidator('Укажите номер паспорта'),
1645
1645
  dulIssueDateField: defaultValidator('Укажите дату выдачи паспорта'),
@@ -1675,7 +1675,7 @@
1675
1675
  consentPfrFlg: agreementValidator,
1676
1676
  consentOthersFlg: agreementValidator,
1677
1677
  consentInformFlg: agreementValidator,
1678
- familyStatus: defaultValidator('Выберите семейное положение'),
1678
+ familyStatus: defaultSelectValidator('Выберите семейное положение'),
1679
1679
  children: lengthStringValidator(2, 'Укажите количество детей'),
1680
1680
  familyMembers: lengthStringValidator(2, 'Укажите количество членов семьи'),
1681
1681
  dependents: lengthStringValidator(2, 'Укажите количество иждивенцев'),
@@ -1701,7 +1701,7 @@
1701
1701
  addressRetail: defaultSelectValidator('Выберите адрес банка'),
1702
1702
  addressMatch: defaultValidator(),
1703
1703
  codeWord: codeWordValidator('Необходимо ввести кодовое слово'),
1704
- confirmationIncome: defaultValidator(),
1704
+ confirmationIncome: defaultSelectValidator(),
1705
1705
  deliveryDate: defaultValidator('Укажите дату доставки'),
1706
1706
  addressCourier: addressDaDataValidator(),
1707
1707
  cardCategory: defaultValidator('Укажите категорию карты'),
@@ -3165,7 +3165,7 @@
3165
3165
  const [cardTypes, setCardTypes] = useState([]);
3166
3166
  const [programId] = useLocalStorage('programId');
3167
3167
  const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
3168
- const selectedPaymentSystem = field('paymentSystem').value;
3168
+ const selectedPaymentSystem = field('paymentSystem')?.value?.type;
3169
3169
  useEffect(() => {
3170
3170
  if (selectedPaymentSystem && programId) {
3171
3171
  (async () => {
@@ -3947,10 +3947,7 @@
3947
3947
  const data = await fetchRetailJSON('/public-data/creditProgramConditions', 'POST', {
3948
3948
  creditProgramId,
3949
3949
  });
3950
- return (data?.paymentSystems?.map((paymentSystem) => ({
3951
- id: paymentSystem.type,
3952
- text: paymentSystem.name,
3953
- })) ?? []);
3950
+ return data?.paymentSystems || [];
3954
3951
  };
3955
3952
 
3956
3953
  const PaymentSystemField = JSX(({ field, input }) => {
@@ -3965,8 +3962,10 @@
3965
3962
  })();
3966
3963
  }
3967
3964
  }, []);
3968
- return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: paymentSystemOptions, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required) }));
3965
+ const handleChange = useCallback((type) => onChange?.(paymentSystemOptions?.find((_) => _.type === type)), [paymentSystemOptions, onChange]);
3966
+ return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: formatPaymentSystems(paymentSystemOptions), ...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required), value: value?.type, onChange: handleChange }));
3969
3967
  });
3968
+ const formatPaymentSystems = (paymentSystems) => paymentSystems?.map((_) => ({ id: _.type, text: _.name })) ?? [];
3970
3969
 
3971
3970
  const isPlaceholder = (_) => _ === '_';
3972
3971
  const isDigit = (_) => /\d/.test(_);
@@ -4458,6 +4457,16 @@
4458
4457
 
4459
4458
  const createUserProfile = (body) => fetchRetailJSON('/public-data/createUserProfile', 'POST', body).then((res) => res?.profile?.id || null);
4460
4459
 
4460
+ const getLastTaskStatus = async (body) => {
4461
+ const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
4462
+ return res?.statusCd === 'DRAFT' ? res?.taskId : null;
4463
+ };
4464
+
4465
+ const getTaskById = async (body) => {
4466
+ const res = await fetchRetailJSON('/user-data/getTaskById', 'POST', body);
4467
+ return res || undefined;
4468
+ };
4469
+
4461
4470
  const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
4462
4471
 
4463
4472
  const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
@@ -4485,16 +4494,6 @@
4485
4494
  };
4486
4495
  };
4487
4496
 
4488
- const useSetter = (target, key) => useCallback((value) => {
4489
- const newValue = value instanceof Function ? value(target[key]) : value;
4490
- if (newValue !== null && newValue !== undefined) {
4491
- target[key] = newValue;
4492
- }
4493
- else {
4494
- delete target[key];
4495
- }
4496
- }, [target, key]);
4497
-
4498
4497
  const sendCode = (body) => fetchRetailJSON('/sms/sendCode', 'POST', body).then((res) => !isErrorResult(res, body.phoneNumber));
4499
4498
  const isErrorResult = (res, phoneNumber) => Boolean(res) &&
4500
4499
  typeof res !== 'string' &&
@@ -4768,6 +4767,208 @@
4768
4767
  };
4769
4768
  };
4770
4769
 
4770
+ const useLeadFormStore = () => useLocalStore();
4771
+
4772
+ const useSetter = (target, key) => useCallback((value) => {
4773
+ const newValue = value instanceof Function ? value(target[key]) : value;
4774
+ if (newValue !== null && newValue !== undefined) {
4775
+ target[key] = newValue;
4776
+ }
4777
+ else {
4778
+ delete target[key];
4779
+ }
4780
+ }, [target, key]);
4781
+
4782
+ const DraftActionButton = JSX(({ title, icon, description, onClick = noop }) => (jsxs("button", { className: "flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green", type: "button", onClick: onClick, children: [jsx(Img, { image: { src: icon }, width: "78", height: "78" }), jsxs("div", { children: [jsx(Heading, { className: "text-left", title: title, headingType: "h5" }), description ? (jsx(Paragraph, { color: "text-secondary-text", size: "text-m", children: description })) : null] })] })));
4783
+
4784
+ const creditCodesToProgrammIdMap = {
4785
+ credit_cash: '10',
4786
+ credit_cash_single_doc: '28',
4787
+ credit_mcx: '39',
4788
+ family_offer_credit: '41',
4789
+ gas_engine_fuel: '33',
4790
+ pension_credit: '12',
4791
+ ref_credit: '11',
4792
+ ref_credit_single_doc: '29',
4793
+ self_employed: '34',
4794
+ summer_cash: '35',
4795
+ summer_cash_pens: '36',
4796
+ };
4797
+ const cardCodesToProgrammIdMap = {
4798
+ amur_card: '14',
4799
+ owner_card: '13',
4800
+ travel_card: '15',
4801
+ };
4802
+ const creditProgramCodeToProductIdMap = {
4803
+ ...creditCodesToProgrammIdMap,
4804
+ ...cardCodesToProgrammIdMap,
4805
+ };
4806
+ const getParticipantIncomes$1 = (participantIncomes) => {
4807
+ const wages = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "WAGES" /* EIncomesType.WAGES */)?.value;
4808
+ const mandatoryPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "MANDATORY_PAYMENTS" /* EIncomesType.MANDATORY_PAYMENTS */)?.value;
4809
+ const incomeAverage = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "INCOME_AVERAGE" /* EIncomesType.INCOME_AVERAGE */)?.value;
4810
+ const additionalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "ADDITIONAL_INCOME" /* EIncomesType.ADDITIONAL_INCOME */)?.value;
4811
+ const otherIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_INCOME" /* EIncomesType.OTHER_INCOME */)?.value;
4812
+ const otherPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "OTHER_PAYMENTS" /* EIncomesType.OTHER_PAYMENTS */)?.value;
4813
+ const rentalIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RENTAL_INCOME" /* EIncomesType.RENTAL_INCOME */)?.value;
4814
+ const retirementIncome = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "RETIREMENT_INCOME" /* EIncomesType.RETIREMENT_INCOME */)?.value;
4815
+ return {
4816
+ wages,
4817
+ mandatoryPayments,
4818
+ incomeAverage,
4819
+ additionalIncome,
4820
+ otherIncome,
4821
+ otherPayments,
4822
+ rentalIncome,
4823
+ retirementIncome,
4824
+ };
4825
+ };
4826
+ const getParticipantAddresses$1 = (participantAddresses) => {
4827
+ const addressRegistration = participantAddresses?.find((address) => address.addressType.key === "REGISTRATION" /* EAddressType.REGISTRATION */);
4828
+ const addressFact = participantAddresses?.find((address) => address.addressType.key === "RESIDENTAL" /* EAddressType.RESIDENTAL */);
4829
+ const organizationAddress = participantAddresses?.find((address) => address.addressType.key === "WORK" /* EAddressType.WORK */);
4830
+ return {
4831
+ addressRegistration,
4832
+ addressFact,
4833
+ organizationAddress,
4834
+ };
4835
+ };
4836
+ const getParticipantContacts$1 = (participantContacts) => {
4837
+ const email = participantContacts?.find((contact) => contact.contactTypeCd.key === "EMAIL" /* EContactType.EMail */)?.value;
4838
+ const phone = participantContacts?.find((contact) => contact.contactTypeCd.key === "MAIN_PHONE" /* EContactType.MainPhone */)?.value;
4839
+ const organizationPhone = participantContacts?.find((contact) => contact.contactTypeCd.key === "ORGANIZATION_PHONE" /* EContactType.OrganizationPhone */)?.value;
4840
+ return {
4841
+ email,
4842
+ phone,
4843
+ organizationPhone,
4844
+ };
4845
+ };
4846
+ const getParticipantGender = (gender) => {
4847
+ return gender?.key
4848
+ ? {
4849
+ sex: gender.key === 'MAN' ? 'male' : 'female',
4850
+ }
4851
+ : null;
4852
+ };
4853
+ const getSelectValue = (option) => {
4854
+ return option?.key
4855
+ ? {
4856
+ key: option.key,
4857
+ text: option.value,
4858
+ }
4859
+ : undefined;
4860
+ };
4861
+
4862
+ const parseDraftTask = (task) => {
4863
+ const participant = task.participants[0];
4864
+ const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
4865
+ const { currencyCode: currency, paymentSystemTypeCd: paymentSystem, classCard: cardCategory, codeWord, birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDateField, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, } = participant;
4866
+ return {
4867
+ currency: currency?.key,
4868
+ paymentSystem,
4869
+ cardCategory: getSelectValue(cardCategory),
4870
+ codeWord,
4871
+ limitedBirthday,
4872
+ middleName,
4873
+ name,
4874
+ surname,
4875
+ birthPlace,
4876
+ dulIssueDateField,
4877
+ dulIssuedBy,
4878
+ dulNumber,
4879
+ dulSerie,
4880
+ dulSubdivisionCode,
4881
+ education: getSelectValue(education),
4882
+ participantDateRegistration,
4883
+ housing: getSelectValue(housing),
4884
+ beginDate,
4885
+ employment: getSelectValue(employment),
4886
+ organizationName,
4887
+ inn,
4888
+ employerActivities: getSelectValue(employerActivities),
4889
+ organization: getSelectValue(organization),
4890
+ employerOrganization: getSelectValue(employerOrganization),
4891
+ amountWorkers: getSelectValue(amountWorkers),
4892
+ legalForm,
4893
+ generalSeniority: generalSeniority?.toString(),
4894
+ experience5Years: experience5Years?.toString(),
4895
+ jobsNumber: jobsNumber?.toString(),
4896
+ lastJobExperience: lastJobExperience?.toString(),
4897
+ positionOrganization: getSelectValue(positionOrganization),
4898
+ familyStatus: getSelectValue(familyStatus),
4899
+ children: children?.toString(),
4900
+ familyMembers: familyMembers?.toString(),
4901
+ dependents: dependents?.toString(),
4902
+ conscription: getSelectValue(conscription),
4903
+ snils,
4904
+ armyIdFlg,
4905
+ bankruptcyFlg,
4906
+ shareholderFlg,
4907
+ legalEntityName,
4908
+ creditInRshbCd: getSelectValue(creditInRshbCd),
4909
+ calculator: {
4910
+ isInsurance,
4911
+ isSalaryClient,
4912
+ moneyValue,
4913
+ monthsValue,
4914
+ isAnnuity: paymentTypeCd?.key === 'ANNUITY',
4915
+ },
4916
+ ...getParticipantIncomes$1(participantIncomes),
4917
+ ...getParticipantAddresses$1(participantAddresses),
4918
+ ...getParticipantContacts$1(participantContacts),
4919
+ ...getParticipantGender(genderCd),
4920
+ };
4921
+ };
4922
+
4923
+ const DraftDialog = JSX(function ({ task, isFromLead = false, onClose = noop, }) {
4924
+ const leadFormStore = useLeadFormStore();
4925
+ const saveForm = useSetter(leadFormStore, 'leadForm');
4926
+ const navigator = locationNavigator();
4927
+ const { participants, creditProgram, id: taskId } = task;
4928
+ const programmId = creditProgramCodeToProductIdMap[creditProgram.code];
4929
+ const isCredit = Boolean(creditCodesToProgrammIdMap[creditProgram.code]);
4930
+ const nextStepLink = isCredit ? '/credit-lead' : '/credit-card-lead';
4931
+ const { name, midname, id: participantId, profile } = participants[0];
4932
+ const handleGoToDraft = useCallback(() => {
4933
+ const taskFromDraft = parseDraftTask(task);
4934
+ leadFormStore.participantId = participantId;
4935
+ leadFormStore.taskId = taskId;
4936
+ leadFormStore.profileId = profile?.id;
4937
+ leadFormStore.programId = programmId;
4938
+ saveForm(taskFromDraft);
4939
+ navigator.assign(nextStepLink);
4940
+ }, []);
4941
+ const handleGoToNewTask = useCallback(() => {
4942
+ navigator.assign(isCredit ? '/natural/loans/all-goals' : '/natural/creditcards/svoya');
4943
+ }, []);
4944
+ const handleGoToMainPage = useCallback(() => {
4945
+ navigator.assign('/');
4946
+ }, []);
4947
+ const appeal = name && midname ? `${name} ${midname}, ` : '';
4948
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg", children: [jsx(Heading, { className: "whitespace-pre-wrap", title: `${appeal}мы нашли черновик вашей заявки.\nПродолжите заполнение?`, headingType: "h5" }), jsx(DraftActionButton, { title: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0443", icon: "api/v1/wcms-file-storage/72d06937-5d8b-4996-9503-52389b93919e/file.svg", description: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0430\u0439\u0442\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u044F\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u0438\u0437 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", onClick: handleGoToDraft }), jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Заполнить новую заявку', icon: "api/v1/wcms-file-storage/796c3e8d-341a-480b-b52f-3aa5784ed623/file.svg", onClick: isFromLead ? onClose : handleGoToNewTask }), jsx(Button, { type: "button", version: "secondary", className: "w-full text-h5", onClick: handleGoToMainPage, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })] }) }));
4949
+ });
4950
+
4951
+ const EmptyDraftDialog = JSX(function ({ onClose = noop }) {
4952
+ const navigator = locationNavigator();
4953
+ const handleGoNewTask = useCallback(() => {
4954
+ navigator.assign('/natural/loans/all-goals');
4955
+ }, []);
4956
+ const handleGoMainPage = useCallback(() => {
4957
+ navigator.assign('/');
4958
+ }, []);
4959
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg", children: [jsx(Heading, { className: "text-center", title: "\u0417\u0430\u044F\u0432\u043A\u0438 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B", headingType: "h3" }), jsx(Paragraph, { size: "text-l", align: "text-center", children: "\u041F\u043E \u0434\u0430\u043D\u043D\u043E\u043C\u0443 \u043D\u043E\u043C\u0435\u0440\u0443 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043D\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044B\u0445 \u0437\u0430\u044F\u0432\u043E\u043A. \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443 \u0438\u043B\u0438 \u0432\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443" }), jsx(Button, { type: "button", className: "w-full", onClick: handleGoNewTask, children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443" }), jsx(Button, { type: "button", version: "secondary", className: "w-full", onClick: handleGoMainPage, children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })] }) }));
4960
+ });
4961
+
4962
+ const useDraftDialog = () => {
4963
+ const { open: openDraftDialog } = useDialog(DraftDialog);
4964
+ const { open: openEmptyDraftDialog } = useDialog(EmptyDraftDialog);
4965
+ return {
4966
+ open: ({ task, isFromLead, onClose }) => {
4967
+ task ? openDraftDialog({ task, isFromLead, onClose }) : openEmptyDraftDialog({});
4968
+ },
4969
+ };
4970
+ };
4971
+
4771
4972
  const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
4772
4973
 
4773
4974
  const EsiaLoginDialog = JSX(({ onClose }) => {
@@ -4899,22 +5100,26 @@
4899
5100
  };
4900
5101
  };
4901
5102
 
4902
- const useLeadFormStore = () => useLocalStore();
4903
-
4904
- const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
4905
- const [responseStatus, setResponseStatus] = useState('');
5103
+ const useSaveUserData = () => {
4906
5104
  const leadFormStore = useLeadFormStore();
4907
5105
  const saveForm = useSetter(leadFormStore, 'leadForm');
4908
- const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
4909
- const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
4910
- const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
4911
- const saveUserData = useCallback(({ participantId, taskId, profileId, programId: programNumber }) => {
5106
+ const saveUserData = useCallback(({ participantId, taskId, profileId, formData, programId: programNumber }) => {
4912
5107
  leadFormStore.participantId = participantId;
4913
5108
  leadFormStore.taskId = taskId;
4914
5109
  leadFormStore.profileId = profileId;
4915
5110
  leadFormStore.programId = programNumber;
5111
+ saveForm(formData);
4916
5112
  }, []);
4917
- // eslint-disable-next-line consistent-return
5113
+ return saveUserData;
5114
+ };
5115
+
5116
+ const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
5117
+ const [responseStatus, setResponseStatus] = useState('');
5118
+ const saveUserData = useSaveUserData();
5119
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5120
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5121
+ const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5122
+ const draftDialog = useDraftDialog();
4918
5123
  const handleSubmit = useCallback(async (formData) => {
4919
5124
  const feedbackValidator = objectValidator(getObjectValidator(inputs));
4920
5125
  if (!isValidationSuccess(feedbackValidator(formData))) {
@@ -4925,17 +5130,34 @@
4925
5130
  profile: { phone: formatPhone(formData.phone) },
4926
5131
  });
4927
5132
  if (profileId && formData?.phone) {
5133
+ const sendCurrentTask = async () => {
5134
+ await updateUserData({
5135
+ programId,
5136
+ profileId,
5137
+ formData,
5138
+ saveUserData,
5139
+ });
5140
+ verifyPhoneDialog.close();
5141
+ consentBkiDialog.open(formData.phone, profileId);
5142
+ };
4928
5143
  const handleSuccessVerify = async () => {
4929
5144
  try {
4930
- await updateUserData({
4931
- programId,
5145
+ const lastTaskId = await getLastTaskStatus({
4932
5146
  profileId,
4933
- formData,
4934
- saveUserData,
4935
- saveForm,
5147
+ programId,
4936
5148
  });
4937
- verifyPhoneDialog.close();
4938
- consentBkiDialog.open(formData.phone, profileId);
5149
+ if (lastTaskId) {
5150
+ const task = await getTaskById({ taskId: lastTaskId });
5151
+ verifyPhoneDialog.close();
5152
+ draftDialog.open({
5153
+ task,
5154
+ isFromLead: true,
5155
+ onClose: sendCurrentTask,
5156
+ });
5157
+ }
5158
+ else {
5159
+ await sendCurrentTask();
5160
+ }
4939
5161
  }
4940
5162
  catch {
4941
5163
  setResponseStatus('Fail');
@@ -4960,7 +5182,7 @@
4960
5182
  responseStatus,
4961
5183
  };
4962
5184
  };
4963
- const updateUserData = async ({ programId, profileId, formData, saveUserData, saveForm, }) => {
5185
+ const updateUserData = async ({ programId, profileId, formData, saveUserData, }) => {
4964
5186
  const transformedForm = transformOtherConsentsField(formData);
4965
5187
  await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
4966
5188
  const { taskId, participantId } = await createDraftTask({
@@ -4978,8 +5200,7 @@
4978
5200
  catch (ex) {
4979
5201
  console.log(ex);
4980
5202
  }
4981
- saveUserData({ participantId, taskId, profileId, programId });
4982
- saveForm(formData);
5203
+ saveUserData({ participantId, taskId, profileId, programId, formData });
4983
5204
  };
4984
5205
  const transformOtherConsentsField = (formData) => {
4985
5206
  const { consentOthersFlg, ...form } = formData;
@@ -5027,7 +5248,7 @@
5027
5248
  addressRegistration: '',
5028
5249
  participantDateRegistration: undefined,
5029
5250
  currency: '',
5030
- paymentSystem: '',
5251
+ paymentSystem: { name: '', type: '' },
5031
5252
  cardCategory: { key: '', text: '' },
5032
5253
  codeWord: '',
5033
5254
  addressRetail: { key: '', text: '' },
@@ -6672,7 +6893,7 @@
6672
6893
 
6673
6894
  const formStateMap$1 = [
6674
6895
  {
6675
- paymentSystem: '',
6896
+ paymentSystem: { name: '', type: '' },
6676
6897
  currency: '810',
6677
6898
  codeWord: '',
6678
6899
  },
@@ -8739,7 +8960,7 @@
8739
8960
  });
8740
8961
  const regionHref = regions?.find((_) => _.name === region.key)?.href;
8741
8962
  const buttonText = button?.text ? button.text : 'Перейти';
8742
- return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-m", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, regions ? (jsx(SelectControl, { label: "\u0412\u0430\u0448 \u0440\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ name = '' }) => ({ key: name, text: name })), value: region, onChange: setRegion })) : null, regionHref ? (jsx("div", { className: "text-center", children: jsx(LinkButton, { href: regionHref, target: "_blank", className: style('p-m w-full @xl:w-auto', buttonStyle), data: getAspectsWithInclude(data, region?.key), children: buttonText }) })) : null] }) }));
8963
+ return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container space-y-m", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, regions ? (jsx(SelectControl, { label: "\u0412\u0430\u0448 \u0440\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ name = '' }) => ({ key: name, text: name })), value: region, onChange: setRegion })) : null, regionHref ? (jsx("div", { className: "text-center", children: jsx(LinkButton, { href: regionHref, target: "_blank", className: style('p-m w-full @xl:w-auto', buttonStyle), data: getAspectsWithInclude(data, region?.key), children: buttonText }) })) : null] }) }));
8743
8964
  });
8744
8965
 
8745
8966
  const BUTTON_STYLE = {
@@ -10168,7 +10389,7 @@
10168
10389
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10169
10390
  });
10170
10391
 
10171
- const packageVersion = "0.14.698";
10392
+ const packageVersion = "0.14.700";
10172
10393
 
10173
10394
  exports.Blocks = Blocks;
10174
10395
  exports.ContentPage = ContentPage;