@redneckz/wildless-cms-uni-blocks 0.14.607 → 0.14.609
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/updateUserProfile.d.ts +2 -0
- package/bundle/bundle.umd.js +101 -29
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/dist/api/RetailAPI/updateUserProfile.js +1 -1
- package/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/dist/ui-kit/DialogManager/openDocument.js +11 -0
- package/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/lib/api/RetailAPI/updateUserProfile.js +1 -1
- package/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.d.ts +6 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/lib/ui-kit/DialogManager/openDocument.js +8 -0
- package/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +101 -29
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/dist/api/RetailAPI/updateUserProfile.js +1 -1
- package/mobile/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.js +11 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/lib/api/RetailAPI/updateUserProfile.js +1 -1
- package/mobile/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.js +8 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/src/api/RetailAPI/updateUserProfile.ts +3 -1
- package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
- package/mobile/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
- package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
- package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
- package/mobile/src/ui-kit/DialogManager/openDocument.tsx +13 -0
- package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
- package/package.json +1 -1
- package/src/api/RetailAPI/updateUserProfile.ts +3 -1
- package/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
- package/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.tsx +7 -0
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
- package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
- package/src/ui-kit/DialogManager/openDocument.tsx +13 -0
- package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
|
@@ -15,6 +15,8 @@ export declare type UpdateUserProfileBody = {
|
|
|
15
15
|
consentAssignmentClaimsFlg?: boolean;
|
|
16
16
|
consentCollectionFlg?: boolean;
|
|
17
17
|
consentInformFlg?: boolean;
|
|
18
|
+
consentBkiFlg?: boolean;
|
|
19
|
+
smsConsentBki?: string;
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
export declare const updateUserProfile: (body: UpdateUserProfileBody) => Promise<CreateUserProfileResponse>;
|
package/bundle/bundle.umd.js
CHANGED
|
@@ -1991,17 +1991,6 @@
|
|
|
1991
1991
|
},
|
|
1992
1992
|
};
|
|
1993
1993
|
|
|
1994
|
-
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" }) })));
|
|
1995
|
-
|
|
1996
|
-
const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
|
|
1997
|
-
const { close } = useDialogManager();
|
|
1998
|
-
const handleClose = useCallback(() => {
|
|
1999
|
-
close();
|
|
2000
|
-
onClose && onClose();
|
|
2001
|
-
}, [onClose]);
|
|
2002
|
-
return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
2003
|
-
});
|
|
2004
|
-
|
|
2005
1994
|
async function doRequest(url, method, body) {
|
|
2006
1995
|
const response = await fetch(`${API_BASE_URI}${url}`, {
|
|
2007
1996
|
method,
|
|
@@ -2031,16 +2020,28 @@
|
|
|
2031
2020
|
return URL.createObjectURL(response);
|
|
2032
2021
|
};
|
|
2033
2022
|
|
|
2034
|
-
const
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2023
|
+
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" }) })));
|
|
2024
|
+
|
|
2025
|
+
const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
|
|
2026
|
+
const { close } = useDialogManager();
|
|
2027
|
+
const handleClose = useCallback(() => {
|
|
2028
|
+
close();
|
|
2029
|
+
onClose && onClose();
|
|
2030
|
+
}, [onClose]);
|
|
2031
|
+
return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
2038
2032
|
});
|
|
2039
|
-
|
|
2033
|
+
|
|
2034
|
+
const openDocument = async (id, open) => {
|
|
2040
2035
|
const document = await getDocument(id);
|
|
2041
2036
|
open(jsx(Dialog, { className: "my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0", children: jsx("iframe", { src: `${document}#toolbar=0`, className: "w-full h-[80vh]", id: "iframe-dialog" }) }));
|
|
2042
2037
|
};
|
|
2043
2038
|
|
|
2039
|
+
const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
|
|
2040
|
+
const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
|
|
2041
|
+
const { open } = useDialogManager();
|
|
2042
|
+
return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (jsx(LinkButton, { className: "text-primary-main", onClick: () => openDocument(docId, open), children: jsx(Text, { children: OPEN_DOC_BUTTON_TEXT }) })) : null] }), renderErrorText(error)] }));
|
|
2043
|
+
});
|
|
2044
|
+
|
|
2044
2045
|
const ConsentField = JSX(({ field, input }) => input && input.name ? (jsx(CheckboxWithDoc, { text: CONSENTS[input.name]?.text, docId: CONSENTS[input.name]?.docId, ...getValidation(field(input.name), validatorObj[input.name], input?.required) })) : null);
|
|
2045
2046
|
|
|
2046
2047
|
const LABEL_TEXT =
|
|
@@ -2715,7 +2716,7 @@
|
|
|
2715
2716
|
?.some((_) => Boolean(withValidator(field(_?.name), validatorObj[_?.name]).error)), [inputs]);
|
|
2716
2717
|
return (jsx("div", { className: "w-fit", children: jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col pl-2xl", children: inputs.map(getField(field, typeForm)) })), renderFoldButton: renderGeneralCheckbox(jsxs("div", { children: [jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, text: CONSENT_ALL_DOCS_TEXT }, key), renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')] })) }) }));
|
|
2717
2718
|
});
|
|
2718
|
-
const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
|
|
2719
|
+
const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", type: "button", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
|
|
2719
2720
|
|
|
2720
2721
|
const renderInputs = ({ field, typeForm = '', inputs }) => {
|
|
2721
2722
|
const { consentInputs, restInputs } = splitInputs(inputs || []);
|
|
@@ -2777,7 +2778,7 @@
|
|
|
2777
2778
|
|
|
2778
2779
|
const createUserProfile = (body) => doRequest('/public-data/createUserProfile', 'POST', body);
|
|
2779
2780
|
|
|
2780
|
-
const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', '
|
|
2781
|
+
const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
|
|
2781
2782
|
|
|
2782
2783
|
const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
|
|
2783
2784
|
|
|
@@ -3028,7 +3029,7 @@
|
|
|
3028
3029
|
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
3029
3030
|
});
|
|
3030
3031
|
resetError();
|
|
3031
|
-
close && close();
|
|
3032
|
+
close && close(values.join(''));
|
|
3032
3033
|
}
|
|
3033
3034
|
catch {
|
|
3034
3035
|
setIsLoading(false);
|
|
@@ -3079,19 +3080,92 @@
|
|
|
3079
3080
|
const renderTextButton = (textButton, isDisabled, handleSubmit) => textButton ? (jsx(SubmitButton, { isDisabled: isDisabled, onClick: handleSubmit, text: textButton })) : null;
|
|
3080
3081
|
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" }));
|
|
3081
3082
|
|
|
3082
|
-
const useVerifyPhoneDialog = (
|
|
3083
|
+
const useVerifyPhoneDialog = () => {
|
|
3083
3084
|
const { open, close } = useDialogManager();
|
|
3084
3085
|
return {
|
|
3085
|
-
open: (
|
|
3086
|
+
open: (handleClose, props) => open(jsx(VerifyPhoneDialog, { onClose: close, close: handleClose, ...props })),
|
|
3086
3087
|
close,
|
|
3087
3088
|
};
|
|
3088
3089
|
};
|
|
3089
3090
|
|
|
3091
|
+
const defaultConsentText = {
|
|
3092
|
+
title: 'Подпишите согласие на запрос в БКИ',
|
|
3093
|
+
description: 'Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту',
|
|
3094
|
+
};
|
|
3095
|
+
const refuseConsentText = {
|
|
3096
|
+
title: 'Вы уверены, что хотите отказаться от запроса в БКИ',
|
|
3097
|
+
description: 'Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения',
|
|
3098
|
+
};
|
|
3099
|
+
const ConsentBkiDialog = JSX(function ({ handleSubmit = noop, onClose = noop, }) {
|
|
3100
|
+
const [confirmStatus, setConfirmStatus] = useState('');
|
|
3101
|
+
const [showRefuceContent, setShowRefuceContent] = useState(false);
|
|
3102
|
+
const { open, close } = useDialogManager();
|
|
3103
|
+
const handleClose = useCallback(() => {
|
|
3104
|
+
close();
|
|
3105
|
+
handleSubmit(confirmStatus);
|
|
3106
|
+
}, [confirmStatus]);
|
|
3107
|
+
const handleConfirmChange = useCallback((value) => {
|
|
3108
|
+
setConfirmStatus(value);
|
|
3109
|
+
if (value === 'REFUSE') {
|
|
3110
|
+
setShowRefuceContent(true);
|
|
3111
|
+
}
|
|
3112
|
+
}, []);
|
|
3113
|
+
const consentText = showRefuceContent ? refuseConsentText : defaultConsentText;
|
|
3114
|
+
return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center", children: [jsx("div", { role: "button", onClick: () => openDocument(CONSENT_BKI_ID, open), children: jsx(Heading, { className: "text-center text-balance", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS$1, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" })] }) }));
|
|
3115
|
+
});
|
|
3116
|
+
const ITEMS$1 = [
|
|
3117
|
+
{ id: 'SIGNED', text: 'Подписать' },
|
|
3118
|
+
{ id: 'REFUSE', text: 'Отказаться' },
|
|
3119
|
+
];
|
|
3120
|
+
const CONSENT_BKI_ID = 2;
|
|
3121
|
+
|
|
3122
|
+
const useConsentBkiDialog = () => {
|
|
3123
|
+
const { open, closeAll } = useDialogManager();
|
|
3124
|
+
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
3125
|
+
const redirectToCreditForm = () => {
|
|
3126
|
+
globalThis.location.href = '/credit-lead';
|
|
3127
|
+
};
|
|
3128
|
+
const handleSuccessVerify = (profileId) => async (smsCode) => {
|
|
3129
|
+
if (profileId) {
|
|
3130
|
+
await updateUserProfile({
|
|
3131
|
+
profile: {
|
|
3132
|
+
id: profileId,
|
|
3133
|
+
consentBkiFlg: true,
|
|
3134
|
+
smsConsentBki: smsCode,
|
|
3135
|
+
},
|
|
3136
|
+
});
|
|
3137
|
+
}
|
|
3138
|
+
redirectToCreditForm();
|
|
3139
|
+
};
|
|
3140
|
+
const handleSubmitBkiConstent = (phone, profileId) => async (confirmStatus) => {
|
|
3141
|
+
await closeAll();
|
|
3142
|
+
if (confirmStatus === 'SIGNED' && phone) {
|
|
3143
|
+
verifyPhoneDialog.open(handleSuccessVerify(profileId), verifyPhoneContent$1(phone));
|
|
3144
|
+
}
|
|
3145
|
+
else {
|
|
3146
|
+
redirectToCreditForm();
|
|
3147
|
+
}
|
|
3148
|
+
};
|
|
3149
|
+
return {
|
|
3150
|
+
open: (phone, profileId) => open(jsx(ConsentBkiDialog, { handleSubmit: handleSubmitBkiConstent(phone, profileId), onClose: redirectToCreditForm })),
|
|
3151
|
+
};
|
|
3152
|
+
};
|
|
3153
|
+
const verifyPhoneContent$1 = (phone) => ({
|
|
3154
|
+
title: 'Подтвердите номер телефона',
|
|
3155
|
+
description: `Мы отправили код на ${phone}`,
|
|
3156
|
+
phoneNumber: formatPhone(phone),
|
|
3157
|
+
textButton: 'Отправить',
|
|
3158
|
+
__html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
|
|
3159
|
+
<ul><li>согласие на запрос информации в БКИ</li></ul>`,
|
|
3160
|
+
});
|
|
3161
|
+
|
|
3090
3162
|
const useApplicationLeadApi = ({ inputs, programId, saveForm }) => {
|
|
3091
3163
|
const [responseStatus, setResponseStatus] = useState('');
|
|
3092
3164
|
const [, setTaskId] = useLocalStorage('taskId');
|
|
3093
3165
|
const [, setProfileId] = useLocalStorage('profileId');
|
|
3094
3166
|
const [, setParticipantId] = useLocalStorage('participantId');
|
|
3167
|
+
const consentBkiDialog = useConsentBkiDialog();
|
|
3168
|
+
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
3095
3169
|
const saveUserData = useCallback((participantId, taskId, profileId) => {
|
|
3096
3170
|
setParticipantId(participantId);
|
|
3097
3171
|
setTaskId(taskId);
|
|
@@ -3125,21 +3199,19 @@
|
|
|
3125
3199
|
}));
|
|
3126
3200
|
saveUserData(participantId, taskId, profileId);
|
|
3127
3201
|
saveForm(JSON.stringify(formData));
|
|
3128
|
-
globalThis.location.href = '/credit-lead';
|
|
3129
3202
|
}
|
|
3130
3203
|
catch {
|
|
3131
3204
|
setResponseStatus('Fail');
|
|
3132
3205
|
}
|
|
3133
3206
|
};
|
|
3207
|
+
const handleCloseVerify = async () => {
|
|
3208
|
+
await handleSuccessVerify();
|
|
3209
|
+
consentBkiDialog.open(formData.phone, profileId);
|
|
3210
|
+
};
|
|
3134
3211
|
const acceptedConsents = Object.keys(CONSENTS)
|
|
3135
3212
|
.filter((_) => formData[_])
|
|
3136
3213
|
.map((_) => CONSENTS[_]?.text);
|
|
3137
|
-
|
|
3138
|
-
const verifyPhoneDialog = useVerifyPhoneDialog({
|
|
3139
|
-
close: handleSuccessVerify,
|
|
3140
|
-
...verifyPhoneContent(formData?.phone, acceptedConsents),
|
|
3141
|
-
});
|
|
3142
|
-
verifyPhoneDialog.open();
|
|
3214
|
+
verifyPhoneDialog.open(handleCloseVerify, verifyPhoneContent(formData?.phone, acceptedConsents));
|
|
3143
3215
|
}
|
|
3144
3216
|
}
|
|
3145
3217
|
catch {
|
|
@@ -7889,7 +7961,7 @@
|
|
|
7889
7961
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7890
7962
|
});
|
|
7891
7963
|
|
|
7892
|
-
const packageVersion = "0.14.
|
|
7964
|
+
const packageVersion = "0.14.608";
|
|
7893
7965
|
|
|
7894
7966
|
exports.Blocks = Blocks;
|
|
7895
7967
|
exports.ContentPage = ContentPage;
|