@redneckz/wildless-cms-uni-blocks 0.14.676 → 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/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +83 -61
- 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/hooks/useNavigator.d.ts +8 -0
- package/bundle/index.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/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/dist/api/RetailAPI/updateRefreshToken.js +6 -10
- package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- 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/CreditCardForm.js +4 -1
- package/dist/components/CreditCardForm/CreditCardForm.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/CreditForm.js +4 -1
- package/dist/components/CreditForm/CreditForm.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/hooks/useNavigator.d.ts +8 -0
- package/dist/hooks/useNavigator.js +13 -0
- package/dist/hooks/useNavigator.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.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/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/lib/api/RetailAPI/updateRefreshToken.js +6 -10
- package/lib/api/RetailAPI/updateRefreshToken.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/CreditCardForm.js +4 -1
- package/lib/components/CreditCardForm/CreditCardForm.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/CreditForm.js +4 -1
- package/lib/components/CreditForm/CreditForm.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/hooks/useNavigator.d.ts +8 -0
- package/lib/hooks/useNavigator.js +10 -0
- package/lib/hooks/useNavigator.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.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/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +83 -61
- 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/hooks/useNavigator.d.ts +8 -0
- package/mobile/bundle/index.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/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js +6 -10
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- 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/CreditCardForm.js +4 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.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/CreditForm.js +4 -1
- package/mobile/dist/components/CreditForm/CreditForm.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/hooks/useNavigator.d.ts +8 -0
- package/mobile/dist/hooks/useNavigator.js +13 -0
- package/mobile/dist/hooks/useNavigator.js.map +1 -0
- package/mobile/dist/index.d.ts +1 -0
- package/mobile/dist/index.js +3 -1
- package/mobile/dist/index.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/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js +6 -10
- package/mobile/lib/api/RetailAPI/updateRefreshToken.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/CreditCardForm.js +4 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.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/CreditForm.js +4 -1
- package/mobile/lib/components/CreditForm/CreditForm.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/hooks/useNavigator.d.ts +8 -0
- package/mobile/lib/hooks/useNavigator.js +10 -0
- package/mobile/lib/hooks/useNavigator.js.map +1 -0
- package/mobile/lib/index.d.ts +1 -0
- package/mobile/lib/index.js +1 -0
- package/mobile/lib/index.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/api/RetailAPI/updateRefreshToken.ts +6 -12
- 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/CreditCardForm.tsx +6 -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/CreditForm.tsx +6 -1
- 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/hooks/useNavigator.ts +15 -0
- package/mobile/src/index.ts +1 -0
- 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/api/RetailAPI/updateRefreshToken.ts +6 -12
- 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/CreditCardForm.tsx +6 -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/CreditForm.tsx +6 -1
- 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/hooks/useNavigator.ts +15 -0
- package/src/index.ts +1 -0
- 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
|
@@ -3,6 +3,9 @@ import { required } from '../../validation/required.js';
|
|
|
3
3
|
import { validator } from '../../validation/validator.js';
|
|
4
4
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
5
5
|
const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
|
|
6
|
+
const MIN_AGE = 23;
|
|
7
|
+
const MAX_AGE = 75;
|
|
8
|
+
const AGE_ERROR_MESSAGE = 'Допустимый возраст заёмщика - от 23 до 75 лет';
|
|
6
9
|
export const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE);
|
|
7
10
|
export const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE);
|
|
8
11
|
export const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 0 && _.length <= 2)(errorMsg ?? ERROR_MESSAGE);
|
|
@@ -39,4 +42,14 @@ export const addressOrganizationValidator = () => validator((address) => Boolean
|
|
|
39
42
|
export const codeWordValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 3 && _.length <= 21 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE);
|
|
40
43
|
const cyrillicPattern = /^[\u0400-\u04FF\d]+$/u;
|
|
41
44
|
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
45
|
+
const limitedBirthdayValidate = (date) => {
|
|
46
|
+
const today = new Date();
|
|
47
|
+
const minDate = new Date(today.getFullYear() - MIN_AGE, today.getMonth(), today.getDate());
|
|
48
|
+
const maxDate = new Date(today.getFullYear() - MAX_AGE, today.getMonth(), today.getDate());
|
|
49
|
+
if (!date || date > minDate || date < maxDate) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
};
|
|
54
|
+
export const limitedBirthdayValidator = () => validator(limitedBirthdayValidate)(AGE_ERROR_MESSAGE);
|
|
42
55
|
//# sourceMappingURL=validators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/validators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,aAAa,GAAG,8BAA8B,CAAC;AAErD,MAAM,qBAAqB,GAAG,oDAAoD,CAAC;AAEnF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAiB,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAiB,EAAE,EAAE,CAC1D,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAiB,EAAE,EAAE,CACtD,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CACtE,QAAQ,IAAI,aAAa,C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AAG,EAAE,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -5,17 +5,15 @@ interface UpdateRefreshTokenBody {
|
|
|
5
5
|
access_token: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const PORTAL_NATURAL_URL = '/';
|
|
9
|
-
|
|
10
8
|
const UPDATING_INTERVAL = 60000 * 4;
|
|
11
9
|
|
|
12
|
-
export const updateRefreshToken = () => {
|
|
10
|
+
export const updateRefreshToken = (failCallback: () => void) => {
|
|
13
11
|
const refreshToken = globalThis.sessionStorage?.getItem('refreshToken');
|
|
14
12
|
const accessToken = globalThis.sessionStorage?.getItem('accessToken');
|
|
15
13
|
const taskId = globalThis.localStorage.getItem('taskId');
|
|
16
14
|
|
|
17
15
|
if (!accessToken || !refreshToken || !taskId) {
|
|
18
|
-
|
|
16
|
+
failCallback();
|
|
19
17
|
|
|
20
18
|
return () => null;
|
|
21
19
|
}
|
|
@@ -28,9 +26,11 @@ export const updateRefreshToken = () => {
|
|
|
28
26
|
access_token: accessToken,
|
|
29
27
|
});
|
|
30
28
|
|
|
31
|
-
if (res) {
|
|
32
|
-
|
|
29
|
+
if (res?.status == 401) {
|
|
30
|
+
failCallback();
|
|
31
|
+
}
|
|
33
32
|
|
|
33
|
+
if (res?.ok) {
|
|
34
34
|
const data: UpdateRefreshTokenBody = await res.json();
|
|
35
35
|
|
|
36
36
|
globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
|
|
@@ -44,9 +44,3 @@ export const updateRefreshToken = () => {
|
|
|
44
44
|
|
|
45
45
|
return () => clearInterval(timer);
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
const handleStatus = (status: number) => {
|
|
49
|
-
if (status == 401) {
|
|
50
|
-
globalThis.location.href = PORTAL_NATURAL_URL;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
@@ -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
|
|
|
@@ -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,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { updateRefreshToken } from '../../api/RetailAPI/updateRefreshToken';
|
|
4
|
+
import { useNavigator } from '../../hooks/useNavigator';
|
|
4
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
6
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
6
7
|
import { style } from '../../utils/style';
|
|
@@ -11,6 +12,8 @@ import { stepsSectionsMap } from './creditCardFormStepsData';
|
|
|
11
12
|
|
|
12
13
|
interface CreditCardFormWizardProps extends CreditCardFormContent, UniBlockProps {}
|
|
13
14
|
|
|
15
|
+
const PORTAL_NATURAL_URL = '/';
|
|
16
|
+
|
|
14
17
|
const WIZARD_STEPS = 6;
|
|
15
18
|
|
|
16
19
|
const WIZARD_TITLES = [
|
|
@@ -31,7 +34,9 @@ export const CreditCardForm = JSX<CreditCardFormWizardProps>(({ className, ...re
|
|
|
31
34
|
[formContainerRef],
|
|
32
35
|
);
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
const navigator = useNavigator();
|
|
38
|
+
|
|
39
|
+
useEffect(() => updateRefreshToken(() => navigator.assign(PORTAL_NATURAL_URL)), []);
|
|
35
40
|
|
|
36
41
|
const handleNextStep = useCallback(() => {
|
|
37
42
|
setStep((_) => Math.min(_ + 1, WIZARD_STEPS));
|
|
@@ -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,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { updateRefreshToken } from '../../api/RetailAPI/updateRefreshToken';
|
|
4
|
+
import { useNavigator } from '../../hooks/useNavigator';
|
|
4
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
6
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
6
7
|
import { style } from '../../utils/style';
|
|
@@ -12,6 +13,8 @@ import { stepsSectionsMap } from './creditFormStepsData';
|
|
|
12
13
|
|
|
13
14
|
interface CreditFormWizardProps extends CreditFormContent, UniBlockProps {}
|
|
14
15
|
|
|
16
|
+
const PORTAL_NATURAL_URL = '/';
|
|
17
|
+
|
|
15
18
|
const WIZARD_STEPS = 5;
|
|
16
19
|
|
|
17
20
|
const WIZARD_TITLES = [
|
|
@@ -32,7 +35,9 @@ export const CreditForm = JSX<CreditFormWizardProps>(({ className, ...rest }) =>
|
|
|
32
35
|
[formContainerRef],
|
|
33
36
|
);
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
const navigator = useNavigator();
|
|
39
|
+
|
|
40
|
+
useEffect(() => updateRefreshToken(() => navigator.assign(PORTAL_NATURAL_URL)), []);
|
|
36
41
|
|
|
37
42
|
const handleNextStep = useCallback(() => {
|
|
38
43
|
setStep((_) => Math.min(_ + 1, WIZARD_STEPS));
|
|
@@ -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,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Navigator {
|
|
2
|
+
assign: (url: string) => void;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function useNavigator(): Navigator {
|
|
6
|
+
return useNavigator._impl();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
useNavigator._impl = (): Navigator => ({
|
|
10
|
+
assign: (url) => globalThis.location.assign(url),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
useNavigator.setup = (impl: () => Navigator) => {
|
|
14
|
+
useNavigator._impl = impl;
|
|
15
|
+
};
|
package/mobile/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { setup } from '@redneckz/uni-jsx/lib/setup';
|
|
|
3
3
|
export { Blocks } from './components/Blocks';
|
|
4
4
|
export { ContentPage } from './components/ContentPage/ContentPage';
|
|
5
5
|
export { handlerDecorator } from './hooks/handlerDecorator';
|
|
6
|
+
export { useNavigator } from './hooks/useNavigator';
|
|
6
7
|
export { useRouter } from './hooks/useRouter';
|
|
7
8
|
export { projectSettings } from './ProjectSettings';
|
|
8
9
|
export { joinList } from './utils/joinList';
|
|
@@ -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);
|
package/package.json
CHANGED
|
@@ -5,17 +5,15 @@ interface UpdateRefreshTokenBody {
|
|
|
5
5
|
access_token: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const PORTAL_NATURAL_URL = '/';
|
|
9
|
-
|
|
10
8
|
const UPDATING_INTERVAL = 60000 * 4;
|
|
11
9
|
|
|
12
|
-
export const updateRefreshToken = () => {
|
|
10
|
+
export const updateRefreshToken = (failCallback: () => void) => {
|
|
13
11
|
const refreshToken = globalThis.sessionStorage?.getItem('refreshToken');
|
|
14
12
|
const accessToken = globalThis.sessionStorage?.getItem('accessToken');
|
|
15
13
|
const taskId = globalThis.localStorage.getItem('taskId');
|
|
16
14
|
|
|
17
15
|
if (!accessToken || !refreshToken || !taskId) {
|
|
18
|
-
|
|
16
|
+
failCallback();
|
|
19
17
|
|
|
20
18
|
return () => null;
|
|
21
19
|
}
|
|
@@ -28,9 +26,11 @@ export const updateRefreshToken = () => {
|
|
|
28
26
|
access_token: accessToken,
|
|
29
27
|
});
|
|
30
28
|
|
|
31
|
-
if (res) {
|
|
32
|
-
|
|
29
|
+
if (res?.status == 401) {
|
|
30
|
+
failCallback();
|
|
31
|
+
}
|
|
33
32
|
|
|
33
|
+
if (res?.ok) {
|
|
34
34
|
const data: UpdateRefreshTokenBody = await res.json();
|
|
35
35
|
|
|
36
36
|
globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
|
|
@@ -44,9 +44,3 @@ export const updateRefreshToken = () => {
|
|
|
44
44
|
|
|
45
45
|
return () => clearInterval(timer);
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
const handleStatus = (status: number) => {
|
|
49
|
-
if (status == 401) {
|
|
50
|
-
globalThis.location.href = PORTAL_NATURAL_URL;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
@@ -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
|
|