@redneckz/wildless-cms-uni-blocks 0.14.647 → 0.14.648
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +84 -45
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -1
- package/bundle/model/DefaultControlType.d.ts +1 -0
- package/bundle/ui-kit/DatePicker/DatePicker.d.ts +1 -0
- package/bundle/ui-kit/DatePicker/DatePickerInput.d.ts +1 -0
- package/bundle/ui-kit/DatePicker/renderDatePickerForm.d.ts +10 -0
- package/bundle/ui-kit/FormField/isEsiaAuthorize.d.ts +1 -0
- package/bundle/ui-kit/FormField/validators.d.ts +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -1
- package/dist/components/CreditForm/creditFormStepsData.js +37 -12
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/model/DefaultControlType.d.ts +1 -0
- package/dist/ui-kit/DatePicker/DatePicker.d.ts +1 -0
- package/dist/ui-kit/DatePicker/DatePicker.js +5 -8
- package/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePickerInput.d.ts +1 -0
- package/dist/ui-kit/DatePicker/DatePickerInput.js +2 -2
- package/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
- package/dist/ui-kit/DatePicker/renderDatePickerForm.d.ts +10 -0
- package/dist/ui-kit/DatePicker/renderDatePickerForm.js +11 -0
- package/dist/ui-kit/DatePicker/renderDatePickerForm.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/AddressField.js +2 -1
- package/dist/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulIssueDateField.js +2 -1
- package/dist/ui-kit/FormField/Fields/DulIssueDateField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulIssuedByField.js +2 -1
- package/dist/ui-kit/FormField/Fields/DulIssuedByField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -1
- package/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -1
- package/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -1
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/FamilyMembersField.js +12 -3
- package/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js +2 -1
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/NameField.js +2 -1
- package/dist/ui-kit/FormField/Fields/NameField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/SurnameField.js +2 -1
- package/dist/ui-kit/FormField/Fields/SurnameField.js.map +1 -1
- package/dist/ui-kit/FormField/isEsiaAuthorize.d.ts +1 -0
- package/dist/ui-kit/FormField/isEsiaAuthorize.js +5 -0
- package/dist/ui-kit/FormField/isEsiaAuthorize.js.map +1 -0
- package/dist/ui-kit/FormField/validators.d.ts +1 -1
- package/dist/ui-kit/FormField/validators.js +1 -1
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -1
- package/lib/components/CreditForm/creditFormStepsData.js +37 -12
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/model/DefaultControlType.d.ts +1 -0
- package/lib/ui-kit/DatePicker/DatePicker.d.ts +1 -0
- package/lib/ui-kit/DatePicker/DatePicker.js +4 -7
- package/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePickerInput.d.ts +1 -0
- package/lib/ui-kit/DatePicker/DatePickerInput.js +2 -2
- package/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
- package/lib/ui-kit/DatePicker/renderDatePickerForm.d.ts +9 -0
- package/lib/ui-kit/DatePicker/renderDatePickerForm.js +8 -0
- package/lib/ui-kit/DatePicker/renderDatePickerForm.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/AddressField.js +2 -1
- package/lib/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulIssueDateField.js +2 -1
- package/lib/ui-kit/FormField/Fields/DulIssueDateField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulIssuedByField.js +2 -1
- package/lib/ui-kit/FormField/Fields/DulIssuedByField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -1
- package/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -1
- package/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -1
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/FamilyMembersField.js +12 -3
- package/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js +2 -1
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/NameField.js +2 -1
- package/lib/ui-kit/FormField/Fields/NameField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/SurnameField.js +2 -1
- package/lib/ui-kit/FormField/Fields/SurnameField.js.map +1 -1
- package/lib/ui-kit/FormField/isEsiaAuthorize.d.ts +1 -0
- package/lib/ui-kit/FormField/isEsiaAuthorize.js +2 -0
- package/lib/ui-kit/FormField/isEsiaAuthorize.js.map +1 -0
- package/lib/ui-kit/FormField/validators.d.ts +1 -1
- package/lib/ui-kit/FormField/validators.js +1 -1
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +84 -45
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -1
- package/mobile/bundle/model/DefaultControlType.d.ts +1 -0
- package/mobile/bundle/ui-kit/DatePicker/DatePicker.d.ts +1 -0
- package/mobile/bundle/ui-kit/DatePicker/DatePickerInput.d.ts +1 -0
- package/mobile/bundle/ui-kit/DatePicker/renderDatePickerForm.d.ts +10 -0
- package/mobile/bundle/ui-kit/FormField/isEsiaAuthorize.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +37 -12
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/model/DefaultControlType.d.ts +1 -0
- package/mobile/dist/ui-kit/DatePicker/DatePicker.d.ts +1 -0
- package/mobile/dist/ui-kit/DatePicker/DatePicker.js +5 -8
- package/mobile/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerInput.d.ts +1 -0
- package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js +2 -2
- package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/renderDatePickerForm.d.ts +10 -0
- package/mobile/dist/ui-kit/DatePicker/renderDatePickerForm.js +11 -0
- package/mobile/dist/ui-kit/DatePicker/renderDatePickerForm.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulIssueDateField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulIssueDateField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulIssuedByField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulIssuedByField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js +12 -3
- package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/NameField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/NameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/SurnameField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/SurnameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/isEsiaAuthorize.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/isEsiaAuthorize.js +5 -0
- package/mobile/dist/ui-kit/FormField/isEsiaAuthorize.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/validators.js +1 -1
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +37 -12
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/model/DefaultControlType.d.ts +1 -0
- package/mobile/lib/ui-kit/DatePicker/DatePicker.d.ts +1 -0
- package/mobile/lib/ui-kit/DatePicker/DatePicker.js +4 -7
- package/mobile/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerInput.d.ts +1 -0
- package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js +2 -2
- package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/renderDatePickerForm.d.ts +10 -0
- package/mobile/lib/ui-kit/DatePicker/renderDatePickerForm.js +8 -0
- package/mobile/lib/ui-kit/DatePicker/renderDatePickerForm.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulIssueDateField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulIssueDateField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulIssuedByField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulIssuedByField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js +12 -3
- package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/NameField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/NameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/SurnameField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/SurnameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/isEsiaAuthorize.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/isEsiaAuthorize.js +2 -0
- package/mobile/lib/ui-kit/FormField/isEsiaAuthorize.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/validators.js +1 -1
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +8 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +7 -1
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +37 -12
- package/mobile/src/model/DefaultControlType.ts +1 -0
- package/mobile/src/ui-kit/DatePicker/DatePicker.tsx +5 -33
- package/mobile/src/ui-kit/DatePicker/DatePickerInput.tsx +4 -2
- package/mobile/src/ui-kit/DatePicker/renderDatePickerForm.tsx +35 -0
- package/mobile/src/ui-kit/FormField/Fields/AddressField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/Fields/DulIssueDateField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/Fields/DulIssuedByField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/Fields/DulNumberField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/Fields/DulSerieField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +23 -12
- package/mobile/src/ui-kit/FormField/Fields/MiddleNameField.tsx +3 -0
- package/mobile/src/ui-kit/FormField/Fields/NameField.tsx +3 -0
- package/mobile/src/ui-kit/FormField/Fields/SurnameField.tsx +3 -0
- package/mobile/src/ui-kit/FormField/isEsiaAuthorize.ts +2 -0
- package/mobile/src/ui-kit/FormField/validators.ts +2 -2
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormContent.ts +8 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +7 -1
- package/src/components/CreditForm/creditFormStepsData.tsx +37 -12
- package/src/model/DefaultControlType.ts +1 -0
- package/src/ui-kit/DatePicker/DatePicker.tsx +5 -33
- package/src/ui-kit/DatePicker/DatePickerInput.tsx +4 -2
- package/src/ui-kit/DatePicker/renderDatePickerForm.tsx +35 -0
- package/src/ui-kit/FormField/Fields/AddressField.tsx +2 -0
- package/src/ui-kit/FormField/Fields/DulIssueDateField.tsx +2 -0
- package/src/ui-kit/FormField/Fields/DulIssuedByField.tsx +2 -0
- package/src/ui-kit/FormField/Fields/DulNumberField.tsx +2 -0
- package/src/ui-kit/FormField/Fields/DulSerieField.tsx +2 -0
- package/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +2 -0
- package/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +23 -12
- package/src/ui-kit/FormField/Fields/MiddleNameField.tsx +3 -0
- package/src/ui-kit/FormField/Fields/NameField.tsx +3 -0
- package/src/ui-kit/FormField/Fields/SurnameField.tsx +3 -0
- package/src/ui-kit/FormField/isEsiaAuthorize.ts +2 -0
- package/src/ui-kit/FormField/validators.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SurnameField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/SurnameField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"SurnameField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/SurnameField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACtE,KAAC,YAAY,IACX,KAAK,EAAC,4CAAS,EACf,WAAW,EAAE,EAAE,EACf,QAAQ,EAAE,eAAe,EAAE,IAAI,KAAK,EAAE,YAAY,KAC9C,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KACtE,KAAK,GACT,CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isEsiaAuthorize: () => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEsiaAuthorize.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/isEsiaAuthorize.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAClC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,EAAE,MAAM,CAAC"}
|
|
@@ -3,7 +3,7 @@ export declare const defaultValidator: (errorMsg?: string) => import("../../vali
|
|
|
3
3
|
export declare const defaultSelectValidator: (errorMsg?: string) => import("../../validation/validator").Validator<any>;
|
|
4
4
|
export declare const jobNumberValidator: (errorMsg?: string) => import("../../validation/validator").Validator<any>;
|
|
5
5
|
export declare const nameValidator: (errorMsg?: string) => import("../../validation/validator").Validator<any>;
|
|
6
|
-
export declare const lengthStringValidator: (
|
|
6
|
+
export declare const lengthStringValidator: (inputLength: number, errorMsg?: string) => import("../../validation/validator").Validator<any>;
|
|
7
7
|
export declare const serieValidator: (errorMsg: string) => import("../../validation/validator").Validator<any>;
|
|
8
8
|
export declare const numberValidator: (errorMsg: string) => import("../../validation/validator").Validator<any>;
|
|
9
9
|
export declare const innValidator: (errorMsg: string) => import("../../validation/validator").Validator<any>;
|
|
@@ -6,7 +6,7 @@ export const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE
|
|
|
6
6
|
export const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE);
|
|
7
7
|
export const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 0 && _.length <= 2)(errorMsg ?? ERROR_MESSAGE);
|
|
8
8
|
export const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1)(errorMsg ?? ERROR_MESSAGE);
|
|
9
|
-
export const lengthStringValidator = (
|
|
9
|
+
export const lengthStringValidator = (inputLength, errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= inputLength)(errorMsg ?? ERROR_MESSAGE);
|
|
10
10
|
export const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
|
|
11
11
|
export const numberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 6)(errorMsg);
|
|
12
12
|
export const innValidator = (errorMsg) => validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(errorMsg);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/validators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,aAAa,GAAG,8BAA8B,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAiB,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAiB,EAAE,EAAE,CAC1D,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAiB,EAAE,EAAE,CACtD,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CACtE,QAAQ,IAAI,aAAa,CAC1B,CAAC;AAEJ,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAiB,EAAE,EAAE,CACjD,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/validators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MA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ACJ,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,EAAE,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CAC9F,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC"}
|
|
@@ -27,9 +27,15 @@ export type ConditionFieldProps = {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
export type FilledByEsiaProps = {
|
|
31
|
+
/** @title Заполняется через госуслуги */
|
|
32
|
+
filledByEsia?: boolean;
|
|
33
|
+
};
|
|
34
|
+
|
|
30
35
|
export type FieldDefaultDef = Required &
|
|
31
36
|
LabelProps &
|
|
32
|
-
ConditionFieldProps &
|
|
37
|
+
ConditionFieldProps &
|
|
38
|
+
FilledByEsiaProps & {
|
|
33
39
|
name?: NameFieldDef;
|
|
34
40
|
dadata?: boolean;
|
|
35
41
|
};
|
|
@@ -73,6 +79,7 @@ export type FieldInfoDef = FieldDefaultDef &
|
|
|
73
79
|
* @title Поле
|
|
74
80
|
* @default { "fieldType": "common" }
|
|
75
81
|
*/
|
|
82
|
+
|
|
76
83
|
export type FieldDef = FieldCommonDef | FieldVedDef | FieldInfoDef;
|
|
77
84
|
|
|
78
85
|
/** @hidden */
|
|
@@ -24,10 +24,16 @@ export type ConditionFieldProps = {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
export type FilledByEsiaProps = {
|
|
28
|
+
/** @title Заполняется через госуслуги */
|
|
29
|
+
filledByEsia?: boolean;
|
|
30
|
+
};
|
|
31
|
+
|
|
27
32
|
export type FieldDefaultDef = Required &
|
|
28
33
|
TextProps &
|
|
29
34
|
LabelProps &
|
|
30
|
-
ConditionFieldProps &
|
|
35
|
+
ConditionFieldProps &
|
|
36
|
+
FilledByEsiaProps & {
|
|
31
37
|
name?: NameFieldDef;
|
|
32
38
|
};
|
|
33
39
|
|
|
@@ -12,11 +12,17 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
12
12
|
title: 'Персональные данные',
|
|
13
13
|
columns: 2,
|
|
14
14
|
inputs: [
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
{
|
|
16
|
+
fieldType: 'common',
|
|
17
|
+
name: 'surname',
|
|
18
|
+
required: true,
|
|
19
|
+
dadata: true,
|
|
20
|
+
filledByEsia: true,
|
|
21
|
+
},
|
|
22
|
+
{ fieldType: 'common', name: 'name', required: true, dadata: true, filledByEsia: true },
|
|
23
|
+
{ fieldType: 'common', name: 'middleName', dadata: true, filledByEsia: true },
|
|
18
24
|
{ fieldType: 'common', name: 'sex', required: true },
|
|
19
|
-
{ fieldType: 'common', name: 'birthday', required: true },
|
|
25
|
+
{ fieldType: 'common', name: 'birthday', required: true, filledByEsia: true },
|
|
20
26
|
{ fieldType: 'common', name: 'birthPlace', required: true },
|
|
21
27
|
{ fieldType: 'common', name: 'phone', required: true },
|
|
22
28
|
{ fieldType: 'common', name: 'email', required: true, dadata: true },
|
|
@@ -26,18 +32,31 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
26
32
|
title: 'Паспортные данные',
|
|
27
33
|
columns: 2,
|
|
28
34
|
inputs: [
|
|
29
|
-
{ fieldType: 'common', name: 'dulSerie', required: true },
|
|
30
|
-
{ fieldType: 'common', name: 'dulNumber', required: true },
|
|
31
|
-
{ fieldType: 'common', name: 'dulIssueDateField', required: true },
|
|
32
|
-
{
|
|
35
|
+
{ fieldType: 'common', name: 'dulSerie', required: true, filledByEsia: true },
|
|
36
|
+
{ fieldType: 'common', name: 'dulNumber', required: true, filledByEsia: true },
|
|
37
|
+
{ fieldType: 'common', name: 'dulIssueDateField', required: true, filledByEsia: true },
|
|
38
|
+
{
|
|
39
|
+
fieldType: 'common',
|
|
40
|
+
name: 'dulSubdivisionCode',
|
|
41
|
+
required: true,
|
|
42
|
+
dadata: true,
|
|
43
|
+
filledByEsia: true,
|
|
44
|
+
},
|
|
33
45
|
],
|
|
34
46
|
},
|
|
35
47
|
{
|
|
36
48
|
inputs: [
|
|
37
|
-
{
|
|
49
|
+
{
|
|
50
|
+
fieldType: 'common',
|
|
51
|
+
name: 'dulIssuedBy',
|
|
52
|
+
required: true,
|
|
53
|
+
dadata: true,
|
|
54
|
+
filledByEsia: true,
|
|
55
|
+
},
|
|
38
56
|
{
|
|
39
57
|
fieldType: 'common',
|
|
40
58
|
name: 'education',
|
|
59
|
+
required: true,
|
|
41
60
|
},
|
|
42
61
|
],
|
|
43
62
|
},
|
|
@@ -48,7 +67,13 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
48
67
|
},
|
|
49
68
|
{
|
|
50
69
|
inputs: [
|
|
51
|
-
{
|
|
70
|
+
{
|
|
71
|
+
fieldType: 'common',
|
|
72
|
+
name: 'addressRegistration',
|
|
73
|
+
required: true,
|
|
74
|
+
dadata: true,
|
|
75
|
+
filledByEsia: true,
|
|
76
|
+
},
|
|
52
77
|
{ fieldType: 'common', name: 'addressMatch' },
|
|
53
78
|
],
|
|
54
79
|
},
|
|
@@ -62,7 +87,7 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
62
87
|
},
|
|
63
88
|
{
|
|
64
89
|
columns: 2,
|
|
65
|
-
inputs: [{ fieldType: 'common', name: 'housing' }],
|
|
90
|
+
inputs: [{ fieldType: 'common', name: 'housing', required: true }],
|
|
66
91
|
},
|
|
67
92
|
{
|
|
68
93
|
inputs: [{ fieldType: 'common', name: 'addressFact', required: true, dadata: true }],
|
|
@@ -152,7 +177,7 @@ export const stepsSectionsMap: SectionsProps[][] = [
|
|
|
152
177
|
{
|
|
153
178
|
columns: 2,
|
|
154
179
|
inputs: [
|
|
155
|
-
{ fieldType: 'common', name: 'familyMembers'
|
|
180
|
+
{ fieldType: 'common', name: 'familyMembers' },
|
|
156
181
|
{ fieldType: 'common', name: 'children', required: true },
|
|
157
182
|
],
|
|
158
183
|
},
|
|
@@ -4,7 +4,6 @@ import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
|
4
4
|
import { useElementSpace } from '../../hooks/useElementSpace';
|
|
5
5
|
import { type LabelProps } from '../../model/HeadlineType';
|
|
6
6
|
import { type IconVersion } from '../../model/IconVersion';
|
|
7
|
-
import { formatDate } from '../../utils/formatDate';
|
|
8
7
|
import { style } from '../../utils/style';
|
|
9
8
|
import { type ControlProps } from '../ControlProps';
|
|
10
9
|
import { Icon } from '../Icon/Icon';
|
|
@@ -12,8 +11,8 @@ import { type IconName } from '../Icon/IconProps';
|
|
|
12
11
|
import { renderLabel } from '../Input/renderLabel';
|
|
13
12
|
import { Select } from '../Select/Select';
|
|
14
13
|
import { Calendar } from './Calendar';
|
|
15
|
-
import { DatePickerInput } from './DatePickerInput';
|
|
16
14
|
import { months } from './months';
|
|
15
|
+
import { renderDatePickerForm } from './renderDatePickerForm';
|
|
17
16
|
import { useDatePickerManager } from './useDatePickerManager';
|
|
18
17
|
|
|
19
18
|
const ICON_PROPS: { name: IconName; iconVersion: IconVersion; width: string; height: string } = {
|
|
@@ -29,20 +28,17 @@ const SELECT_PROPS: { className: string; iconVersion: IconVersion; isBorder: boo
|
|
|
29
28
|
isBorder: false,
|
|
30
29
|
};
|
|
31
30
|
|
|
32
|
-
const formStyle =
|
|
33
|
-
'flex justify-between items-center h-14 py-s border rounded-md cursor-pointer ' +
|
|
34
|
-
'hover:border-black active:border-black focus:border-black';
|
|
35
|
-
|
|
36
31
|
interface DatePickerProps extends ControlProps<Date>, LabelProps {
|
|
37
32
|
className?: string;
|
|
38
33
|
minDate?: Date;
|
|
39
34
|
maxDate?: Date;
|
|
40
35
|
valid?: boolean;
|
|
36
|
+
disabled?: boolean;
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
export const DatePicker = JSX<DatePickerProps>(
|
|
44
40
|
// eslint-disable-next-line max-lines-per-function
|
|
45
|
-
({ className = '', label = '', value, valid = true, minDate, maxDate, onChange }) => {
|
|
41
|
+
({ className = '', label = '', value, valid = true, minDate, maxDate, disabled, onChange }) => {
|
|
46
42
|
const [showCalendar, { setValue }] = useBool(false);
|
|
47
43
|
const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
|
|
48
44
|
const [selectedYear, setSelectedYear] = useState(
|
|
@@ -80,10 +76,11 @@ export const DatePicker = JSX<DatePickerProps>(
|
|
|
80
76
|
value,
|
|
81
77
|
valid,
|
|
82
78
|
onChange,
|
|
79
|
+
disabled,
|
|
83
80
|
setSelectedMonth,
|
|
84
81
|
setSelectedYear,
|
|
85
82
|
})}
|
|
86
|
-
{showCalendar ? (
|
|
83
|
+
{showCalendar && !disabled ? (
|
|
87
84
|
<div
|
|
88
85
|
className={style('absolute bg-white z-20 select-none', {
|
|
89
86
|
'bottom-full': spaceAbove,
|
|
@@ -125,28 +122,3 @@ export const DatePicker = JSX<DatePickerProps>(
|
|
|
125
122
|
);
|
|
126
123
|
},
|
|
127
124
|
);
|
|
128
|
-
|
|
129
|
-
const renderDatePickerForm = ({
|
|
130
|
-
handleChangeVisibleCalendar,
|
|
131
|
-
value,
|
|
132
|
-
valid,
|
|
133
|
-
onChange,
|
|
134
|
-
setSelectedMonth,
|
|
135
|
-
setSelectedYear,
|
|
136
|
-
}: {
|
|
137
|
-
handleChangeVisibleCalendar: () => void;
|
|
138
|
-
value: Date | undefined;
|
|
139
|
-
valid: boolean;
|
|
140
|
-
setSelectedMonth: (selectedMonth: number) => void;
|
|
141
|
-
setSelectedYear: (selectedYear: number) => void;
|
|
142
|
-
onChange?: (value: Date) => void;
|
|
143
|
-
}) => (
|
|
144
|
-
<DatePickerInput
|
|
145
|
-
onChange={onChange}
|
|
146
|
-
onClick={handleChangeVisibleCalendar}
|
|
147
|
-
value={value && formatDate(value)}
|
|
148
|
-
setSelectedMonth={setSelectedMonth}
|
|
149
|
-
setSelectedYear={setSelectedYear}
|
|
150
|
-
className={style(formStyle, valid ? 'border-gray' : 'border-error')}
|
|
151
|
-
></DatePickerInput>
|
|
152
|
-
);
|
|
@@ -21,10 +21,11 @@ interface DatePickerInputProps {
|
|
|
21
21
|
value?: string;
|
|
22
22
|
onChange?: (value: Date) => void;
|
|
23
23
|
onClick?: () => void;
|
|
24
|
+
disabled?: boolean;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export const DatePickerInput = JSX<DatePickerInputProps>(
|
|
27
|
-
({ setSelectedMonth, setSelectedYear, className, value, onChange, onClick }) => {
|
|
28
|
+
({ setSelectedMonth, setSelectedYear, className, value, disabled, onChange, onClick }) => {
|
|
28
29
|
const ref = useRef<HTMLInputElement | null>(null);
|
|
29
30
|
const [inputValue, setInputValue] = useState<string>(value || '');
|
|
30
31
|
|
|
@@ -66,8 +67,9 @@ export const DatePickerInput = JSX<DatePickerInputProps>(
|
|
|
66
67
|
type="text"
|
|
67
68
|
onChange={handleChange}
|
|
68
69
|
onBlur={onBlur}
|
|
70
|
+
disabled={disabled}
|
|
69
71
|
/>
|
|
70
|
-
<Icon className="mr-s" {...ICON_PROPS} />
|
|
72
|
+
{disabled ? null : <Icon className="mr-s" {...ICON_PROPS} />}
|
|
71
73
|
</div>
|
|
72
74
|
);
|
|
73
75
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { formatDate } from '../../utils/formatDate';
|
|
2
|
+
import { style } from '../../utils/style';
|
|
3
|
+
import { DatePickerInput } from './DatePickerInput';
|
|
4
|
+
|
|
5
|
+
const formStyle =
|
|
6
|
+
'flex justify-between items-center h-14 border rounded-md cursor-pointer ' +
|
|
7
|
+
'hover:border-black active:border-black focus:border-black';
|
|
8
|
+
|
|
9
|
+
export const renderDatePickerForm = ({
|
|
10
|
+
handleChangeVisibleCalendar,
|
|
11
|
+
value,
|
|
12
|
+
valid,
|
|
13
|
+
onChange,
|
|
14
|
+
setSelectedMonth,
|
|
15
|
+
setSelectedYear,
|
|
16
|
+
disabled = false,
|
|
17
|
+
}: {
|
|
18
|
+
handleChangeVisibleCalendar: () => void;
|
|
19
|
+
value: Date | undefined;
|
|
20
|
+
valid: boolean;
|
|
21
|
+
setSelectedMonth: (selectedMonth: number) => void;
|
|
22
|
+
setSelectedYear: (selectedYear: number) => void;
|
|
23
|
+
onChange?: (value: Date) => void;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}) => (
|
|
26
|
+
<DatePickerInput
|
|
27
|
+
onChange={onChange}
|
|
28
|
+
disabled={disabled}
|
|
29
|
+
onClick={handleChangeVisibleCalendar}
|
|
30
|
+
value={value && formatDate(value)}
|
|
31
|
+
setSelectedMonth={setSelectedMonth}
|
|
32
|
+
setSelectedYear={setSelectedYear}
|
|
33
|
+
className={style(formStyle, valid ? 'border-gray' : 'border-error')}
|
|
34
|
+
></DatePickerInput>
|
|
35
|
+
);
|
|
@@ -6,6 +6,7 @@ import { calculateIsRequired } from '../calculateIsRequired';
|
|
|
6
6
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
7
7
|
import { validatorObj } from '../getObjectValidator';
|
|
8
8
|
import { getValidation } from '../getValidation';
|
|
9
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
9
10
|
|
|
10
11
|
export const AddressField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
11
12
|
const fieldName = input?.name || 'addressRegistration';
|
|
@@ -40,6 +41,7 @@ export const AddressField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
43
|
<InputControl
|
|
44
|
+
disabled={fieldName === 'addressRegistration' && isEsiaAuthorize() && input?.filledByEsia}
|
|
43
45
|
label="Адрес"
|
|
44
46
|
{...getValidation(
|
|
45
47
|
field(fieldName),
|
|
@@ -3,10 +3,12 @@ import { DatePickerControl } from '../../DatePicker/DatePickerControl';
|
|
|
3
3
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
6
7
|
|
|
7
8
|
export const DulIssueDateField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<DatePickerControl
|
|
9
10
|
label="Дата выдачи"
|
|
10
11
|
{...getValidation(field('dulIssueDateField'), validatorObj.dulIssueDateField, input?.required)}
|
|
12
|
+
disabled={isEsiaAuthorize() && input?.filledByEsia}
|
|
11
13
|
/>
|
|
12
14
|
));
|
|
@@ -5,6 +5,7 @@ import { InputControl } from '../../Input/InputControl';
|
|
|
5
5
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
6
|
import { validatorObj } from '../getObjectValidator';
|
|
7
7
|
import { getValidation } from '../getValidation';
|
|
8
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
8
9
|
|
|
9
10
|
export const DulIssuedByField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
10
11
|
const { value: dulSubdivisionCode, onChange: changeDulSubdivisionCode } =
|
|
@@ -16,6 +17,7 @@ export const DulIssuedByField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
16
17
|
|
|
17
18
|
return (
|
|
18
19
|
<InputControl
|
|
20
|
+
disabled={isEsiaAuthorize() && input?.filledByEsia}
|
|
19
21
|
label="Кем выдан"
|
|
20
22
|
{...input}
|
|
21
23
|
{...getValidation(field('dulIssuedBy'), validatorObj.dulIssuedBy, input?.required)}
|
|
@@ -3,9 +3,11 @@ import { InputControl } from '../../Input/InputControl';
|
|
|
3
3
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
6
7
|
|
|
7
8
|
export const DulNumberField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<InputControl
|
|
10
|
+
disabled={isEsiaAuthorize() && input?.filledByEsia}
|
|
9
11
|
label="Номер документа"
|
|
10
12
|
type="number"
|
|
11
13
|
inputLength={6}
|
|
@@ -3,9 +3,11 @@ import { InputControl } from '../../Input/InputControl';
|
|
|
3
3
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
6
7
|
|
|
7
8
|
export const DulSerieField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<InputControl
|
|
10
|
+
disabled={isEsiaAuthorize() && input?.filledByEsia}
|
|
9
11
|
label="Серия документа"
|
|
10
12
|
type="number"
|
|
11
13
|
inputLength={4}
|
|
@@ -5,6 +5,7 @@ import { InputControl } from '../../Input/InputControl';
|
|
|
5
5
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
6
|
import { validatorObj } from '../getObjectValidator';
|
|
7
7
|
import { getValidation } from '../getValidation';
|
|
8
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
8
9
|
|
|
9
10
|
export const DulSubdivisionCodeField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
10
11
|
const onDaDataChange = useCallback((item: DaDataSuggestion) => {
|
|
@@ -13,6 +14,7 @@ export const DulSubdivisionCodeField = JSX<CustomFieldProps>(({ field, input })
|
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<InputControl
|
|
17
|
+
disabled={isEsiaAuthorize() && input?.filledByEsia}
|
|
16
18
|
label="Код подразделения"
|
|
17
19
|
type="number"
|
|
18
20
|
inputLength={6}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
3
|
import { InputControl } from '../../Input/InputControl';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
|
-
import { validatorObj } from '../getObjectValidator';
|
|
5
|
-
import { getValidation } from '../getValidation';
|
|
6
5
|
|
|
7
|
-
export const FamilyMembersField = JSX<CustomFieldProps>(({ field
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
));
|
|
6
|
+
export const FamilyMembersField = JSX<CustomFieldProps>(({ field }) => {
|
|
7
|
+
const { value, onChange } = field('familyMembers');
|
|
8
|
+
const adultsCount = field('familyStatus')?.value?.key === 'В браке' ? 2 : 1;
|
|
9
|
+
const childrenCount = Number(field('children')?.value);
|
|
10
|
+
const dependentsCount = Number(field('dependents')?.value);
|
|
11
|
+
const totalCount = adultsCount + childrenCount + dependentsCount;
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
field?.('familyMembers')?.onChange?.(totalCount);
|
|
15
|
+
}, [field('familyStatus')?.value?.key, childrenCount, dependentsCount]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<InputControl
|
|
19
|
+
label="Количество членов семьи"
|
|
20
|
+
placeholder="Введите значение"
|
|
21
|
+
type="number"
|
|
22
|
+
disabled={true}
|
|
23
|
+
value={value}
|
|
24
|
+
onChange={(_) => onChange?.(_)}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
});
|
|
@@ -3,10 +3,13 @@ import { InputControl } from '../../Input/InputControl';
|
|
|
3
3
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
6
7
|
|
|
7
8
|
export const MiddleNameField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<InputControl
|
|
9
10
|
label="Отчество (Обязательно, при наличии)"
|
|
11
|
+
inputLength={60}
|
|
12
|
+
disabled={isEsiaAuthorize() && input?.filledByEsia}
|
|
10
13
|
{...getValidation(field('middleName'), validatorObj.middleName)}
|
|
11
14
|
{...input}
|
|
12
15
|
/>
|
|
@@ -3,10 +3,13 @@ import { InputControl } from '../../Input/InputControl';
|
|
|
3
3
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
6
7
|
|
|
7
8
|
export const NameField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<InputControl
|
|
9
10
|
label="Имя"
|
|
11
|
+
inputLength={60}
|
|
12
|
+
disabled={isEsiaAuthorize() && input?.filledByEsia}
|
|
10
13
|
{...getValidation(field('name'), validatorObj.name, input?.required)}
|
|
11
14
|
{...input}
|
|
12
15
|
/>
|
|
@@ -3,10 +3,13 @@ import { InputControl } from '../../Input/InputControl';
|
|
|
3
3
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
4
4
|
import { validatorObj } from '../getObjectValidator';
|
|
5
5
|
import { getValidation } from '../getValidation';
|
|
6
|
+
import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
6
7
|
|
|
7
8
|
export const SurnameField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
9
|
<InputControl
|
|
9
10
|
label="Фамилия"
|
|
11
|
+
inputLength={60}
|
|
12
|
+
disabled={isEsiaAuthorize() && input?.filledByEsia}
|
|
10
13
|
{...getValidation(field('surname'), validatorObj.surname, input?.required)}
|
|
11
14
|
{...input}
|
|
12
15
|
/>
|
|
@@ -18,8 +18,8 @@ export const jobNumberValidator = (errorMsg?: string) =>
|
|
|
18
18
|
export const nameValidator = (errorMsg?: string) =>
|
|
19
19
|
validator((_) => typeof _ === 'string' && _.length > 1)(errorMsg ?? ERROR_MESSAGE);
|
|
20
20
|
|
|
21
|
-
export const lengthStringValidator = (
|
|
22
|
-
validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <=
|
|
21
|
+
export const lengthStringValidator = (inputLength: number, errorMsg?: string) =>
|
|
22
|
+
validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= inputLength)(
|
|
23
23
|
errorMsg ?? ERROR_MESSAGE,
|
|
24
24
|
);
|
|
25
25
|
|
package/package.json
CHANGED
|
@@ -27,9 +27,15 @@ export type ConditionFieldProps = {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
export type FilledByEsiaProps = {
|
|
31
|
+
/** @title Заполняется через госуслуги */
|
|
32
|
+
filledByEsia?: boolean;
|
|
33
|
+
};
|
|
34
|
+
|
|
30
35
|
export type FieldDefaultDef = Required &
|
|
31
36
|
LabelProps &
|
|
32
|
-
ConditionFieldProps &
|
|
37
|
+
ConditionFieldProps &
|
|
38
|
+
FilledByEsiaProps & {
|
|
33
39
|
name?: NameFieldDef;
|
|
34
40
|
dadata?: boolean;
|
|
35
41
|
};
|
|
@@ -73,6 +79,7 @@ export type FieldInfoDef = FieldDefaultDef &
|
|
|
73
79
|
* @title Поле
|
|
74
80
|
* @default { "fieldType": "common" }
|
|
75
81
|
*/
|
|
82
|
+
|
|
76
83
|
export type FieldDef = FieldCommonDef | FieldVedDef | FieldInfoDef;
|
|
77
84
|
|
|
78
85
|
/** @hidden */
|
|
@@ -24,10 +24,16 @@ export type ConditionFieldProps = {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
export type FilledByEsiaProps = {
|
|
28
|
+
/** @title Заполняется через госуслуги */
|
|
29
|
+
filledByEsia?: boolean;
|
|
30
|
+
};
|
|
31
|
+
|
|
27
32
|
export type FieldDefaultDef = Required &
|
|
28
33
|
TextProps &
|
|
29
34
|
LabelProps &
|
|
30
|
-
ConditionFieldProps &
|
|
35
|
+
ConditionFieldProps &
|
|
36
|
+
FilledByEsiaProps & {
|
|
31
37
|
name?: NameFieldDef;
|
|
32
38
|
};
|
|
33
39
|
|