@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.
- package/bundle/bundle.umd.js +44 -32
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/bundle/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/bundle/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/bundle/ui-kit/Button/Button.d.ts +1 -0
- package/bundle/ui-kit/Loader/Loader.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
- package/dist/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -2
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/dist/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/dist/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.js +2 -2
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/dist/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +7 -1
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/ui-kit/Button/Button.d.ts +1 -0
- package/dist/ui-kit/Button/Button.js +6 -5
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Loader/Loader.d.ts +1 -0
- package/dist/ui-kit/Loader/Loader.js +2 -2
- package/dist/ui-kit/Loader/Loader.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
- package/lib/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -2
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/lib/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/lib/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.js +2 -2
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/lib/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +7 -1
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/ui-kit/Button/Button.d.ts +1 -0
- package/lib/ui-kit/Button/Button.js +7 -6
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Loader/Loader.d.ts +1 -0
- package/lib/ui-kit/Loader/Loader.js +2 -2
- package/lib/ui-kit/Loader/Loader.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +44 -32
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/mobile/bundle/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/mobile/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/bundle/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/mobile/bundle/ui-kit/Button/Button.d.ts +1 -0
- package/mobile/bundle/ui-kit/Loader/Loader.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -2
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js +2 -2
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +7 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/ui-kit/Button/Button.d.ts +1 -0
- package/mobile/dist/ui-kit/Button/Button.js +6 -5
- package/mobile/dist/ui-kit/Button/Button.js.map +1 -1
- package/mobile/dist/ui-kit/Loader/Loader.d.ts +1 -0
- package/mobile/dist/ui-kit/Loader/Loader.js +2 -2
- package/mobile/dist/ui-kit/Loader/Loader.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -2
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js +2 -2
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +7 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/ui-kit/Button/Button.d.ts +1 -0
- package/mobile/lib/ui-kit/Button/Button.js +7 -6
- package/mobile/lib/ui-kit/Button/Button.js.map +1 -1
- package/mobile/lib/ui-kit/Loader/Loader.d.ts +1 -0
- package/mobile/lib/ui-kit/Loader/Loader.js +2 -2
- package/mobile/lib/ui-kit/Loader/Loader.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -2
- package/mobile/src/components/ApplicationLeadForm/renderSubmitButton.tsx +2 -2
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +12 -7
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -2
- package/mobile/src/components/CreditCardForm/StepsNavigationButtons.tsx +17 -12
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +7 -2
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -2
- package/mobile/src/components/CreditForm/StepsNavigationButtons.tsx +17 -12
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +7 -2
- package/mobile/src/ui-kit/Button/Button.tsx +7 -3
- package/mobile/src/ui-kit/Loader/Loader.tsx +5 -3
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +5 -4
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -2
- package/src/components/ApplicationLeadForm/renderSubmitButton.tsx +2 -2
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +12 -7
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -2
- package/src/components/CreditCardForm/StepsNavigationButtons.tsx +17 -12
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +7 -2
- package/src/components/CreditForm/CreditFormStep.tsx +2 -2
- package/src/components/CreditForm/StepsNavigationButtons.tsx +17 -12
- package/src/components/CreditForm/useCreditFormAPI.tsx +7 -2
- package/src/ui-kit/Button/Button.tsx +7 -3
- package/src/ui-kit/Loader/Loader.tsx +5 -3
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +5 -4
package/bundle/bundle.umd.js
CHANGED
|
@@ -1980,9 +1980,9 @@
|
|
|
1980
1980
|
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) }));
|
|
1981
1981
|
});
|
|
1982
1982
|
|
|
1983
|
-
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, {
|
|
1983
|
+
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, {
|
|
1984
1984
|
'backdrop-blur': blur,
|
|
1985
|
-
}), children: jsx("div", { className: style('inline-block
|
|
1985
|
+
}), 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" }) })));
|
|
1986
1986
|
|
|
1987
1987
|
const MapMarkerClusterIcon = '/icons/MapMarkerClusterIcon.svg';
|
|
1988
1988
|
const MapMarkerClusterYellowIcon = '/icons/MapMarkerClusterYellowIcon.svg';
|
|
@@ -3247,14 +3247,14 @@
|
|
|
3247
3247
|
};
|
|
3248
3248
|
const Button = JSX(({ children, ...props }) => {
|
|
3249
3249
|
const button = useButton();
|
|
3250
|
-
const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
|
|
3251
|
-
return (
|
|
3250
|
+
const { className, version = 'primary', active, disabled, isLoading, type = 'button', rounded = true, role, onClick, } = button(props);
|
|
3251
|
+
return (jsxs("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs relative', {
|
|
3252
3252
|
'text-white bg-primary-active': active,
|
|
3253
|
-
'bg-main-gray text-main-disabled cursor-not-allowed': disabled,
|
|
3253
|
+
'bg-main-gray text-main-disabled cursor-not-allowed': disabled || isLoading,
|
|
3254
3254
|
'rounded-md': rounded,
|
|
3255
|
-
}, !active && !disabled
|
|
3255
|
+
}, !active && !disabled && !isLoading
|
|
3256
3256
|
? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
|
|
3257
|
-
: '', className), type: type, role: role, onClick: onClick, children: children }));
|
|
3257
|
+
: '', className), type: type, role: role, onClick: onClick, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] }));
|
|
3258
3258
|
});
|
|
3259
3259
|
|
|
3260
3260
|
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" }) })));
|
|
@@ -4470,7 +4470,7 @@
|
|
|
4470
4470
|
},
|
|
4471
4471
|
];
|
|
4472
4472
|
|
|
4473
|
-
const renderSubmitButton = (button,
|
|
4473
|
+
const renderSubmitButton = (button, isSending) => (jsx(Button, { className: style('w-full @xl:w-auto'), type: "submit", isLoading: isSending, children: button?.text ? button.text : 'Отправить заявку' }));
|
|
4474
4474
|
|
|
4475
4475
|
const createDraftTask = async (body) => {
|
|
4476
4476
|
const res = await fetchRetailJSON('/user-data/createDraftTask', 'POST', body);
|
|
@@ -4651,7 +4651,7 @@
|
|
|
4651
4651
|
|
|
4652
4652
|
const useVerifyPhoneDialogSubmit = ({ values, onSuccess, }) => {
|
|
4653
4653
|
const [errorText, setErrorText] = useState('');
|
|
4654
|
-
const [isLoading,
|
|
4654
|
+
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
4655
4655
|
const [timeNextReq, setTimeNextReq] = useState(0);
|
|
4656
4656
|
const [isTimerStarted, setIsTimerStarted] = useState(false);
|
|
4657
4657
|
const [attempts, setAttempts] = useState(0);
|
|
@@ -4663,19 +4663,19 @@
|
|
|
4663
4663
|
setIsTimerStarted(false);
|
|
4664
4664
|
setTimeNextReq(0);
|
|
4665
4665
|
setAttempts((_) => _ + 1);
|
|
4666
|
-
|
|
4666
|
+
startLoading();
|
|
4667
4667
|
await checkCode({
|
|
4668
4668
|
smsText: values.join(''),
|
|
4669
4669
|
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
4670
4670
|
});
|
|
4671
4671
|
resetError();
|
|
4672
|
-
onSuccess?.(values.join(''));
|
|
4672
|
+
await onSuccess?.(values.join(''));
|
|
4673
4673
|
}
|
|
4674
4674
|
catch {
|
|
4675
4675
|
setErrorText(attempts > 1 ? 'Исчерпан лимит ввода смс-кода' : 'Неверный код');
|
|
4676
4676
|
}
|
|
4677
4677
|
finally {
|
|
4678
|
-
|
|
4678
|
+
endLoading();
|
|
4679
4679
|
}
|
|
4680
4680
|
}, [values, attempts]);
|
|
4681
4681
|
useEffect(() => {
|
|
@@ -5126,6 +5126,7 @@
|
|
|
5126
5126
|
|
|
5127
5127
|
const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
|
|
5128
5128
|
const [responseStatus, setResponseStatus] = useState('');
|
|
5129
|
+
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
5129
5130
|
const saveUserData = useSaveUserData();
|
|
5130
5131
|
const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
|
|
5131
5132
|
const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
|
|
@@ -5137,6 +5138,7 @@
|
|
|
5137
5138
|
return;
|
|
5138
5139
|
}
|
|
5139
5140
|
try {
|
|
5141
|
+
startSending();
|
|
5140
5142
|
const profileId = await createUserProfile({
|
|
5141
5143
|
profile: { phone: formatPhone(formData.phone) },
|
|
5142
5144
|
});
|
|
@@ -5153,10 +5155,7 @@
|
|
|
5153
5155
|
};
|
|
5154
5156
|
const handleSuccessVerify = async () => {
|
|
5155
5157
|
try {
|
|
5156
|
-
const lastTaskId = await getLastTaskStatus({
|
|
5157
|
-
profileId,
|
|
5158
|
-
programId,
|
|
5159
|
-
});
|
|
5158
|
+
const lastTaskId = await getLastTaskStatus({ profileId, programId });
|
|
5160
5159
|
if (lastTaskId) {
|
|
5161
5160
|
const task = await getTaskById({ taskId: lastTaskId });
|
|
5162
5161
|
verifyPhoneDialog.close();
|
|
@@ -5174,14 +5173,13 @@
|
|
|
5174
5173
|
setResponseStatus('Fail');
|
|
5175
5174
|
}
|
|
5176
5175
|
};
|
|
5177
|
-
const acceptedConsents =
|
|
5178
|
-
.filter((_) => formData[_])
|
|
5179
|
-
.map((_) => CONSENTS[_]?.text);
|
|
5176
|
+
const acceptedConsents = getAcceptedConsents(formData);
|
|
5180
5177
|
verifyPhoneDialog.open({
|
|
5181
5178
|
phone: formData?.phone,
|
|
5182
5179
|
consents: acceptedConsents,
|
|
5183
5180
|
onSuccess: handleSuccessVerify,
|
|
5184
5181
|
});
|
|
5182
|
+
endSending();
|
|
5185
5183
|
}
|
|
5186
5184
|
}
|
|
5187
5185
|
catch {
|
|
@@ -5191,8 +5189,12 @@
|
|
|
5191
5189
|
return {
|
|
5192
5190
|
handleSubmit,
|
|
5193
5191
|
responseStatus,
|
|
5192
|
+
isSending,
|
|
5194
5193
|
};
|
|
5195
5194
|
};
|
|
5195
|
+
const getAcceptedConsents = (formData) => Object.keys(CONSENTS)
|
|
5196
|
+
.filter((_) => formData[_])
|
|
5197
|
+
.map((_) => CONSENTS[_]?.text);
|
|
5196
5198
|
const updateUserData = async ({ programId, profileId, formData, saveUserData, }) => {
|
|
5197
5199
|
const transformedForm = transformOtherConsentsField(formData);
|
|
5198
5200
|
await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
|
|
@@ -5379,7 +5381,7 @@
|
|
|
5379
5381
|
const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, ...rest }) => {
|
|
5380
5382
|
const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
|
|
5381
5383
|
const [initialFormState, { isLoading }] = useInitApplicationLead(inputs, nextStepLink);
|
|
5382
|
-
const { handleSubmit, responseStatus } = useApplicationLeadApi({
|
|
5384
|
+
const { handleSubmit, responseStatus, isSending } = useApplicationLeadApi({
|
|
5383
5385
|
inputs,
|
|
5384
5386
|
programId,
|
|
5385
5387
|
nextStepLink,
|
|
@@ -5391,7 +5393,7 @@
|
|
|
5391
5393
|
responseTypeDialog.open({ responseType: responseStatus });
|
|
5392
5394
|
}
|
|
5393
5395
|
}, [responseStatus]);
|
|
5394
|
-
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)] }) }));
|
|
5396
|
+
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)] }) }));
|
|
5395
5397
|
});
|
|
5396
5398
|
|
|
5397
5399
|
const NotFound = JSX(({ title, description }) => {
|
|
@@ -6978,10 +6980,10 @@
|
|
|
6978
6980
|
});
|
|
6979
6981
|
const getValue$3 = (field) => (name) => field(name)?.value;
|
|
6980
6982
|
|
|
6981
|
-
const StepsNavigationButtons$1 = JSX(({ step, onPrevStep }) => {
|
|
6983
|
+
const StepsNavigationButtons$1 = JSX(({ step, isSending, onPrevStep }) => {
|
|
6982
6984
|
const isFirstStep = step === 0;
|
|
6983
6985
|
const isFinalStep = step === 5;
|
|
6984
|
-
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 ? 'Отправить заявку' : 'Далее' })] }));
|
|
6986
|
+
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 ? 'Отправить заявку' : 'Далее' })] }));
|
|
6985
6987
|
});
|
|
6986
6988
|
|
|
6987
6989
|
const getAdditionalInfoData = (formData) => {
|
|
@@ -7271,6 +7273,7 @@
|
|
|
7271
7273
|
};
|
|
7272
7274
|
|
|
7273
7275
|
const useCreditCardFormAPI = ({ step, inputs, onNextStep, onFinish, }) => {
|
|
7276
|
+
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
7274
7277
|
const isFinalStep = step === 5;
|
|
7275
7278
|
const retailFormStore = useRetailFormStore();
|
|
7276
7279
|
const initialState = useMemo(() => getInitialFormState$1(step, retailFormStore.leadForm), [step, retailFormStore.leadForm]);
|
|
@@ -7295,6 +7298,7 @@
|
|
|
7295
7298
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
7296
7299
|
return;
|
|
7297
7300
|
}
|
|
7301
|
+
startSending();
|
|
7298
7302
|
retailFormStore.leadForm = formData;
|
|
7299
7303
|
try {
|
|
7300
7304
|
const { taskId, profileId, participantId } = retailFormStore;
|
|
@@ -7316,21 +7320,24 @@
|
|
|
7316
7320
|
catch (ex) {
|
|
7317
7321
|
// Do nothing
|
|
7318
7322
|
}
|
|
7323
|
+
finally {
|
|
7324
|
+
endSending();
|
|
7325
|
+
}
|
|
7319
7326
|
}, [isFinalStep, resetForm]);
|
|
7320
|
-
return [initialState, handleSubmit];
|
|
7327
|
+
return [initialState, handleSubmit, isSending];
|
|
7321
7328
|
};
|
|
7322
7329
|
const getValue$2 = (formData) => (name) => formData[name];
|
|
7323
7330
|
|
|
7324
7331
|
const CreditCardFormStep = JSX(({ step, sections, isFormFinished, onPrevStep, onNextStep, onFinish }) => {
|
|
7325
7332
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
7326
|
-
const [initialState, onSubmit] = useCreditCardFormAPI({
|
|
7333
|
+
const [initialState, onSubmit, isSending] = useCreditCardFormAPI({
|
|
7327
7334
|
step,
|
|
7328
7335
|
inputs,
|
|
7329
7336
|
onNextStep,
|
|
7330
7337
|
onFinish,
|
|
7331
7338
|
});
|
|
7332
7339
|
const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
|
|
7333
|
-
return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$2({ sections, field, step }), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
|
|
7340
|
+
return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$2({ sections, field, step }), jsx(StepsNavigationButtons$1, { isSending: isSending, step: step, onPrevStep: onPrevStep })] }));
|
|
7334
7341
|
});
|
|
7335
7342
|
|
|
7336
7343
|
const PERSONAL_INFO_CONTENT = [
|
|
@@ -7928,10 +7935,10 @@
|
|
|
7928
7935
|
});
|
|
7929
7936
|
const getValue$1 = (field) => (name) => field(name)?.value;
|
|
7930
7937
|
|
|
7931
|
-
const StepsNavigationButtons = JSX(({ step, onPrevStep }) => {
|
|
7938
|
+
const StepsNavigationButtons = JSX(({ step, onPrevStep, isSending }) => {
|
|
7932
7939
|
const isFirstStep = step === 0;
|
|
7933
7940
|
const isFinalStep = step === 5;
|
|
7934
|
-
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 ? 'Отправить заявку' : 'Далее' })] }));
|
|
7941
|
+
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 ? 'Отправить заявку' : 'Далее' })] }));
|
|
7935
7942
|
});
|
|
7936
7943
|
|
|
7937
7944
|
const PAYMENT_TYPE_DATA = {
|
|
@@ -8110,6 +8117,7 @@
|
|
|
8110
8117
|
};
|
|
8111
8118
|
|
|
8112
8119
|
const useCreditFormAPI = ({ step, inputs, onNextStep, onFinish, }) => {
|
|
8120
|
+
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
8113
8121
|
const isFinalStep = step === 5;
|
|
8114
8122
|
const retailFormStore = useRetailFormStore();
|
|
8115
8123
|
const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm), [step, retailFormStore.leadForm]);
|
|
@@ -8134,6 +8142,7 @@
|
|
|
8134
8142
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
8135
8143
|
return;
|
|
8136
8144
|
}
|
|
8145
|
+
startSending();
|
|
8137
8146
|
retailFormStore.leadForm = formData;
|
|
8138
8147
|
try {
|
|
8139
8148
|
const { taskId, profileId, participantId } = retailFormStore;
|
|
@@ -8155,8 +8164,11 @@
|
|
|
8155
8164
|
catch (ex) {
|
|
8156
8165
|
// Do nothing
|
|
8157
8166
|
}
|
|
8167
|
+
finally {
|
|
8168
|
+
endSending();
|
|
8169
|
+
}
|
|
8158
8170
|
}, [isFinalStep, resetForm]);
|
|
8159
|
-
return [initialState, handleSubmit];
|
|
8171
|
+
return [initialState, handleSubmit, isSending];
|
|
8160
8172
|
};
|
|
8161
8173
|
const getValue = (formData) => (name) => formData[name];
|
|
8162
8174
|
|
|
@@ -8164,14 +8176,14 @@
|
|
|
8164
8176
|
const { programId } = useRetailFormStore();
|
|
8165
8177
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
8166
8178
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
8167
|
-
const [initialState, onSubmit] = useCreditFormAPI({
|
|
8179
|
+
const [initialState, onSubmit, isSending] = useCreditFormAPI({
|
|
8168
8180
|
step,
|
|
8169
8181
|
inputs,
|
|
8170
8182
|
onNextStep,
|
|
8171
8183
|
onFinish,
|
|
8172
8184
|
});
|
|
8173
8185
|
const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
|
|
8174
|
-
return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, onPrevStep: onPrevStep })] }));
|
|
8186
|
+
return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
|
|
8175
8187
|
});
|
|
8176
8188
|
|
|
8177
8189
|
const stepsSectionsMap = [
|
|
@@ -10483,7 +10495,7 @@
|
|
|
10483
10495
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10484
10496
|
});
|
|
10485
10497
|
|
|
10486
|
-
const packageVersion = "0.14.
|
|
10498
|
+
const packageVersion = "0.14.714";
|
|
10487
10499
|
|
|
10488
10500
|
exports.Blocks = Blocks;
|
|
10489
10501
|
exports.ContentPage = ContentPage;
|