@redneckz/wildless-cms-uni-blocks 0.14.714 → 0.14.715

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 (173) hide show
  1. package/bundle/bundle.umd.js +44 -32
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
  4. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
  5. package/bundle/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
  6. package/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
  7. package/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
  8. package/bundle/components/CreditForm/useCreditFormAPI.d.ts +1 -1
  9. package/bundle/ui-kit/Button/Button.d.ts +1 -0
  10. package/bundle/ui-kit/Loader/Loader.d.ts +1 -0
  11. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
  12. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  13. package/dist/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
  14. package/dist/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
  15. package/dist/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
  16. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
  17. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  18. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  19. package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -2
  20. package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  21. package/dist/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
  22. package/dist/components/CreditCardForm/StepsNavigationButtons.js +2 -2
  23. package/dist/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
  24. package/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
  25. package/dist/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
  26. package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  27. package/dist/components/CreditForm/CreditFormStep.js +2 -2
  28. package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  29. package/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
  30. package/dist/components/CreditForm/StepsNavigationButtons.js +2 -2
  31. package/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
  32. package/dist/components/CreditForm/useCreditFormAPI.d.ts +1 -1
  33. package/dist/components/CreditForm/useCreditFormAPI.js +7 -1
  34. package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
  35. package/dist/ui-kit/Button/Button.d.ts +1 -0
  36. package/dist/ui-kit/Button/Button.js +6 -5
  37. package/dist/ui-kit/Button/Button.js.map +1 -1
  38. package/dist/ui-kit/Loader/Loader.d.ts +1 -0
  39. package/dist/ui-kit/Loader/Loader.js +2 -2
  40. package/dist/ui-kit/Loader/Loader.js.map +1 -1
  41. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
  42. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  43. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
  44. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  45. package/lib/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
  46. package/lib/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
  47. package/lib/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
  48. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
  49. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  50. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  51. package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -2
  52. package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  53. package/lib/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
  54. package/lib/components/CreditCardForm/StepsNavigationButtons.js +2 -2
  55. package/lib/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
  56. package/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
  57. package/lib/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
  58. package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  59. package/lib/components/CreditForm/CreditFormStep.js +2 -2
  60. package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  61. package/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
  62. package/lib/components/CreditForm/StepsNavigationButtons.js +2 -2
  63. package/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
  64. package/lib/components/CreditForm/useCreditFormAPI.d.ts +1 -1
  65. package/lib/components/CreditForm/useCreditFormAPI.js +7 -1
  66. package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
  67. package/lib/ui-kit/Button/Button.d.ts +1 -0
  68. package/lib/ui-kit/Button/Button.js +7 -6
  69. package/lib/ui-kit/Button/Button.js.map +1 -1
  70. package/lib/ui-kit/Loader/Loader.d.ts +1 -0
  71. package/lib/ui-kit/Loader/Loader.js +2 -2
  72. package/lib/ui-kit/Loader/Loader.js.map +1 -1
  73. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
  74. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  75. package/mobile/bundle/bundle.umd.js +44 -32
  76. package/mobile/bundle/bundle.umd.min.js +1 -1
  77. package/mobile/bundle/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
  78. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
  79. package/mobile/bundle/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
  80. package/mobile/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
  81. package/mobile/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
  82. package/mobile/bundle/components/CreditForm/useCreditFormAPI.d.ts +1 -1
  83. package/mobile/bundle/ui-kit/Button/Button.d.ts +1 -0
  84. package/mobile/bundle/ui-kit/Loader/Loader.d.ts +1 -0
  85. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
  86. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  87. package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
  88. package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
  89. package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
  90. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
  91. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  92. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  93. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -2
  94. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  95. package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
  96. package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js +2 -2
  97. package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
  98. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
  99. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
  100. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  101. package/mobile/dist/components/CreditForm/CreditFormStep.js +2 -2
  102. package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  103. package/mobile/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
  104. package/mobile/dist/components/CreditForm/StepsNavigationButtons.js +2 -2
  105. package/mobile/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
  106. package/mobile/dist/components/CreditForm/useCreditFormAPI.d.ts +1 -1
  107. package/mobile/dist/components/CreditForm/useCreditFormAPI.js +7 -1
  108. package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
  109. package/mobile/dist/ui-kit/Button/Button.d.ts +1 -0
  110. package/mobile/dist/ui-kit/Button/Button.js +6 -5
  111. package/mobile/dist/ui-kit/Button/Button.js.map +1 -1
  112. package/mobile/dist/ui-kit/Loader/Loader.d.ts +1 -0
  113. package/mobile/dist/ui-kit/Loader/Loader.js +2 -2
  114. package/mobile/dist/ui-kit/Loader/Loader.js.map +1 -1
  115. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
  116. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  117. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
  118. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  119. package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
  120. package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
  121. package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
  122. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
  123. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  124. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  125. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -2
  126. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  127. package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
  128. package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js +2 -2
  129. package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
  130. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
  131. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
  132. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  133. package/mobile/lib/components/CreditForm/CreditFormStep.js +2 -2
  134. package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  135. package/mobile/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
  136. package/mobile/lib/components/CreditForm/StepsNavigationButtons.js +2 -2
  137. package/mobile/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
  138. package/mobile/lib/components/CreditForm/useCreditFormAPI.d.ts +1 -1
  139. package/mobile/lib/components/CreditForm/useCreditFormAPI.js +7 -1
  140. package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
  141. package/mobile/lib/ui-kit/Button/Button.d.ts +1 -0
  142. package/mobile/lib/ui-kit/Button/Button.js +7 -6
  143. package/mobile/lib/ui-kit/Button/Button.js.map +1 -1
  144. package/mobile/lib/ui-kit/Loader/Loader.d.ts +1 -0
  145. package/mobile/lib/ui-kit/Loader/Loader.js +2 -2
  146. package/mobile/lib/ui-kit/Loader/Loader.js.map +1 -1
  147. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
  148. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  149. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -2
  150. package/mobile/src/components/ApplicationLeadForm/renderSubmitButton.tsx +2 -2
  151. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +12 -7
  152. package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -2
  153. package/mobile/src/components/CreditCardForm/StepsNavigationButtons.tsx +17 -12
  154. package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +7 -2
  155. package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -2
  156. package/mobile/src/components/CreditForm/StepsNavigationButtons.tsx +17 -12
  157. package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +7 -2
  158. package/mobile/src/ui-kit/Button/Button.tsx +7 -3
  159. package/mobile/src/ui-kit/Loader/Loader.tsx +5 -3
  160. package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +5 -4
  161. package/package.json +1 -1
  162. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -2
  163. package/src/components/ApplicationLeadForm/renderSubmitButton.tsx +2 -2
  164. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +12 -7
  165. package/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -2
  166. package/src/components/CreditCardForm/StepsNavigationButtons.tsx +17 -12
  167. package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +7 -2
  168. package/src/components/CreditForm/CreditFormStep.tsx +2 -2
  169. package/src/components/CreditForm/StepsNavigationButtons.tsx +17 -12
  170. package/src/components/CreditForm/useCreditFormAPI.tsx +7 -2
  171. package/src/ui-kit/Button/Button.tsx +7 -3
  172. package/src/ui-kit/Loader/Loader.tsx +5 -3
  173. package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +5 -4
@@ -1988,9 +1988,9 @@
1988
1988
  return (jsx(CheckboxWithError, { text: "\u0410\u0434\u0440\u0435\u0441 \u0444\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043C\u0435\u0441\u0442\u0430 \u0436\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u0435\u0442 \u0441 \u0430\u0434\u0440\u0435\u0441\u043E\u043C \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438", ...getValidation(field('addressMatch'), validatorObj.addressMatch, input?.required) }));
1989
1989
  });
1990
1990
 
1991
- const Loader = JSX(({ color = 'text-primary-main', position = 'absolute', blur = true }) => (jsx("div", { className: style('flex justify-center items-center h-full w-full z-50', position, {
1991
+ const Loader = JSX(({ color = 'text-primary-main', position = 'absolute', blur = true, size = 'big' }) => (jsx("div", { className: style('flex justify-center items-center h-full w-full z-50', position, {
1992
1992
  'backdrop-blur': blur,
1993
- }), children: jsx("div", { className: style('inline-block h-28 w-28', 'animate-spin rounded-full', 'border-8 border-solid border-current', 'border-r-transparent', color), role: "status" }) })));
1993
+ }), children: jsx("div", { className: style('inline-block ', 'animate-spin rounded-full', 'border-solid border-current', 'border-r-transparent', size === 'small' ? 'border-4 h-8 w-8' : 'border-8 h-28 w-28', color), role: "status" }) })));
1994
1994
 
1995
1995
  const MapMarkerClusterIcon = '/icons/MapMarkerClusterIcon.svg';
1996
1996
  const MapMarkerClusterYellowIcon = '/icons/MapMarkerClusterYellowIcon.svg';
@@ -3255,14 +3255,14 @@
3255
3255
  };
3256
3256
  const Button = JSX(({ children, ...props }) => {
3257
3257
  const button = useButton();
3258
- const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
3259
- return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', {
3258
+ const { className, version = 'primary', active, disabled, isLoading, type = 'button', rounded = true, role, onClick, } = button(props);
3259
+ return (jsxs("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs relative', {
3260
3260
  'text-white bg-primary-active': active,
3261
- 'bg-main-gray text-main-disabled cursor-not-allowed': disabled,
3261
+ 'bg-main-gray text-main-disabled cursor-not-allowed': disabled || isLoading,
3262
3262
  'rounded-md': rounded,
3263
- }, !active && !disabled
3263
+ }, !active && !disabled && !isLoading
3264
3264
  ? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
3265
- : '', className), type: type, role: role, onClick: onClick, children: children }));
3265
+ : '', className), type: type, role: role, onClick: onClick, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] }));
3266
3266
  });
3267
3267
 
3268
3268
  const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
@@ -4478,7 +4478,7 @@
4478
4478
  },
4479
4479
  ];
4480
4480
 
4481
- const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
4481
+ const renderSubmitButton = (button, isSending) => (jsx(Button, { className: style('w-full @xl:w-auto'), type: "submit", isLoading: isSending, children: button?.text ? button.text : 'Отправить заявку' }));
4482
4482
 
4483
4483
  const createDraftTask = async (body) => {
4484
4484
  const res = await fetchRetailJSON('/user-data/createDraftTask', 'POST', body);
@@ -4659,7 +4659,7 @@
4659
4659
 
4660
4660
  const useVerifyPhoneDialogSubmit = ({ values, onSuccess, }) => {
4661
4661
  const [errorText, setErrorText] = useState('');
4662
- const [isLoading, setIsLoading] = useState(false);
4662
+ const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
4663
4663
  const [timeNextReq, setTimeNextReq] = useState(0);
4664
4664
  const [isTimerStarted, setIsTimerStarted] = useState(false);
4665
4665
  const [attempts, setAttempts] = useState(0);
@@ -4671,19 +4671,19 @@
4671
4671
  setIsTimerStarted(false);
4672
4672
  setTimeNextReq(0);
4673
4673
  setAttempts((_) => _ + 1);
4674
- setIsLoading(true);
4674
+ startLoading();
4675
4675
  await checkCode({
4676
4676
  smsText: values.join(''),
4677
4677
  smsCodesSetName: { key: 'AUTHENTICATION' },
4678
4678
  });
4679
4679
  resetError();
4680
- onSuccess?.(values.join(''));
4680
+ await onSuccess?.(values.join(''));
4681
4681
  }
4682
4682
  catch {
4683
4683
  setErrorText(attempts > 1 ? 'Исчерпан лимит ввода смс-кода' : 'Неверный код');
4684
4684
  }
4685
4685
  finally {
4686
- setIsLoading(false);
4686
+ endLoading();
4687
4687
  }
4688
4688
  }, [values, attempts]);
4689
4689
  useEffect(() => {
@@ -5134,6 +5134,7 @@
5134
5134
 
5135
5135
  const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
5136
5136
  const [responseStatus, setResponseStatus] = useState('');
5137
+ const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5137
5138
  const saveUserData = useSaveUserData();
5138
5139
  const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5139
5140
  const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
@@ -5145,6 +5146,7 @@
5145
5146
  return;
5146
5147
  }
5147
5148
  try {
5149
+ startSending();
5148
5150
  const profileId = await createUserProfile({
5149
5151
  profile: { phone: formatPhone(formData.phone) },
5150
5152
  });
@@ -5161,10 +5163,7 @@
5161
5163
  };
5162
5164
  const handleSuccessVerify = async () => {
5163
5165
  try {
5164
- const lastTaskId = await getLastTaskStatus({
5165
- profileId,
5166
- programId,
5167
- });
5166
+ const lastTaskId = await getLastTaskStatus({ profileId, programId });
5168
5167
  if (lastTaskId) {
5169
5168
  const task = await getTaskById({ taskId: lastTaskId });
5170
5169
  verifyPhoneDialog.close();
@@ -5182,14 +5181,13 @@
5182
5181
  setResponseStatus('Fail');
5183
5182
  }
5184
5183
  };
5185
- const acceptedConsents = Object.keys(CONSENTS)
5186
- .filter((_) => formData[_])
5187
- .map((_) => CONSENTS[_]?.text);
5184
+ const acceptedConsents = getAcceptedConsents(formData);
5188
5185
  verifyPhoneDialog.open({
5189
5186
  phone: formData?.phone,
5190
5187
  consents: acceptedConsents,
5191
5188
  onSuccess: handleSuccessVerify,
5192
5189
  });
5190
+ endSending();
5193
5191
  }
5194
5192
  }
5195
5193
  catch {
@@ -5199,8 +5197,12 @@
5199
5197
  return {
5200
5198
  handleSubmit,
5201
5199
  responseStatus,
5200
+ isSending,
5202
5201
  };
5203
5202
  };
5203
+ const getAcceptedConsents = (formData) => Object.keys(CONSENTS)
5204
+ .filter((_) => formData[_])
5205
+ .map((_) => CONSENTS[_]?.text);
5204
5206
  const updateUserData = async ({ programId, profileId, formData, saveUserData, }) => {
5205
5207
  const transformedForm = transformOtherConsentsField(formData);
5206
5208
  await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
@@ -5387,7 +5389,7 @@
5387
5389
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, ...rest }) => {
5388
5390
  const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
5389
5391
  const [initialFormState, { isLoading }] = useInitApplicationLead(inputs, nextStepLink);
5390
- const { handleSubmit, responseStatus } = useApplicationLeadApi({
5392
+ const { handleSubmit, responseStatus, isSending } = useApplicationLeadApi({
5391
5393
  inputs,
5392
5394
  programId,
5393
5395
  nextStepLink,
@@ -5399,7 +5401,7 @@
5399
5401
  responseTypeDialog.open({ responseType: responseStatus });
5400
5402
  }
5401
5403
  }, [responseStatus]);
5402
- return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$2({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
5404
+ return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$2({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button, isSending)] }) }));
5403
5405
  });
5404
5406
 
5405
5407
  const NotFound = JSX(({ title, description }) => {
@@ -6970,10 +6972,10 @@
6970
6972
  });
6971
6973
  const getValue$3 = (field) => (name) => field(name)?.value;
6972
6974
 
6973
- const StepsNavigationButtons$1 = JSX(({ step, onPrevStep }) => {
6975
+ const StepsNavigationButtons$1 = JSX(({ step, isSending, onPrevStep }) => {
6974
6976
  const isFirstStep = step === 0;
6975
6977
  const isFinalStep = step === 5;
6976
- return (jsxs("div", { className: "flex justify-between gap-m", children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { type: "submit", children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
6978
+ return (jsxs("div", { className: "flex justify-between gap-m", children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { isLoading: isSending, type: "submit", children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
6977
6979
  });
6978
6980
 
6979
6981
  const getAdditionalInfoData = (formData) => {
@@ -7263,6 +7265,7 @@
7263
7265
  };
7264
7266
 
7265
7267
  const useCreditCardFormAPI = ({ step, inputs, onNextStep, onFinish, }) => {
7268
+ const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
7266
7269
  const isFinalStep = step === 5;
7267
7270
  const retailFormStore = useRetailFormStore();
7268
7271
  const initialState = useMemo(() => getInitialFormState$1(step, retailFormStore.leadForm), [step, retailFormStore.leadForm]);
@@ -7287,6 +7290,7 @@
7287
7290
  if (!isValidationSuccess(feedbackValidator(formData))) {
7288
7291
  return;
7289
7292
  }
7293
+ startSending();
7290
7294
  retailFormStore.leadForm = formData;
7291
7295
  try {
7292
7296
  const { taskId, profileId, participantId } = retailFormStore;
@@ -7308,21 +7312,24 @@
7308
7312
  catch (ex) {
7309
7313
  // Do nothing
7310
7314
  }
7315
+ finally {
7316
+ endSending();
7317
+ }
7311
7318
  }, [isFinalStep, resetForm]);
7312
- return [initialState, handleSubmit];
7319
+ return [initialState, handleSubmit, isSending];
7313
7320
  };
7314
7321
  const getValue$2 = (formData) => (name) => formData[name];
7315
7322
 
7316
7323
  const CreditCardFormStep = JSX(({ step, sections, isFormFinished, onPrevStep, onNextStep, onFinish }) => {
7317
7324
  const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
7318
- const [initialState, onSubmit] = useCreditCardFormAPI({
7325
+ const [initialState, onSubmit, isSending] = useCreditCardFormAPI({
7319
7326
  step,
7320
7327
  inputs,
7321
7328
  onNextStep,
7322
7329
  onFinish,
7323
7330
  });
7324
7331
  const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
7325
- return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step }), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
7332
+ return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step }), jsx(StepsNavigationButtons$1, { isSending: isSending, step: step, onPrevStep: onPrevStep })] }));
7326
7333
  });
7327
7334
 
7328
7335
  const PERSONAL_INFO_CONTENT = [
@@ -7920,10 +7927,10 @@
7920
7927
  });
7921
7928
  const getValue$1 = (field) => (name) => field(name)?.value;
7922
7929
 
7923
- const StepsNavigationButtons = JSX(({ step, onPrevStep }) => {
7930
+ const StepsNavigationButtons = JSX(({ step, onPrevStep, isSending }) => {
7924
7931
  const isFirstStep = step === 0;
7925
7932
  const isFinalStep = step === 5;
7926
- return (jsxs("div", { className: 'flex justify-between gap-m', children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { type: "submit", children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
7933
+ return (jsxs("div", { className: 'flex justify-between gap-m', children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { type: "submit", isLoading: isSending, children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
7927
7934
  });
7928
7935
 
7929
7936
  const PAYMENT_TYPE_DATA = {
@@ -8102,6 +8109,7 @@
8102
8109
  };
8103
8110
 
8104
8111
  const useCreditFormAPI = ({ step, inputs, onNextStep, onFinish, }) => {
8112
+ const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
8105
8113
  const isFinalStep = step === 5;
8106
8114
  const retailFormStore = useRetailFormStore();
8107
8115
  const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm), [step, retailFormStore.leadForm]);
@@ -8126,6 +8134,7 @@
8126
8134
  if (!isValidationSuccess(feedbackValidator(formData))) {
8127
8135
  return;
8128
8136
  }
8137
+ startSending();
8129
8138
  retailFormStore.leadForm = formData;
8130
8139
  try {
8131
8140
  const { taskId, profileId, participantId } = retailFormStore;
@@ -8147,8 +8156,11 @@
8147
8156
  catch (ex) {
8148
8157
  // Do nothing
8149
8158
  }
8159
+ finally {
8160
+ endSending();
8161
+ }
8150
8162
  }, [isFinalStep, resetForm]);
8151
- return [initialState, handleSubmit];
8163
+ return [initialState, handleSubmit, isSending];
8152
8164
  };
8153
8165
  const getValue = (formData) => (name) => formData[name];
8154
8166
 
@@ -8156,14 +8168,14 @@
8156
8168
  const { programId } = useRetailFormStore();
8157
8169
  const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
8158
8170
  const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
8159
- const [initialState, onSubmit] = useCreditFormAPI({
8171
+ const [initialState, onSubmit, isSending] = useCreditFormAPI({
8160
8172
  step,
8161
8173
  inputs,
8162
8174
  onNextStep,
8163
8175
  onFinish,
8164
8176
  });
8165
8177
  const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
8166
- return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, onPrevStep: onPrevStep })] }));
8178
+ return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
8167
8179
  });
8168
8180
 
8169
8181
  const stepsSectionsMap = [
@@ -10106,7 +10118,7 @@
10106
10118
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10107
10119
  });
10108
10120
 
10109
- const packageVersion = "0.14.713";
10121
+ const packageVersion = "0.14.714";
10110
10122
 
10111
10123
  exports.Blocks = Blocks;
10112
10124
  exports.ContentPage = ContentPage;