@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
package/bundle/bundle.umd.js
CHANGED
|
@@ -2022,7 +2022,7 @@
|
|
|
2022
2022
|
|
|
2023
2023
|
const PhoneField = JSX(({ field, input }) => {
|
|
2024
2024
|
const fieldName = input?.name || 'phone';
|
|
2025
|
-
return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...field(fieldName), ...input });
|
|
2025
|
+
return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(fieldName), ...input }));
|
|
2026
2026
|
});
|
|
2027
2027
|
|
|
2028
2028
|
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);
|
|
@@ -2202,7 +2202,7 @@
|
|
|
2202
2202
|
function shouldRenderField({ input, field, }) {
|
|
2203
2203
|
const { condition } = input;
|
|
2204
2204
|
const { value } = field(condition?.name || '');
|
|
2205
|
-
return !condition || condition?.values?.
|
|
2205
|
+
return !condition || condition?.values?.includes(value?.key ?? value);
|
|
2206
2206
|
}
|
|
2207
2207
|
|
|
2208
2208
|
const PRODUCT_REF = {
|
|
@@ -2429,10 +2429,12 @@
|
|
|
2429
2429
|
|
|
2430
2430
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
2431
2431
|
const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
|
|
2432
|
+
const retailCyrillicPattern = /^[\u0400-\u04FF-\s]+$/u;
|
|
2432
2433
|
const addressDaDataValidate = (address) => Boolean(address.region && (address.city || address.locality) && address.house);
|
|
2433
2434
|
const addressDaDataValidator = () => validator(addressDaDataValidate)(ADDRESS_ERROR_MESSAGE);
|
|
2434
2435
|
const addressOrganizationValidator = () => validator((address) => Boolean(address.fiasCode && (address.city || address.locality) && address.house))(ADDRESS_ERROR_MESSAGE);
|
|
2435
2436
|
const codeWordValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 3 && _.length <= 21 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE);
|
|
2437
|
+
const nameRetailValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && retailCyrillicPattern.test(_))(errorMsg ?? ERROR_MESSAGE);
|
|
2436
2438
|
const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && /^[0-9]{1,2}$/g.test(_))(errorMsg ?? ERROR_MESSAGE);
|
|
2437
2439
|
const lengthStringValidator = (inputLength, errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= inputLength)(errorMsg ?? ERROR_MESSAGE);
|
|
2438
2440
|
const limitedBirthdayValidate = ({ minAge, maxAge }) => (date) => {
|
|
@@ -2556,6 +2558,9 @@
|
|
|
2556
2558
|
partInBusiness: defaultValidator(),
|
|
2557
2559
|
regionRetail: defaultSelectValidator('Выберите регион'),
|
|
2558
2560
|
latinSurname: defaultValidator('Укажите фамилию'),
|
|
2561
|
+
surname: nameRetailValidator('Укажите свою фамилию на кириллице'),
|
|
2562
|
+
name: nameRetailValidator('Укажите своё имя на кириллице'),
|
|
2563
|
+
middleName: nameRetailValidator('Укажите своё отчество на кириллице'),
|
|
2559
2564
|
};
|
|
2560
2565
|
const validatorObj = {
|
|
2561
2566
|
...validatorRetailObj,
|
|
@@ -2655,11 +2660,11 @@
|
|
|
2655
2660
|
{
|
|
2656
2661
|
columns: 2,
|
|
2657
2662
|
inputs: [
|
|
2658
|
-
{ name: 'surname', required: true, dadata: true },
|
|
2659
|
-
{ name: 'name', required: true, dadata: true },
|
|
2660
|
-
{ name: 'middleName', dadata: true },
|
|
2661
|
-
{ name: 'limitedBirthday', required: true },
|
|
2662
|
-
{ name: 'phone', required: true },
|
|
2663
|
+
{ name: 'surname', required: true, dadata: true, filledByEsia: true },
|
|
2664
|
+
{ name: 'name', required: true, dadata: true, filledByEsia: true },
|
|
2665
|
+
{ name: 'middleName', dadata: true, filledByEsia: true },
|
|
2666
|
+
{ name: 'limitedBirthday', required: true, filledByEsia: true },
|
|
2667
|
+
{ name: 'phone', required: true, filledByEsia: true },
|
|
2663
2668
|
{ name: 'email', required: true, dadata: true },
|
|
2664
2669
|
],
|
|
2665
2670
|
},
|
|
@@ -2669,6 +2674,57 @@
|
|
|
2669
2674
|
];
|
|
2670
2675
|
};
|
|
2671
2676
|
|
|
2677
|
+
const getTraceId = () => {
|
|
2678
|
+
const result = new Uint8Array(8);
|
|
2679
|
+
globalThis.crypto.getRandomValues(result);
|
|
2680
|
+
return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
|
|
2681
|
+
};
|
|
2682
|
+
|
|
2683
|
+
const fetchRetailJSON = async (url, method, body) => {
|
|
2684
|
+
try {
|
|
2685
|
+
const response = await doRequest(url, method, body);
|
|
2686
|
+
return response.json();
|
|
2687
|
+
}
|
|
2688
|
+
catch (err) {
|
|
2689
|
+
console.error(err);
|
|
2690
|
+
return null;
|
|
2691
|
+
}
|
|
2692
|
+
};
|
|
2693
|
+
async function doRequest(url, method, body) {
|
|
2694
|
+
const traceId = getTraceId();
|
|
2695
|
+
return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
|
|
2696
|
+
method,
|
|
2697
|
+
headers: {
|
|
2698
|
+
'Content-Type': 'application/json',
|
|
2699
|
+
'X-B3-Sampled': '1',
|
|
2700
|
+
'X-B3-Spanid': traceId,
|
|
2701
|
+
'X-B3-Traceid': traceId,
|
|
2702
|
+
...getAuthorizationHeaders(),
|
|
2703
|
+
},
|
|
2704
|
+
credentials: 'include',
|
|
2705
|
+
body: body ? JSON.stringify(body) : null,
|
|
2706
|
+
});
|
|
2707
|
+
}
|
|
2708
|
+
const getAuthorizationHeaders = () => {
|
|
2709
|
+
const token = sessionStorage.getItem('accessToken');
|
|
2710
|
+
return token ? { Authorization: `Bearer ${token}` } : null;
|
|
2711
|
+
};
|
|
2712
|
+
|
|
2713
|
+
const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
|
|
2714
|
+
|
|
2715
|
+
const EsiaLoginBanner = JSX(() => {
|
|
2716
|
+
const navigator = locationNavigator();
|
|
2717
|
+
const handleAuth = useCallback(async () => {
|
|
2718
|
+
const resp = await getLink({
|
|
2719
|
+
redirectUri: globalThis.location.origin + globalThis.location.pathname,
|
|
2720
|
+
});
|
|
2721
|
+
if (resp?.link) {
|
|
2722
|
+
navigator.assign(resp.link);
|
|
2723
|
+
}
|
|
2724
|
+
}, []);
|
|
2725
|
+
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" })] }));
|
|
2726
|
+
});
|
|
2727
|
+
|
|
2672
2728
|
const debounce = (fn, delay = 600) => {
|
|
2673
2729
|
let timerId;
|
|
2674
2730
|
const debouncedCallback = (...args) => {
|
|
@@ -3555,42 +3611,6 @@
|
|
|
3555
3611
|
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
3556
3612
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
3557
3613
|
|
|
3558
|
-
const getTraceId = () => {
|
|
3559
|
-
const result = new Uint8Array(8);
|
|
3560
|
-
globalThis.crypto.getRandomValues(result);
|
|
3561
|
-
return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
|
|
3562
|
-
};
|
|
3563
|
-
|
|
3564
|
-
const fetchRetailJSON = async (url, method, body) => {
|
|
3565
|
-
try {
|
|
3566
|
-
const response = await doRequest(url, method, body);
|
|
3567
|
-
return response.json();
|
|
3568
|
-
}
|
|
3569
|
-
catch (err) {
|
|
3570
|
-
console.error(err);
|
|
3571
|
-
return null;
|
|
3572
|
-
}
|
|
3573
|
-
};
|
|
3574
|
-
async function doRequest(url, method, body) {
|
|
3575
|
-
const traceId = getTraceId();
|
|
3576
|
-
return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
|
|
3577
|
-
method,
|
|
3578
|
-
headers: {
|
|
3579
|
-
'Content-Type': 'application/json',
|
|
3580
|
-
'X-B3-Sampled': '1',
|
|
3581
|
-
'X-B3-Spanid': traceId,
|
|
3582
|
-
'X-B3-Traceid': traceId,
|
|
3583
|
-
...getAuthorizationHeaders(),
|
|
3584
|
-
},
|
|
3585
|
-
credentials: 'include',
|
|
3586
|
-
body: body ? JSON.stringify(body) : null,
|
|
3587
|
-
});
|
|
3588
|
-
}
|
|
3589
|
-
const getAuthorizationHeaders = () => {
|
|
3590
|
-
const token = sessionStorage.getItem('accessToken');
|
|
3591
|
-
return token ? { Authorization: `Bearer ${token}` } : null;
|
|
3592
|
-
};
|
|
3593
|
-
|
|
3594
3614
|
const fetchRegionOffices = async (regionKey) => {
|
|
3595
3615
|
const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
|
|
3596
3616
|
regionRfCd: {
|
|
@@ -3820,7 +3840,7 @@
|
|
|
3820
3840
|
|
|
3821
3841
|
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 ?? '') })));
|
|
3822
3842
|
|
|
3823
|
-
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 })));
|
|
3843
|
+
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 ?? '') })));
|
|
3824
3844
|
|
|
3825
3845
|
const FIELD_NAME$2 = 'birthPlace';
|
|
3826
3846
|
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) })));
|
|
@@ -3884,7 +3904,8 @@
|
|
|
3884
3904
|
|
|
3885
3905
|
const ConfirmationIncomeField = JSX(({ field, input }) => {
|
|
3886
3906
|
const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
|
|
3887
|
-
|
|
3907
|
+
const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
|
|
3908
|
+
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 })] }));
|
|
3888
3909
|
});
|
|
3889
3910
|
|
|
3890
3911
|
const ConscriptionField = JSX(({ field, input }) => {
|
|
@@ -4428,10 +4449,10 @@
|
|
|
4428
4449
|
}
|
|
4429
4450
|
})();
|
|
4430
4451
|
}, [employerActivities, employerOrganization, organization, amountWorkers]);
|
|
4431
|
-
return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
|
|
4452
|
+
return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
|
|
4432
4453
|
});
|
|
4433
4454
|
|
|
4434
|
-
const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? '') })));
|
|
4455
|
+
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() })));
|
|
4435
4456
|
|
|
4436
4457
|
const DeliveryTimeField = JSX(({ field, input }) => {
|
|
4437
4458
|
const { data } = useLeadFormData('COURIER_DELIVERY_TIME');
|
|
@@ -4444,7 +4465,11 @@
|
|
|
4444
4465
|
|
|
4445
4466
|
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 })));
|
|
4446
4467
|
|
|
4447
|
-
const DulIssueDateField = JSX(({ field, input }) =>
|
|
4468
|
+
const DulIssueDateField = JSX(({ field, input }) => {
|
|
4469
|
+
const birthDate = field('limitedBirthday')?.value;
|
|
4470
|
+
const startDulIssueDate = useMemo(() => new Date(birthDate.getFullYear() + 14, birthDate.getMonth(), birthDate.getDate()), [birthDate]);
|
|
4471
|
+
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 }));
|
|
4472
|
+
});
|
|
4448
4473
|
|
|
4449
4474
|
const DulIssuedByField = JSX(({ field, input }) => {
|
|
4450
4475
|
const { value: dulSubdivisionCode, onChange: changeDulSubdivisionCode } = field('dulSubdivisionCode');
|
|
@@ -4507,7 +4532,7 @@
|
|
|
4507
4532
|
const MIN_YEARS = 0;
|
|
4508
4533
|
const Experience5YearsField = JSX(({ field, input }) => {
|
|
4509
4534
|
const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
|
|
4510
|
-
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 }));
|
|
4535
|
+
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 ?? '') }));
|
|
4511
4536
|
});
|
|
4512
4537
|
|
|
4513
4538
|
const FamilyMembersField = JSX(({ field, input }) => {
|
|
@@ -4528,7 +4553,7 @@
|
|
|
4528
4553
|
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 }));
|
|
4529
4554
|
});
|
|
4530
4555
|
|
|
4531
|
-
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 })));
|
|
4556
|
+
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 ?? '') })));
|
|
4532
4557
|
|
|
4533
4558
|
const HousingField = JSX(({ field, input }) => {
|
|
4534
4559
|
const { data: housing } = useLeadFormData('HOUSE_TYPE');
|
|
@@ -4537,9 +4562,9 @@
|
|
|
4537
4562
|
|
|
4538
4563
|
const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
|
|
4539
4564
|
|
|
4540
|
-
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 })));
|
|
4565
|
+
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 ?? '') })));
|
|
4541
4566
|
|
|
4542
|
-
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 })));
|
|
4567
|
+
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 ?? '') })));
|
|
4543
4568
|
|
|
4544
4569
|
const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
|
|
4545
4570
|
const isLatin = (_ = '') => latinPattern.test(_);
|
|
@@ -4670,9 +4695,23 @@
|
|
|
4670
4695
|
];
|
|
4671
4696
|
const MethodObtainField = JSX(({ field, input }) => (jsx(RadioButtonGroupControl, { orientation: "horizontal", items: METHODS_OF_OBTAIN, ...field(input?.name ?? '') })));
|
|
4672
4697
|
|
|
4673
|
-
const MiddleNameField = JSX(({ field, input }) =>
|
|
4698
|
+
const MiddleNameField = JSX(({ field, input }) => {
|
|
4699
|
+
const onChange = useCallback((value) => {
|
|
4700
|
+
if (retailCyrillicPattern.test(value) || value.length === 0) {
|
|
4701
|
+
field('middleName')?.onChange?.(value);
|
|
4702
|
+
}
|
|
4703
|
+
}, [field]);
|
|
4704
|
+
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 }));
|
|
4705
|
+
});
|
|
4674
4706
|
|
|
4675
|
-
const NameField = JSX(({ field, input }) =>
|
|
4707
|
+
const NameField = JSX(({ field, input }) => {
|
|
4708
|
+
const onChange = useCallback((value) => {
|
|
4709
|
+
if (retailCyrillicPattern.test(value) || value.length === 0) {
|
|
4710
|
+
field('name')?.onChange?.(value);
|
|
4711
|
+
}
|
|
4712
|
+
}, [field]);
|
|
4713
|
+
return (jsx(DaDataInputControl, { label: "\u0418\u043C\u044F", maxLength: 60, disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(input?.name ?? ''), ...input, onChange: onChange }));
|
|
4714
|
+
});
|
|
4676
4715
|
|
|
4677
4716
|
const OrganizationField = JSX(({ field, input }) => {
|
|
4678
4717
|
const { data } = useLeadFormData('ORGANIZATION_TYPE');
|
|
@@ -4691,7 +4730,7 @@
|
|
|
4691
4730
|
field?.('inn')?.onChange?.(item.data?.inn);
|
|
4692
4731
|
updateOrganizationFields(store, field, item);
|
|
4693
4732
|
}, []);
|
|
4694
|
-
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 }));
|
|
4733
|
+
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 }));
|
|
4695
4734
|
});
|
|
4696
4735
|
|
|
4697
4736
|
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 })));
|
|
@@ -4827,11 +4866,18 @@
|
|
|
4827
4866
|
const SnilsField = JSX(({ field, input }) => (jsx(InputSnilsControl, { label: "\u0421\u041D\u0418\u041B\u0421", maxLength: 14, ...field(input?.name ?? ''), ...input })));
|
|
4828
4867
|
|
|
4829
4868
|
const FIELD_NAME = 'surname';
|
|
4830
|
-
const SurnameField = JSX(({ field, input }) =>
|
|
4869
|
+
const SurnameField = JSX(({ field, input }) => {
|
|
4870
|
+
const onChange = useCallback((value) => {
|
|
4871
|
+
if (retailCyrillicPattern.test(value) || value.length === 0) {
|
|
4872
|
+
field('surname')?.onChange?.(value);
|
|
4873
|
+
}
|
|
4874
|
+
}, [field]);
|
|
4875
|
+
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 }));
|
|
4876
|
+
});
|
|
4831
4877
|
|
|
4832
4878
|
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 })));
|
|
4833
4879
|
|
|
4834
|
-
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 })));
|
|
4880
|
+
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 ?? '') })));
|
|
4835
4881
|
|
|
4836
4882
|
const DELIVERY_CITIES_REF = {
|
|
4837
4883
|
$ref: '/wcms-resources/delivery-cities-data.json',
|
|
@@ -5461,7 +5507,7 @@
|
|
|
5461
5507
|
const participant = task.participants[0];
|
|
5462
5508
|
const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
|
|
5463
5509
|
const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
|
|
5464
|
-
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;
|
|
5510
|
+
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;
|
|
5465
5511
|
return {
|
|
5466
5512
|
currency: currency?.key,
|
|
5467
5513
|
paymentSystem: getSelectValue(paymentSystem),
|
|
@@ -5513,6 +5559,7 @@
|
|
|
5513
5559
|
monthsValue,
|
|
5514
5560
|
isAnnuity: paymentTypeCd?.key === 'ANNUITY',
|
|
5515
5561
|
},
|
|
5562
|
+
esiaAccountTypeCd: profile?.esiaAccountTypeCd,
|
|
5516
5563
|
...getParticipantIncomes(participantIncomes),
|
|
5517
5564
|
...getParticipantAddresses(participantAddresses),
|
|
5518
5565
|
...getParticipantContacts(participantContacts),
|
|
@@ -5567,39 +5614,6 @@
|
|
|
5567
5614
|
};
|
|
5568
5615
|
};
|
|
5569
5616
|
|
|
5570
|
-
const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
|
|
5571
|
-
|
|
5572
|
-
const EsiaLoginDialog = JSX(({ onClose }) => {
|
|
5573
|
-
const navigator = locationNavigator();
|
|
5574
|
-
const retailFormStore = useRetailFormStore();
|
|
5575
|
-
const handleAuth = useCallback(async () => {
|
|
5576
|
-
const resp = await getLink({
|
|
5577
|
-
redirectUri: globalThis.location.origin + globalThis.location.pathname,
|
|
5578
|
-
});
|
|
5579
|
-
if (resp?.link) {
|
|
5580
|
-
navigator.assign(resp.link);
|
|
5581
|
-
globalThis.location.href = resp.link;
|
|
5582
|
-
}
|
|
5583
|
-
}, []);
|
|
5584
|
-
const handleClose = useCallback(() => {
|
|
5585
|
-
if (retailFormStore.leadForm) {
|
|
5586
|
-
const leadForm = { ...retailFormStore.leadForm };
|
|
5587
|
-
delete leadForm.esiaAccountTypeCd;
|
|
5588
|
-
retailFormStore.leadForm = leadForm;
|
|
5589
|
-
}
|
|
5590
|
-
onClose?.();
|
|
5591
|
-
}, []);
|
|
5592
|
-
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" })] })] }) }));
|
|
5593
|
-
});
|
|
5594
|
-
|
|
5595
|
-
const useEsiaLoginDialog = (nextStepLink) => {
|
|
5596
|
-
const { open } = useDialog(EsiaLoginDialog);
|
|
5597
|
-
const navigator = locationNavigator();
|
|
5598
|
-
return useCallback(() => {
|
|
5599
|
-
open({ onClose: () => navigator.assign(nextStepLink) });
|
|
5600
|
-
}, [open, nextStepLink]);
|
|
5601
|
-
};
|
|
5602
|
-
|
|
5603
5617
|
// TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
|
|
5604
5618
|
const getUpdateUserProfileData = (profileId, formData, consents) => {
|
|
5605
5619
|
const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
|
|
@@ -5721,21 +5735,19 @@
|
|
|
5721
5735
|
|
|
5722
5736
|
/* eslint-disable max-lines */
|
|
5723
5737
|
// eslint-disable-next-line max-lines-per-function
|
|
5724
|
-
const useApplicationLeadApi = ({ programId, nextStepLink, productType,
|
|
5738
|
+
const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
|
|
5725
5739
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
5726
5740
|
const [ok, setOK] = useState();
|
|
5727
5741
|
const saveUserData = useSaveUserData();
|
|
5728
5742
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
5729
5743
|
const navigator = locationNavigator();
|
|
5730
|
-
const
|
|
5731
|
-
|
|
5744
|
+
const goToNextStep = useCallback(() => {
|
|
5745
|
+
navigator.assign(nextStepLink);
|
|
5746
|
+
}, []);
|
|
5747
|
+
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
5732
5748
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
5733
5749
|
const draftDialog = useDraftDialog();
|
|
5734
5750
|
const handleSubmit = useCallback(async (formData) => {
|
|
5735
|
-
if (esiaError) {
|
|
5736
|
-
navigator.assign(nextStepLink);
|
|
5737
|
-
return;
|
|
5738
|
-
}
|
|
5739
5751
|
try {
|
|
5740
5752
|
startSending();
|
|
5741
5753
|
const profileId = await createUserProfile({
|
|
@@ -5753,7 +5765,7 @@
|
|
|
5753
5765
|
});
|
|
5754
5766
|
verifyPhoneDialog.close();
|
|
5755
5767
|
if (productType === 'debitCard') {
|
|
5756
|
-
|
|
5768
|
+
goToNextStep();
|
|
5757
5769
|
}
|
|
5758
5770
|
else {
|
|
5759
5771
|
consentBkiDialog.open(formData.phone, profileId);
|
|
@@ -5792,7 +5804,7 @@
|
|
|
5792
5804
|
catch {
|
|
5793
5805
|
setOK(false);
|
|
5794
5806
|
}
|
|
5795
|
-
}, [
|
|
5807
|
+
}, []);
|
|
5796
5808
|
return { isSending, ok, handleSubmit };
|
|
5797
5809
|
};
|
|
5798
5810
|
const getAcceptedConsents = (formData, productType) => {
|
|
@@ -5875,7 +5887,10 @@
|
|
|
5875
5887
|
}
|
|
5876
5888
|
}, [target, key]);
|
|
5877
5889
|
|
|
5878
|
-
const
|
|
5890
|
+
const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
|
|
5891
|
+
saveToken(res);
|
|
5892
|
+
return res;
|
|
5893
|
+
});
|
|
5879
5894
|
|
|
5880
5895
|
const initialFormState = {
|
|
5881
5896
|
surname: '',
|
|
@@ -5893,19 +5908,24 @@
|
|
|
5893
5908
|
consentPhotoFlg: false,
|
|
5894
5909
|
consentFATCA: false,
|
|
5895
5910
|
};
|
|
5896
|
-
const getInitialFormState$1 = (inputs, savedForm) => {
|
|
5911
|
+
const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
|
|
5897
5912
|
if (savedForm) {
|
|
5898
|
-
return {
|
|
5913
|
+
return {
|
|
5914
|
+
...savedForm,
|
|
5915
|
+
limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
|
|
5916
|
+
...(!esiaAuthSuccess && {
|
|
5917
|
+
esiaAccountTypeCd: { key: '' },
|
|
5918
|
+
}),
|
|
5919
|
+
};
|
|
5899
5920
|
}
|
|
5900
5921
|
const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
|
|
5901
5922
|
return { ...formState };
|
|
5902
5923
|
};
|
|
5903
5924
|
|
|
5904
|
-
const uploadFile = async (file,
|
|
5925
|
+
const uploadFile = async (file, documentCategory, isPDF = false) => {
|
|
5905
5926
|
const fd = new FormData();
|
|
5906
|
-
fd.append('taskId', taskId);
|
|
5907
5927
|
fd.append('documentCategory', documentCategory);
|
|
5908
|
-
fd.append('file', file, '
|
|
5928
|
+
fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
|
|
5909
5929
|
const res = await globalThis
|
|
5910
5930
|
?.fetch?.(`/light-api-cash/v1/file`, {
|
|
5911
5931
|
method: 'POST',
|
|
@@ -5919,23 +5939,13 @@
|
|
|
5919
5939
|
return res;
|
|
5920
5940
|
};
|
|
5921
5941
|
|
|
5922
|
-
const parseEsiaProfile = async (esiaProfile,
|
|
5923
|
-
|
|
5942
|
+
const parseEsiaProfile = async (esiaProfile, isDebit) => {
|
|
5943
|
+
checkEsiaData(esiaProfile);
|
|
5944
|
+
const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
|
|
5924
5945
|
const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
|
|
5925
|
-
|
|
5926
|
-
if (
|
|
5927
|
-
await
|
|
5928
|
-
document: esiaAdditionalDocument.pdfFileWorkbook,
|
|
5929
|
-
taskId,
|
|
5930
|
-
category: 'CONFIRMING_INCOME_DOC',
|
|
5931
|
-
files,
|
|
5932
|
-
});
|
|
5933
|
-
await saveDocument({
|
|
5934
|
-
document: esiaAdditionalDocument.pdfFilePayout,
|
|
5935
|
-
taskId,
|
|
5936
|
-
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
5937
|
-
files,
|
|
5938
|
-
});
|
|
5946
|
+
let files = [];
|
|
5947
|
+
if (isFullEsiaData) {
|
|
5948
|
+
files = await saveDocuments(esiaAdditionalDocument);
|
|
5939
5949
|
}
|
|
5940
5950
|
const mainData = {
|
|
5941
5951
|
name: profile.name,
|
|
@@ -5952,11 +5962,11 @@
|
|
|
5952
5962
|
birthPlace: addInfo.birthPlace,
|
|
5953
5963
|
addressRegistration: buildAddress(addressRegistration),
|
|
5954
5964
|
addressFact: buildAddress(addressFact),
|
|
5955
|
-
esiaAccountTypeCd: profile.esiaAccountType,
|
|
5965
|
+
esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
|
|
5956
5966
|
};
|
|
5957
5967
|
return {
|
|
5958
5968
|
...mainData,
|
|
5959
|
-
...(
|
|
5969
|
+
...(isFullEsiaData && {
|
|
5960
5970
|
snils: addInfo.snils,
|
|
5961
5971
|
inn: esiaAdditionalDocument.inn,
|
|
5962
5972
|
wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
|
|
@@ -5965,6 +5975,9 @@
|
|
|
5965
5975
|
generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
|
|
5966
5976
|
lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
|
|
5967
5977
|
jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
5978
|
+
esiaAccountTypeCd: profile.esiaAccountType,
|
|
5979
|
+
confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
|
|
5980
|
+
employment: { key: 'WORK', text: 'Работаю' },
|
|
5968
5981
|
files,
|
|
5969
5982
|
}),
|
|
5970
5983
|
};
|
|
@@ -5997,43 +6010,60 @@
|
|
|
5997
6010
|
};
|
|
5998
6011
|
};
|
|
5999
6012
|
const getYearFromMonth = (month) => Math.floor(month / 12);
|
|
6000
|
-
const
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6013
|
+
const saveDocuments = async (esiaAdditionalDocument) => {
|
|
6014
|
+
const files = [];
|
|
6015
|
+
const documents = [
|
|
6016
|
+
{
|
|
6017
|
+
file: esiaAdditionalDocument.pdfFileWorkbook,
|
|
6018
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
6019
|
+
isPDF: true,
|
|
6020
|
+
},
|
|
6021
|
+
{
|
|
6022
|
+
file: esiaAdditionalDocument.pdfFilePayout,
|
|
6023
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
6024
|
+
isPDF: true,
|
|
6025
|
+
},
|
|
6026
|
+
{
|
|
6027
|
+
file: esiaAdditionalDocument.pdfFileSigPayout,
|
|
6028
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
6029
|
+
isPDF: true,
|
|
6030
|
+
},
|
|
6031
|
+
{
|
|
6032
|
+
file: esiaAdditionalDocument.xmlFilePayout,
|
|
6033
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
6034
|
+
isPDF: false,
|
|
6035
|
+
},
|
|
6036
|
+
{
|
|
6037
|
+
file: esiaAdditionalDocument.xmlFileSigPayout,
|
|
6038
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
6039
|
+
isPDF: false,
|
|
6040
|
+
},
|
|
6041
|
+
{
|
|
6042
|
+
file: esiaAdditionalDocument.xmlFileWorkbook,
|
|
6043
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
6044
|
+
isPDF: false,
|
|
6045
|
+
},
|
|
6046
|
+
{
|
|
6047
|
+
file: esiaAdditionalDocument.pdfFileSigWorkbook,
|
|
6048
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
6049
|
+
isPDF: true,
|
|
6050
|
+
},
|
|
6051
|
+
{
|
|
6052
|
+
file: esiaAdditionalDocument.xmlFileSigWorkbook,
|
|
6053
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
6054
|
+
isPDF: false,
|
|
6055
|
+
},
|
|
6031
6056
|
];
|
|
6032
|
-
|
|
6033
|
-
|
|
6057
|
+
for (const doc of documents) {
|
|
6058
|
+
const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
|
|
6059
|
+
await fetch(`${contentType},${doc.file}`)
|
|
6060
|
+
.then((res) => res.blob())
|
|
6061
|
+
.then((value) => uploadFile(value, doc.category, doc.isPDF))
|
|
6062
|
+
.then((file) => files.push(file));
|
|
6034
6063
|
}
|
|
6064
|
+
return files;
|
|
6035
6065
|
};
|
|
6036
|
-
const
|
|
6066
|
+
const checkEsiaData = (esiaProfile) => {
|
|
6037
6067
|
const { profile, document, addressRegistration } = esiaProfile;
|
|
6038
6068
|
const data = [
|
|
6039
6069
|
profile.name,
|
|
@@ -6041,7 +6071,6 @@
|
|
|
6041
6071
|
profile.midname,
|
|
6042
6072
|
profile.birthDate,
|
|
6043
6073
|
profile.phone,
|
|
6044
|
-
profile.email,
|
|
6045
6074
|
document.dulIssueDate,
|
|
6046
6075
|
document.dulIssuedBy,
|
|
6047
6076
|
document.dulNumber,
|
|
@@ -6054,75 +6083,97 @@
|
|
|
6054
6083
|
throw new Error();
|
|
6055
6084
|
}
|
|
6056
6085
|
};
|
|
6086
|
+
const checkEsiaAdditionalDocument = (esiaProfile) => {
|
|
6087
|
+
const { esiaAdditionalDocument } = esiaProfile;
|
|
6088
|
+
const data = [
|
|
6089
|
+
esiaAdditionalDocument?.inn,
|
|
6090
|
+
esiaAdditionalDocument?.averageMonthlyIncome?.toString(),
|
|
6091
|
+
esiaAdditionalDocument?.startWorkDate,
|
|
6092
|
+
esiaAdditionalDocument?.workLengthInFiveYears?.toString(),
|
|
6093
|
+
esiaAdditionalDocument?.workLength?.toString(),
|
|
6094
|
+
esiaAdditionalDocument?.workLengthLastJob?.toString(),
|
|
6095
|
+
esiaAdditionalDocument?.jobsNumberInFiveYears?.toString(),
|
|
6096
|
+
esiaAdditionalDocument?.pdfFilePayout,
|
|
6097
|
+
esiaAdditionalDocument?.pdfFileWorkbook,
|
|
6098
|
+
esiaAdditionalDocument?.pdfFileSigPayout,
|
|
6099
|
+
esiaAdditionalDocument?.xmlFilePayout,
|
|
6100
|
+
esiaAdditionalDocument?.xmlFileSigPayout,
|
|
6101
|
+
esiaAdditionalDocument?.xmlFileWorkbook,
|
|
6102
|
+
esiaAdditionalDocument?.pdfFileSigWorkbook,
|
|
6103
|
+
esiaAdditionalDocument?.xmlFileSigWorkbook,
|
|
6104
|
+
];
|
|
6105
|
+
return data.every((_) => Boolean(_));
|
|
6106
|
+
};
|
|
6057
6107
|
|
|
6058
|
-
const useInitApplicationLead = ({ inputs,
|
|
6059
|
-
const navigator = locationNavigator();
|
|
6060
|
-
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
6108
|
+
const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
|
|
6061
6109
|
const leadFormStore = useLeadFormStore();
|
|
6062
6110
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
6063
|
-
const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
|
|
6064
|
-
const
|
|
6065
|
-
|
|
6111
|
+
const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
|
|
6112
|
+
const requestEsiaProfile = useCallback(async (code, state) => {
|
|
6113
|
+
setEsiaStatus(EsiaStatuses.Pending);
|
|
6066
6114
|
try {
|
|
6067
|
-
const data = await
|
|
6068
|
-
profileId,
|
|
6115
|
+
const data = await esiaRequestProfile({
|
|
6069
6116
|
code,
|
|
6070
6117
|
state,
|
|
6071
6118
|
redirectUri: globalThis.location?.href,
|
|
6119
|
+
authorize: true,
|
|
6072
6120
|
});
|
|
6073
|
-
if (data
|
|
6074
|
-
const parsedData = await parseEsiaProfile(data,
|
|
6121
|
+
if (data) {
|
|
6122
|
+
const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
|
|
6075
6123
|
saveForm((_) => ({
|
|
6076
6124
|
..._,
|
|
6077
6125
|
...parsedData,
|
|
6078
6126
|
}));
|
|
6127
|
+
setEsiaStatus(EsiaStatuses.Success);
|
|
6079
6128
|
}
|
|
6080
|
-
navigator.assign(nextStepLink);
|
|
6081
6129
|
}
|
|
6082
6130
|
catch {
|
|
6083
|
-
|
|
6084
|
-
}
|
|
6085
|
-
finally {
|
|
6086
|
-
endLoading();
|
|
6131
|
+
setEsiaStatus(EsiaStatuses.Error);
|
|
6087
6132
|
}
|
|
6088
|
-
}, [
|
|
6133
|
+
}, []);
|
|
6089
6134
|
useEffect(() => {
|
|
6090
6135
|
leadFormStore.productType = productType;
|
|
6091
|
-
const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
|
|
6092
6136
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
6093
6137
|
const code = params.get('code');
|
|
6094
6138
|
const state = params.get('state');
|
|
6095
|
-
if (
|
|
6096
|
-
|
|
6139
|
+
if (code && state) {
|
|
6140
|
+
requestEsiaProfile(code, state);
|
|
6097
6141
|
}
|
|
6098
6142
|
else {
|
|
6099
6143
|
sessionStorage.removeItem('accessToken');
|
|
6100
6144
|
sessionStorage.removeItem('refreshToken');
|
|
6101
6145
|
}
|
|
6102
6146
|
}, []);
|
|
6103
|
-
return
|
|
6147
|
+
return initialFormState;
|
|
6104
6148
|
};
|
|
6105
6149
|
|
|
6150
|
+
var EsiaStatuses;
|
|
6151
|
+
(function (EsiaStatuses) {
|
|
6152
|
+
EsiaStatuses["Success"] = "SUCCESS";
|
|
6153
|
+
EsiaStatuses["Error"] = "ERROR";
|
|
6154
|
+
EsiaStatuses["Pending"] = "PENDING";
|
|
6155
|
+
})(EsiaStatuses || (EsiaStatuses = {}));
|
|
6106
6156
|
const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
|
|
6107
|
-
const [
|
|
6157
|
+
const [esiaStatus, setEsiaStatus] = useState();
|
|
6158
|
+
const leadForm = useRef(null);
|
|
6108
6159
|
const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
|
|
6109
6160
|
const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
|
|
6110
6161
|
const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
|
|
6111
6162
|
const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
|
|
6112
|
-
const
|
|
6163
|
+
const initialFormState = useInitApplicationLead({
|
|
6113
6164
|
inputs,
|
|
6114
6165
|
nextStepLink,
|
|
6115
6166
|
productType,
|
|
6116
|
-
|
|
6167
|
+
setEsiaStatus,
|
|
6168
|
+
esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
|
|
6117
6169
|
});
|
|
6118
6170
|
const { isSending, ok, handleSubmit } = useApplicationLeadApi({
|
|
6119
6171
|
programId,
|
|
6120
6172
|
nextStepLink,
|
|
6121
6173
|
productType,
|
|
6122
|
-
esiaError,
|
|
6123
6174
|
data,
|
|
6124
6175
|
});
|
|
6125
|
-
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
6176
|
+
const [, { field, onSubmit, reset }] = useForm(initialFormState, {
|
|
6126
6177
|
formValidator,
|
|
6127
6178
|
onSubmit: handleSubmit,
|
|
6128
6179
|
});
|
|
@@ -6132,7 +6183,17 @@
|
|
|
6132
6183
|
responseTypeDialog.open({ ok });
|
|
6133
6184
|
}
|
|
6134
6185
|
}, [ok]);
|
|
6135
|
-
|
|
6186
|
+
useEffect(() => {
|
|
6187
|
+
if (esiaStatus && leadForm?.current) {
|
|
6188
|
+
leadForm.current.scrollIntoView({
|
|
6189
|
+
block: 'start',
|
|
6190
|
+
});
|
|
6191
|
+
}
|
|
6192
|
+
if (esiaStatus === EsiaStatuses.Success) {
|
|
6193
|
+
reset();
|
|
6194
|
+
}
|
|
6195
|
+
}, [leadForm?.current, esiaStatus]);
|
|
6196
|
+
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] })] }));
|
|
6136
6197
|
});
|
|
6137
6198
|
const getInputs = (applicationFormData) => (applicationFormData?.flatMap((_) => _?.inputs) || []);
|
|
6138
6199
|
const getExtendedValidatorObj = (productType) => ({
|
|
@@ -7846,6 +7907,7 @@
|
|
|
7846
7907
|
mandatoryPayments: undefined,
|
|
7847
7908
|
snils: '',
|
|
7848
7909
|
armyIdFlg: false,
|
|
7910
|
+
esiaAccountTypeCd: { key: '', text: '' },
|
|
7849
7911
|
},
|
|
7850
7912
|
{
|
|
7851
7913
|
bankruptcyFlg: false,
|
|
@@ -8241,7 +8303,7 @@
|
|
|
8241
8303
|
label: 'Телефон работодателя',
|
|
8242
8304
|
required: true,
|
|
8243
8305
|
},
|
|
8244
|
-
{ name: 'beginDate', required: true },
|
|
8306
|
+
{ name: 'beginDate', required: true, filledByEsia: true },
|
|
8245
8307
|
],
|
|
8246
8308
|
},
|
|
8247
8309
|
{
|
|
@@ -8283,16 +8345,22 @@
|
|
|
8283
8345
|
title: 'Совокупный доход',
|
|
8284
8346
|
},
|
|
8285
8347
|
{
|
|
8348
|
+
columns: 1,
|
|
8286
8349
|
inputs: [
|
|
8287
8350
|
{
|
|
8288
|
-
name: '
|
|
8289
|
-
|
|
8351
|
+
name: 'confirmationIncome',
|
|
8352
|
+
required: true,
|
|
8353
|
+
filledByEsia: true,
|
|
8290
8354
|
},
|
|
8291
8355
|
],
|
|
8292
8356
|
},
|
|
8293
8357
|
{
|
|
8294
|
-
|
|
8295
|
-
|
|
8358
|
+
inputs: [
|
|
8359
|
+
{
|
|
8360
|
+
name: 'infoCard',
|
|
8361
|
+
label: 'Сумма основного и дополнительных доходов после вычета налога',
|
|
8362
|
+
},
|
|
8363
|
+
],
|
|
8296
8364
|
},
|
|
8297
8365
|
{
|
|
8298
8366
|
columns: 1,
|
|
@@ -11593,7 +11661,7 @@
|
|
|
11593
11661
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11594
11662
|
});
|
|
11595
11663
|
|
|
11596
|
-
const packageVersion = "0.14.
|
|
11664
|
+
const packageVersion = "0.14.823";
|
|
11597
11665
|
|
|
11598
11666
|
exports.Blocks = Blocks;
|
|
11599
11667
|
exports.ContentPage = ContentPage;
|