@redneckz/wildless-cms-uni-blocks 0.14.677 → 0.14.678
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 +61 -50
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/renderInputs.d.ts +1 -5
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/bundle/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
- package/bundle/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/getField.d.ts +1 -1
- package/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/dist/components/ApplicationForm/renderInputs.d.ts +1 -5
- package/dist/components/ApplicationForm/renderInputs.js +2 -2
- package/dist/components/ApplicationForm/renderInputs.js.map +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +1 -1
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
- package/dist/components/CreditCardForm/creditCardFormStepsData.js +1 -1
- package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/dist/components/CreditCardForm/formStateMap.js +1 -1
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/components/CreditCardForm/getInitialFormState.js +1 -1
- package/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/dist/components/CreditCardForm/getSecondStepData.js +2 -2
- package/dist/components/CreditCardForm/getSecondStepData.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/formStateMap.js +1 -1
- package/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/dist/components/CreditForm/getFirstStepData.js +2 -2
- package/dist/components/CreditForm/getFirstStepData.js.map +1 -1
- package/dist/components/CreditForm/getInitialFormState.js +1 -1
- package/dist/components/CreditForm/getInitialFormState.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
- package/dist/ui-kit/FormField/Fields/BirthdayField.js +1 -18
- package/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/LimitedBirthdayField.js +11 -0
- package/dist/ui-kit/FormField/Fields/LimitedBirthdayField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js +10 -1
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.js +4 -2
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/dist/ui-kit/FormField/validators.js +15 -1
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/lib/components/ApplicationForm/renderInputs.d.ts +1 -5
- package/lib/components/ApplicationForm/renderInputs.js +2 -2
- package/lib/components/ApplicationForm/renderInputs.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +1 -1
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
- package/lib/components/CreditCardForm/creditCardFormStepsData.js +1 -1
- package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/lib/components/CreditCardForm/formStateMap.js +1 -1
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/components/CreditCardForm/getInitialFormState.js +1 -1
- package/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/lib/components/CreditCardForm/getSecondStepData.js +2 -2
- package/lib/components/CreditCardForm/getSecondStepData.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/formStateMap.js +1 -1
- package/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/lib/components/CreditForm/getFirstStepData.js +2 -2
- package/lib/components/CreditForm/getFirstStepData.js.map +1 -1
- package/lib/components/CreditForm/getInitialFormState.js +1 -1
- package/lib/components/CreditForm/getInitialFormState.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
- package/lib/ui-kit/FormField/Fields/BirthdayField.js +1 -18
- package/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/LimitedBirthdayField.js +9 -0
- package/lib/ui-kit/FormField/Fields/LimitedBirthdayField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js +10 -1
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.js +4 -2
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +2 -1
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/lib/ui-kit/FormField/validators.js +13 -0
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +61 -50
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/renderInputs.d.ts +1 -5
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
- package/mobile/bundle/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/getField.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/renderInputs.d.ts +1 -5
- package/mobile/dist/components/ApplicationForm/renderInputs.js +2 -2
- package/mobile/dist/components/ApplicationForm/renderInputs.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +1 -1
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getInitialFormState.js +1 -1
- package/mobile/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getSecondStepData.js +2 -2
- package/mobile/dist/components/CreditCardForm/getSecondStepData.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/formStateMap.js +1 -1
- package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditForm/getFirstStepData.js +2 -2
- package/mobile/dist/components/CreditForm/getFirstStepData.js.map +1 -1
- package/mobile/dist/components/CreditForm/getInitialFormState.js +1 -1
- package/mobile/dist/components/CreditForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
- package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js +1 -18
- package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/LimitedBirthdayField.js +11 -0
- package/mobile/dist/ui-kit/FormField/Fields/LimitedBirthdayField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js +10 -1
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +4 -2
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/validators.js +15 -1
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderInputs.d.ts +1 -5
- package/mobile/lib/components/ApplicationForm/renderInputs.js +2 -2
- package/mobile/lib/components/ApplicationForm/renderInputs.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +1 -1
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getInitialFormState.js +1 -1
- package/mobile/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getSecondStepData.js +2 -2
- package/mobile/lib/components/CreditCardForm/getSecondStepData.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/formStateMap.js +1 -1
- package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditForm/getFirstStepData.js +2 -2
- package/mobile/lib/components/CreditForm/getFirstStepData.js.map +1 -1
- package/mobile/lib/components/CreditForm/getInitialFormState.js +1 -1
- package/mobile/lib/components/CreditForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
- package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js +1 -18
- package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/LimitedBirthdayField.js +9 -0
- package/mobile/lib/ui-kit/FormField/Fields/LimitedBirthdayField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js +10 -1
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +4 -2
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +2 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/validators.js +13 -0
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/src/components/ApplicationForm/renderInputs.tsx +3 -12
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +3 -1
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +2 -2
- package/mobile/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +1 -1
- package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +1 -1
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -1
- package/mobile/src/components/CreditCardForm/getInitialFormState.tsx +1 -1
- package/mobile/src/components/CreditCardForm/getSecondStepData.tsx +2 -2
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +1 -1
- package/mobile/src/components/CreditForm/formStateMap.tsx +1 -1
- package/mobile/src/components/CreditForm/getFirstStepData.tsx +2 -2
- package/mobile/src/components/CreditForm/getInitialFormState.tsx +1 -1
- package/mobile/src/ui-kit/FormField/Fields/BirthdayField.tsx +6 -36
- package/mobile/src/ui-kit/FormField/Fields/LimitedBirthdayField.tsx +16 -0
- package/mobile/src/ui-kit/FormField/Fields/MiddleNameField.tsx +22 -9
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +1 -0
- package/mobile/src/ui-kit/FormField/getField.tsx +4 -3
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +2 -0
- package/mobile/src/ui-kit/FormField/validators.ts +19 -0
- package/package.json +1 -1
- package/src/components/ApplicationForm/renderInputs.tsx +3 -12
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.tsx +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +3 -1
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +2 -2
- package/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +1 -1
- package/src/components/CreditCardForm/creditCardFormStepsData.tsx +1 -1
- package/src/components/CreditCardForm/formStateMap.tsx +1 -1
- package/src/components/CreditCardForm/getInitialFormState.tsx +1 -1
- package/src/components/CreditCardForm/getSecondStepData.tsx +2 -2
- package/src/components/CreditForm/creditFormStepsData.tsx +1 -1
- package/src/components/CreditForm/formStateMap.tsx +1 -1
- package/src/components/CreditForm/getFirstStepData.tsx +2 -2
- package/src/components/CreditForm/getInitialFormState.tsx +1 -1
- package/src/ui-kit/FormField/Fields/BirthdayField.tsx +6 -36
- package/src/ui-kit/FormField/Fields/LimitedBirthdayField.tsx +16 -0
- package/src/ui-kit/FormField/Fields/MiddleNameField.tsx +22 -9
- package/src/ui-kit/FormField/NameFieldDef.ts +1 -0
- package/src/ui-kit/FormField/getField.tsx +4 -3
- package/src/ui-kit/FormField/getObjectValidator.tsx +2 -0
- package/src/ui-kit/FormField/validators.ts +19 -0
package/package.json
CHANGED
|
@@ -6,25 +6,16 @@ import type {
|
|
|
6
6
|
import { CONSENTS } from '../ApplicationLeadForm/consents';
|
|
7
7
|
import { GroupedConsents } from '../ApplicationLeadForm/GroupedConsents';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
isRetailForm?: boolean;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const renderInputs = ({
|
|
14
|
-
field,
|
|
15
|
-
typeForm = '',
|
|
16
|
-
inputs,
|
|
17
|
-
isRetailForm = false,
|
|
18
|
-
}: RenderInputsProps) => {
|
|
9
|
+
export const renderInputs = ({ field, typeForm = '', inputs }: GroupedConsentsProps) => {
|
|
19
10
|
const { consentInputs, restInputs } = splitInputs(inputs || []);
|
|
20
11
|
|
|
21
12
|
return consentInputs.length > 2 ? (
|
|
22
13
|
<div>
|
|
23
|
-
{restInputs.map(getField(field, typeForm
|
|
14
|
+
{restInputs.map(getField(field, typeForm))}
|
|
24
15
|
<GroupedConsents inputs={consentInputs} field={field} />
|
|
25
16
|
</div>
|
|
26
17
|
) : (
|
|
27
|
-
(inputs || [])?.map(getField(field, typeForm
|
|
18
|
+
(inputs || [])?.map(getField(field, typeForm))
|
|
28
19
|
);
|
|
29
20
|
};
|
|
30
21
|
|
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
{ fieldType: 'common', name: 'surname', required: true },
|
|
23
23
|
{ fieldType: 'common', name: 'name', required: true },
|
|
24
24
|
{ fieldType: 'common', name: 'middleName' },
|
|
25
|
-
{ fieldType: 'common', name: '
|
|
25
|
+
{ fieldType: 'common', name: 'limitedBirthday', required: true },
|
|
26
26
|
{ fieldType: 'common', name: 'phone', required: true },
|
|
27
27
|
{ fieldType: 'common', name: 'email', required: true },
|
|
28
28
|
],
|
|
@@ -24,7 +24,7 @@ export default {
|
|
|
24
24
|
{ fieldType: 'common', name: 'surname', required: true, dadata: true },
|
|
25
25
|
{ fieldType: 'common', name: 'name', required: true, dadata: true },
|
|
26
26
|
{ fieldType: 'common', name: 'middleName', dadata: true },
|
|
27
|
-
{ fieldType: 'common', name: '
|
|
27
|
+
{ fieldType: 'common', name: 'limitedBirthday', required: true },
|
|
28
28
|
{ fieldType: 'common', name: 'phone', required: true },
|
|
29
29
|
{ fieldType: 'common', name: 'email', required: true, dadata: true },
|
|
30
30
|
],
|
|
@@ -69,7 +69,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
69
69
|
className={style(inputColumnStyles(_.columns), 'grid gap-x-m')}
|
|
70
70
|
>
|
|
71
71
|
{renderTitle(_.title)}
|
|
72
|
-
{renderInputs({ field, inputs: _?.inputs
|
|
72
|
+
{renderInputs({ field, inputs: _?.inputs })}
|
|
73
73
|
</div>
|
|
74
74
|
))}
|
|
75
75
|
{renderSubmitButton(button)}
|
|
@@ -56,6 +56,7 @@ export interface FormState extends FormConsents, FormStateDeliveryType {
|
|
|
56
56
|
fullName?: string;
|
|
57
57
|
registrationDate?: Date | string;
|
|
58
58
|
birthday?: Date | string;
|
|
59
|
+
limitedBirthday?: Date | string;
|
|
59
60
|
birthPlace?: string;
|
|
60
61
|
sex?: string;
|
|
61
62
|
phone?: string;
|
|
@@ -173,6 +174,7 @@ const initialFormState = {
|
|
|
173
174
|
serviceDirection: SERVICE_DIRECTIONS[0],
|
|
174
175
|
vedTypes: VED_TYPES[0],
|
|
175
176
|
birthday: undefined,
|
|
177
|
+
limitedBirthday: undefined,
|
|
176
178
|
isClient: false,
|
|
177
179
|
onlineCheckout: false,
|
|
178
180
|
posTerminal: false,
|
|
@@ -198,7 +200,7 @@ export const getInitialFormState = (
|
|
|
198
200
|
): FormState => {
|
|
199
201
|
if (savedForm) {
|
|
200
202
|
const formStateCopy = { ...savedForm };
|
|
201
|
-
formStateCopy.
|
|
203
|
+
formStateCopy.limitedBirthday = new Date(formStateCopy?.limitedBirthday || 0);
|
|
202
204
|
|
|
203
205
|
return formStateCopy;
|
|
204
206
|
}
|
|
@@ -17,7 +17,7 @@ export const getLeadFormTaskData = ({
|
|
|
17
17
|
profileId,
|
|
18
18
|
formData,
|
|
19
19
|
}: getLeadFormTaskDataProps): UpdateUserTaskBody => {
|
|
20
|
-
const { name, surname, middleName,
|
|
20
|
+
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
21
21
|
|
|
22
22
|
return {
|
|
23
23
|
sendToBank: true,
|
|
@@ -27,7 +27,7 @@ export const getLeadFormTaskData = ({
|
|
|
27
27
|
id: taskId,
|
|
28
28
|
participants: [
|
|
29
29
|
{
|
|
30
|
-
birthDate:
|
|
30
|
+
birthDate: limitedBirthday && formatDate(limitedBirthday, true),
|
|
31
31
|
id: participantId,
|
|
32
32
|
midname: middleName,
|
|
33
33
|
name,
|
|
@@ -9,7 +9,7 @@ export const parseEsiaProfile = (esiaProfile: UpdateProfileEsiaResponse): FormSt
|
|
|
9
9
|
name: profile?.name,
|
|
10
10
|
surname: profile?.surname,
|
|
11
11
|
middleName: profile?.midname,
|
|
12
|
-
|
|
12
|
+
limitedBirthday: profile?.birthDate,
|
|
13
13
|
phone: normalizePhone(profile?.phone),
|
|
14
14
|
email: profile?.email,
|
|
15
15
|
dulIssueDateField: document?.dulIssueDate,
|
|
@@ -33,7 +33,7 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
|
|
|
33
33
|
{ fieldType: 'common', name: 'name', required: true, dadata: true, filledByEsia: true },
|
|
34
34
|
{ fieldType: 'common', name: 'middleName', dadata: true, filledByEsia: true },
|
|
35
35
|
{ fieldType: 'common', name: 'sex', required: true },
|
|
36
|
-
{ fieldType: 'common', name: '
|
|
36
|
+
{ fieldType: 'common', name: 'limitedBirthday', required: true, filledByEsia: true },
|
|
37
37
|
{ fieldType: 'common', name: 'birthPlace', required: true },
|
|
38
38
|
{ fieldType: 'common', name: 'phone', required: true },
|
|
39
39
|
{ fieldType: 'common', name: 'email', required: true, dadata: true },
|
|
@@ -7,7 +7,7 @@ export const getInitialFormState = (
|
|
|
7
7
|
): FormState => ({
|
|
8
8
|
...formStateMap[step],
|
|
9
9
|
...localStorageData,
|
|
10
|
-
|
|
10
|
+
limitedBirthday: transformStringToData(localStorageData?.limitedBirthday as string),
|
|
11
11
|
dulIssueDateField: transformStringToData(localStorageData?.dulIssueDateField as string),
|
|
12
12
|
participantDateRegistration: transformStringToData(
|
|
13
13
|
localStorageData?.participantDateRegistration as string,
|
|
@@ -9,7 +9,7 @@ export const getSecondStepData = (formData: FormState): Partial<Participant> =>
|
|
|
9
9
|
name,
|
|
10
10
|
surname,
|
|
11
11
|
middleName,
|
|
12
|
-
|
|
12
|
+
limitedBirthday = '',
|
|
13
13
|
phone = '',
|
|
14
14
|
email,
|
|
15
15
|
sex,
|
|
@@ -27,7 +27,7 @@ export const getSecondStepData = (formData: FormState): Partial<Participant> =>
|
|
|
27
27
|
} = formData;
|
|
28
28
|
|
|
29
29
|
return {
|
|
30
|
-
birthDate: formatDate(
|
|
30
|
+
birthDate: formatDate(limitedBirthday, true),
|
|
31
31
|
midname: middleName,
|
|
32
32
|
name,
|
|
33
33
|
surname,
|
|
@@ -22,7 +22,7 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
22
22
|
{ fieldType: 'common', name: 'name', required: true, dadata: true, filledByEsia: true },
|
|
23
23
|
{ fieldType: 'common', name: 'middleName', dadata: true, filledByEsia: true },
|
|
24
24
|
{ fieldType: 'common', name: 'sex', required: true },
|
|
25
|
-
{ fieldType: 'common', name: '
|
|
25
|
+
{ fieldType: 'common', name: 'limitedBirthday', required: true, filledByEsia: true },
|
|
26
26
|
{ fieldType: 'common', name: 'birthPlace', required: true, filledByEsia: true },
|
|
27
27
|
{ fieldType: 'common', name: 'phone', required: true, filledByEsia: true },
|
|
28
28
|
{ fieldType: 'common', name: 'email', required: true, dadata: true },
|
|
@@ -9,7 +9,7 @@ export const getFirstStepData = (formData: FormState): Partial<Participant> => {
|
|
|
9
9
|
name,
|
|
10
10
|
surname,
|
|
11
11
|
middleName,
|
|
12
|
-
|
|
12
|
+
limitedBirthday = '',
|
|
13
13
|
phone = '',
|
|
14
14
|
email,
|
|
15
15
|
sex,
|
|
@@ -27,7 +27,7 @@ export const getFirstStepData = (formData: FormState): Partial<Participant> => {
|
|
|
27
27
|
} = formData;
|
|
28
28
|
|
|
29
29
|
return {
|
|
30
|
-
birthDate: formatDate(
|
|
30
|
+
birthDate: formatDate(limitedBirthday, true),
|
|
31
31
|
midname: middleName,
|
|
32
32
|
name,
|
|
33
33
|
surname,
|
|
@@ -7,7 +7,7 @@ export const getInitialFormState = (
|
|
|
7
7
|
): FormState => ({
|
|
8
8
|
...formStateMap[step],
|
|
9
9
|
...localStorageData,
|
|
10
|
-
|
|
10
|
+
limitedBirthday: transformStringToData(localStorageData?.limitedBirthday as string),
|
|
11
11
|
dulIssueDateField: transformStringToData(localStorageData?.dulIssueDateField as string),
|
|
12
12
|
participantDateRegistration: transformStringToData(
|
|
13
13
|
localStorageData?.participantDateRegistration as string,
|
|
@@ -3,40 +3,10 @@ import { DatePickerControl } from '../../DatePicker/DatePickerControl';
|
|
|
3
3
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
|
-
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
7
6
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const FIELD_NAME = 'birthday';
|
|
17
|
-
|
|
18
|
-
export const BirthdayField = JSX<BirthdayFieldProps>(({ field, input, isRetailForm = false }) => {
|
|
19
|
-
const { value } = field(FIELD_NAME);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<DatePickerControl
|
|
23
|
-
label="Дата рождения"
|
|
24
|
-
{...getValidation(field(FIELD_NAME), validatorObj.birthday, input?.required)}
|
|
25
|
-
error={isRetailForm && value && !birthdayValidate(value as Date) ? AGE_ERROR_MESSAGE : ''}
|
|
26
|
-
disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const birthdayValidate = (date?: Date) => {
|
|
32
|
-
const today = new Date();
|
|
33
|
-
|
|
34
|
-
const minDate = new Date(today.getFullYear() - MIN_AGE, today.getMonth(), today.getDate());
|
|
35
|
-
const maxDate = new Date(today.getFullYear() - MAX_AGE, today.getMonth(), today.getDate());
|
|
36
|
-
|
|
37
|
-
if (!date || date > minDate || date < maxDate) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return true;
|
|
42
|
-
};
|
|
7
|
+
export const BirthdayField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<DatePickerControl
|
|
9
|
+
label="Дата рождения"
|
|
10
|
+
{...getValidation(field('birthday'), validatorObj.birthday, input?.required)}
|
|
11
|
+
/>
|
|
12
|
+
));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { DatePickerControl } from '../../DatePicker/DatePickerControl';
|
|
3
|
+
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
|
+
import { validatorObj } from '../getObjectValidator';
|
|
5
|
+
import { getValidation } from '../getValidation';
|
|
6
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
7
|
+
|
|
8
|
+
const FIELD_NAME = 'limitedBirthday';
|
|
9
|
+
|
|
10
|
+
export const LimitedBirthdayField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
11
|
+
<DatePickerControl
|
|
12
|
+
label="Дата рождения"
|
|
13
|
+
{...getValidation(field(FIELD_NAME), validatorObj.limitedBirthday, input?.required)}
|
|
14
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
|
|
15
|
+
/>
|
|
16
|
+
));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
|
|
2
4
|
import { InputControl } from '../../Input/InputControl';
|
|
3
5
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
6
|
import { validatorObj } from '../getObjectValidator';
|
|
@@ -7,12 +9,23 @@ import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
|
7
9
|
|
|
8
10
|
const FIELD_NAME = 'middleName';
|
|
9
11
|
|
|
10
|
-
export const MiddleNameField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
export const MiddleNameField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
13
|
+
const onDaDataChange = useCallback((item: DaDataSuggestion) => {
|
|
14
|
+
const dadataGender = item?.data?.gender;
|
|
15
|
+
|
|
16
|
+
if (dadataGender && dadataGender !== 'UNKNOWN') {
|
|
17
|
+
field('sex')?.onChange?.(dadataGender.toLowerCase());
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<InputControl
|
|
23
|
+
label="Отчество (Обязательно, при наличии)"
|
|
24
|
+
maxLength={60}
|
|
25
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
|
|
26
|
+
{...getValidation(field(FIELD_NAME), validatorObj.middleName, input?.required)}
|
|
27
|
+
{...input}
|
|
28
|
+
onDaDataChange={onDaDataChange}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
@@ -59,6 +59,7 @@ import { JobsNumberField } from './Fields/JobsNumberField';
|
|
|
59
59
|
import { LastJobExperienceField } from './Fields/LastJobExperienceField';
|
|
60
60
|
import { LegalEntityNameField } from './Fields/LegalEntityNameField';
|
|
61
61
|
import { LegalFormField } from './Fields/LegalFormField';
|
|
62
|
+
import { LimitedBirthdayField } from './Fields/LimitedBirthdayField';
|
|
62
63
|
import { LocalitiesField } from './Fields/LocalitiesField';
|
|
63
64
|
import { MandatoryPaymentsField } from './Fields/MandatoryPaymentsField';
|
|
64
65
|
import { MethodObtainField } from './Fields/MethodObtainField';
|
|
@@ -98,8 +99,7 @@ const PRODUCT_REF = {
|
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
export const getField =
|
|
101
|
-
(field: FormFieldRegisterer<any>, typeForm: string,
|
|
102
|
-
(input: FieldDef, i: number) => {
|
|
102
|
+
(field: FormFieldRegisterer<any>, typeForm: string) => (input: FieldDef, i: number) => {
|
|
103
103
|
const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
|
|
104
104
|
|
|
105
105
|
const InputsMap = {
|
|
@@ -123,7 +123,8 @@ export const getField =
|
|
|
123
123
|
comment: <CommentField field={field} input={input} />,
|
|
124
124
|
addressBranch: <AddressBranchField field={field} input={input} isPremium={isPremium} />,
|
|
125
125
|
sex: <SexField field={field} input={input} />,
|
|
126
|
-
birthday: <BirthdayField field={field} input={input}
|
|
126
|
+
birthday: <BirthdayField field={field} input={input} />,
|
|
127
|
+
limitedBirthday: <LimitedBirthdayField field={field} input={input} />,
|
|
127
128
|
birthPlace: <BirthPlaceField field={field} input={input} />,
|
|
128
129
|
desiredMeetingDate: <DesiredMeetingDateField field={field} input={input} />,
|
|
129
130
|
product: <ProductField field={field} source={PRODUCT_REF} />,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
innValidator,
|
|
13
13
|
jobNumberValidator,
|
|
14
14
|
lengthStringValidator,
|
|
15
|
+
limitedBirthdayValidator,
|
|
15
16
|
nameValidator,
|
|
16
17
|
numberValidator,
|
|
17
18
|
phoneValidator,
|
|
@@ -30,6 +31,7 @@ export const validatorObj: Record<string, Validator> = {
|
|
|
30
31
|
secondaryPhone: phoneValidator('Укажите номер телефона'),
|
|
31
32
|
organizationPhone: phoneValidator('Укажите номер телефона'),
|
|
32
33
|
birthday: defaultValidator('Укажите дату рождения'),
|
|
34
|
+
limitedBirthday: limitedBirthdayValidator(),
|
|
33
35
|
birthPlace: defaultValidator('Укажите место рождения'),
|
|
34
36
|
education: defaultValidator('Выберите ваше образование'),
|
|
35
37
|
housing: defaultValidator('Выберите тип жилья'),
|
|
@@ -7,6 +7,10 @@ const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
|
7
7
|
|
|
8
8
|
const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
|
|
9
9
|
|
|
10
|
+
const MIN_AGE = 23;
|
|
11
|
+
const MAX_AGE = 75;
|
|
12
|
+
const AGE_ERROR_MESSAGE = 'Допустимый возраст заёмщика - от 23 до 75 лет';
|
|
13
|
+
|
|
10
14
|
export const defaultValidator = (errorMsg?: string) => required(errorMsg ?? ERROR_MESSAGE);
|
|
11
15
|
|
|
12
16
|
export const defaultSelectValidator = (errorMsg?: string) =>
|
|
@@ -88,3 +92,18 @@ export const codeWordValidator = (errorMsg?: string) =>
|
|
|
88
92
|
const cyrillicPattern = /^[\u0400-\u04FF\d]+$/u;
|
|
89
93
|
|
|
90
94
|
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
95
|
+
|
|
96
|
+
const limitedBirthdayValidate = (date?: Date) => {
|
|
97
|
+
const today = new Date();
|
|
98
|
+
|
|
99
|
+
const minDate = new Date(today.getFullYear() - MIN_AGE, today.getMonth(), today.getDate());
|
|
100
|
+
const maxDate = new Date(today.getFullYear() - MAX_AGE, today.getMonth(), today.getDate());
|
|
101
|
+
|
|
102
|
+
if (!date || date > minDate || date < maxDate) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return true;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const limitedBirthdayValidator = () => validator(limitedBirthdayValidate)(AGE_ERROR_MESSAGE);
|