@redneckz/wildless-cms-uni-blocks 0.14.824 → 0.14.826
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 +233 -254
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- 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 +2 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/bundle/retail/api/checkCode.d.ts +0 -1
- package/{dist/retail/api/esiaRequestProfile.d.ts → bundle/retail/api/updateProfileEsia.d.ts} +4 -11
- package/bundle/retail/api/updateUserTask.d.ts +0 -1
- package/bundle/retail/api/uploadFile.d.ts +1 -1
- package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/bundle/retail/inputs.d.ts +5 -1
- package/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/bundle/retail/validator/getRetailFormValidator.d.ts +11 -0
- package/bundle/retail/validator/validators.d.ts +2 -0
- package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
- package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js +7 -11
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.js +7 -11
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/DebitForm/DebitFormStep.js +7 -11
- package/dist/components/DebitForm/DebitFormStep.js.map +1 -1
- package/dist/retail/api/checkCode.d.ts +0 -1
- package/dist/retail/api/checkCode.js +2 -3
- package/dist/retail/api/checkCode.js.map +1 -1
- package/{bundle/retail/api/esiaRequestProfile.d.ts → dist/retail/api/updateProfileEsia.d.ts} +4 -11
- package/dist/retail/api/updateProfileEsia.js +6 -0
- package/dist/retail/api/updateProfileEsia.js.map +1 -0
- package/dist/retail/api/updateUserTask.d.ts +0 -1
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/api/uploadFile.d.ts +1 -1
- package/dist/retail/api/uploadFile.js +3 -2
- package/dist/retail/api/uploadFile.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/dist/retail/components/Fields/BeginDateField.js +1 -2
- package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
- package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/dist/retail/components/Fields/DaDataInnField.js +1 -2
- package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/dist/retail/components/Fields/DulIssueDateField.js +1 -1
- package/dist/retail/components/Fields/DulIssueDateField.js.map +1 -1
- package/dist/retail/components/Fields/Experience5YearsField.js +1 -2
- package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
- package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/dist/retail/components/Fields/JobsNumberField.js +1 -2
- package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
- package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/dist/retail/components/Fields/OrganizationNameField.js +1 -2
- package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/dist/retail/components/Fields/WagesField.js +1 -2
- package/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/dist/retail/content.js +5 -11
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/inputs.d.ts +5 -1
- package/dist/retail/inputs.js +1 -1
- package/dist/retail/inputs.js.map +1 -1
- package/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/dist/retail/utils/mainFormStateMap.js +0 -1
- package/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/dist/retail/validator/getRetailFormValidator.d.ts +11 -0
- package/dist/retail/validator/getRetailFormValidator.js +14 -0
- package/dist/retail/validator/getRetailFormValidator.js.map +1 -0
- package/dist/retail/validator/validatorObj.js +1 -2
- package/dist/retail/validator/validatorObj.js.map +1 -1
- package/dist/retail/validator/validators.d.ts +2 -0
- package/dist/retail/validator/validators.js +11 -1
- package/dist/retail/validator/validators.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
- 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 +0 -5
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
- package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +7 -11
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.js +7 -11
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/DebitForm/DebitFormStep.js +7 -11
- package/lib/components/DebitForm/DebitFormStep.js.map +1 -1
- package/lib/retail/api/checkCode.d.ts +0 -1
- package/lib/retail/api/checkCode.js +1 -1
- package/lib/retail/api/checkCode.js.map +1 -1
- package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
- package/lib/retail/api/updateProfileEsia.js +3 -0
- package/lib/retail/api/updateProfileEsia.js.map +1 -0
- package/lib/retail/api/updateUserTask.d.ts +0 -1
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/api/uploadFile.d.ts +1 -1
- package/lib/retail/api/uploadFile.js +3 -2
- package/lib/retail/api/uploadFile.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/lib/retail/components/Fields/BeginDateField.js +1 -2
- package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
- package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/lib/retail/components/Fields/DaDataInnField.js +1 -2
- package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/lib/retail/components/Fields/DulIssueDateField.js +1 -1
- package/lib/retail/components/Fields/DulIssueDateField.js.map +1 -1
- package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
- package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
- package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/lib/retail/components/Fields/JobsNumberField.js +1 -2
- package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
- package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
- package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/lib/retail/components/Fields/WagesField.js +1 -2
- package/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/lib/retail/content.js +5 -11
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/inputs.d.ts +5 -1
- package/lib/retail/inputs.js +1 -1
- package/lib/retail/inputs.js.map +1 -1
- package/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/lib/retail/utils/mainFormStateMap.js +0 -1
- package/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/lib/retail/validator/getRetailFormValidator.d.ts +11 -0
- package/lib/retail/validator/getRetailFormValidator.js +11 -0
- package/lib/retail/validator/getRetailFormValidator.js.map +1 -0
- package/lib/retail/validator/validatorObj.js +2 -3
- package/lib/retail/validator/validatorObj.js.map +1 -1
- package/lib/retail/validator/validators.d.ts +2 -0
- package/lib/retail/validator/validators.js +8 -0
- package/lib/retail/validator/validators.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
- 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 +227 -247
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- 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 +2 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
- package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
- package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
- package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
- package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/mobile/bundle/retail/inputs.d.ts +5 -1
- package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/retail/validator/getRetailFormValidator.d.ts +11 -0
- package/mobile/bundle/retail/validator/validators.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
- 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 +2 -8
- 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 +53 -83
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
- 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 +24 -16
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +7 -11
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js +7 -11
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/DebitForm/DebitFormStep.js +7 -11
- package/mobile/dist/components/DebitForm/DebitFormStep.js.map +1 -1
- package/mobile/dist/retail/api/checkCode.d.ts +0 -1
- package/mobile/dist/retail/api/checkCode.js +2 -3
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
- package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
- package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
- package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
- 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 +3 -2
- package/mobile/dist/retail/api/uploadFile.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
- package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
- package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DulIssueDateField.js +1 -1
- package/mobile/dist/retail/components/Fields/DulIssueDateField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
- package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
- package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/dist/retail/content.js +5 -11
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/retail/inputs.d.ts +5 -1
- package/mobile/dist/retail/inputs.js +1 -1
- package/mobile/dist/retail/inputs.js.map +1 -1
- package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
- package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/dist/retail/validator/getRetailFormValidator.d.ts +11 -0
- package/mobile/dist/retail/validator/getRetailFormValidator.js +14 -0
- package/mobile/dist/retail/validator/getRetailFormValidator.js.map +1 -0
- package/mobile/dist/retail/validator/validatorObj.js +1 -2
- 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 +11 -1
- package/mobile/dist/retail/validator/validators.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
- 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 +0 -5
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
- 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 +2 -8
- 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 +53 -83
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
- 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 +24 -16
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +7 -11
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js +7 -11
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/DebitForm/DebitFormStep.js +7 -11
- package/mobile/lib/components/DebitForm/DebitFormStep.js.map +1 -1
- package/mobile/lib/retail/api/checkCode.d.ts +0 -1
- package/mobile/lib/retail/api/checkCode.js +1 -1
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
- package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
- package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
- package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
- 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 +3 -2
- package/mobile/lib/retail/api/uploadFile.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
- package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
- package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DulIssueDateField.js +1 -1
- package/mobile/lib/retail/components/Fields/DulIssueDateField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
- package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
- package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/lib/retail/content.js +5 -11
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/retail/inputs.d.ts +5 -1
- package/mobile/lib/retail/inputs.js +1 -1
- package/mobile/lib/retail/inputs.js.map +1 -1
- package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
- package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/lib/retail/validator/getRetailFormValidator.d.ts +11 -0
- package/mobile/lib/retail/validator/getRetailFormValidator.js +11 -0
- package/mobile/lib/retail/validator/getRetailFormValidator.js.map +1 -0
- package/mobile/lib/retail/validator/validatorObj.js +2 -3
- 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 +8 -0
- package/mobile/lib/retail/validator/validators.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
- 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 +10 -31
- package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +73 -57
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +7 -14
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +7 -14
- package/mobile/src/components/DebitForm/DebitFormStep.tsx +7 -14
- package/mobile/src/retail/api/checkCode.ts +1 -1
- package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
- package/mobile/src/retail/api/updateUserTask.ts +0 -1
- package/mobile/src/retail/api/uploadFile.ts +3 -2
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
- package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
- package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
- package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
- package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
- package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
- package/mobile/src/retail/components/Fields/DulIssueDateField.tsx +1 -1
- package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
- package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
- package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
- package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
- package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
- package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
- package/mobile/src/retail/content.tsx +5 -11
- package/mobile/src/retail/inputs.tsx +1 -1
- package/mobile/src/retail/model/NameFieldDef.ts +0 -1
- package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
- package/mobile/src/retail/validator/getRetailFormValidator.ts +27 -0
- package/mobile/src/retail/validator/validatorObj.ts +2 -2
- package/mobile/src/retail/validator/validators.ts +19 -0
- package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
- package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
- package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +73 -57
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +7 -14
- package/src/components/CreditForm/CreditFormStep.tsx +7 -14
- package/src/components/DebitForm/DebitFormStep.tsx +7 -14
- package/src/retail/api/checkCode.ts +1 -1
- package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
- package/src/retail/api/updateUserTask.ts +0 -1
- package/src/retail/api/uploadFile.ts +3 -2
- package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
- package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
- package/src/retail/components/Fields/BeginDateField.tsx +0 -2
- package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
- package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
- package/src/retail/components/Fields/DulIssueDateField.tsx +1 -1
- package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
- package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
- package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
- package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
- package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
- package/src/retail/components/Fields/WagesField.tsx +0 -2
- package/src/retail/content.tsx +5 -11
- package/src/retail/inputs.tsx +1 -1
- package/src/retail/model/NameFieldDef.ts +0 -1
- package/src/retail/utils/mainFormStateMap.ts +0 -1
- package/src/retail/validator/getRetailFormValidator.ts +27 -0
- package/src/retail/validator/validatorObj.ts +2 -2
- package/src/retail/validator/validators.ts +19 -0
- package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
- package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
- package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
- package/dist/retail/api/esiaRequestProfile.js +0 -10
- package/dist/retail/api/esiaRequestProfile.js.map +0 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
- package/lib/retail/api/esiaRequestProfile.js +0 -7
- package/lib/retail/api/esiaRequestProfile.js.map +0 -1
- package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
- package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
- package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
- package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
- package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
|
@@ -2030,7 +2030,7 @@
|
|
|
2030
2030
|
|
|
2031
2031
|
const PhoneField = JSX(({ field, input }) => {
|
|
2032
2032
|
const fieldName = input?.name || 'phone';
|
|
2033
|
-
return
|
|
2033
|
+
return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...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?.find((_) => _ === (value?.key ?? value));
|
|
2214
2214
|
}
|
|
2215
2215
|
|
|
2216
2216
|
const PRODUCT_REF = {
|
|
@@ -2460,6 +2460,14 @@
|
|
|
2460
2460
|
return true;
|
|
2461
2461
|
};
|
|
2462
2462
|
const limitedBirthdayValidator = (params) => validator(limitedBirthdayValidate(params))(params.errorMessage);
|
|
2463
|
+
const passportValidator = (birthDate) => validator((_) => {
|
|
2464
|
+
if (_ && birthDate) {
|
|
2465
|
+
return (_.getTime() >=
|
|
2466
|
+
new Date(birthDate?.getFullYear() + 14, birthDate?.getMonth(), birthDate?.getDate()).getTime());
|
|
2467
|
+
}
|
|
2468
|
+
return false;
|
|
2469
|
+
})('Укажите дату выдачи паспорта');
|
|
2470
|
+
const deliveryDateValidator = (errorMsg) => validator((_) => _?.getTime() >= new Date().getTime())(errorMsg);
|
|
2463
2471
|
const numberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 6)(errorMsg);
|
|
2464
2472
|
const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
|
|
2465
2473
|
const snilsValidate = (snils) => {
|
|
@@ -2514,7 +2522,7 @@
|
|
|
2514
2522
|
codeWord: codeWordValidator('Необходимо ввести кодовое слово'),
|
|
2515
2523
|
confirmationIncome: defaultSelectValidator(),
|
|
2516
2524
|
methodObtain: defaultValidator(),
|
|
2517
|
-
deliveryDate:
|
|
2525
|
+
deliveryDate: deliveryDateValidator('Укажите дату доставки'),
|
|
2518
2526
|
};
|
|
2519
2527
|
const validatorRetailObj = {
|
|
2520
2528
|
organization: defaultSelectValidator('Выберите тип организации'),
|
|
@@ -2551,7 +2559,6 @@
|
|
|
2551
2559
|
armyIdFlg: agreementValidator,
|
|
2552
2560
|
dulSerie: serieValidator('Укажите серию паспорта'),
|
|
2553
2561
|
dulNumber: numberValidator('Укажите номер паспорта'),
|
|
2554
|
-
dulIssueDate: defaultValidator('Укажите дату выдачи паспорта'),
|
|
2555
2562
|
dulSubdivisionCode: numberValidator('Укажите код подразделения'),
|
|
2556
2563
|
dulIssuedBy: defaultValidator('Укажите организацию, выдавшую паспорт'),
|
|
2557
2564
|
participantDateRegistration: defaultValidator('Укажите дату регистрации'),
|
|
@@ -2668,11 +2675,11 @@
|
|
|
2668
2675
|
{
|
|
2669
2676
|
columns: 2,
|
|
2670
2677
|
inputs: [
|
|
2671
|
-
{ name: 'surname', required: true, dadata: true
|
|
2672
|
-
{ name: 'name', required: true, dadata: true
|
|
2673
|
-
{ name: 'middleName', dadata: true
|
|
2674
|
-
{ name: 'limitedBirthday', required: true
|
|
2675
|
-
{ name: 'phone', required: true
|
|
2678
|
+
{ name: 'surname', required: true, dadata: true },
|
|
2679
|
+
{ name: 'name', required: true, dadata: true },
|
|
2680
|
+
{ name: 'middleName', dadata: true },
|
|
2681
|
+
{ name: 'limitedBirthday', required: true },
|
|
2682
|
+
{ name: 'phone', required: true },
|
|
2676
2683
|
{ name: 'email', required: true, dadata: true },
|
|
2677
2684
|
],
|
|
2678
2685
|
},
|
|
@@ -2682,57 +2689,6 @@
|
|
|
2682
2689
|
];
|
|
2683
2690
|
};
|
|
2684
2691
|
|
|
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
|
-
|
|
2736
2692
|
const debounce = (fn, delay = 600) => {
|
|
2737
2693
|
let timerId;
|
|
2738
2694
|
const debouncedCallback = (...args) => {
|
|
@@ -3619,6 +3575,42 @@
|
|
|
3619
3575
|
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
3620
3576
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
3621
3577
|
|
|
3578
|
+
const getTraceId = () => {
|
|
3579
|
+
const result = new Uint8Array(8);
|
|
3580
|
+
globalThis.crypto.getRandomValues(result);
|
|
3581
|
+
return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
|
|
3582
|
+
};
|
|
3583
|
+
|
|
3584
|
+
const fetchRetailJSON = async (url, method, body) => {
|
|
3585
|
+
try {
|
|
3586
|
+
const response = await doRequest(url, method, body);
|
|
3587
|
+
return response.json();
|
|
3588
|
+
}
|
|
3589
|
+
catch (err) {
|
|
3590
|
+
console.error(err);
|
|
3591
|
+
return null;
|
|
3592
|
+
}
|
|
3593
|
+
};
|
|
3594
|
+
async function doRequest(url, method, body) {
|
|
3595
|
+
const traceId = getTraceId();
|
|
3596
|
+
return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
|
|
3597
|
+
method,
|
|
3598
|
+
headers: {
|
|
3599
|
+
'Content-Type': 'application/json',
|
|
3600
|
+
'X-B3-Sampled': '1',
|
|
3601
|
+
'X-B3-Spanid': traceId,
|
|
3602
|
+
'X-B3-Traceid': traceId,
|
|
3603
|
+
...getAuthorizationHeaders(),
|
|
3604
|
+
},
|
|
3605
|
+
credentials: 'include',
|
|
3606
|
+
body: body ? JSON.stringify(body) : null,
|
|
3607
|
+
});
|
|
3608
|
+
}
|
|
3609
|
+
const getAuthorizationHeaders = () => {
|
|
3610
|
+
const token = sessionStorage.getItem('accessToken');
|
|
3611
|
+
return token ? { Authorization: `Bearer ${token}` } : null;
|
|
3612
|
+
};
|
|
3613
|
+
|
|
3622
3614
|
const fetchRegionOffices = async (regionKey) => {
|
|
3623
3615
|
const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
|
|
3624
3616
|
regionRfCd: {
|
|
@@ -3848,7 +3840,7 @@
|
|
|
3848
3840
|
|
|
3849
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 ?? '') })));
|
|
3850
3842
|
|
|
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
|
|
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 })));
|
|
3852
3844
|
|
|
3853
3845
|
const FIELD_NAME$2 = 'birthPlace';
|
|
3854
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) })));
|
|
@@ -3912,8 +3904,7 @@
|
|
|
3912
3904
|
|
|
3913
3905
|
const ConfirmationIncomeField = JSX(({ field, input }) => {
|
|
3914
3906
|
const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
|
|
3915
|
-
|
|
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 })] }));
|
|
3907
|
+
return (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 }));
|
|
3917
3908
|
});
|
|
3918
3909
|
|
|
3919
3910
|
const ConscriptionField = JSX(({ field, input }) => {
|
|
@@ -4457,7 +4448,7 @@
|
|
|
4457
4448
|
}
|
|
4458
4449
|
})();
|
|
4459
4450
|
}, [employerActivities, employerOrganization, organization, amountWorkers]);
|
|
4460
|
-
return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange
|
|
4451
|
+
return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
|
|
4461
4452
|
});
|
|
4462
4453
|
|
|
4463
4454
|
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() })));
|
|
@@ -4475,7 +4466,7 @@
|
|
|
4475
4466
|
|
|
4476
4467
|
const DulIssueDateField = JSX(({ field, input }) => {
|
|
4477
4468
|
const birthDate = field('limitedBirthday')?.value;
|
|
4478
|
-
const startDulIssueDate = useMemo(() => new Date(birthDate
|
|
4469
|
+
const startDulIssueDate = useMemo(() => new Date(birthDate?.getFullYear() + 14, birthDate?.getMonth(), birthDate?.getDate()), [birthDate]);
|
|
4479
4470
|
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
4471
|
});
|
|
4481
4472
|
|
|
@@ -4540,7 +4531,7 @@
|
|
|
4540
4531
|
const MIN_YEARS = 0;
|
|
4541
4532
|
const Experience5YearsField = JSX(({ field, input }) => {
|
|
4542
4533
|
const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
|
|
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
|
|
4534
|
+
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 }));
|
|
4544
4535
|
});
|
|
4545
4536
|
|
|
4546
4537
|
const FamilyMembersField = JSX(({ field, input }) => {
|
|
@@ -4561,7 +4552,7 @@
|
|
|
4561
4552
|
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 }));
|
|
4562
4553
|
});
|
|
4563
4554
|
|
|
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
|
|
4555
|
+
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 })));
|
|
4565
4556
|
|
|
4566
4557
|
const HousingField = JSX(({ field, input }) => {
|
|
4567
4558
|
const { data: housing } = useLeadFormData('HOUSE_TYPE');
|
|
@@ -4570,9 +4561,9 @@
|
|
|
4570
4561
|
|
|
4571
4562
|
const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
|
|
4572
4563
|
|
|
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
|
|
4564
|
+
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 })));
|
|
4574
4565
|
|
|
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
|
|
4566
|
+
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 })));
|
|
4576
4567
|
|
|
4577
4568
|
const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
|
|
4578
4569
|
const isLatin = (_ = '') => latinPattern.test(_);
|
|
@@ -4738,7 +4729,7 @@
|
|
|
4738
4729
|
field?.('inn')?.onChange?.(item.data?.inn);
|
|
4739
4730
|
updateOrganizationFields(store, field, item);
|
|
4740
4731
|
}, []);
|
|
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 ?? ''),
|
|
4732
|
+
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 }));
|
|
4742
4733
|
});
|
|
4743
4734
|
|
|
4744
4735
|
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 })));
|
|
@@ -4885,7 +4876,7 @@
|
|
|
4885
4876
|
|
|
4886
4877
|
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 })));
|
|
4887
4878
|
|
|
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
|
|
4879
|
+
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 })));
|
|
4889
4880
|
|
|
4890
4881
|
const DELIVERY_CITIES_REF = {
|
|
4891
4882
|
$ref: '/wcms-resources/delivery-cities-data.json',
|
|
@@ -4923,7 +4914,6 @@
|
|
|
4923
4914
|
addressRetail: AddressRetailField,
|
|
4924
4915
|
addressMatch: AddressMatchField,
|
|
4925
4916
|
sex: SexField,
|
|
4926
|
-
limitedBirthday: LimitedBirthdayField,
|
|
4927
4917
|
birthPlace: BirthPlaceField,
|
|
4928
4918
|
education: EducationField,
|
|
4929
4919
|
housing: HousingField,
|
|
@@ -4962,6 +4952,7 @@
|
|
|
4962
4952
|
calculator: CreditCalcField,
|
|
4963
4953
|
confirmationIncome: ConfirmationIncomeField,
|
|
4964
4954
|
inn: DaDataInnField,
|
|
4955
|
+
...InputsApplicationLeadMap,
|
|
4965
4956
|
};
|
|
4966
4957
|
const InputRetailCardMap = {
|
|
4967
4958
|
addressCourier: (props) => (jsx(AddressCourierField, { ...props, source: DELIVERY_CITIES_REF })),
|
|
@@ -5515,7 +5506,7 @@
|
|
|
5515
5506
|
const participant = task.participants[0];
|
|
5516
5507
|
const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
|
|
5517
5508
|
const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
|
|
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,
|
|
5509
|
+
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;
|
|
5519
5510
|
return {
|
|
5520
5511
|
currency: currency?.key,
|
|
5521
5512
|
paymentSystem: getSelectValue(paymentSystem),
|
|
@@ -5567,7 +5558,6 @@
|
|
|
5567
5558
|
monthsValue,
|
|
5568
5559
|
isAnnuity: paymentTypeCd?.key === 'ANNUITY',
|
|
5569
5560
|
},
|
|
5570
|
-
esiaAccountTypeCd: profile?.esiaAccountTypeCd,
|
|
5571
5561
|
...getParticipantIncomes(participantIncomes),
|
|
5572
5562
|
...getParticipantAddresses(participantAddresses),
|
|
5573
5563
|
...getParticipantContacts(participantContacts),
|
|
@@ -5622,6 +5612,39 @@
|
|
|
5622
5612
|
};
|
|
5623
5613
|
};
|
|
5624
5614
|
|
|
5615
|
+
const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
|
|
5616
|
+
|
|
5617
|
+
const EsiaLoginDialog = JSX(({ onClose }) => {
|
|
5618
|
+
const navigator = locationNavigator();
|
|
5619
|
+
const retailFormStore = useRetailFormStore();
|
|
5620
|
+
const handleAuth = useCallback(async () => {
|
|
5621
|
+
const resp = await getLink({
|
|
5622
|
+
redirectUri: globalThis.location.origin + globalThis.location.pathname,
|
|
5623
|
+
});
|
|
5624
|
+
if (resp?.link) {
|
|
5625
|
+
navigator.assign(resp.link);
|
|
5626
|
+
globalThis.location.href = resp.link;
|
|
5627
|
+
}
|
|
5628
|
+
}, []);
|
|
5629
|
+
const handleClose = useCallback(() => {
|
|
5630
|
+
if (retailFormStore.leadForm) {
|
|
5631
|
+
const leadForm = { ...retailFormStore.leadForm };
|
|
5632
|
+
delete leadForm.esiaAccountTypeCd;
|
|
5633
|
+
retailFormStore.leadForm = leadForm;
|
|
5634
|
+
}
|
|
5635
|
+
onClose?.();
|
|
5636
|
+
}, []);
|
|
5637
|
+
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" })] })] }) }));
|
|
5638
|
+
});
|
|
5639
|
+
|
|
5640
|
+
const useEsiaLoginDialog = (nextStepLink) => {
|
|
5641
|
+
const { open } = useDialog(EsiaLoginDialog);
|
|
5642
|
+
const navigator = locationNavigator();
|
|
5643
|
+
return useCallback(() => {
|
|
5644
|
+
open({ onClose: () => navigator.assign(nextStepLink) });
|
|
5645
|
+
}, [open, nextStepLink]);
|
|
5646
|
+
};
|
|
5647
|
+
|
|
5625
5648
|
// TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
|
|
5626
5649
|
const getUpdateUserProfileData = (profileId, formData, consents) => {
|
|
5627
5650
|
const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
|
|
@@ -5743,40 +5766,43 @@
|
|
|
5743
5766
|
|
|
5744
5767
|
/* eslint-disable max-lines */
|
|
5745
5768
|
// eslint-disable-next-line max-lines-per-function
|
|
5746
|
-
const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
|
|
5769
|
+
const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
|
|
5747
5770
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
5748
5771
|
const [ok, setOK] = useState();
|
|
5749
5772
|
const saveUserData = useSaveUserData();
|
|
5750
5773
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
5751
5774
|
const navigator = locationNavigator();
|
|
5752
|
-
const
|
|
5753
|
-
|
|
5754
|
-
}, []);
|
|
5755
|
-
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
5775
|
+
const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
|
|
5776
|
+
const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
|
|
5756
5777
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
5757
5778
|
const draftDialog = useDraftDialog();
|
|
5758
5779
|
const handleSubmit = useCallback(async (formData) => {
|
|
5780
|
+
if (esiaError) {
|
|
5781
|
+
navigator.assign(nextStepLink);
|
|
5782
|
+
return;
|
|
5783
|
+
}
|
|
5759
5784
|
try {
|
|
5760
5785
|
startSending();
|
|
5786
|
+
const transformedFormData = transformFormData(formData);
|
|
5761
5787
|
const profileId = await createUserProfile({
|
|
5762
|
-
profile: { phone: formatPhone(
|
|
5788
|
+
profile: { phone: formatPhone(transformedFormData.phone) },
|
|
5763
5789
|
});
|
|
5764
|
-
if (profileId &&
|
|
5790
|
+
if (profileId && transformedFormData?.phone) {
|
|
5765
5791
|
const sendCurrentTask = async () => {
|
|
5766
5792
|
await updateUserData({
|
|
5767
5793
|
programId,
|
|
5768
5794
|
profileId,
|
|
5769
|
-
formData,
|
|
5795
|
+
formData: transformedFormData,
|
|
5770
5796
|
productType,
|
|
5771
5797
|
saveUserData,
|
|
5772
5798
|
sendAspects,
|
|
5773
5799
|
});
|
|
5774
5800
|
verifyPhoneDialog.close();
|
|
5775
5801
|
if (productType === 'debitCard') {
|
|
5776
|
-
|
|
5802
|
+
openEsiaLoginDialog();
|
|
5777
5803
|
}
|
|
5778
5804
|
else {
|
|
5779
|
-
consentBkiDialog.open(
|
|
5805
|
+
consentBkiDialog.open(transformedFormData.phone, profileId);
|
|
5780
5806
|
}
|
|
5781
5807
|
};
|
|
5782
5808
|
const handleSuccessVerify = async () => {
|
|
@@ -5802,7 +5828,7 @@
|
|
|
5802
5828
|
};
|
|
5803
5829
|
const acceptedConsents = getAcceptedConsents(formData, productType);
|
|
5804
5830
|
verifyPhoneDialog.open({
|
|
5805
|
-
phone:
|
|
5831
|
+
phone: transformedFormData?.phone,
|
|
5806
5832
|
consents: acceptedConsents,
|
|
5807
5833
|
onSuccess: handleSuccessVerify,
|
|
5808
5834
|
});
|
|
@@ -5812,7 +5838,7 @@
|
|
|
5812
5838
|
catch {
|
|
5813
5839
|
setOK(false);
|
|
5814
5840
|
}
|
|
5815
|
-
}, []);
|
|
5841
|
+
}, [esiaError]);
|
|
5816
5842
|
return { isSending, ok, handleSubmit };
|
|
5817
5843
|
};
|
|
5818
5844
|
const getAcceptedConsents = (formData, productType) => {
|
|
@@ -5884,6 +5910,12 @@
|
|
|
5884
5910
|
consentAssignmentClaimsFlg: consentOthersFlg,
|
|
5885
5911
|
};
|
|
5886
5912
|
};
|
|
5913
|
+
const transformFormData = (formData) => ({
|
|
5914
|
+
...formData,
|
|
5915
|
+
surname: formData.surname?.trim(),
|
|
5916
|
+
name: formData.name?.trim(),
|
|
5917
|
+
middleName: formData.middleName?.trim(),
|
|
5918
|
+
});
|
|
5887
5919
|
|
|
5888
5920
|
const useSetter = (target, key) => useCallback((value) => {
|
|
5889
5921
|
const newValue = value instanceof Function ? value(target[key]) : value;
|
|
@@ -5895,10 +5927,7 @@
|
|
|
5895
5927
|
}
|
|
5896
5928
|
}, [target, key]);
|
|
5897
5929
|
|
|
5898
|
-
const
|
|
5899
|
-
saveToken(res);
|
|
5900
|
-
return res;
|
|
5901
|
-
});
|
|
5930
|
+
const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
|
|
5902
5931
|
|
|
5903
5932
|
const initialFormState = {
|
|
5904
5933
|
surname: '',
|
|
@@ -5916,24 +5945,19 @@
|
|
|
5916
5945
|
consentPhotoFlg: false,
|
|
5917
5946
|
consentFATCA: false,
|
|
5918
5947
|
};
|
|
5919
|
-
const getInitialFormState$1 = (inputs, savedForm
|
|
5948
|
+
const getInitialFormState$1 = (inputs, savedForm) => {
|
|
5920
5949
|
if (savedForm) {
|
|
5921
|
-
return {
|
|
5922
|
-
...savedForm,
|
|
5923
|
-
limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
|
|
5924
|
-
...(!esiaAuthSuccess && {
|
|
5925
|
-
esiaAccountTypeCd: { key: '' },
|
|
5926
|
-
}),
|
|
5927
|
-
};
|
|
5950
|
+
return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
|
|
5928
5951
|
}
|
|
5929
5952
|
const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
|
|
5930
5953
|
return { ...formState };
|
|
5931
5954
|
};
|
|
5932
5955
|
|
|
5933
|
-
const uploadFile = async (file,
|
|
5956
|
+
const uploadFile = async (file, taskId, documentCategory) => {
|
|
5934
5957
|
const fd = new FormData();
|
|
5958
|
+
fd.append('taskId', taskId);
|
|
5935
5959
|
fd.append('documentCategory', documentCategory);
|
|
5936
|
-
fd.append('file', file,
|
|
5960
|
+
fd.append('file', file, 'file.pdf');
|
|
5937
5961
|
const res = await globalThis
|
|
5938
5962
|
?.fetch?.(`/light-api-cash/v1/file`, {
|
|
5939
5963
|
method: 'POST',
|
|
@@ -5947,13 +5971,23 @@
|
|
|
5947
5971
|
return res;
|
|
5948
5972
|
};
|
|
5949
5973
|
|
|
5950
|
-
const parseEsiaProfile = async (esiaProfile, isDebit) => {
|
|
5951
|
-
|
|
5952
|
-
const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
|
|
5974
|
+
const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
|
|
5975
|
+
isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
|
|
5953
5976
|
const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
|
|
5954
|
-
|
|
5955
|
-
if (
|
|
5956
|
-
|
|
5977
|
+
const files = [];
|
|
5978
|
+
if (!isDebit) {
|
|
5979
|
+
await saveDocument({
|
|
5980
|
+
document: esiaAdditionalDocument.pdfFileWorkbook,
|
|
5981
|
+
taskId,
|
|
5982
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
5983
|
+
files,
|
|
5984
|
+
});
|
|
5985
|
+
await saveDocument({
|
|
5986
|
+
document: esiaAdditionalDocument.pdfFilePayout,
|
|
5987
|
+
taskId,
|
|
5988
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
5989
|
+
files,
|
|
5990
|
+
});
|
|
5957
5991
|
}
|
|
5958
5992
|
const mainData = {
|
|
5959
5993
|
name: profile.name,
|
|
@@ -5970,11 +6004,11 @@
|
|
|
5970
6004
|
birthPlace: addInfo.birthPlace,
|
|
5971
6005
|
addressRegistration: buildAddress(addressRegistration),
|
|
5972
6006
|
addressFact: buildAddress(addressFact),
|
|
5973
|
-
esiaAccountTypeCd:
|
|
6007
|
+
esiaAccountTypeCd: profile.esiaAccountType,
|
|
5974
6008
|
};
|
|
5975
6009
|
return {
|
|
5976
6010
|
...mainData,
|
|
5977
|
-
...(
|
|
6011
|
+
...(!isDebit && {
|
|
5978
6012
|
snils: addInfo.snils,
|
|
5979
6013
|
inn: esiaAdditionalDocument.inn,
|
|
5980
6014
|
wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
|
|
@@ -5983,9 +6017,6 @@
|
|
|
5983
6017
|
generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
|
|
5984
6018
|
lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
|
|
5985
6019
|
jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
5986
|
-
esiaAccountTypeCd: profile.esiaAccountType,
|
|
5987
|
-
confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
|
|
5988
|
-
employment: { key: 'WORK', text: 'Работаю' },
|
|
5989
6020
|
files,
|
|
5990
6021
|
}),
|
|
5991
6022
|
};
|
|
@@ -6018,60 +6049,43 @@
|
|
|
6018
6049
|
};
|
|
6019
6050
|
};
|
|
6020
6051
|
const getYearFromMonth = (month) => Math.floor(month / 12);
|
|
6021
|
-
const
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
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
|
-
},
|
|
6052
|
+
const saveDocument = async ({ document, taskId, category, files, }) => {
|
|
6053
|
+
await fetch(`data:application/pdf;base64,${document}`)
|
|
6054
|
+
.then((res) => res.blob())
|
|
6055
|
+
.then((value) => uploadFile(value, taskId, category))
|
|
6056
|
+
.then((file) => files.push(file));
|
|
6057
|
+
};
|
|
6058
|
+
const checkEsiaDataForCredit = (esiaProfile) => {
|
|
6059
|
+
const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
|
|
6060
|
+
const data = [
|
|
6061
|
+
profile.name,
|
|
6062
|
+
profile.surname,
|
|
6063
|
+
profile.midname,
|
|
6064
|
+
profile.birthDate,
|
|
6065
|
+
profile.phone,
|
|
6066
|
+
profile.email,
|
|
6067
|
+
document.dulIssueDate,
|
|
6068
|
+
document.dulIssuedBy,
|
|
6069
|
+
document.dulNumber,
|
|
6070
|
+
document.dulSerie,
|
|
6071
|
+
document.dulSubdivisionCode,
|
|
6072
|
+
addressRegistration,
|
|
6073
|
+
profile.esiaAccountType,
|
|
6074
|
+
esiaAdditionalDocument.inn,
|
|
6075
|
+
esiaAdditionalDocument.averageMonthlyIncome.toString(),
|
|
6076
|
+
esiaAdditionalDocument.startWorkDate,
|
|
6077
|
+
esiaAdditionalDocument.workLengthInFiveYears.toString(),
|
|
6078
|
+
esiaAdditionalDocument.workLength.toString(),
|
|
6079
|
+
esiaAdditionalDocument.workLengthLastJob.toString(),
|
|
6080
|
+
esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
6081
|
+
esiaAdditionalDocument.pdfFilePayout,
|
|
6082
|
+
esiaAdditionalDocument.pdfFileWorkbook,
|
|
6064
6083
|
];
|
|
6065
|
-
|
|
6066
|
-
|
|
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));
|
|
6084
|
+
if (!data.every((_) => Boolean(_))) {
|
|
6085
|
+
throw new Error();
|
|
6071
6086
|
}
|
|
6072
|
-
return files;
|
|
6073
6087
|
};
|
|
6074
|
-
const
|
|
6088
|
+
const checkEsiaDataForDebit = (esiaProfile) => {
|
|
6075
6089
|
const { profile, document, addressRegistration } = esiaProfile;
|
|
6076
6090
|
const data = [
|
|
6077
6091
|
profile.name,
|
|
@@ -6079,6 +6093,7 @@
|
|
|
6079
6093
|
profile.midname,
|
|
6080
6094
|
profile.birthDate,
|
|
6081
6095
|
profile.phone,
|
|
6096
|
+
profile.email,
|
|
6082
6097
|
document.dulIssueDate,
|
|
6083
6098
|
document.dulIssuedBy,
|
|
6084
6099
|
document.dulNumber,
|
|
@@ -6091,97 +6106,75 @@
|
|
|
6091
6106
|
throw new Error();
|
|
6092
6107
|
}
|
|
6093
6108
|
};
|
|
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
|
-
};
|
|
6115
6109
|
|
|
6116
|
-
const useInitApplicationLead = ({ inputs,
|
|
6110
|
+
const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
|
|
6111
|
+
const navigator = locationNavigator();
|
|
6112
|
+
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
6117
6113
|
const leadFormStore = useLeadFormStore();
|
|
6118
6114
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
6119
|
-
const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm
|
|
6120
|
-
const
|
|
6121
|
-
|
|
6115
|
+
const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
|
|
6116
|
+
const updateEsiaProfile = useCallback(async (profileId, code, state) => {
|
|
6117
|
+
startLoading();
|
|
6122
6118
|
try {
|
|
6123
|
-
const data = await
|
|
6119
|
+
const data = await updateProfileEsia({
|
|
6120
|
+
profileId,
|
|
6124
6121
|
code,
|
|
6125
6122
|
state,
|
|
6126
6123
|
redirectUri: globalThis.location?.href,
|
|
6127
|
-
authorize: true,
|
|
6128
6124
|
});
|
|
6129
|
-
if (data) {
|
|
6130
|
-
const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
|
|
6125
|
+
if (data && leadFormStore?.taskId) {
|
|
6126
|
+
const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
|
|
6131
6127
|
saveForm((_) => ({
|
|
6132
6128
|
..._,
|
|
6133
6129
|
...parsedData,
|
|
6134
6130
|
}));
|
|
6135
|
-
setEsiaStatus(EsiaStatuses.Success);
|
|
6136
6131
|
}
|
|
6132
|
+
navigator.assign(nextStepLink);
|
|
6137
6133
|
}
|
|
6138
6134
|
catch {
|
|
6139
|
-
|
|
6135
|
+
setEsiaError();
|
|
6140
6136
|
}
|
|
6141
|
-
|
|
6137
|
+
finally {
|
|
6138
|
+
endLoading();
|
|
6139
|
+
}
|
|
6140
|
+
}, [nextStepLink]);
|
|
6142
6141
|
useEffect(() => {
|
|
6143
6142
|
leadFormStore.productType = productType;
|
|
6143
|
+
const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
|
|
6144
6144
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
6145
6145
|
const code = params.get('code');
|
|
6146
6146
|
const state = params.get('state');
|
|
6147
|
-
if (code && state) {
|
|
6148
|
-
|
|
6147
|
+
if (profileId && code && state) {
|
|
6148
|
+
updateEsiaProfile(profileId, code, state);
|
|
6149
6149
|
}
|
|
6150
6150
|
else {
|
|
6151
6151
|
sessionStorage.removeItem('accessToken');
|
|
6152
6152
|
sessionStorage.removeItem('refreshToken');
|
|
6153
6153
|
}
|
|
6154
6154
|
}, []);
|
|
6155
|
-
return initialFormState;
|
|
6155
|
+
return [initialFormState, { isLoading }];
|
|
6156
6156
|
};
|
|
6157
6157
|
|
|
6158
|
-
var EsiaStatuses;
|
|
6159
|
-
(function (EsiaStatuses) {
|
|
6160
|
-
EsiaStatuses["Success"] = "SUCCESS";
|
|
6161
|
-
EsiaStatuses["Error"] = "ERROR";
|
|
6162
|
-
EsiaStatuses["Pending"] = "PENDING";
|
|
6163
|
-
})(EsiaStatuses || (EsiaStatuses = {}));
|
|
6164
6158
|
const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
|
|
6165
|
-
const [
|
|
6166
|
-
const leadForm = useRef(null);
|
|
6159
|
+
const [esiaError, { setTrue: setEsiaError }] = useBool(false);
|
|
6167
6160
|
const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
|
|
6168
6161
|
const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
|
|
6169
6162
|
const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
|
|
6170
6163
|
const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
|
|
6171
|
-
const initialFormState = useInitApplicationLead({
|
|
6164
|
+
const [initialFormState, { isLoading }] = useInitApplicationLead({
|
|
6172
6165
|
inputs,
|
|
6173
6166
|
nextStepLink,
|
|
6174
6167
|
productType,
|
|
6175
|
-
|
|
6176
|
-
esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
|
|
6168
|
+
setEsiaError,
|
|
6177
6169
|
});
|
|
6178
6170
|
const { isSending, ok, handleSubmit } = useApplicationLeadApi({
|
|
6179
6171
|
programId,
|
|
6180
6172
|
nextStepLink,
|
|
6181
6173
|
productType,
|
|
6174
|
+
esiaError,
|
|
6182
6175
|
data,
|
|
6183
6176
|
});
|
|
6184
|
-
const [, { field, onSubmit
|
|
6177
|
+
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
6185
6178
|
formValidator,
|
|
6186
6179
|
onSubmit: handleSubmit,
|
|
6187
6180
|
});
|
|
@@ -6191,17 +6184,7 @@
|
|
|
6191
6184
|
responseTypeDialog.open({ ok });
|
|
6192
6185
|
}
|
|
6193
6186
|
}, [ok]);
|
|
6194
|
-
|
|
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] })] }));
|
|
6187
|
+
return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? 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), esiaError ? (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] }) }));
|
|
6205
6188
|
});
|
|
6206
6189
|
const getInputs = (applicationFormData) => (applicationFormData?.flatMap((_) => _?.inputs) || []);
|
|
6207
6190
|
const getExtendedValidatorObj = (productType) => ({
|
|
@@ -7819,6 +7802,12 @@
|
|
|
7819
7802
|
});
|
|
7820
7803
|
const getValue = (field) => (name) => field(name)?.value;
|
|
7821
7804
|
|
|
7805
|
+
const getRetailFormValidator = ({ formState, inputs, step, productType, }) => getFormValidator(calculateInputs((_) => formState[_])(inputs, step), {
|
|
7806
|
+
...validatorObj,
|
|
7807
|
+
limitedBirthday: getLimitedBirthdayValidation(productType),
|
|
7808
|
+
dulIssueDate: passportValidator(formState.limitedBirthday),
|
|
7809
|
+
})(formState);
|
|
7810
|
+
|
|
7822
7811
|
const StepsNavigationButtons$1 = JSX(({ step, isSending, onPrevStep }) => {
|
|
7823
7812
|
const isFirstStep = step === 0;
|
|
7824
7813
|
const isFinalStep = step === 5;
|
|
@@ -7899,7 +7888,6 @@
|
|
|
7899
7888
|
mandatoryPayments: undefined,
|
|
7900
7889
|
snils: '',
|
|
7901
7890
|
armyIdFlg: false,
|
|
7902
|
-
esiaAccountTypeCd: { key: '', text: '' },
|
|
7903
7891
|
},
|
|
7904
7892
|
{
|
|
7905
7893
|
bankruptcyFlg: false,
|
|
@@ -8138,15 +8126,14 @@
|
|
|
8138
8126
|
};
|
|
8139
8127
|
|
|
8140
8128
|
const PRODUCT_TYPE$1 = 'creditCard';
|
|
8141
|
-
const extendedValidatorObj$1 = {
|
|
8142
|
-
...validatorObj,
|
|
8143
|
-
limitedBirthday: getLimitedBirthdayValidation(PRODUCT_TYPE$1),
|
|
8144
|
-
};
|
|
8145
8129
|
const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
|
|
8146
8130
|
const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs || []), [sections]);
|
|
8147
|
-
const formValidator = useCallback((formState) =>
|
|
8148
|
-
|
|
8149
|
-
|
|
8131
|
+
const formValidator = useCallback((formState) => getRetailFormValidator({
|
|
8132
|
+
formState,
|
|
8133
|
+
inputs,
|
|
8134
|
+
step,
|
|
8135
|
+
productType: PRODUCT_TYPE$1,
|
|
8136
|
+
}), [inputs]);
|
|
8150
8137
|
const [initialState, onSubmit, isSending] = useCreditCardFormAPI({
|
|
8151
8138
|
step,
|
|
8152
8139
|
onNextStep,
|
|
@@ -8295,7 +8282,7 @@
|
|
|
8295
8282
|
label: 'Телефон работодателя',
|
|
8296
8283
|
required: true,
|
|
8297
8284
|
},
|
|
8298
|
-
{ name: 'beginDate', required: true
|
|
8285
|
+
{ name: 'beginDate', required: true },
|
|
8299
8286
|
],
|
|
8300
8287
|
},
|
|
8301
8288
|
{
|
|
@@ -8336,16 +8323,6 @@
|
|
|
8336
8323
|
{
|
|
8337
8324
|
title: 'Совокупный доход',
|
|
8338
8325
|
},
|
|
8339
|
-
{
|
|
8340
|
-
columns: 1,
|
|
8341
|
-
inputs: [
|
|
8342
|
-
{
|
|
8343
|
-
name: 'confirmationIncome',
|
|
8344
|
-
required: true,
|
|
8345
|
-
filledByEsia: true,
|
|
8346
|
-
},
|
|
8347
|
-
],
|
|
8348
|
-
},
|
|
8349
8326
|
{
|
|
8350
8327
|
inputs: [
|
|
8351
8328
|
{
|
|
@@ -8354,6 +8331,10 @@
|
|
|
8354
8331
|
},
|
|
8355
8332
|
],
|
|
8356
8333
|
},
|
|
8334
|
+
{
|
|
8335
|
+
columns: 1,
|
|
8336
|
+
inputs: [{ name: 'confirmationIncome', required: true }],
|
|
8337
|
+
},
|
|
8357
8338
|
{
|
|
8358
8339
|
columns: 1,
|
|
8359
8340
|
inputs: [{ name: 'wages', required: true, filledByEsia: true }],
|
|
@@ -8889,17 +8870,16 @@
|
|
|
8889
8870
|
};
|
|
8890
8871
|
|
|
8891
8872
|
const PRODUCT_TYPE = 'credit';
|
|
8892
|
-
const extendedValidatorObj = {
|
|
8893
|
-
...validatorObj,
|
|
8894
|
-
limitedBirthday: getLimitedBirthdayValidation(PRODUCT_TYPE),
|
|
8895
|
-
};
|
|
8896
8873
|
const CreditFormStep = JSX(({ step, sections, programsSource, onPrevStep, onNextStep, onFinish }) => {
|
|
8897
8874
|
const { programId } = useRetailFormStore();
|
|
8898
8875
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
8899
8876
|
const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs ?? []), [sections]);
|
|
8900
|
-
const formValidator = useCallback((formState) =>
|
|
8901
|
-
|
|
8902
|
-
|
|
8877
|
+
const formValidator = useCallback((formState) => getRetailFormValidator({
|
|
8878
|
+
formState,
|
|
8879
|
+
inputs,
|
|
8880
|
+
step,
|
|
8881
|
+
productType: PRODUCT_TYPE,
|
|
8882
|
+
}), [inputs]);
|
|
8903
8883
|
const [initialState, onSubmit, isSending] = useCreditFormAPI({
|
|
8904
8884
|
step,
|
|
8905
8885
|
onNextStep,
|
|
@@ -10949,7 +10929,7 @@
|
|
|
10949
10929
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10950
10930
|
});
|
|
10951
10931
|
|
|
10952
|
-
const packageVersion = "0.14.
|
|
10932
|
+
const packageVersion = "0.14.825";
|
|
10953
10933
|
|
|
10954
10934
|
exports.Blocks = Blocks;
|
|
10955
10935
|
exports.ContentPage = ContentPage;
|