@redneckz/wildless-cms-uni-blocks 0.14.653 → 0.14.655
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/updateUserTask.d.ts +7 -0
- package/bundle/bundle.umd.js +35 -7
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/bundle/components/CreditForm/getZeroStepData.d.ts +3 -0
- package/dist/api/RetailAPI/updateRefreshToken.js +12 -5
- package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/dist/api/RetailAPI/updateUserTask.d.ts +7 -0
- package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +7 -1
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/getCreditFormTaskData.js +3 -0
- package/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
- package/dist/components/CreditForm/getZeroStepData.d.ts +3 -0
- package/dist/components/CreditForm/getZeroStepData.js +16 -0
- package/dist/components/CreditForm/getZeroStepData.js.map +1 -0
- package/lib/api/RetailAPI/updateRefreshToken.js +12 -5
- package/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/lib/api/RetailAPI/updateUserTask.d.ts +7 -0
- package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +7 -1
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/getCreditFormTaskData.js +3 -0
- package/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
- package/lib/components/CreditForm/getZeroStepData.d.ts +3 -0
- package/lib/components/CreditForm/getZeroStepData.js +13 -0
- package/lib/components/CreditForm/getZeroStepData.js.map +1 -0
- package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +7 -0
- package/mobile/bundle/bundle.umd.js +35 -7
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/mobile/bundle/components/CreditForm/getZeroStepData.d.ts +3 -0
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js +12 -5
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +7 -0
- package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +7 -1
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/getCreditFormTaskData.js +3 -0
- package/mobile/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
- package/mobile/dist/components/CreditForm/getZeroStepData.d.ts +3 -0
- package/mobile/dist/components/CreditForm/getZeroStepData.js +16 -0
- package/mobile/dist/components/CreditForm/getZeroStepData.js.map +1 -0
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js +12 -5
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +7 -0
- package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +7 -1
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/getCreditFormTaskData.js +3 -0
- package/mobile/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
- package/mobile/lib/components/CreditForm/getZeroStepData.d.ts +3 -0
- package/mobile/lib/components/CreditForm/getZeroStepData.js +13 -0
- package/mobile/lib/components/CreditForm/getZeroStepData.js.map +1 -0
- package/mobile/src/api/RetailAPI/updateRefreshToken.ts +15 -5
- package/mobile/src/api/RetailAPI/updateUserTask.ts +8 -0
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +3 -0
- package/mobile/src/components/CreditForm/CreditForm.tsx +7 -1
- package/mobile/src/components/CreditForm/getCreditFormTaskData.ts +3 -0
- package/mobile/src/components/CreditForm/getZeroStepData.ts +17 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/updateRefreshToken.ts +15 -5
- package/src/api/RetailAPI/updateUserTask.ts +8 -0
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +3 -0
- package/src/components/CreditForm/CreditForm.tsx +7 -1
- package/src/components/CreditForm/getCreditFormTaskData.ts +3 -0
- package/src/components/CreditForm/getZeroStepData.ts +17 -0
|
@@ -24,6 +24,10 @@ declare type ParticipantIncome = {
|
|
|
24
24
|
};
|
|
25
25
|
value: number;
|
|
26
26
|
};
|
|
27
|
+
export declare type PaymentType = {
|
|
28
|
+
key: 'ANNUITY' | 'DIFFERENTIAL';
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
27
31
|
export declare type Participant = {
|
|
28
32
|
birthDate?: string;
|
|
29
33
|
id: number;
|
|
@@ -88,6 +92,9 @@ export declare type Participant = {
|
|
|
88
92
|
paymentSystemTypeCd?: string;
|
|
89
93
|
classCard?: Option;
|
|
90
94
|
codeWord?: string;
|
|
95
|
+
loanAmount?: number;
|
|
96
|
+
creditPeriod?: number;
|
|
97
|
+
paymentTypeCd?: PaymentType;
|
|
91
98
|
};
|
|
92
99
|
export declare type UpdateUserTaskBody = {
|
|
93
100
|
sendToBank: boolean;
|
package/bundle/bundle.umd.js
CHANGED
|
@@ -6789,7 +6789,7 @@
|
|
|
6789
6789
|
globalThis.location.href = PORTAL_NATURAL_URL;
|
|
6790
6790
|
return () => null;
|
|
6791
6791
|
}
|
|
6792
|
-
const
|
|
6792
|
+
const updateTokenRequest = async () => {
|
|
6793
6793
|
const res = await doRequest('/auth/refresh', 'POST', {
|
|
6794
6794
|
// eslint-disable-next-line camelcase
|
|
6795
6795
|
refresh_token: refreshToken,
|
|
@@ -6797,14 +6797,21 @@
|
|
|
6797
6797
|
access_token: accessToken,
|
|
6798
6798
|
});
|
|
6799
6799
|
if (res instanceof Response) {
|
|
6800
|
-
|
|
6800
|
+
handleStatus(res.status);
|
|
6801
6801
|
return;
|
|
6802
6802
|
}
|
|
6803
|
-
sessionStorage.setItem('refreshToken', res.refresh_token);
|
|
6804
|
-
sessionStorage.setItem('accessToken', res.access_token);
|
|
6805
|
-
}
|
|
6803
|
+
globalThis.sessionStorage.setItem('refreshToken', res.refresh_token);
|
|
6804
|
+
globalThis.sessionStorage.setItem('accessToken', res.access_token);
|
|
6805
|
+
};
|
|
6806
|
+
updateTokenRequest();
|
|
6807
|
+
const timer = setInterval(updateTokenRequest, UPDATING_INTERVAL);
|
|
6806
6808
|
return () => clearInterval(timer);
|
|
6807
6809
|
};
|
|
6810
|
+
const handleStatus = (status) => {
|
|
6811
|
+
if (status == 401) {
|
|
6812
|
+
globalThis.location.href = PORTAL_NATURAL_URL;
|
|
6813
|
+
}
|
|
6814
|
+
};
|
|
6808
6815
|
|
|
6809
6816
|
const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
|
|
6810
6817
|
const progress = useMemo(() => (step / totalSteps) * 100, [step, totalSteps]);
|
|
@@ -7126,6 +7133,19 @@
|
|
|
7126
7133
|
};
|
|
7127
7134
|
};
|
|
7128
7135
|
|
|
7136
|
+
const PAYMENT_TYPE_DATA = {
|
|
7137
|
+
annuity: { key: 'ANNUITY', value: 'Аннуитетный' },
|
|
7138
|
+
differential: { key: 'DIFFERENTIAL', value: 'Дифференцированный ' },
|
|
7139
|
+
};
|
|
7140
|
+
const getZeroStepData = (formData) => {
|
|
7141
|
+
const { moneyValue, monthsValue, isAnnuity } = formData;
|
|
7142
|
+
return {
|
|
7143
|
+
loanAmount: moneyValue,
|
|
7144
|
+
creditPeriod: monthsValue,
|
|
7145
|
+
paymentTypeCd: PAYMENT_TYPE_DATA[isAnnuity ? 'annuity' : 'differential'],
|
|
7146
|
+
};
|
|
7147
|
+
};
|
|
7148
|
+
|
|
7129
7149
|
const getCreditFormTaskData = ({ participantId, taskId, profileId, formData, step = 0, }) => ({
|
|
7130
7150
|
sendToBank: true,
|
|
7131
7151
|
taskKind: 'UNITED',
|
|
@@ -7154,6 +7174,8 @@
|
|
|
7154
7174
|
});
|
|
7155
7175
|
const getCurrentStepData = (step, formData) => {
|
|
7156
7176
|
switch (step) {
|
|
7177
|
+
case 0:
|
|
7178
|
+
return getZeroStepData(formData);
|
|
7157
7179
|
case 1:
|
|
7158
7180
|
return getFirstStepData(formData);
|
|
7159
7181
|
case 2:
|
|
@@ -7529,7 +7551,13 @@
|
|
|
7529
7551
|
const isStartStep = step === 0;
|
|
7530
7552
|
const [isFormFinished, setIsFormFinished] = useState(false);
|
|
7531
7553
|
return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: WIZARD_TITLES, step: step, totalSteps: WIZARD_STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, inputs: inputs, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished, renderStep: isStartStep
|
|
7532
|
-
? ({ registerSubmit }) => (jsx(CalculatorCredit, { ...{
|
|
7554
|
+
? ({ registerSubmit, field }) => (jsx(CalculatorCredit, { ...{
|
|
7555
|
+
// TODO: Remove "as never"
|
|
7556
|
+
defaultParams: {
|
|
7557
|
+
sum: field('moneyValue').value,
|
|
7558
|
+
period: field('monthsValue').value,
|
|
7559
|
+
isAnnuity: field('isAnnuity').value,
|
|
7560
|
+
},
|
|
7533
7561
|
title: 'Калькулятор кредита',
|
|
7534
7562
|
footnote: 'Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.',
|
|
7535
7563
|
calcSource: {
|
|
@@ -9799,7 +9827,7 @@
|
|
|
9799
9827
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
9800
9828
|
});
|
|
9801
9829
|
|
|
9802
|
-
const packageVersion = "0.14.
|
|
9830
|
+
const packageVersion = "0.14.654";
|
|
9803
9831
|
|
|
9804
9832
|
exports.Blocks = Blocks;
|
|
9805
9833
|
exports.ContentPage = ContentPage;
|