@redneckz/wildless-cms-uni-blocks 0.14.822 → 0.14.824
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/bundle.umd.js +259 -191
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/bundle/retail/api/checkCode.d.ts +1 -0
- package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
- package/bundle/retail/api/updateUserTask.d.ts +1 -0
- package/bundle/retail/api/uploadFile.d.ts +1 -1
- package/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/bundle/retail/validator/validators.d.ts +2 -0
- package/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
- package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/retail/api/checkCode.d.ts +1 -0
- package/dist/retail/api/checkCode.js +3 -2
- package/dist/retail/api/checkCode.js.map +1 -1
- package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/dist/retail/api/esiaRequestProfile.js +10 -0
- package/dist/retail/api/esiaRequestProfile.js.map +1 -0
- package/dist/retail/api/updateUserTask.d.ts +1 -0
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/api/uploadFile.d.ts +1 -1
- package/dist/retail/api/uploadFile.js +2 -3
- package/dist/retail/api/uploadFile.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/components/Fields/BeginDateField.js +2 -1
- package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
- package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/dist/retail/components/Fields/DaDataInnField.js +2 -1
- package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/dist/retail/components/Fields/DeliveryDateFiels.js +1 -1
- package/dist/retail/components/Fields/DeliveryDateFiels.js.map +1 -1
- package/dist/retail/components/Fields/DulIssueDateField.js +6 -1
- package/dist/retail/components/Fields/DulIssueDateField.js.map +1 -1
- package/dist/retail/components/Fields/Experience5YearsField.js +2 -1
- package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/dist/retail/components/Fields/JobsNumberField.js +2 -1
- package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/dist/retail/components/Fields/MiddleNameField.js +10 -1
- package/dist/retail/components/Fields/MiddleNameField.js.map +1 -1
- package/dist/retail/components/Fields/NameField.js +10 -1
- package/dist/retail/components/Fields/NameField.js.map +1 -1
- package/dist/retail/components/Fields/OrganizationNameField.js +2 -1
- package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/dist/retail/components/Fields/SurnameField.js +10 -1
- package/dist/retail/components/Fields/SurnameField.js.map +1 -1
- package/dist/retail/components/Fields/WagesField.js +2 -1
- package/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/dist/retail/content.js +11 -5
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/dist/retail/utils/mainFormStateMap.js +1 -0
- package/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/dist/retail/validator/validatorObj.js +3 -0
- package/dist/retail/validator/validatorObj.js.map +1 -1
- package/dist/retail/validator/validators.d.ts +2 -0
- package/dist/retail/validator/validators.js +4 -1
- package/dist/retail/validator/validators.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
- package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/retail/api/checkCode.d.ts +1 -0
- package/lib/retail/api/checkCode.js +1 -1
- package/lib/retail/api/checkCode.js.map +1 -1
- package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/lib/retail/api/esiaRequestProfile.js +7 -0
- package/lib/retail/api/esiaRequestProfile.js.map +1 -0
- package/lib/retail/api/updateUserTask.d.ts +1 -0
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/api/uploadFile.d.ts +1 -1
- package/lib/retail/api/uploadFile.js +2 -3
- package/lib/retail/api/uploadFile.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/components/Fields/BeginDateField.js +2 -1
- package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
- package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/lib/retail/components/Fields/DaDataInnField.js +2 -1
- package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/lib/retail/components/Fields/DeliveryDateFiels.js +1 -1
- package/lib/retail/components/Fields/DeliveryDateFiels.js.map +1 -1
- package/lib/retail/components/Fields/DulIssueDateField.js +6 -1
- package/lib/retail/components/Fields/DulIssueDateField.js.map +1 -1
- package/lib/retail/components/Fields/Experience5YearsField.js +2 -1
- package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/lib/retail/components/Fields/JobsNumberField.js +2 -1
- package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/lib/retail/components/Fields/MiddleNameField.js +10 -1
- package/lib/retail/components/Fields/MiddleNameField.js.map +1 -1
- package/lib/retail/components/Fields/NameField.js +10 -1
- package/lib/retail/components/Fields/NameField.js.map +1 -1
- package/lib/retail/components/Fields/OrganizationNameField.js +2 -1
- package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/lib/retail/components/Fields/SurnameField.js +10 -1
- package/lib/retail/components/Fields/SurnameField.js.map +1 -1
- package/lib/retail/components/Fields/WagesField.js +2 -1
- package/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/lib/retail/content.js +11 -5
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/lib/retail/utils/mainFormStateMap.js +1 -0
- package/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/lib/retail/validator/validatorObj.js +4 -1
- package/lib/retail/validator/validatorObj.js.map +1 -1
- package/lib/retail/validator/validators.d.ts +2 -0
- package/lib/retail/validator/validators.js +2 -0
- package/lib/retail/validator/validators.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +259 -191
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
- package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
- package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/retail/validator/validators.d.ts +2 -0
- package/mobile/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/retail/api/checkCode.d.ts +1 -0
- package/mobile/dist/retail/api/checkCode.js +3 -2
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
- package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
- package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
- package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
- package/mobile/dist/retail/api/uploadFile.js +2 -3
- package/mobile/dist/retail/api/uploadFile.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/components/Fields/BeginDateField.js +2 -1
- package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js +2 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DeliveryDateFiels.js +1 -1
- package/mobile/dist/retail/components/Fields/DeliveryDateFiels.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DulIssueDateField.js +6 -1
- package/mobile/dist/retail/components/Fields/DulIssueDateField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js +2 -1
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/JobsNumberField.js +2 -1
- package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/MiddleNameField.js +10 -1
- package/mobile/dist/retail/components/Fields/MiddleNameField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/NameField.js +10 -1
- package/mobile/dist/retail/components/Fields/NameField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js +2 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/SurnameField.js +10 -1
- package/mobile/dist/retail/components/Fields/SurnameField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/WagesField.js +2 -1
- package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/dist/retail/content.js +11 -5
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
- package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/dist/retail/validator/validatorObj.js +3 -0
- package/mobile/dist/retail/validator/validatorObj.js.map +1 -1
- package/mobile/dist/retail/validator/validators.d.ts +2 -0
- package/mobile/dist/retail/validator/validators.js +4 -1
- package/mobile/dist/retail/validator/validators.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/retail/api/checkCode.d.ts +1 -0
- package/mobile/lib/retail/api/checkCode.js +1 -1
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
- package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
- package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
- package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
- package/mobile/lib/retail/api/uploadFile.js +2 -3
- package/mobile/lib/retail/api/uploadFile.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/components/Fields/BeginDateField.js +2 -1
- package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js +2 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DeliveryDateFiels.js +1 -1
- package/mobile/lib/retail/components/Fields/DeliveryDateFiels.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DulIssueDateField.js +6 -1
- package/mobile/lib/retail/components/Fields/DulIssueDateField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js +2 -1
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/JobsNumberField.js +2 -1
- package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/MiddleNameField.js +10 -1
- package/mobile/lib/retail/components/Fields/MiddleNameField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/NameField.js +10 -1
- package/mobile/lib/retail/components/Fields/NameField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js +2 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/SurnameField.js +10 -1
- package/mobile/lib/retail/components/Fields/SurnameField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/WagesField.js +2 -1
- package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/lib/retail/content.js +11 -5
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
- package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/lib/retail/validator/validatorObj.js +4 -1
- package/mobile/lib/retail/validator/validatorObj.js.map +1 -1
- package/mobile/lib/retail/validator/validators.d.ts +2 -0
- package/mobile/lib/retail/validator/validators.js +2 -0
- package/mobile/lib/retail/validator/validators.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
- package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -65
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
- package/mobile/src/retail/api/checkCode.ts +1 -1
- package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
- package/mobile/src/retail/api/updateUserTask.ts +1 -0
- package/mobile/src/retail/api/uploadFile.ts +2 -3
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
- package/mobile/src/retail/components/Fields/BeginDateField.tsx +2 -0
- package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
- package/mobile/src/retail/components/Fields/DaDataInnField.tsx +2 -0
- package/mobile/src/retail/components/Fields/DeliveryDateFiels.tsx +1 -1
- package/mobile/src/retail/components/Fields/DulIssueDateField.tsx +17 -7
- package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
- package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
- package/mobile/src/retail/components/Fields/JobsNumberField.tsx +2 -0
- package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
- package/mobile/src/retail/components/Fields/MiddleNameField.tsx +23 -9
- package/mobile/src/retail/components/Fields/NameField.tsx +23 -9
- package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
- package/mobile/src/retail/components/Fields/SurnameField.tsx +23 -9
- package/mobile/src/retail/components/Fields/WagesField.tsx +2 -0
- package/mobile/src/retail/content.tsx +11 -5
- package/mobile/src/retail/model/NameFieldDef.ts +1 -0
- package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
- package/mobile/src/retail/validator/validatorObj.ts +4 -0
- package/mobile/src/retail/validator/validators.ts +7 -0
- package/mobile/src/ui-kit/DatePicker/DatePickerControl.tsx +3 -1
- package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
- package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
- package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -65
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
- package/src/retail/api/checkCode.ts +1 -1
- package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
- package/src/retail/api/updateUserTask.ts +1 -0
- package/src/retail/api/uploadFile.ts +2 -3
- package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
- package/src/retail/components/Fields/BeginDateField.tsx +2 -0
- package/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
- package/src/retail/components/Fields/DaDataInnField.tsx +2 -0
- package/src/retail/components/Fields/DeliveryDateFiels.tsx +1 -1
- package/src/retail/components/Fields/DulIssueDateField.tsx +17 -7
- package/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
- package/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
- package/src/retail/components/Fields/JobsNumberField.tsx +2 -0
- package/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
- package/src/retail/components/Fields/MiddleNameField.tsx +23 -9
- package/src/retail/components/Fields/NameField.tsx +23 -9
- package/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
- package/src/retail/components/Fields/SurnameField.tsx +23 -9
- package/src/retail/components/Fields/WagesField.tsx +2 -0
- package/src/retail/content.tsx +11 -5
- package/src/retail/model/NameFieldDef.ts +1 -0
- package/src/retail/utils/mainFormStateMap.ts +1 -0
- package/src/retail/validator/validatorObj.ts +4 -0
- package/src/retail/validator/validators.ts +7 -0
- package/src/ui-kit/DatePicker/DatePickerControl.tsx +3 -1
- package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
- package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
- package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/dist/retail/api/updateProfileEsia.js +0 -6
- package/dist/retail/api/updateProfileEsia.js.map +0 -1
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/lib/retail/api/updateProfileEsia.js +0 -3
- package/lib/retail/api/updateProfileEsia.js.map +0 -1
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +0 -5
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
- package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
- package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
- package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
- package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
- package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
- package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
|
@@ -2030,7 +2030,7 @@
|
|
|
2030
2030
|
|
|
2031
2031
|
const PhoneField = JSX(({ field, input }) => {
|
|
2032
2032
|
const fieldName = input?.name || 'phone';
|
|
2033
|
-
return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...field(fieldName), ...input });
|
|
2033
|
+
return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(fieldName), ...input }));
|
|
2034
2034
|
});
|
|
2035
2035
|
|
|
2036
2036
|
const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
|
|
@@ -2210,7 +2210,7 @@
|
|
|
2210
2210
|
function shouldRenderField({ input, field, }) {
|
|
2211
2211
|
const { condition } = input;
|
|
2212
2212
|
const { value } = field(condition?.name || '');
|
|
2213
|
-
return !condition || condition?.values?.
|
|
2213
|
+
return !condition || condition?.values?.includes(value?.key ?? value);
|
|
2214
2214
|
}
|
|
2215
2215
|
|
|
2216
2216
|
const PRODUCT_REF = {
|
|
@@ -2437,10 +2437,12 @@
|
|
|
2437
2437
|
|
|
2438
2438
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
2439
2439
|
const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
|
|
2440
|
+
const retailCyrillicPattern = /^[\u0400-\u04FF-\s]+$/u;
|
|
2440
2441
|
const addressDaDataValidate = (address) => Boolean(address.region && (address.city || address.locality) && address.house);
|
|
2441
2442
|
const addressDaDataValidator = () => validator(addressDaDataValidate)(ADDRESS_ERROR_MESSAGE);
|
|
2442
2443
|
const addressOrganizationValidator = () => validator((address) => Boolean(address.fiasCode && (address.city || address.locality) && address.house))(ADDRESS_ERROR_MESSAGE);
|
|
2443
2444
|
const codeWordValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 3 && _.length <= 21 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE);
|
|
2445
|
+
const nameRetailValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && retailCyrillicPattern.test(_))(errorMsg ?? ERROR_MESSAGE);
|
|
2444
2446
|
const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && /^[0-9]{1,2}$/g.test(_))(errorMsg ?? ERROR_MESSAGE);
|
|
2445
2447
|
const lengthStringValidator = (inputLength, errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= inputLength)(errorMsg ?? ERROR_MESSAGE);
|
|
2446
2448
|
const limitedBirthdayValidate = ({ minAge, maxAge }) => (date) => {
|
|
@@ -2564,6 +2566,9 @@
|
|
|
2564
2566
|
partInBusiness: defaultValidator(),
|
|
2565
2567
|
regionRetail: defaultSelectValidator('Выберите регион'),
|
|
2566
2568
|
latinSurname: defaultValidator('Укажите фамилию'),
|
|
2569
|
+
surname: nameRetailValidator('Укажите свою фамилию на кириллице'),
|
|
2570
|
+
name: nameRetailValidator('Укажите своё имя на кириллице'),
|
|
2571
|
+
middleName: nameRetailValidator('Укажите своё отчество на кириллице'),
|
|
2567
2572
|
};
|
|
2568
2573
|
const validatorObj = {
|
|
2569
2574
|
...validatorRetailObj,
|
|
@@ -2663,11 +2668,11 @@
|
|
|
2663
2668
|
{
|
|
2664
2669
|
columns: 2,
|
|
2665
2670
|
inputs: [
|
|
2666
|
-
{ name: 'surname', required: true, dadata: true },
|
|
2667
|
-
{ name: 'name', required: true, dadata: true },
|
|
2668
|
-
{ name: 'middleName', dadata: true },
|
|
2669
|
-
{ name: 'limitedBirthday', required: true },
|
|
2670
|
-
{ name: 'phone', required: true },
|
|
2671
|
+
{ name: 'surname', required: true, dadata: true, filledByEsia: true },
|
|
2672
|
+
{ name: 'name', required: true, dadata: true, filledByEsia: true },
|
|
2673
|
+
{ name: 'middleName', dadata: true, filledByEsia: true },
|
|
2674
|
+
{ name: 'limitedBirthday', required: true, filledByEsia: true },
|
|
2675
|
+
{ name: 'phone', required: true, filledByEsia: true },
|
|
2671
2676
|
{ name: 'email', required: true, dadata: true },
|
|
2672
2677
|
],
|
|
2673
2678
|
},
|
|
@@ -2677,6 +2682,57 @@
|
|
|
2677
2682
|
];
|
|
2678
2683
|
};
|
|
2679
2684
|
|
|
2685
|
+
const getTraceId = () => {
|
|
2686
|
+
const result = new Uint8Array(8);
|
|
2687
|
+
globalThis.crypto.getRandomValues(result);
|
|
2688
|
+
return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
|
|
2689
|
+
};
|
|
2690
|
+
|
|
2691
|
+
const fetchRetailJSON = async (url, method, body) => {
|
|
2692
|
+
try {
|
|
2693
|
+
const response = await doRequest(url, method, body);
|
|
2694
|
+
return response.json();
|
|
2695
|
+
}
|
|
2696
|
+
catch (err) {
|
|
2697
|
+
console.error(err);
|
|
2698
|
+
return null;
|
|
2699
|
+
}
|
|
2700
|
+
};
|
|
2701
|
+
async function doRequest(url, method, body) {
|
|
2702
|
+
const traceId = getTraceId();
|
|
2703
|
+
return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
|
|
2704
|
+
method,
|
|
2705
|
+
headers: {
|
|
2706
|
+
'Content-Type': 'application/json',
|
|
2707
|
+
'X-B3-Sampled': '1',
|
|
2708
|
+
'X-B3-Spanid': traceId,
|
|
2709
|
+
'X-B3-Traceid': traceId,
|
|
2710
|
+
...getAuthorizationHeaders(),
|
|
2711
|
+
},
|
|
2712
|
+
credentials: 'include',
|
|
2713
|
+
body: body ? JSON.stringify(body) : null,
|
|
2714
|
+
});
|
|
2715
|
+
}
|
|
2716
|
+
const getAuthorizationHeaders = () => {
|
|
2717
|
+
const token = sessionStorage.getItem('accessToken');
|
|
2718
|
+
return token ? { Authorization: `Bearer ${token}` } : null;
|
|
2719
|
+
};
|
|
2720
|
+
|
|
2721
|
+
const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
|
|
2722
|
+
|
|
2723
|
+
const EsiaLoginBanner = JSX(() => {
|
|
2724
|
+
const navigator = locationNavigator();
|
|
2725
|
+
const handleAuth = useCallback(async () => {
|
|
2726
|
+
const resp = await getLink({
|
|
2727
|
+
redirectUri: globalThis.location.origin + globalThis.location.pathname,
|
|
2728
|
+
});
|
|
2729
|
+
if (resp?.link) {
|
|
2730
|
+
navigator.assign(resp.link);
|
|
2731
|
+
}
|
|
2732
|
+
}, []);
|
|
2733
|
+
return (jsxs("div", { className: "flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9", children: [jsxs("div", { className: "flex flex-col justify-around w-full", children: [jsx("p", { className: "mb-4 text-xl @md:text-2xl @md:mb-6", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsxs("ul", { className: "list-disc list-inside mb-9", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { className: "block mb-6 self-center @md:hidden", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "80", width: "80" }), jsx(Button, { type: "button", onClick: handleAuth, className: "w-full @md:w-fit", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C" })] }), jsx(Img, { className: "hidden @md:block", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "164" })] }));
|
|
2734
|
+
});
|
|
2735
|
+
|
|
2680
2736
|
const debounce = (fn, delay = 600) => {
|
|
2681
2737
|
let timerId;
|
|
2682
2738
|
const debouncedCallback = (...args) => {
|
|
@@ -3563,42 +3619,6 @@
|
|
|
3563
3619
|
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
3564
3620
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
3565
3621
|
|
|
3566
|
-
const getTraceId = () => {
|
|
3567
|
-
const result = new Uint8Array(8);
|
|
3568
|
-
globalThis.crypto.getRandomValues(result);
|
|
3569
|
-
return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
|
|
3570
|
-
};
|
|
3571
|
-
|
|
3572
|
-
const fetchRetailJSON = async (url, method, body) => {
|
|
3573
|
-
try {
|
|
3574
|
-
const response = await doRequest(url, method, body);
|
|
3575
|
-
return response.json();
|
|
3576
|
-
}
|
|
3577
|
-
catch (err) {
|
|
3578
|
-
console.error(err);
|
|
3579
|
-
return null;
|
|
3580
|
-
}
|
|
3581
|
-
};
|
|
3582
|
-
async function doRequest(url, method, body) {
|
|
3583
|
-
const traceId = getTraceId();
|
|
3584
|
-
return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
|
|
3585
|
-
method,
|
|
3586
|
-
headers: {
|
|
3587
|
-
'Content-Type': 'application/json',
|
|
3588
|
-
'X-B3-Sampled': '1',
|
|
3589
|
-
'X-B3-Spanid': traceId,
|
|
3590
|
-
'X-B3-Traceid': traceId,
|
|
3591
|
-
...getAuthorizationHeaders(),
|
|
3592
|
-
},
|
|
3593
|
-
credentials: 'include',
|
|
3594
|
-
body: body ? JSON.stringify(body) : null,
|
|
3595
|
-
});
|
|
3596
|
-
}
|
|
3597
|
-
const getAuthorizationHeaders = () => {
|
|
3598
|
-
const token = sessionStorage.getItem('accessToken');
|
|
3599
|
-
return token ? { Authorization: `Bearer ${token}` } : null;
|
|
3600
|
-
};
|
|
3601
|
-
|
|
3602
3622
|
const fetchRegionOffices = async (regionKey) => {
|
|
3603
3623
|
const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
|
|
3604
3624
|
regionRfCd: {
|
|
@@ -3828,7 +3848,7 @@
|
|
|
3828
3848
|
|
|
3829
3849
|
const BankruptcyFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0412 \u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0438 \u043C\u0435\u043D\u044F \u0432\u0435\u0434\u0451\u0442\u0441\u044F \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u043E \u043F\u043E \u0434\u0435\u043B\u0443 \u043E \u0431\u0430\u043D\u043A\u0440\u043E\u0442\u0441\u0442\u0432\u0435", ...field(input?.name ?? '') })));
|
|
3830
3850
|
|
|
3831
|
-
const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input })));
|
|
3851
|
+
const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
|
|
3832
3852
|
|
|
3833
3853
|
const FIELD_NAME$2 = 'birthPlace';
|
|
3834
3854
|
const BirthPlaceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$2) })));
|
|
@@ -3892,7 +3912,8 @@
|
|
|
3892
3912
|
|
|
3893
3913
|
const ConfirmationIncomeField = JSX(({ field, input }) => {
|
|
3894
3914
|
const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
|
|
3895
|
-
|
|
3915
|
+
const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
|
|
3916
|
+
return (jsxs("div", { children: [filledByEsia ? (jsx("div", { className: "mb-6", children: jsx(InfoCard, { __html: "\u0414\u043B\u044F \u0432\u044B\u0431\u043E\u0440\u0430 \u0438\u043D\u043E\u0433\u043E \u0441\u043F\u043E\u0441\u043E\u0431\u0430 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430, \u043E\u0444\u043E\u0440\u043C\u0438\u0442\u0435 \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442 \u0431\u0435\u0437 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043D\u0430 \u043F\u043E\u0440\u0442\u0430\u043B\u0435 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }) })) : null, jsx(SelectField, { field: field, source: confirmationIncome, label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430", fieldName: "confirmationIncome", input: input, disabled: filledByEsia })] }));
|
|
3896
3917
|
});
|
|
3897
3918
|
|
|
3898
3919
|
const ConscriptionField = JSX(({ field, input }) => {
|
|
@@ -4436,10 +4457,10 @@
|
|
|
4436
4457
|
}
|
|
4437
4458
|
})();
|
|
4438
4459
|
}, [employerActivities, employerOrganization, organization, amountWorkers]);
|
|
4439
|
-
return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
|
|
4460
|
+
return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
|
|
4440
4461
|
});
|
|
4441
4462
|
|
|
4442
|
-
const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? '') })));
|
|
4463
|
+
const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: new Date() })));
|
|
4443
4464
|
|
|
4444
4465
|
const DeliveryTimeField = JSX(({ field, input }) => {
|
|
4445
4466
|
const { data } = useLeadFormData('COURIER_DELIVERY_TIME');
|
|
@@ -4452,7 +4473,11 @@
|
|
|
4452
4473
|
|
|
4453
4474
|
const DependentsField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u043D\u044B\u0445 \u0438\u0436\u0434\u0438\u0432\u0435\u043D\u0446\u0435\u0432", placeholder: "\u0417\u0430 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435\u043C \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input })));
|
|
4454
4475
|
|
|
4455
|
-
const DulIssueDateField = JSX(({ field, input }) =>
|
|
4476
|
+
const DulIssueDateField = JSX(({ field, input }) => {
|
|
4477
|
+
const birthDate = field('limitedBirthday')?.value;
|
|
4478
|
+
const startDulIssueDate = useMemo(() => new Date(birthDate.getFullYear() + 14, birthDate.getMonth(), birthDate.getDate()), [birthDate]);
|
|
4479
|
+
return (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0432\u044B\u0434\u0430\u0447\u0438", ...field(input?.name ?? ''), disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? ''), minDate: startDulIssueDate }));
|
|
4480
|
+
});
|
|
4456
4481
|
|
|
4457
4482
|
const DulIssuedByField = JSX(({ field, input }) => {
|
|
4458
4483
|
const { value: dulSubdivisionCode, onChange: changeDulSubdivisionCode } = field('dulSubdivisionCode');
|
|
@@ -4515,7 +4540,7 @@
|
|
|
4515
4540
|
const MIN_YEARS = 0;
|
|
4516
4541
|
const Experience5YearsField = JSX(({ field, input }) => {
|
|
4517
4542
|
const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
|
|
4518
|
-
return (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", type: "number", ...field(input?.name ?? ''), ...input, onChange: onChange }));
|
|
4543
|
+
return (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", type: "number", ...field(input?.name ?? ''), ...input, onChange: onChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
|
|
4519
4544
|
});
|
|
4520
4545
|
|
|
4521
4546
|
const FamilyMembersField = JSX(({ field, input }) => {
|
|
@@ -4536,7 +4561,7 @@
|
|
|
4536
4561
|
return (jsx(SelectField, { field: field, source: familyStatus, label: "\u0421\u0435\u043C\u0435\u0439\u043D\u043E\u0435 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", fieldName: "familyStatus", input: input }));
|
|
4537
4562
|
});
|
|
4538
4563
|
|
|
4539
|
-
const GeneralSeniorityField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", type: "number", maxLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...field(input?.name ?? ''), ...input })));
|
|
4564
|
+
const GeneralSeniorityField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", type: "number", maxLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
|
|
4540
4565
|
|
|
4541
4566
|
const HousingField = JSX(({ field, input }) => {
|
|
4542
4567
|
const { data: housing } = useLeadFormData('HOUSE_TYPE');
|
|
@@ -4545,9 +4570,9 @@
|
|
|
4545
4570
|
|
|
4546
4571
|
const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
|
|
4547
4572
|
|
|
4548
|
-
const JobsNumberField = JSX(({ field, input }) => (jsx(DaDataInputControl, { 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", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input })));
|
|
4573
|
+
const JobsNumberField = JSX(({ field, input }) => (jsx(DaDataInputControl, { 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", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
|
|
4549
4574
|
|
|
4550
|
-
const LastJobExperienceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { 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", type: "number", maxLength: 2, ...field(input?.name ?? ''), ...input })));
|
|
4575
|
+
const LastJobExperienceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { 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", type: "number", maxLength: 2, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
|
|
4551
4576
|
|
|
4552
4577
|
const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
|
|
4553
4578
|
const isLatin = (_ = '') => latinPattern.test(_);
|
|
@@ -4678,9 +4703,23 @@
|
|
|
4678
4703
|
];
|
|
4679
4704
|
const MethodObtainField = JSX(({ field, input }) => (jsx(RadioButtonGroupControl, { orientation: "horizontal", items: METHODS_OF_OBTAIN, ...field(input?.name ?? '') })));
|
|
4680
4705
|
|
|
4681
|
-
const MiddleNameField = JSX(({ field, input }) =>
|
|
4706
|
+
const MiddleNameField = JSX(({ field, input }) => {
|
|
4707
|
+
const onChange = useCallback((value) => {
|
|
4708
|
+
if (retailCyrillicPattern.test(value) || value.length === 0) {
|
|
4709
|
+
field('middleName')?.onChange?.(value);
|
|
4710
|
+
}
|
|
4711
|
+
}, [field]);
|
|
4712
|
+
return (jsx(DaDataInputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", maxLength: 60, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? ''), ...field(input?.name ?? ''), ...input, onChange: onChange }));
|
|
4713
|
+
});
|
|
4682
4714
|
|
|
4683
|
-
const NameField = JSX(({ field, input }) =>
|
|
4715
|
+
const NameField = JSX(({ field, input }) => {
|
|
4716
|
+
const onChange = useCallback((value) => {
|
|
4717
|
+
if (retailCyrillicPattern.test(value) || value.length === 0) {
|
|
4718
|
+
field('name')?.onChange?.(value);
|
|
4719
|
+
}
|
|
4720
|
+
}, [field]);
|
|
4721
|
+
return (jsx(DaDataInputControl, { label: "\u0418\u043C\u044F", maxLength: 60, disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(input?.name ?? ''), ...input, onChange: onChange }));
|
|
4722
|
+
});
|
|
4684
4723
|
|
|
4685
4724
|
const OrganizationField = JSX(({ field, input }) => {
|
|
4686
4725
|
const { data } = useLeadFormData('ORGANIZATION_TYPE');
|
|
@@ -4699,7 +4738,7 @@
|
|
|
4699
4738
|
field?.('inn')?.onChange?.(item.data?.inn);
|
|
4700
4739
|
updateOrganizationFields(store, field, item);
|
|
4701
4740
|
}, []);
|
|
4702
|
-
return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
|
|
4741
|
+
return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? ''), onDaDataChange: onDaDataChange }));
|
|
4703
4742
|
});
|
|
4704
4743
|
|
|
4705
4744
|
const OtherIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0418\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
|
|
@@ -4835,11 +4874,18 @@
|
|
|
4835
4874
|
const SnilsField = JSX(({ field, input }) => (jsx(InputSnilsControl, { label: "\u0421\u041D\u0418\u041B\u0421", maxLength: 14, ...field(input?.name ?? ''), ...input })));
|
|
4836
4875
|
|
|
4837
4876
|
const FIELD_NAME = 'surname';
|
|
4838
|
-
const SurnameField = JSX(({ field, input }) =>
|
|
4877
|
+
const SurnameField = JSX(({ field, input }) => {
|
|
4878
|
+
const onChange = useCallback((value) => {
|
|
4879
|
+
if (retailCyrillicPattern.test(value) || value.length === 0) {
|
|
4880
|
+
field('surname')?.onChange?.(value);
|
|
4881
|
+
}
|
|
4882
|
+
}, [field]);
|
|
4883
|
+
return (jsx(DaDataInputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", maxLength: 60, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME), ...field(input?.name ?? ''), ...input, onChange: onChange }));
|
|
4884
|
+
});
|
|
4839
4885
|
|
|
4840
4886
|
const TotalIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
|
|
4841
4887
|
|
|
4842
|
-
const WagesField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
|
|
4888
|
+
const WagesField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
|
|
4843
4889
|
|
|
4844
4890
|
const DELIVERY_CITIES_REF = {
|
|
4845
4891
|
$ref: '/wcms-resources/delivery-cities-data.json',
|
|
@@ -5469,7 +5515,7 @@
|
|
|
5469
5515
|
const participant = task.participants[0];
|
|
5470
5516
|
const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
|
|
5471
5517
|
const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
|
|
5472
|
-
const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, incomeCertificateCd, } = participant;
|
|
5518
|
+
const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, incomeCertificateCd, profile, } = participant;
|
|
5473
5519
|
return {
|
|
5474
5520
|
currency: currency?.key,
|
|
5475
5521
|
paymentSystem: getSelectValue(paymentSystem),
|
|
@@ -5521,6 +5567,7 @@
|
|
|
5521
5567
|
monthsValue,
|
|
5522
5568
|
isAnnuity: paymentTypeCd?.key === 'ANNUITY',
|
|
5523
5569
|
},
|
|
5570
|
+
esiaAccountTypeCd: profile?.esiaAccountTypeCd,
|
|
5524
5571
|
...getParticipantIncomes(participantIncomes),
|
|
5525
5572
|
...getParticipantAddresses(participantAddresses),
|
|
5526
5573
|
...getParticipantContacts(participantContacts),
|
|
@@ -5575,39 +5622,6 @@
|
|
|
5575
5622
|
};
|
|
5576
5623
|
};
|
|
5577
5624
|
|
|
5578
|
-
const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
|
|
5579
|
-
|
|
5580
|
-
const EsiaLoginDialog = JSX(({ onClose }) => {
|
|
5581
|
-
const navigator = locationNavigator();
|
|
5582
|
-
const retailFormStore = useRetailFormStore();
|
|
5583
|
-
const handleAuth = useCallback(async () => {
|
|
5584
|
-
const resp = await getLink({
|
|
5585
|
-
redirectUri: globalThis.location.origin + globalThis.location.pathname,
|
|
5586
|
-
});
|
|
5587
|
-
if (resp?.link) {
|
|
5588
|
-
navigator.assign(resp.link);
|
|
5589
|
-
globalThis.location.href = resp.link;
|
|
5590
|
-
}
|
|
5591
|
-
}, []);
|
|
5592
|
-
const handleClose = useCallback(() => {
|
|
5593
|
-
if (retailFormStore.leadForm) {
|
|
5594
|
-
const leadForm = { ...retailFormStore.leadForm };
|
|
5595
|
-
delete leadForm.esiaAccountTypeCd;
|
|
5596
|
-
retailFormStore.leadForm = leadForm;
|
|
5597
|
-
}
|
|
5598
|
-
onClose?.();
|
|
5599
|
-
}, []);
|
|
5600
|
-
return (jsx(Dialog, { className: "my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg", onClose: handleClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [jsxs("div", { className: "flex items-center justify-around w-full px-m", children: [jsxs("ul", { className: "list-disc", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "70" })] }), jsxs("div", { className: "@container flex flex-wrap gap-lg w-full", children: [jsx(Button, { type: "button", onClick: handleAuth, className: "w-full md:w-auto", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsx(Button, { type: "button", version: "secondary", onClick: handleClose, className: "w-full md:w-auto", children: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" })] })] }) }));
|
|
5601
|
-
});
|
|
5602
|
-
|
|
5603
|
-
const useEsiaLoginDialog = (nextStepLink) => {
|
|
5604
|
-
const { open } = useDialog(EsiaLoginDialog);
|
|
5605
|
-
const navigator = locationNavigator();
|
|
5606
|
-
return useCallback(() => {
|
|
5607
|
-
open({ onClose: () => navigator.assign(nextStepLink) });
|
|
5608
|
-
}, [open, nextStepLink]);
|
|
5609
|
-
};
|
|
5610
|
-
|
|
5611
5625
|
// TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
|
|
5612
5626
|
const getUpdateUserProfileData = (profileId, formData, consents) => {
|
|
5613
5627
|
const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
|
|
@@ -5729,21 +5743,19 @@
|
|
|
5729
5743
|
|
|
5730
5744
|
/* eslint-disable max-lines */
|
|
5731
5745
|
// eslint-disable-next-line max-lines-per-function
|
|
5732
|
-
const useApplicationLeadApi = ({ programId, nextStepLink, productType,
|
|
5746
|
+
const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
|
|
5733
5747
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
5734
5748
|
const [ok, setOK] = useState();
|
|
5735
5749
|
const saveUserData = useSaveUserData();
|
|
5736
5750
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
5737
5751
|
const navigator = locationNavigator();
|
|
5738
|
-
const
|
|
5739
|
-
|
|
5752
|
+
const goToNextStep = useCallback(() => {
|
|
5753
|
+
navigator.assign(nextStepLink);
|
|
5754
|
+
}, []);
|
|
5755
|
+
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
5740
5756
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
5741
5757
|
const draftDialog = useDraftDialog();
|
|
5742
5758
|
const handleSubmit = useCallback(async (formData) => {
|
|
5743
|
-
if (esiaError) {
|
|
5744
|
-
navigator.assign(nextStepLink);
|
|
5745
|
-
return;
|
|
5746
|
-
}
|
|
5747
5759
|
try {
|
|
5748
5760
|
startSending();
|
|
5749
5761
|
const profileId = await createUserProfile({
|
|
@@ -5761,7 +5773,7 @@
|
|
|
5761
5773
|
});
|
|
5762
5774
|
verifyPhoneDialog.close();
|
|
5763
5775
|
if (productType === 'debitCard') {
|
|
5764
|
-
|
|
5776
|
+
goToNextStep();
|
|
5765
5777
|
}
|
|
5766
5778
|
else {
|
|
5767
5779
|
consentBkiDialog.open(formData.phone, profileId);
|
|
@@ -5800,7 +5812,7 @@
|
|
|
5800
5812
|
catch {
|
|
5801
5813
|
setOK(false);
|
|
5802
5814
|
}
|
|
5803
|
-
}, [
|
|
5815
|
+
}, []);
|
|
5804
5816
|
return { isSending, ok, handleSubmit };
|
|
5805
5817
|
};
|
|
5806
5818
|
const getAcceptedConsents = (formData, productType) => {
|
|
@@ -5883,7 +5895,10 @@
|
|
|
5883
5895
|
}
|
|
5884
5896
|
}, [target, key]);
|
|
5885
5897
|
|
|
5886
|
-
const
|
|
5898
|
+
const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
|
|
5899
|
+
saveToken(res);
|
|
5900
|
+
return res;
|
|
5901
|
+
});
|
|
5887
5902
|
|
|
5888
5903
|
const initialFormState = {
|
|
5889
5904
|
surname: '',
|
|
@@ -5901,19 +5916,24 @@
|
|
|
5901
5916
|
consentPhotoFlg: false,
|
|
5902
5917
|
consentFATCA: false,
|
|
5903
5918
|
};
|
|
5904
|
-
const getInitialFormState$1 = (inputs, savedForm) => {
|
|
5919
|
+
const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
|
|
5905
5920
|
if (savedForm) {
|
|
5906
|
-
return {
|
|
5921
|
+
return {
|
|
5922
|
+
...savedForm,
|
|
5923
|
+
limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
|
|
5924
|
+
...(!esiaAuthSuccess && {
|
|
5925
|
+
esiaAccountTypeCd: { key: '' },
|
|
5926
|
+
}),
|
|
5927
|
+
};
|
|
5907
5928
|
}
|
|
5908
5929
|
const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
|
|
5909
5930
|
return { ...formState };
|
|
5910
5931
|
};
|
|
5911
5932
|
|
|
5912
|
-
const uploadFile = async (file,
|
|
5933
|
+
const uploadFile = async (file, documentCategory, isPDF = false) => {
|
|
5913
5934
|
const fd = new FormData();
|
|
5914
|
-
fd.append('taskId', taskId);
|
|
5915
5935
|
fd.append('documentCategory', documentCategory);
|
|
5916
|
-
fd.append('file', file, '
|
|
5936
|
+
fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
|
|
5917
5937
|
const res = await globalThis
|
|
5918
5938
|
?.fetch?.(`/light-api-cash/v1/file`, {
|
|
5919
5939
|
method: 'POST',
|
|
@@ -5927,23 +5947,13 @@
|
|
|
5927
5947
|
return res;
|
|
5928
5948
|
};
|
|
5929
5949
|
|
|
5930
|
-
const parseEsiaProfile = async (esiaProfile,
|
|
5931
|
-
|
|
5950
|
+
const parseEsiaProfile = async (esiaProfile, isDebit) => {
|
|
5951
|
+
checkEsiaData(esiaProfile);
|
|
5952
|
+
const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
|
|
5932
5953
|
const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
|
|
5933
|
-
|
|
5934
|
-
if (
|
|
5935
|
-
await
|
|
5936
|
-
document: esiaAdditionalDocument.pdfFileWorkbook,
|
|
5937
|
-
taskId,
|
|
5938
|
-
category: 'CONFIRMING_INCOME_DOC',
|
|
5939
|
-
files,
|
|
5940
|
-
});
|
|
5941
|
-
await saveDocument({
|
|
5942
|
-
document: esiaAdditionalDocument.pdfFilePayout,
|
|
5943
|
-
taskId,
|
|
5944
|
-
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
5945
|
-
files,
|
|
5946
|
-
});
|
|
5954
|
+
let files = [];
|
|
5955
|
+
if (isFullEsiaData) {
|
|
5956
|
+
files = await saveDocuments(esiaAdditionalDocument);
|
|
5947
5957
|
}
|
|
5948
5958
|
const mainData = {
|
|
5949
5959
|
name: profile.name,
|
|
@@ -5960,11 +5970,11 @@
|
|
|
5960
5970
|
birthPlace: addInfo.birthPlace,
|
|
5961
5971
|
addressRegistration: buildAddress(addressRegistration),
|
|
5962
5972
|
addressFact: buildAddress(addressFact),
|
|
5963
|
-
esiaAccountTypeCd: profile.esiaAccountType,
|
|
5973
|
+
esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
|
|
5964
5974
|
};
|
|
5965
5975
|
return {
|
|
5966
5976
|
...mainData,
|
|
5967
|
-
...(
|
|
5977
|
+
...(isFullEsiaData && {
|
|
5968
5978
|
snils: addInfo.snils,
|
|
5969
5979
|
inn: esiaAdditionalDocument.inn,
|
|
5970
5980
|
wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
|
|
@@ -5973,6 +5983,9 @@
|
|
|
5973
5983
|
generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
|
|
5974
5984
|
lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
|
|
5975
5985
|
jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
5986
|
+
esiaAccountTypeCd: profile.esiaAccountType,
|
|
5987
|
+
confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
|
|
5988
|
+
employment: { key: 'WORK', text: 'Работаю' },
|
|
5976
5989
|
files,
|
|
5977
5990
|
}),
|
|
5978
5991
|
};
|
|
@@ -6005,43 +6018,60 @@
|
|
|
6005
6018
|
};
|
|
6006
6019
|
};
|
|
6007
6020
|
const getYearFromMonth = (month) => Math.floor(month / 12);
|
|
6008
|
-
const
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6021
|
+
const saveDocuments = async (esiaAdditionalDocument) => {
|
|
6022
|
+
const files = [];
|
|
6023
|
+
const documents = [
|
|
6024
|
+
{
|
|
6025
|
+
file: esiaAdditionalDocument.pdfFileWorkbook,
|
|
6026
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
6027
|
+
isPDF: true,
|
|
6028
|
+
},
|
|
6029
|
+
{
|
|
6030
|
+
file: esiaAdditionalDocument.pdfFilePayout,
|
|
6031
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
6032
|
+
isPDF: true,
|
|
6033
|
+
},
|
|
6034
|
+
{
|
|
6035
|
+
file: esiaAdditionalDocument.pdfFileSigPayout,
|
|
6036
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
6037
|
+
isPDF: true,
|
|
6038
|
+
},
|
|
6039
|
+
{
|
|
6040
|
+
file: esiaAdditionalDocument.xmlFilePayout,
|
|
6041
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
6042
|
+
isPDF: false,
|
|
6043
|
+
},
|
|
6044
|
+
{
|
|
6045
|
+
file: esiaAdditionalDocument.xmlFileSigPayout,
|
|
6046
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
6047
|
+
isPDF: false,
|
|
6048
|
+
},
|
|
6049
|
+
{
|
|
6050
|
+
file: esiaAdditionalDocument.xmlFileWorkbook,
|
|
6051
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
6052
|
+
isPDF: false,
|
|
6053
|
+
},
|
|
6054
|
+
{
|
|
6055
|
+
file: esiaAdditionalDocument.pdfFileSigWorkbook,
|
|
6056
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
6057
|
+
isPDF: true,
|
|
6058
|
+
},
|
|
6059
|
+
{
|
|
6060
|
+
file: esiaAdditionalDocument.xmlFileSigWorkbook,
|
|
6061
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
6062
|
+
isPDF: false,
|
|
6063
|
+
},
|
|
6039
6064
|
];
|
|
6040
|
-
|
|
6041
|
-
|
|
6065
|
+
for (const doc of documents) {
|
|
6066
|
+
const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
|
|
6067
|
+
await fetch(`${contentType},${doc.file}`)
|
|
6068
|
+
.then((res) => res.blob())
|
|
6069
|
+
.then((value) => uploadFile(value, doc.category, doc.isPDF))
|
|
6070
|
+
.then((file) => files.push(file));
|
|
6042
6071
|
}
|
|
6072
|
+
return files;
|
|
6043
6073
|
};
|
|
6044
|
-
const
|
|
6074
|
+
const checkEsiaData = (esiaProfile) => {
|
|
6045
6075
|
const { profile, document, addressRegistration } = esiaProfile;
|
|
6046
6076
|
const data = [
|
|
6047
6077
|
profile.name,
|
|
@@ -6049,7 +6079,6 @@
|
|
|
6049
6079
|
profile.midname,
|
|
6050
6080
|
profile.birthDate,
|
|
6051
6081
|
profile.phone,
|
|
6052
|
-
profile.email,
|
|
6053
6082
|
document.dulIssueDate,
|
|
6054
6083
|
document.dulIssuedBy,
|
|
6055
6084
|
document.dulNumber,
|
|
@@ -6062,75 +6091,97 @@
|
|
|
6062
6091
|
throw new Error();
|
|
6063
6092
|
}
|
|
6064
6093
|
};
|
|
6094
|
+
const checkEsiaAdditionalDocument = (esiaProfile) => {
|
|
6095
|
+
const { esiaAdditionalDocument } = esiaProfile;
|
|
6096
|
+
const data = [
|
|
6097
|
+
esiaAdditionalDocument?.inn,
|
|
6098
|
+
esiaAdditionalDocument?.averageMonthlyIncome?.toString(),
|
|
6099
|
+
esiaAdditionalDocument?.startWorkDate,
|
|
6100
|
+
esiaAdditionalDocument?.workLengthInFiveYears?.toString(),
|
|
6101
|
+
esiaAdditionalDocument?.workLength?.toString(),
|
|
6102
|
+
esiaAdditionalDocument?.workLengthLastJob?.toString(),
|
|
6103
|
+
esiaAdditionalDocument?.jobsNumberInFiveYears?.toString(),
|
|
6104
|
+
esiaAdditionalDocument?.pdfFilePayout,
|
|
6105
|
+
esiaAdditionalDocument?.pdfFileWorkbook,
|
|
6106
|
+
esiaAdditionalDocument?.pdfFileSigPayout,
|
|
6107
|
+
esiaAdditionalDocument?.xmlFilePayout,
|
|
6108
|
+
esiaAdditionalDocument?.xmlFileSigPayout,
|
|
6109
|
+
esiaAdditionalDocument?.xmlFileWorkbook,
|
|
6110
|
+
esiaAdditionalDocument?.pdfFileSigWorkbook,
|
|
6111
|
+
esiaAdditionalDocument?.xmlFileSigWorkbook,
|
|
6112
|
+
];
|
|
6113
|
+
return data.every((_) => Boolean(_));
|
|
6114
|
+
};
|
|
6065
6115
|
|
|
6066
|
-
const useInitApplicationLead = ({ inputs,
|
|
6067
|
-
const navigator = locationNavigator();
|
|
6068
|
-
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
6116
|
+
const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
|
|
6069
6117
|
const leadFormStore = useLeadFormStore();
|
|
6070
6118
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
6071
|
-
const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
|
|
6072
|
-
const
|
|
6073
|
-
|
|
6119
|
+
const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
|
|
6120
|
+
const requestEsiaProfile = useCallback(async (code, state) => {
|
|
6121
|
+
setEsiaStatus(EsiaStatuses.Pending);
|
|
6074
6122
|
try {
|
|
6075
|
-
const data = await
|
|
6076
|
-
profileId,
|
|
6123
|
+
const data = await esiaRequestProfile({
|
|
6077
6124
|
code,
|
|
6078
6125
|
state,
|
|
6079
6126
|
redirectUri: globalThis.location?.href,
|
|
6127
|
+
authorize: true,
|
|
6080
6128
|
});
|
|
6081
|
-
if (data
|
|
6082
|
-
const parsedData = await parseEsiaProfile(data,
|
|
6129
|
+
if (data) {
|
|
6130
|
+
const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
|
|
6083
6131
|
saveForm((_) => ({
|
|
6084
6132
|
..._,
|
|
6085
6133
|
...parsedData,
|
|
6086
6134
|
}));
|
|
6135
|
+
setEsiaStatus(EsiaStatuses.Success);
|
|
6087
6136
|
}
|
|
6088
|
-
navigator.assign(nextStepLink);
|
|
6089
6137
|
}
|
|
6090
6138
|
catch {
|
|
6091
|
-
|
|
6092
|
-
}
|
|
6093
|
-
finally {
|
|
6094
|
-
endLoading();
|
|
6139
|
+
setEsiaStatus(EsiaStatuses.Error);
|
|
6095
6140
|
}
|
|
6096
|
-
}, [
|
|
6141
|
+
}, []);
|
|
6097
6142
|
useEffect(() => {
|
|
6098
6143
|
leadFormStore.productType = productType;
|
|
6099
|
-
const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
|
|
6100
6144
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
6101
6145
|
const code = params.get('code');
|
|
6102
6146
|
const state = params.get('state');
|
|
6103
|
-
if (
|
|
6104
|
-
|
|
6147
|
+
if (code && state) {
|
|
6148
|
+
requestEsiaProfile(code, state);
|
|
6105
6149
|
}
|
|
6106
6150
|
else {
|
|
6107
6151
|
sessionStorage.removeItem('accessToken');
|
|
6108
6152
|
sessionStorage.removeItem('refreshToken');
|
|
6109
6153
|
}
|
|
6110
6154
|
}, []);
|
|
6111
|
-
return
|
|
6155
|
+
return initialFormState;
|
|
6112
6156
|
};
|
|
6113
6157
|
|
|
6158
|
+
var EsiaStatuses;
|
|
6159
|
+
(function (EsiaStatuses) {
|
|
6160
|
+
EsiaStatuses["Success"] = "SUCCESS";
|
|
6161
|
+
EsiaStatuses["Error"] = "ERROR";
|
|
6162
|
+
EsiaStatuses["Pending"] = "PENDING";
|
|
6163
|
+
})(EsiaStatuses || (EsiaStatuses = {}));
|
|
6114
6164
|
const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
|
|
6115
|
-
const [
|
|
6165
|
+
const [esiaStatus, setEsiaStatus] = useState();
|
|
6166
|
+
const leadForm = useRef(null);
|
|
6116
6167
|
const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
|
|
6117
6168
|
const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
|
|
6118
6169
|
const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
|
|
6119
6170
|
const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
|
|
6120
|
-
const
|
|
6171
|
+
const initialFormState = useInitApplicationLead({
|
|
6121
6172
|
inputs,
|
|
6122
6173
|
nextStepLink,
|
|
6123
6174
|
productType,
|
|
6124
|
-
|
|
6175
|
+
setEsiaStatus,
|
|
6176
|
+
esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
|
|
6125
6177
|
});
|
|
6126
6178
|
const { isSending, ok, handleSubmit } = useApplicationLeadApi({
|
|
6127
6179
|
programId,
|
|
6128
6180
|
nextStepLink,
|
|
6129
6181
|
productType,
|
|
6130
|
-
esiaError,
|
|
6131
6182
|
data,
|
|
6132
6183
|
});
|
|
6133
|
-
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
6184
|
+
const [, { field, onSubmit, reset }] = useForm(initialFormState, {
|
|
6134
6185
|
formValidator,
|
|
6135
6186
|
onSubmit: handleSubmit,
|
|
6136
6187
|
});
|
|
@@ -6140,7 +6191,17 @@
|
|
|
6140
6191
|
responseTypeDialog.open({ ok });
|
|
6141
6192
|
}
|
|
6142
6193
|
}, [ok]);
|
|
6143
|
-
|
|
6194
|
+
useEffect(() => {
|
|
6195
|
+
if (esiaStatus && leadForm?.current) {
|
|
6196
|
+
leadForm.current.scrollIntoView({
|
|
6197
|
+
block: 'start',
|
|
6198
|
+
});
|
|
6199
|
+
}
|
|
6200
|
+
if (esiaStatus === EsiaStatuses.Success) {
|
|
6201
|
+
reset();
|
|
6202
|
+
}
|
|
6203
|
+
}, [leadForm?.current, esiaStatus]);
|
|
6204
|
+
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaStatus ? jsx(EsiaLoginBanner, {}) : null, jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", ref: leadForm, children: [esiaStatus === EsiaStatuses.Pending ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaStatus === EsiaStatuses.Error ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] })] }));
|
|
6144
6205
|
});
|
|
6145
6206
|
const getInputs = (applicationFormData) => (applicationFormData?.flatMap((_) => _?.inputs) || []);
|
|
6146
6207
|
const getExtendedValidatorObj = (productType) => ({
|
|
@@ -7838,6 +7899,7 @@
|
|
|
7838
7899
|
mandatoryPayments: undefined,
|
|
7839
7900
|
snils: '',
|
|
7840
7901
|
armyIdFlg: false,
|
|
7902
|
+
esiaAccountTypeCd: { key: '', text: '' },
|
|
7841
7903
|
},
|
|
7842
7904
|
{
|
|
7843
7905
|
bankruptcyFlg: false,
|
|
@@ -8233,7 +8295,7 @@
|
|
|
8233
8295
|
label: 'Телефон работодателя',
|
|
8234
8296
|
required: true,
|
|
8235
8297
|
},
|
|
8236
|
-
{ name: 'beginDate', required: true },
|
|
8298
|
+
{ name: 'beginDate', required: true, filledByEsia: true },
|
|
8237
8299
|
],
|
|
8238
8300
|
},
|
|
8239
8301
|
{
|
|
@@ -8275,16 +8337,22 @@
|
|
|
8275
8337
|
title: 'Совокупный доход',
|
|
8276
8338
|
},
|
|
8277
8339
|
{
|
|
8340
|
+
columns: 1,
|
|
8278
8341
|
inputs: [
|
|
8279
8342
|
{
|
|
8280
|
-
name: '
|
|
8281
|
-
|
|
8343
|
+
name: 'confirmationIncome',
|
|
8344
|
+
required: true,
|
|
8345
|
+
filledByEsia: true,
|
|
8282
8346
|
},
|
|
8283
8347
|
],
|
|
8284
8348
|
},
|
|
8285
8349
|
{
|
|
8286
|
-
|
|
8287
|
-
|
|
8350
|
+
inputs: [
|
|
8351
|
+
{
|
|
8352
|
+
name: 'infoCard',
|
|
8353
|
+
label: 'Сумма основного и дополнительных доходов после вычета налога',
|
|
8354
|
+
},
|
|
8355
|
+
],
|
|
8288
8356
|
},
|
|
8289
8357
|
{
|
|
8290
8358
|
columns: 1,
|
|
@@ -10881,7 +10949,7 @@
|
|
|
10881
10949
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10882
10950
|
});
|
|
10883
10951
|
|
|
10884
|
-
const packageVersion = "0.14.
|
|
10952
|
+
const packageVersion = "0.14.823";
|
|
10885
10953
|
|
|
10886
10954
|
exports.Blocks = Blocks;
|
|
10887
10955
|
exports.ContentPage = ContentPage;
|