@redneckz/wildless-cms-uni-blocks 0.14.685 → 0.14.686
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/RetailAPI/getGenderFromName.d.ts +1 -0
- package/bundle/bundle.umd.js +54 -14
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +2 -0
- package/dist/api/RetailAPI/getGenderFromName.d.ts +1 -0
- package/dist/api/RetailAPI/getGenderFromName.js +15 -0
- package/dist/api/RetailAPI/getGenderFromName.js.map +1 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +4 -3
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +2 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.js +25 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js +1 -10
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/SexField.js +17 -1
- package/dist/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/lib/api/RetailAPI/getGenderFromName.d.ts +1 -0
- package/lib/api/RetailAPI/getGenderFromName.js +12 -0
- package/lib/api/RetailAPI/getGenderFromName.js.map +1 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +4 -3
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +2 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.js +23 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js +1 -10
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/SexField.js +17 -1
- package/lib/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/getGenderFromName.d.ts +1 -0
- package/mobile/bundle/bundle.umd.js +54 -14
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +2 -0
- package/mobile/dist/api/RetailAPI/getGenderFromName.d.ts +1 -0
- package/mobile/dist/api/RetailAPI/getGenderFromName.js +15 -0
- package/mobile/dist/api/RetailAPI/getGenderFromName.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +4 -3
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +2 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +25 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js +1 -10
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/SexField.js +17 -1
- package/mobile/dist/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/mobile/lib/api/RetailAPI/getGenderFromName.d.ts +1 -0
- package/mobile/lib/api/RetailAPI/getGenderFromName.js +12 -0
- package/mobile/lib/api/RetailAPI/getGenderFromName.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +4 -3
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +2 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +23 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js +1 -10
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/SexField.js +17 -1
- package/mobile/lib/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/mobile/src/api/RetailAPI/getGenderFromName.ts +20 -0
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +4 -11
- package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +24 -0
- package/mobile/src/ui-kit/FormField/Fields/MiddleNameField.tsx +9 -22
- package/mobile/src/ui-kit/FormField/Fields/SexField.tsx +26 -8
- package/package.json +1 -1
- package/src/api/RetailAPI/getGenderFromName.ts +20 -0
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +1 -23
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +4 -11
- package/src/components/ApplicationLeadForm/applicationFormData.tsx +24 -0
- package/src/ui-kit/FormField/Fields/MiddleNameField.tsx +9 -22
- package/src/ui-kit/FormField/Fields/SexField.tsx +26 -8
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SectionsProps } from '../../model/InputSectionsType';
|
|
2
|
+
|
|
3
|
+
export const applicationFormData: SectionsProps[] = [
|
|
4
|
+
{
|
|
5
|
+
columns: 2,
|
|
6
|
+
inputs: [
|
|
7
|
+
{ fieldType: 'common', name: 'surname', required: true, dadata: true },
|
|
8
|
+
{ fieldType: 'common', name: 'name', required: true, dadata: true },
|
|
9
|
+
{ fieldType: 'common', name: 'middleName', dadata: true },
|
|
10
|
+
{ fieldType: 'common', name: 'limitedBirthday', required: true },
|
|
11
|
+
{ fieldType: 'common', name: 'phone', required: true },
|
|
12
|
+
{ fieldType: 'common', name: 'email', required: true, dadata: true },
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
inputs: [
|
|
17
|
+
{ fieldType: 'common', name: 'processPersonalDataFlg', required: true },
|
|
18
|
+
{ fieldType: 'common', name: 'consentProviderFlg', required: true },
|
|
19
|
+
{ fieldType: 'common', name: 'consentOthersFlg', required: true },
|
|
20
|
+
{ fieldType: 'common', name: 'consentInformFlg' },
|
|
21
|
+
{ fieldType: 'common', name: 'consentPfrFlg' },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
];
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
|
|
4
2
|
import { InputControl } from '../../Input/InputControl';
|
|
5
3
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
4
|
import { validatorObj } from '../getObjectValidator';
|
|
@@ -9,23 +7,12 @@ import { isEsiaAuthorize } from '../isEsiaAuthorize';
|
|
|
9
7
|
|
|
10
8
|
const FIELD_NAME = 'middleName';
|
|
11
9
|
|
|
12
|
-
export const MiddleNameField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<InputControl
|
|
23
|
-
label="Отчество (Обязательно, при наличии)"
|
|
24
|
-
maxLength={60}
|
|
25
|
-
disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
|
|
26
|
-
{...getValidation(field(FIELD_NAME), validatorObj.middleName, input?.required)}
|
|
27
|
-
{...input}
|
|
28
|
-
onDaDataChange={onDaDataChange}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
});
|
|
10
|
+
export const MiddleNameField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
11
|
+
<InputControl
|
|
12
|
+
label="Отчество (Обязательно, при наличии)"
|
|
13
|
+
maxLength={60}
|
|
14
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
|
|
15
|
+
{...getValidation(field(FIELD_NAME), validatorObj.middleName, input?.required)}
|
|
16
|
+
{...input}
|
|
17
|
+
/>
|
|
18
|
+
));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { getGenderFromName } from '../../../api/RetailAPI/getGenderFromName';
|
|
2
4
|
import { type RadioButtonItem } from '../../RadioButtonGroup/RadioButtonGroup';
|
|
3
5
|
import { RadioButtonGroupControl } from '../../RadioButtonGroup/RadioButtonGroupControl';
|
|
4
6
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
@@ -10,11 +12,27 @@ export const SEX_TYPES: RadioButtonItem[] = [
|
|
|
10
12
|
{ id: 'female', text: 'Женский' },
|
|
11
13
|
];
|
|
12
14
|
|
|
13
|
-
export const SexField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)
|
|
15
|
+
export const SexField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
16
|
+
const name = field('name')?.value;
|
|
17
|
+
const { value: selectedSex, onChange: changeSex } = field('sex');
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (name && !selectedSex) {
|
|
21
|
+
(async () => {
|
|
22
|
+
const gender = await getGenderFromName(name as string);
|
|
23
|
+
if (gender) {
|
|
24
|
+
changeSex?.(gender);
|
|
25
|
+
}
|
|
26
|
+
})();
|
|
27
|
+
}
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<RadioButtonGroupControl
|
|
32
|
+
label="Пол"
|
|
33
|
+
orientation="horizontal"
|
|
34
|
+
items={SEX_TYPES}
|
|
35
|
+
{...getValidation(field('sex'), validatorObj.sex, input?.required)}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
});
|