@redneckz/wildless-cms-uni-blocks 0.14.673 → 0.14.675
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +19 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/dist/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +1 -1
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/AddressFactField.js +1 -1
- package/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/dist/ui-kit/FormField/validators.js +7 -4
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/Input/InputControl.js +4 -1
- package/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.js +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/lib/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +1 -1
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/AddressFactField.js +1 -1
- package/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/lib/ui-kit/FormField/validators.js +7 -4
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/Input/InputControl.js +4 -1
- package/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +19 -11
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/mobile/dist/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.js +7 -4
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputControl.js +4 -1
- package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js +2 -2
- package/mobile/lib/components/CreditCardForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js +2 -2
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.js +7 -4
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputControl.js +4 -1
- package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +4 -5
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +1 -1
- package/mobile/src/components/CreditCardForm/StepsNavigationButtons.tsx +3 -11
- package/mobile/src/components/CreditForm/CreditForm.tsx +1 -1
- package/mobile/src/components/CreditForm/StepsNavigationButtons.tsx +4 -12
- package/mobile/src/ui-kit/FormField/Fields/AddressFactField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/validators.ts +14 -8
- package/mobile/src/ui-kit/Input/InputControl.tsx +5 -2
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +4 -5
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +1 -1
- package/src/components/CreditCardForm/CreditCardForm.tsx +1 -1
- package/src/components/CreditCardForm/StepsNavigationButtons.tsx +3 -11
- package/src/components/CreditForm/CreditForm.tsx +1 -1
- package/src/components/CreditForm/StepsNavigationButtons.tsx +4 -12
- package/src/ui-kit/FormField/Fields/AddressFactField.tsx +1 -1
- package/src/ui-kit/FormField/validators.ts +14 -8
- package/src/ui-kit/Input/InputControl.tsx +5 -2
|
@@ -57,17 +57,16 @@
|
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"fieldType": "common",
|
|
60
|
-
"name": "
|
|
60
|
+
"name": "consentOthersFlg",
|
|
61
|
+
"required": true
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
"fieldType": "common",
|
|
64
|
-
"name": "consentInformFlg"
|
|
65
|
-
"required": true
|
|
65
|
+
"name": "consentInformFlg"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"fieldType": "common",
|
|
69
|
-
"name": "
|
|
70
|
-
"required": true
|
|
69
|
+
"name": "consentPfrFlg"
|
|
71
70
|
}
|
|
72
71
|
]
|
|
73
72
|
}
|
|
@@ -32,9 +32,9 @@ export default {
|
|
|
32
32
|
{
|
|
33
33
|
inputs: [
|
|
34
34
|
{ fieldType: 'common', name: 'processPersonalDataFlg', required: true },
|
|
35
|
-
{ fieldType: 'common', name: 'consentInformFlg', required: true },
|
|
36
35
|
{ fieldType: 'common', name: 'consentProviderFlg', required: true },
|
|
37
36
|
{ fieldType: 'common', name: 'consentOthersFlg', required: true },
|
|
37
|
+
{ fieldType: 'common', name: 'consentInformFlg' },
|
|
38
38
|
{ fieldType: 'common', name: 'consentPfrFlg' },
|
|
39
39
|
],
|
|
40
40
|
},
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { Button } from '../../ui-kit/Button/Button';
|
|
3
|
-
import { style } from '../../utils/style';
|
|
4
3
|
|
|
5
4
|
export interface StepsNavigationButtonsProps {
|
|
6
5
|
step: number;
|
|
@@ -9,21 +8,14 @@ export interface StepsNavigationButtonsProps {
|
|
|
9
8
|
|
|
10
9
|
export const StepsNavigationButtons = JSX<StepsNavigationButtonsProps>(({ step, onPrevStep }) => {
|
|
11
10
|
const isFirstStep = step === 0;
|
|
11
|
+
const isFinalStep = step === 6;
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<div className="flex justify-between gap-m">
|
|
15
|
-
<Button
|
|
16
|
-
onClick={onPrevStep}
|
|
17
|
-
className={style('w-full @xl:w-auto')}
|
|
18
|
-
type="button"
|
|
19
|
-
version="secondary"
|
|
20
|
-
disabled={isFirstStep}
|
|
21
|
-
>
|
|
15
|
+
<Button onClick={onPrevStep} type="button" version="secondary" disabled={isFirstStep}>
|
|
22
16
|
Назад
|
|
23
17
|
</Button>
|
|
24
|
-
<Button
|
|
25
|
-
Далее
|
|
26
|
-
</Button>
|
|
18
|
+
<Button type="submit">{isFinalStep ? 'Отправить заявку' : 'Далее'}</Button>
|
|
27
19
|
</div>
|
|
28
20
|
);
|
|
29
21
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { Button } from '../../ui-kit/Button/Button';
|
|
3
|
-
import { style } from '../../utils/style';
|
|
4
3
|
|
|
5
4
|
export interface StepsNavigationButtonsProps {
|
|
6
5
|
step: number;
|
|
@@ -9,21 +8,14 @@ export interface StepsNavigationButtonsProps {
|
|
|
9
8
|
|
|
10
9
|
export const StepsNavigationButtons = JSX<StepsNavigationButtonsProps>(({ step, onPrevStep }) => {
|
|
11
10
|
const isFirstStep = step === 0;
|
|
11
|
+
const isFinalStep = step === 5;
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<div className={'flex justify-between'}>
|
|
15
|
-
<Button
|
|
16
|
-
onClick={onPrevStep}
|
|
17
|
-
className={style('w-full @xl:w-auto')}
|
|
18
|
-
type="button"
|
|
19
|
-
version="secondary"
|
|
20
|
-
disabled={isFirstStep}
|
|
21
|
-
>
|
|
14
|
+
<div className={'flex justify-between gap-m'}>
|
|
15
|
+
<Button onClick={onPrevStep} type="button" version="secondary" disabled={isFirstStep}>
|
|
22
16
|
Назад
|
|
23
17
|
</Button>
|
|
24
|
-
<Button
|
|
25
|
-
Далее
|
|
26
|
-
</Button>
|
|
18
|
+
<Button type="submit">{isFinalStep ? 'Отправить заявку' : 'Далее'}</Button>
|
|
27
19
|
</div>
|
|
28
20
|
);
|
|
29
21
|
});
|
|
@@ -15,7 +15,7 @@ export const AddressFactField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
15
15
|
if (value) {
|
|
16
16
|
field('addressFact')?.onChange?.(field('addressRegistration').value);
|
|
17
17
|
}
|
|
18
|
-
}, [value]);
|
|
18
|
+
}, [value, field('addressRegistration').value]);
|
|
19
19
|
|
|
20
20
|
const onDaDataChange = useCallback((item: DaDataSuggestion) => {
|
|
21
21
|
field?.(fieldName)?.onChange?.({
|
|
@@ -5,6 +5,8 @@ import { validator } from '../../validation/validator';
|
|
|
5
5
|
|
|
6
6
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
7
7
|
|
|
8
|
+
const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
|
|
9
|
+
|
|
8
10
|
export const defaultValidator = (errorMsg?: string) => required(errorMsg ?? ERROR_MESSAGE);
|
|
9
11
|
|
|
10
12
|
export const defaultSelectValidator = (errorMsg?: string) =>
|
|
@@ -16,7 +18,9 @@ export const jobNumberValidator = (errorMsg?: string) =>
|
|
|
16
18
|
);
|
|
17
19
|
|
|
18
20
|
export const nameValidator = (errorMsg?: string) =>
|
|
19
|
-
validator((_) => typeof _ === 'string' && _.length > 1
|
|
21
|
+
validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(
|
|
22
|
+
errorMsg ?? ERROR_MESSAGE,
|
|
23
|
+
);
|
|
20
24
|
|
|
21
25
|
export const lengthStringValidator = (inputLength: number, errorMsg?: string) =>
|
|
22
26
|
validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= inputLength)(
|
|
@@ -69,16 +73,18 @@ export const emailValidator = (errorMsg: string) =>
|
|
|
69
73
|
const addressDaDataValidate = (address: Address) =>
|
|
70
74
|
Boolean(address.region && address.city && address.house);
|
|
71
75
|
|
|
72
|
-
export const addressDaDataValidator = () =>
|
|
73
|
-
validator(addressDaDataValidate)('Укажите регион, город/населенный пункт, улицу, дом, квартиру');
|
|
76
|
+
export const addressDaDataValidator = () => validator(addressDaDataValidate)(ADDRESS_ERROR_MESSAGE);
|
|
74
77
|
|
|
75
78
|
export const addressOrganizationValidator = () =>
|
|
76
79
|
validator((address: Address) => Boolean(address.fiasCode && address.city && address.house))(
|
|
77
|
-
|
|
80
|
+
ADDRESS_ERROR_MESSAGE,
|
|
78
81
|
);
|
|
79
82
|
|
|
80
83
|
export const codeWordValidator = (errorMsg?: string) =>
|
|
81
|
-
validator(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
validator((_) => typeof _ === 'string' && _.length >= 3 && _.length <= 21 && isCyrillic(_))(
|
|
85
|
+
errorMsg ?? ERROR_MESSAGE,
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const cyrillicPattern = /^[\u0400-\u04FF\d]+$/u;
|
|
89
|
+
|
|
90
|
+
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
@@ -33,8 +33,11 @@ export const InputControl = JSX<InputProps>(
|
|
|
33
33
|
const popupRef = useOutsideClick<HTMLDivElement>(close);
|
|
34
34
|
|
|
35
35
|
const handleChange = useCallback(
|
|
36
|
-
(v: string) =>
|
|
37
|
-
|
|
36
|
+
(v: string) => {
|
|
37
|
+
dadata && !isOpen && open();
|
|
38
|
+
maxLength ? v.length <= maxLength && onChange(v) : onChange(v);
|
|
39
|
+
},
|
|
40
|
+
[dadata, isOpen, onChange],
|
|
38
41
|
);
|
|
39
42
|
|
|
40
43
|
const inputRef = useInputPopup({
|