@redneckz/wildless-cms-uni-blocks 0.14.989 → 0.14.991
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/api/LeadServiceAPI.d.ts +10 -3
- package/bundle/api/getSubmitBody.d.ts +201 -97
- package/bundle/api/sendFile.d.ts +16 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +566 -51
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/bundle/components/ApplicationForm/constants.d.ts +7 -0
- package/bundle/components/ApplicationForm/handlers.d.ts +3 -2
- package/bundle/hooks/useDragAndDrop.d.ts +16 -0
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/bundle/model/InputTypes.d.ts +1 -1
- package/bundle/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/bundle/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/bundle/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/bundle/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/bundle/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/constants.d.ts +3 -0
- package/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/bundle/ui-kit/Input/InputFile.d.ts +2 -0
- package/bundle/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/bundle/ui-kit/Input/InputProps.d.ts +6 -1
- package/bundle/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/bundle/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/bundle/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/bundle/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/bundle/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/bundle/ui-kit/Input/constants.d.ts +6 -0
- package/bundle/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/bundle/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/bundle/ui-kit/Input/styles.d.ts +2 -0
- package/bundle/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/bundle/ui-kit/PreventableEvent.d.ts +4 -0
- package/bundle/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/bundle/utils/animateStepWithMinDuration.d.ts +8 -0
- package/bundle/utils/isDateValid.d.ts +4 -0
- package/dist/api/LeadServiceAPI.d.ts +10 -3
- package/dist/api/LeadServiceAPI.js +20 -9
- package/dist/api/LeadServiceAPI.js.map +1 -1
- package/dist/api/getSubmitBody.d.ts +201 -97
- package/dist/api/getSubmitBody.js +13 -6
- package/dist/api/getSubmitBody.js.map +1 -1
- package/dist/api/sendFile.d.ts +16 -0
- package/dist/api/sendFile.js +78 -0
- package/dist/api/sendFile.js.map +1 -0
- package/dist/components/ApplicationForm/ApplicationForm.js +5 -6
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/dist/components/ApplicationForm/constants.d.ts +7 -0
- package/dist/components/ApplicationForm/constants.js +29 -0
- package/dist/components/ApplicationForm/constants.js.map +1 -0
- package/dist/components/ApplicationForm/handlers.d.ts +3 -2
- package/dist/components/ApplicationForm/handlers.js +3 -3
- package/dist/components/ApplicationForm/handlers.js.map +1 -1
- package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +3 -0
- package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/dist/hooks/useDragAndDrop.d.ts +16 -0
- package/dist/hooks/useDragAndDrop.js +29 -0
- package/dist/hooks/useDragAndDrop.js.map +1 -0
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/model/InputTypes.d.ts +1 -1
- package/dist/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/dist/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/dist/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/AverageGradeField.js +9 -0
- package/dist/ui-kit/FormField/Fields/AverageGradeField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/BirthdayField.js +4 -1
- package/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CommentField.js +1 -1
- package/dist/ui-kit/FormField/Fields/CommentField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/FileIdField.js +7 -0
- package/dist/ui-kit/FormField/Fields/FileIdField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/FileUpload.js +14 -0
- package/dist/ui-kit/FormField/Fields/FileUpload.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/InternshipEndDateField.js +23 -0
- package/dist/ui-kit/FormField/Fields/InternshipEndDateField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/InternshipStartDateField.js +23 -0
- package/dist/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/dist/ui-kit/FormField/Fields/SelectField.js +7 -0
- package/dist/ui-kit/FormField/Fields/SelectField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/TextField.js +7 -0
- package/dist/ui-kit/FormField/Fields/TextField.js.map +1 -0
- package/dist/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/dist/ui-kit/FormField/InputsMap.js +119 -0
- package/dist/ui-kit/FormField/InputsMap.js.map +1 -0
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/constants.d.ts +3 -0
- package/dist/ui-kit/FormField/constants.js +27 -1
- package/dist/ui-kit/FormField/constants.js.map +1 -1
- package/dist/ui-kit/FormField/getField.js +2 -94
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +15 -1
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/dist/ui-kit/FormField/validators.js +4 -1
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/Input/Input.js +2 -2
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/InputFile.d.ts +2 -0
- package/dist/ui-kit/Input/InputFile.js +75 -0
- package/dist/ui-kit/Input/InputFile.js.map +1 -0
- package/dist/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/dist/ui-kit/Input/InputFileControl.js +10 -0
- package/dist/ui-kit/Input/InputFileControl.js.map +1 -0
- package/dist/ui-kit/Input/InputProps.d.ts +6 -1
- package/dist/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/dist/ui-kit/Input/checks/checkFIleExtension.js +12 -0
- package/dist/ui-kit/Input/checks/checkFIleExtension.js.map +1 -0
- package/dist/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/dist/ui-kit/Input/checks/checkFileMimeType.js +20 -0
- package/dist/ui-kit/Input/checks/checkFileMimeType.js.map +1 -0
- package/dist/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/dist/ui-kit/Input/checks/checkFileSignature.js +25 -0
- package/dist/ui-kit/Input/checks/checkFileSignature.js.map +1 -0
- package/dist/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/dist/ui-kit/Input/checks/checkFileSize.js +13 -0
- package/dist/ui-kit/Input/checks/checkFileSize.js.map +1 -0
- package/dist/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/dist/ui-kit/Input/checks/getFileSignature.js +19 -0
- package/dist/ui-kit/Input/checks/getFileSignature.js.map +1 -0
- package/dist/ui-kit/Input/constants.d.ts +6 -0
- package/dist/ui-kit/Input/constants.js +9 -0
- package/dist/ui-kit/Input/constants.js.map +1 -0
- package/dist/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/dist/ui-kit/Input/renderFileInput.js +33 -0
- package/dist/ui-kit/Input/renderFileInput.js.map +1 -0
- package/dist/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/dist/ui-kit/Input/renderInfoText.js +14 -0
- package/dist/ui-kit/Input/renderInfoText.js.map +1 -0
- package/dist/ui-kit/Input/styles.d.ts +2 -0
- package/dist/ui-kit/Input/styles.js +5 -0
- package/dist/ui-kit/Input/styles.js.map +1 -0
- package/dist/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/dist/ui-kit/Input/useVerifyFile.js +64 -0
- package/dist/ui-kit/Input/useVerifyFile.js.map +1 -0
- package/dist/ui-kit/PreventableEvent.d.ts +4 -0
- package/dist/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/dist/ui-kit/ProgressBar/ProgressBar.js +1 -1
- package/dist/ui-kit/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/utils/animateStepWithMinDuration.d.ts +8 -0
- package/dist/utils/animateStepWithMinDuration.js +26 -0
- package/dist/utils/animateStepWithMinDuration.js.map +1 -0
- package/dist/utils/isDateValid.d.ts +4 -0
- package/dist/utils/isDateValid.js +24 -0
- package/dist/utils/isDateValid.js.map +1 -0
- package/lib/api/LeadServiceAPI.d.ts +10 -3
- package/lib/api/LeadServiceAPI.js +20 -9
- package/lib/api/LeadServiceAPI.js.map +1 -1
- package/lib/api/getSubmitBody.d.ts +201 -97
- package/lib/api/getSubmitBody.js +13 -6
- package/lib/api/getSubmitBody.js.map +1 -1
- package/lib/api/sendFile.d.ts +16 -0
- package/lib/api/sendFile.js +75 -0
- package/lib/api/sendFile.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +2 -0
- package/lib/components/ApplicationForm/ApplicationForm.js +5 -6
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/lib/components/ApplicationForm/constants.d.ts +7 -0
- package/lib/components/ApplicationForm/constants.js +27 -0
- package/lib/components/ApplicationForm/constants.js.map +1 -0
- package/lib/components/ApplicationForm/handlers.d.ts +3 -2
- package/lib/components/ApplicationForm/handlers.js +3 -3
- package/lib/components/ApplicationForm/handlers.js.map +1 -1
- package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +3 -0
- package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/hooks/useDragAndDrop.d.ts +16 -0
- package/lib/hooks/useDragAndDrop.js +26 -0
- package/lib/hooks/useDragAndDrop.js.map +1 -0
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/model/InputTypes.d.ts +1 -1
- package/lib/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/lib/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/lib/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/AverageGradeField.js +7 -0
- package/lib/ui-kit/FormField/Fields/AverageGradeField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/BirthdayField.js +4 -1
- package/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CommentField.js +1 -1
- package/lib/ui-kit/FormField/Fields/CommentField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/FileIdField.js +5 -0
- package/lib/ui-kit/FormField/Fields/FileIdField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/FileUpload.js +12 -0
- package/lib/ui-kit/FormField/Fields/FileUpload.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/InternshipEndDateField.js +21 -0
- package/lib/ui-kit/FormField/Fields/InternshipEndDateField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/InternshipStartDateField.js +21 -0
- package/lib/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/lib/ui-kit/FormField/Fields/SelectField.js +5 -0
- package/lib/ui-kit/FormField/Fields/SelectField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/TextField.js +5 -0
- package/lib/ui-kit/FormField/Fields/TextField.js.map +1 -0
- package/lib/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/lib/ui-kit/FormField/InputsMap.js +117 -0
- package/lib/ui-kit/FormField/InputsMap.js.map +1 -0
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/constants.d.ts +3 -0
- package/lib/ui-kit/FormField/constants.js +26 -0
- package/lib/ui-kit/FormField/constants.js.map +1 -1
- package/lib/ui-kit/FormField/getField.js +1 -93
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +16 -2
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/lib/ui-kit/FormField/validators.js +2 -0
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/Input/Input.js +1 -1
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/InputFile.d.ts +2 -0
- package/lib/ui-kit/Input/InputFile.js +73 -0
- package/lib/ui-kit/Input/InputFile.js.map +1 -0
- package/lib/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/lib/ui-kit/Input/InputFileControl.js +8 -0
- package/lib/ui-kit/Input/InputFileControl.js.map +1 -0
- package/lib/ui-kit/Input/InputProps.d.ts +6 -1
- package/lib/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/lib/ui-kit/Input/checks/checkFIleExtension.js +9 -0
- package/lib/ui-kit/Input/checks/checkFIleExtension.js.map +1 -0
- package/lib/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/lib/ui-kit/Input/checks/checkFileMimeType.js +17 -0
- package/lib/ui-kit/Input/checks/checkFileMimeType.js.map +1 -0
- package/lib/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/lib/ui-kit/Input/checks/checkFileSignature.js +22 -0
- package/lib/ui-kit/Input/checks/checkFileSignature.js.map +1 -0
- package/lib/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/lib/ui-kit/Input/checks/checkFileSize.js +10 -0
- package/lib/ui-kit/Input/checks/checkFileSize.js.map +1 -0
- package/lib/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/lib/ui-kit/Input/checks/getFileSignature.js +16 -0
- package/lib/ui-kit/Input/checks/getFileSignature.js.map +1 -0
- package/lib/ui-kit/Input/constants.d.ts +6 -0
- package/lib/ui-kit/Input/constants.js +7 -0
- package/lib/ui-kit/Input/constants.js.map +1 -0
- package/lib/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/lib/ui-kit/Input/renderFileInput.js +30 -0
- package/lib/ui-kit/Input/renderFileInput.js.map +1 -0
- package/lib/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/lib/ui-kit/Input/renderInfoText.js +11 -0
- package/lib/ui-kit/Input/renderInfoText.js.map +1 -0
- package/lib/ui-kit/Input/styles.d.ts +2 -0
- package/lib/ui-kit/Input/styles.js +3 -0
- package/lib/ui-kit/Input/styles.js.map +1 -0
- package/lib/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/lib/ui-kit/Input/useVerifyFile.js +61 -0
- package/lib/ui-kit/Input/useVerifyFile.js.map +1 -0
- package/lib/ui-kit/PreventableEvent.d.ts +4 -0
- package/lib/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/lib/ui-kit/ProgressBar/ProgressBar.js +1 -1
- package/lib/ui-kit/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/utils/animateStepWithMinDuration.d.ts +8 -0
- package/lib/utils/animateStepWithMinDuration.js +23 -0
- package/lib/utils/animateStepWithMinDuration.js.map +1 -0
- package/lib/utils/isDateValid.d.ts +4 -0
- package/lib/utils/isDateValid.js +21 -0
- package/lib/utils/isDateValid.js.map +1 -0
- package/mobile/bundle/api/LeadServiceAPI.d.ts +10 -3
- package/mobile/bundle/api/getSubmitBody.d.ts +201 -97
- package/mobile/bundle/api/sendFile.d.ts +16 -0
- package/mobile/bundle/bundle.umd.js +566 -51
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/mobile/bundle/components/ApplicationForm/constants.d.ts +7 -0
- package/mobile/bundle/components/ApplicationForm/handlers.d.ts +3 -2
- package/mobile/bundle/hooks/useDragAndDrop.d.ts +16 -0
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/bundle/model/InputTypes.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/mobile/bundle/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/mobile/bundle/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/constants.d.ts +3 -0
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/InputFile.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/InputProps.d.ts +6 -1
- package/mobile/bundle/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/mobile/bundle/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/constants.d.ts +6 -0
- package/mobile/bundle/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/mobile/bundle/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/styles.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/mobile/bundle/ui-kit/PreventableEvent.d.ts +4 -0
- package/mobile/bundle/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/mobile/bundle/utils/animateStepWithMinDuration.d.ts +8 -0
- package/mobile/bundle/utils/isDateValid.d.ts +4 -0
- package/mobile/dist/api/LeadServiceAPI.d.ts +10 -3
- package/mobile/dist/api/LeadServiceAPI.js +20 -9
- package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
- package/mobile/dist/api/getSubmitBody.d.ts +201 -97
- package/mobile/dist/api/getSubmitBody.js +13 -6
- package/mobile/dist/api/getSubmitBody.js.map +1 -1
- package/mobile/dist/api/sendFile.d.ts +16 -0
- package/mobile/dist/api/sendFile.js +78 -0
- package/mobile/dist/api/sendFile.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +5 -6
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/mobile/dist/components/ApplicationForm/constants.d.ts +7 -0
- package/mobile/dist/components/ApplicationForm/constants.js +29 -0
- package/mobile/dist/components/ApplicationForm/constants.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/handlers.d.ts +3 -2
- package/mobile/dist/components/ApplicationForm/handlers.js +3 -3
- package/mobile/dist/components/ApplicationForm/handlers.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +3 -0
- package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/dist/hooks/useDragAndDrop.d.ts +16 -0
- package/mobile/dist/hooks/useDragAndDrop.js +29 -0
- package/mobile/dist/hooks/useDragAndDrop.js.map +1 -0
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/model/InputTypes.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.js +9 -0
- package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js +4 -1
- package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CommentField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CommentField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileIdField.js +7 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileIdField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileUpload.js +14 -0
- package/mobile/dist/ui-kit/FormField/Fields/FileUpload.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipEndDateField.js +23 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipEndDateField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipStartDateField.js +23 -0
- package/mobile/dist/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/mobile/dist/ui-kit/FormField/Fields/SelectField.js +7 -0
- package/mobile/dist/ui-kit/FormField/Fields/SelectField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/TextField.js +7 -0
- package/mobile/dist/ui-kit/FormField/Fields/TextField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/mobile/dist/ui-kit/FormField/InputsMap.js +119 -0
- package/mobile/dist/ui-kit/FormField/InputsMap.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/constants.d.ts +3 -0
- package/mobile/dist/ui-kit/FormField/constants.js +27 -1
- package/mobile/dist/ui-kit/FormField/constants.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +2 -94
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +15 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/validators.js +4 -1
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/Input/Input.js +2 -2
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputFile.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/InputFile.js +75 -0
- package/mobile/dist/ui-kit/Input/InputFile.js.map +1 -0
- package/mobile/dist/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/InputFileControl.js +10 -0
- package/mobile/dist/ui-kit/Input/InputFileControl.js.map +1 -0
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +6 -1
- package/mobile/dist/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFIleExtension.js +12 -0
- package/mobile/dist/ui-kit/Input/checks/checkFIleExtension.js.map +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileMimeType.js +20 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileMimeType.js.map +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSignature.js +25 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSignature.js.map +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSize.js +13 -0
- package/mobile/dist/ui-kit/Input/checks/checkFileSize.js.map +1 -0
- package/mobile/dist/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/checks/getFileSignature.js +19 -0
- package/mobile/dist/ui-kit/Input/checks/getFileSignature.js.map +1 -0
- package/mobile/dist/ui-kit/Input/constants.d.ts +6 -0
- package/mobile/dist/ui-kit/Input/constants.js +9 -0
- package/mobile/dist/ui-kit/Input/constants.js.map +1 -0
- package/mobile/dist/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/mobile/dist/ui-kit/Input/renderFileInput.js +33 -0
- package/mobile/dist/ui-kit/Input/renderFileInput.js.map +1 -0
- package/mobile/dist/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/renderInfoText.js +14 -0
- package/mobile/dist/ui-kit/Input/renderInfoText.js.map +1 -0
- package/mobile/dist/ui-kit/Input/styles.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/styles.js +5 -0
- package/mobile/dist/ui-kit/Input/styles.js.map +1 -0
- package/mobile/dist/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/mobile/dist/ui-kit/Input/useVerifyFile.js +64 -0
- package/mobile/dist/ui-kit/Input/useVerifyFile.js.map +1 -0
- package/mobile/dist/ui-kit/PreventableEvent.d.ts +4 -0
- package/mobile/dist/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/mobile/dist/ui-kit/ProgressBar/ProgressBar.js +1 -1
- package/mobile/dist/ui-kit/ProgressBar/ProgressBar.js.map +1 -1
- package/mobile/dist/utils/animateStepWithMinDuration.d.ts +8 -0
- package/mobile/dist/utils/animateStepWithMinDuration.js +26 -0
- package/mobile/dist/utils/animateStepWithMinDuration.js.map +1 -0
- package/mobile/dist/utils/isDateValid.d.ts +4 -0
- package/mobile/dist/utils/isDateValid.js +24 -0
- package/mobile/dist/utils/isDateValid.js.map +1 -0
- package/mobile/lib/api/LeadServiceAPI.d.ts +10 -3
- package/mobile/lib/api/LeadServiceAPI.js +20 -9
- package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
- package/mobile/lib/api/getSubmitBody.d.ts +201 -97
- package/mobile/lib/api/getSubmitBody.js +13 -6
- package/mobile/lib/api/getSubmitBody.js.map +1 -1
- package/mobile/lib/api/sendFile.d.ts +16 -0
- package/mobile/lib/api/sendFile.js +75 -0
- package/mobile/lib/api/sendFile.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +5 -6
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -2
- package/mobile/lib/components/ApplicationForm/constants.d.ts +7 -0
- package/mobile/lib/components/ApplicationForm/constants.js +27 -0
- package/mobile/lib/components/ApplicationForm/constants.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/handlers.d.ts +3 -2
- package/mobile/lib/components/ApplicationForm/handlers.js +3 -3
- package/mobile/lib/components/ApplicationForm/handlers.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +3 -0
- package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/hooks/useDragAndDrop.d.ts +16 -0
- package/mobile/lib/hooks/useDragAndDrop.js +26 -0
- package/mobile/lib/hooks/useDragAndDrop.js.map +1 -0
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/model/InputTypes.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressBranchField.d.ts +1 -2
- package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.js +7 -0
- package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js +4 -1
- package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CommentField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CommentField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/FileIdField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileIdField.js +5 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileIdField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileUpload.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileUpload.js +12 -0
- package/mobile/lib/ui-kit/FormField/Fields/FileUpload.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipEndDateField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipEndDateField.js +21 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipEndDateField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipStartDateField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipStartDateField.js +21 -0
- package/mobile/lib/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/SelectField.d.ts +6 -0
- package/mobile/lib/ui-kit/FormField/Fields/SelectField.js +5 -0
- package/mobile/lib/ui-kit/FormField/Fields/SelectField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/TextField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/TextField.js +5 -0
- package/mobile/lib/ui-kit/FormField/Fields/TextField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/InputsMap.d.ts +62 -0
- package/mobile/lib/ui-kit/FormField/InputsMap.js +117 -0
- package/mobile/lib/ui-kit/FormField/InputsMap.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/constants.d.ts +3 -0
- package/mobile/lib/ui-kit/FormField/constants.js +26 -0
- package/mobile/lib/ui-kit/FormField/constants.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +1 -93
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +16 -2
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/validators.js +2 -0
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/Input/Input.js +1 -1
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputFile.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/InputFile.js +73 -0
- package/mobile/lib/ui-kit/Input/InputFile.js.map +1 -0
- package/mobile/lib/ui-kit/Input/InputFileControl.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/InputFileControl.js +8 -0
- package/mobile/lib/ui-kit/Input/InputFileControl.js.map +1 -0
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +6 -1
- package/mobile/lib/ui-kit/Input/checks/checkFIleExtension.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFIleExtension.js +9 -0
- package/mobile/lib/ui-kit/Input/checks/checkFIleExtension.js.map +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileMimeType.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileMimeType.js +17 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileMimeType.js.map +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSignature.d.ts +3 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSignature.js +22 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSignature.js.map +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSize.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSize.js +10 -0
- package/mobile/lib/ui-kit/Input/checks/checkFileSize.js.map +1 -0
- package/mobile/lib/ui-kit/Input/checks/getFileSignature.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/checks/getFileSignature.js +16 -0
- package/mobile/lib/ui-kit/Input/checks/getFileSignature.js.map +1 -0
- package/mobile/lib/ui-kit/Input/constants.d.ts +6 -0
- package/mobile/lib/ui-kit/Input/constants.js +7 -0
- package/mobile/lib/ui-kit/Input/constants.js.map +1 -0
- package/mobile/lib/ui-kit/Input/renderFileInput.d.ts +12 -0
- package/mobile/lib/ui-kit/Input/renderFileInput.js +30 -0
- package/mobile/lib/ui-kit/Input/renderFileInput.js.map +1 -0
- package/mobile/lib/ui-kit/Input/renderInfoText.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/renderInfoText.js +11 -0
- package/mobile/lib/ui-kit/Input/renderInfoText.js.map +1 -0
- package/mobile/lib/ui-kit/Input/styles.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/styles.js +3 -0
- package/mobile/lib/ui-kit/Input/styles.js.map +1 -0
- package/mobile/lib/ui-kit/Input/useVerifyFile.d.ts +17 -0
- package/mobile/lib/ui-kit/Input/useVerifyFile.js +61 -0
- package/mobile/lib/ui-kit/Input/useVerifyFile.js.map +1 -0
- package/mobile/lib/ui-kit/PreventableEvent.d.ts +4 -0
- package/mobile/lib/ui-kit/ProgressBar/ProgressBar.d.ts +1 -0
- package/mobile/lib/ui-kit/ProgressBar/ProgressBar.js +1 -1
- package/mobile/lib/ui-kit/ProgressBar/ProgressBar.js.map +1 -1
- package/mobile/lib/utils/animateStepWithMinDuration.d.ts +8 -0
- package/mobile/lib/utils/animateStepWithMinDuration.js +23 -0
- package/mobile/lib/utils/animateStepWithMinDuration.js.map +1 -0
- package/mobile/lib/utils/isDateValid.d.ts +4 -0
- package/mobile/lib/utils/isDateValid.js +21 -0
- package/mobile/lib/utils/isDateValid.js.map +1 -0
- package/mobile/src/api/LeadServiceAPI.ts +37 -10
- package/mobile/src/api/getSubmitBody.ts +28 -7
- package/mobile/src/api/sendFile.ts +97 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +192 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +22 -16
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +16 -2
- package/mobile/src/components/ApplicationForm/constants.ts +33 -0
- package/mobile/src/components/ApplicationForm/handlers.ts +5 -3
- package/mobile/src/components/ApplicationForm/useVerifyPhoneDialogSubmit.tsx +3 -0
- package/mobile/src/hooks/useDragAndDrop.ts +48 -0
- package/mobile/src/model/FormTypeFieldDef.ts +2 -1
- package/mobile/src/model/InputTypes.ts +1 -1
- package/mobile/src/ui-kit/FormField/CustomFieldProps.ts +1 -0
- package/mobile/src/ui-kit/FormField/Fields/AddressBranchField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/Fields/AverageGradeField.tsx +14 -0
- package/mobile/src/ui-kit/FormField/Fields/BirthdayField.tsx +12 -7
- package/mobile/src/ui-kit/FormField/Fields/CommentField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/Fields/FileIdField.tsx +7 -0
- package/mobile/src/ui-kit/FormField/Fields/FileUpload.tsx +22 -0
- package/mobile/src/ui-kit/FormField/Fields/InternshipEndDateField.tsx +38 -0
- package/mobile/src/ui-kit/FormField/Fields/InternshipStartDateField.tsx +38 -0
- package/mobile/src/ui-kit/FormField/Fields/SelectField.tsx +12 -0
- package/mobile/src/ui-kit/FormField/Fields/TextField.tsx +7 -0
- package/mobile/src/ui-kit/FormField/InputsMap.tsx +133 -0
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +17 -1
- package/mobile/src/ui-kit/FormField/constants.tsx +29 -0
- package/mobile/src/ui-kit/FormField/getField.tsx +1 -105
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +16 -1
- package/mobile/src/ui-kit/FormField/validators.ts +4 -0
- package/mobile/src/ui-kit/Input/Input.tsx +1 -2
- package/mobile/src/ui-kit/Input/InputFile.tsx +132 -0
- package/mobile/src/ui-kit/Input/InputFileControl.tsx +22 -0
- package/mobile/src/ui-kit/Input/InputProps.ts +10 -1
- package/mobile/src/ui-kit/Input/checks/checkFIleExtension.ts +9 -0
- package/mobile/src/ui-kit/Input/checks/checkFileMimeType.ts +20 -0
- package/mobile/src/ui-kit/Input/checks/checkFileSignature.ts +30 -0
- package/mobile/src/ui-kit/Input/checks/checkFileSize.ts +10 -0
- package/mobile/src/ui-kit/Input/checks/getFileSignature.ts +16 -0
- package/mobile/src/ui-kit/Input/constants.ts +6 -0
- package/mobile/src/ui-kit/Input/renderFileInput.tsx +87 -0
- package/mobile/src/ui-kit/Input/renderInfoText.tsx +15 -0
- package/mobile/src/ui-kit/Input/styles.ts +2 -0
- package/mobile/src/ui-kit/Input/useVerifyFile.ts +100 -0
- package/mobile/src/ui-kit/PreventableEvent.ts +5 -0
- package/mobile/src/ui-kit/ProgressBar/ProgressBar.tsx +7 -2
- package/mobile/src/utils/animateStepWithMinDuration.ts +38 -0
- package/mobile/src/utils/isDateValid.ts +33 -0
- package/package.json +2 -2
- package/src/api/LeadServiceAPI.ts +37 -10
- package/src/api/getSubmitBody.ts +28 -7
- package/src/api/sendFile.ts +97 -0
- package/src/components/ApplicationForm/ApplicationForm.example.json +192 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +132 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +22 -16
- package/src/components/ApplicationForm/ApplicationFormContent.ts +16 -2
- package/src/components/ApplicationForm/constants.ts +33 -0
- package/src/components/ApplicationForm/handlers.ts +5 -3
- package/src/components/ApplicationForm/useVerifyPhoneDialogSubmit.tsx +3 -0
- package/src/hooks/useDragAndDrop.ts +48 -0
- package/src/model/FormTypeFieldDef.ts +2 -1
- package/src/model/InputTypes.ts +1 -1
- package/src/ui-kit/FormField/CustomFieldProps.ts +1 -0
- package/src/ui-kit/FormField/Fields/AddressBranchField.tsx +1 -1
- package/src/ui-kit/FormField/Fields/AverageGradeField.tsx +14 -0
- package/src/ui-kit/FormField/Fields/BirthdayField.tsx +12 -7
- package/src/ui-kit/FormField/Fields/CommentField.tsx +1 -1
- package/src/ui-kit/FormField/Fields/FileIdField.tsx +7 -0
- package/src/ui-kit/FormField/Fields/FileUpload.tsx +22 -0
- package/src/ui-kit/FormField/Fields/InternshipEndDateField.tsx +38 -0
- package/src/ui-kit/FormField/Fields/InternshipStartDateField.tsx +38 -0
- package/src/ui-kit/FormField/Fields/SelectField.tsx +12 -0
- package/src/ui-kit/FormField/Fields/TextField.tsx +7 -0
- package/src/ui-kit/FormField/InputsMap.tsx +133 -0
- package/src/ui-kit/FormField/NameFieldDef.ts +17 -1
- package/src/ui-kit/FormField/constants.tsx +29 -0
- package/src/ui-kit/FormField/getField.tsx +1 -105
- package/src/ui-kit/FormField/getObjectValidator.tsx +16 -1
- package/src/ui-kit/FormField/validators.ts +4 -0
- package/src/ui-kit/Input/Input.tsx +1 -2
- package/src/ui-kit/Input/InputFile.tsx +132 -0
- package/src/ui-kit/Input/InputFileControl.tsx +22 -0
- package/src/ui-kit/Input/InputProps.ts +10 -1
- package/src/ui-kit/Input/checks/checkFIleExtension.ts +9 -0
- package/src/ui-kit/Input/checks/checkFileMimeType.ts +20 -0
- package/src/ui-kit/Input/checks/checkFileSignature.ts +30 -0
- package/src/ui-kit/Input/checks/checkFileSize.ts +10 -0
- package/src/ui-kit/Input/checks/getFileSignature.ts +16 -0
- package/src/ui-kit/Input/constants.ts +6 -0
- package/src/ui-kit/Input/renderFileInput.tsx +87 -0
- package/src/ui-kit/Input/renderInfoText.tsx +15 -0
- package/src/ui-kit/Input/styles.ts +2 -0
- package/src/ui-kit/Input/useVerifyFile.ts +100 -0
- package/src/ui-kit/PreventableEvent.ts +5 -0
- package/src/ui-kit/ProgressBar/ProgressBar.tsx +7 -2
- package/src/utils/animateStepWithMinDuration.ts +38 -0
- package/src/utils/isDateValid.ts +33 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -1203,6 +1203,27 @@
|
|
|
1203
1203
|
const cyrillicPattern = /^[а-яё-]*$/i;
|
|
1204
1204
|
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
1205
1205
|
|
|
1206
|
+
const isDateValid = (value, limits) => {
|
|
1207
|
+
if (!value || isNaN(value.getTime())) {
|
|
1208
|
+
return false;
|
|
1209
|
+
}
|
|
1210
|
+
const { minLimit, maxLimit } = limits;
|
|
1211
|
+
const time = value.getTime();
|
|
1212
|
+
return isValidMin(time, minLimit) && isValidMax(time, maxLimit);
|
|
1213
|
+
};
|
|
1214
|
+
const isValidMin = (time, minLimit) => {
|
|
1215
|
+
if (!minLimit || isNaN(minLimit.getTime())) {
|
|
1216
|
+
return true;
|
|
1217
|
+
}
|
|
1218
|
+
return time > minLimit.getTime();
|
|
1219
|
+
};
|
|
1220
|
+
const isValidMax = (time, maxLimit) => {
|
|
1221
|
+
if (!maxLimit || isNaN(maxLimit.getTime())) {
|
|
1222
|
+
return true;
|
|
1223
|
+
}
|
|
1224
|
+
return time < maxLimit.getTime();
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1206
1227
|
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
1207
1228
|
|
|
1208
1229
|
const ERROR_MESSAGE$1 = 'Некорректно заполненное поле';
|
|
@@ -1219,6 +1240,7 @@
|
|
|
1219
1240
|
const emailValidate = (email) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(email);
|
|
1220
1241
|
const emailValidator = (errorMsg) => validator((_) => emailValidate(_))(errorMsg);
|
|
1221
1242
|
const isValidInnLength = (value) => typeof value === 'string' && (value.length === 10 || value.length === 12);
|
|
1243
|
+
const birthdayValidator = (errorMsg) => validator((_) => isDateValid(_, { maxLimit: new Date() }))(errorMsg);
|
|
1222
1244
|
|
|
1223
1245
|
const validatorObj$1 = {
|
|
1224
1246
|
fullName: defaultValidator(),
|
|
@@ -1241,7 +1263,7 @@
|
|
|
1241
1263
|
surname: nameValidator('Укажите свою фамилию на кириллице'),
|
|
1242
1264
|
name: nameValidator('Укажите своё имя на кириллице (без сокращений)'),
|
|
1243
1265
|
middleName: nameValidator('Укажите своё отчество на кириллице'),
|
|
1244
|
-
birthday:
|
|
1266
|
+
birthday: birthdayValidator('Укажите дату рождения'),
|
|
1245
1267
|
phone: phoneValidator('Укажите номер телефона'),
|
|
1246
1268
|
email: emailValidator('Укажите электронную почту'),
|
|
1247
1269
|
inn: innValidator('Укажите ИНН'),
|
|
@@ -1255,6 +1277,20 @@
|
|
|
1255
1277
|
callbackTime: defaultValidator(),
|
|
1256
1278
|
questionProduct: defaultValidator(),
|
|
1257
1279
|
russianPhone: russianPhoneValidator('Укажите номер телефона'),
|
|
1280
|
+
cityOfResidence: defaultValidator(),
|
|
1281
|
+
internshipStartDate: defaultValidator(),
|
|
1282
|
+
internshipEndDate: defaultValidator(),
|
|
1283
|
+
university: defaultValidator(),
|
|
1284
|
+
fieldOfStudy: defaultValidator(),
|
|
1285
|
+
courseYear: defaultValidator(),
|
|
1286
|
+
graduationYear: defaultValidator(),
|
|
1287
|
+
averageGrade: defaultValidator(),
|
|
1288
|
+
skillsAndKnowledge: defaultValidator(),
|
|
1289
|
+
educationLevel: defaultSelectValidator(),
|
|
1290
|
+
motivationForInternship: defaultValidator(),
|
|
1291
|
+
workExperience: defaultValidator(),
|
|
1292
|
+
internshipDirection: defaultValidator(),
|
|
1293
|
+
workingHours: defaultValidator(),
|
|
1258
1294
|
};
|
|
1259
1295
|
const getFormValidator = (fieldDefs, externalValidatorObj = {}) => {
|
|
1260
1296
|
const requiredFields = fieldDefs.filter((_) => Boolean(_?.required && _?.name));
|
|
@@ -1415,6 +1451,32 @@
|
|
|
1415
1451
|
{ id: 'conversionTransactions', text: 'Конверсионные операции' },
|
|
1416
1452
|
{ id: 'otherIssues', text: 'Иные вопросы ВЭД' },
|
|
1417
1453
|
];
|
|
1454
|
+
const INTERNSHIP_DIRECTION = [
|
|
1455
|
+
{ key: 'economics', text: 'Экономика и финансы' },
|
|
1456
|
+
{ key: 'audit', text: 'Аудит' },
|
|
1457
|
+
{ key: 'law', text: 'Юриспруденция' },
|
|
1458
|
+
{ key: 'it', text: 'ИТ' },
|
|
1459
|
+
{ key: 'marketing', text: 'Маркетинг' },
|
|
1460
|
+
{ key: 'hr', text: 'HR' },
|
|
1461
|
+
{ key: 'analytics', text: 'Аналитика' },
|
|
1462
|
+
{ key: 'management', text: 'Менеджмент' },
|
|
1463
|
+
{ key: 'administration', text: 'ГМУ' },
|
|
1464
|
+
{ key: 'design', text: 'Дизайн' },
|
|
1465
|
+
{ key: 'journalism', text: 'Журналистика' },
|
|
1466
|
+
{ key: 'contact', text: 'Контакт-центр' },
|
|
1467
|
+
{ key: 'other', text: 'Другое' },
|
|
1468
|
+
];
|
|
1469
|
+
const WORKING_HOURS = [
|
|
1470
|
+
{ key: '20', text: '20' },
|
|
1471
|
+
{ key: '30', text: '30' },
|
|
1472
|
+
{ key: '40', text: '40' },
|
|
1473
|
+
];
|
|
1474
|
+
const EDUCATION_LEVEL = [
|
|
1475
|
+
{ key: 'bachelor', text: 'Бакалавриат' },
|
|
1476
|
+
{ key: 'specialist', text: 'Специалитет' },
|
|
1477
|
+
{ key: 'master', text: 'Магистратура' },
|
|
1478
|
+
{ key: 'doctorate', text: 'Аспирантура' },
|
|
1479
|
+
];
|
|
1418
1480
|
|
|
1419
1481
|
// TODO Базовая функицональность всех Control - надо вынести и привязать к required флагу
|
|
1420
1482
|
const getRequiredLabel = ({ label, required = false }) => label && required ? `${label}*` : label;
|
|
@@ -1466,6 +1528,9 @@
|
|
|
1466
1528
|
|
|
1467
1529
|
const getValidStyle = (valid) => (valid ? inputValidStyle : 'border-error');
|
|
1468
1530
|
|
|
1531
|
+
const defaultStyle$1 = 'w-full border rounded-md text-primary-text outline-none p-m';
|
|
1532
|
+
const borderStyle = 'border-dashed';
|
|
1533
|
+
|
|
1469
1534
|
const Input = JSX(
|
|
1470
1535
|
// eslint-disable-next-line max-lines-per-function
|
|
1471
1536
|
({ key, className, id, name, type = 'text', label, placeholder, value = '', valid = true, pattern, autoFocus = false, isTextarea = false, disabled = false, children, onChange, onFocus, onBlur, }) => {
|
|
@@ -1484,7 +1549,6 @@
|
|
|
1484
1549
|
const ariaLabel = label ?? name ?? id;
|
|
1485
1550
|
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { className: "space-y-xs", children: [renderLabel$1(label), isTextarea ? (jsx("textarea", { className: style('block resize-y min-h-24', defaultStyle$1, validStyle), id: style('textarea', id), value: value, name: name || id, placeholder: placeholder, disabled: disabled, "aria-label": ariaLabel, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }, key)) : (jsx("input", { ref: inputRef, className: style('h-14', defaultStyle$1, paddingStyle, validStyle), id: id, type: type, value: value, name: name || id, placeholder: placeholder, pattern: pattern, disabled: disabled, "aria-label": ariaLabel, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }, key))] }), children] }));
|
|
1486
1551
|
});
|
|
1487
|
-
const defaultStyle$1 = 'w-full border rounded-md text-primary-text outline-none p-m';
|
|
1488
1552
|
|
|
1489
1553
|
const InputWrapper = JSX(({ className, label, value = '', error, errors, type, isInteger, placeholder, maxLength, inputRef, isOpen, onOpen, onClose, required, onChange = noop, ...rest }) => {
|
|
1490
1554
|
const popupRef = useOutsideClick(onClose);
|
|
@@ -1721,6 +1785,33 @@
|
|
|
1721
1785
|
|
|
1722
1786
|
const API_BASE_URI = '/api/v1';
|
|
1723
1787
|
|
|
1788
|
+
const ENDPOINT_MAPPING = {
|
|
1789
|
+
lead: {
|
|
1790
|
+
withTypeForm: true,
|
|
1791
|
+
isNaturalEndpoint: true,
|
|
1792
|
+
},
|
|
1793
|
+
sendcorporatelead: {
|
|
1794
|
+
withTypeForm: true,
|
|
1795
|
+
isNaturalEndpoint: false,
|
|
1796
|
+
},
|
|
1797
|
+
practice: {
|
|
1798
|
+
withTypeForm: false,
|
|
1799
|
+
isNaturalEndpoint: true,
|
|
1800
|
+
},
|
|
1801
|
+
internship: {
|
|
1802
|
+
withTypeForm: false,
|
|
1803
|
+
isNaturalEndpoint: true,
|
|
1804
|
+
},
|
|
1805
|
+
initcorporatelead: {
|
|
1806
|
+
withTypeForm: false,
|
|
1807
|
+
isNaturalEndpoint: false,
|
|
1808
|
+
},
|
|
1809
|
+
callback: {
|
|
1810
|
+
withTypeForm: false,
|
|
1811
|
+
isNaturalEndpoint: true,
|
|
1812
|
+
},
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1724
1815
|
const formatDate = (date, toTimeStamp = false) => {
|
|
1725
1816
|
if (typeof date === 'string') {
|
|
1726
1817
|
return date.split('-').reverse().join('.');
|
|
@@ -1735,16 +1826,22 @@
|
|
|
1735
1826
|
|
|
1736
1827
|
const formatPhone = (phone) => phone?.replace(/[^+\d]/g, '');
|
|
1737
1828
|
|
|
1738
|
-
const getSubmitBody = (body,
|
|
1739
|
-
const
|
|
1829
|
+
const getSubmitBody = ({ body, endpoint, router }) => {
|
|
1830
|
+
const isNaturalPerson = endpoint && ENDPOINT_MAPPING[endpoint].isNaturalEndpoint;
|
|
1831
|
+
const withTypeForm = endpoint && ENDPOINT_MAPPING[endpoint].withTypeForm;
|
|
1832
|
+
const { typeForm, region, phone = '', email, birthday, desiredMeetingDate, fullRegion, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, partnerName, russianPhone, partnerSymbolCode, internshipEndDate, internshipStartDate, ...staticBody } = body;
|
|
1740
1833
|
return {
|
|
1741
|
-
typeForm,
|
|
1834
|
+
...(withTypeForm ? { typeForm } : {}),
|
|
1742
1835
|
...getRegion(region, isNaturalPerson),
|
|
1743
1836
|
...getEmail(email, isNaturalPerson),
|
|
1744
1837
|
...getPhone(phone),
|
|
1745
1838
|
...getPhone(russianPhone),
|
|
1746
|
-
...getFormatDate(
|
|
1747
|
-
...
|
|
1839
|
+
...(isNaturalPerson ? getFormatDate([[birthday, 'birthday']]) : { birthday }),
|
|
1840
|
+
...getFormatDate([
|
|
1841
|
+
[desiredMeetingDate, 'desiredMeetingDate'],
|
|
1842
|
+
[internshipEndDate, 'internshipEndDate'],
|
|
1843
|
+
[internshipStartDate, 'internshipStartDate'],
|
|
1844
|
+
]),
|
|
1748
1845
|
...(typeForm === 'FEEDBACK'
|
|
1749
1846
|
? {}
|
|
1750
1847
|
: {
|
|
@@ -1768,7 +1865,7 @@
|
|
|
1768
1865
|
};
|
|
1769
1866
|
};
|
|
1770
1867
|
const getPhone = (phone) => (phone ? { phone: formatPhone(phone) } : {});
|
|
1771
|
-
const getFormatDate = (
|
|
1868
|
+
const getFormatDate = (dates) => Object.fromEntries(dates.filter(([value]) => value).map(([value, key]) => [key, formatDate(value)]));
|
|
1772
1869
|
const getRegion = (region, isNaturalPerson = true) => ({
|
|
1773
1870
|
[isNaturalPerson ? 'regionBranch' : 'region']: region,
|
|
1774
1871
|
});
|
|
@@ -1791,12 +1888,16 @@
|
|
|
1791
1888
|
}
|
|
1792
1889
|
: {};
|
|
1793
1890
|
|
|
1891
|
+
// eslint-disable-next-line max-lines-per-function
|
|
1794
1892
|
function LeadServiceAPI() {
|
|
1795
|
-
async function send(body, router,
|
|
1796
|
-
const
|
|
1797
|
-
const
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1893
|
+
async function send({ body, router, endpoint }) {
|
|
1894
|
+
const calculatedEndpoint = endpoint && getEndpoint(endpoint, body);
|
|
1895
|
+
const url = `${API_BASE_URI}/${calculatedEndpoint}`;
|
|
1896
|
+
const submitBody = getSubmitBody({
|
|
1897
|
+
body,
|
|
1898
|
+
endpoint,
|
|
1899
|
+
router,
|
|
1900
|
+
});
|
|
1800
1901
|
try {
|
|
1801
1902
|
const response = await LeadServiceFetch(url, submitBody);
|
|
1802
1903
|
if (!response?.ok) {
|
|
@@ -1823,11 +1924,11 @@
|
|
|
1823
1924
|
return null;
|
|
1824
1925
|
}
|
|
1825
1926
|
}
|
|
1826
|
-
async function checkCode({ reqId, code, body }) {
|
|
1927
|
+
async function checkCode({ reqId, code, body, router, }) {
|
|
1827
1928
|
const submitBody = {
|
|
1828
1929
|
requestId: reqId,
|
|
1829
1930
|
confimationCode: code,
|
|
1830
|
-
leadRequest: getSubmitBody(body,
|
|
1931
|
+
leadRequest: getSubmitBody({ body, router }),
|
|
1831
1932
|
};
|
|
1832
1933
|
try {
|
|
1833
1934
|
const response = await LeadServiceFetch(`${API_BASE_URI}/confirmCorporateLead`, submitBody);
|
|
@@ -1837,9 +1938,9 @@
|
|
|
1837
1938
|
return null;
|
|
1838
1939
|
}
|
|
1839
1940
|
}
|
|
1840
|
-
async function sendPhoneCallRequest(body,
|
|
1941
|
+
async function sendPhoneCallRequest(body, endpoint) {
|
|
1841
1942
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1842
|
-
const submitBody = getSubmitBody(body,
|
|
1943
|
+
const submitBody = getSubmitBody({ body, endpoint });
|
|
1843
1944
|
const formatSubmitBody = getFormatCallbackSubmitBody(submitBody);
|
|
1844
1945
|
try {
|
|
1845
1946
|
const response = await LeadServiceFetch(`${API_BASE_URI}/callback`, formatSubmitBody);
|
|
@@ -1874,6 +1975,13 @@
|
|
|
1874
1975
|
clientTimezone: getUserTimezoneOffset(),
|
|
1875
1976
|
};
|
|
1876
1977
|
};
|
|
1978
|
+
const getEndpoint = (endpoint, body) => {
|
|
1979
|
+
const { serviceDirection } = body;
|
|
1980
|
+
if (endpoint === 'lead' && serviceDirection !== 'Юридическое лицо / ИП') {
|
|
1981
|
+
return 'lead';
|
|
1982
|
+
}
|
|
1983
|
+
return endpoint;
|
|
1984
|
+
};
|
|
1877
1985
|
|
|
1878
1986
|
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1879
1987
|
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
@@ -1903,8 +2011,8 @@
|
|
|
1903
2011
|
},
|
|
1904
2012
|
});
|
|
1905
2013
|
};
|
|
1906
|
-
const handleCallback = async ({ formatData, data, aspects = {}, ev, typeForm, responseTypeDialog, onSuccess = noop, }) => {
|
|
1907
|
-
const response = await API$2.sendPhoneCallRequest(formatData);
|
|
2014
|
+
const handleCallback = async ({ formatData, data, aspects = {}, ev, typeForm, responseTypeDialog, onSuccess = noop, endpoint, }) => {
|
|
2015
|
+
const response = await API$2.sendPhoneCallRequest(formatData, endpoint);
|
|
1908
2016
|
onSuccess();
|
|
1909
2017
|
if (response?.status === 'success') {
|
|
1910
2018
|
responseTypeDialog.open({ ok: true, typeForm });
|
|
@@ -1924,7 +2032,7 @@
|
|
|
1924
2032
|
}
|
|
1925
2033
|
};
|
|
1926
2034
|
const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, withSnowplow, }) => {
|
|
1927
|
-
const response = await API$2.send(formatData, router, endpoint
|
|
2035
|
+
const response = await API$2.send({ body: formatData, router, endpoint });
|
|
1928
2036
|
const ok = Boolean(response);
|
|
1929
2037
|
responseTypeDialog.open({ ok });
|
|
1930
2038
|
if (ok) {
|
|
@@ -2200,6 +2308,10 @@
|
|
|
2200
2308
|
|
|
2201
2309
|
const ApplierTypeField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0440\u0430\u0442\u0438\u0432\u0448\u0435\u0433\u043E\u0441\u044F", ...input, options: APPLIER_TYPES, ...field('applierType') })));
|
|
2202
2310
|
|
|
2311
|
+
const AverageGradeField = JSX(({ field, input }) => {
|
|
2312
|
+
return (jsx(InputControl, { label: "\u0421\u0440\u0435\u0434\u043D\u0438\u0439 \u0431\u0430\u043B\u043B \u043E\u0431\u0443\u0447\u0435\u043D\u0438\u044F", type: "number", ...field(input?.name ?? ''), ...input }));
|
|
2313
|
+
});
|
|
2314
|
+
|
|
2203
2315
|
const BankEmpoleeField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field(input?.name ?? ''), ...input })));
|
|
2204
2316
|
|
|
2205
2317
|
const useElementSpace = (ref, heightEl) => {
|
|
@@ -2314,7 +2426,7 @@
|
|
|
2314
2426
|
const START_YEAR = 1940;
|
|
2315
2427
|
const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
|
|
2316
2428
|
|
|
2317
|
-
const ICON_PROPS$
|
|
2429
|
+
const ICON_PROPS$2 = {
|
|
2318
2430
|
name: 'CalendarIcon',
|
|
2319
2431
|
iconVersion: 'black',
|
|
2320
2432
|
width: '24',
|
|
@@ -2349,7 +2461,7 @@
|
|
|
2349
2461
|
useEffect(() => {
|
|
2350
2462
|
updateSelectedDate({ inputValue, setSelectedMonth, setSelectedYear, onChange });
|
|
2351
2463
|
}, [inputValue]);
|
|
2352
|
-
return (jsxs("div", { onClick: onInputClick, className: style('relative', className), children: [jsx("input", { ref: ref, className: "h-full w-full px-m text-l text-black focus-visible:outline-none rounded-none", value: inputValue, type: "text", onChange: handleChange, onBlur: onBlur, disabled: disabled }), disabled ? null : jsx(Icon, { className: "mr-s", ...ICON_PROPS$
|
|
2464
|
+
return (jsxs("div", { onClick: onInputClick, className: style('relative', className), children: [jsx("input", { ref: ref, className: "h-full w-full px-m text-l text-black focus-visible:outline-none rounded-none", value: inputValue, type: "text", onChange: handleChange, onBlur: onBlur, disabled: disabled }), disabled ? null : jsx(Icon, { className: "mr-s", ...ICON_PROPS$2 })] }));
|
|
2353
2465
|
});
|
|
2354
2466
|
const isValidYear = (year) => Number(year) >= START_YEAR && Number(year) <= new Date().getFullYear();
|
|
2355
2467
|
const isValidMonth = (month) => Number(month) > 0 && Number(month) < 13;
|
|
@@ -2456,7 +2568,7 @@
|
|
|
2456
2568
|
onChange?.(new Date(selectedYear, selectedMonth, Math.min(maxDateOfMonth, value.getDate())));
|
|
2457
2569
|
};
|
|
2458
2570
|
|
|
2459
|
-
const ICON_PROPS = {
|
|
2571
|
+
const ICON_PROPS$1 = {
|
|
2460
2572
|
name: 'ArrowUpIcon',
|
|
2461
2573
|
iconVersion: 'black',
|
|
2462
2574
|
width: '24',
|
|
@@ -2498,18 +2610,21 @@
|
|
|
2498
2610
|
setSelectedYear,
|
|
2499
2611
|
}), isCalendarVisible && !disabled ? (jsxs("div", { className: style('absolute bg-white z-20 select-none', {
|
|
2500
2612
|
'bottom-full': spaceAbove,
|
|
2501
|
-
}), children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, min: minDate, max: maxDate, weekends: weekends, onDateSelect: handleDateSelect })] })) : null] })] }));
|
|
2613
|
+
}), children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS$1, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS$1, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, min: minDate, max: maxDate, weekends: weekends, onDateSelect: handleDateSelect })] })) : null] })] }));
|
|
2502
2614
|
});
|
|
2503
2615
|
|
|
2504
2616
|
const DatePickerControl = JSX(({ className, label, error, required, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: getRequiredLabel({ label, required }), valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
|
|
2505
2617
|
|
|
2506
|
-
const BirthdayField = JSX(({ field, input }) =>
|
|
2618
|
+
const BirthdayField = JSX(({ field, input }) => {
|
|
2619
|
+
const today = new Date();
|
|
2620
|
+
return (jsx(DatePickerControl, { label: input?.label || 'Дата рождения', ...field(input?.name ?? ''), maxDate: today, ...input }));
|
|
2621
|
+
});
|
|
2507
2622
|
|
|
2508
2623
|
const CallbackTimeField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u041A\u043E\u0433\u0434\u0430 \u043F\u0435\u0440\u0435\u0437\u0432\u043E\u043D\u0438\u0442\u044C?", ...input, options: CALLBACK_TIME, ...field(input?.name ?? '') })));
|
|
2509
2624
|
|
|
2510
2625
|
const CollectionCountField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0438\u043D\u043A\u0430\u0441\u0441\u0430\u0446\u0438\u0438", isInteger: true, ...field(input?.name ?? ''), ...input })));
|
|
2511
2626
|
|
|
2512
|
-
const CommentField = JSX(({ field, input }) => (jsx(InputControl, { className: "col-span-2", ...field(input?.name ?? ''), placeholder:
|
|
2627
|
+
const CommentField = JSX(({ field, input }) => (jsx(InputControl, { className: "col-span-2", ...field(input?.name ?? ''), placeholder: input?.placeholder ?? 'Ваше сообщение', isTextarea: true, ...input })));
|
|
2513
2628
|
|
|
2514
2629
|
function useAsyncEffect(effect, deps) {
|
|
2515
2630
|
useEffect(() => {
|
|
@@ -2648,6 +2763,355 @@
|
|
|
2648
2763
|
|
|
2649
2764
|
const FeedbackMethodField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u0432\u0435\u0442\u0430", options: FEEDBACK_METHOD, ...field(input?.name ?? ''), ...input })));
|
|
2650
2765
|
|
|
2766
|
+
const ACCEPTED_EXTENSIONS_TEXT = 'Поддерживаемые форматы файлов';
|
|
2767
|
+
const MAX_SIZE_TEXT = 'Максимальный размер файла';
|
|
2768
|
+
const EMPTY_FILE_ERROR_TEXT = 'Ошибка загрузки файла. Убедитесь, что файл не пустой';
|
|
2769
|
+
const EXTENSIONS_ERROR_TEXT = 'Файл не соответствует допустимым расширениям';
|
|
2770
|
+
const MAX_SIZE_ERROR_TEXT = 'Файл превышает допустимый размер';
|
|
2771
|
+
const DEFAULT_ERROR_TEXT = 'Ошибка при загрузке файла. Попробуйте загрузить файл позднее';
|
|
2772
|
+
|
|
2773
|
+
const FILE_CHECK_URL = 'uploadFile';
|
|
2774
|
+
const SUCCESS_STATUS = 'SUCCESS';
|
|
2775
|
+
async function sendFile({ file, onProgress = noop }) {
|
|
2776
|
+
return new Promise((resolve, reject) => {
|
|
2777
|
+
const formData = new FormData();
|
|
2778
|
+
formData.append('file', file);
|
|
2779
|
+
let processingAnimation = undefined;
|
|
2780
|
+
const xhr = new XMLHttpRequest();
|
|
2781
|
+
let lastProgress;
|
|
2782
|
+
xhr.upload.onprogress = (event) => {
|
|
2783
|
+
if (event.lengthComputable) {
|
|
2784
|
+
const percentComplete = (event.loaded / event.total) * 50;
|
|
2785
|
+
onProgress(percentComplete);
|
|
2786
|
+
}
|
|
2787
|
+
};
|
|
2788
|
+
xhr.upload.onload = () => {
|
|
2789
|
+
let current = 50;
|
|
2790
|
+
onProgress(current);
|
|
2791
|
+
processingAnimation = window.setInterval(() => {
|
|
2792
|
+
current += 0.2;
|
|
2793
|
+
lastProgress = current;
|
|
2794
|
+
if (current < 90) {
|
|
2795
|
+
onProgress(current);
|
|
2796
|
+
}
|
|
2797
|
+
else {
|
|
2798
|
+
onProgress(90);
|
|
2799
|
+
window.clearInterval(processingAnimation);
|
|
2800
|
+
}
|
|
2801
|
+
}, 100);
|
|
2802
|
+
};
|
|
2803
|
+
xhr.onload = async () => {
|
|
2804
|
+
try {
|
|
2805
|
+
const response = JSON.parse(xhr.responseText);
|
|
2806
|
+
if (response.status === 'SUCCESS') {
|
|
2807
|
+
window.clearInterval(processingAnimation);
|
|
2808
|
+
await animateToFull(lastProgress, onProgress);
|
|
2809
|
+
resolve(response);
|
|
2810
|
+
}
|
|
2811
|
+
else {
|
|
2812
|
+
reject(new Error(response.errorDesc ?? DEFAULT_ERROR_TEXT));
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
catch (e) {
|
|
2816
|
+
reject(new Error(DEFAULT_ERROR_TEXT));
|
|
2817
|
+
}
|
|
2818
|
+
};
|
|
2819
|
+
xhr.onerror = () => {
|
|
2820
|
+
reject(new Error(DEFAULT_ERROR_TEXT));
|
|
2821
|
+
};
|
|
2822
|
+
xhr.open('POST', `${API_BASE_URI}/${FILE_CHECK_URL}`);
|
|
2823
|
+
xhr.send(formData);
|
|
2824
|
+
});
|
|
2825
|
+
}
|
|
2826
|
+
const animateToFull = (current, onProgress) => new Promise((resolve) => {
|
|
2827
|
+
let value = current;
|
|
2828
|
+
const increment = (100 - current) / 30;
|
|
2829
|
+
const interval = 16;
|
|
2830
|
+
const step = () => {
|
|
2831
|
+
value += increment;
|
|
2832
|
+
if (value >= 100) {
|
|
2833
|
+
onProgress(100);
|
|
2834
|
+
resolve();
|
|
2835
|
+
}
|
|
2836
|
+
else {
|
|
2837
|
+
onProgress(value);
|
|
2838
|
+
setTimeout(step, interval);
|
|
2839
|
+
}
|
|
2840
|
+
};
|
|
2841
|
+
step();
|
|
2842
|
+
});
|
|
2843
|
+
|
|
2844
|
+
const useDragAndDrop = ({ onFileSelected, onReset, uploadResponse, onFileChanged, }) => {
|
|
2845
|
+
const [isDragActive, setIsDragActive] = useState(false);
|
|
2846
|
+
const handleDrag = (e) => {
|
|
2847
|
+
e.preventDefault();
|
|
2848
|
+
if (uploadResponse) {
|
|
2849
|
+
return;
|
|
2850
|
+
}
|
|
2851
|
+
setIsDragActive(true);
|
|
2852
|
+
};
|
|
2853
|
+
const handleLeave = () => setIsDragActive(false);
|
|
2854
|
+
const handleDrop = async (e) => {
|
|
2855
|
+
e.preventDefault();
|
|
2856
|
+
if (uploadResponse) {
|
|
2857
|
+
return;
|
|
2858
|
+
}
|
|
2859
|
+
onReset();
|
|
2860
|
+
setIsDragActive(false);
|
|
2861
|
+
const file = e.dataTransfer?.files?.[0];
|
|
2862
|
+
if (file) {
|
|
2863
|
+
await onFileSelected({ file, onFileChanged });
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
return { handleDrag, handleLeave, handleDrop, isDragActive };
|
|
2867
|
+
};
|
|
2868
|
+
|
|
2869
|
+
const ProgressBar = JSX(({ step = 10, description, showPercentage = true, isOnlyInteger = false }) => (jsxs("div", { children: [jsx("div", { className: "h-4 w-full bg-gray relative", children: jsx("div", { className: "h-4 bg-green", style: { width: `${step}%` } }) }), jsxs("div", { className: "relative", children: [showPercentage ? (jsxs("div", { className: "absolute left-2/4 text-green", children: [isOnlyInteger ? Math.round(step) : step, "%"] })) : null, description ? jsx("div", { className: "text-right pr-m text-gray", children: description }) : null] })] })));
|
|
2870
|
+
|
|
2871
|
+
const ICON_PROPS = {
|
|
2872
|
+
name: 'DocIcon',
|
|
2873
|
+
iconVersion: 'black',
|
|
2874
|
+
width: '24',
|
|
2875
|
+
height: '24',
|
|
2876
|
+
};
|
|
2877
|
+
const renderFileInput = ({ label, inputRef, id, key, type, name, pattern, disabled, onChange = noop, onFocus, onBlur, extensions, uploadResponse, file, }) => {
|
|
2878
|
+
const ariaLabel = label ?? name ?? id;
|
|
2879
|
+
return (jsx("div", { children: uploadResponse?.status === SUCCESS_STATUS ? (renderFileName(file)) : (jsxs("div", { className: "flex items-center space-x-2", children: [jsx(Icon, { className: "inline-block", ...ICON_PROPS }), renderLabel$1(label), jsx("input", { ref: inputRef, className: style('h-14 hidden'), id: id, type: type, name: name || id, pattern: pattern, disabled: disabled, "aria-label": ariaLabel, onChange: (e) => {
|
|
2880
|
+
e?.target?.files && onChange(e?.target?.files[0]);
|
|
2881
|
+
}, onFocus: onFocus, onBlur: onBlur, accept: extensionsToAccept(extensions) }, key)] })) }));
|
|
2882
|
+
};
|
|
2883
|
+
const extensionsToAccept = (extensions = []) => {
|
|
2884
|
+
return extensions
|
|
2885
|
+
.map((ext) => {
|
|
2886
|
+
const str = String(ext).trim();
|
|
2887
|
+
return str.startsWith('.') ? str : '.' + str;
|
|
2888
|
+
})
|
|
2889
|
+
.map((ext) => ext.toLowerCase())
|
|
2890
|
+
.filter((ext, index, arr) => arr.indexOf(ext) === index)
|
|
2891
|
+
.join(', ');
|
|
2892
|
+
};
|
|
2893
|
+
const renderFileName = (file) => jsx("span", { children: file?.name });
|
|
2894
|
+
|
|
2895
|
+
const renderInfoText = (extensions, maxSize) => {
|
|
2896
|
+
const extensionsMessage = extensions
|
|
2897
|
+
? `${ACCEPTED_EXTENSIONS_TEXT} - ${extensions.join(', ')}. `
|
|
2898
|
+
: '';
|
|
2899
|
+
const maxSizeMessage = maxSize ? `${MAX_SIZE_TEXT} - ${maxSize}Мб.` : '';
|
|
2900
|
+
return (jsx(Text, { size: "text-xs", font: "font-light", color: "text-secondary-text", children: extensionsMessage + maxSizeMessage }));
|
|
2901
|
+
};
|
|
2902
|
+
|
|
2903
|
+
const animateStepWithMinDuration = ({ from, to, onUpdate = noop, minDuration = 300, }) => {
|
|
2904
|
+
return new Promise((resolve) => {
|
|
2905
|
+
const startTime = performance.now();
|
|
2906
|
+
const animate = () => {
|
|
2907
|
+
const currentTime = performance.now();
|
|
2908
|
+
const elapsed = currentTime - startTime;
|
|
2909
|
+
const animationProgress = Math.min(elapsed / minDuration, 1);
|
|
2910
|
+
const easeProgress = 1 - Math.pow(1 - animationProgress, 3);
|
|
2911
|
+
const value = from + (to - from) * easeProgress;
|
|
2912
|
+
onUpdate(value);
|
|
2913
|
+
if (animationProgress < 1) {
|
|
2914
|
+
requestAnimationFrame(animate);
|
|
2915
|
+
}
|
|
2916
|
+
else {
|
|
2917
|
+
onUpdate(to);
|
|
2918
|
+
resolve();
|
|
2919
|
+
}
|
|
2920
|
+
};
|
|
2921
|
+
requestAnimationFrame(animate);
|
|
2922
|
+
});
|
|
2923
|
+
};
|
|
2924
|
+
|
|
2925
|
+
const checkFileExtension = async (file, extensions) => {
|
|
2926
|
+
const fileExt = file.name.split('.')[1];
|
|
2927
|
+
console.log(fileExt, extensions);
|
|
2928
|
+
if (!extensions?.includes(fileExt)) {
|
|
2929
|
+
throw new Error(EXTENSIONS_ERROR_TEXT);
|
|
2930
|
+
}
|
|
2931
|
+
};
|
|
2932
|
+
|
|
2933
|
+
const EXT_TO_MIME = {
|
|
2934
|
+
pdf: 'application/pdf',
|
|
2935
|
+
doc: 'application/msword',
|
|
2936
|
+
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
2937
|
+
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
2938
|
+
};
|
|
2939
|
+
const checkFileMimeType = async (file, extensions) => {
|
|
2940
|
+
const fileMimeType = file?.type ?? '';
|
|
2941
|
+
const expectedMimeTypes = (extensions || [])
|
|
2942
|
+
.map((ext) => EXT_TO_MIME[ext])
|
|
2943
|
+
.filter((mime) => mime !== undefined);
|
|
2944
|
+
if (!expectedMimeTypes.includes(fileMimeType)) {
|
|
2945
|
+
throw new Error(EXTENSIONS_ERROR_TEXT);
|
|
2946
|
+
}
|
|
2947
|
+
};
|
|
2948
|
+
|
|
2949
|
+
const getFileSignature = (file) => {
|
|
2950
|
+
return new Promise((resolve, reject) => {
|
|
2951
|
+
const reader = new FileReader();
|
|
2952
|
+
reader.onload = () => {
|
|
2953
|
+
const buffer = reader.result;
|
|
2954
|
+
const bytes = new Uint8Array(buffer);
|
|
2955
|
+
const hex = Array.from(bytes)
|
|
2956
|
+
.map((b) => b.toString(16).padStart(2, '0'))
|
|
2957
|
+
.join(' ');
|
|
2958
|
+
resolve(hex);
|
|
2959
|
+
};
|
|
2960
|
+
reader.onerror = reject;
|
|
2961
|
+
return file && reader.readAsArrayBuffer(file.slice(0, 8));
|
|
2962
|
+
});
|
|
2963
|
+
};
|
|
2964
|
+
|
|
2965
|
+
const SIGNATURES = {
|
|
2966
|
+
pdf: '25 50 44 46 2d',
|
|
2967
|
+
docx: '50 4b 03 04',
|
|
2968
|
+
pptx: '50 4b 03 04',
|
|
2969
|
+
xlsx: '50 4b 03 04',
|
|
2970
|
+
doc: 'D0 CF 11 E0 A1 B1 1A E1',
|
|
2971
|
+
};
|
|
2972
|
+
const checkFileSignature = async (file, expectedTypes) => {
|
|
2973
|
+
const hexSignature = await getFileSignature(file);
|
|
2974
|
+
const isValid = (expectedTypes ?? []).some((type) => {
|
|
2975
|
+
const expectedSignature = SIGNATURES[type]?.toLowerCase();
|
|
2976
|
+
console.log(expectedSignature);
|
|
2977
|
+
console.log(hexSignature);
|
|
2978
|
+
return expectedSignature && hexSignature.startsWith(expectedSignature);
|
|
2979
|
+
});
|
|
2980
|
+
if (!isValid) {
|
|
2981
|
+
throw new Error(EXTENSIONS_ERROR_TEXT);
|
|
2982
|
+
}
|
|
2983
|
+
};
|
|
2984
|
+
|
|
2985
|
+
const checkFileSize = async (file, maxSizeMB) => {
|
|
2986
|
+
if (maxSizeMB && file.size > maxSizeMB * 1024 * 1024) {
|
|
2987
|
+
throw new Error(MAX_SIZE_ERROR_TEXT);
|
|
2988
|
+
}
|
|
2989
|
+
if (file.size === 0) {
|
|
2990
|
+
throw new Error(EMPTY_FILE_ERROR_TEXT);
|
|
2991
|
+
}
|
|
2992
|
+
};
|
|
2993
|
+
|
|
2994
|
+
const DEBOUNCE_DELAY = 500;
|
|
2995
|
+
const useVerifyFile = ({ onUploadError = noop, onFileSelected = noop, extensions, maxSizeMB, onUploadResponse = noop, }) => {
|
|
2996
|
+
const [progress, setProgress] = useState(0);
|
|
2997
|
+
const [isFileUploading, setIsFileUploading] = useState(false);
|
|
2998
|
+
const debouncedOnFileUploaded = useMemo(() => debounce((isUploading) => setIsFileUploading(isUploading), DEBOUNCE_DELAY), [setIsFileUploading]);
|
|
2999
|
+
const debouncedOnUploadError = useMemo(() => debounce((message) => onUploadError(message), DEBOUNCE_DELAY), [onUploadError]);
|
|
3000
|
+
const debouncedOnUploadResponse = useMemo(() => debounce((response) => onUploadResponse(response), DEBOUNCE_DELAY), [onUploadResponse]);
|
|
3001
|
+
const verifyFile = async ({ file, onFileChanged = noop }) => {
|
|
3002
|
+
onFileSelected(file);
|
|
3003
|
+
setIsFileUploading(true);
|
|
3004
|
+
const checks = [
|
|
3005
|
+
() => checkFileExtension(file, extensions),
|
|
3006
|
+
() => checkFileSize(file, maxSizeMB),
|
|
3007
|
+
() => checkFileSignature(file, extensions),
|
|
3008
|
+
() => checkFileMimeType(file, extensions),
|
|
3009
|
+
];
|
|
3010
|
+
const checkProgressStep = 50 / checks.length;
|
|
3011
|
+
let currentProgress = 0;
|
|
3012
|
+
try {
|
|
3013
|
+
for (let i = 0; i < checks.length; i++) {
|
|
3014
|
+
const checkPromise = checks[i];
|
|
3015
|
+
await checkPromise();
|
|
3016
|
+
const targetProgress = (i + 1) * checkProgressStep;
|
|
3017
|
+
await animateStepWithMinDuration({
|
|
3018
|
+
from: currentProgress,
|
|
3019
|
+
to: targetProgress,
|
|
3020
|
+
onUpdate: setProgress,
|
|
3021
|
+
minDuration: 300,
|
|
3022
|
+
});
|
|
3023
|
+
currentProgress = targetProgress;
|
|
3024
|
+
}
|
|
3025
|
+
const response = await sendFile({
|
|
3026
|
+
file,
|
|
3027
|
+
onProgress: setProgress,
|
|
3028
|
+
});
|
|
3029
|
+
debouncedOnUploadResponse(response);
|
|
3030
|
+
onFileChanged(response?.fileId ?? '');
|
|
3031
|
+
if (response?.status === SUCCESS_STATUS) {
|
|
3032
|
+
debouncedOnFileUploaded?.(false);
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
catch (e) {
|
|
3036
|
+
const errorMessage = e instanceof Error ? e.message : DEFAULT_ERROR_TEXT;
|
|
3037
|
+
debouncedOnUploadError(errorMessage);
|
|
3038
|
+
onFileChanged('');
|
|
3039
|
+
}
|
|
3040
|
+
debouncedOnFileUploaded?.(false);
|
|
3041
|
+
};
|
|
3042
|
+
return { verifyFile, isFileUploading, progress };
|
|
3043
|
+
};
|
|
3044
|
+
|
|
3045
|
+
const InputFile = JSX(
|
|
3046
|
+
// eslint-disable-next-line max-lines-per-function
|
|
3047
|
+
({ key, className, id, name, type = 'file', label, valid = true, pattern, autoFocus = false, extensions, children, onFocus, onBlur, maxSizeMB, error, onFileChanged = noop, }) => {
|
|
3048
|
+
const inputRef = useRef(null);
|
|
3049
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
3050
|
+
const [uploadError, setUploadError] = useState('');
|
|
3051
|
+
const [uploadResponse, setUploadResponse] = useState(null);
|
|
3052
|
+
const { verifyFile, isFileUploading, progress } = useVerifyFile({
|
|
3053
|
+
onUploadError: setUploadError,
|
|
3054
|
+
onUploadResponse: setUploadResponse,
|
|
3055
|
+
onFileSelected: setSelectedFile,
|
|
3056
|
+
extensions,
|
|
3057
|
+
maxSizeMB,
|
|
3058
|
+
});
|
|
3059
|
+
useEffect(() => {
|
|
3060
|
+
if (autoFocus) {
|
|
3061
|
+
inputRef.current?.focus();
|
|
3062
|
+
}
|
|
3063
|
+
}, [autoFocus, inputRef]);
|
|
3064
|
+
const handleFileChange = async (file) => {
|
|
3065
|
+
handleResetFile();
|
|
3066
|
+
if (file) {
|
|
3067
|
+
await verifyFile({ file, onFileChanged });
|
|
3068
|
+
}
|
|
3069
|
+
};
|
|
3070
|
+
const handleResetFile = () => {
|
|
3071
|
+
setSelectedFile(null);
|
|
3072
|
+
setUploadError('');
|
|
3073
|
+
setUploadResponse(null);
|
|
3074
|
+
onFileChanged('');
|
|
3075
|
+
};
|
|
3076
|
+
const { handleDrag, handleLeave, handleDrop, isDragActive } = useDragAndDrop({
|
|
3077
|
+
onReset: handleResetFile,
|
|
3078
|
+
onFileSelected: verifyFile,
|
|
3079
|
+
uploadResponse,
|
|
3080
|
+
onFileChanged,
|
|
3081
|
+
});
|
|
3082
|
+
const paddingStyle = children ? 'pr-3xl' : '';
|
|
3083
|
+
const validStyle = getValidStyle(valid);
|
|
3084
|
+
const activeDragStyle = isDragActive ? 'border-primary-hover' : '';
|
|
3085
|
+
return (jsxs("div", { className: style('relative', className), onDragEnter: handleDrag, onDragOver: handleDrag, onDragLeave: handleLeave, onDrop: handleDrop, children: [jsx("label", { className: style('h-14 cursor-pointer space-y-xs block', defaultStyle$1, paddingStyle, borderStyle, validStyle, activeDragStyle), children: isFileUploading ? (jsx("div", { children: jsx(ProgressBar, { step: progress, isOnlyInteger: true }) })) : (renderFileInput({
|
|
3086
|
+
label,
|
|
3087
|
+
inputRef,
|
|
3088
|
+
id,
|
|
3089
|
+
key,
|
|
3090
|
+
type,
|
|
3091
|
+
name,
|
|
3092
|
+
pattern,
|
|
3093
|
+
disabled: Boolean(uploadResponse || isFileUploading),
|
|
3094
|
+
onChange: handleFileChange,
|
|
3095
|
+
onFocus,
|
|
3096
|
+
onBlur,
|
|
3097
|
+
extensions,
|
|
3098
|
+
uploadResponse,
|
|
3099
|
+
file: selectedFile,
|
|
3100
|
+
})) }), uploadResponse?.status === SUCCESS_STATUS ? (jsx(CloseButton, { className: "absolute top-0 right-0 z-10", onClose: handleResetFile })) : null, renderInfoText(extensions, maxSizeMB), renderErrorText(error || uploadError), children] }));
|
|
3101
|
+
});
|
|
3102
|
+
|
|
3103
|
+
const InputFileControl = JSX(({ label, value = '', error, type, inputRef, required, ...rest }) => {
|
|
3104
|
+
return (jsx("div", { ref: inputRef, children: jsx(InputFile, { type: type || 'file', "aria-label": label, label: getRequiredLabel({ label, required }), valid: Boolean(!error), value: value, error: error, ...rest }) }));
|
|
3105
|
+
});
|
|
3106
|
+
|
|
3107
|
+
const FileUploadField = JSX(({ field, input }) => {
|
|
3108
|
+
const [fileId, setFileId] = useState('');
|
|
3109
|
+
useEffect(() => {
|
|
3110
|
+
field('fileId')?.onChange?.(fileId);
|
|
3111
|
+
}, [fileId]);
|
|
3112
|
+
return (jsx(InputFileControl, { type: "file", label: input?.name ?? '', ...field(input?.name ?? ''), ...input, onFileChanged: setFileId }));
|
|
3113
|
+
});
|
|
3114
|
+
|
|
2651
3115
|
const FullNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E", ...field(input?.name ?? ''), ...input })));
|
|
2652
3116
|
|
|
2653
3117
|
const FullRegionField = JSX(({ field, input, params }) => {
|
|
@@ -2662,6 +3126,38 @@
|
|
|
2662
3126
|
|
|
2663
3127
|
const InnField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? '') })));
|
|
2664
3128
|
|
|
3129
|
+
const INTERNSHIP_END_DATE_ERROR = 'Некорректно заполненное поле';
|
|
3130
|
+
const InternshipEndDateField = JSX(({ field, input }) => {
|
|
3131
|
+
const [startDate, setStartDate] = useState();
|
|
3132
|
+
const [internshipEndDateError, setInternshipEndDateError] = useState('');
|
|
3133
|
+
const [internshipEndDateValue, setInternshipEndDateValue] = useState();
|
|
3134
|
+
useEffect(() => {
|
|
3135
|
+
setStartDate(field('internshipStartDate').value);
|
|
3136
|
+
}, [field('internshipStartDate').value]);
|
|
3137
|
+
const handleInputChange = (value) => {
|
|
3138
|
+
setInternshipEndDateValue(value);
|
|
3139
|
+
field(input?.name ?? '')?.onChange?.(value);
|
|
3140
|
+
setInternshipEndDateError(isDateValid(value, { minLimit: startDate }) ? '' : INTERNSHIP_END_DATE_ERROR);
|
|
3141
|
+
};
|
|
3142
|
+
return (jsx(DatePickerControl, { label: input?.label || 'Дата окончания практики', ...field(input?.name ?? ''), ...input, value: internshipEndDateValue, error: field(input?.name ?? '')?.error || internshipEndDateError, errors: [field(input?.name ?? '')?.error || internshipEndDateError], onChange: handleInputChange, minDate: startDate }));
|
|
3143
|
+
});
|
|
3144
|
+
|
|
3145
|
+
const INTERNSHIP_START_DATE_ERROR = 'Некорректно заполненное поле';
|
|
3146
|
+
const InternshipStartDateField = JSX(({ field, input }) => {
|
|
3147
|
+
const [endDate, setEndDate] = useState();
|
|
3148
|
+
const [internshipStartDateError, setInternshipStartDateError] = useState('');
|
|
3149
|
+
const [internshipStartDateValue, setInternshipStartDateValue] = useState();
|
|
3150
|
+
useEffect(() => {
|
|
3151
|
+
setEndDate(field('internshipEndDate').value);
|
|
3152
|
+
}, [field('internshipEndDate').value]);
|
|
3153
|
+
const handleInputChange = (value) => {
|
|
3154
|
+
setInternshipStartDateValue(value);
|
|
3155
|
+
field(input?.name ?? '')?.onChange?.(value);
|
|
3156
|
+
setInternshipStartDateError(isDateValid(value, { maxLimit: endDate }) ? '' : INTERNSHIP_START_DATE_ERROR);
|
|
3157
|
+
};
|
|
3158
|
+
return (jsx(DatePickerControl, { label: input?.label || 'Дата начала практики', ...field(input?.name ?? ''), ...input, value: internshipStartDateValue, error: internshipStartDateError || field(input?.name ?? '')?.error, errors: [internshipStartDateError ?? field(input?.name ?? '')?.error], onChange: handleInputChange, maxDate: endDate }));
|
|
3159
|
+
});
|
|
3160
|
+
|
|
2665
3161
|
const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
|
|
2666
3162
|
|
|
2667
3163
|
const IsClientField = JSX(({ field, input }) => (jsx(CheckboxWithError, { ...field(input?.name ?? ''), ...input, text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })));
|
|
@@ -2792,6 +3288,8 @@
|
|
|
2792
3288
|
: withValidator(fieldPhone, validatorObj$1.secondaryPhone)) }));
|
|
2793
3289
|
});
|
|
2794
3290
|
|
|
3291
|
+
const SelectField$1 = JSX(({ field, input, label, options }) => (jsx(SelectControl, { label: label, options: options, ...field(input?.name ?? ''), ...input })));
|
|
3292
|
+
|
|
2795
3293
|
const ServiceDirectionField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...field(input?.name ?? ''), ...input })));
|
|
2796
3294
|
|
|
2797
3295
|
const SituationDescriptionField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438", ...input, ...field('situationDescription') })));
|
|
@@ -2805,6 +3303,8 @@
|
|
|
2805
3303
|
const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
|
|
2806
3304
|
const TermField = JSX(({ field }) => (jsx(InputRange, { title: "\u0421\u0440\u043E\u043A, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })));
|
|
2807
3305
|
|
|
3306
|
+
const TextField = JSX(({ field, input, label }) => (jsx(InputControl, { label: label, maxLength: 60, ...field(input?.name ?? ''), ...input })));
|
|
3307
|
+
|
|
2808
3308
|
const UltraPremiumField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...field(input?.name ?? ''), ...input })));
|
|
2809
3309
|
|
|
2810
3310
|
const orientationStyleMap = {
|
|
@@ -2825,22 +3325,6 @@
|
|
|
2825
3325
|
|
|
2826
3326
|
const ConsentToReceiveMaterialsField = JSX(({ field, input }) => (jsx(Checkbox, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435", ...field(input?.name ?? ''), ...input })));
|
|
2827
3327
|
|
|
2828
|
-
const RefWrapper = JSX(({ onFieldRef = noop, children }) => {
|
|
2829
|
-
const ref = useRef(null);
|
|
2830
|
-
useEffect(() => {
|
|
2831
|
-
if (ref.current) {
|
|
2832
|
-
onFieldRef(ref.current);
|
|
2833
|
-
}
|
|
2834
|
-
}, []);
|
|
2835
|
-
return jsx("div", { ref: ref, children: children });
|
|
2836
|
-
});
|
|
2837
|
-
|
|
2838
|
-
function shouldRenderField({ input, field, }) {
|
|
2839
|
-
const { condition } = input;
|
|
2840
|
-
const { value } = field(condition?.name || '');
|
|
2841
|
-
return !condition || condition?.values?.includes(value?.key ?? value);
|
|
2842
|
-
}
|
|
2843
|
-
|
|
2844
3328
|
const PRODUCT_REF = {
|
|
2845
3329
|
$ref: '/wcms-resources/outservice-productlist.json',
|
|
2846
3330
|
};
|
|
@@ -2891,7 +3375,39 @@
|
|
|
2891
3375
|
questionProduct: QuestionProductField,
|
|
2892
3376
|
callbackTime: CallbackTimeField,
|
|
2893
3377
|
russianPhone: PhoneField,
|
|
3378
|
+
cityOfResidence: (props) => jsx(TextField, { ...props, label: "\u0413\u043E\u0440\u043E\u0434 \u043F\u0440\u043E\u0436\u0438\u0432\u0430\u043D\u0438\u044F" }),
|
|
3379
|
+
internshipStartDate: InternshipStartDateField,
|
|
3380
|
+
internshipEndDate: InternshipEndDateField,
|
|
3381
|
+
university: (props) => jsx(TextField, { ...props, label: "\u0412\u0423\u0417" }),
|
|
3382
|
+
courseYear: (props) => jsx(TextField, { ...props, label: "\u041A\u0443\u0440\u0441" }),
|
|
3383
|
+
graduationYear: (props) => jsx(TextField, { ...props, label: "\u0413\u043E\u0434 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F" }),
|
|
3384
|
+
fieldOfStudy: (props) => jsx(TextField, { ...props, label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0443\u0447\u0435\u043D\u0438\u044F" }),
|
|
3385
|
+
educationLevel: (props) => (jsx(SelectField$1, { ...props, label: "\u0421\u0442\u0443\u043F\u0435\u043D\u044C \u043E\u0431\u0443\u0447\u0435\u043D\u0438\u044F", options: EDUCATION_LEVEL })),
|
|
3386
|
+
averageGrade: AverageGradeField,
|
|
3387
|
+
skillsAndKnowledge: CommentField,
|
|
3388
|
+
workExperience: CommentField,
|
|
3389
|
+
motivationForInternship: CommentField,
|
|
3390
|
+
internshipDirection: (props) => (jsx(SelectField$1, { ...props, label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0430\u0436\u0438\u0440\u043E\u0432\u043A\u0438", options: INTERNSHIP_DIRECTION })),
|
|
3391
|
+
workingHours: (props) => (jsx(SelectField$1, { ...props, label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u0447\u0430\u0441\u043E\u0432", options: WORKING_HOURS })),
|
|
3392
|
+
fileUpload: FileUploadField,
|
|
2894
3393
|
};
|
|
3394
|
+
|
|
3395
|
+
const RefWrapper = JSX(({ onFieldRef = noop, children }) => {
|
|
3396
|
+
const ref = useRef(null);
|
|
3397
|
+
useEffect(() => {
|
|
3398
|
+
if (ref.current) {
|
|
3399
|
+
onFieldRef(ref.current);
|
|
3400
|
+
}
|
|
3401
|
+
}, []);
|
|
3402
|
+
return jsx("div", { ref: ref, children: children });
|
|
3403
|
+
});
|
|
3404
|
+
|
|
3405
|
+
function shouldRenderField({ input, field, }) {
|
|
3406
|
+
const { condition } = input;
|
|
3407
|
+
const { value } = field(condition?.name || '');
|
|
3408
|
+
return !condition || condition?.values?.includes(value?.key ?? value);
|
|
3409
|
+
}
|
|
3410
|
+
|
|
2895
3411
|
const getField = (field, params, externalInputs = {}) => (input, i) => {
|
|
2896
3412
|
const fieldsRegister = {
|
|
2897
3413
|
...InputsMap$1,
|
|
@@ -3004,6 +3520,7 @@
|
|
|
3004
3520
|
const API$1 = LeadServiceAPI();
|
|
3005
3521
|
const useVerifyPhoneDialogSubmit$1 = ({ values, onSuccess, formatData, reqId, }) => {
|
|
3006
3522
|
const timer = Math.max(getTimer(Date.now()), 0);
|
|
3523
|
+
const router = useRouter();
|
|
3007
3524
|
const [errorText, setErrorText] = useState('');
|
|
3008
3525
|
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
3009
3526
|
const [timeNextReq, setTimeNextReq] = useState(timer);
|
|
@@ -3016,6 +3533,7 @@
|
|
|
3016
3533
|
code: values.join(''),
|
|
3017
3534
|
body: formatData,
|
|
3018
3535
|
reqId,
|
|
3536
|
+
router,
|
|
3019
3537
|
});
|
|
3020
3538
|
if (response?.errorDesc) {
|
|
3021
3539
|
setErrorText(response?.errorDesc);
|
|
@@ -3087,7 +3605,7 @@
|
|
|
3087
3605
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog$1);
|
|
3088
3606
|
const handleSubmit = useCallback(async (formData, ev) => {
|
|
3089
3607
|
const formatData = getFormatData({ ...formData, ...additionalParams });
|
|
3090
|
-
await executeHandler(
|
|
3608
|
+
await executeHandler({
|
|
3091
3609
|
formatData,
|
|
3092
3610
|
ev,
|
|
3093
3611
|
typeForm,
|
|
@@ -3097,9 +3615,8 @@
|
|
|
3097
3615
|
responseTypeDialog,
|
|
3098
3616
|
verifyPhoneDialog,
|
|
3099
3617
|
onSuccess,
|
|
3100
|
-
endpoint,
|
|
3101
3618
|
withSnowplow,
|
|
3102
|
-
});
|
|
3619
|
+
}, endpoint);
|
|
3103
3620
|
}, [typeForm]);
|
|
3104
3621
|
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
3105
3622
|
resetOnSubmit: true,
|
|
@@ -3115,9 +3632,9 @@
|
|
|
3115
3632
|
typeForm,
|
|
3116
3633
|
})] }), isContacts ? renderContacts() : null] }));
|
|
3117
3634
|
});
|
|
3118
|
-
const executeHandler = async (
|
|
3119
|
-
const handler = handlerMap[endpoint] || handlerMap.default;
|
|
3120
|
-
await handler(context);
|
|
3635
|
+
const executeHandler = async (context, endpoint) => {
|
|
3636
|
+
const handler = (endpoint && handlerMap[endpoint]) || handlerMap.default;
|
|
3637
|
+
await handler({ ...context, endpoint });
|
|
3121
3638
|
};
|
|
3122
3639
|
|
|
3123
3640
|
const mapProductTypeToName = {
|
|
@@ -8999,8 +9516,6 @@
|
|
|
8999
9516
|
const renderBlocks = (info) => (jsx("div", { className: "flex gap-5xl grow basis-0", children: info.map((column, i) => renderBlocksColumn({ column, i })) }));
|
|
9000
9517
|
const renderBlocksColumn = ({ column, i }) => column ? (jsx("div", { className: "flex flex-col gap-xl grow basis-0", children: column.map(({ title = '', description, additionalDescription, button }, key) => (jsxs("div", { children: [jsx(Headline, { title: title, description: description, headlineVersion: "XS", align: "text-left", isEmbedded: true }), additionalDescription ? (jsx("div", { className: "mt-xs opacity-80", children: jsx(Paragraph, { size: "text-m", font: "font-light", children: additionalDescription }) })) : null, jsx("div", { className: style({ 'mt-xl': Boolean(button?.text) }), children: renderButtonsSection([button]) })] }, String(key)))) }, `col-${String(i)}`)) : null;
|
|
9001
9518
|
|
|
9002
|
-
const ProgressBar = JSX(({ step = 10, description, showPercentage = true }) => (jsxs("div", { children: [jsx("div", { className: "h-4 w-full bg-gray relative", children: jsx("div", { className: "h-4 bg-green", style: { width: `${step}%` } }) }), jsxs("div", { className: "relative", children: [showPercentage ? jsxs("div", { className: "absolute left-2/4 text-green", children: [step, "%"] }) : null, description ? jsx("div", { className: "text-right pr-m text-gray", children: description }) : null] })] })));
|
|
9003
|
-
|
|
9004
9519
|
const CreditCardFormProgress = JSX(({ step = 1, totalSteps = 6, stepsTitles = [] }) => {
|
|
9005
9520
|
const progress = useMemo(() => ((step + 1) / totalSteps) * 100, [step, totalSteps]);
|
|
9006
9521
|
return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold mr-s", children: ["\u0428\u0430\u0433 ", step + 1, " \u0438\u0437 ", totalSteps, "."] }), stepsTitles[step] || null, jsx(ProgressBar, { step: progress, showPercentage: false })] }) }));
|
|
@@ -13167,7 +13682,7 @@
|
|
|
13167
13682
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
13168
13683
|
});
|
|
13169
13684
|
|
|
13170
|
-
const packageVersion = "0.14.
|
|
13685
|
+
const packageVersion = "0.14.990";
|
|
13171
13686
|
|
|
13172
13687
|
exports.Blocks = Blocks;
|
|
13173
13688
|
exports.ContentPage = ContentPage;
|