@redneckz/wildless-cms-uni-blocks 0.14.878 → 0.14.880
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 +22 -18
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/retail/api/updateUserTask.d.ts +2 -0
- package/bundle/retail/components/DocumentDialog/useDocumentDialog.d.ts +4 -1
- package/bundle/ui-kit/Loader/Loader.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -3
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/DebitForm/getDebitCardFormTaskData.js +1 -0
- package/dist/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/dist/retail/api/esiaRequestProfile.js +1 -5
- package/dist/retail/api/esiaRequestProfile.js.map +1 -1
- package/dist/retail/api/updateUserTask.d.ts +2 -0
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/components/CheckboxWithDoc/CheckboxWithDoc.js +3 -2
- package/dist/retail/components/CheckboxWithDoc/CheckboxWithDoc.js.map +1 -1
- package/dist/retail/components/DocumentDialog/DocumentDialog.js +1 -1
- package/dist/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
- package/dist/retail/components/DocumentDialog/useDocumentDialog.d.ts +4 -1
- package/dist/retail/components/DocumentDialog/useDocumentDialog.js +11 -3
- package/dist/retail/components/DocumentDialog/useDocumentDialog.js.map +1 -1
- package/dist/ui-kit/DialogManager/Dialog.js +1 -1
- package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/dist/ui-kit/Loader/Loader.d.ts +1 -1
- package/dist/ui-kit/Loader/Loader.js +1 -1
- package/dist/ui-kit/Loader/Loader.js.map +1 -1
- package/dist/ui-kit/Select/Select.js +1 -1
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -3
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/DebitForm/getDebitCardFormTaskData.js +1 -0
- package/lib/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/lib/retail/api/esiaRequestProfile.js +1 -5
- package/lib/retail/api/esiaRequestProfile.js.map +1 -1
- package/lib/retail/api/updateUserTask.d.ts +2 -0
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/components/CheckboxWithDoc/CheckboxWithDoc.js +3 -2
- package/lib/retail/components/CheckboxWithDoc/CheckboxWithDoc.js.map +1 -1
- package/lib/retail/components/DocumentDialog/DocumentDialog.js +1 -1
- package/lib/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
- package/lib/retail/components/DocumentDialog/useDocumentDialog.d.ts +4 -1
- package/lib/retail/components/DocumentDialog/useDocumentDialog.js +11 -3
- package/lib/retail/components/DocumentDialog/useDocumentDialog.js.map +1 -1
- package/lib/ui-kit/DialogManager/Dialog.js +1 -1
- package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/ui-kit/Loader/Loader.d.ts +1 -1
- package/lib/ui-kit/Loader/Loader.js +1 -1
- package/lib/ui-kit/Loader/Loader.js.map +1 -1
- package/lib/ui-kit/Select/Select.js +1 -1
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +450 -70
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/retail/api/updateUserTask.d.ts +2 -0
- package/mobile/bundle/retail/components/DocumentDialog/useDocumentDialog.d.ts +4 -1
- package/mobile/bundle/ui-kit/Loader/Loader.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -3
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/DebitForm/getDebitCardFormTaskData.js +1 -0
- package/mobile/dist/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/mobile/dist/retail/api/esiaRequestProfile.js +1 -5
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -1
- package/mobile/dist/retail/api/updateUserTask.d.ts +2 -0
- package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
- package/mobile/dist/retail/components/CheckboxWithDoc/CheckboxWithDoc.js +3 -2
- package/mobile/dist/retail/components/CheckboxWithDoc/CheckboxWithDoc.js.map +1 -1
- package/mobile/dist/retail/components/DocumentDialog/DocumentDialog.js +1 -1
- package/mobile/dist/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
- package/mobile/dist/retail/components/DocumentDialog/useDocumentDialog.d.ts +4 -1
- package/mobile/dist/retail/components/DocumentDialog/useDocumentDialog.js +11 -3
- package/mobile/dist/retail/components/DocumentDialog/useDocumentDialog.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/dist/ui-kit/Loader/Loader.d.ts +1 -1
- package/mobile/dist/ui-kit/Loader/Loader.js +1 -1
- package/mobile/dist/ui-kit/Loader/Loader.js.map +1 -1
- package/mobile/dist/ui-kit/Select/Select.js +1 -1
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -3
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/DebitForm/getDebitCardFormTaskData.js +1 -0
- package/mobile/lib/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/mobile/lib/retail/api/esiaRequestProfile.js +1 -5
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -1
- package/mobile/lib/retail/api/updateUserTask.d.ts +2 -0
- package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
- package/mobile/lib/retail/components/CheckboxWithDoc/CheckboxWithDoc.js +3 -2
- package/mobile/lib/retail/components/CheckboxWithDoc/CheckboxWithDoc.js.map +1 -1
- package/mobile/lib/retail/components/DocumentDialog/DocumentDialog.js +1 -1
- package/mobile/lib/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
- package/mobile/lib/retail/components/DocumentDialog/useDocumentDialog.d.ts +4 -1
- package/mobile/lib/retail/components/DocumentDialog/useDocumentDialog.js +11 -3
- package/mobile/lib/retail/components/DocumentDialog/useDocumentDialog.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/lib/ui-kit/Loader/Loader.d.ts +1 -1
- package/mobile/lib/ui-kit/Loader/Loader.js +1 -1
- package/mobile/lib/ui-kit/Loader/Loader.js.map +1 -1
- package/mobile/lib/ui-kit/Select/Select.js +1 -1
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +1 -3
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +2 -1
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/DebitForm/getDebitCardFormTaskData.ts +1 -0
- package/mobile/src/retail/api/esiaRequestProfile.ts +2 -6
- package/mobile/src/retail/api/updateUserTask.ts +2 -0
- package/mobile/src/retail/components/CheckboxWithDoc/CheckboxWithDoc.tsx +3 -1
- package/mobile/src/retail/components/DocumentDialog/DocumentDialog.tsx +1 -1
- package/mobile/src/retail/components/DocumentDialog/useDocumentDialog.ts +12 -3
- package/mobile/src/ui-kit/DialogManager/Dialog.tsx +1 -1
- package/mobile/src/ui-kit/Loader/Loader.tsx +4 -2
- package/mobile/src/ui-kit/Select/Select.tsx +1 -1
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +1 -3
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +2 -1
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/DebitForm/getDebitCardFormTaskData.ts +1 -0
- package/src/retail/api/esiaRequestProfile.ts +2 -6
- package/src/retail/api/updateUserTask.ts +2 -0
- package/src/retail/components/CheckboxWithDoc/CheckboxWithDoc.tsx +3 -1
- package/src/retail/components/DocumentDialog/DocumentDialog.tsx +1 -1
- package/src/retail/components/DocumentDialog/useDocumentDialog.ts +12 -3
- package/src/ui-kit/DialogManager/Dialog.tsx +1 -1
- package/src/ui-kit/Loader/Loader.tsx +4 -2
- package/src/ui-kit/Select/Select.tsx +1 -1
|
@@ -1394,7 +1394,7 @@
|
|
|
1394
1394
|
}, [isDisabled]);
|
|
1395
1395
|
const handleChangeQuery = (newQuery) => {
|
|
1396
1396
|
setQuery(newQuery);
|
|
1397
|
-
setOption(newQuery, onChange);
|
|
1397
|
+
isManualInput && setOption(newQuery, onChange);
|
|
1398
1398
|
debouncedOnSearchQuery && debouncedOnSearchQuery(newQuery);
|
|
1399
1399
|
};
|
|
1400
1400
|
const handleClose = useCallback(() => {
|
|
@@ -2462,7 +2462,7 @@
|
|
|
2462
2462
|
|
|
2463
2463
|
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" }) })));
|
|
2464
2464
|
|
|
2465
|
-
const Dialog = JSX(({ className, head, children, onClose, onClick }) => (jsxs("div", { className: style('relative bg-white pt-0 p-lg', className), role: "dialog", title: "\u0414\u0438\u0430\u043B\u043E\u0433", onClick: onClick, children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: onClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-
|
|
2465
|
+
const Dialog = JSX(({ className, head, children, onClose, onClick }) => (jsxs("div", { className: style('relative bg-white pt-0 p-lg', className), role: "dialog", title: "\u0414\u0438\u0430\u043B\u043E\u0433", onClick: onClick, children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: onClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-m mb-[74px] lg:mb-0", children: children })] })));
|
|
2466
2466
|
|
|
2467
2467
|
const ResponseTypeDialog = JSX(({ ok, typeForm, onClose }) => {
|
|
2468
2468
|
const statusIcon = ok ? 'ResponseOKIcon' : 'ResponseFailIcon';
|
|
@@ -2550,7 +2550,7 @@
|
|
|
2550
2550
|
|
|
2551
2551
|
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, {
|
|
2552
2552
|
'backdrop-blur': blur,
|
|
2553
|
-
}), children: jsx("div", { className: style('inline-block', 'animate-spin rounded-full', 'border-solid border-current', 'border-r-transparent', size === 'small'
|
|
2553
|
+
}), children: jsx("div", { className: style('inline-block', 'animate-spin rounded-full', 'border-solid border-current', 'border-r-transparent', size === 'extraSmall' && 'border-2 h-4 w-4', size === 'small' && 'border-4 h-8 w-8', size === 'big' && 'border-8 h-28 w-28', color), role: "status" }) })));
|
|
2554
2554
|
|
|
2555
2555
|
const SubmitButton$1 = JSX(({ isLoading, disabled, children, className, ...rest }) => (jsxs(Button, { type: "submit", className: style('relative', className), disabled: isLoading || disabled, ...rest, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] })));
|
|
2556
2556
|
|
|
@@ -4103,26 +4103,33 @@
|
|
|
4103
4103
|
|
|
4104
4104
|
const DocumentDialog = JSX(({ src, onClose, onDocumentRead }) => {
|
|
4105
4105
|
const isMobileMode = useMobileMode();
|
|
4106
|
-
return (jsxs(Dialog, { className: "
|
|
4106
|
+
return (jsxs(Dialog, { className: "mt-xl max-w-4xl mx-auto px-0 min-h-0 pb-0", onClose: onClose, children: [isMobileMode ? (jsx("img", { src: src })) : (jsx("iframe", { src: `${src}#toolbar=0`, className: "w-full h-[80vh]", id: "iframe-dialog" })), jsx(Button, { className: "mx-auto mt-m", type: "button", onClick: () => {
|
|
4107
4107
|
onDocumentRead?.();
|
|
4108
4108
|
onClose?.();
|
|
4109
4109
|
}, children: "\u041E\u0437\u043D\u0430\u043A\u043E\u043C\u0438\u0442\u044C\u0441\u044F" })] }));
|
|
4110
4110
|
});
|
|
4111
4111
|
|
|
4112
4112
|
const useDocumentDialog = (docId, onDocumentRead) => {
|
|
4113
|
+
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
4113
4114
|
const { open } = useDialog(DocumentDialog);
|
|
4114
4115
|
const isMobileMode = useMobileMode();
|
|
4115
|
-
|
|
4116
|
-
if (docId) {
|
|
4116
|
+
const openDocument = useCallback(async () => {
|
|
4117
|
+
if (docId && !isLoading) {
|
|
4118
|
+
startLoading();
|
|
4117
4119
|
const src = URL.createObjectURL(await feedbackById(docId, isMobileMode));
|
|
4118
4120
|
open({ src, onDocumentRead });
|
|
4121
|
+
endLoading();
|
|
4119
4122
|
}
|
|
4120
|
-
}, [open, docId, isMobileMode]);
|
|
4123
|
+
}, [open, docId, isMobileMode, isLoading]);
|
|
4124
|
+
return {
|
|
4125
|
+
openDocument,
|
|
4126
|
+
isLoading,
|
|
4127
|
+
};
|
|
4121
4128
|
};
|
|
4122
4129
|
|
|
4123
4130
|
const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
|
|
4124
|
-
const openDocument = useDocumentDialog(docId, () => props.onChange?.(true));
|
|
4125
|
-
return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (
|
|
4131
|
+
const { openDocument, isLoading } = useDocumentDialog(docId, () => props.onChange?.(true));
|
|
4132
|
+
return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (jsxs(Button, { embedded: true, onClick: openDocument, children: [jsx(ButtonTitle, { children: "\u041E\u0437\u043D\u0430\u043A\u043E\u043C\u0438\u0442\u044C\u0441\u044F" }), isLoading ? jsx(Loader, { blur: false, size: "extraSmall", position: "static" }) : null] })) : null] }), renderErrorText(error)] }));
|
|
4126
4133
|
});
|
|
4127
4134
|
|
|
4128
4135
|
const ConsentField = JSX(({ field, input }) => {
|
|
@@ -5917,9 +5924,7 @@
|
|
|
5917
5924
|
}),
|
|
5918
5925
|
},
|
|
5919
5926
|
],
|
|
5920
|
-
marketingInfo
|
|
5921
|
-
bannerId: marketingInfo?.bannerId,
|
|
5922
|
-
},
|
|
5927
|
+
marketingInfo,
|
|
5923
5928
|
},
|
|
5924
5929
|
};
|
|
5925
5930
|
};
|
|
@@ -6145,10 +6150,7 @@
|
|
|
6145
6150
|
}
|
|
6146
6151
|
}, [target, key]);
|
|
6147
6152
|
|
|
6148
|
-
const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body)
|
|
6149
|
-
saveToken(res);
|
|
6150
|
-
return res;
|
|
6151
|
-
});
|
|
6153
|
+
const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body);
|
|
6152
6154
|
|
|
6153
6155
|
const initialFormState = {
|
|
6154
6156
|
surname: '',
|
|
@@ -6366,7 +6368,7 @@
|
|
|
6366
6368
|
code,
|
|
6367
6369
|
state,
|
|
6368
6370
|
redirectUri: globalThis.location?.href,
|
|
6369
|
-
authorize:
|
|
6371
|
+
authorize: false,
|
|
6370
6372
|
});
|
|
6371
6373
|
if (data) {
|
|
6372
6374
|
const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
|
|
@@ -6420,6 +6422,7 @@
|
|
|
6420
6422
|
utm_content: queryStorage.get('utm_content'),
|
|
6421
6423
|
utm_term: queryStorage.get('utm_term'),
|
|
6422
6424
|
bannerId: queryStorage.get('bannerId'),
|
|
6425
|
+
userId: queryStorage.get('userId'),
|
|
6423
6426
|
};
|
|
6424
6427
|
return {
|
|
6425
6428
|
code,
|
|
@@ -7909,19 +7912,19 @@
|
|
|
7909
7912
|
} }), jsx("div", { className: "z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m", children: jsx(Timer, { seconds: time }) })] })] }));
|
|
7910
7913
|
});
|
|
7911
7914
|
|
|
7912
|
-
const FormStatus = JSX(({ title, description: dsc, sectionInfoTitle, sectionInfo, sectionAdditionalTitle, sectionInfoAdditional, buttonText, interval, onExpire = noop, ...props }) => (jsxs(BlockWrapper, { ...props, children: [jsxs("div", { className: "flex flex-col md:flex-row items-center", children: [jsx(Headline, { headlineVersion: "M", title: title, description: dsc, align: "text-left", padding: "p-xl", className: "w-full" }), interval ? jsx(TimerCircle, { interval: interval, onEnd: onExpire }) : null] }), jsx(SectionInfo, { title: sectionInfoTitle, items: sectionInfo }), jsx(SectionInfo, { title: sectionAdditionalTitle, items: sectionInfoAdditional, countColumns: true }), buttonText ? (jsx(Link, { href: "/natural", text: buttonText, version: "primary", className: "w-full mt-lg" })) : null] })));
|
|
7913
|
-
const SectionInfo = ({ title, items, countColumns = false, }) => {
|
|
7915
|
+
const FormStatus = JSX(({ title, description: dsc, sectionInfoTitle, sectionInfo, sectionAdditionalTitle, sectionInfoAdditional, buttonText, interval, onExpire = noop, ...props }) => (jsxs(BlockWrapper, { ...props, children: [jsxs("div", { className: "flex flex-col md:flex-row items-center", children: [jsx(Headline, { headlineVersion: "M", title: title, description: dsc, align: "text-left", padding: "p-xl", className: "w-full" }), interval ? jsx(TimerCircle, { interval: interval, onEnd: onExpire }) : null] }), jsx(SectionInfo$1, { title: sectionInfoTitle, items: sectionInfo }), jsx(SectionInfo$1, { title: sectionAdditionalTitle, items: sectionInfoAdditional, countColumns: true }), buttonText ? (jsx(Link, { href: "/natural", text: buttonText, version: "primary", className: "w-full mt-lg" })) : null] })));
|
|
7916
|
+
const SectionInfo$1 = ({ title, items, countColumns = false, }) => {
|
|
7914
7917
|
const isMobile = useMobileMode();
|
|
7915
7918
|
if (!items) {
|
|
7916
7919
|
return null;
|
|
7917
7920
|
}
|
|
7918
|
-
return (jsxs("div", { children: [jsx("hr", { className: "w-full h-px bg-main-gray border-0" }), jsxs("div", { className: "p-xl", children: [title ? (jsx(Text, { color: "text-primary-text", size: "text-h5", children: jsx("div", { className: style({ 'mb-m': Boolean(title) }), children: title }) })) : null, items ? (jsx("div", { className: style('grid grid-cols-1 gap-m', inputColumnStyles(countColumns || isMobile ? 1 : 2)), children: items.map((item, index) => (jsx("div", { children: renderItem$
|
|
7921
|
+
return (jsxs("div", { children: [jsx("hr", { className: "w-full h-px bg-main-gray border-0" }), jsxs("div", { className: "p-xl", children: [title ? (jsx(Text, { color: "text-primary-text", size: "text-h5", children: jsx("div", { className: style({ 'mb-m': Boolean(title) }), children: title }) })) : null, items ? (jsx("div", { className: style('grid grid-cols-1 gap-m', inputColumnStyles(countColumns || isMobile ? 1 : 2)), children: items.map((item, index) => (jsx("div", { children: renderItem$2(item) }, index))) })) : null] })] }));
|
|
7919
7922
|
};
|
|
7920
|
-
const renderItem$
|
|
7923
|
+
const renderItem$2 = ({ label, description }) => (jsxs("div", { className: "flex flex-col", children: [jsx(Text, { color: "text-secondary-text", size: "text-l", children: label }), jsx(Text, { color: "text-primary-text", size: "text-xl", children: description })] }));
|
|
7921
7924
|
|
|
7922
|
-
const FailedStatusContent$
|
|
7925
|
+
const FailedStatusContent$2 = JSX(() => (jsx(FormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435", description: "\u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u0411\u0430\u043D\u043A \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043E\u0434\u043E\u0431\u0440\u0438\u0442\u044C \u0412\u0430\u0448\u0443 \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u043F\u043E\u0437\u0436\u0435. \u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0432 \u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB.", buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
7923
7926
|
|
|
7924
|
-
const PendingStatusContent$
|
|
7927
|
+
const PendingStatusContent$2 = JSX(({ onExpire }) => {
|
|
7925
7928
|
const { statusInfo } = useRetailFormStore();
|
|
7926
7929
|
return (jsx(FormStatus, { interval: 300, title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430", description: "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0439\u0442\u0435 \u043E\u043A\u043D\u043E, \u0441\u043A\u043E\u0440\u043E \u0441\u043E\u043E\u0431\u0449\u0438\u043C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442", sectionInfoTitle: "\u0417\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u043E \u043A\u0440\u0435\u0434\u0438\u0442\u0443", sectionInfo: [
|
|
7927
7930
|
{
|
|
@@ -8017,14 +8020,14 @@
|
|
|
8017
8020
|
}, [taskId]);
|
|
8018
8021
|
useInterval(trackStatus, 30000);
|
|
8019
8022
|
const handleExpire = useCallback(() => setStatus(STATUS_TYPE.rework), []);
|
|
8020
|
-
return renderStatus$
|
|
8023
|
+
return renderStatus$2(status, handleExpire);
|
|
8021
8024
|
});
|
|
8022
|
-
const renderStatus$
|
|
8025
|
+
const renderStatus$2 = (status, handleExpire) => {
|
|
8023
8026
|
const statusesMap = {
|
|
8024
|
-
IN_PROCESS: jsx(PendingStatusContent$
|
|
8025
|
-
CANCELLED: jsx(FailedStatusContent$
|
|
8026
|
-
FAILED: jsx(FailedStatusContent$
|
|
8027
|
-
DRAFT: jsx(FailedStatusContent$
|
|
8027
|
+
IN_PROCESS: jsx(PendingStatusContent$2, { onExpire: handleExpire }),
|
|
8028
|
+
CANCELLED: jsx(FailedStatusContent$2, {}),
|
|
8029
|
+
FAILED: jsx(FailedStatusContent$2, {}),
|
|
8030
|
+
DRAFT: jsx(FailedStatusContent$2, {}),
|
|
8028
8031
|
APPROVED: jsx(SuccessStatusCardContent, {}),
|
|
8029
8032
|
PRE_DECISION: jsx(SuccessStatusCardContent, {}),
|
|
8030
8033
|
REVISION: jsx(ReworkStatusContent$1, {}),
|
|
@@ -8085,7 +8088,7 @@
|
|
|
8085
8088
|
participantDateRegistration: dateRegistrationValidator(formState.limitedBirthday),
|
|
8086
8089
|
})(formState);
|
|
8087
8090
|
|
|
8088
|
-
const StepsNavigationButtons$
|
|
8091
|
+
const StepsNavigationButtons$2 = JSX(({ step, isSending, onPrevStep }) => {
|
|
8089
8092
|
const isFirstStep = step === 0;
|
|
8090
8093
|
const isFinalStep = step === 5;
|
|
8091
8094
|
return (jsxs("div", { className: "flex justify-between gap-m", children: [jsx(Button, { version: "secondary", disabled: isFirstStep, onClick: onPrevStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(SubmitButton$1, { isLoading: isSending, children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
|
|
@@ -8176,7 +8179,7 @@
|
|
|
8176
8179
|
},
|
|
8177
8180
|
];
|
|
8178
8181
|
|
|
8179
|
-
const formStateMap$
|
|
8182
|
+
const formStateMap$2 = [
|
|
8180
8183
|
{
|
|
8181
8184
|
paymentSystem: { key: '', text: '' },
|
|
8182
8185
|
currency: '810',
|
|
@@ -8280,7 +8283,7 @@
|
|
|
8280
8283
|
return new Date(date).toISOString().split('.')[0];
|
|
8281
8284
|
};
|
|
8282
8285
|
|
|
8283
|
-
const getDeliveryData = (formData) => {
|
|
8286
|
+
const getDeliveryData$1 = (formData) => {
|
|
8284
8287
|
const { methodObtain, deliveryDate = '', deliveryTime } = formData;
|
|
8285
8288
|
const isCourierDelivery = methodObtain === 'courier';
|
|
8286
8289
|
const deliveryTimeCd = deliveryTime ? { deliveryTimeCd: { key: deliveryTime } } : {};
|
|
@@ -8294,7 +8297,7 @@
|
|
|
8294
8297
|
}
|
|
8295
8298
|
: {};
|
|
8296
8299
|
};
|
|
8297
|
-
const getOfficeCode = (formData) => {
|
|
8300
|
+
const getOfficeCode$1 = (formData) => {
|
|
8298
8301
|
const { addressRetail, methodObtain } = formData;
|
|
8299
8302
|
const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
|
|
8300
8303
|
return isOfficeObtain
|
|
@@ -8318,7 +8321,7 @@
|
|
|
8318
8321
|
taskKind: 'UNITED',
|
|
8319
8322
|
task: {
|
|
8320
8323
|
id: taskId,
|
|
8321
|
-
...getOfficeCode(formData),
|
|
8324
|
+
...getOfficeCode$1(formData),
|
|
8322
8325
|
authorizedAgentId: formData?.bankEmployeeCode,
|
|
8323
8326
|
participants: [
|
|
8324
8327
|
{
|
|
@@ -8330,15 +8333,15 @@
|
|
|
8330
8333
|
key: 'BORROWER',
|
|
8331
8334
|
value: 'Заемщик',
|
|
8332
8335
|
},
|
|
8333
|
-
...getCurrentStepData$
|
|
8336
|
+
...getCurrentStepData$2(step, formData),
|
|
8334
8337
|
},
|
|
8335
8338
|
],
|
|
8336
8339
|
...getCardOptionsData(formData),
|
|
8337
|
-
...getDeliveryData(formData),
|
|
8340
|
+
...getDeliveryData$1(formData),
|
|
8338
8341
|
files: formData?.files,
|
|
8339
8342
|
},
|
|
8340
8343
|
});
|
|
8341
|
-
const getCurrentStepData$
|
|
8344
|
+
const getCurrentStepData$2 = (step, formData) => {
|
|
8342
8345
|
switch (step) {
|
|
8343
8346
|
case 0:
|
|
8344
8347
|
return {};
|
|
@@ -8361,7 +8364,7 @@
|
|
|
8361
8364
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
8362
8365
|
const isFinalStep = step === 5;
|
|
8363
8366
|
const retailFormStore = useRetailFormStore();
|
|
8364
|
-
const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm, formStateMap$
|
|
8367
|
+
const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm, formStateMap$2), [step, retailFormStore.leadForm]);
|
|
8365
8368
|
const resetForm = useCallback((response) => {
|
|
8366
8369
|
const { leadForm } = retailFormStore;
|
|
8367
8370
|
if (isFinalStep && response.ok && leadForm) {
|
|
@@ -8402,14 +8405,14 @@
|
|
|
8402
8405
|
return [initialState, handleSubmit, isSending];
|
|
8403
8406
|
};
|
|
8404
8407
|
|
|
8405
|
-
const PRODUCT_TYPE$
|
|
8408
|
+
const PRODUCT_TYPE$2 = 'creditCard';
|
|
8406
8409
|
const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
|
|
8407
8410
|
const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs || []), [sections]);
|
|
8408
8411
|
const formValidator = useCallback((formState) => getRetailFormValidator({
|
|
8409
8412
|
formState,
|
|
8410
8413
|
inputs,
|
|
8411
8414
|
step,
|
|
8412
|
-
productType: PRODUCT_TYPE$
|
|
8415
|
+
productType: PRODUCT_TYPE$2,
|
|
8413
8416
|
}), [inputs]);
|
|
8414
8417
|
const [initialState, onSubmit, isSending] = useCreditCardFormAPI({
|
|
8415
8418
|
step,
|
|
@@ -8420,7 +8423,7 @@
|
|
|
8420
8423
|
formValidator,
|
|
8421
8424
|
onSubmit,
|
|
8422
8425
|
});
|
|
8423
|
-
return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep({ sections, field, step }), jsx(StepsNavigationButtons$
|
|
8426
|
+
return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep({ sections, field, step }), jsx(StepsNavigationButtons$2, { isSending: isSending, step: step, onPrevStep: onPrevStep })] }));
|
|
8424
8427
|
});
|
|
8425
8428
|
|
|
8426
8429
|
const PERSONAL_DATA = [
|
|
@@ -8818,7 +8821,7 @@
|
|
|
8818
8821
|
],
|
|
8819
8822
|
},
|
|
8820
8823
|
];
|
|
8821
|
-
const stepsSectionsMap$
|
|
8824
|
+
const stepsSectionsMap$2 = [
|
|
8822
8825
|
CREDIT_CARD_CONTENT,
|
|
8823
8826
|
PERSONAL_INFO_CONTENT$1,
|
|
8824
8827
|
EMPLOYMENT_CONTENT$1,
|
|
@@ -8827,7 +8830,7 @@
|
|
|
8827
8830
|
DELIVERY_CREDIT_CARD_CONTENT,
|
|
8828
8831
|
];
|
|
8829
8832
|
|
|
8830
|
-
const STEPS$
|
|
8833
|
+
const STEPS$2 = 6;
|
|
8831
8834
|
const TITLES = [
|
|
8832
8835
|
'Параметры карты',
|
|
8833
8836
|
'Персональные данные',
|
|
@@ -8842,7 +8845,7 @@
|
|
|
8842
8845
|
const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
|
|
8843
8846
|
useEffect(updateRefreshToken, []);
|
|
8844
8847
|
const handleNextStep = useCallback(() => {
|
|
8845
|
-
setStep((_) => Math.min(_ + 1, STEPS$
|
|
8848
|
+
setStep((_) => Math.min(_ + 1, STEPS$2));
|
|
8846
8849
|
scrollToTop();
|
|
8847
8850
|
}, []);
|
|
8848
8851
|
const handlePrevStep = useCallback(() => {
|
|
@@ -8850,9 +8853,9 @@
|
|
|
8850
8853
|
setStep((_) => Math.max(_ - 1, 0));
|
|
8851
8854
|
scrollToTop();
|
|
8852
8855
|
}, []);
|
|
8853
|
-
const sections = stepsSectionsMap$
|
|
8856
|
+
const sections = stepsSectionsMap$2[step];
|
|
8854
8857
|
const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
|
|
8855
|
-
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$
|
|
8858
|
+
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$2 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step))) })] }) }));
|
|
8856
8859
|
});
|
|
8857
8860
|
|
|
8858
8861
|
const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
|
|
@@ -8860,9 +8863,9 @@
|
|
|
8860
8863
|
return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold mr-s", children: ["\u0428\u0430\u0433 ", step, " \u0438\u0437 ", totalSteps, "."] }), stepsTitles[step] || null, jsx(ProgressBar, { step: progress, showPercentage: false })] }) }));
|
|
8861
8864
|
});
|
|
8862
8865
|
|
|
8863
|
-
const FailedStatusContent = JSX(() => (jsx(FormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435", description: "\u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u0411\u0430\u043D\u043A \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043E\u0434\u043E\u0431\u0440\u0438\u0442\u044C \u0412\u0430\u0448\u0443 \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u043F\u043E\u0437\u0436\u0435. \u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0432 \u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB.", buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
8866
|
+
const FailedStatusContent$1 = JSX(() => (jsx(FormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435", description: "\u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u0411\u0430\u043D\u043A \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043E\u0434\u043E\u0431\u0440\u0438\u0442\u044C \u0412\u0430\u0448\u0443 \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u043F\u043E\u0437\u0436\u0435. \u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0432 \u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB.", buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
8864
8867
|
|
|
8865
|
-
const PendingStatusContent = JSX(({ onExpire }) => {
|
|
8868
|
+
const PendingStatusContent$1 = JSX(({ onExpire }) => {
|
|
8866
8869
|
const { statusInfo } = useRetailFormStore();
|
|
8867
8870
|
return (jsx(FormStatus, { interval: 300, title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430", description: "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0439\u0442\u0435 \u043E\u043A\u043D\u043E, \u0441\u043A\u043E\u0440\u043E \u0441\u043E\u043E\u0431\u0449\u0438\u043C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442", sectionInfoTitle: "\u0417\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u043E \u043A\u0440\u0435\u0434\u0438\u0442\u0443", sectionInfo: [
|
|
8868
8871
|
{
|
|
@@ -8907,7 +8910,7 @@
|
|
|
8907
8910
|
], buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" }));
|
|
8908
8911
|
});
|
|
8909
8912
|
|
|
8910
|
-
const SuccessStatusContent = JSX(() => {
|
|
8913
|
+
const SuccessStatusContent$1 = JSX(() => {
|
|
8911
8914
|
const { statusInfo } = useRetailFormStore();
|
|
8912
8915
|
return (jsx(FormStatus, { title: "\u0411\u0430\u043D\u043A \u043E\u0434\u043E\u0431\u0440\u0438\u043B \u0432\u0430\u043C \u043A\u0440\u0435\u0434\u0438\u0442", description: "\u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u0432 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0432\u0430\u0448 \u043A\u0440\u0435\u0434\u0438\u0442", sectionInfo: [
|
|
8913
8916
|
{
|
|
@@ -8956,22 +8959,22 @@
|
|
|
8956
8959
|
}, [taskId]);
|
|
8957
8960
|
useInterval(trackStatus, 30_000);
|
|
8958
8961
|
const handleExpire = useCallback(() => setStatus(STATUS_TYPE.rework), []);
|
|
8959
|
-
return renderStatus(status, handleExpire);
|
|
8962
|
+
return renderStatus$1(status, handleExpire);
|
|
8960
8963
|
});
|
|
8961
|
-
const renderStatus = (status, onExpire) => {
|
|
8964
|
+
const renderStatus$1 = (status, onExpire) => {
|
|
8962
8965
|
const statusesMap = {
|
|
8963
|
-
IN_PROCESS: jsx(PendingStatusContent, { onExpire: onExpire }),
|
|
8964
|
-
CANCELLED: jsx(FailedStatusContent, {}),
|
|
8965
|
-
FAILED: jsx(FailedStatusContent, {}),
|
|
8966
|
-
DRAFT: jsx(FailedStatusContent, {}),
|
|
8967
|
-
APPROVED: jsx(SuccessStatusContent, {}),
|
|
8968
|
-
PRE_DECISION: jsx(SuccessStatusContent, {}),
|
|
8966
|
+
IN_PROCESS: jsx(PendingStatusContent$1, { onExpire: onExpire }),
|
|
8967
|
+
CANCELLED: jsx(FailedStatusContent$1, {}),
|
|
8968
|
+
FAILED: jsx(FailedStatusContent$1, {}),
|
|
8969
|
+
DRAFT: jsx(FailedStatusContent$1, {}),
|
|
8970
|
+
APPROVED: jsx(SuccessStatusContent$1, {}),
|
|
8971
|
+
PRE_DECISION: jsx(SuccessStatusContent$1, {}),
|
|
8969
8972
|
REVISION: jsx(ReworkStatusContent, {}),
|
|
8970
8973
|
};
|
|
8971
8974
|
return statusesMap[status] || jsx(ReworkStatusContent, {});
|
|
8972
8975
|
};
|
|
8973
8976
|
|
|
8974
|
-
const StepsNavigationButtons = JSX(({ step, onPrevStep, isSending }) => {
|
|
8977
|
+
const StepsNavigationButtons$1 = JSX(({ step, onPrevStep, isSending }) => {
|
|
8975
8978
|
const isFirstStep = step === 0;
|
|
8976
8979
|
const isFinalStep = step === 5;
|
|
8977
8980
|
return (jsxs("div", { className: 'flex justify-between gap-m', children: [jsx(Button, { version: "secondary", disabled: isFirstStep, onClick: onPrevStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(SubmitButton$1, { isLoading: isSending, children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
|
|
@@ -9021,7 +9024,7 @@
|
|
|
9021
9024
|
key: 'BORROWER',
|
|
9022
9025
|
value: 'Заемщик',
|
|
9023
9026
|
},
|
|
9024
|
-
...getCurrentStepData(step, formData),
|
|
9027
|
+
...getCurrentStepData$1(step, formData),
|
|
9025
9028
|
},
|
|
9026
9029
|
],
|
|
9027
9030
|
...getCalcData(formData),
|
|
@@ -9032,7 +9035,7 @@
|
|
|
9032
9035
|
files: formData?.files,
|
|
9033
9036
|
},
|
|
9034
9037
|
});
|
|
9035
|
-
const getCurrentStepData = (step, formData) => {
|
|
9038
|
+
const getCurrentStepData$1 = (step, formData) => {
|
|
9036
9039
|
switch (step) {
|
|
9037
9040
|
case 0:
|
|
9038
9041
|
return getCalculatorData(formData);
|
|
@@ -9047,7 +9050,7 @@
|
|
|
9047
9050
|
}
|
|
9048
9051
|
};
|
|
9049
9052
|
|
|
9050
|
-
const formStateMap = [
|
|
9053
|
+
const formStateMap$1 = [
|
|
9051
9054
|
{
|
|
9052
9055
|
calculator: {
|
|
9053
9056
|
moneyValue: 0,
|
|
@@ -9073,7 +9076,7 @@
|
|
|
9073
9076
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
9074
9077
|
const isFinalStep = step === 4;
|
|
9075
9078
|
const retailFormStore = useRetailFormStore();
|
|
9076
|
-
const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm, formStateMap), [step, retailFormStore.leadForm]);
|
|
9079
|
+
const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm, formStateMap$1), [step, retailFormStore.leadForm]);
|
|
9077
9080
|
const resetForm = useCallback((response) => {
|
|
9078
9081
|
const { leadForm } = retailFormStore;
|
|
9079
9082
|
if (isFinalStep && response.ok && leadForm) {
|
|
@@ -9118,7 +9121,7 @@
|
|
|
9118
9121
|
return [initialState, handleSubmit, isSending];
|
|
9119
9122
|
};
|
|
9120
9123
|
|
|
9121
|
-
const PRODUCT_TYPE = 'credit';
|
|
9124
|
+
const PRODUCT_TYPE$1 = 'credit';
|
|
9122
9125
|
const CreditFormStep = JSX(({ step, sections, programsSource, onPrevStep, onNextStep, onFinish }) => {
|
|
9123
9126
|
const { programId } = useRetailFormStore();
|
|
9124
9127
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
@@ -9127,7 +9130,7 @@
|
|
|
9127
9130
|
formState,
|
|
9128
9131
|
inputs,
|
|
9129
9132
|
step,
|
|
9130
|
-
productType: PRODUCT_TYPE,
|
|
9133
|
+
productType: PRODUCT_TYPE$1,
|
|
9131
9134
|
}), [inputs]);
|
|
9132
9135
|
const [initialState, onSubmit, isSending] = useCreditFormAPI({
|
|
9133
9136
|
step,
|
|
@@ -9138,7 +9141,7 @@
|
|
|
9138
9141
|
formValidator,
|
|
9139
9142
|
onSubmit,
|
|
9140
9143
|
});
|
|
9141
|
-
return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
|
|
9144
|
+
return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons$1, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
|
|
9142
9145
|
});
|
|
9143
9146
|
|
|
9144
9147
|
/* eslint-disable max-lines */
|
|
@@ -9328,7 +9331,7 @@
|
|
|
9328
9331
|
],
|
|
9329
9332
|
},
|
|
9330
9333
|
];
|
|
9331
|
-
const stepsSectionsMap = [
|
|
9334
|
+
const stepsSectionsMap$1 = [
|
|
9332
9335
|
CALCULATOR_CONTENT,
|
|
9333
9336
|
PERSONAL_INFO_CONTENT,
|
|
9334
9337
|
EMPLOYMENT_CONTENT,
|
|
@@ -9336,8 +9339,8 @@
|
|
|
9336
9339
|
DELIVERY_CREDIT_CONTENT,
|
|
9337
9340
|
];
|
|
9338
9341
|
|
|
9339
|
-
const STEPS = 4;
|
|
9340
|
-
const STEP_TITLES = [
|
|
9342
|
+
const STEPS$1 = 4;
|
|
9343
|
+
const STEP_TITLES$1 = [
|
|
9341
9344
|
'',
|
|
9342
9345
|
'Персональные данные',
|
|
9343
9346
|
'Данные о трудоустройстве',
|
|
@@ -9345,6 +9348,382 @@
|
|
|
9345
9348
|
'Отделение Банка',
|
|
9346
9349
|
];
|
|
9347
9350
|
const CreditForm = UniBlock(({ className, programsSource, ...rest }) => {
|
|
9351
|
+
const [step, setStep] = useState(0);
|
|
9352
|
+
const formContainerRef = useRef(null);
|
|
9353
|
+
const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
|
|
9354
|
+
useEffect(updateRefreshToken, []);
|
|
9355
|
+
const handleNextStep = useCallback(() => {
|
|
9356
|
+
setStep((_) => Math.min(_ + 1, STEPS$1));
|
|
9357
|
+
scrollToTop();
|
|
9358
|
+
}, []);
|
|
9359
|
+
const handlePrevStep = useCallback(() => {
|
|
9360
|
+
//TODO search hook - 1,
|
|
9361
|
+
setStep((_) => Math.max(_ - 1, 0));
|
|
9362
|
+
scrollToTop();
|
|
9363
|
+
}, []);
|
|
9364
|
+
const sections = stepsSectionsMap$1[step];
|
|
9365
|
+
const isStartStep = step === 0;
|
|
9366
|
+
const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
|
|
9367
|
+
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES$1, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsx(CreditFormStep, { step: step, sections: sections, programsSource: programsSource, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step))) })] }) }));
|
|
9368
|
+
});
|
|
9369
|
+
|
|
9370
|
+
const DebitFormProgress = JSX(({ step = 1, totalSteps = 2, stepsTitles = [] }) => {
|
|
9371
|
+
const progress = useMemo(() => (step / totalSteps) * 100, [step, totalSteps]);
|
|
9372
|
+
return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold mr-s", children: ["\u0428\u0430\u0433 ", step, " \u0438\u0437 ", totalSteps, "."] }), stepsTitles[step] || null, jsx(ProgressBar, { step: progress, showPercentage: false })] }) }));
|
|
9373
|
+
});
|
|
9374
|
+
|
|
9375
|
+
const INTERNET_BANK_LINK = 'https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault';
|
|
9376
|
+
const DebitFormStatus = JSX(({ title, description: dsc, sectionInfo, buttonText, isDboClient, ...props }) => {
|
|
9377
|
+
return (jsxs(BlockWrapper, { ...props, children: [jsx("div", { className: "flex flex-col md:flex-row items-center", children: jsx(Headline, { headlineVersion: "M", title: title, description: dsc, align: "text-left", padding: "p-xl", className: "w-full" }) }), jsx(SectionInfo, { items: sectionInfo }), buttonText ? (jsx(LinkButton, { href: "/natural", text: buttonText, version: "primary", className: "w-full mt-lg" })) : null, isDboClient ? (jsxs("div", { className: "flex flex-col md:flex-row md:gap-lg", children: [jsx(LinkButton, { href: "/natural/debetcards", text: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0437\u0430\u043D\u043E\u0432\u043E", version: "primary", className: "w-full mt-lg" }), jsx(LinkButton, { href: INTERNET_BANK_LINK, text: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442 \u0431\u0430\u043D\u043A", version: "primary", className: "w-full mt-lg" })] })) : null] }));
|
|
9378
|
+
});
|
|
9379
|
+
const SectionInfo = ({ title, items, }) => {
|
|
9380
|
+
if (!items) {
|
|
9381
|
+
return null;
|
|
9382
|
+
}
|
|
9383
|
+
return (jsxs("div", { children: [jsx("hr", { className: "w-full h-px bg-main-gray border-0" }), jsxs("div", { className: "p-xl", children: [title ? (jsx(Text, { color: "text-primary-text", size: "text-h5", children: jsx("div", { className: style({ 'mb-m': Boolean(title) }), children: title }) })) : null, items ? (jsx("div", { className: style('grid gap-m md:grid-cols-2', 'md:grid-cols-2'), children: items.map((item, index) => (jsx("div", { children: renderItem$1(item) }, index))) })) : null] })] }));
|
|
9384
|
+
};
|
|
9385
|
+
const renderItem$1 = ({ label, description }) => (jsxs("div", { className: "flex flex-col", children: [jsx(Text, { color: "text-secondary-text", size: "text-l", children: label }), jsx(Text, { color: "text-primary-text", size: "text-xl", children: description })] }));
|
|
9386
|
+
|
|
9387
|
+
const DboClientStatusContent = JSX(() => {
|
|
9388
|
+
const { leadForm } = useRetailFormStore();
|
|
9389
|
+
return (jsx(DebitFormStatus, { title: `${leadForm?.name} ${leadForm?.middleName},`, description: "\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0412\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044C \u0432 \u0441\u0438\u0441\u0442\u0435\u043C\u0430\u0445 \u0411\u0430\u043D\u043A\u0430, \u043E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435 \u043D\u0430 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u043E\u0441\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u043F\u0430\u0441\u043F\u043E\u0440\u0442\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445", sectionInfo: [
|
|
9390
|
+
{
|
|
9391
|
+
label: 'Фамилия',
|
|
9392
|
+
description: leadForm?.surname,
|
|
9393
|
+
},
|
|
9394
|
+
{
|
|
9395
|
+
label: 'Имя',
|
|
9396
|
+
description: leadForm?.name,
|
|
9397
|
+
},
|
|
9398
|
+
{
|
|
9399
|
+
label: 'Отчество',
|
|
9400
|
+
description: leadForm?.middleName,
|
|
9401
|
+
},
|
|
9402
|
+
{
|
|
9403
|
+
label: 'Дата рождения',
|
|
9404
|
+
description: formatDate(leadForm?.limitedBirthday || ''),
|
|
9405
|
+
},
|
|
9406
|
+
{
|
|
9407
|
+
label: 'Серия документа',
|
|
9408
|
+
description: leadForm?.dulSerie,
|
|
9409
|
+
},
|
|
9410
|
+
{
|
|
9411
|
+
label: 'Номер документа',
|
|
9412
|
+
description: leadForm?.dulNumber,
|
|
9413
|
+
},
|
|
9414
|
+
], isDboClient: true }));
|
|
9415
|
+
});
|
|
9416
|
+
|
|
9417
|
+
const FailedStatusContent = JSX(() => (jsx(DebitFormStatus, { title: "\u0412\u0440\u0435\u043C\u044F \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u043F\u0440\u0435\u0432\u044B\u0448\u0435\u043D\u043E", description: "\u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u043F\u043E\u0437\u0436\u0435", buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
9418
|
+
|
|
9419
|
+
const PendingStatusContent = JSX(() => (jsx(DebitFormStatus, { title: "\u041F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435 \u043D\u0435\u043C\u043D\u043E\u0433\u043E", description: "\u0411\u0430\u043D\u043A \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u0435\u0442 \u0432\u0430\u0448\u0443 \u0437\u0430\u044F\u0432\u043A\u0443" })));
|
|
9420
|
+
|
|
9421
|
+
const SalaryDboClientStatusContent = JSX(() => (jsx(DebitFormStatus, { description: "\u0412\u044B \u0443\u0436\u0435 \u044F\u0432\u043B\u044F\u0435\u0442\u0435\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB, \u0434\u043B\u044F \u0412\u0430\u0441 \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0432 \u043F\u0435\u0440\u0432\u044B\u0439 \u0440\u0430\u0431\u043E\u0447\u0438\u0439 \u0434\u0435\u043D\u044C", buttonText: "\u041D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
9422
|
+
|
|
9423
|
+
const SuccessStatusContent = JSX(({ isOffice }) => (jsx(DebitFormStatus, { title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u043F\u0440\u0438\u043D\u044F\u0442\u0430", description: isOffice
|
|
9424
|
+
? 'Ваша заявка принята, мы сообщим вам в СМС о поступлении карты в офис'
|
|
9425
|
+
: 'Вам позвонит сотрудник Банка для уточнения времени и даты доставки', buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
9426
|
+
|
|
9427
|
+
const DebitFormStatusTracker = JSX(() => {
|
|
9428
|
+
const [status, setStatus] = useState(STATUS_TYPE.process);
|
|
9429
|
+
const { taskId, statusInfo, programId } = useRetailFormStore();
|
|
9430
|
+
const isSalaryCard = programId === '38';
|
|
9431
|
+
const isOffice = statusInfo?.methodObtain === 'office';
|
|
9432
|
+
useEffect(() => {
|
|
9433
|
+
(async () => {
|
|
9434
|
+
const statusCd = await sendSignalToProcess({
|
|
9435
|
+
signalType: 'FIND_PERSON_SIGNAL',
|
|
9436
|
+
taskId,
|
|
9437
|
+
});
|
|
9438
|
+
isOffice &&
|
|
9439
|
+
(await sendSignalToProcess({
|
|
9440
|
+
signalType: 'SET_PERSON_SIGNAL',
|
|
9441
|
+
taskId,
|
|
9442
|
+
}));
|
|
9443
|
+
setStatus(statusCd || STATUS_TYPE.notFound);
|
|
9444
|
+
})();
|
|
9445
|
+
}, [taskId]);
|
|
9446
|
+
return renderStatus(status, isOffice, isSalaryCard);
|
|
9447
|
+
});
|
|
9448
|
+
const renderStatus = (status, isOffice, isSalaryCard) => {
|
|
9449
|
+
const statusesMap = {
|
|
9450
|
+
IN_PROCESS: jsx(PendingStatusContent, {}),
|
|
9451
|
+
NOT_FOUND: jsx(FailedStatusContent, {}),
|
|
9452
|
+
CLIENT_NOT_OK: jsx(FailedStatusContent, {}),
|
|
9453
|
+
DBO_CLIENT: isSalaryCard ? jsx(SalaryDboClientStatusContent, {}) : jsx(DboClientStatusContent, {}),
|
|
9454
|
+
PRE_DECISION: jsx(SuccessStatusContent, { isOffice: isOffice }), //
|
|
9455
|
+
};
|
|
9456
|
+
return statusesMap[status] || jsx(SuccessStatusContent, { isOffice: isOffice });
|
|
9457
|
+
};
|
|
9458
|
+
|
|
9459
|
+
const StepsNavigationButtons = JSX(({ step, onPrevStep, isSending }) => {
|
|
9460
|
+
const isFirstStep = step === 0;
|
|
9461
|
+
const isFinalStep = step === 5;
|
|
9462
|
+
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(SubmitButton$1, { isLoading: isSending, children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
|
|
9463
|
+
});
|
|
9464
|
+
|
|
9465
|
+
const updateUserTaskDebit = (body) => doRequest('/user-data/updateUserTaskDebit', 'PUT', body);
|
|
9466
|
+
|
|
9467
|
+
const formStateMap = [
|
|
9468
|
+
{
|
|
9469
|
+
regionRetail: { key: '', text: '' },
|
|
9470
|
+
regionHasDelivery: false,
|
|
9471
|
+
addressRetail: { key: '', text: '' },
|
|
9472
|
+
addressCourier: {
|
|
9473
|
+
fullAddress: '',
|
|
9474
|
+
fiasCode: '',
|
|
9475
|
+
},
|
|
9476
|
+
methodObtain: undefined,
|
|
9477
|
+
deliveryDate: undefined,
|
|
9478
|
+
},
|
|
9479
|
+
{
|
|
9480
|
+
surname: '',
|
|
9481
|
+
name: '',
|
|
9482
|
+
middleName: '',
|
|
9483
|
+
sex: '',
|
|
9484
|
+
limitedBirthday: undefined,
|
|
9485
|
+
birthPlace: '',
|
|
9486
|
+
phone: '',
|
|
9487
|
+
email: '',
|
|
9488
|
+
dulSerie: undefined,
|
|
9489
|
+
dulNumber: undefined,
|
|
9490
|
+
dulIssueDate: undefined,
|
|
9491
|
+
dulSubdivisionCode: '',
|
|
9492
|
+
dulIssuedBy: '',
|
|
9493
|
+
addressRegistration: {
|
|
9494
|
+
fullAddress: '',
|
|
9495
|
+
fiasCode: '',
|
|
9496
|
+
},
|
|
9497
|
+
addressFact: {
|
|
9498
|
+
fullAddress: '',
|
|
9499
|
+
fiasCode: '',
|
|
9500
|
+
},
|
|
9501
|
+
},
|
|
9502
|
+
{
|
|
9503
|
+
paymentSystem: { key: '', text: '' },
|
|
9504
|
+
currency: '810',
|
|
9505
|
+
codeWord: '',
|
|
9506
|
+
latinName: '',
|
|
9507
|
+
latinSurname: '',
|
|
9508
|
+
},
|
|
9509
|
+
];
|
|
9510
|
+
|
|
9511
|
+
const getDeliveryData = (formData) => {
|
|
9512
|
+
const { methodObtain, regionRetail, comment, deliveryDate = '', deliveryTime } = formData;
|
|
9513
|
+
const isCourierDelivery = methodObtain === 'courier';
|
|
9514
|
+
const deliveryTimeCd = deliveryTime ? { deliveryTimeCd: { key: deliveryTime } } : {};
|
|
9515
|
+
return isCourierDelivery
|
|
9516
|
+
? {
|
|
9517
|
+
cardServiceRegionCd: regionRetail,
|
|
9518
|
+
courierDeliveryFlg: true,
|
|
9519
|
+
deliveryComment: comment,
|
|
9520
|
+
deliveryDate: dateToISO(deliveryDate.toString().replace(/(GMT)[+-]\d{4}/, 'GMT+0000')),
|
|
9521
|
+
office: { id: '' },
|
|
9522
|
+
...deliveryTimeCd,
|
|
9523
|
+
}
|
|
9524
|
+
: {};
|
|
9525
|
+
};
|
|
9526
|
+
const getOfficeCode = (formData) => {
|
|
9527
|
+
const { addressRetail, methodObtain } = formData;
|
|
9528
|
+
const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
|
|
9529
|
+
return isOfficeObtain
|
|
9530
|
+
? {
|
|
9531
|
+
courierDeliveryFlg: false,
|
|
9532
|
+
office: { id: addressRetail.key },
|
|
9533
|
+
}
|
|
9534
|
+
: {};
|
|
9535
|
+
};
|
|
9536
|
+
const getDeliveryDebitData = (formData) => {
|
|
9537
|
+
const { addressCourier, methodObtain } = formData;
|
|
9538
|
+
const isCourierDelivery = methodObtain === 'courier';
|
|
9539
|
+
return isCourierDelivery
|
|
9540
|
+
? {
|
|
9541
|
+
participantAddresses: getParticipantAddresses$1({ addressCourier }),
|
|
9542
|
+
}
|
|
9543
|
+
: {};
|
|
9544
|
+
};
|
|
9545
|
+
const getDebitCardData = (formData) => {
|
|
9546
|
+
const { latinName: latinFirstname, latinSurname } = formData;
|
|
9547
|
+
return {
|
|
9548
|
+
latinFirstname,
|
|
9549
|
+
latinSurname,
|
|
9550
|
+
latinName: `${latinFirstname} ${latinSurname}`,
|
|
9551
|
+
};
|
|
9552
|
+
};
|
|
9553
|
+
|
|
9554
|
+
const getDebitCardFormTaskData = ({ participantId, taskId, formData, programId, step = 0, }) => ({
|
|
9555
|
+
task: {
|
|
9556
|
+
id: taskId,
|
|
9557
|
+
creditProgram: {
|
|
9558
|
+
code: debitProgrammIdToCardCodesMap[programId],
|
|
9559
|
+
},
|
|
9560
|
+
...getOfficeCode(formData),
|
|
9561
|
+
participants: [
|
|
9562
|
+
{
|
|
9563
|
+
id: participantId,
|
|
9564
|
+
residentOtherCountry: false,
|
|
9565
|
+
...getCurrentStepData(step, formData),
|
|
9566
|
+
},
|
|
9567
|
+
],
|
|
9568
|
+
...getCardOptionsData(formData),
|
|
9569
|
+
...getDeliveryData(formData),
|
|
9570
|
+
},
|
|
9571
|
+
});
|
|
9572
|
+
const getCurrentStepData = (step, formData) => {
|
|
9573
|
+
switch (step) {
|
|
9574
|
+
case 0:
|
|
9575
|
+
return getDeliveryDebitData(formData);
|
|
9576
|
+
case 1:
|
|
9577
|
+
return getPersonalInfoData(formData);
|
|
9578
|
+
case 2:
|
|
9579
|
+
return getDebitCardData(formData);
|
|
9580
|
+
default:
|
|
9581
|
+
return {};
|
|
9582
|
+
}
|
|
9583
|
+
};
|
|
9584
|
+
|
|
9585
|
+
const useDebitFormAPI = ({ step, onNextStep, onFinish, }) => {
|
|
9586
|
+
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
9587
|
+
const isFinalStep = step === 2;
|
|
9588
|
+
const retailFormStore = useRetailFormStore();
|
|
9589
|
+
const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm, formStateMap), [step, retailFormStore.leadForm]);
|
|
9590
|
+
const resetForm = useCallback(() => {
|
|
9591
|
+
const { leadForm } = retailFormStore;
|
|
9592
|
+
retailFormStore.statusInfo = {
|
|
9593
|
+
methodObtain: leadForm?.methodObtain,
|
|
9594
|
+
};
|
|
9595
|
+
retailFormStore.leadForm = initialState;
|
|
9596
|
+
}, [initialState]);
|
|
9597
|
+
const handleSubmit = useCallback(async (formData) => {
|
|
9598
|
+
startSending();
|
|
9599
|
+
retailFormStore.leadForm = formData;
|
|
9600
|
+
try {
|
|
9601
|
+
const { taskId, participantId, programId } = retailFormStore;
|
|
9602
|
+
if (taskId && participantId && programId) {
|
|
9603
|
+
await updateUserTaskDebit(getDebitCardFormTaskData({
|
|
9604
|
+
participantId,
|
|
9605
|
+
taskId,
|
|
9606
|
+
programId,
|
|
9607
|
+
step,
|
|
9608
|
+
formData: formData,
|
|
9609
|
+
}));
|
|
9610
|
+
}
|
|
9611
|
+
if (isFinalStep || formData.methodObtain === 'courier') {
|
|
9612
|
+
onFinish?.();
|
|
9613
|
+
resetForm();
|
|
9614
|
+
}
|
|
9615
|
+
else {
|
|
9616
|
+
onNextStep();
|
|
9617
|
+
}
|
|
9618
|
+
}
|
|
9619
|
+
catch (ex) {
|
|
9620
|
+
// Do nothing
|
|
9621
|
+
}
|
|
9622
|
+
finally {
|
|
9623
|
+
endSending();
|
|
9624
|
+
}
|
|
9625
|
+
}, [isFinalStep]);
|
|
9626
|
+
return [initialState, handleSubmit, isSending];
|
|
9627
|
+
};
|
|
9628
|
+
|
|
9629
|
+
const PRODUCT_TYPE = 'debitCard';
|
|
9630
|
+
const DebitFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
|
|
9631
|
+
const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs ?? []), [sections]);
|
|
9632
|
+
const formValidator = useCallback((formState) => getRetailFormValidator({
|
|
9633
|
+
formState,
|
|
9634
|
+
inputs,
|
|
9635
|
+
step,
|
|
9636
|
+
productType: PRODUCT_TYPE,
|
|
9637
|
+
}), [inputs]);
|
|
9638
|
+
const [initialState, onSubmit, isSending] = useDebitFormAPI({
|
|
9639
|
+
step,
|
|
9640
|
+
onNextStep,
|
|
9641
|
+
onFinish,
|
|
9642
|
+
});
|
|
9643
|
+
const [, { field, onSubmit: handleSubmit }] = useForm(initialState, {
|
|
9644
|
+
formValidator,
|
|
9645
|
+
onSubmit,
|
|
9646
|
+
});
|
|
9647
|
+
return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep({ sections, field, step }), jsx(StepsNavigationButtons, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
|
|
9648
|
+
});
|
|
9649
|
+
|
|
9650
|
+
const DEBIT_PERSONAL_INFO_CONTENT = [
|
|
9651
|
+
...PERSONAL_DATA,
|
|
9652
|
+
{
|
|
9653
|
+
title: 'Адрес регистрации по месту жительства',
|
|
9654
|
+
columns: 1,
|
|
9655
|
+
inputs: [],
|
|
9656
|
+
},
|
|
9657
|
+
{
|
|
9658
|
+
inputs: [
|
|
9659
|
+
{
|
|
9660
|
+
name: 'addressRegistration',
|
|
9661
|
+
required: true,
|
|
9662
|
+
dadata: true,
|
|
9663
|
+
filledByEsia: true,
|
|
9664
|
+
},
|
|
9665
|
+
{ name: 'addressMatch' },
|
|
9666
|
+
],
|
|
9667
|
+
},
|
|
9668
|
+
{
|
|
9669
|
+
title: 'Адрес фактического проживания (место пребывания РФ)',
|
|
9670
|
+
inputs: [],
|
|
9671
|
+
},
|
|
9672
|
+
{
|
|
9673
|
+
inputs: [{ name: 'addressFact', required: true, dadata: true }],
|
|
9674
|
+
},
|
|
9675
|
+
];
|
|
9676
|
+
const DEBIT_CARD_CONTENT = [
|
|
9677
|
+
{
|
|
9678
|
+
title: 'Параметры карты',
|
|
9679
|
+
inputs: [],
|
|
9680
|
+
},
|
|
9681
|
+
{
|
|
9682
|
+
inputs: [
|
|
9683
|
+
{ name: 'currency', required: true },
|
|
9684
|
+
{ name: 'paymentSystem', required: true },
|
|
9685
|
+
{ name: 'cardCategory', required: true },
|
|
9686
|
+
],
|
|
9687
|
+
},
|
|
9688
|
+
{
|
|
9689
|
+
title: 'Отображение на карте',
|
|
9690
|
+
inputs: [],
|
|
9691
|
+
},
|
|
9692
|
+
{
|
|
9693
|
+
columns: 2,
|
|
9694
|
+
inputs: [{ name: 'latinName' }, { name: 'latinSurname', required: true }],
|
|
9695
|
+
},
|
|
9696
|
+
{
|
|
9697
|
+
inputs: [
|
|
9698
|
+
{
|
|
9699
|
+
name: 'infoCard',
|
|
9700
|
+
label: 'Проверьте корректность заполненных полей, при необходимости внесите изменения.',
|
|
9701
|
+
},
|
|
9702
|
+
],
|
|
9703
|
+
},
|
|
9704
|
+
{
|
|
9705
|
+
inputs: [
|
|
9706
|
+
{
|
|
9707
|
+
name: 'infoCard',
|
|
9708
|
+
label:
|
|
9709
|
+
// eslint-disable-next-line max-len
|
|
9710
|
+
'Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию.',
|
|
9711
|
+
},
|
|
9712
|
+
],
|
|
9713
|
+
},
|
|
9714
|
+
{
|
|
9715
|
+
inputs: [{ name: 'codeWord', required: true }],
|
|
9716
|
+
},
|
|
9717
|
+
];
|
|
9718
|
+
const stepsSectionsMap = [
|
|
9719
|
+
DELIVERY_CARD_CONTENT,
|
|
9720
|
+
DEBIT_PERSONAL_INFO_CONTENT,
|
|
9721
|
+
DEBIT_CARD_CONTENT,
|
|
9722
|
+
];
|
|
9723
|
+
|
|
9724
|
+
const STEPS = 2;
|
|
9725
|
+
const STEP_TITLES = ['', 'Персональные данные', 'Платежная система'];
|
|
9726
|
+
const DebitForm = UniBlock(({ className, ...rest }) => {
|
|
9348
9727
|
const [step, setStep] = useState(0);
|
|
9349
9728
|
const formContainerRef = useRef(null);
|
|
9350
9729
|
const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
|
|
@@ -9361,7 +9740,7 @@
|
|
|
9361
9740
|
const sections = stepsSectionsMap[step];
|
|
9362
9741
|
const isStartStep = step === 0;
|
|
9363
9742
|
const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
|
|
9364
|
-
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(
|
|
9743
|
+
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(DebitFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: isFormFinished ? (jsx(DebitFormStatusTracker, {})) : (jsx(DebitFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step))) })] }) }));
|
|
9365
9744
|
});
|
|
9366
9745
|
|
|
9367
9746
|
const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
|
|
@@ -10601,6 +10980,7 @@
|
|
|
10601
10980
|
ApplicationLeadForm,
|
|
10602
10981
|
CreditCardForm,
|
|
10603
10982
|
CreditForm,
|
|
10983
|
+
DebitForm,
|
|
10604
10984
|
};
|
|
10605
10985
|
|
|
10606
10986
|
const applyAspects = (aspects) => (ev) => {
|
|
@@ -10722,7 +11102,7 @@
|
|
|
10722
11102
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10723
11103
|
});
|
|
10724
11104
|
|
|
10725
|
-
const packageVersion = "0.14.
|
|
11105
|
+
const packageVersion = "0.14.879";
|
|
10726
11106
|
|
|
10727
11107
|
exports.Blocks = Blocks;
|
|
10728
11108
|
exports.ContentPage = ContentPage;
|