@redneckz/wildless-cms-uni-blocks 0.14.641 → 0.14.643
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/dadataHints/dadataHintsType.d.ts +2 -0
- package/bundle/bundle.umd.js +37 -21
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/bundle/ui-kit/FormField/calculateIsRequired.d.ts +2 -0
- package/bundle/ui-kit/FormField/validators.d.ts +2 -0
- package/bundle/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +2 -2
- package/dist/api/RetailAPI/sendSignalToProcess.js +1 -1
- package/dist/api/RetailAPI/sendSignalToProcess.js.map +1 -1
- package/dist/api/dadataHints/dadataHintsType.d.ts +2 -0
- package/dist/components/ApplicationForm/ApplicationForm.js +2 -2
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +4 -0
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +2 -1
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/AddressField.js +7 -1
- package/dist/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/BeginDateField.js +2 -1
- package/dist/ui-kit/FormField/Fields/BeginDateField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -1
- package/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -1
- package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/InnField.js +2 -1
- package/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -1
- package/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -1
- package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/LegalFormField.js +2 -1
- package/dist/ui-kit/FormField/Fields/LegalFormField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/OrganizationNameField.js +2 -1
- package/dist/ui-kit/FormField/Fields/OrganizationNameField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js +2 -1
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js +4 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/dist/ui-kit/FormField/calculateIsRequired.d.ts +2 -0
- package/dist/ui-kit/FormField/calculateIsRequired.js +5 -0
- package/dist/ui-kit/FormField/calculateIsRequired.js.map +1 -0
- package/dist/ui-kit/FormField/getObjectValidator.js +3 -3
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/FormField/validators.d.ts +2 -0
- package/dist/ui-kit/FormField/validators.js +4 -1
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +2 -2
- package/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js +2 -2
- package/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js.map +1 -1
- package/lib/api/RetailAPI/sendSignalToProcess.js +1 -1
- package/lib/api/RetailAPI/sendSignalToProcess.js.map +1 -1
- package/lib/api/dadataHints/dadataHintsType.d.ts +2 -0
- package/lib/components/ApplicationForm/ApplicationForm.js +2 -2
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +4 -0
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +2 -1
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/ui-kit/FormField/Fields/AddressField.js +7 -1
- package/lib/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/BeginDateField.js +2 -1
- package/lib/ui-kit/FormField/Fields/BeginDateField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -1
- package/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -1
- package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/InnField.js +2 -1
- package/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -1
- package/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -1
- package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/LegalFormField.js +2 -1
- package/lib/ui-kit/FormField/Fields/LegalFormField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/OrganizationNameField.js +2 -1
- package/lib/ui-kit/FormField/Fields/OrganizationNameField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js +2 -1
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js +4 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/lib/ui-kit/FormField/calculateIsRequired.d.ts +2 -0
- package/lib/ui-kit/FormField/calculateIsRequired.js +2 -0
- package/lib/ui-kit/FormField/calculateIsRequired.js.map +1 -0
- package/lib/ui-kit/FormField/getObjectValidator.js +4 -4
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/FormField/validators.d.ts +2 -0
- package/lib/ui-kit/FormField/validators.js +2 -0
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +2 -2
- package/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js +2 -2
- package/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js.map +1 -1
- package/mobile/bundle/api/dadataHints/dadataHintsType.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +37 -21
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/mobile/bundle/ui-kit/FormField/calculateIsRequired.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +2 -0
- package/mobile/bundle/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +2 -2
- package/mobile/dist/api/RetailAPI/sendSignalToProcess.js +1 -1
- package/mobile/dist/api/RetailAPI/sendSignalToProcess.js.map +1 -1
- package/mobile/dist/api/dadataHints/dadataHintsType.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +2 -2
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +4 -0
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +2 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressField.js +7 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/BeginDateField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/BeginDateField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/LegalFormField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/LegalFormField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/OrganizationNameField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +4 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/calculateIsRequired.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/calculateIsRequired.js +5 -0
- package/mobile/dist/ui-kit/FormField/calculateIsRequired.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +3 -3
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.d.ts +2 -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/ResponseTypeDialog/useResponseTypeDialog.d.ts +2 -2
- package/mobile/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js +2 -2
- package/mobile/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js.map +1 -1
- package/mobile/lib/api/RetailAPI/sendSignalToProcess.js +1 -1
- package/mobile/lib/api/RetailAPI/sendSignalToProcess.js.map +1 -1
- package/mobile/lib/api/dadataHints/dadataHintsType.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +2 -2
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +3 -0
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +4 -0
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +2 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressField.js +7 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/BeginDateField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/BeginDateField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/LegalFormField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/LegalFormField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/OrganizationNameField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +4 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/calculateIsRequired.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/calculateIsRequired.js +2 -0
- package/mobile/lib/ui-kit/FormField/calculateIsRequired.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +4 -4
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.d.ts +2 -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/ResponseTypeDialog/useResponseTypeDialog.d.ts +2 -2
- package/mobile/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js +2 -2
- package/mobile/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js.map +1 -1
- package/mobile/src/api/RetailAPI/sendSignalToProcess.ts +1 -1
- package/mobile/src/api/dadataHints/dadataHintsType.ts +2 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +2 -2
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +3 -0
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +4 -0
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +10 -1
- package/mobile/src/ui-kit/FormField/Fields/AddressField.tsx +11 -1
- package/mobile/src/ui-kit/FormField/Fields/BeginDateField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/JobsNumberField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/LegalFormField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/OrganizationNameField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +8 -1
- package/mobile/src/ui-kit/FormField/calculateIsRequired.ts +6 -0
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +4 -3
- package/mobile/src/ui-kit/FormField/validators.ts +7 -0
- package/mobile/src/ui-kit/ResponseTypeDialog/useResponseTypeDialog.tsx +3 -2
- package/package.json +1 -1
- package/src/api/RetailAPI/sendSignalToProcess.ts +1 -1
- package/src/api/dadataHints/dadataHintsType.ts +2 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +2 -2
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +3 -0
- package/src/components/CreditForm/creditFormStepsData.tsx +4 -0
- package/src/components/CreditForm/useCreditFormAPI.tsx +10 -1
- package/src/ui-kit/FormField/Fields/AddressField.tsx +11 -1
- package/src/ui-kit/FormField/Fields/BeginDateField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/InnField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/JobsNumberField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/LegalFormField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/OrganizationNameField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/PhoneField.tsx +8 -1
- package/src/ui-kit/FormField/calculateIsRequired.ts +6 -0
- package/src/ui-kit/FormField/getObjectValidator.tsx +4 -3
- package/src/ui-kit/FormField/validators.ts +7 -0
- package/src/ui-kit/ResponseTypeDialog/useResponseTypeDialog.tsx +3 -2
|
@@ -44,6 +44,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
44
44
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []) as FieldDef[];
|
|
45
45
|
const initialFormState = getInitialFormState(inputs, typeForm);
|
|
46
46
|
const [responseType, setResponseType] = useState<'OK' | 'Fail' | ''>('');
|
|
47
|
+
const responseTypeDialog = useResponseTypeDialog({ typeForm });
|
|
47
48
|
const handleSubmit = useCallback(
|
|
48
49
|
async (formData: FormState, ev: PreventableEventWithTarget) => {
|
|
49
50
|
const inputsFiltered = getFilteredInputs(inputs, formData);
|
|
@@ -56,8 +57,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
56
57
|
setResponseType(status);
|
|
57
58
|
|
|
58
59
|
if (status) {
|
|
59
|
-
|
|
60
|
-
responseTypeDialog.open();
|
|
60
|
+
responseTypeDialog.open({ responseType: status });
|
|
61
61
|
}
|
|
62
62
|
if (status === 'OK' && data) {
|
|
63
63
|
const aspects = useAspects();
|
|
@@ -179,6 +179,10 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
179
179
|
columns: 1,
|
|
180
180
|
inputs: [{ fieldType: 'common', name: 'snils', required: true }],
|
|
181
181
|
},
|
|
182
|
+
{
|
|
183
|
+
columns: 1,
|
|
184
|
+
inputs: [{ fieldType: 'common', name: 'conscription', required: true }],
|
|
185
|
+
},
|
|
182
186
|
{
|
|
183
187
|
columns: 2,
|
|
184
188
|
inputs: [{ fieldType: 'common', name: 'armyIdFlg' }],
|
|
@@ -28,7 +28,9 @@ export const useCreditFormAPI = ({
|
|
|
28
28
|
const [participantId] = useLocalStorage<number>('participantId');
|
|
29
29
|
|
|
30
30
|
const handleSubmit = useCallback(async (formData: FormStateMap[keyof FormStateMap]) => {
|
|
31
|
-
const feedbackValidator = objectValidator(
|
|
31
|
+
const feedbackValidator = objectValidator(
|
|
32
|
+
getObjectValidator(calculateInputs(formData, inputs, step)),
|
|
33
|
+
);
|
|
32
34
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
33
35
|
return console.warn('validation fail');
|
|
34
36
|
}
|
|
@@ -64,3 +66,10 @@ export const useCreditFormAPI = ({
|
|
|
64
66
|
handleSubmit,
|
|
65
67
|
};
|
|
66
68
|
};
|
|
69
|
+
|
|
70
|
+
const calculateInputs = (
|
|
71
|
+
formData: FormStateMap[keyof FormStateMap],
|
|
72
|
+
inputs: FieldDef[],
|
|
73
|
+
step: number,
|
|
74
|
+
) =>
|
|
75
|
+
step === 2 && 'employment' in formData && formData?.employment?.key === 'RETIREE' ? [] : inputs;
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
|
|
4
4
|
import { InputControl } from '../../Input/InputControl';
|
|
5
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
5
6
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
7
|
import { validatorObj } from '../getObjectValidator';
|
|
7
8
|
import { getValidation } from '../getValidation';
|
|
@@ -24,6 +25,9 @@ export const AddressField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
24
25
|
region: item?.data?.region,
|
|
25
26
|
regionCode: item?.data?.region_kladr_id ? item?.data?.region_kladr_id.substring(0, 2) : '',
|
|
26
27
|
street: item?.data?.house,
|
|
28
|
+
qc: item?.data?.qc,
|
|
29
|
+
qcComplete: item?.data?.qc_complete,
|
|
30
|
+
qcHouse: item?.data?.qc_house,
|
|
27
31
|
});
|
|
28
32
|
}, []);
|
|
29
33
|
|
|
@@ -37,7 +41,13 @@ export const AddressField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
37
41
|
return (
|
|
38
42
|
<InputControl
|
|
39
43
|
label="Адрес"
|
|
40
|
-
{...getValidation(
|
|
44
|
+
{...getValidation(
|
|
45
|
+
field(fieldName),
|
|
46
|
+
validatorObj[fieldName],
|
|
47
|
+
input?.name === 'organizationAddress'
|
|
48
|
+
? calculateIsRequired(field, input?.required)
|
|
49
|
+
: input?.required,
|
|
50
|
+
)}
|
|
41
51
|
value={fieldValue.fullAddress}
|
|
42
52
|
onChange={onChange}
|
|
43
53
|
{...input}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { DatePickerControl } from '../../DatePicker/DatePickerControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -7,7 +8,11 @@ import { getValidation } from '../getValidation';
|
|
|
7
8
|
export const BeginDateField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<DatePickerControl
|
|
9
10
|
label="Дата начала работы на текущем месте"
|
|
10
|
-
{...getValidation(
|
|
11
|
+
{...getValidation(
|
|
12
|
+
field('beginDate'),
|
|
13
|
+
validatorObj.beginDate,
|
|
14
|
+
calculateIsRequired(field, input?.required),
|
|
15
|
+
)}
|
|
11
16
|
{...input}
|
|
12
17
|
/>
|
|
13
18
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -10,7 +11,11 @@ export const Experience5YearsField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
10
11
|
placeholder="За последние 5 лет"
|
|
11
12
|
type="number"
|
|
12
13
|
inputLength={2}
|
|
13
|
-
{...getValidation(
|
|
14
|
+
{...getValidation(
|
|
15
|
+
field('experience5Years'),
|
|
16
|
+
validatorObj.experience5Years,
|
|
17
|
+
calculateIsRequired(field, input?.required),
|
|
18
|
+
)}
|
|
14
19
|
{...input}
|
|
15
20
|
/>
|
|
16
21
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -10,7 +11,11 @@ export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
10
11
|
type="number"
|
|
11
12
|
inputLength={2}
|
|
12
13
|
placeholder="Количество лет"
|
|
13
|
-
{...getValidation(
|
|
14
|
+
{...getValidation(
|
|
15
|
+
field('generalSeniority'),
|
|
16
|
+
validatorObj.generalSeniority,
|
|
17
|
+
calculateIsRequired(field, input?.required),
|
|
18
|
+
)}
|
|
14
19
|
{...input}
|
|
15
20
|
/>
|
|
16
21
|
));
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
|
|
4
4
|
import { InputControl } from '../../Input/InputControl';
|
|
5
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
5
6
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
7
|
import { validatorObj } from '../getObjectValidator';
|
|
7
8
|
import { getValidation } from '../getValidation';
|
|
@@ -18,7 +19,11 @@ export const InnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
18
19
|
type="number"
|
|
19
20
|
inputLength={12}
|
|
20
21
|
{...input}
|
|
21
|
-
{...getValidation(
|
|
22
|
+
{...getValidation(
|
|
23
|
+
field('inn'),
|
|
24
|
+
validatorObj.inn,
|
|
25
|
+
calculateIsRequired(field, input?.required),
|
|
26
|
+
)}
|
|
22
27
|
onDaDataChange={onDaDataChange}
|
|
23
28
|
/>
|
|
24
29
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -10,7 +11,11 @@ export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
|
10
11
|
placeholder="Количество мест"
|
|
11
12
|
type="number"
|
|
12
13
|
inputLength={2}
|
|
13
|
-
{...getValidation(
|
|
14
|
+
{...getValidation(
|
|
15
|
+
field('jobsNumber'),
|
|
16
|
+
validatorObj.jobsNumber,
|
|
17
|
+
calculateIsRequired(field, input?.required),
|
|
18
|
+
)}
|
|
14
19
|
{...input}
|
|
15
20
|
/>
|
|
16
21
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -10,7 +11,11 @@ export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) =
|
|
|
10
11
|
placeholder="Количество лет"
|
|
11
12
|
type="number"
|
|
12
13
|
inputLength={2}
|
|
13
|
-
{...getValidation(
|
|
14
|
+
{...getValidation(
|
|
15
|
+
field('lastJobExperience'),
|
|
16
|
+
validatorObj.lastJobExperience,
|
|
17
|
+
calculateIsRequired(field, input?.required),
|
|
18
|
+
)}
|
|
14
19
|
{...input}
|
|
15
20
|
/>
|
|
16
21
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -8,7 +9,11 @@ export const LegalFormField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
|
8
9
|
<InputControl
|
|
9
10
|
label="ОПФ"
|
|
10
11
|
placeholder="ООО, ПАО и др."
|
|
11
|
-
{...getValidation(
|
|
12
|
+
{...getValidation(
|
|
13
|
+
field('legalForm'),
|
|
14
|
+
validatorObj.legalForm,
|
|
15
|
+
calculateIsRequired(field, input?.required),
|
|
16
|
+
)}
|
|
12
17
|
{...input}
|
|
13
18
|
/>
|
|
14
19
|
));
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
|
|
4
4
|
import { InputControl } from '../../Input/InputControl';
|
|
5
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
5
6
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
7
|
import { validatorObj } from '../getObjectValidator';
|
|
7
8
|
import { getValidation } from '../getValidation';
|
|
@@ -16,7 +17,11 @@ export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
16
17
|
<InputControl
|
|
17
18
|
label="Наименование организации"
|
|
18
19
|
{...input}
|
|
19
|
-
{...getValidation(
|
|
20
|
+
{...getValidation(
|
|
21
|
+
field('organizationName'),
|
|
22
|
+
validatorObj.organizationName,
|
|
23
|
+
calculateIsRequired(field, input?.required),
|
|
24
|
+
)}
|
|
20
25
|
onDaDataChange={onDaDataChange}
|
|
21
26
|
/>
|
|
22
27
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -8,7 +9,11 @@ const MAX_PART = 100;
|
|
|
8
9
|
|
|
9
10
|
export const PartInBusinessField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
10
11
|
const partInBusinessField = {
|
|
11
|
-
...getValidation(
|
|
12
|
+
...getValidation(
|
|
13
|
+
field('partInBusiness'),
|
|
14
|
+
validatorObj.partInBusiness,
|
|
15
|
+
calculateIsRequired(field, input?.required),
|
|
16
|
+
),
|
|
12
17
|
};
|
|
13
18
|
|
|
14
19
|
const handleChange = (value: string) =>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputPhoneControl } from '../../Input/InputPhoneControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -7,7 +8,13 @@ import { getValidation } from '../getValidation';
|
|
|
7
8
|
export const PhoneField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<InputPhoneControl
|
|
9
10
|
label="Телефон"
|
|
10
|
-
{...getValidation(
|
|
11
|
+
{...getValidation(
|
|
12
|
+
field(input?.name || 'phone'),
|
|
13
|
+
validatorObj.phone,
|
|
14
|
+
input?.name === 'organizationPhone'
|
|
15
|
+
? calculateIsRequired(field, input?.required)
|
|
16
|
+
: input?.required,
|
|
17
|
+
)}
|
|
11
18
|
{...input}
|
|
12
19
|
/>
|
|
13
20
|
));
|
|
@@ -2,6 +2,7 @@ import { type FieldDef } from '../../components/ApplicationForm/ApplicationFormC
|
|
|
2
2
|
import { type Validator } from '../../validation/validator';
|
|
3
3
|
import { getNamesFromInput } from './getNamesFromInput';
|
|
4
4
|
import {
|
|
5
|
+
addressDaDataValidator,
|
|
5
6
|
agreementValidator,
|
|
6
7
|
defaultSelectValidator,
|
|
7
8
|
defaultValidator,
|
|
@@ -51,7 +52,7 @@ export const validatorObj: Record<string, Validator> = {
|
|
|
51
52
|
experience5Years: jobNumberValidator('Укажите общий стаж за последние 5 лет'),
|
|
52
53
|
jobsNumber: jobNumberValidator('Укажите количество мест работы за последние 5 лет'),
|
|
53
54
|
beginDate: defaultValidator('Укажите дату заключения трудового договора'),
|
|
54
|
-
addressFact:
|
|
55
|
+
addressFact: addressDaDataValidator(),
|
|
55
56
|
partnerComments: defaultValidator(),
|
|
56
57
|
collectionCount: defaultValidator(),
|
|
57
58
|
comment: defaultValidator(),
|
|
@@ -80,8 +81,8 @@ export const validatorObj: Record<string, Validator> = {
|
|
|
80
81
|
conscription: defaultValidator(),
|
|
81
82
|
armyIdFlg: agreementValidator,
|
|
82
83
|
sex: defaultValidator('Укажите свой пол'),
|
|
83
|
-
addressRegistration:
|
|
84
|
-
organizationAddress:
|
|
84
|
+
addressRegistration: addressDaDataValidator(),
|
|
85
|
+
organizationAddress: addressDaDataValidator(),
|
|
85
86
|
participantDateRegistration: defaultValidator('Укажите дату регистрации'),
|
|
86
87
|
retirementIncome: defaultValidator(),
|
|
87
88
|
otherIncome: defaultValidator(),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Address } from '../../components/ApplicationLeadForm/getInitialFormState';
|
|
1
2
|
import { pattern } from '../../validation/pattern';
|
|
2
3
|
import { required } from '../../validation/required';
|
|
3
4
|
import { validator } from '../../validation/validator';
|
|
@@ -64,3 +65,9 @@ const emailValidate = (email: string) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test
|
|
|
64
65
|
|
|
65
66
|
export const emailValidator = (errorMsg: string) =>
|
|
66
67
|
validator((_: string) => emailValidate(_))(errorMsg);
|
|
68
|
+
|
|
69
|
+
const addressDaDataValidate = (address: Address) =>
|
|
70
|
+
Boolean(address.qc === '0' && address.qcComplete === '0' && address.qcHouse === '2');
|
|
71
|
+
|
|
72
|
+
export const addressDaDataValidator = () =>
|
|
73
|
+
validator(addressDaDataValidate)('Укажите регион, город/населенный пункт, улицу, дом, квартиру');
|
|
@@ -6,11 +6,12 @@ export interface ResponseTypeDialogProps {
|
|
|
6
6
|
typeForm?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const useResponseTypeDialog = (
|
|
9
|
+
export const useResponseTypeDialog = (initialProps: ResponseTypeDialogProps) => {
|
|
10
10
|
const { open, close } = useDialogManager();
|
|
11
11
|
|
|
12
12
|
return {
|
|
13
|
-
open: (options: DialogOptions = {}) =>
|
|
13
|
+
open: (props?: ResponseTypeDialogProps, options: DialogOptions = {}) =>
|
|
14
|
+
open(<ResponseTypeDialog {...initialProps} {...props} />, options),
|
|
14
15
|
close,
|
|
15
16
|
};
|
|
16
17
|
};
|
package/package.json
CHANGED
|
@@ -16,4 +16,4 @@ interface SendSignalToProcessResponse {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export const sendSignalToProcess = (body: SendSignalToProcess) =>
|
|
19
|
-
doRequest<SendSignalToProcessResponse>('/
|
|
19
|
+
doRequest<SendSignalToProcessResponse>('/user-data/sendSignalToProcess', 'POST', body);
|
|
@@ -44,6 +44,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
44
44
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []) as FieldDef[];
|
|
45
45
|
const initialFormState = getInitialFormState(inputs, typeForm);
|
|
46
46
|
const [responseType, setResponseType] = useState<'OK' | 'Fail' | ''>('');
|
|
47
|
+
const responseTypeDialog = useResponseTypeDialog({ typeForm });
|
|
47
48
|
const handleSubmit = useCallback(
|
|
48
49
|
async (formData: FormState, ev: PreventableEventWithTarget) => {
|
|
49
50
|
const inputsFiltered = getFilteredInputs(inputs, formData);
|
|
@@ -56,8 +57,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
56
57
|
setResponseType(status);
|
|
57
58
|
|
|
58
59
|
if (status) {
|
|
59
|
-
|
|
60
|
-
responseTypeDialog.open();
|
|
60
|
+
responseTypeDialog.open({ responseType: status });
|
|
61
61
|
}
|
|
62
62
|
if (status === 'OK' && data) {
|
|
63
63
|
const aspects = useAspects();
|
|
@@ -179,6 +179,10 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
179
179
|
columns: 1,
|
|
180
180
|
inputs: [{ fieldType: 'common', name: 'snils', required: true }],
|
|
181
181
|
},
|
|
182
|
+
{
|
|
183
|
+
columns: 1,
|
|
184
|
+
inputs: [{ fieldType: 'common', name: 'conscription', required: true }],
|
|
185
|
+
},
|
|
182
186
|
{
|
|
183
187
|
columns: 2,
|
|
184
188
|
inputs: [{ fieldType: 'common', name: 'armyIdFlg' }],
|
|
@@ -28,7 +28,9 @@ export const useCreditFormAPI = ({
|
|
|
28
28
|
const [participantId] = useLocalStorage<number>('participantId');
|
|
29
29
|
|
|
30
30
|
const handleSubmit = useCallback(async (formData: FormStateMap[keyof FormStateMap]) => {
|
|
31
|
-
const feedbackValidator = objectValidator(
|
|
31
|
+
const feedbackValidator = objectValidator(
|
|
32
|
+
getObjectValidator(calculateInputs(formData, inputs, step)),
|
|
33
|
+
);
|
|
32
34
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
33
35
|
return console.warn('validation fail');
|
|
34
36
|
}
|
|
@@ -64,3 +66,10 @@ export const useCreditFormAPI = ({
|
|
|
64
66
|
handleSubmit,
|
|
65
67
|
};
|
|
66
68
|
};
|
|
69
|
+
|
|
70
|
+
const calculateInputs = (
|
|
71
|
+
formData: FormStateMap[keyof FormStateMap],
|
|
72
|
+
inputs: FieldDef[],
|
|
73
|
+
step: number,
|
|
74
|
+
) =>
|
|
75
|
+
step === 2 && 'employment' in formData && formData?.employment?.key === 'RETIREE' ? [] : inputs;
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
|
|
4
4
|
import { InputControl } from '../../Input/InputControl';
|
|
5
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
5
6
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
7
|
import { validatorObj } from '../getObjectValidator';
|
|
7
8
|
import { getValidation } from '../getValidation';
|
|
@@ -24,6 +25,9 @@ export const AddressField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
24
25
|
region: item?.data?.region,
|
|
25
26
|
regionCode: item?.data?.region_kladr_id ? item?.data?.region_kladr_id.substring(0, 2) : '',
|
|
26
27
|
street: item?.data?.house,
|
|
28
|
+
qc: item?.data?.qc,
|
|
29
|
+
qcComplete: item?.data?.qc_complete,
|
|
30
|
+
qcHouse: item?.data?.qc_house,
|
|
27
31
|
});
|
|
28
32
|
}, []);
|
|
29
33
|
|
|
@@ -37,7 +41,13 @@ export const AddressField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
37
41
|
return (
|
|
38
42
|
<InputControl
|
|
39
43
|
label="Адрес"
|
|
40
|
-
{...getValidation(
|
|
44
|
+
{...getValidation(
|
|
45
|
+
field(fieldName),
|
|
46
|
+
validatorObj[fieldName],
|
|
47
|
+
input?.name === 'organizationAddress'
|
|
48
|
+
? calculateIsRequired(field, input?.required)
|
|
49
|
+
: input?.required,
|
|
50
|
+
)}
|
|
41
51
|
value={fieldValue.fullAddress}
|
|
42
52
|
onChange={onChange}
|
|
43
53
|
{...input}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { DatePickerControl } from '../../DatePicker/DatePickerControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -7,7 +8,11 @@ import { getValidation } from '../getValidation';
|
|
|
7
8
|
export const BeginDateField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<DatePickerControl
|
|
9
10
|
label="Дата начала работы на текущем месте"
|
|
10
|
-
{...getValidation(
|
|
11
|
+
{...getValidation(
|
|
12
|
+
field('beginDate'),
|
|
13
|
+
validatorObj.beginDate,
|
|
14
|
+
calculateIsRequired(field, input?.required),
|
|
15
|
+
)}
|
|
11
16
|
{...input}
|
|
12
17
|
/>
|
|
13
18
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -10,7 +11,11 @@ export const Experience5YearsField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
10
11
|
placeholder="За последние 5 лет"
|
|
11
12
|
type="number"
|
|
12
13
|
inputLength={2}
|
|
13
|
-
{...getValidation(
|
|
14
|
+
{...getValidation(
|
|
15
|
+
field('experience5Years'),
|
|
16
|
+
validatorObj.experience5Years,
|
|
17
|
+
calculateIsRequired(field, input?.required),
|
|
18
|
+
)}
|
|
14
19
|
{...input}
|
|
15
20
|
/>
|
|
16
21
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -10,7 +11,11 @@ export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
10
11
|
type="number"
|
|
11
12
|
inputLength={2}
|
|
12
13
|
placeholder="Количество лет"
|
|
13
|
-
{...getValidation(
|
|
14
|
+
{...getValidation(
|
|
15
|
+
field('generalSeniority'),
|
|
16
|
+
validatorObj.generalSeniority,
|
|
17
|
+
calculateIsRequired(field, input?.required),
|
|
18
|
+
)}
|
|
14
19
|
{...input}
|
|
15
20
|
/>
|
|
16
21
|
));
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
|
|
4
4
|
import { InputControl } from '../../Input/InputControl';
|
|
5
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
5
6
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
7
|
import { validatorObj } from '../getObjectValidator';
|
|
7
8
|
import { getValidation } from '../getValidation';
|
|
@@ -18,7 +19,11 @@ export const InnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
18
19
|
type="number"
|
|
19
20
|
inputLength={12}
|
|
20
21
|
{...input}
|
|
21
|
-
{...getValidation(
|
|
22
|
+
{...getValidation(
|
|
23
|
+
field('inn'),
|
|
24
|
+
validatorObj.inn,
|
|
25
|
+
calculateIsRequired(field, input?.required),
|
|
26
|
+
)}
|
|
22
27
|
onDaDataChange={onDaDataChange}
|
|
23
28
|
/>
|
|
24
29
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -10,7 +11,11 @@ export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
|
10
11
|
placeholder="Количество мест"
|
|
11
12
|
type="number"
|
|
12
13
|
inputLength={2}
|
|
13
|
-
{...getValidation(
|
|
14
|
+
{...getValidation(
|
|
15
|
+
field('jobsNumber'),
|
|
16
|
+
validatorObj.jobsNumber,
|
|
17
|
+
calculateIsRequired(field, input?.required),
|
|
18
|
+
)}
|
|
14
19
|
{...input}
|
|
15
20
|
/>
|
|
16
21
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -10,7 +11,11 @@ export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) =
|
|
|
10
11
|
placeholder="Количество лет"
|
|
11
12
|
type="number"
|
|
12
13
|
inputLength={2}
|
|
13
|
-
{...getValidation(
|
|
14
|
+
{...getValidation(
|
|
15
|
+
field('lastJobExperience'),
|
|
16
|
+
validatorObj.lastJobExperience,
|
|
17
|
+
calculateIsRequired(field, input?.required),
|
|
18
|
+
)}
|
|
14
19
|
{...input}
|
|
15
20
|
/>
|
|
16
21
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { InputControl } from '../../Input/InputControl';
|
|
3
|
+
import { calculateIsRequired } from '../calculateIsRequired';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
5
|
import { validatorObj } from '../getObjectValidator';
|
|
5
6
|
import { getValidation } from '../getValidation';
|
|
@@ -8,7 +9,11 @@ export const LegalFormField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
|
8
9
|
<InputControl
|
|
9
10
|
label="ОПФ"
|
|
10
11
|
placeholder="ООО, ПАО и др."
|
|
11
|
-
{...getValidation(
|
|
12
|
+
{...getValidation(
|
|
13
|
+
field('legalForm'),
|
|
14
|
+
validatorObj.legalForm,
|
|
15
|
+
calculateIsRequired(field, input?.required),
|
|
16
|
+
)}
|
|
12
17
|
{...input}
|
|
13
18
|
/>
|
|
14
19
|
));
|