@redneckz/wildless-cms-uni-blocks 0.14.588 → 0.14.589
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/api/RetailApi/RetailApi.d.ts +3 -1
- package/bundle/api/RetailApi/RetailApiTypes.d.ts +3 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +166 -58
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/icons/IconName.d.ts +4 -2
- package/bundle/ui-kit/CaptchaDialog/CaptchaDialog.d.ts +7 -0
- package/bundle/ui-kit/CaptchaDialog/checkCaptcha.d.ts +8 -0
- package/bundle/ui-kit/CaptchaDialog/createCaptcha.d.ts +1 -0
- package/bundle/ui-kit/CaptchaDialog/useCaptchaDialog.d.ts +6 -0
- package/bundle/ui-kit/VerifyPhoneDialog/InputCode.d.ts +1 -0
- package/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +3 -3
- package/bundle/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +15 -0
- package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +16 -0
- package/cosmos-static/icons/RefreshIcon.svg +1 -0
- package/cosmos-static/icons/sprites.svg +1 -0
- package/dist/api/RetailApi/RetailApi.d.ts +3 -1
- package/dist/api/RetailApi/RetailApi.js +15 -1
- package/dist/api/RetailApi/RetailApi.js.map +1 -1
- package/dist/api/RetailApi/RetailApiTypes.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -4
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +3 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/CaptchaDialog/CaptchaDialog.d.ts +7 -0
- package/dist/ui-kit/CaptchaDialog/CaptchaDialog.js +22 -0
- package/dist/ui-kit/CaptchaDialog/CaptchaDialog.js.map +1 -0
- package/dist/ui-kit/CaptchaDialog/checkCaptcha.d.ts +8 -0
- package/dist/ui-kit/CaptchaDialog/checkCaptcha.js +16 -0
- package/dist/ui-kit/CaptchaDialog/checkCaptcha.js.map +1 -0
- package/dist/ui-kit/CaptchaDialog/createCaptcha.d.ts +1 -0
- package/dist/ui-kit/CaptchaDialog/createCaptcha.js +9 -0
- package/dist/ui-kit/CaptchaDialog/createCaptcha.js.map +1 -0
- package/dist/ui-kit/CaptchaDialog/useCaptchaDialog.d.ts +6 -0
- package/dist/ui-kit/CaptchaDialog/useCaptchaDialog.js +15 -0
- package/dist/ui-kit/CaptchaDialog/useCaptchaDialog.js.map +1 -0
- package/dist/ui-kit/VerifyPhoneDialog/InputCode.d.ts +1 -0
- package/dist/ui-kit/VerifyPhoneDialog/InputCode.js +2 -2
- package/dist/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +3 -3
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +20 -29
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +15 -0
- package/dist/ui-kit/VerifyPhoneDialog/handleSendCode.js +21 -0
- package/dist/ui-kit/VerifyPhoneDialog/handleSendCode.js.map +1 -0
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +16 -0
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +59 -0
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -0
- package/lib/api/RetailApi/RetailApi.d.ts +3 -1
- package/lib/api/RetailApi/RetailApi.js +15 -1
- package/lib/api/RetailApi/RetailApi.js.map +1 -1
- package/lib/api/RetailApi/RetailApiTypes.d.ts +3 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -4
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +3 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/CaptchaDialog/CaptchaDialog.d.ts +7 -0
- package/lib/ui-kit/CaptchaDialog/CaptchaDialog.fixture.d.ts +6 -0
- package/lib/ui-kit/CaptchaDialog/CaptchaDialog.js +20 -0
- package/lib/ui-kit/CaptchaDialog/CaptchaDialog.js.map +1 -0
- package/lib/ui-kit/CaptchaDialog/checkCaptcha.d.ts +8 -0
- package/lib/ui-kit/CaptchaDialog/checkCaptcha.js +13 -0
- package/lib/ui-kit/CaptchaDialog/checkCaptcha.js.map +1 -0
- package/lib/ui-kit/CaptchaDialog/createCaptcha.d.ts +1 -0
- package/lib/ui-kit/CaptchaDialog/createCaptcha.js +6 -0
- package/lib/ui-kit/CaptchaDialog/createCaptcha.js.map +1 -0
- package/lib/ui-kit/CaptchaDialog/useCaptchaDialog.d.ts +6 -0
- package/lib/ui-kit/CaptchaDialog/useCaptchaDialog.js +12 -0
- package/lib/ui-kit/CaptchaDialog/useCaptchaDialog.js.map +1 -0
- package/lib/ui-kit/VerifyPhoneDialog/InputCode.d.ts +1 -0
- package/lib/ui-kit/VerifyPhoneDialog/InputCode.js +2 -2
- package/lib/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +3 -3
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +21 -30
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +15 -0
- package/lib/ui-kit/VerifyPhoneDialog/handleSendCode.js +18 -0
- package/lib/ui-kit/VerifyPhoneDialog/handleSendCode.js.map +1 -0
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +16 -0
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +56 -0
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -0
- package/mobile/bundle/api/RetailApi/RetailApi.d.ts +3 -1
- package/mobile/bundle/api/RetailApi/RetailApiTypes.d.ts +3 -0
- package/mobile/bundle/bundle.umd.js +166 -58
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/icons/IconName.d.ts +4 -2
- package/mobile/bundle/ui-kit/CaptchaDialog/CaptchaDialog.d.ts +7 -0
- package/mobile/bundle/ui-kit/CaptchaDialog/checkCaptcha.d.ts +8 -0
- package/mobile/bundle/ui-kit/CaptchaDialog/createCaptcha.d.ts +1 -0
- package/mobile/bundle/ui-kit/CaptchaDialog/useCaptchaDialog.d.ts +6 -0
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/InputCode.d.ts +1 -0
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +3 -3
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +15 -0
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +16 -0
- package/mobile/dist/api/RetailApi/RetailApi.d.ts +3 -1
- package/mobile/dist/api/RetailApi/RetailApi.js +15 -1
- package/mobile/dist/api/RetailApi/RetailApi.js.map +1 -1
- package/mobile/dist/api/RetailApi/RetailApiTypes.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -4
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +3 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/CaptchaDialog/CaptchaDialog.d.ts +7 -0
- package/mobile/dist/ui-kit/CaptchaDialog/CaptchaDialog.js +22 -0
- package/mobile/dist/ui-kit/CaptchaDialog/CaptchaDialog.js.map +1 -0
- package/mobile/dist/ui-kit/CaptchaDialog/checkCaptcha.d.ts +8 -0
- package/mobile/dist/ui-kit/CaptchaDialog/checkCaptcha.js +16 -0
- package/mobile/dist/ui-kit/CaptchaDialog/checkCaptcha.js.map +1 -0
- package/mobile/dist/ui-kit/CaptchaDialog/createCaptcha.d.ts +1 -0
- package/mobile/dist/ui-kit/CaptchaDialog/createCaptcha.js +9 -0
- package/mobile/dist/ui-kit/CaptchaDialog/createCaptcha.js.map +1 -0
- package/mobile/dist/ui-kit/CaptchaDialog/useCaptchaDialog.d.ts +6 -0
- package/mobile/dist/ui-kit/CaptchaDialog/useCaptchaDialog.js +15 -0
- package/mobile/dist/ui-kit/CaptchaDialog/useCaptchaDialog.js.map +1 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.d.ts +1 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.js +2 -2
- package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +3 -3
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +20 -29
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +15 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/handleSendCode.js +21 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/handleSendCode.js.map +1 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +16 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +59 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -0
- package/mobile/lib/api/RetailApi/RetailApi.d.ts +3 -1
- package/mobile/lib/api/RetailApi/RetailApi.js +15 -1
- package/mobile/lib/api/RetailApi/RetailApi.js.map +1 -1
- package/mobile/lib/api/RetailApi/RetailApiTypes.d.ts +3 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -4
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +3 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/CaptchaDialog/CaptchaDialog.d.ts +7 -0
- package/mobile/lib/ui-kit/CaptchaDialog/CaptchaDialog.js +20 -0
- package/mobile/lib/ui-kit/CaptchaDialog/CaptchaDialog.js.map +1 -0
- package/mobile/lib/ui-kit/CaptchaDialog/checkCaptcha.d.ts +8 -0
- package/mobile/lib/ui-kit/CaptchaDialog/checkCaptcha.js +13 -0
- package/mobile/lib/ui-kit/CaptchaDialog/checkCaptcha.js.map +1 -0
- package/mobile/lib/ui-kit/CaptchaDialog/createCaptcha.d.ts +1 -0
- package/mobile/lib/ui-kit/CaptchaDialog/createCaptcha.js +6 -0
- package/mobile/lib/ui-kit/CaptchaDialog/createCaptcha.js.map +1 -0
- package/mobile/lib/ui-kit/CaptchaDialog/useCaptchaDialog.d.ts +6 -0
- package/mobile/lib/ui-kit/CaptchaDialog/useCaptchaDialog.js +12 -0
- package/mobile/lib/ui-kit/CaptchaDialog/useCaptchaDialog.js.map +1 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.d.ts +1 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.js +2 -2
- package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +3 -3
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +21 -30
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +15 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/handleSendCode.js +18 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/handleSendCode.js.map +1 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +16 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +56 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -0
- package/mobile/src/api/RetailApi/RetailApi.ts +18 -1
- package/mobile/src/api/RetailApi/RetailApiTypes.ts +4 -0
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +3 -4
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/icons/RefreshIcon.svg +3 -0
- package/mobile/src/ui-kit/CaptchaDialog/CaptchaDialog.tsx +68 -0
- package/mobile/src/ui-kit/CaptchaDialog/checkCaptcha.ts +25 -0
- package/mobile/src/ui-kit/CaptchaDialog/createCaptcha.ts +6 -0
- package/mobile/src/ui-kit/CaptchaDialog/useCaptchaDialog.tsx +12 -0
- package/mobile/src/ui-kit/VerifyPhoneDialog/InputCode.tsx +3 -2
- package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +66 -51
- package/mobile/src/ui-kit/VerifyPhoneDialog/handleSendCode.ts +37 -0
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +2 -1
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +71 -0
- package/package.json +2 -2
- package/src/api/RetailApi/RetailApi.ts +18 -1
- package/src/api/RetailApi/RetailApiTypes.ts +4 -0
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +3 -4
- package/src/icons/IconName.ts +353 -6
- package/src/icons/RefreshIcon.svg +3 -0
- package/src/ui-kit/CaptchaDialog/CaptchaDialog.fixture.tsx +11 -0
- package/src/ui-kit/CaptchaDialog/CaptchaDialog.tsx +68 -0
- package/src/ui-kit/CaptchaDialog/checkCaptcha.ts +25 -0
- package/src/ui-kit/CaptchaDialog/createCaptcha.ts +6 -0
- package/src/ui-kit/CaptchaDialog/useCaptchaDialog.tsx +12 -0
- package/src/ui-kit/VerifyPhoneDialog/InputCode.tsx +3 -2
- package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.fixture.tsx +11 -8
- package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +66 -51
- package/src/ui-kit/VerifyPhoneDialog/handleSendCode.ts +37 -0
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +2 -1
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +71 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -1122,9 +1122,9 @@
|
|
|
1122
1122
|
onChange && onChange(!value);
|
|
1123
1123
|
}, [onChange, disabled, value]);
|
|
1124
1124
|
const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
|
|
1125
|
-
return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled), "aria-label": text }), value ? icon : null, renderText$
|
|
1125
|
+
return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled), "aria-label": text }), value ? icon : null, renderText$2(text)] }) }));
|
|
1126
1126
|
});
|
|
1127
|
-
const renderText$
|
|
1127
|
+
const renderText$2 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
|
|
1128
1128
|
const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
|
|
1129
1129
|
const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
|
|
1130
1130
|
const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
|
|
@@ -2550,6 +2550,7 @@
|
|
|
2550
2550
|
|
|
2551
2551
|
const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
|
|
2552
2552
|
|
|
2553
|
+
const getResponse = (response) => (isJSON(response) ? response.json() : response);
|
|
2553
2554
|
const getAthorizationHeaders = () => {
|
|
2554
2555
|
const token = sessionStorage.getItem('accessToken');
|
|
2555
2556
|
return token ? { Authorization: `Bearer ${token}` } : null;
|
|
@@ -2563,7 +2564,18 @@
|
|
|
2563
2564
|
},
|
|
2564
2565
|
credentials: 'include',
|
|
2565
2566
|
body: body ? JSON.stringify(body) : null,
|
|
2566
|
-
})
|
|
2567
|
+
})
|
|
2568
|
+
.then((response) => {
|
|
2569
|
+
if (response.ok) {
|
|
2570
|
+
return getResponse(response);
|
|
2571
|
+
}
|
|
2572
|
+
else {
|
|
2573
|
+
throw response;
|
|
2574
|
+
}
|
|
2575
|
+
})
|
|
2576
|
+
.catch((error) => {
|
|
2577
|
+
throw error;
|
|
2578
|
+
});
|
|
2567
2579
|
const saveToken = (data) => {
|
|
2568
2580
|
sessionStorage.setItem('accessToken', data.access_token);
|
|
2569
2581
|
sessionStorage.setItem('refreshToken', data.refresh_token);
|
|
@@ -2575,6 +2587,8 @@
|
|
|
2575
2587
|
UpdateUserTask: async (body) => await request('/user-data/updateUserTask', 'PUT', body),
|
|
2576
2588
|
SendCode: async (body) => await request('/sms/sendCode', 'POST', body),
|
|
2577
2589
|
CheckCode: async (body) => await request('/sms/checkCode', 'POST', body).then(saveToken),
|
|
2590
|
+
CreateCaptcha: async (phoneNumber) => await request(`/sms/createCaptcha?phoneNumber=${phoneNumber}`, 'GET'),
|
|
2591
|
+
CheckCaptcha: async (body) => await request('/sms/checkCaptcha', 'POST', body),
|
|
2578
2592
|
};
|
|
2579
2593
|
|
|
2580
2594
|
const getUpdateUserProfileData = (profileId, formData) => {
|
|
@@ -2639,6 +2653,71 @@
|
|
|
2639
2653
|
},
|
|
2640
2654
|
});
|
|
2641
2655
|
|
|
2656
|
+
const ICON_SIZE$1 = { width: '118', height: '24' };
|
|
2657
|
+
|
|
2658
|
+
const logoTitleSizeStyle = '';
|
|
2659
|
+
|
|
2660
|
+
const ICON_VERSION_MAP = {
|
|
2661
|
+
'bg-white': 'color',
|
|
2662
|
+
transparent: 'white',
|
|
2663
|
+
};
|
|
2664
|
+
const SVG_COLOR = {
|
|
2665
|
+
'bg-white': 'text-primary-main',
|
|
2666
|
+
transparent: 'text-white',
|
|
2667
|
+
};
|
|
2668
|
+
const renderImage = (bgColor, image, size) => {
|
|
2669
|
+
const img = image?.src
|
|
2670
|
+
? image
|
|
2671
|
+
: {
|
|
2672
|
+
icon: image?.icon || 'LogoIcon',
|
|
2673
|
+
iconVersion: ICON_VERSION_MAP[bgColor],
|
|
2674
|
+
};
|
|
2675
|
+
return (jsx(Img, { image: img, className: SVG_COLOR[bgColor], width: size?.width, height: size?.height }));
|
|
2676
|
+
};
|
|
2677
|
+
|
|
2678
|
+
const TEXT_COLOR = {
|
|
2679
|
+
'bg-white': 'text-primary-text',
|
|
2680
|
+
transparent: 'text-white',
|
|
2681
|
+
};
|
|
2682
|
+
const Logo = JSX(({ className, href = '/', logo, children, targetBlank, bgColor = 'bg-white', showTitle = true, data, }) => (jsxs("a", { className: style('inline-flex items-center font-sans no-underline', className), href: logo?.href ?? href, target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title ?? 'Россельхозбанк', ...getAspectsAttributes(data), children: [renderImage(bgColor, logo?.image, ICON_SIZE$1), showTitle
|
|
2683
|
+
? children ?? (jsx("div", { className: "ml-s", children: jsx(Text, { font: "font-medium", color: TEXT_COLOR[bgColor], size: logoTitleSizeStyle, children: logo?.title ?? 'Россельхозбанк' }) }))
|
|
2684
|
+
: null] })));
|
|
2685
|
+
|
|
2686
|
+
const checkCaptcha = async ({ code, setHasError, close, sendCode = noop, }) => {
|
|
2687
|
+
const response = await RETAIL_API.CheckCaptcha({ captchaText: code });
|
|
2688
|
+
if ((await response.text()) === 'ERROR') {
|
|
2689
|
+
setHasError(true);
|
|
2690
|
+
}
|
|
2691
|
+
else {
|
|
2692
|
+
sendCode();
|
|
2693
|
+
close?.();
|
|
2694
|
+
}
|
|
2695
|
+
};
|
|
2696
|
+
|
|
2697
|
+
const createCaptcha = async (setCaptcha, phoneNumber) => {
|
|
2698
|
+
const response = await RETAIL_API.CreateCaptcha(phoneNumber);
|
|
2699
|
+
setCaptcha(URL.createObjectURL(await response.blob()));
|
|
2700
|
+
};
|
|
2701
|
+
|
|
2702
|
+
const CaptchaDialog = JSX(({ phoneNumber, close, sendCode, onClose }) => {
|
|
2703
|
+
const [captcha, setCaptcha] = useState('');
|
|
2704
|
+
const [code, setCode] = useState('');
|
|
2705
|
+
const [hasError, setHasError] = useState(false);
|
|
2706
|
+
useEffect(() => {
|
|
2707
|
+
createCaptcha(setCaptcha, phoneNumber);
|
|
2708
|
+
}, []);
|
|
2709
|
+
return (jsx(Dialog, { head: jsx(Logo, {}), onClose: onClose, className: "my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg", children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [jsxs("div", { className: "flex h-[140px] w-[300px]", children: [jsx("img", { className: "grow", src: captcha }), jsx("div", { onClick: () => createCaptcha(setCaptcha, phoneNumber), className: "flex w-8 items-center justify-center cursor-pointer", children: jsx(Icon, { iconVersion: "normal", name: "RefreshIcon" }) })] }), jsx(Input, { className: "w-[300px]", onChange: setCode, value: code, placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434 \u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438" }), hasError ? jsx("div", { className: "text-error", children: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043E\u0434" }) : null, jsxs("div", { className: "flex w-[310px] justify-between", children: [jsx(Button, { onClick: close, version: "secondary", children: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F" }), jsx(Button, { type: "submit", disabled: !code, onClick: () => checkCaptcha({ code, setHasError, close, sendCode }), version: "secondary", children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C" })] })] }) }));
|
|
2710
|
+
});
|
|
2711
|
+
|
|
2712
|
+
const useCaptchaDialog = (initialProps, onClose) => {
|
|
2713
|
+
const { open, close, closeAll } = useDialogManager();
|
|
2714
|
+
return {
|
|
2715
|
+
open: () => open(jsx(CaptchaDialog, { close: close, onClose: onClose, ...initialProps })),
|
|
2716
|
+
close,
|
|
2717
|
+
closeAll,
|
|
2718
|
+
};
|
|
2719
|
+
};
|
|
2720
|
+
|
|
2642
2721
|
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, {
|
|
2643
2722
|
'backdrop-blur': blur,
|
|
2644
2723
|
}), 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" }) })));
|
|
@@ -2663,7 +2742,24 @@
|
|
|
2663
2742
|
return `${minutes}:${seconds}`;
|
|
2664
2743
|
};
|
|
2665
2744
|
|
|
2666
|
-
const
|
|
2745
|
+
const handleSendCode = async ({ phoneNumber, captchaDialog, setTimeNextReq, setIsTimerStarted, setAttemps, }) => {
|
|
2746
|
+
try {
|
|
2747
|
+
await RETAIL_API.SendCode({
|
|
2748
|
+
phoneNumber: phoneNumber,
|
|
2749
|
+
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
2750
|
+
});
|
|
2751
|
+
setAttemps(0);
|
|
2752
|
+
setTimeNextReq(180);
|
|
2753
|
+
setIsTimerStarted(true);
|
|
2754
|
+
}
|
|
2755
|
+
catch (e) {
|
|
2756
|
+
if (e?.status === 429) {
|
|
2757
|
+
captchaDialog.open();
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
};
|
|
2761
|
+
|
|
2762
|
+
const InputCode = JSX(({ values, setValues, hasError, errorText }) => {
|
|
2667
2763
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
2668
2764
|
const inputRefs = useRef([]);
|
|
2669
2765
|
useEffect(() => {
|
|
@@ -2700,7 +2796,7 @@
|
|
|
2700
2796
|
inputRefs.current = [];
|
|
2701
2797
|
}
|
|
2702
2798
|
inputRefs.current[index] = ref;
|
|
2703
|
-
}, onFocus: (event) => event.target.select(), onKeyDown: handleKeyDown(index), className: getInputStyle(index, values, hasError) }, index))) }), hasError ? jsx("div", { className: "text-error", children:
|
|
2799
|
+
}, onFocus: (event) => event.target.select(), onKeyDown: handleKeyDown(index), className: getInputStyle(index, values, hasError) }, index))) }), hasError ? jsx("div", { className: "text-error", children: errorText }) : null] }));
|
|
2704
2800
|
});
|
|
2705
2801
|
const getInputStyle = (index, values, hasError = false) => {
|
|
2706
2802
|
const isInputEmpty = !values[index];
|
|
@@ -2711,42 +2807,85 @@
|
|
|
2711
2807
|
return (jsx(Button, { type: "button", onClick: onClick, disabled: isDisabled, children: jsx(Text, { font: "font-medium", children: text }) }));
|
|
2712
2808
|
});
|
|
2713
2809
|
|
|
2714
|
-
const
|
|
2715
|
-
const { close } = useDialogManager();
|
|
2716
|
-
const [values, setValues] = useState(Array(codeLength).fill(''));
|
|
2810
|
+
const useVerifyPhoneDialogSubmit = ({ close, values }) => {
|
|
2717
2811
|
const [hasError, setHasError] = useState(false);
|
|
2812
|
+
const [errorText, setErrorText] = useState('');
|
|
2718
2813
|
const [isLoading, setIsLoading] = useState(false);
|
|
2719
|
-
const [timeNextReq, setTimeNextReq] = useState(
|
|
2720
|
-
const
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
});
|
|
2814
|
+
const [timeNextReq, setTimeNextReq] = useState(0);
|
|
2815
|
+
const [isTimerStarted, setIsTimerStarted] = useState(false);
|
|
2816
|
+
const [attemps, setAttemps] = useState(0);
|
|
2817
|
+
const resetError = useCallback(() => {
|
|
2818
|
+
setHasError(false);
|
|
2819
|
+
setErrorText('');
|
|
2726
2820
|
}, []);
|
|
2821
|
+
const isTimeExpired = useMemo(() => timeNextReq === 0 && isTimerStarted, [timeNextReq, isTimerStarted]);
|
|
2822
|
+
const isSubmitButtonDisabled = useMemo(() => attemps > 2 || !values.every(Boolean) || isTimeExpired, [values]);
|
|
2727
2823
|
const handleSubmit = useCallback(async () => {
|
|
2728
2824
|
try {
|
|
2825
|
+
setIsTimerStarted(false);
|
|
2826
|
+
setTimeNextReq(0);
|
|
2827
|
+
setAttemps(attemps + 1);
|
|
2729
2828
|
setIsLoading(true);
|
|
2730
2829
|
await RETAIL_API.CheckCode({
|
|
2731
2830
|
smsText: values.join(''),
|
|
2732
2831
|
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
2733
2832
|
});
|
|
2734
|
-
|
|
2735
|
-
close();
|
|
2736
|
-
onClose && onClose();
|
|
2833
|
+
resetError();
|
|
2834
|
+
close && close();
|
|
2737
2835
|
}
|
|
2738
2836
|
catch {
|
|
2739
2837
|
setIsLoading(false);
|
|
2838
|
+
attemps > 1 ? setErrorText('Исчерпан лимит ввода смс-кода') : setErrorText('Неверный код');
|
|
2740
2839
|
setHasError(true);
|
|
2741
2840
|
}
|
|
2742
|
-
}, [values]);
|
|
2743
|
-
|
|
2841
|
+
}, [values, attemps]);
|
|
2842
|
+
useEffect(() => {
|
|
2843
|
+
if (isTimeExpired) {
|
|
2844
|
+
setHasError(true);
|
|
2845
|
+
setErrorText('Код просрочен');
|
|
2846
|
+
}
|
|
2847
|
+
else {
|
|
2848
|
+
setHasError(false);
|
|
2849
|
+
}
|
|
2850
|
+
}, [isTimeExpired]);
|
|
2851
|
+
return {
|
|
2852
|
+
handleSubmit,
|
|
2853
|
+
hasError,
|
|
2854
|
+
errorText,
|
|
2855
|
+
isLoading,
|
|
2856
|
+
timeNextReq,
|
|
2857
|
+
isSubmitButtonDisabled,
|
|
2858
|
+
setTimeNextReq,
|
|
2859
|
+
setIsTimerStarted,
|
|
2860
|
+
setAttemps,
|
|
2861
|
+
};
|
|
2862
|
+
};
|
|
2863
|
+
|
|
2864
|
+
const VerifyPhoneDialog = JSX(({ close = noop, onClose = noop, title, description, __html, code = true, codeLength = 4, textButton = '', phoneNumber = '+79999999999', }) => {
|
|
2865
|
+
const [values, setValues] = useState(Array(codeLength).fill(''));
|
|
2866
|
+
const { handleSubmit, hasError, errorText, isLoading, timeNextReq, isSubmitButtonDisabled, setTimeNextReq, setIsTimerStarted, setAttemps, } = useVerifyPhoneDialogSubmit({ values, close });
|
|
2867
|
+
const sendCode = useCallback(() => {
|
|
2868
|
+
handleSendCode({
|
|
2869
|
+
phoneNumber,
|
|
2870
|
+
captchaDialog,
|
|
2871
|
+
setTimeNextReq,
|
|
2872
|
+
setIsTimerStarted,
|
|
2873
|
+
setAttemps,
|
|
2874
|
+
});
|
|
2875
|
+
}, []);
|
|
2876
|
+
const captchaDialog = useCaptchaDialog({ phoneNumber, sendCode }, onClose);
|
|
2877
|
+
useEffect(() => {
|
|
2878
|
+
sendCode();
|
|
2879
|
+
}, []);
|
|
2880
|
+
return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg", children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [jsx(Headline, { className: "w-full", title: title, description: description, headlineVersion: "S", isEmbedded: true }), code ? (jsx(InputCode, { values: values, setValues: setValues, errorText: errorText, hasError: hasError })) : null, renderText$1(timeNextReq, setTimeNextReq, sendCode), jsx(RichText, { itemSize: "list-s", __html: __html }), renderTextButton(textButton, isSubmitButtonDisabled, handleSubmit), isLoading ? jsx(Loader, { blur: false }) : null] }) }));
|
|
2744
2881
|
});
|
|
2882
|
+
const renderTextButton = (textButton, isDisabled, handleSubmit) => textButton ? (jsx(SubmitButton, { isDisabled: isDisabled, onClick: handleSubmit, text: textButton })) : null;
|
|
2883
|
+
const renderText$1 = (timeNextReq, setTimeNextReq, sendCode) => timeNextReq ? (jsxs("div", { className: "flex flex-row text-l font-light text-primary-main", children: ["\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434 \u043C\u043E\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437", jsx(Timer, { className: "text-primary-main ml-1", time: timeNextReq, setTime: setTimeNextReq })] })) : (jsx(LinkButton, { onClick: sendCode, className: "text-primary-main", children: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434" }));
|
|
2745
2884
|
|
|
2746
2885
|
const useVerifyPhoneDialog = (props) => {
|
|
2747
2886
|
const { open, close } = useDialogManager();
|
|
2748
2887
|
return {
|
|
2749
|
-
open: (options = {}) => open(jsx(VerifyPhoneDialog, { ...props }), options),
|
|
2888
|
+
open: (options = {}) => open(jsx(VerifyPhoneDialog, { onClose: close, ...props }), options),
|
|
2750
2889
|
close,
|
|
2751
2890
|
};
|
|
2752
2891
|
};
|
|
@@ -2773,7 +2912,7 @@
|
|
|
2773
2912
|
programId,
|
|
2774
2913
|
});
|
|
2775
2914
|
await RETAIL_API.UpdateUserTask(getUpdateUserTaskData(participantId, taskId, profileId, formData));
|
|
2776
|
-
|
|
2915
|
+
globalThis.location.href = '/credit-lead';
|
|
2777
2916
|
}
|
|
2778
2917
|
catch {
|
|
2779
2918
|
setResponseStatus('Fail');
|
|
@@ -2781,7 +2920,7 @@
|
|
|
2781
2920
|
};
|
|
2782
2921
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
2783
2922
|
const verifyPhoneDialog = useVerifyPhoneDialog({
|
|
2784
|
-
|
|
2923
|
+
close: handleSuccessVerify,
|
|
2785
2924
|
...verifyPhoneContent(formData?.phone),
|
|
2786
2925
|
});
|
|
2787
2926
|
verifyPhoneDialog.open();
|
|
@@ -2799,14 +2938,13 @@
|
|
|
2799
2938
|
const verifyPhoneContent = (phone) => ({
|
|
2800
2939
|
title: 'Подтвердите номер телефона',
|
|
2801
2940
|
description: `Мы отправили код на ${phone}`,
|
|
2802
|
-
|
|
2941
|
+
phoneNumber: formatPhone(phone),
|
|
2803
2942
|
textButton: 'Оформить',
|
|
2804
2943
|
__html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
|
|
2805
2944
|
<ul><li>соглашение о порядке использования простой электронной подписи,
|
|
2806
2945
|
</li><li>согласие на обработку персональных данных,
|
|
2807
2946
|
</li><li>предоставление и подписание прочих согласий Банка,
|
|
2808
2947
|
</li><li>согласие на запрос в ПФР</li></ul>`,
|
|
2809
|
-
href: '/credit-lead',
|
|
2810
2948
|
});
|
|
2811
2949
|
|
|
2812
2950
|
const useInitApplicationLead = () => {
|
|
@@ -4555,7 +4693,7 @@
|
|
|
4555
4693
|
return null;
|
|
4556
4694
|
};
|
|
4557
4695
|
|
|
4558
|
-
const ICON_SIZE
|
|
4696
|
+
const ICON_SIZE = { width: '24', height: '24' };
|
|
4559
4697
|
const PaginationContainer = ({ currentPage, onPageChange, totalPages, }) => {
|
|
4560
4698
|
const pages = useMemo(() => Array.from({ length: totalPages }).fill({
|
|
4561
4699
|
currentPage,
|
|
@@ -4574,7 +4712,7 @@
|
|
|
4574
4712
|
}, [currentPage, totalPages]);
|
|
4575
4713
|
const handleFirstPage = useCallback(() => onPageChange(1), []);
|
|
4576
4714
|
const handleLastPage = useCallback(() => onPageChange(totalPages), [totalPages]);
|
|
4577
|
-
return (jsxs("div", { className: "flex gap-m items-center", children: [jsx("div", { onClick: handlePrevPage, children: jsx(Icon, { name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === 1), ...ICON_SIZE
|
|
4715
|
+
return (jsxs("div", { className: "flex gap-m items-center", children: [jsx("div", { onClick: handlePrevPage, children: jsx(Icon, { name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === 1), ...ICON_SIZE }) }), jsxs("div", { className: "flex @lg:gap-2xs", children: [currentPage > 1 ? (jsx("div", { onClick: handleFirstPage, className: paginationBlockStyle, "aria-label": "\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 1", children: "1" })) : null, currentPage > 3 ? jsx("div", { className: "py-m @lg:px-s", children: "..." }) : null, pages.map(renderPages), currentPage < totalPages - 2 ? jsx("div", { className: "py-m @lg:px-s", children: "..." }) : null, currentPage < totalPages ? (jsx("div", { onClick: handleLastPage, className: paginationBlockStyle, "aria-label": `Страница ${totalPages}`, children: totalPages })) : null] }), jsx("div", { onClick: handleNextPage, children: jsx(Icon, { className: "rotate-180", name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === totalPages), ...ICON_SIZE }) })] }));
|
|
4578
4716
|
};
|
|
4579
4717
|
const getIconStyle = (condition) => condition ? 'opacity-20' : 'cursor-pointer hover:opacity-60';
|
|
4580
4718
|
|
|
@@ -4895,36 +5033,6 @@
|
|
|
4895
5033
|
|
|
4896
5034
|
const LEFT_COLUMN_STYLE = 'w-full lg:w-52';
|
|
4897
5035
|
|
|
4898
|
-
const ICON_SIZE = { width: '118', height: '24' };
|
|
4899
|
-
|
|
4900
|
-
const logoTitleSizeStyle = '';
|
|
4901
|
-
|
|
4902
|
-
const ICON_VERSION_MAP = {
|
|
4903
|
-
'bg-white': 'color',
|
|
4904
|
-
transparent: 'white',
|
|
4905
|
-
};
|
|
4906
|
-
const SVG_COLOR = {
|
|
4907
|
-
'bg-white': 'text-primary-main',
|
|
4908
|
-
transparent: 'text-white',
|
|
4909
|
-
};
|
|
4910
|
-
const renderImage = (bgColor, image, size) => {
|
|
4911
|
-
const img = image?.src
|
|
4912
|
-
? image
|
|
4913
|
-
: {
|
|
4914
|
-
icon: image?.icon || 'LogoIcon',
|
|
4915
|
-
iconVersion: ICON_VERSION_MAP[bgColor],
|
|
4916
|
-
};
|
|
4917
|
-
return (jsx(Img, { image: img, className: SVG_COLOR[bgColor], width: size?.width, height: size?.height }));
|
|
4918
|
-
};
|
|
4919
|
-
|
|
4920
|
-
const TEXT_COLOR = {
|
|
4921
|
-
'bg-white': 'text-primary-text',
|
|
4922
|
-
transparent: 'text-white',
|
|
4923
|
-
};
|
|
4924
|
-
const Logo = JSX(({ className, href = '/', logo, children, targetBlank, bgColor = 'bg-white', showTitle = true, data, }) => (jsxs("a", { className: style('inline-flex items-center font-sans no-underline', className), href: logo?.href ?? href, target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title ?? 'Россельхозбанк', ...getAspectsAttributes(data), children: [renderImage(bgColor, logo?.image, ICON_SIZE), showTitle
|
|
4925
|
-
? children ?? (jsx("div", { className: "ml-s", children: jsx(Text, { font: "font-medium", color: TEXT_COLOR[bgColor], size: logoTitleSizeStyle, children: logo?.title ?? 'Россельхозбанк' }) }))
|
|
4926
|
-
: null] })));
|
|
4927
|
-
|
|
4928
5036
|
function useDebouncedEffect(effect, deps, delay = 300) {
|
|
4929
5037
|
useEffect(() => {
|
|
4930
5038
|
const timerId = globalThis.setTimeout(effect, delay);
|
|
@@ -7303,7 +7411,7 @@
|
|
|
7303
7411
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7304
7412
|
});
|
|
7305
7413
|
|
|
7306
|
-
const packageVersion = "0.14.
|
|
7414
|
+
const packageVersion = "0.14.588";
|
|
7307
7415
|
|
|
7308
7416
|
exports.Blocks = Blocks;
|
|
7309
7417
|
exports.ContentPage = ContentPage;
|