@redneckz/wildless-cms-uni-blocks 0.14.665 → 0.14.666
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +93 -58
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +5 -1
- package/bundle/components/CreditForm/utils.d.ts +7 -1
- package/bundle/ui-kit/FormField/Fields/MandatoryPaymentsField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/WagesField.d.ts +2 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +5 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ContentPage/useContentPageData.js +1 -1
- package/dist/components/ContentPage/useContentPageData.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +2 -0
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditCardForm/creditCardFormStepsData.js +2 -2
- package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/dist/components/CreditCardForm/formStateMap.js +2 -2
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/components/CreditCardForm/getFourthStepData.js +8 -2
- package/dist/components/CreditCardForm/getFourthStepData.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +2 -2
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/formStateMap.js +2 -2
- package/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/dist/components/CreditForm/getThirdStepData.js +8 -2
- package/dist/components/CreditForm/getThirdStepData.js.map +1 -1
- package/dist/components/CreditForm/utils.d.ts +7 -1
- package/dist/components/CreditForm/utils.js +9 -3
- package/dist/components/CreditForm/utils.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/MandatoryPaymentsField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/MandatoryPaymentsField.js +9 -0
- package/dist/ui-kit/FormField/Fields/MandatoryPaymentsField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/RetirementIncomeField.js +10 -1
- package/dist/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/WagesField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/WagesField.js +18 -0
- package/dist/ui-kit/FormField/Fields/WagesField.js.map +1 -0
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.js +4 -4
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +2 -2
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +5 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ContentPage/useContentPageData.js +1 -1
- package/lib/components/ContentPage/useContentPageData.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.js +3 -1
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditCardForm/creditCardFormStepsData.js +2 -2
- package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/lib/components/CreditCardForm/formStateMap.js +2 -2
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/components/CreditCardForm/getFourthStepData.js +8 -2
- package/lib/components/CreditCardForm/getFourthStepData.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +2 -2
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/formStateMap.js +2 -2
- package/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/lib/components/CreditForm/getThirdStepData.js +8 -2
- package/lib/components/CreditForm/getThirdStepData.js.map +1 -1
- package/lib/components/CreditForm/utils.d.ts +7 -1
- package/lib/components/CreditForm/utils.js +9 -3
- package/lib/components/CreditForm/utils.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/ui-kit/FormField/Fields/MandatoryPaymentsField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/MandatoryPaymentsField.js +7 -0
- package/lib/ui-kit/FormField/Fields/MandatoryPaymentsField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/RetirementIncomeField.js +10 -1
- package/lib/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/WagesField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/WagesField.js +16 -0
- package/lib/ui-kit/FormField/Fields/WagesField.js.map +1 -0
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.js +4 -4
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +2 -2
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +93 -58
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +5 -1
- package/mobile/bundle/components/CreditForm/utils.d.ts +7 -1
- package/mobile/bundle/ui-kit/FormField/Fields/MandatoryPaymentsField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/WagesField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +5 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ContentPage/useContentPageData.js +1 -1
- package/mobile/dist/components/ContentPage/useContentPageData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +2 -0
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +2 -2
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js +2 -2
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getFourthStepData.js +8 -2
- package/mobile/dist/components/CreditCardForm/getFourthStepData.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +2 -2
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/formStateMap.js +2 -2
- package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditForm/getThirdStepData.js +8 -2
- package/mobile/dist/components/CreditForm/getThirdStepData.js.map +1 -1
- package/mobile/dist/components/CreditForm/utils.d.ts +7 -1
- package/mobile/dist/components/CreditForm/utils.js +9 -3
- package/mobile/dist/components/CreditForm/utils.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/MandatoryPaymentsField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/MandatoryPaymentsField.js +9 -0
- package/mobile/dist/ui-kit/FormField/Fields/MandatoryPaymentsField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/RetirementIncomeField.js +10 -1
- package/mobile/dist/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/WagesField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/WagesField.js +18 -0
- package/mobile/dist/ui-kit/FormField/Fields/WagesField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +4 -4
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +2 -2
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +5 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ContentPage/useContentPageData.js +1 -1
- package/mobile/lib/components/ContentPage/useContentPageData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +3 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +2 -2
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js +2 -2
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getFourthStepData.js +8 -2
- package/mobile/lib/components/CreditCardForm/getFourthStepData.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +2 -2
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/formStateMap.js +2 -2
- package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditForm/getThirdStepData.js +8 -2
- package/mobile/lib/components/CreditForm/getThirdStepData.js.map +1 -1
- package/mobile/lib/components/CreditForm/utils.d.ts +7 -1
- package/mobile/lib/components/CreditForm/utils.js +9 -3
- package/mobile/lib/components/CreditForm/utils.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/MandatoryPaymentsField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/MandatoryPaymentsField.js +7 -0
- package/mobile/lib/ui-kit/FormField/Fields/MandatoryPaymentsField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/RetirementIncomeField.js +10 -1
- package/mobile/lib/ui-kit/FormField/Fields/RetirementIncomeField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/WagesField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/WagesField.js +16 -0
- package/mobile/lib/ui-kit/FormField/Fields/WagesField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +4 -4
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +2 -2
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +5 -1
- package/mobile/src/components/ContentPage/useContentPageData.ts +1 -1
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +4 -1
- package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +2 -2
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +2 -2
- package/mobile/src/components/CreditCardForm/getFourthStepData.ts +14 -2
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +2 -2
- package/mobile/src/components/CreditForm/formStateMap.tsx +2 -2
- package/mobile/src/components/CreditForm/getThirdStepData.ts +14 -2
- package/mobile/src/components/CreditForm/utils.ts +9 -3
- package/mobile/src/ui-kit/FormField/Fields/{OtherPayments.tsx → MandatoryPaymentsField.tsx} +2 -2
- package/mobile/src/ui-kit/FormField/Fields/RetirementIncomeField.tsx +25 -9
- package/mobile/src/ui-kit/FormField/Fields/WagesField.tsx +31 -0
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +5 -1
- package/mobile/src/ui-kit/FormField/getField.tsx +4 -4
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +2 -2
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +5 -1
- package/src/components/ContentPage/useContentPageData.ts +1 -1
- package/src/components/CreditCardForm/CreditCardForm.fixture.tsx +11 -0
- package/src/components/CreditCardForm/CreditCardForm.tsx +4 -1
- package/src/components/CreditCardForm/creditCardFormStepsData.tsx +2 -2
- package/src/components/CreditCardForm/formStateMap.tsx +2 -2
- package/src/components/CreditCardForm/getFourthStepData.ts +14 -2
- package/src/components/CreditForm/creditFormStepsData.tsx +2 -2
- package/src/components/CreditForm/formStateMap.tsx +2 -2
- package/src/components/CreditForm/getThirdStepData.ts +14 -2
- package/src/components/CreditForm/utils.ts +9 -3
- package/src/ui-kit/FormField/Fields/{OtherPayments.tsx → MandatoryPaymentsField.tsx} +2 -2
- package/src/ui-kit/FormField/Fields/RetirementIncomeField.tsx +25 -9
- package/src/ui-kit/FormField/Fields/WagesField.tsx +31 -0
- package/src/ui-kit/FormField/NameFieldDef.ts +5 -1
- package/src/ui-kit/FormField/getField.tsx +4 -4
- package/src/ui-kit/FormField/getObjectValidator.tsx +2 -2
- package/bundle/ui-kit/FormField/Fields/MandatoryIncome.d.ts +0 -2
- package/bundle/ui-kit/FormField/Fields/OtherPayments.d.ts +0 -2
- package/dist/ui-kit/FormField/Fields/MandatoryIncome.d.ts +0 -2
- package/dist/ui-kit/FormField/Fields/MandatoryIncome.js +0 -9
- package/dist/ui-kit/FormField/Fields/MandatoryIncome.js.map +0 -1
- package/dist/ui-kit/FormField/Fields/OtherPayments.d.ts +0 -2
- package/dist/ui-kit/FormField/Fields/OtherPayments.js +0 -9
- package/dist/ui-kit/FormField/Fields/OtherPayments.js.map +0 -1
- package/lib/ui-kit/FormField/Fields/MandatoryIncome.d.ts +0 -2
- package/lib/ui-kit/FormField/Fields/MandatoryIncome.js +0 -7
- package/lib/ui-kit/FormField/Fields/MandatoryIncome.js.map +0 -1
- package/lib/ui-kit/FormField/Fields/OtherPayments.d.ts +0 -2
- package/lib/ui-kit/FormField/Fields/OtherPayments.js +0 -7
- package/lib/ui-kit/FormField/Fields/OtherPayments.js.map +0 -1
- package/mobile/bundle/ui-kit/FormField/Fields/MandatoryIncome.d.ts +0 -2
- package/mobile/bundle/ui-kit/FormField/Fields/OtherPayments.d.ts +0 -2
- package/mobile/dist/ui-kit/FormField/Fields/MandatoryIncome.d.ts +0 -2
- package/mobile/dist/ui-kit/FormField/Fields/MandatoryIncome.js +0 -9
- package/mobile/dist/ui-kit/FormField/Fields/MandatoryIncome.js.map +0 -1
- package/mobile/dist/ui-kit/FormField/Fields/OtherPayments.d.ts +0 -2
- package/mobile/dist/ui-kit/FormField/Fields/OtherPayments.js +0 -9
- package/mobile/dist/ui-kit/FormField/Fields/OtherPayments.js.map +0 -1
- package/mobile/lib/ui-kit/FormField/Fields/MandatoryIncome.d.ts +0 -2
- package/mobile/lib/ui-kit/FormField/Fields/MandatoryIncome.js +0 -7
- package/mobile/lib/ui-kit/FormField/Fields/MandatoryIncome.js.map +0 -1
- package/mobile/lib/ui-kit/FormField/Fields/OtherPayments.d.ts +0 -2
- package/mobile/lib/ui-kit/FormField/Fields/OtherPayments.js +0 -7
- package/mobile/lib/ui-kit/FormField/Fields/OtherPayments.js.map +0 -1
- package/mobile/src/ui-kit/FormField/Fields/MandatoryIncome.tsx +0 -15
- package/src/ui-kit/FormField/Fields/MandatoryIncome.tsx +0 -15
|
@@ -123,8 +123,12 @@ export interface FormState extends FormConsents, FormStateDeliveryType {
|
|
|
123
123
|
participantDateRegistration?: Date | string;
|
|
124
124
|
retirementIncome?: number;
|
|
125
125
|
otherIncome?: number;
|
|
126
|
-
|
|
126
|
+
incomeAverage?: number;
|
|
127
|
+
mandatoryPayments?: number;
|
|
128
|
+
additionalIncome?: number;
|
|
127
129
|
otherPayments?: number;
|
|
130
|
+
rentalIncome?: number;
|
|
131
|
+
wages?: number;
|
|
128
132
|
creditInRshbCd?: Option;
|
|
129
133
|
disablePeopleFlg?: boolean;
|
|
130
134
|
bankruptcyFlg?: boolean;
|
|
@@ -3,7 +3,7 @@ import { type BlocksRegistry } from '../../model/BlocksRegistry';
|
|
|
3
3
|
import { type BlockDef, type ContentPageDef } from '../../model/ContentPageDef';
|
|
4
4
|
import baseData from './ContentPage.page.json';
|
|
5
5
|
|
|
6
|
-
const BLOCK_TYPES_BLACK_LIST = ['Header', 'Footer', 'Placeholder'];
|
|
6
|
+
const BLOCK_TYPES_BLACK_LIST = ['Header', 'Footer', 'Placeholder', 'CreditForm', 'CreditCardForm'];
|
|
7
7
|
|
|
8
8
|
export function useContentPageData(blocksRegistry: BlocksRegistry): ContentPageDef {
|
|
9
9
|
const [data, setData] = useState<ContentPageDef>(baseData as ContentPageDef);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { updateRefreshToken } from '../../api/RetailAPI/updateRefreshToken';
|
|
3
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
4
5
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
5
6
|
import { style } from '../../utils/style';
|
|
@@ -24,6 +25,8 @@ const WIZARD_TITLES = [
|
|
|
24
25
|
export const CreditCardForm = JSX<CreditCardFormWizardProps>(({ className, ...rest }) => {
|
|
25
26
|
const [step, setStep] = useState(0);
|
|
26
27
|
|
|
28
|
+
useEffect(updateRefreshToken, []);
|
|
29
|
+
|
|
27
30
|
const handleNextStep = useCallback(() => {
|
|
28
31
|
setStep((_) => Math.min(_ + 1, WIZARD_STEPS));
|
|
29
32
|
}, []);
|
|
@@ -205,11 +205,11 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
|
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
columns: 1,
|
|
208
|
-
inputs: [{ fieldType: 'common', name: '
|
|
208
|
+
inputs: [{ fieldType: 'common', name: 'wages', required: true }],
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
columns: 1,
|
|
212
|
-
inputs: [{ fieldType: 'common', name: '
|
|
212
|
+
inputs: [{ fieldType: 'common', name: 'mandatoryPayments', required: true }],
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
215
|
columns: 1,
|
|
@@ -63,8 +63,8 @@ export const formStateMap: Partial<FormState>[] = [
|
|
|
63
63
|
dependents: undefined,
|
|
64
64
|
familyMembers: undefined,
|
|
65
65
|
confirmationIncome: { key: '', text: '' },
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
wages: undefined,
|
|
67
|
+
mandatoryPayments: undefined,
|
|
68
68
|
snils: '',
|
|
69
69
|
armyIdFlg: false,
|
|
70
70
|
},
|
|
@@ -7,8 +7,14 @@ export const getFourthStepData = (formData: FormState): Partial<Participant> =>
|
|
|
7
7
|
familyStatus,
|
|
8
8
|
dependents,
|
|
9
9
|
familyMembers,
|
|
10
|
-
|
|
10
|
+
wages,
|
|
11
|
+
mandatoryPayments,
|
|
12
|
+
incomeAverage,
|
|
13
|
+
additionalIncome,
|
|
14
|
+
otherIncome,
|
|
11
15
|
otherPayments,
|
|
16
|
+
rentalIncome,
|
|
17
|
+
retirementIncome,
|
|
12
18
|
snils,
|
|
13
19
|
armyIdFlg,
|
|
14
20
|
} = formData;
|
|
@@ -18,8 +24,14 @@ export const getFourthStepData = (formData: FormState): Partial<Participant> =>
|
|
|
18
24
|
totalDependents: familyMembers,
|
|
19
25
|
otherDependents: dependents,
|
|
20
26
|
participantIncomes: getParticipantIncomes({
|
|
21
|
-
|
|
27
|
+
wages,
|
|
28
|
+
mandatoryPayments,
|
|
29
|
+
incomeAverage,
|
|
30
|
+
additionalIncome,
|
|
31
|
+
otherIncome,
|
|
22
32
|
otherPayments,
|
|
33
|
+
rentalIncome,
|
|
34
|
+
retirementIncome,
|
|
23
35
|
}),
|
|
24
36
|
snils: snils?.replaceAll(' ', ''),
|
|
25
37
|
armyIdFlg,
|
|
@@ -198,11 +198,11 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
columns: 1,
|
|
201
|
-
inputs: [{ fieldType: 'common', name: '
|
|
201
|
+
inputs: [{ fieldType: 'common', name: 'wages', required: true }],
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
204
|
columns: 1,
|
|
205
|
-
inputs: [{ fieldType: 'common', name: '
|
|
205
|
+
inputs: [{ fieldType: 'common', name: 'mandatoryPayments', required: true }],
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
columns: 1,
|
|
@@ -61,8 +61,8 @@ export const formStateMap: Partial<FormState>[] = [
|
|
|
61
61
|
dependents: undefined,
|
|
62
62
|
familyMembers: undefined,
|
|
63
63
|
confirmationIncome: { key: '', text: '' },
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
wages: undefined,
|
|
65
|
+
mandatoryPayments: undefined,
|
|
66
66
|
snils: '',
|
|
67
67
|
armyIdFlg: false,
|
|
68
68
|
},
|
|
@@ -8,8 +8,14 @@ export const getThirdStepData = (formData: FormState): Partial<Participant> => {
|
|
|
8
8
|
dependents,
|
|
9
9
|
familyMembers,
|
|
10
10
|
confirmationIncome,
|
|
11
|
-
|
|
11
|
+
wages,
|
|
12
|
+
mandatoryPayments,
|
|
13
|
+
incomeAverage,
|
|
14
|
+
additionalIncome,
|
|
15
|
+
otherIncome,
|
|
12
16
|
otherPayments,
|
|
17
|
+
rentalIncome,
|
|
18
|
+
retirementIncome,
|
|
13
19
|
snils,
|
|
14
20
|
armyIdFlg,
|
|
15
21
|
} = formData;
|
|
@@ -20,8 +26,14 @@ export const getThirdStepData = (formData: FormState): Partial<Participant> => {
|
|
|
20
26
|
incomeCertificateCd: confirmationIncome,
|
|
21
27
|
otherDependents: dependents,
|
|
22
28
|
participantIncomes: getParticipantIncomes({
|
|
23
|
-
|
|
29
|
+
wages,
|
|
30
|
+
mandatoryPayments,
|
|
31
|
+
incomeAverage,
|
|
32
|
+
additionalIncome,
|
|
33
|
+
otherIncome,
|
|
24
34
|
otherPayments,
|
|
35
|
+
rentalIncome,
|
|
36
|
+
retirementIncome,
|
|
25
37
|
}),
|
|
26
38
|
snils: snils?.replaceAll(' ', ''),
|
|
27
39
|
armyIdFlg,
|
|
@@ -13,8 +13,14 @@ export const fieldsNamesToAddressKeysMap = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const fieldsNamesToIncomeKeysMap = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
incomeAverage: 'INCOME_AVERAGE',
|
|
17
|
+
mandatoryPayments: 'MANDATORY_PAYMENTS',
|
|
18
|
+
additionalIncome: 'ADDITIONAL_INCOME',
|
|
19
|
+
otherIncome: 'OTHER_INCOME',
|
|
20
|
+
otherPayments: 'OTHER_PAYMENTS',
|
|
21
|
+
rentalIncome: 'RENTAL_INCOME',
|
|
22
|
+
wages: 'WAGES',
|
|
23
|
+
retirementIncome: 'RETIREMENT_INCOME',
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
export const getParticipantContacts = (fields: Record<string, string | undefined>): any[] =>
|
|
@@ -66,7 +72,7 @@ export const getParticipantIncomes = (fields: Record<string, number | undefined>
|
|
|
66
72
|
incomeTypeCd: {
|
|
67
73
|
key: fieldsNamesToIncomeKeysMap[key],
|
|
68
74
|
},
|
|
69
|
-
value,
|
|
75
|
+
value: Number(value || 0),
|
|
70
76
|
},
|
|
71
77
|
];
|
|
72
78
|
}
|
|
@@ -4,12 +4,12 @@ import type { CustomFieldProps } from '../CustomFieldProps';
|
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const MandatoryPaymentsField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
8
|
<InputControl
|
|
9
9
|
label="Обязательные выплаты"
|
|
10
10
|
placeholder="Введите значение"
|
|
11
11
|
type="number"
|
|
12
|
-
{...getValidation(field('
|
|
12
|
+
{...getValidation(field('mandatoryPayments'), validatorObj.mandatoryPayments, input?.required)}
|
|
13
13
|
{...input}
|
|
14
14
|
/>
|
|
15
15
|
));
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
3
|
import { InputControl } from '../../Input/InputControl';
|
|
3
4
|
import type { CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
6
7
|
|
|
7
|
-
export const RetirementIncomeField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
));
|
|
8
|
+
export const RetirementIncomeField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
+
const currentWages = field('wages')?.value;
|
|
10
|
+
|
|
11
|
+
const onChange = useCallback(
|
|
12
|
+
(_: string) => {
|
|
13
|
+
const incomesSum = Number(_) + Number(currentWages || 0);
|
|
14
|
+
|
|
15
|
+
field('retirementIncome')?.onChange?.(_);
|
|
16
|
+
field('incomeAverage')?.onChange?.(String(incomesSum));
|
|
17
|
+
},
|
|
18
|
+
[currentWages],
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<InputControl
|
|
23
|
+
label="Пенсионные доходы"
|
|
24
|
+
placeholder="Введите значение"
|
|
25
|
+
type="number"
|
|
26
|
+
{...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required)}
|
|
27
|
+
{...input}
|
|
28
|
+
onChange={onChange}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { InputControl } from '../../Input/InputControl';
|
|
4
|
+
import type { CustomFieldProps } from '../CustomFieldProps';
|
|
5
|
+
import { validatorObj } from '../getObjectValidator';
|
|
6
|
+
import { getValidation } from '../getValidation';
|
|
7
|
+
|
|
8
|
+
export const WagesField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
+
const currentRetirementIncome = field('retirementIncome')?.value;
|
|
10
|
+
|
|
11
|
+
const onChange = useCallback(
|
|
12
|
+
(_: string) => {
|
|
13
|
+
const incomesSum = Number(_) + Number(currentRetirementIncome || 0);
|
|
14
|
+
|
|
15
|
+
field('wages')?.onChange?.(_);
|
|
16
|
+
field('incomeAverage')?.onChange?.(String(incomesSum));
|
|
17
|
+
},
|
|
18
|
+
[currentRetirementIncome],
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<InputControl
|
|
23
|
+
label="Совокупный доход в месяц после вычета налогов (зарплата, премии)"
|
|
24
|
+
placeholder="Введите значение"
|
|
25
|
+
type="number"
|
|
26
|
+
{...getValidation(field('wages'), validatorObj.wages, input?.required)}
|
|
27
|
+
{...input}
|
|
28
|
+
onChange={onChange}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
@@ -76,8 +76,12 @@ export type NameFieldDef =
|
|
|
76
76
|
| 'participantDateRegistration'
|
|
77
77
|
| 'retirementIncome'
|
|
78
78
|
| 'otherIncome'
|
|
79
|
-
| '
|
|
79
|
+
| 'incomeAverage'
|
|
80
|
+
| 'mandatoryPayments'
|
|
81
|
+
| 'additionalIncome'
|
|
80
82
|
| 'otherPayments'
|
|
83
|
+
| 'rentalIncome'
|
|
84
|
+
| 'wages'
|
|
81
85
|
| 'creditInRshbCd'
|
|
82
86
|
| 'disablePeopleFlg'
|
|
83
87
|
| 'bankruptcyFlg'
|
|
@@ -59,7 +59,7 @@ import { LastJobExperienceField } from './Fields/LastJobExperienceField';
|
|
|
59
59
|
import { LegalEntityNameField } from './Fields/LegalEntityNameField';
|
|
60
60
|
import { LegalFormField } from './Fields/LegalFormField';
|
|
61
61
|
import { LocalitiesField } from './Fields/LocalitiesField';
|
|
62
|
-
import {
|
|
62
|
+
import { MandatoryPaymentsField } from './Fields/MandatoryPaymentsField';
|
|
63
63
|
import { MethodObtainField } from './Fields/MethodObtainField';
|
|
64
64
|
import { MiddleNameField } from './Fields/MiddleNameField';
|
|
65
65
|
import { NameField } from './Fields/NameField';
|
|
@@ -67,7 +67,6 @@ import { OnlineCheckoutField } from './Fields/OnlineCheckoutField';
|
|
|
67
67
|
import { OrganizationField } from './Fields/OrganizationField';
|
|
68
68
|
import { OrganizationNameField } from './Fields/OrganizationNameField';
|
|
69
69
|
import { OtherIncomeField } from './Fields/OtherIncomeField';
|
|
70
|
-
import { OtherPaymentsField } from './Fields/OtherPayments';
|
|
71
70
|
import { ParticipantDateRegistrationField } from './Fields/ParticipantDateRegistrationField';
|
|
72
71
|
import { PartInBusinessField } from './Fields/PartInBusinessField';
|
|
73
72
|
import { PartnerCommentsField } from './Fields/PartnerCommentsField';
|
|
@@ -91,6 +90,7 @@ import { TermField } from './Fields/TermField';
|
|
|
91
90
|
import { TotalIncomeField } from './Fields/TotalIncomeField';
|
|
92
91
|
import { UltraPremiumField } from './Fields/UltraPremiumField';
|
|
93
92
|
import { VedField } from './Fields/VedField';
|
|
93
|
+
import { WagesField } from './Fields/WagesField';
|
|
94
94
|
import { isRenderField } from './isRenderField';
|
|
95
95
|
|
|
96
96
|
const PRODUCT_REF = {
|
|
@@ -184,8 +184,8 @@ export const getField =
|
|
|
184
184
|
participantDateRegistration: <ParticipantDateRegistrationField field={field} input={input} />,
|
|
185
185
|
retirementIncome: <RetirementIncomeField field={field} input={input} />,
|
|
186
186
|
otherIncome: <OtherIncomeField field={field} input={input} />,
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
wages: <WagesField field={field} input={input} />,
|
|
188
|
+
mandatoryPayments: <MandatoryPaymentsField field={field} input={input} />,
|
|
189
189
|
disablePeopleFlg: <DisablePeopleFlgField field={field} input={input} />,
|
|
190
190
|
bankruptcyFlg: <BankruptcyFlgField field={field} input={input} />,
|
|
191
191
|
shareholderFlg: <ShareholderFlgField field={field} input={input} />,
|
|
@@ -88,8 +88,8 @@ export const validatorObj: Record<string, Validator> = {
|
|
|
88
88
|
participantDateRegistration: defaultValidator('Укажите дату регистрации'),
|
|
89
89
|
retirementIncome: defaultValidator(),
|
|
90
90
|
otherIncome: defaultValidator(),
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
wages: defaultValidator(),
|
|
92
|
+
mandatoryPayments: defaultValidator(),
|
|
93
93
|
disablePeopleFlg: defaultValidator(),
|
|
94
94
|
bankruptcyFlg: defaultValidator(),
|
|
95
95
|
shareholderFlg: defaultValidator(),
|
package/package.json
CHANGED
|
@@ -123,8 +123,12 @@ export interface FormState extends FormConsents, FormStateDeliveryType {
|
|
|
123
123
|
participantDateRegistration?: Date | string;
|
|
124
124
|
retirementIncome?: number;
|
|
125
125
|
otherIncome?: number;
|
|
126
|
-
|
|
126
|
+
incomeAverage?: number;
|
|
127
|
+
mandatoryPayments?: number;
|
|
128
|
+
additionalIncome?: number;
|
|
127
129
|
otherPayments?: number;
|
|
130
|
+
rentalIncome?: number;
|
|
131
|
+
wages?: number;
|
|
128
132
|
creditInRshbCd?: Option;
|
|
129
133
|
disablePeopleFlg?: boolean;
|
|
130
134
|
bankruptcyFlg?: boolean;
|
|
@@ -3,7 +3,7 @@ import { type BlocksRegistry } from '../../model/BlocksRegistry';
|
|
|
3
3
|
import { type BlockDef, type ContentPageDef } from '../../model/ContentPageDef';
|
|
4
4
|
import baseData from './ContentPage.page.json';
|
|
5
5
|
|
|
6
|
-
const BLOCK_TYPES_BLACK_LIST = ['Header', 'Footer', 'Placeholder'];
|
|
6
|
+
const BLOCK_TYPES_BLACK_LIST = ['Header', 'Footer', 'Placeholder', 'CreditForm', 'CreditCardForm'];
|
|
7
7
|
|
|
8
8
|
export function useContentPageData(blocksRegistry: BlocksRegistry): ContentPageDef {
|
|
9
9
|
const [data, setData] = useState<ContentPageDef>(baseData as ContentPageDef);
|
|
@@ -3,6 +3,17 @@ import { DialogManager } from '../../ui-kit/DialogManager/DialogManager';
|
|
|
3
3
|
import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
|
|
4
4
|
import { CreditCardForm } from './CreditCardForm';
|
|
5
5
|
|
|
6
|
+
const MOCK_TOKEN = 'mock-key';
|
|
7
|
+
const MOCK_TASK_ID = '111111';
|
|
8
|
+
|
|
9
|
+
const refreshToken = globalThis.sessionStorage?.getItem('refreshToken');
|
|
10
|
+
const accessToken = globalThis.sessionStorage?.getItem('accessToken');
|
|
11
|
+
const taskId = globalThis.localStorage.getItem('taskId');
|
|
12
|
+
|
|
13
|
+
!refreshToken && globalThis.sessionStorage?.setItem('refreshToken', MOCK_TOKEN);
|
|
14
|
+
!accessToken && globalThis.sessionStorage?.setItem('accessToken', MOCK_TOKEN);
|
|
15
|
+
!taskId && globalThis.localStorage.setItem('taskId', MOCK_TASK_ID);
|
|
16
|
+
|
|
6
17
|
export default {
|
|
7
18
|
default: (
|
|
8
19
|
<div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { updateRefreshToken } from '../../api/RetailAPI/updateRefreshToken';
|
|
3
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
4
5
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
5
6
|
import { style } from '../../utils/style';
|
|
@@ -24,6 +25,8 @@ const WIZARD_TITLES = [
|
|
|
24
25
|
export const CreditCardForm = JSX<CreditCardFormWizardProps>(({ className, ...rest }) => {
|
|
25
26
|
const [step, setStep] = useState(0);
|
|
26
27
|
|
|
28
|
+
useEffect(updateRefreshToken, []);
|
|
29
|
+
|
|
27
30
|
const handleNextStep = useCallback(() => {
|
|
28
31
|
setStep((_) => Math.min(_ + 1, WIZARD_STEPS));
|
|
29
32
|
}, []);
|
|
@@ -205,11 +205,11 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
|
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
columns: 1,
|
|
208
|
-
inputs: [{ fieldType: 'common', name: '
|
|
208
|
+
inputs: [{ fieldType: 'common', name: 'wages', required: true }],
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
columns: 1,
|
|
212
|
-
inputs: [{ fieldType: 'common', name: '
|
|
212
|
+
inputs: [{ fieldType: 'common', name: 'mandatoryPayments', required: true }],
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
215
|
columns: 1,
|
|
@@ -63,8 +63,8 @@ export const formStateMap: Partial<FormState>[] = [
|
|
|
63
63
|
dependents: undefined,
|
|
64
64
|
familyMembers: undefined,
|
|
65
65
|
confirmationIncome: { key: '', text: '' },
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
wages: undefined,
|
|
67
|
+
mandatoryPayments: undefined,
|
|
68
68
|
snils: '',
|
|
69
69
|
armyIdFlg: false,
|
|
70
70
|
},
|
|
@@ -7,8 +7,14 @@ export const getFourthStepData = (formData: FormState): Partial<Participant> =>
|
|
|
7
7
|
familyStatus,
|
|
8
8
|
dependents,
|
|
9
9
|
familyMembers,
|
|
10
|
-
|
|
10
|
+
wages,
|
|
11
|
+
mandatoryPayments,
|
|
12
|
+
incomeAverage,
|
|
13
|
+
additionalIncome,
|
|
14
|
+
otherIncome,
|
|
11
15
|
otherPayments,
|
|
16
|
+
rentalIncome,
|
|
17
|
+
retirementIncome,
|
|
12
18
|
snils,
|
|
13
19
|
armyIdFlg,
|
|
14
20
|
} = formData;
|
|
@@ -18,8 +24,14 @@ export const getFourthStepData = (formData: FormState): Partial<Participant> =>
|
|
|
18
24
|
totalDependents: familyMembers,
|
|
19
25
|
otherDependents: dependents,
|
|
20
26
|
participantIncomes: getParticipantIncomes({
|
|
21
|
-
|
|
27
|
+
wages,
|
|
28
|
+
mandatoryPayments,
|
|
29
|
+
incomeAverage,
|
|
30
|
+
additionalIncome,
|
|
31
|
+
otherIncome,
|
|
22
32
|
otherPayments,
|
|
33
|
+
rentalIncome,
|
|
34
|
+
retirementIncome,
|
|
23
35
|
}),
|
|
24
36
|
snils: snils?.replaceAll(' ', ''),
|
|
25
37
|
armyIdFlg,
|
|
@@ -198,11 +198,11 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
columns: 1,
|
|
201
|
-
inputs: [{ fieldType: 'common', name: '
|
|
201
|
+
inputs: [{ fieldType: 'common', name: 'wages', required: true }],
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
204
|
columns: 1,
|
|
205
|
-
inputs: [{ fieldType: 'common', name: '
|
|
205
|
+
inputs: [{ fieldType: 'common', name: 'mandatoryPayments', required: true }],
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
columns: 1,
|
|
@@ -61,8 +61,8 @@ export const formStateMap: Partial<FormState>[] = [
|
|
|
61
61
|
dependents: undefined,
|
|
62
62
|
familyMembers: undefined,
|
|
63
63
|
confirmationIncome: { key: '', text: '' },
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
wages: undefined,
|
|
65
|
+
mandatoryPayments: undefined,
|
|
66
66
|
snils: '',
|
|
67
67
|
armyIdFlg: false,
|
|
68
68
|
},
|
|
@@ -8,8 +8,14 @@ export const getThirdStepData = (formData: FormState): Partial<Participant> => {
|
|
|
8
8
|
dependents,
|
|
9
9
|
familyMembers,
|
|
10
10
|
confirmationIncome,
|
|
11
|
-
|
|
11
|
+
wages,
|
|
12
|
+
mandatoryPayments,
|
|
13
|
+
incomeAverage,
|
|
14
|
+
additionalIncome,
|
|
15
|
+
otherIncome,
|
|
12
16
|
otherPayments,
|
|
17
|
+
rentalIncome,
|
|
18
|
+
retirementIncome,
|
|
13
19
|
snils,
|
|
14
20
|
armyIdFlg,
|
|
15
21
|
} = formData;
|
|
@@ -20,8 +26,14 @@ export const getThirdStepData = (formData: FormState): Partial<Participant> => {
|
|
|
20
26
|
incomeCertificateCd: confirmationIncome,
|
|
21
27
|
otherDependents: dependents,
|
|
22
28
|
participantIncomes: getParticipantIncomes({
|
|
23
|
-
|
|
29
|
+
wages,
|
|
30
|
+
mandatoryPayments,
|
|
31
|
+
incomeAverage,
|
|
32
|
+
additionalIncome,
|
|
33
|
+
otherIncome,
|
|
24
34
|
otherPayments,
|
|
35
|
+
rentalIncome,
|
|
36
|
+
retirementIncome,
|
|
25
37
|
}),
|
|
26
38
|
snils: snils?.replaceAll(' ', ''),
|
|
27
39
|
armyIdFlg,
|
|
@@ -13,8 +13,14 @@ export const fieldsNamesToAddressKeysMap = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const fieldsNamesToIncomeKeysMap = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
incomeAverage: 'INCOME_AVERAGE',
|
|
17
|
+
mandatoryPayments: 'MANDATORY_PAYMENTS',
|
|
18
|
+
additionalIncome: 'ADDITIONAL_INCOME',
|
|
19
|
+
otherIncome: 'OTHER_INCOME',
|
|
20
|
+
otherPayments: 'OTHER_PAYMENTS',
|
|
21
|
+
rentalIncome: 'RENTAL_INCOME',
|
|
22
|
+
wages: 'WAGES',
|
|
23
|
+
retirementIncome: 'RETIREMENT_INCOME',
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
export const getParticipantContacts = (fields: Record<string, string | undefined>): any[] =>
|
|
@@ -66,7 +72,7 @@ export const getParticipantIncomes = (fields: Record<string, number | undefined>
|
|
|
66
72
|
incomeTypeCd: {
|
|
67
73
|
key: fieldsNamesToIncomeKeysMap[key],
|
|
68
74
|
},
|
|
69
|
-
value,
|
|
75
|
+
value: Number(value || 0),
|
|
70
76
|
},
|
|
71
77
|
];
|
|
72
78
|
}
|
|
@@ -4,12 +4,12 @@ import type { CustomFieldProps } from '../CustomFieldProps';
|
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const MandatoryPaymentsField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
8
|
<InputControl
|
|
9
9
|
label="Обязательные выплаты"
|
|
10
10
|
placeholder="Введите значение"
|
|
11
11
|
type="number"
|
|
12
|
-
{...getValidation(field('
|
|
12
|
+
{...getValidation(field('mandatoryPayments'), validatorObj.mandatoryPayments, input?.required)}
|
|
13
13
|
{...input}
|
|
14
14
|
/>
|
|
15
15
|
));
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
3
|
import { InputControl } from '../../Input/InputControl';
|
|
3
4
|
import type { CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
6
7
|
|
|
7
|
-
export const RetirementIncomeField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
));
|
|
8
|
+
export const RetirementIncomeField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
+
const currentWages = field('wages')?.value;
|
|
10
|
+
|
|
11
|
+
const onChange = useCallback(
|
|
12
|
+
(_: string) => {
|
|
13
|
+
const incomesSum = Number(_) + Number(currentWages || 0);
|
|
14
|
+
|
|
15
|
+
field('retirementIncome')?.onChange?.(_);
|
|
16
|
+
field('incomeAverage')?.onChange?.(String(incomesSum));
|
|
17
|
+
},
|
|
18
|
+
[currentWages],
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<InputControl
|
|
23
|
+
label="Пенсионные доходы"
|
|
24
|
+
placeholder="Введите значение"
|
|
25
|
+
type="number"
|
|
26
|
+
{...getValidation(field('retirementIncome'), validatorObj.retirementIncome, input?.required)}
|
|
27
|
+
{...input}
|
|
28
|
+
onChange={onChange}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { InputControl } from '../../Input/InputControl';
|
|
4
|
+
import type { CustomFieldProps } from '../CustomFieldProps';
|
|
5
|
+
import { validatorObj } from '../getObjectValidator';
|
|
6
|
+
import { getValidation } from '../getValidation';
|
|
7
|
+
|
|
8
|
+
export const WagesField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
+
const currentRetirementIncome = field('retirementIncome')?.value;
|
|
10
|
+
|
|
11
|
+
const onChange = useCallback(
|
|
12
|
+
(_: string) => {
|
|
13
|
+
const incomesSum = Number(_) + Number(currentRetirementIncome || 0);
|
|
14
|
+
|
|
15
|
+
field('wages')?.onChange?.(_);
|
|
16
|
+
field('incomeAverage')?.onChange?.(String(incomesSum));
|
|
17
|
+
},
|
|
18
|
+
[currentRetirementIncome],
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<InputControl
|
|
23
|
+
label="Совокупный доход в месяц после вычета налогов (зарплата, премии)"
|
|
24
|
+
placeholder="Введите значение"
|
|
25
|
+
type="number"
|
|
26
|
+
{...getValidation(field('wages'), validatorObj.wages, input?.required)}
|
|
27
|
+
{...input}
|
|
28
|
+
onChange={onChange}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
});
|