@redneckz/wildless-cms-uni-blocks 0.14.713 → 0.14.715
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +47 -36
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/bundle/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/bundle/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/bundle/hooks/useAsyncEffect.d.ts +1 -0
- package/bundle/services/retail/mockLocalStorage.d.ts +1 -0
- package/bundle/ui-kit/Button/Button.d.ts +1 -0
- package/bundle/ui-kit/Loader/Loader.d.ts +1 -0
- package/dist/api/RetailAPI/sendCode.js +3 -4
- package/dist/api/RetailAPI/sendCode.js.map +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
- package/dist/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -2
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/dist/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/dist/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.js +2 -2
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/dist/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +7 -1
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/hooks/useAsyncEffect.d.ts +1 -0
- package/dist/hooks/useAsyncEffect.js +15 -0
- package/dist/hooks/useAsyncEffect.js.map +1 -0
- package/dist/services/retail/mockLocalStorage.d.ts +1 -0
- package/dist/services/retail/mockLocalStorage.js +35 -0
- package/dist/services/retail/mockLocalStorage.js.map +1 -0
- package/dist/setup-fixture.js +11 -0
- package/dist/setup-fixture.js.map +1 -1
- package/dist/ui-kit/Button/Button.d.ts +1 -0
- package/dist/ui-kit/Button/Button.js +6 -5
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Loader/Loader.d.ts +1 -0
- package/dist/ui-kit/Loader/Loader.js +2 -2
- package/dist/ui-kit/Loader/Loader.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/api/RetailAPI/sendCode.js +4 -5
- package/lib/api/RetailAPI/sendCode.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
- package/lib/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.fixture.d.ts +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.fixture.mobile.d.ts +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -2
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/lib/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/lib/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.fixture.d.ts +1 -1
- package/lib/components/CreditForm/CreditForm.fixture.mobile.d.ts +1 -1
- package/lib/components/CreditForm/CreditFormStep.js +2 -2
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/lib/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +7 -1
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/hooks/useAsyncEffect.d.ts +1 -0
- package/lib/hooks/useAsyncEffect.js +12 -0
- package/lib/hooks/useAsyncEffect.js.map +1 -0
- package/lib/services/retail/mockLocalStorage.d.ts +1 -0
- package/lib/services/retail/mockLocalStorage.js +32 -0
- package/lib/services/retail/mockLocalStorage.js.map +1 -0
- package/lib/setup-fixture.js +11 -0
- package/lib/setup-fixture.js.map +1 -1
- package/lib/ui-kit/Button/Button.d.ts +1 -0
- package/lib/ui-kit/Button/Button.js +7 -6
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Loader/Loader.d.ts +1 -0
- package/lib/ui-kit/Loader/Loader.js +2 -2
- package/lib/ui-kit/Loader/Loader.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +47 -36
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/mobile/bundle/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/mobile/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/bundle/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/mobile/bundle/hooks/useAsyncEffect.d.ts +1 -0
- package/mobile/bundle/services/retail/mockLocalStorage.d.ts +1 -0
- package/mobile/bundle/ui-kit/Button/Button.d.ts +1 -0
- package/mobile/bundle/ui-kit/Loader/Loader.d.ts +1 -0
- package/mobile/dist/api/RetailAPI/sendCode.js +3 -4
- package/mobile/dist/api/RetailAPI/sendCode.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -2
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js +2 -2
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +7 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/hooks/useAsyncEffect.d.ts +1 -0
- package/mobile/dist/hooks/useAsyncEffect.js +15 -0
- package/mobile/dist/hooks/useAsyncEffect.js.map +1 -0
- package/mobile/dist/services/retail/mockLocalStorage.d.ts +1 -0
- package/mobile/dist/services/retail/mockLocalStorage.js +35 -0
- package/mobile/dist/services/retail/mockLocalStorage.js.map +1 -0
- package/mobile/dist/setup-fixture.js +11 -0
- package/mobile/dist/setup-fixture.js.map +1 -1
- package/mobile/dist/ui-kit/Button/Button.d.ts +1 -0
- package/mobile/dist/ui-kit/Button/Button.js +6 -5
- package/mobile/dist/ui-kit/Button/Button.js.map +1 -1
- package/mobile/dist/ui-kit/Loader/Loader.d.ts +1 -0
- package/mobile/dist/ui-kit/Loader/Loader.js +2 -2
- package/mobile/dist/ui-kit/Loader/Loader.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/api/RetailAPI/sendCode.js +4 -5
- package/mobile/lib/api/RetailAPI/sendCode.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/renderSubmitButton.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -2
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +7 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js +2 -2
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -0
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.d.ts +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +7 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/hooks/useAsyncEffect.d.ts +1 -0
- package/mobile/lib/hooks/useAsyncEffect.js +12 -0
- package/mobile/lib/hooks/useAsyncEffect.js.map +1 -0
- package/mobile/lib/services/retail/mockLocalStorage.d.ts +1 -0
- package/mobile/lib/services/retail/mockLocalStorage.js +32 -0
- package/mobile/lib/services/retail/mockLocalStorage.js.map +1 -0
- package/mobile/lib/setup-fixture.js +11 -0
- package/mobile/lib/setup-fixture.js.map +1 -1
- package/mobile/lib/ui-kit/Button/Button.d.ts +1 -0
- package/mobile/lib/ui-kit/Button/Button.js +7 -6
- package/mobile/lib/ui-kit/Button/Button.js.map +1 -1
- package/mobile/lib/ui-kit/Loader/Loader.d.ts +1 -0
- package/mobile/lib/ui-kit/Loader/Loader.js +2 -2
- package/mobile/lib/ui-kit/Loader/Loader.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -4
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/src/api/RetailAPI/sendCode.ts +4 -15
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -2
- package/mobile/src/components/ApplicationLeadForm/renderSubmitButton.tsx +2 -2
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +12 -7
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -2
- package/mobile/src/components/CreditCardForm/StepsNavigationButtons.tsx +17 -12
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +7 -2
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -2
- package/mobile/src/components/CreditForm/StepsNavigationButtons.tsx +17 -12
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +7 -2
- package/mobile/src/hooks/useAsyncEffect.ts +16 -0
- package/mobile/src/services/retail/mockLocalStorage.ts +40 -0
- package/mobile/src/setup-fixture.ts +12 -0
- package/mobile/src/ui-kit/Button/Button.tsx +7 -3
- package/mobile/src/ui-kit/Loader/Loader.tsx +5 -3
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +5 -4
- package/package.json +1 -1
- package/src/api/RetailAPI/sendCode.ts +4 -15
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -2
- package/src/components/ApplicationLeadForm/renderSubmitButton.tsx +2 -2
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +12 -7
- package/src/components/CreditCardForm/CreditCardForm.fixture.mobile.tsx +14 -18
- package/src/components/CreditCardForm/CreditCardForm.fixture.tsx +14 -18
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -2
- package/src/components/CreditCardForm/StepsNavigationButtons.tsx +17 -12
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +7 -2
- package/src/components/CreditForm/CreditForm.fixture.mobile.tsx +19 -23
- package/src/components/CreditForm/CreditForm.fixture.tsx +19 -23
- package/src/components/CreditForm/CreditFormStep.tsx +2 -2
- package/src/components/CreditForm/StepsNavigationButtons.tsx +17 -12
- package/src/components/CreditForm/useCreditFormAPI.tsx +7 -2
- package/src/hooks/useAsyncEffect.ts +16 -0
- package/src/services/retail/mockLocalStorage.ts +40 -0
- package/src/setup-fixture.ts +12 -0
- package/src/ui-kit/Button/Button.tsx +7 -3
- package/src/ui-kit/Loader/Loader.tsx +5 -3
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +5 -4
package/bundle/bundle.umd.js
CHANGED
|
@@ -1980,9 +1980,9 @@
|
|
|
1980
1980
|
return (jsx(CheckboxWithError, { text: "\u0410\u0434\u0440\u0435\u0441 \u0444\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043C\u0435\u0441\u0442\u0430 \u0436\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u0435\u0442 \u0441 \u0430\u0434\u0440\u0435\u0441\u043E\u043C \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438", ...getValidation(field('addressMatch'), validatorObj.addressMatch, input?.required) }));
|
|
1981
1981
|
});
|
|
1982
1982
|
|
|
1983
|
-
const Loader = JSX(({ color = 'text-primary-main', position = 'absolute', blur = true }) => (jsx("div", { className: style('flex justify-center items-center h-full w-full z-50', position, {
|
|
1983
|
+
const Loader = JSX(({ color = 'text-primary-main', position = 'absolute', blur = true, size = 'big' }) => (jsx("div", { className: style('flex justify-center items-center h-full w-full z-50', position, {
|
|
1984
1984
|
'backdrop-blur': blur,
|
|
1985
|
-
}), children: jsx("div", { className: style('inline-block
|
|
1985
|
+
}), children: jsx("div", { className: style('inline-block ', 'animate-spin rounded-full', 'border-solid border-current', 'border-r-transparent', size === 'small' ? 'border-4 h-8 w-8' : 'border-8 h-28 w-28', color), role: "status" }) })));
|
|
1986
1986
|
|
|
1987
1987
|
const MapMarkerClusterIcon = '/icons/MapMarkerClusterIcon.svg';
|
|
1988
1988
|
const MapMarkerClusterYellowIcon = '/icons/MapMarkerClusterYellowIcon.svg';
|
|
@@ -3247,14 +3247,14 @@
|
|
|
3247
3247
|
};
|
|
3248
3248
|
const Button = JSX(({ children, ...props }) => {
|
|
3249
3249
|
const button = useButton();
|
|
3250
|
-
const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
|
|
3251
|
-
return (
|
|
3250
|
+
const { className, version = 'primary', active, disabled, isLoading, type = 'button', rounded = true, role, onClick, } = button(props);
|
|
3251
|
+
return (jsxs("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs relative', {
|
|
3252
3252
|
'text-white bg-primary-active': active,
|
|
3253
|
-
'bg-main-gray text-main-disabled cursor-not-allowed': disabled,
|
|
3253
|
+
'bg-main-gray text-main-disabled cursor-not-allowed': disabled || isLoading,
|
|
3254
3254
|
'rounded-md': rounded,
|
|
3255
|
-
}, !active && !disabled
|
|
3255
|
+
}, !active && !disabled && !isLoading
|
|
3256
3256
|
? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
|
|
3257
|
-
: '', className), type: type, role: role, onClick: onClick, children: children }));
|
|
3257
|
+
: '', className), type: type, role: role, onClick: onClick, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] }));
|
|
3258
3258
|
});
|
|
3259
3259
|
|
|
3260
3260
|
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
|
|
@@ -4470,7 +4470,7 @@
|
|
|
4470
4470
|
},
|
|
4471
4471
|
];
|
|
4472
4472
|
|
|
4473
|
-
const renderSubmitButton = (button,
|
|
4473
|
+
const renderSubmitButton = (button, isSending) => (jsx(Button, { className: style('w-full @xl:w-auto'), type: "submit", isLoading: isSending, children: button?.text ? button.text : 'Отправить заявку' }));
|
|
4474
4474
|
|
|
4475
4475
|
const createDraftTask = async (body) => {
|
|
4476
4476
|
const res = await fetchRetailJSON('/user-data/createDraftTask', 'POST', body);
|
|
@@ -4516,10 +4516,9 @@
|
|
|
4516
4516
|
};
|
|
4517
4517
|
};
|
|
4518
4518
|
|
|
4519
|
-
const sendCode = (body) =>
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
Boolean(res?.errorMessage?.startsWith(`Too many request for phoneNumber [${phoneNumber}]`));
|
|
4519
|
+
const sendCode = (body) => doRequest('/sms/sendCode', 'POST', body)
|
|
4520
|
+
.then((res) => res.text())
|
|
4521
|
+
.then((text) => text === 'OK');
|
|
4523
4522
|
|
|
4524
4523
|
const checkCaptcha = (body) => doRequest('/sms/checkCaptcha', 'POST', body)
|
|
4525
4524
|
.then((res) => res.text())
|
|
@@ -4652,7 +4651,7 @@
|
|
|
4652
4651
|
|
|
4653
4652
|
const useVerifyPhoneDialogSubmit = ({ values, onSuccess, }) => {
|
|
4654
4653
|
const [errorText, setErrorText] = useState('');
|
|
4655
|
-
const [isLoading,
|
|
4654
|
+
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
4656
4655
|
const [timeNextReq, setTimeNextReq] = useState(0);
|
|
4657
4656
|
const [isTimerStarted, setIsTimerStarted] = useState(false);
|
|
4658
4657
|
const [attempts, setAttempts] = useState(0);
|
|
@@ -4664,19 +4663,19 @@
|
|
|
4664
4663
|
setIsTimerStarted(false);
|
|
4665
4664
|
setTimeNextReq(0);
|
|
4666
4665
|
setAttempts((_) => _ + 1);
|
|
4667
|
-
|
|
4666
|
+
startLoading();
|
|
4668
4667
|
await checkCode({
|
|
4669
4668
|
smsText: values.join(''),
|
|
4670
4669
|
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
4671
4670
|
});
|
|
4672
4671
|
resetError();
|
|
4673
|
-
onSuccess?.(values.join(''));
|
|
4672
|
+
await onSuccess?.(values.join(''));
|
|
4674
4673
|
}
|
|
4675
4674
|
catch {
|
|
4676
4675
|
setErrorText(attempts > 1 ? 'Исчерпан лимит ввода смс-кода' : 'Неверный код');
|
|
4677
4676
|
}
|
|
4678
4677
|
finally {
|
|
4679
|
-
|
|
4678
|
+
endLoading();
|
|
4680
4679
|
}
|
|
4681
4680
|
}, [values, attempts]);
|
|
4682
4681
|
useEffect(() => {
|
|
@@ -5127,6 +5126,7 @@
|
|
|
5127
5126
|
|
|
5128
5127
|
const useApplicationLeadApi = ({ inputs, programId, nextStepLink, }) => {
|
|
5129
5128
|
const [responseStatus, setResponseStatus] = useState('');
|
|
5129
|
+
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
5130
5130
|
const saveUserData = useSaveUserData();
|
|
5131
5131
|
const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
|
|
5132
5132
|
const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
|
|
@@ -5138,6 +5138,7 @@
|
|
|
5138
5138
|
return;
|
|
5139
5139
|
}
|
|
5140
5140
|
try {
|
|
5141
|
+
startSending();
|
|
5141
5142
|
const profileId = await createUserProfile({
|
|
5142
5143
|
profile: { phone: formatPhone(formData.phone) },
|
|
5143
5144
|
});
|
|
@@ -5154,10 +5155,7 @@
|
|
|
5154
5155
|
};
|
|
5155
5156
|
const handleSuccessVerify = async () => {
|
|
5156
5157
|
try {
|
|
5157
|
-
const lastTaskId = await getLastTaskStatus({
|
|
5158
|
-
profileId,
|
|
5159
|
-
programId,
|
|
5160
|
-
});
|
|
5158
|
+
const lastTaskId = await getLastTaskStatus({ profileId, programId });
|
|
5161
5159
|
if (lastTaskId) {
|
|
5162
5160
|
const task = await getTaskById({ taskId: lastTaskId });
|
|
5163
5161
|
verifyPhoneDialog.close();
|
|
@@ -5175,14 +5173,13 @@
|
|
|
5175
5173
|
setResponseStatus('Fail');
|
|
5176
5174
|
}
|
|
5177
5175
|
};
|
|
5178
|
-
const acceptedConsents =
|
|
5179
|
-
.filter((_) => formData[_])
|
|
5180
|
-
.map((_) => CONSENTS[_]?.text);
|
|
5176
|
+
const acceptedConsents = getAcceptedConsents(formData);
|
|
5181
5177
|
verifyPhoneDialog.open({
|
|
5182
5178
|
phone: formData?.phone,
|
|
5183
5179
|
consents: acceptedConsents,
|
|
5184
5180
|
onSuccess: handleSuccessVerify,
|
|
5185
5181
|
});
|
|
5182
|
+
endSending();
|
|
5186
5183
|
}
|
|
5187
5184
|
}
|
|
5188
5185
|
catch {
|
|
@@ -5192,8 +5189,12 @@
|
|
|
5192
5189
|
return {
|
|
5193
5190
|
handleSubmit,
|
|
5194
5191
|
responseStatus,
|
|
5192
|
+
isSending,
|
|
5195
5193
|
};
|
|
5196
5194
|
};
|
|
5195
|
+
const getAcceptedConsents = (formData) => Object.keys(CONSENTS)
|
|
5196
|
+
.filter((_) => formData[_])
|
|
5197
|
+
.map((_) => CONSENTS[_]?.text);
|
|
5197
5198
|
const updateUserData = async ({ programId, profileId, formData, saveUserData, }) => {
|
|
5198
5199
|
const transformedForm = transformOtherConsentsField(formData);
|
|
5199
5200
|
await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
|
|
@@ -5380,7 +5381,7 @@
|
|
|
5380
5381
|
const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, ...rest }) => {
|
|
5381
5382
|
const inputs = useMemo(() => (applicationFormData?.flatMap((_) => _?.inputs) || []), [applicationFormData]);
|
|
5382
5383
|
const [initialFormState, { isLoading }] = useInitApplicationLead(inputs, nextStepLink);
|
|
5383
|
-
const { handleSubmit, responseStatus } = useApplicationLeadApi({
|
|
5384
|
+
const { handleSubmit, responseStatus, isSending } = useApplicationLeadApi({
|
|
5384
5385
|
inputs,
|
|
5385
5386
|
programId,
|
|
5386
5387
|
nextStepLink,
|
|
@@ -5392,7 +5393,7 @@
|
|
|
5392
5393
|
responseTypeDialog.open({ responseType: responseStatus });
|
|
5393
5394
|
}
|
|
5394
5395
|
}, [responseStatus]);
|
|
5395
|
-
return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$2({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
|
|
5396
|
+
return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$2({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button, isSending)] }) }));
|
|
5396
5397
|
});
|
|
5397
5398
|
|
|
5398
5399
|
const NotFound = JSX(({ title, description }) => {
|
|
@@ -6979,10 +6980,10 @@
|
|
|
6979
6980
|
});
|
|
6980
6981
|
const getValue$3 = (field) => (name) => field(name)?.value;
|
|
6981
6982
|
|
|
6982
|
-
const StepsNavigationButtons$1 = JSX(({ step, onPrevStep }) => {
|
|
6983
|
+
const StepsNavigationButtons$1 = JSX(({ step, isSending, onPrevStep }) => {
|
|
6983
6984
|
const isFirstStep = step === 0;
|
|
6984
6985
|
const isFinalStep = step === 5;
|
|
6985
|
-
return (jsxs("div", { className: "flex justify-between gap-m", children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { type: "submit", children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
|
|
6986
|
+
return (jsxs("div", { className: "flex justify-between gap-m", children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { isLoading: isSending, type: "submit", children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
|
|
6986
6987
|
});
|
|
6987
6988
|
|
|
6988
6989
|
const getAdditionalInfoData = (formData) => {
|
|
@@ -7272,6 +7273,7 @@
|
|
|
7272
7273
|
};
|
|
7273
7274
|
|
|
7274
7275
|
const useCreditCardFormAPI = ({ step, inputs, onNextStep, onFinish, }) => {
|
|
7276
|
+
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
7275
7277
|
const isFinalStep = step === 5;
|
|
7276
7278
|
const retailFormStore = useRetailFormStore();
|
|
7277
7279
|
const initialState = useMemo(() => getInitialFormState$1(step, retailFormStore.leadForm), [step, retailFormStore.leadForm]);
|
|
@@ -7296,6 +7298,7 @@
|
|
|
7296
7298
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
7297
7299
|
return;
|
|
7298
7300
|
}
|
|
7301
|
+
startSending();
|
|
7299
7302
|
retailFormStore.leadForm = formData;
|
|
7300
7303
|
try {
|
|
7301
7304
|
const { taskId, profileId, participantId } = retailFormStore;
|
|
@@ -7317,21 +7320,24 @@
|
|
|
7317
7320
|
catch (ex) {
|
|
7318
7321
|
// Do nothing
|
|
7319
7322
|
}
|
|
7323
|
+
finally {
|
|
7324
|
+
endSending();
|
|
7325
|
+
}
|
|
7320
7326
|
}, [isFinalStep, resetForm]);
|
|
7321
|
-
return [initialState, handleSubmit];
|
|
7327
|
+
return [initialState, handleSubmit, isSending];
|
|
7322
7328
|
};
|
|
7323
7329
|
const getValue$2 = (formData) => (name) => formData[name];
|
|
7324
7330
|
|
|
7325
7331
|
const CreditCardFormStep = JSX(({ step, sections, isFormFinished, onPrevStep, onNextStep, onFinish }) => {
|
|
7326
7332
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
7327
|
-
const [initialState, onSubmit] = useCreditCardFormAPI({
|
|
7333
|
+
const [initialState, onSubmit, isSending] = useCreditCardFormAPI({
|
|
7328
7334
|
step,
|
|
7329
7335
|
inputs,
|
|
7330
7336
|
onNextStep,
|
|
7331
7337
|
onFinish,
|
|
7332
7338
|
});
|
|
7333
7339
|
const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
|
|
7334
|
-
return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$2({ sections, field, step }), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
|
|
7340
|
+
return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$2({ sections, field, step }), jsx(StepsNavigationButtons$1, { isSending: isSending, step: step, onPrevStep: onPrevStep })] }));
|
|
7335
7341
|
});
|
|
7336
7342
|
|
|
7337
7343
|
const PERSONAL_INFO_CONTENT = [
|
|
@@ -7929,10 +7935,10 @@
|
|
|
7929
7935
|
});
|
|
7930
7936
|
const getValue$1 = (field) => (name) => field(name)?.value;
|
|
7931
7937
|
|
|
7932
|
-
const StepsNavigationButtons = JSX(({ step, onPrevStep }) => {
|
|
7938
|
+
const StepsNavigationButtons = JSX(({ step, onPrevStep, isSending }) => {
|
|
7933
7939
|
const isFirstStep = step === 0;
|
|
7934
7940
|
const isFinalStep = step === 5;
|
|
7935
|
-
return (jsxs("div", { className: 'flex justify-between gap-m', children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { type: "submit", children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
|
|
7941
|
+
return (jsxs("div", { className: 'flex justify-between gap-m', children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { type: "submit", isLoading: isSending, children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
|
|
7936
7942
|
});
|
|
7937
7943
|
|
|
7938
7944
|
const PAYMENT_TYPE_DATA = {
|
|
@@ -8111,6 +8117,7 @@
|
|
|
8111
8117
|
};
|
|
8112
8118
|
|
|
8113
8119
|
const useCreditFormAPI = ({ step, inputs, onNextStep, onFinish, }) => {
|
|
8120
|
+
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
8114
8121
|
const isFinalStep = step === 5;
|
|
8115
8122
|
const retailFormStore = useRetailFormStore();
|
|
8116
8123
|
const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm), [step, retailFormStore.leadForm]);
|
|
@@ -8135,6 +8142,7 @@
|
|
|
8135
8142
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
8136
8143
|
return;
|
|
8137
8144
|
}
|
|
8145
|
+
startSending();
|
|
8138
8146
|
retailFormStore.leadForm = formData;
|
|
8139
8147
|
try {
|
|
8140
8148
|
const { taskId, profileId, participantId } = retailFormStore;
|
|
@@ -8156,8 +8164,11 @@
|
|
|
8156
8164
|
catch (ex) {
|
|
8157
8165
|
// Do nothing
|
|
8158
8166
|
}
|
|
8167
|
+
finally {
|
|
8168
|
+
endSending();
|
|
8169
|
+
}
|
|
8159
8170
|
}, [isFinalStep, resetForm]);
|
|
8160
|
-
return [initialState, handleSubmit];
|
|
8171
|
+
return [initialState, handleSubmit, isSending];
|
|
8161
8172
|
};
|
|
8162
8173
|
const getValue = (formData) => (name) => formData[name];
|
|
8163
8174
|
|
|
@@ -8165,14 +8176,14 @@
|
|
|
8165
8176
|
const { programId } = useRetailFormStore();
|
|
8166
8177
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
8167
8178
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
8168
|
-
const [initialState, onSubmit] = useCreditFormAPI({
|
|
8179
|
+
const [initialState, onSubmit, isSending] = useCreditFormAPI({
|
|
8169
8180
|
step,
|
|
8170
8181
|
inputs,
|
|
8171
8182
|
onNextStep,
|
|
8172
8183
|
onFinish,
|
|
8173
8184
|
});
|
|
8174
8185
|
const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
|
|
8175
|
-
return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, onPrevStep: onPrevStep })] }));
|
|
8186
|
+
return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
|
|
8176
8187
|
});
|
|
8177
8188
|
|
|
8178
8189
|
const stepsSectionsMap = [
|
|
@@ -10484,7 +10495,7 @@
|
|
|
10484
10495
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10485
10496
|
});
|
|
10486
10497
|
|
|
10487
|
-
const packageVersion = "0.14.
|
|
10498
|
+
const packageVersion = "0.14.714";
|
|
10488
10499
|
|
|
10489
10500
|
exports.Blocks = Blocks;
|
|
10490
10501
|
exports.ContentPage = ContentPage;
|