@redneckz/wildless-cms-uni-blocks 0.14.609 → 0.14.616
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/utils/getUpdateUserTask.d.ts +2 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +384 -150
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/bundle/components/ApplicationStatus/ApplicationStatus.d.ts +5 -0
- package/bundle/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
- package/bundle/components/CreditForm/CreditForm.d.ts +2 -9
- package/bundle/components/CreditForm/CreditFormContent.d.ts +9 -1
- package/bundle/components/CreditForm/CreditFormStep.d.ts +17 -0
- package/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
- package/bundle/components/CreditForm/creditFormStepsData.d.ts +40 -2
- package/bundle/components/CreditForm/getInitialFormState.d.ts +62 -0
- package/bundle/components/CreditForm/renderInputs.d.ts +3 -0
- package/bundle/components/CreditForm/useCreditFormApi.d.ts +11 -0
- package/bundle/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
- package/bundle/ui-kit/DatePicker/getYears.d.ts +1 -0
- package/bundle/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
- package/bundle/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/bundle/ui-kit/InfoCard/InfoCard.d.ts +3 -2
- package/bundle/ui-kit/Input/InputNumberControl.d.ts +2 -0
- package/bundle/ui-kit/Input/InputProps.d.ts +2 -1
- package/bundle/ui-kit/InputNumber/InputNumber.d.ts +2 -0
- package/bundle/utils/normalizeWithMask.d.ts +1 -0
- package/dist/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
- package/dist/api/RetailAPI/utils/getUpdateUserTask.js +39 -34
- package/dist/api/RetailAPI/utils/getUpdateUserTask.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/ApplicationStatus/ApplicationStatus.d.ts +5 -0
- package/dist/components/ApplicationStatus/ApplicationStatus.js +25 -0
- package/dist/components/ApplicationStatus/ApplicationStatus.js.map +1 -0
- package/dist/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
- package/dist/components/ApplicationStatus/ApplicationStatusContent.js +2 -0
- package/dist/components/ApplicationStatus/ApplicationStatusContent.js.map +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.d.ts +2 -9
- package/dist/components/CreditForm/CreditForm.js +11 -19
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/CreditFormContent.d.ts +9 -1
- package/dist/components/CreditForm/CreditFormStep.d.ts +17 -0
- package/dist/components/CreditForm/CreditFormStep.js +33 -0
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -0
- package/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
- package/dist/components/CreditForm/StepsNavigationButtons.js +2 -12
- package/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.d.ts +40 -2
- package/dist/components/CreditForm/creditFormStepsData.js +31 -26
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/getInitialFormState.d.ts +62 -0
- package/dist/components/CreditForm/getInitialFormState.js +77 -0
- package/dist/components/CreditForm/getInitialFormState.js.map +1 -0
- package/dist/components/CreditForm/renderInputs.d.ts +3 -0
- package/dist/components/CreditForm/renderInputs.js +8 -0
- package/dist/components/CreditForm/renderInputs.js.map +1 -0
- package/dist/components/CreditForm/useCreditFormApi.d.ts +11 -0
- package/dist/components/CreditForm/useCreditFormApi.js +28 -0
- package/dist/components/CreditForm/useCreditFormApi.js.map +1 -0
- package/dist/ui-kit/DatePicker/DatePicker.js +16 -5
- package/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
- package/dist/ui-kit/DatePicker/DatePickerInput.js +66 -0
- package/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -0
- package/dist/ui-kit/DatePicker/getYears.d.ts +1 -0
- package/dist/ui-kit/DatePicker/getYears.js +3 -3
- package/dist/ui-kit/DatePicker/getYears.js.map +1 -1
- package/dist/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
- package/dist/ui-kit/DatePicker/useDatePickerManager.js +29 -3
- package/dist/ui-kit/DatePicker/useDatePickerManager.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DependentsField.js +2 -2
- package/dist/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -2
- package/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -2
- package/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
- package/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
- package/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
- package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/InnField.js +2 -2
- package/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
- package/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
- package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js +9 -0
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -0
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/SelectField.js +1 -1
- package/dist/ui-kit/FormField/SelectField.js.map +1 -1
- package/dist/ui-kit/FormField/getField.js +2 -0
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +6 -5
- 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 +3 -1
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/InfoCard/InfoCard.d.ts +3 -2
- package/dist/ui-kit/InfoCard/InfoCard.js +2 -1
- package/dist/ui-kit/InfoCard/InfoCard.js.map +1 -1
- package/dist/ui-kit/Input/InputNumberControl.d.ts +2 -0
- package/dist/ui-kit/Input/InputNumberControl.js +10 -0
- package/dist/ui-kit/Input/InputNumberControl.js.map +1 -0
- package/dist/ui-kit/Input/InputProps.d.ts +2 -1
- package/dist/ui-kit/InputNumber/InputNumber.d.ts +2 -0
- package/dist/ui-kit/InputNumber/InputNumber.js +12 -0
- package/dist/ui-kit/InputNumber/InputNumber.js.map +1 -0
- package/dist/ui-kit/SnilsInput/SnilsInput.js +2 -2
- package/dist/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
- package/dist/ui-kit/TimerCircle/TimerCircle.js +3 -2
- package/dist/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
- package/dist/utils/normalizeWithMask.d.ts +1 -0
- package/dist/utils/normalizeWithMask.js +20 -0
- package/dist/utils/normalizeWithMask.js.map +1 -0
- package/lib/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
- package/lib/api/RetailAPI/utils/getUpdateUserTask.js +39 -34
- package/lib/api/RetailAPI/utils/getUpdateUserTask.js.map +1 -1
- package/lib/common.css +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/ApplicationStatus/ApplicationStatus.d.ts +5 -0
- package/lib/components/ApplicationStatus/ApplicationStatus.fixture.d.ts +9 -0
- package/lib/components/ApplicationStatus/ApplicationStatus.js +23 -0
- package/lib/components/ApplicationStatus/ApplicationStatus.js.map +1 -0
- package/lib/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
- package/lib/components/ApplicationStatus/ApplicationStatusContent.js +2 -0
- package/lib/components/ApplicationStatus/ApplicationStatusContent.js.map +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.d.ts +2 -9
- package/lib/components/CreditForm/CreditForm.js +12 -20
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/CreditFormContent.d.ts +9 -1
- package/lib/components/CreditForm/CreditFormStep.d.ts +17 -0
- package/lib/components/CreditForm/CreditFormStep.js +31 -0
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -0
- package/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
- package/lib/components/CreditForm/StepsNavigationButtons.js +2 -12
- package/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.d.ts +40 -2
- package/lib/components/CreditForm/creditFormStepsData.js +31 -26
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/getInitialFormState.d.ts +62 -0
- package/lib/components/CreditForm/getInitialFormState.js +74 -0
- package/lib/components/CreditForm/getInitialFormState.js.map +1 -0
- package/lib/components/CreditForm/renderInputs.d.ts +2 -0
- package/lib/components/CreditForm/renderInputs.js +5 -0
- package/lib/components/CreditForm/renderInputs.js.map +1 -0
- package/lib/components/CreditForm/useCreditFormApi.d.ts +11 -0
- package/lib/components/CreditForm/useCreditFormApi.js +25 -0
- package/lib/components/CreditForm/useCreditFormApi.js.map +1 -0
- package/lib/ui-kit/DatePicker/DatePicker.js +16 -5
- package/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
- package/lib/ui-kit/DatePicker/DatePickerInput.js +64 -0
- package/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -0
- package/lib/ui-kit/DatePicker/getYears.d.ts +1 -0
- package/lib/ui-kit/DatePicker/getYears.js +1 -1
- package/lib/ui-kit/DatePicker/getYears.js.map +1 -1
- package/lib/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
- package/lib/ui-kit/DatePicker/useDatePickerManager.js +29 -3
- package/lib/ui-kit/DatePicker/useDatePickerManager.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DependentsField.js +2 -2
- package/lib/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -2
- package/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -2
- package/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
- package/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
- package/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
- package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/InnField.js +2 -2
- package/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
- package/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
- package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js +7 -0
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -0
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/SelectField.js +1 -1
- package/lib/ui-kit/FormField/SelectField.js.map +1 -1
- package/lib/ui-kit/FormField/getField.js +2 -0
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +7 -6
- 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 +1 -0
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/InfoCard/InfoCard.d.ts +3 -2
- package/lib/ui-kit/InfoCard/InfoCard.js +2 -1
- package/lib/ui-kit/InfoCard/InfoCard.js.map +1 -1
- package/lib/ui-kit/Input/InputNumberControl.d.ts +2 -0
- package/lib/ui-kit/Input/InputNumberControl.js +8 -0
- package/lib/ui-kit/Input/InputNumberControl.js.map +1 -0
- package/lib/ui-kit/Input/InputProps.d.ts +2 -1
- package/lib/ui-kit/InputNumber/InputNumber.d.ts +2 -0
- package/lib/ui-kit/InputNumber/InputNumber.js +10 -0
- package/lib/ui-kit/InputNumber/InputNumber.js.map +1 -0
- package/lib/ui-kit/SnilsInput/SnilsInput.js +2 -2
- package/lib/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
- package/lib/ui-kit/TimerCircle/TimerCircle.js +3 -2
- package/lib/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
- package/lib/utils/normalizeWithMask.d.ts +1 -0
- package/lib/utils/normalizeWithMask.js +17 -0
- package/lib/utils/normalizeWithMask.js.map +1 -0
- package/mobile/bundle/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
- package/mobile/bundle/bundle.umd.js +363 -150
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/bundle/components/ApplicationStatus/ApplicationStatus.d.ts +5 -0
- package/mobile/bundle/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
- package/mobile/bundle/components/CreditForm/CreditForm.d.ts +2 -9
- package/mobile/bundle/components/CreditForm/CreditFormContent.d.ts +9 -1
- package/mobile/bundle/components/CreditForm/CreditFormStep.d.ts +17 -0
- package/mobile/bundle/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
- package/mobile/bundle/components/CreditForm/creditFormStepsData.d.ts +40 -2
- package/mobile/bundle/components/CreditForm/getInitialFormState.d.ts +62 -0
- package/mobile/bundle/components/CreditForm/renderInputs.d.ts +3 -0
- package/mobile/bundle/components/CreditForm/useCreditFormApi.d.ts +11 -0
- package/mobile/bundle/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
- package/mobile/bundle/ui-kit/DatePicker/getYears.d.ts +1 -0
- package/mobile/bundle/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
- package/mobile/bundle/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/bundle/ui-kit/InfoCard/InfoCard.d.ts +3 -2
- package/mobile/bundle/ui-kit/Input/InputNumberControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/InputProps.d.ts +2 -1
- package/mobile/bundle/ui-kit/InputNumber/InputNumber.d.ts +2 -0
- package/mobile/bundle/utils/normalizeWithMask.d.ts +1 -0
- package/mobile/dist/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
- package/mobile/dist/api/RetailAPI/utils/getUpdateUserTask.js +39 -34
- package/mobile/dist/api/RetailAPI/utils/getUpdateUserTask.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/ApplicationStatus/ApplicationStatus.d.ts +5 -0
- package/mobile/dist/components/ApplicationStatus/ApplicationStatus.js +25 -0
- package/mobile/dist/components/ApplicationStatus/ApplicationStatus.js.map +1 -0
- package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
- package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.js +2 -0
- package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.js.map +1 -0
- package/mobile/dist/components/CreditForm/CreditForm.d.ts +2 -9
- package/mobile/dist/components/CreditForm/CreditForm.js +11 -19
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormContent.d.ts +9 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.d.ts +17 -0
- package/mobile/dist/components/CreditForm/CreditFormStep.js +33 -0
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -0
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js +2 -12
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.d.ts +40 -2
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +31 -26
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/getInitialFormState.d.ts +62 -0
- package/mobile/dist/components/CreditForm/getInitialFormState.js +77 -0
- package/mobile/dist/components/CreditForm/getInitialFormState.js.map +1 -0
- package/mobile/dist/components/CreditForm/renderInputs.d.ts +3 -0
- package/mobile/dist/components/CreditForm/renderInputs.js +8 -0
- package/mobile/dist/components/CreditForm/renderInputs.js.map +1 -0
- package/mobile/dist/components/CreditForm/useCreditFormApi.d.ts +11 -0
- package/mobile/dist/components/CreditForm/useCreditFormApi.js +28 -0
- package/mobile/dist/components/CreditForm/useCreditFormApi.js.map +1 -0
- package/mobile/dist/ui-kit/DatePicker/DatePicker.js +16 -5
- package/mobile/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
- package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js +66 -0
- package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -0
- package/mobile/dist/ui-kit/DatePicker/getYears.d.ts +1 -0
- package/mobile/dist/ui-kit/DatePicker/getYears.js +3 -3
- package/mobile/dist/ui-kit/DatePicker/getYears.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
- package/mobile/dist/ui-kit/DatePicker/useDatePickerManager.js +29 -3
- package/mobile/dist/ui-kit/DatePicker/useDatePickerManager.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DependentsField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js +9 -0
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/SelectField.js +1 -1
- package/mobile/dist/ui-kit/FormField/SelectField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +2 -0
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +6 -5
- 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 +3 -1
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/InfoCard/InfoCard.d.ts +3 -2
- package/mobile/dist/ui-kit/InfoCard/InfoCard.js +2 -1
- package/mobile/dist/ui-kit/InfoCard/InfoCard.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputNumberControl.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/InputNumberControl.js +10 -0
- package/mobile/dist/ui-kit/Input/InputNumberControl.js.map +1 -0
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +2 -1
- package/mobile/dist/ui-kit/InputNumber/InputNumber.d.ts +2 -0
- package/mobile/dist/ui-kit/InputNumber/InputNumber.js +12 -0
- package/mobile/dist/ui-kit/InputNumber/InputNumber.js.map +1 -0
- package/mobile/dist/ui-kit/SnilsInput/SnilsInput.js +2 -2
- package/mobile/dist/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
- package/mobile/dist/ui-kit/TimerCircle/TimerCircle.js +3 -2
- package/mobile/dist/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
- package/mobile/dist/utils/normalizeWithMask.d.ts +1 -0
- package/mobile/dist/utils/normalizeWithMask.js +20 -0
- package/mobile/dist/utils/normalizeWithMask.js.map +1 -0
- package/mobile/lib/api/RetailAPI/utils/getUpdateUserTask.d.ts +2 -1
- package/mobile/lib/api/RetailAPI/utils/getUpdateUserTask.js +39 -34
- package/mobile/lib/api/RetailAPI/utils/getUpdateUserTask.js.map +1 -1
- package/mobile/lib/common.css +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/ApplicationStatus/ApplicationStatus.d.ts +5 -0
- package/mobile/lib/components/ApplicationStatus/ApplicationStatus.js +23 -0
- package/mobile/lib/components/ApplicationStatus/ApplicationStatus.js.map +1 -0
- package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.d.ts +18 -0
- package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.js +2 -0
- package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.js.map +1 -0
- package/mobile/lib/components/CreditForm/CreditForm.d.ts +2 -9
- package/mobile/lib/components/CreditForm/CreditForm.js +12 -20
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormContent.d.ts +9 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.d.ts +17 -0
- package/mobile/lib/components/CreditForm/CreditFormStep.js +31 -0
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -0
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.d.ts +1 -1
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js +2 -12
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.d.ts +40 -2
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +31 -26
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/getInitialFormState.d.ts +62 -0
- package/mobile/lib/components/CreditForm/getInitialFormState.js +74 -0
- package/mobile/lib/components/CreditForm/getInitialFormState.js.map +1 -0
- package/mobile/lib/components/CreditForm/renderInputs.d.ts +3 -0
- package/mobile/lib/components/CreditForm/renderInputs.js +5 -0
- package/mobile/lib/components/CreditForm/renderInputs.js.map +1 -0
- package/mobile/lib/components/CreditForm/useCreditFormApi.d.ts +11 -0
- package/mobile/lib/components/CreditForm/useCreditFormApi.js +25 -0
- package/mobile/lib/components/CreditForm/useCreditFormApi.js.map +1 -0
- package/mobile/lib/ui-kit/DatePicker/DatePicker.js +16 -5
- package/mobile/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerInput.d.ts +10 -0
- package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js +64 -0
- package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -0
- package/mobile/lib/ui-kit/DatePicker/getYears.d.ts +1 -0
- package/mobile/lib/ui-kit/DatePicker/getYears.js +1 -1
- package/mobile/lib/ui-kit/DatePicker/getYears.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/useDatePickerManager.d.ts +3 -1
- package/mobile/lib/ui-kit/DatePicker/useDatePickerManager.js +29 -3
- package/mobile/lib/ui-kit/DatePicker/useDatePickerManager.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DependentsField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js +7 -0
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/SelectField.js +1 -1
- package/mobile/lib/ui-kit/FormField/SelectField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +2 -0
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +7 -6
- 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 +1 -0
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/InfoCard/InfoCard.d.ts +3 -2
- package/mobile/lib/ui-kit/InfoCard/InfoCard.js +2 -1
- package/mobile/lib/ui-kit/InfoCard/InfoCard.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputNumberControl.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/InputNumberControl.js +8 -0
- package/mobile/lib/ui-kit/Input/InputNumberControl.js.map +1 -0
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +2 -1
- package/mobile/lib/ui-kit/InputNumber/InputNumber.d.ts +2 -0
- package/mobile/lib/ui-kit/InputNumber/InputNumber.js +10 -0
- package/mobile/lib/ui-kit/InputNumber/InputNumber.js.map +1 -0
- package/mobile/lib/ui-kit/SnilsInput/SnilsInput.js +2 -2
- package/mobile/lib/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
- package/mobile/lib/ui-kit/TimerCircle/TimerCircle.js +3 -2
- package/mobile/lib/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
- package/mobile/lib/utils/normalizeWithMask.d.ts +1 -0
- package/mobile/lib/utils/normalizeWithMask.js +17 -0
- package/mobile/lib/utils/normalizeWithMask.js.map +1 -0
- package/mobile/src/api/RetailAPI/utils/getUpdateUserTask.ts +49 -35
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +4 -1
- package/mobile/src/components/ApplicationStatus/ApplicationStatus.example.json +6 -0
- package/mobile/src/components/ApplicationStatus/ApplicationStatus.tsx +108 -0
- package/mobile/src/components/ApplicationStatus/ApplicationStatus.ui.json +1 -0
- package/mobile/src/components/ApplicationStatus/ApplicationStatusContent.ts +19 -0
- package/mobile/src/components/CreditForm/CreditForm.tsx +36 -56
- package/mobile/src/components/CreditForm/CreditFormContent.ts +13 -1
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +65 -0
- package/mobile/src/components/CreditForm/StepsNavigationButtons.tsx +19 -38
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +31 -26
- package/mobile/src/components/CreditForm/getInitialFormState.tsx +145 -0
- package/mobile/src/components/CreditForm/renderInputs.tsx +6 -0
- package/mobile/src/components/CreditForm/useCreditFormApi.tsx +36 -0
- package/mobile/src/ui-kit/DatePicker/DatePicker.tsx +34 -13
- package/mobile/src/ui-kit/DatePicker/DatePickerInput.tsx +100 -0
- package/mobile/src/ui-kit/DatePicker/getYears.ts +1 -1
- package/mobile/src/ui-kit/DatePicker/useDatePickerManager.ts +51 -3
- package/mobile/src/ui-kit/FormField/Fields/DependentsField.tsx +3 -3
- package/mobile/src/ui-kit/FormField/Fields/DulNumberField.tsx +3 -3
- package/mobile/src/ui-kit/FormField/Fields/DulSerieField.tsx +3 -3
- package/mobile/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +3 -3
- package/mobile/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +3 -2
- package/mobile/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +3 -3
- package/mobile/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +3 -2
- package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +3 -3
- package/mobile/src/ui-kit/FormField/Fields/JobsNumberField.tsx +5 -5
- package/mobile/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +3 -2
- package/mobile/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +15 -0
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +2 -1
- package/mobile/src/ui-kit/FormField/SelectField.tsx +3 -1
- package/mobile/src/ui-kit/FormField/getField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +7 -7
- package/mobile/src/ui-kit/FormField/validators.ts +5 -0
- package/mobile/src/ui-kit/InfoCard/InfoCard.tsx +9 -3
- package/mobile/src/ui-kit/Input/InputNumberControl.tsx +18 -0
- package/mobile/src/ui-kit/Input/InputProps.ts +2 -1
- package/mobile/src/ui-kit/InputNumber/InputNumber.tsx +24 -0
- package/mobile/src/ui-kit/SnilsInput/SnilsInput.tsx +2 -2
- package/mobile/src/ui-kit/TimerCircle/TimerCircle.tsx +9 -4
- package/mobile/src/utils/normalizeWithMask.ts +23 -0
- package/package.json +2 -2
- package/src/api/RetailAPI/utils/getUpdateUserTask.ts +49 -35
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +4 -1
- package/src/components/ApplicationStatus/ApplicationStatus.example.json +6 -0
- package/src/components/ApplicationStatus/ApplicationStatus.fixture.tsx +129 -0
- package/src/components/ApplicationStatus/ApplicationStatus.tsx +108 -0
- package/src/components/ApplicationStatus/ApplicationStatus.ui.json +1 -0
- package/src/components/ApplicationStatus/ApplicationStatusContent.ts +19 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/CreditForm/CreditForm.fixture.tsx +27 -1
- package/src/components/CreditForm/CreditForm.tsx +36 -56
- package/src/components/CreditForm/CreditFormContent.ts +13 -1
- package/src/components/CreditForm/CreditFormStep.tsx +65 -0
- package/src/components/CreditForm/StepsNavigationButtons.tsx +19 -38
- package/src/components/CreditForm/creditFormStepsData.tsx +31 -26
- package/src/components/CreditForm/getInitialFormState.tsx +145 -0
- package/src/components/CreditForm/renderInputs.tsx +6 -0
- package/src/components/CreditForm/useCreditFormApi.tsx +36 -0
- package/src/ui-kit/DatePicker/DatePicker.tsx +34 -13
- package/src/ui-kit/DatePicker/DatePickerInput.tsx +100 -0
- package/src/ui-kit/DatePicker/getYears.ts +1 -1
- package/src/ui-kit/DatePicker/useDatePickerManager.ts +51 -3
- package/src/ui-kit/FormField/Fields/DependentsField.tsx +3 -3
- package/src/ui-kit/FormField/Fields/DulNumberField.tsx +3 -3
- package/src/ui-kit/FormField/Fields/DulSerieField.tsx +3 -3
- package/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +3 -3
- package/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +3 -2
- package/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +3 -3
- package/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +3 -2
- package/src/ui-kit/FormField/Fields/InnField.tsx +3 -3
- package/src/ui-kit/FormField/Fields/JobsNumberField.tsx +5 -5
- package/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +3 -2
- package/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +15 -0
- package/src/ui-kit/FormField/NameFieldDef.ts +2 -1
- package/src/ui-kit/FormField/SelectField.tsx +3 -1
- package/src/ui-kit/FormField/getField.tsx +2 -0
- package/src/ui-kit/FormField/getObjectValidator.tsx +7 -7
- package/src/ui-kit/FormField/validators.ts +5 -0
- package/src/ui-kit/InfoCard/InfoCard.tsx +9 -3
- package/src/ui-kit/Input/InputNumberControl.tsx +18 -0
- package/src/ui-kit/Input/InputProps.ts +2 -1
- package/src/ui-kit/InputNumber/InputNumber.tsx +24 -0
- package/src/ui-kit/SnilsInput/SnilsInput.tsx +2 -2
- package/src/ui-kit/TimerCircle/TimerCircle.tsx +9 -4
- package/src/utils/normalizeWithMask.ts +23 -0
- package/bundle/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
- package/dist/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
- package/dist/ui-kit/SnilsInput/normalizeSnils.js +0 -23
- package/dist/ui-kit/SnilsInput/normalizeSnils.js.map +0 -1
- package/lib/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
- package/lib/ui-kit/SnilsInput/normalizeSnils.js +0 -20
- package/lib/ui-kit/SnilsInput/normalizeSnils.js.map +0 -1
- package/mobile/bundle/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
- package/mobile/dist/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
- package/mobile/dist/ui-kit/SnilsInput/normalizeSnils.js +0 -23
- package/mobile/dist/ui-kit/SnilsInput/normalizeSnils.js.map +0 -1
- package/mobile/lib/ui-kit/SnilsInput/normalizeSnils.d.ts +0 -1
- package/mobile/lib/ui-kit/SnilsInput/normalizeSnils.js +0 -20
- package/mobile/lib/ui-kit/SnilsInput/normalizeSnils.js.map +0 -1
- package/mobile/src/ui-kit/SnilsInput/normalizeSnils.ts +0 -29
- package/src/ui-kit/SnilsInput/normalizeSnils.ts +0 -29
|
@@ -1418,6 +1418,7 @@
|
|
|
1418
1418
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
1419
1419
|
const defaultValidator = (errorMsg) => required(errorMsg ? errorMsg : ERROR_MESSAGE);
|
|
1420
1420
|
const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
|
|
1421
|
+
const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 0 && _.length <= 2)(errorMsg ? errorMsg : ERROR_MESSAGE);
|
|
1421
1422
|
const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1)(errorMsg ? errorMsg : ERROR_MESSAGE);
|
|
1422
1423
|
const lengthStringValidator = (maxLength, errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= maxLength)(errorMsg ? errorMsg : ERROR_MESSAGE);
|
|
1423
1424
|
const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
|
|
@@ -1475,10 +1476,10 @@
|
|
|
1475
1476
|
inn: innValidator('Укажите ИНН'),
|
|
1476
1477
|
legalForm: defaultValidator('Укажите ОПФ'),
|
|
1477
1478
|
organizationName: defaultValidator('Укажите наименование организации'),
|
|
1478
|
-
generalSeniority:
|
|
1479
|
-
lastJobExperience:
|
|
1480
|
-
experience5Years:
|
|
1481
|
-
jobsNumber:
|
|
1479
|
+
generalSeniority: jobNumberValidator('Укажите количество лет стажа'),
|
|
1480
|
+
lastJobExperience: jobNumberValidator('Укажите стаж на последнем месте работы'),
|
|
1481
|
+
experience5Years: jobNumberValidator('Укажите общий стаж за последние 5 лет'),
|
|
1482
|
+
jobsNumber: jobNumberValidator('Укажите количество мест работы за последние 5 лет'),
|
|
1482
1483
|
beginDate: defaultValidator('Укажите дату заключения трудового договора'),
|
|
1483
1484
|
fullAddress: defaultValidator(),
|
|
1484
1485
|
partnerComments: defaultValidator(),
|
|
@@ -1520,9 +1521,10 @@
|
|
|
1520
1521
|
shareholderFlg: defaultValidator(),
|
|
1521
1522
|
legalEntityName: defaultValidator(),
|
|
1522
1523
|
bankEmployeeCode: defaultValidator(),
|
|
1524
|
+
partInBusiness: defaultValidator(),
|
|
1523
1525
|
};
|
|
1524
1526
|
const getObjectValidator = (inputs) => {
|
|
1525
|
-
const requiredInputs = getNamesFromInput(inputs.filter((_) => (
|
|
1527
|
+
const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
|
|
1526
1528
|
return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
|
|
1527
1529
|
};
|
|
1528
1530
|
|
|
@@ -1740,7 +1742,7 @@
|
|
|
1740
1742
|
const leadDescription = (source && source?.map((_) => _.description)) || [];
|
|
1741
1743
|
return (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430", label: label, options: arrayToOptions$1(leadDescription), ...getValidation(field(fieldName), validatorObj[fieldName], input?.required) }));
|
|
1742
1744
|
});
|
|
1743
|
-
const arrayToOptions$1 = (array) => (array ?? []).map((_) => ({ key: _,
|
|
1745
|
+
const arrayToOptions$1 = (array) => (array ?? []).map((_) => ({ key: _, text: _ }));
|
|
1744
1746
|
|
|
1745
1747
|
const AmountWorkersField = JSX(({ field, input }) => {
|
|
1746
1748
|
const { data: amountWorkers } = useLeadFormData('EMPLOYEES_NUMBER');
|
|
@@ -1863,6 +1865,83 @@
|
|
|
1863
1865
|
}) })] }));
|
|
1864
1866
|
});
|
|
1865
1867
|
|
|
1868
|
+
function normalizeWithMask(value, pattern) {
|
|
1869
|
+
const valueNumbers = value.replace(/\D/g, '');
|
|
1870
|
+
if (valueNumbers === '' || value?.length === pattern.length) {
|
|
1871
|
+
return value;
|
|
1872
|
+
}
|
|
1873
|
+
const patternInArr = [...pattern];
|
|
1874
|
+
const firstPlaceholderIndex = patternInArr.findIndex(isPlaceholder$1);
|
|
1875
|
+
const valueWildcardIndicies = patternInArr.map((_, i) => isWildcard$1(_) ? patternInArr.slice(0, i).filter(isWildcard$1).length : -1);
|
|
1876
|
+
const applyPlaceholder = (_, i) => isDigit$1(_) ? _ : valueNumbers.charAt(valueWildcardIndicies[i]) || _;
|
|
1877
|
+
const resultInArr = patternInArr.map(applyPlaceholder);
|
|
1878
|
+
const resultLength = valueWildcardIndicies.indexOf(valueNumbers.length - 1) + 1;
|
|
1879
|
+
return resultInArr.slice(0, Math.max(firstPlaceholderIndex, resultLength)).join('');
|
|
1880
|
+
}
|
|
1881
|
+
const isPlaceholder$1 = (_) => _ === '_';
|
|
1882
|
+
const isDigit$1 = (_) => /\d/.test(_);
|
|
1883
|
+
const isWildcard$1 = (_) => isPlaceholder$1(_) || isDigit$1(_);
|
|
1884
|
+
|
|
1885
|
+
const START_YEAR = 1940;
|
|
1886
|
+
const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
|
|
1887
|
+
|
|
1888
|
+
const ICON_PROPS$1 = {
|
|
1889
|
+
name: 'CalendarIcon',
|
|
1890
|
+
iconVersion: 'black',
|
|
1891
|
+
width: '24',
|
|
1892
|
+
height: '24',
|
|
1893
|
+
};
|
|
1894
|
+
const DatePickerInput = JSX(({ setSelectedMonth, setSelectedYear, className, value, onChange, onClick }) => {
|
|
1895
|
+
const ref = useRef(null);
|
|
1896
|
+
const [inputValue, setInputValue] = useState(value || '');
|
|
1897
|
+
const handleChange = (ev) => {
|
|
1898
|
+
const val = ev.target?.value;
|
|
1899
|
+
if (typeof val === 'string' && val?.length < 11) {
|
|
1900
|
+
setInputValue(normalizeWithMask(val, '__.__.____'));
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
const onBlur = () => {
|
|
1904
|
+
if (checkIsValidDate(inputValue)) {
|
|
1905
|
+
const [day, month, year] = inputValue.split('.');
|
|
1906
|
+
onChange?.(new Date(Number(year), Number(month) - 1, Number(day)));
|
|
1907
|
+
setSelectedMonth(Number(month) - 1);
|
|
1908
|
+
setSelectedYear(Number(year));
|
|
1909
|
+
}
|
|
1910
|
+
else {
|
|
1911
|
+
setInputValue(value || '');
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
const onInputClick = () => {
|
|
1915
|
+
if (ref.current !== null) {
|
|
1916
|
+
ref.current.focus();
|
|
1917
|
+
}
|
|
1918
|
+
onClick?.();
|
|
1919
|
+
};
|
|
1920
|
+
useEffect(() => {
|
|
1921
|
+
setInputValue(value || '');
|
|
1922
|
+
}, [value]);
|
|
1923
|
+
return (jsxs("div", { onClick: onInputClick, className: style('relative', className), children: [jsx("input", { ref: ref, className: "h-full w-full px-m text-l text-black focus-visible:outline-none", value: inputValue, type: "text", onChange: handleChange, onBlur: onBlur }), jsx(Icon, { className: "mr-s", ...ICON_PROPS$1 })] }));
|
|
1924
|
+
});
|
|
1925
|
+
const isValidYear = (year) => Number(year) >= START_YEAR && Number(year) <= new Date().getFullYear();
|
|
1926
|
+
const isValidMonth = (month) => Number(month) > 0 && Number(month) < 13;
|
|
1927
|
+
const checkIsValidDate = (date) => {
|
|
1928
|
+
const [day, month, year] = date.split('.');
|
|
1929
|
+
if (isValidYear(year)) {
|
|
1930
|
+
if (isValidMonth(month)) {
|
|
1931
|
+
const currentDate = new Date(Number(year), Number(month) - 1, 1);
|
|
1932
|
+
let maxDateOfMonth = 0;
|
|
1933
|
+
while (currentDate.getMonth() === Number(month) - 1) {
|
|
1934
|
+
currentDate.setDate(currentDate.getDate() + 1);
|
|
1935
|
+
maxDateOfMonth++;
|
|
1936
|
+
}
|
|
1937
|
+
if (Number(day) > 0 && Number(day) <= maxDateOfMonth) {
|
|
1938
|
+
return true;
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
return false;
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1866
1945
|
const months = [
|
|
1867
1946
|
'Январь',
|
|
1868
1947
|
'Февраль',
|
|
@@ -1878,15 +1957,12 @@
|
|
|
1878
1957
|
'Декабрь',
|
|
1879
1958
|
];
|
|
1880
1959
|
|
|
1881
|
-
const START_YEAR = 1940;
|
|
1882
|
-
const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
|
|
1883
|
-
|
|
1884
1960
|
const MONTHS_COUNT = 11;
|
|
1885
1961
|
const MONTHS_OPTIONS = months.map((key) => ({ key }));
|
|
1886
1962
|
const YEARS_OPTIONS = getYears()
|
|
1887
1963
|
.reverse()
|
|
1888
1964
|
.map((key) => ({ key: String(key) }));
|
|
1889
|
-
const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, }) => {
|
|
1965
|
+
const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, onChange, value, }) => {
|
|
1890
1966
|
const close = useCallback(() => showCalendar && onShowCalendar(false), [showCalendar]);
|
|
1891
1967
|
const ref = useOutsideClick(close);
|
|
1892
1968
|
const handleChangeVisibleCalendar = useCallback(() => onShowCalendar(!showCalendar), [showCalendar]);
|
|
@@ -1908,8 +1984,21 @@
|
|
|
1908
1984
|
onYearSelect(selectedYear - 1);
|
|
1909
1985
|
}
|
|
1910
1986
|
}, [selectedMonth]);
|
|
1911
|
-
const handleSelectMonth = useCallback(({ key }) =>
|
|
1912
|
-
|
|
1987
|
+
const handleSelectMonth = useCallback(({ key }) => {
|
|
1988
|
+
onMonthSelect(months.indexOf(key));
|
|
1989
|
+
const maxDateOfMonth = calculateMaxDaysOfMonth(selectedYear, months.indexOf(key));
|
|
1990
|
+
handleChangeMonth({
|
|
1991
|
+
maxDateOfMonth,
|
|
1992
|
+
selectedYear,
|
|
1993
|
+
selectedMonth: months.indexOf(key),
|
|
1994
|
+
value,
|
|
1995
|
+
onChange,
|
|
1996
|
+
});
|
|
1997
|
+
}, [value]);
|
|
1998
|
+
const handleSelectYear = useCallback(({ key }) => {
|
|
1999
|
+
onYearSelect(Number(key));
|
|
2000
|
+
value && onChange?.(new Date(Number(key), selectedMonth, value?.getDate()));
|
|
2001
|
+
}, [value]);
|
|
1913
2002
|
return {
|
|
1914
2003
|
handleChangeVisibleCalendar,
|
|
1915
2004
|
handleNextMonth,
|
|
@@ -1921,6 +2010,19 @@
|
|
|
1921
2010
|
ref,
|
|
1922
2011
|
};
|
|
1923
2012
|
};
|
|
2013
|
+
const calculateMaxDaysOfMonth = (selectedYear, selectedMonth) => {
|
|
2014
|
+
const date = new Date(selectedYear, selectedMonth, 1);
|
|
2015
|
+
let maxDateOfMonth = 0;
|
|
2016
|
+
while (date.getMonth() === selectedMonth) {
|
|
2017
|
+
maxDateOfMonth++;
|
|
2018
|
+
date.setDate(date.getDate() + 1);
|
|
2019
|
+
}
|
|
2020
|
+
return maxDateOfMonth;
|
|
2021
|
+
};
|
|
2022
|
+
const handleChangeMonth = ({ maxDateOfMonth, selectedYear, selectedMonth, value, onChange, }) => {
|
|
2023
|
+
value &&
|
|
2024
|
+
onChange?.(new Date(selectedYear, selectedMonth, Math.min(maxDateOfMonth, value.getDate())));
|
|
2025
|
+
};
|
|
1924
2026
|
|
|
1925
2027
|
const ICON_PROPS = {
|
|
1926
2028
|
name: 'ArrowUpIcon',
|
|
@@ -1933,9 +2035,11 @@
|
|
|
1933
2035
|
iconVersion: 'black',
|
|
1934
2036
|
isBorder: false,
|
|
1935
2037
|
};
|
|
1936
|
-
const formStyle = 'flex justify-between items-center h-14
|
|
2038
|
+
const formStyle = 'flex justify-between items-center h-14 py-s border rounded-md cursor-pointer ' +
|
|
1937
2039
|
'hover:border-black active:border-black focus:border-black';
|
|
1938
|
-
const DatePicker = JSX(
|
|
2040
|
+
const DatePicker = JSX(
|
|
2041
|
+
// eslint-disable-next-line max-lines-per-function
|
|
2042
|
+
({ className = '', label = '', value, valid = true, minDate, maxDate, onChange }) => {
|
|
1939
2043
|
const [showCalendar, { setValue }] = useBool(false);
|
|
1940
2044
|
const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
|
|
1941
2045
|
const [selectedYear, setSelectedYear] = useState(value?.getFullYear() || new Date().getFullYear());
|
|
@@ -1946,13 +2050,22 @@
|
|
|
1946
2050
|
selectedYear,
|
|
1947
2051
|
selectedMonth,
|
|
1948
2052
|
showCalendar,
|
|
2053
|
+
onChange,
|
|
2054
|
+
value,
|
|
1949
2055
|
});
|
|
1950
2056
|
const spaceAbove = useElementSpace(ref, 370);
|
|
1951
|
-
return (jsxs("div", { className: style('space-y-xs', className), ref: ref, children: [renderLabel(label), jsxs("div", { className: "relative", children: [renderDatePickerForm(
|
|
2057
|
+
return (jsxs("div", { className: style('space-y-xs', className), ref: ref, children: [renderLabel(label), jsxs("div", { className: "relative", children: [renderDatePickerForm({
|
|
2058
|
+
handleChangeVisibleCalendar,
|
|
2059
|
+
value,
|
|
2060
|
+
valid,
|
|
2061
|
+
onChange,
|
|
2062
|
+
setSelectedMonth,
|
|
2063
|
+
setSelectedYear,
|
|
2064
|
+
}), showCalendar ? (jsxs("div", { className: style('absolute bg-white z-20 select-none', {
|
|
1952
2065
|
'bottom-full': spaceAbove,
|
|
1953
2066
|
}), children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, onDateSelect: onChange, min: minDate, max: maxDate, setValue: setValue })] })) : null] })] }));
|
|
1954
2067
|
});
|
|
1955
|
-
const renderDatePickerForm = (handleChangeVisibleCalendar, value, valid) => (
|
|
2068
|
+
const renderDatePickerForm = ({ handleChangeVisibleCalendar, value, valid, onChange, setSelectedMonth, setSelectedYear, }) => (jsx(DatePickerInput, { onChange: onChange, onClick: handleChangeVisibleCalendar, value: value && formatDate(value), setSelectedMonth: setSelectedMonth, setSelectedYear: setSelectedYear, className: style(formStyle, valid ? 'border-gray' : 'border-error') }));
|
|
1956
2069
|
|
|
1957
2070
|
const DatePickerControl = JSX(({ className, label, error, errors, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: getRequiredLabel({ label, errors }), valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
|
|
1958
2071
|
|
|
@@ -2060,7 +2173,15 @@
|
|
|
2060
2173
|
return (jsx(SelectField, { field: field, source: creditInRshbCd, label: LABEL_TEXT, fieldName: "creditInRshbCd", input: input }));
|
|
2061
2174
|
});
|
|
2062
2175
|
|
|
2063
|
-
const
|
|
2176
|
+
const InputNumber = JSX(({ children, onChange, inputLength, ...inputProps }) => {
|
|
2177
|
+
const handleChange = useCallback((v) => onChange && inputLength && v.length <= inputLength && onChange(normalizeInput(v)), [onChange]);
|
|
2178
|
+
return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), children: children }));
|
|
2179
|
+
});
|
|
2180
|
+
const normalizeInput = (value) => value.replace(/\D/g, '');
|
|
2181
|
+
|
|
2182
|
+
const InputNumberControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(InputNumber, { "aria-label": label, label: getRequiredLabel({ label, errors: rest?.errors }), valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
|
|
2183
|
+
|
|
2184
|
+
const DependentsField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0436\u0434\u0438\u0432\u0435\u043D\u0446\u0435\u0432", placeholder: "\u0417\u0430 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", inputLength: 2, ...getValidation(field('dependents'), validatorObj.dependents, input?.required), ...input })));
|
|
2064
2185
|
|
|
2065
2186
|
const DesiredMeetingDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0438", ...getValidation(field('desiredMeetingDate'), validatorObj.meetingDay, input?.required) })));
|
|
2066
2187
|
|
|
@@ -2076,15 +2197,15 @@
|
|
|
2076
2197
|
return (jsx(InputControl, { label: "\u041A\u0435\u043C \u0432\u044B\u0434\u0430\u043D", ...input, ...getValidation(field('dulIssuedBy'), validatorObj.dulIssuedBy, input?.required), onDaDataChange: onDaDataChange, daDataQueryPrefix: dulSubdivisionCode }));
|
|
2077
2198
|
});
|
|
2078
2199
|
|
|
2079
|
-
const DulNumberField = JSX(({ field, input }) => (jsx(
|
|
2200
|
+
const DulNumberField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041D\u043E\u043C\u0435\u0440 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", inputLength: 6, ...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required) })));
|
|
2080
2201
|
|
|
2081
|
-
const DulSerieField = JSX(({ field, input }) => (jsx(
|
|
2202
|
+
const DulSerieField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u0421\u0435\u0440\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", inputLength: 4, ...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required) })));
|
|
2082
2203
|
|
|
2083
2204
|
const DulSubdivisionCodeField = JSX(({ field, input }) => {
|
|
2084
2205
|
const onDaDataChange = useCallback((item) => {
|
|
2085
2206
|
field?.('dulIssuedBy')?.onChange?.(item?.data?.name);
|
|
2086
2207
|
}, []);
|
|
2087
|
-
return (jsx(
|
|
2208
|
+
return (jsx(InputNumberControl, { label: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F", ...input, inputLength: 6, ...getValidation(field('dulSubdivisionCode'), validatorObj.dulSubdivisionCode, input?.required), onDaDataChange: onDaDataChange }));
|
|
2088
2209
|
});
|
|
2089
2210
|
|
|
2090
2211
|
const EducationField = JSX(({ field, input }) => {
|
|
@@ -2114,9 +2235,9 @@
|
|
|
2114
2235
|
|
|
2115
2236
|
const ExpensesField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0440\u0430\u0441\u0445\u043E\u0434\u044B \u0432 \u043C\u0435\u0441\u044F\u0446", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", type: "number", ...getValidation(field('expenses'), validatorObj.expenses, input?.required), ...input })));
|
|
2116
2237
|
|
|
2117
|
-
const Experience5YearsField = JSX(({ field, input }) => (jsx(
|
|
2238
|
+
const Experience5YearsField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", inputLength: 2, ...getValidation(field('experience5Years'), validatorObj.experience5Years, input?.required), ...input })));
|
|
2118
2239
|
|
|
2119
|
-
const FamilyMembersField = JSX(({ field, input }) => (jsx(
|
|
2240
|
+
const FamilyMembersField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0447\u043B\u0435\u043D\u043E\u0432 \u0441\u0435\u043C\u044C\u0438", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", inputLength: 2, ...getValidation(field('familyMembers'), validatorObj.familyMembers, input?.required), ...input })));
|
|
2120
2241
|
|
|
2121
2242
|
const FamilyStatusField = JSX(({ field, input }) => {
|
|
2122
2243
|
const { data: familyStatus } = useLeadFormData('MARITAL_STATUS');
|
|
@@ -2142,7 +2263,7 @@
|
|
|
2142
2263
|
|
|
2143
2264
|
const FullNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E", ...getValidation(field('fullName'), validatorObj.fullName, input?.required), ...input })));
|
|
2144
2265
|
|
|
2145
|
-
const GeneralSeniorityField = JSX(({ field, input }) => (jsx(
|
|
2266
|
+
const GeneralSeniorityField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", inputLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...getValidation(field('generalSeniority'), validatorObj.generalSeniority, input?.required), ...input })));
|
|
2146
2267
|
|
|
2147
2268
|
const HousingField = JSX(({ field, input }) => {
|
|
2148
2269
|
const { data: housing } = useLeadFormData('HOUSE_TYPE');
|
|
@@ -2154,14 +2275,14 @@
|
|
|
2154
2275
|
field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
|
|
2155
2276
|
field?.('legalForm')?.onChange?.(item.data?.opf?.short);
|
|
2156
2277
|
}, []);
|
|
2157
|
-
return (jsx(
|
|
2278
|
+
return (jsx(InputNumberControl, { label: "\u0418\u041D\u041D", inputLength: 12, ...input, ...getValidation(field('inn'), validatorObj.inn, input?.required), onDaDataChange: onDaDataChange }));
|
|
2158
2279
|
});
|
|
2159
2280
|
|
|
2160
2281
|
const IsClientField = JSX(({ field }) => (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })));
|
|
2161
2282
|
|
|
2162
|
-
const JobsNumberField = JSX(({ field, input }) => (jsx(
|
|
2283
|
+
const JobsNumberField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442 \u0440\u0430\u0431\u043E\u0442\u044B \u0437\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442", inputLength: 2, ...getValidation(field('jobsNumber'), validatorObj.jobsNumber, input?.required), ...input })));
|
|
2163
2284
|
|
|
2164
|
-
const LastJobExperienceField = JSX(({ field, input }) => (jsx(
|
|
2285
|
+
const LastJobExperienceField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", inputLength: 2, ...getValidation(field('lastJobExperience'), validatorObj.lastJobExperience, input?.required), ...input })));
|
|
2165
2286
|
|
|
2166
2287
|
const LegalEntityNameField = JSX(({ field, input }) => {
|
|
2167
2288
|
return (jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430", ...input, ...getValidation(field('legalEntityName'), validatorObj.legalEntityName, input?.required) }));
|
|
@@ -2222,23 +2343,25 @@
|
|
|
2222
2343
|
|
|
2223
2344
|
const ParticipantDateRegistrationField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E \u043C\u0435\u0441\u0442\u0443 \u0436\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430", ...getValidation(field('participantDateRegistration'), validatorObj.participantDateRegistration, input?.required) })));
|
|
2224
2345
|
|
|
2346
|
+
const PartInBusinessField = JSX(({ field, input }) => (jsx(InputNumberControl, { label: "\u0414\u043E\u043B\u044F \u0443\u0447\u0430\u0441\u0442\u0438\u044F \u0432 \u0431\u0438\u0437\u043D\u0435\u0441\u0435", placeholder: "\u0432 %", inputLength: 2, ...getValidation(field('partInBusiness'), validatorObj.partInBusiness, input?.required), ...input })));
|
|
2347
|
+
|
|
2225
2348
|
const PartnerCommentsField = JSX(({ field, input }) => {
|
|
2226
2349
|
const { required, ...rest } = input;
|
|
2227
2350
|
return (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...rest }));
|
|
2228
2351
|
});
|
|
2229
2352
|
|
|
2230
|
-
const isPlaceholder
|
|
2231
|
-
const isDigit
|
|
2232
|
-
const isWildcard
|
|
2353
|
+
const isPlaceholder = (_) => _ === '_';
|
|
2354
|
+
const isDigit = (_) => /\d/.test(_);
|
|
2355
|
+
const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
|
|
2233
2356
|
const phonePattern = [...'+7 (___) ___-__-__'];
|
|
2234
|
-
const firstPlaceholderIndex
|
|
2235
|
-
const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard
|
|
2357
|
+
const firstPlaceholderIndex = phonePattern.findIndex(isPlaceholder);
|
|
2358
|
+
const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard(_) ? phonePattern.slice(0, i).filter(isWildcard).length : -1);
|
|
2236
2359
|
function normalizePhone(phone) {
|
|
2237
2360
|
const phoneNumbers = phone.replace(/\D/g, '');
|
|
2238
|
-
const applyPlaceholder = (_, i) => isDigit
|
|
2361
|
+
const applyPlaceholder = (_, i) => isDigit(_) ? _ : phoneNumbers.charAt(phoneWildcardIndicies[i]) || _;
|
|
2239
2362
|
const result = phonePattern.map(applyPlaceholder);
|
|
2240
2363
|
const resultLength = phoneWildcardIndicies.indexOf(phoneNumbers.length - 1) + 1;
|
|
2241
|
-
return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex
|
|
2364
|
+
return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
|
|
2242
2365
|
}
|
|
2243
2366
|
|
|
2244
2367
|
const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
|
|
@@ -2312,28 +2435,8 @@
|
|
|
2312
2435
|
|
|
2313
2436
|
const ShareholderFlgField = JSX(({ field }) => (jsx(CheckboxWithError, { text: "\u042F \u044F\u0432\u043B\u044F\u044E\u0441\u044C \u0430\u043A\u0446\u0438\u043E\u043D\u0435\u0440\u043E\u043C / \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u043E\u043C / \u0447\u043B\u0435\u043D\u043E\u043C / \u043F\u0430\u0439\u0449\u0438\u043A\u043E\u043C / \u0432\u043A\u043B\u0430\u0434\u0447\u0438\u043A\u043E\u043C \u0441 \u0434\u043E\u043B\u0435\u0439 \u0443\u0447\u0430\u0441\u0442\u0438\u044F \u0431\u043E\u043B\u0435\u0435 20% \u0443\u0441\u0442\u0430\u0432\u043D\u043E\u0433\u043E \u043A\u0430\u043F\u0438\u0442\u0430\u043B\u0430 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430", ...getValidation(field('shareholderFlg'), validatorObj.shareholderFlg) })));
|
|
2314
2437
|
|
|
2315
|
-
const isPlaceholder = (_) => _ === '_';
|
|
2316
|
-
const isDigit = (_) => /\d/.test(_);
|
|
2317
|
-
const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
|
|
2318
|
-
const snilsPattern = [...'___-___-___ __'];
|
|
2319
|
-
const firstPlaceholderIndex = snilsPattern.findIndex(isPlaceholder);
|
|
2320
|
-
const snilsWildcardIndicies = snilsPattern.map((_, i) => isWildcard(_) ? snilsPattern.slice(0, i).filter(isWildcard).length : -1);
|
|
2321
|
-
function normalizeSnils(snils) {
|
|
2322
|
-
const snilsNumbers = snils.replace(/\D/g, '');
|
|
2323
|
-
const applyPlaceholder = (_, i) => isDigit(_) ? _ : snilsNumbers.charAt(snilsWildcardIndicies[i]) || _;
|
|
2324
|
-
const result = snilsPattern.map(applyPlaceholder);
|
|
2325
|
-
const resultLength = snilsWildcardIndicies.indexOf(snilsNumbers.length - 1) + 1;
|
|
2326
|
-
const isCursorStart = snilsNumbers.length === 0;
|
|
2327
|
-
if (!isCursorStart) {
|
|
2328
|
-
return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
|
|
2329
|
-
}
|
|
2330
|
-
else {
|
|
2331
|
-
return '';
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
|
|
2335
2438
|
const SnilsInput = JSX(({ children, onChange, ...inputProps }) => {
|
|
2336
|
-
const handleChange = useCallback((v) => onChange && onChange(
|
|
2439
|
+
const handleChange = useCallback((v) => onChange && onChange(normalizeWithMask(v, '___-___-___ __')), [onChange]);
|
|
2337
2440
|
const handleBlur = useCallback((v) => {
|
|
2338
2441
|
if (v === '___-___-___ __') {
|
|
2339
2442
|
onChange && onChange('');
|
|
@@ -2469,6 +2572,7 @@
|
|
|
2469
2572
|
legalEntityName: jsx(LegalEntityNameField, { field: field, input: input }),
|
|
2470
2573
|
creditInRshbCd: jsx(CreditInRshbCdField, { field: field, input: input }),
|
|
2471
2574
|
bankEmployeeCode: jsx(BankEmpoleeCodeField, { field: field, input: input }),
|
|
2575
|
+
partInBusiness: jsx(PartInBusinessField, { field: field, input: input }),
|
|
2472
2576
|
};
|
|
2473
2577
|
return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name] }, String(i))) : null;
|
|
2474
2578
|
};
|
|
@@ -2594,7 +2698,7 @@
|
|
|
2594
2698
|
consentToReceiveMaterials: false,
|
|
2595
2699
|
consentDataProcessing: false,
|
|
2596
2700
|
};
|
|
2597
|
-
const getInitialFormState$
|
|
2701
|
+
const getInitialFormState$2 = (inputs, typeForm = '') => {
|
|
2598
2702
|
const formState = Object.fromEntries(inputs.map((_) => [
|
|
2599
2703
|
_.name,
|
|
2600
2704
|
(_.fieldType === 'ved' && _?.defaultValue) || initialFormState$1[_.name],
|
|
@@ -2619,7 +2723,7 @@
|
|
|
2619
2723
|
// eslint-disable-next-line max-lines-per-function
|
|
2620
2724
|
({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, ...rest }) => {
|
|
2621
2725
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
2622
|
-
const initialFormState = getInitialFormState$
|
|
2726
|
+
const initialFormState = getInitialFormState$2(inputs, typeForm);
|
|
2623
2727
|
const [responseType, setResponseType] = useState('');
|
|
2624
2728
|
const handleSubmit = useCallback(async (formData, ev) => {
|
|
2625
2729
|
const inputsFiltered = getFilteredInputs(inputs, formData);
|
|
@@ -2726,7 +2830,7 @@
|
|
|
2726
2830
|
});
|
|
2727
2831
|
const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", type: "button", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
|
|
2728
2832
|
|
|
2729
|
-
const renderInputs = ({ field, typeForm = '', inputs }) => {
|
|
2833
|
+
const renderInputs$1 = ({ field, typeForm = '', inputs }) => {
|
|
2730
2834
|
const { consentInputs, restInputs } = splitInputs(inputs || []);
|
|
2731
2835
|
return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm)));
|
|
2732
2836
|
};
|
|
@@ -2735,6 +2839,7 @@
|
|
|
2735
2839
|
restInputs: inputs?.filter((_) => !Object.keys(CONSENTS).includes(_.name)) || [],
|
|
2736
2840
|
});
|
|
2737
2841
|
|
|
2842
|
+
/* eslint-disable max-lines */
|
|
2738
2843
|
const initialFormState = {
|
|
2739
2844
|
typeForm: '',
|
|
2740
2845
|
region: { key: '', text: '' },
|
|
@@ -2767,9 +2872,9 @@
|
|
|
2767
2872
|
participantAddress: '',
|
|
2768
2873
|
participantDateRegistration: undefined,
|
|
2769
2874
|
};
|
|
2770
|
-
const getInitialFormState = (inputs, savedForm, typeForm = '') => {
|
|
2875
|
+
const getInitialFormState$1 = (inputs, savedForm, typeForm = '') => {
|
|
2771
2876
|
if (savedForm) {
|
|
2772
|
-
const formState = JSON.parse(savedForm);
|
|
2877
|
+
const formState = typeof savedForm === 'string' ? JSON.parse(savedForm) : savedForm;
|
|
2773
2878
|
formState.birthday = new Date(formState?.birthday || 0);
|
|
2774
2879
|
return formState;
|
|
2775
2880
|
}
|
|
@@ -2812,44 +2917,47 @@
|
|
|
2812
2917
|
};
|
|
2813
2918
|
};
|
|
2814
2919
|
|
|
2815
|
-
const getUpdateUserTaskData = ({ participantId, taskId, profileId, formData, }) =>
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
{
|
|
2833
|
-
contactTypeCd: {
|
|
2834
|
-
key: 'EMAIL',
|
|
2835
|
-
},
|
|
2836
|
-
value: formData?.email,
|
|
2920
|
+
const getUpdateUserTaskData = ({ participantId, taskId, profileId, formData, }) => {
|
|
2921
|
+
const { name = '', surname = '', middleName = '', birthday = '', phone = '', email = '', } = formData;
|
|
2922
|
+
return {
|
|
2923
|
+
sendToBank: true,
|
|
2924
|
+
taskKind: 'SHORT',
|
|
2925
|
+
task: {
|
|
2926
|
+
taskSource: globalThis.location.origin,
|
|
2927
|
+
id: taskId,
|
|
2928
|
+
participants: [
|
|
2929
|
+
{
|
|
2930
|
+
birthDate: formatDate(birthday, true),
|
|
2931
|
+
id: participantId,
|
|
2932
|
+
midname: middleName,
|
|
2933
|
+
name: name,
|
|
2934
|
+
surname: surname,
|
|
2935
|
+
profile: {
|
|
2936
|
+
id: profileId,
|
|
2837
2937
|
},
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2938
|
+
participantContacts: [
|
|
2939
|
+
{
|
|
2940
|
+
contactTypeCd: {
|
|
2941
|
+
key: 'EMAIL',
|
|
2942
|
+
},
|
|
2943
|
+
value: email,
|
|
2944
|
+
},
|
|
2945
|
+
{
|
|
2946
|
+
contactTypeCd: {
|
|
2947
|
+
key: 'MAIN_PHONE',
|
|
2948
|
+
},
|
|
2949
|
+
value: formatPhone(phone),
|
|
2841
2950
|
},
|
|
2842
|
-
|
|
2951
|
+
],
|
|
2952
|
+
roleCd: {
|
|
2953
|
+
key: 'BORROWER',
|
|
2954
|
+
value: 'Заемщик',
|
|
2843
2955
|
},
|
|
2844
|
-
],
|
|
2845
|
-
roleCd: {
|
|
2846
|
-
key: 'BORROWER',
|
|
2847
|
-
value: 'Заемщик',
|
|
2848
2956
|
},
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
}
|
|
2852
|
-
}
|
|
2957
|
+
],
|
|
2958
|
+
},
|
|
2959
|
+
};
|
|
2960
|
+
};
|
|
2853
2961
|
|
|
2854
2962
|
const ICON_SIZE$1 = { width: '103', height: '21' };
|
|
2855
2963
|
|
|
@@ -3261,7 +3369,7 @@
|
|
|
3261
3369
|
const [responseType, setResponseType] = useState('');
|
|
3262
3370
|
useInitApplicationLead();
|
|
3263
3371
|
const [leadForm, setLeadForm] = useLocalStorage('leadForm');
|
|
3264
|
-
const initialFormState = getInitialFormState(inputs, leadForm, typeForm);
|
|
3372
|
+
const initialFormState = getInitialFormState$1(inputs, leadForm, typeForm);
|
|
3265
3373
|
const { handleSubmit, responseStatus } = useApplicationLeadApi({
|
|
3266
3374
|
inputs,
|
|
3267
3375
|
programId,
|
|
@@ -3278,7 +3386,7 @@
|
|
|
3278
3386
|
reset();
|
|
3279
3387
|
}
|
|
3280
3388
|
}, [responseType]);
|
|
3281
|
-
return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs({ field,
|
|
3389
|
+
return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
|
|
3282
3390
|
});
|
|
3283
3391
|
|
|
3284
3392
|
const NotFound = JSX(({ title, description }) => {
|
|
@@ -4901,8 +5009,6 @@
|
|
|
4901
5009
|
}
|
|
4902
5010
|
}, type: "button", ...(isUnfolded ? getAspectsAttributes(data) : {}), children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
|
|
4903
5011
|
|
|
4904
|
-
const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black' }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsx(RichText, { __html: __html })] })));
|
|
4905
|
-
|
|
4906
5012
|
const ProgressBar = JSX(({ step = 10, description, showPercentage = true }) => (jsxs("div", { children: [jsx("div", { className: "h-4 w-full bg-gray relative", children: jsx("div", { className: "h-4 bg-green", style: { width: `${step}%` } }) }), jsxs("div", { className: "relative", children: [showPercentage ? jsxs("div", { className: "absolute left-2/4 text-green", children: [step, "%"] }) : null, description ? jsx("div", { className: "text-right mr-4 text-gray", children: description }) : null] })] })));
|
|
4907
5013
|
|
|
4908
5014
|
const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
|
|
@@ -4910,8 +5016,127 @@
|
|
|
4910
5016
|
return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold", children: ["\u0428\u0430\u0433 ", step, " \u0438\u0437 ", totalSteps, "."] }), ' ', stepsTitles[step - 1] || null, jsx(ProgressBar, { step: progress, showPercentage: false })] }) }));
|
|
4911
5017
|
});
|
|
4912
5018
|
|
|
5019
|
+
const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black', link }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsxs("div", { className: "", children: [jsx(RichText, { __html: __html }), link?.text ? jsx(LinkButton, { className: "text-primary-main", children: link.text }) : null] })] })));
|
|
5020
|
+
|
|
5021
|
+
const formStateMap = {
|
|
5022
|
+
1: {
|
|
5023
|
+
surname: '',
|
|
5024
|
+
name: '',
|
|
5025
|
+
middleName: '',
|
|
5026
|
+
sex: '',
|
|
5027
|
+
birthday: undefined,
|
|
5028
|
+
birthPlace: '',
|
|
5029
|
+
phone: '',
|
|
5030
|
+
email: '',
|
|
5031
|
+
dulSerie: undefined,
|
|
5032
|
+
dulNumber: undefined,
|
|
5033
|
+
dulIssueDateField: undefined,
|
|
5034
|
+
dulSubdivisionCode: '',
|
|
5035
|
+
dulIssuedBy: '',
|
|
5036
|
+
participantAddress: '',
|
|
5037
|
+
participantDateRegistration: undefined,
|
|
5038
|
+
fullAddress: '',
|
|
5039
|
+
housing: '',
|
|
5040
|
+
},
|
|
5041
|
+
2: {
|
|
5042
|
+
employment: { key: '', text: '' },
|
|
5043
|
+
organizationName: '',
|
|
5044
|
+
inn: undefined,
|
|
5045
|
+
legalForm: '',
|
|
5046
|
+
organization: { key: '', text: '' },
|
|
5047
|
+
amountWorkers: { key: '', text: '' },
|
|
5048
|
+
employerActivities: { key: '', text: '' },
|
|
5049
|
+
employerOrganization: { key: '', text: '' },
|
|
5050
|
+
lastJobExperience: '',
|
|
5051
|
+
experience5Years: '',
|
|
5052
|
+
jobsNumber: '',
|
|
5053
|
+
phone: '',
|
|
5054
|
+
beginDate: undefined,
|
|
5055
|
+
positionOrganization: { key: '', text: '' },
|
|
5056
|
+
partInBusiness: undefined,
|
|
5057
|
+
fullAddress: '',
|
|
5058
|
+
},
|
|
5059
|
+
3: {
|
|
5060
|
+
familyStatus: { key: '', text: '' },
|
|
5061
|
+
dependents: undefined,
|
|
5062
|
+
familyMembers: undefined,
|
|
5063
|
+
mandatoryIncome: undefined,
|
|
5064
|
+
otherPayments: undefined,
|
|
5065
|
+
snils: '',
|
|
5066
|
+
armyIdFlg: false,
|
|
5067
|
+
},
|
|
5068
|
+
4: {
|
|
5069
|
+
disablePeopleFlg: '',
|
|
5070
|
+
bankruptcyFlg: '',
|
|
5071
|
+
shareholderFlg: '',
|
|
5072
|
+
legalEntityName: '',
|
|
5073
|
+
creditInRshbCd: '',
|
|
5074
|
+
},
|
|
5075
|
+
5: {
|
|
5076
|
+
region: '',
|
|
5077
|
+
addressBranch: '',
|
|
5078
|
+
bankEmployeeCode: '',
|
|
5079
|
+
},
|
|
5080
|
+
};
|
|
5081
|
+
const getInitialFormState = (step, localStorageData) => {
|
|
5082
|
+
if (localStorageData) {
|
|
5083
|
+
// TODO: Fill in for other fields with type Date
|
|
5084
|
+
// TODO: Take it out to the helper
|
|
5085
|
+
localStorageData.birthday = localStorageData.dulIssueDateField = new Date(localStorageData?.birthday || Date.now());
|
|
5086
|
+
localStorageData.participantDateRegistration = new Date(localStorageData?.participantDateRegistration || Date.now());
|
|
5087
|
+
localStorageData.beginDate = new Date(localStorageData?.beginDate || Date.now());
|
|
5088
|
+
}
|
|
5089
|
+
return {
|
|
5090
|
+
...formStateMap[step],
|
|
5091
|
+
...localStorageData,
|
|
5092
|
+
};
|
|
5093
|
+
};
|
|
5094
|
+
|
|
5095
|
+
const renderInputs = ({ field, inputs }) => {
|
|
5096
|
+
return (inputs || [])?.map(getField(field, ''));
|
|
5097
|
+
};
|
|
5098
|
+
|
|
5099
|
+
const StepsNavigationButtons = JSX(({ step, onPrevStep }) => {
|
|
5100
|
+
return (jsxs("div", { className: 'flex justify-between', children: [jsx(Button, { onClick: onPrevStep, className: style('w-full @xl:w-auto'), type: "button", version: "secondary", disabled: step === 1, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { className: style('w-full @xl:w-auto'), type: "submit", children: "\u0414\u0430\u043B\u0435\u0435" })] }));
|
|
5101
|
+
});
|
|
5102
|
+
|
|
5103
|
+
const useCreditFormApi = ({ inputs, onNextStep, saveStep }) => {
|
|
5104
|
+
const handleSubmit = useCallback(async (formData) => {
|
|
5105
|
+
const feedbackValidator = objectValidator(getObjectValidator(inputs));
|
|
5106
|
+
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
5107
|
+
return 'Fail';
|
|
5108
|
+
}
|
|
5109
|
+
saveStep(formData);
|
|
5110
|
+
onNextStep();
|
|
5111
|
+
return 'OK';
|
|
5112
|
+
}, []);
|
|
5113
|
+
return {
|
|
5114
|
+
handleSubmit,
|
|
5115
|
+
};
|
|
5116
|
+
};
|
|
5117
|
+
|
|
5118
|
+
const CreditFormStep = JSX(({ totalSteps, step, sections, onPrevStep, onNextStep, inputs }) => {
|
|
5119
|
+
const [localStorageData, saveStep] = useLocalStorage('leadForm');
|
|
5120
|
+
const initialState = getInitialFormState(step, localStorageData);
|
|
5121
|
+
const { handleSubmit } = useCreditFormApi({
|
|
5122
|
+
inputs,
|
|
5123
|
+
onNextStep: onNextStep,
|
|
5124
|
+
saveStep,
|
|
5125
|
+
});
|
|
5126
|
+
const [, { field, onSubmit }] = useForm(initialState, { onSubmit: handleSubmit });
|
|
5127
|
+
return (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep({ sections, field }), jsx(StepsNavigationButtons, { step: step, totalSteps: totalSteps, onPrevStep: onPrevStep })] }));
|
|
5128
|
+
});
|
|
5129
|
+
const renderStep = ({ sections, field }) => {
|
|
5130
|
+
return sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderInfo$1(_?.inputs), renderTitle(_?.title), renderInputs({ field, inputs: _?.inputs })] }, `section-${i}`)));
|
|
5131
|
+
};
|
|
5132
|
+
const renderInfo$1 = (inputs = []) => {
|
|
5133
|
+
const infoInputs = inputs.filter((_) => _.fieldType === 'info');
|
|
5134
|
+
return infoInputs.length ? infoInputs.map(({ text }) => jsx(InfoCard, { __html: text })) : null;
|
|
5135
|
+
};
|
|
5136
|
+
|
|
4913
5137
|
/* eslint-disable max-lines */
|
|
4914
5138
|
/* eslint-disable max-len */
|
|
5139
|
+
//TODO: DO List
|
|
4915
5140
|
const stepsSectionsMap = {
|
|
4916
5141
|
1: [
|
|
4917
5142
|
{
|
|
@@ -4944,24 +5169,27 @@
|
|
|
4944
5169
|
{
|
|
4945
5170
|
fieldType: 'common',
|
|
4946
5171
|
name: 'education',
|
|
4947
|
-
required: true,
|
|
4948
5172
|
},
|
|
4949
5173
|
],
|
|
4950
5174
|
},
|
|
4951
5175
|
{
|
|
4952
5176
|
title: 'Адрес регистрации по месту жительства',
|
|
5177
|
+
columns: 1,
|
|
5178
|
+
inputs: [],
|
|
5179
|
+
},
|
|
5180
|
+
{
|
|
5181
|
+
inputs: [{ fieldType: 'common', name: 'participantAddress', required: true, dadata: true }],
|
|
5182
|
+
},
|
|
5183
|
+
{
|
|
4953
5184
|
columns: 2,
|
|
4954
|
-
inputs: [
|
|
4955
|
-
{ fieldType: 'common', name: 'participantAddress', required: true },
|
|
4956
|
-
{ fieldType: 'common', name: 'participantAddress', required: true, dadata: true },
|
|
4957
|
-
],
|
|
5185
|
+
inputs: [{ fieldType: 'common', name: 'participantDateRegistration', required: true }],
|
|
4958
5186
|
},
|
|
4959
5187
|
{
|
|
4960
5188
|
title: 'Адрес фактического проживания (место пребывания РФ)',
|
|
4961
5189
|
columns: 2,
|
|
4962
5190
|
inputs: [
|
|
4963
5191
|
{ fieldType: 'common', name: 'fullAddress', required: true, dadata: true },
|
|
4964
|
-
{ fieldType: 'common', name: 'housing'
|
|
5192
|
+
{ fieldType: 'common', name: 'housing' },
|
|
4965
5193
|
],
|
|
4966
5194
|
},
|
|
4967
5195
|
],
|
|
@@ -4980,7 +5208,7 @@
|
|
|
4980
5208
|
},
|
|
4981
5209
|
{
|
|
4982
5210
|
inputs: [
|
|
4983
|
-
{ fieldType: 'common', name: 'employment'
|
|
5211
|
+
{ fieldType: 'common', name: 'employment' },
|
|
4984
5212
|
{ fieldType: 'common', name: 'organizationName', required: true, dadata: true },
|
|
4985
5213
|
],
|
|
4986
5214
|
},
|
|
@@ -4993,15 +5221,15 @@
|
|
|
4993
5221
|
},
|
|
4994
5222
|
{
|
|
4995
5223
|
inputs: [
|
|
4996
|
-
{ fieldType: 'common', name: 'organization', required:
|
|
4997
|
-
{ fieldType: 'common', name: 'amountWorkers', required:
|
|
5224
|
+
{ fieldType: 'common', name: 'organization', required: false },
|
|
5225
|
+
{ fieldType: 'common', name: 'amountWorkers', required: false },
|
|
4998
5226
|
],
|
|
4999
5227
|
},
|
|
5000
5228
|
{
|
|
5001
5229
|
columns: 2,
|
|
5002
5230
|
inputs: [
|
|
5003
|
-
{ fieldType: 'common', name: 'employerActivities', required:
|
|
5004
|
-
{ fieldType: 'common', name: 'employerOrganization', required:
|
|
5231
|
+
{ fieldType: 'common', name: 'employerActivities', required: false },
|
|
5232
|
+
{ fieldType: 'common', name: 'employerOrganization', required: false },
|
|
5005
5233
|
{ fieldType: 'common', name: 'generalSeniority', required: true },
|
|
5006
5234
|
{ fieldType: 'common', name: 'lastJobExperience', required: true },
|
|
5007
5235
|
{ fieldType: 'common', name: 'experience5Years', required: true },
|
|
@@ -5012,7 +5240,13 @@
|
|
|
5012
5240
|
inputs: [
|
|
5013
5241
|
{ fieldType: 'common', name: 'phone', label: 'Телефон работодателя', required: true },
|
|
5014
5242
|
{ fieldType: 'common', name: 'beginDate', required: true },
|
|
5015
|
-
|
|
5243
|
+
],
|
|
5244
|
+
},
|
|
5245
|
+
{
|
|
5246
|
+
columns: 2,
|
|
5247
|
+
inputs: [
|
|
5248
|
+
{ fieldType: 'common', name: 'positionOrganization', required: false },
|
|
5249
|
+
{ fieldType: 'common', name: 'partInBusiness', required: true },
|
|
5016
5250
|
],
|
|
5017
5251
|
},
|
|
5018
5252
|
{
|
|
@@ -5029,20 +5263,15 @@
|
|
|
5029
5263
|
},
|
|
5030
5264
|
{
|
|
5031
5265
|
columns: 1,
|
|
5032
|
-
inputs: [{ fieldType: 'common', name: 'familyStatus' }],
|
|
5266
|
+
inputs: [{ fieldType: 'common', name: 'familyStatus', required: true }],
|
|
5033
5267
|
},
|
|
5034
5268
|
{
|
|
5035
5269
|
columns: 1,
|
|
5036
|
-
inputs: [{ fieldType: 'common', name: 'dependents' }],
|
|
5270
|
+
inputs: [{ fieldType: 'common', name: 'dependents', required: true }],
|
|
5037
5271
|
},
|
|
5038
5272
|
{
|
|
5039
|
-
columns:
|
|
5040
|
-
inputs: [
|
|
5041
|
-
{ fieldType: 'common', name: 'familyMembers' },
|
|
5042
|
-
{ fieldType: 'common', name: 'familyMembers' },
|
|
5043
|
-
{ fieldType: 'common', name: 'retirementIncome' },
|
|
5044
|
-
{ fieldType: 'common', name: 'otherIncome' },
|
|
5045
|
-
],
|
|
5273
|
+
columns: 1,
|
|
5274
|
+
inputs: [{ fieldType: 'common', name: 'familyMembers', required: true }],
|
|
5046
5275
|
},
|
|
5047
5276
|
{
|
|
5048
5277
|
title: 'Совокупный доход',
|
|
@@ -5057,15 +5286,15 @@
|
|
|
5057
5286
|
},
|
|
5058
5287
|
{
|
|
5059
5288
|
columns: 1,
|
|
5060
|
-
inputs: [{ fieldType: 'common', name: 'mandatoryIncome' }],
|
|
5289
|
+
inputs: [{ fieldType: 'common', name: 'mandatoryIncome', required: true }],
|
|
5061
5290
|
},
|
|
5062
5291
|
{
|
|
5063
5292
|
columns: 1,
|
|
5064
|
-
inputs: [{ fieldType: 'common', name: 'otherPayments' }],
|
|
5293
|
+
inputs: [{ fieldType: 'common', name: 'otherPayments', required: true }],
|
|
5065
5294
|
},
|
|
5066
5295
|
{
|
|
5067
5296
|
columns: 1,
|
|
5068
|
-
inputs: [{ fieldType: 'common', name: 'snils' }],
|
|
5297
|
+
inputs: [{ fieldType: 'common', name: 'snils', required: true }],
|
|
5069
5298
|
},
|
|
5070
5299
|
{
|
|
5071
5300
|
columns: 2,
|
|
@@ -5101,10 +5330,10 @@
|
|
|
5101
5330
|
inputs: [],
|
|
5102
5331
|
},
|
|
5103
5332
|
{
|
|
5104
|
-
inputs: [{ fieldType: 'common', name: 'region' }],
|
|
5333
|
+
inputs: [{ fieldType: 'common', name: 'region', required: true }],
|
|
5105
5334
|
},
|
|
5106
5335
|
{
|
|
5107
|
-
inputs: [{ fieldType: 'common', name: 'addressBranch' }],
|
|
5336
|
+
inputs: [{ fieldType: 'common', name: 'addressBranch', required: true }],
|
|
5108
5337
|
},
|
|
5109
5338
|
{
|
|
5110
5339
|
title: 'Код представителя Банка',
|
|
@@ -5125,20 +5354,6 @@
|
|
|
5125
5354
|
],
|
|
5126
5355
|
};
|
|
5127
5356
|
|
|
5128
|
-
const StepsNavigationButtons = JSX(({ step, setStep, totalSteps }) => {
|
|
5129
|
-
const handleNext = () => {
|
|
5130
|
-
if (step < totalSteps) {
|
|
5131
|
-
setStep(step + 1);
|
|
5132
|
-
}
|
|
5133
|
-
};
|
|
5134
|
-
const handlePrev = () => {
|
|
5135
|
-
if (step > 1) {
|
|
5136
|
-
setStep(step - 1);
|
|
5137
|
-
}
|
|
5138
|
-
};
|
|
5139
|
-
return (jsxs("div", { className: 'flex justify-between', children: [jsx(Button, { onClick: handlePrev, className: style('w-full @xl:w-auto'), type: "button", version: "secondary", disabled: step === 1, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { onClick: handleNext, className: style('w-full @xl:w-auto'), type: "button", disabled: step === totalSteps, children: "\u0414\u0430\u043B\u0435\u0435" })] }));
|
|
5140
|
-
});
|
|
5141
|
-
|
|
5142
5357
|
const STEPS_COUNT = 5;
|
|
5143
5358
|
const STEPS_TITLES = [
|
|
5144
5359
|
'Персональные данные',
|
|
@@ -5147,21 +5362,19 @@
|
|
|
5147
5362
|
'Дополнительные сведения',
|
|
5148
5363
|
'Отделение Банка',
|
|
5149
5364
|
];
|
|
5150
|
-
const CreditForm = JSX(({ className,
|
|
5365
|
+
const CreditForm = JSX(({ className, ...rest }) => {
|
|
5151
5366
|
const [step, setStep] = useState(1);
|
|
5367
|
+
const sections = useMemo(() => stepsSectionsMap[step], [step]);
|
|
5152
5368
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
5153
|
-
const
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5369
|
+
const handleNextStep = useCallback(() => {
|
|
5370
|
+
setStep((_) => Math.min(_ + 1, STEPS_COUNT));
|
|
5371
|
+
}, []);
|
|
5372
|
+
const handlePrevStep = useCallback(() => {
|
|
5373
|
+
//TODO search hook - 1,
|
|
5374
|
+
setStep((_) => Math.max(_ - 1, 0));
|
|
5375
|
+
}, []);
|
|
5376
|
+
return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container grid grid-cols-12", children: [jsx(CreditFormProgress, { stepsTitles: STEPS_TITLES, step: step, totalSteps: STEPS_COUNT }), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { inputs: inputs, totalSteps: STEPS_COUNT, step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep }, String(step)) })] }) }));
|
|
5157
5377
|
});
|
|
5158
|
-
const renderStep = ({ sections, field, typeForm }) => {
|
|
5159
|
-
return sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderInfo$1(_?.inputs), renderTitle(_?.title), renderInputs({ field, typeForm, inputs: _?.inputs })] }, `section-${i}`)));
|
|
5160
|
-
};
|
|
5161
|
-
const renderInfo$1 = (inputs = []) => {
|
|
5162
|
-
const infoInputs = inputs.filter((_) => _.fieldType === 'info');
|
|
5163
|
-
return infoInputs.length ? infoInputs.map(({ text }) => jsx(InfoCard, { __html: text })) : null;
|
|
5164
|
-
};
|
|
5165
5378
|
|
|
5166
5379
|
const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
|
|
5167
5380
|
|
|
@@ -7588,7 +7801,7 @@
|
|
|
7588
7801
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7589
7802
|
});
|
|
7590
7803
|
|
|
7591
|
-
const packageVersion = "0.14.
|
|
7804
|
+
const packageVersion = "0.14.615";
|
|
7592
7805
|
|
|
7593
7806
|
exports.Blocks = Blocks;
|
|
7594
7807
|
exports.ContentPage = ContentPage;
|