@redneckz/wildless-cms-uni-blocks 0.14.559 → 0.14.561
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 +40 -29
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/MiddleNameField.d.ts +2 -0
- package/bundle/components/ApplicationForm/NameField.d.ts +2 -0
- package/bundle/components/ApplicationForm/PhoneField.d.ts +2 -0
- package/bundle/components/ApplicationForm/SurnameField.d.ts +2 -0
- package/bundle/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
- package/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
- package/dist/components/ApplicationForm/MiddleNameField.d.ts +2 -0
- package/dist/components/ApplicationForm/MiddleNameField.js +7 -0
- package/dist/components/ApplicationForm/MiddleNameField.js.map +1 -0
- package/dist/components/ApplicationForm/NameField.d.ts +2 -0
- package/dist/components/ApplicationForm/NameField.js +12 -0
- package/dist/components/ApplicationForm/NameField.js.map +1 -0
- package/dist/components/ApplicationForm/PhoneField.d.ts +2 -0
- package/dist/components/ApplicationForm/PhoneField.js +9 -0
- package/dist/components/ApplicationForm/PhoneField.js.map +1 -0
- package/dist/components/ApplicationForm/SurnameField.d.ts +2 -0
- package/dist/components/ApplicationForm/SurnameField.js +9 -0
- package/dist/components/ApplicationForm/SurnameField.js.map +1 -0
- package/dist/components/ApplicationForm/getField.js +8 -5
- package/dist/components/ApplicationForm/getField.js.map +1 -1
- package/dist/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
- package/dist/ui-kit/Checkbox/CheckboxGroup.js +20 -0
- package/dist/ui-kit/Checkbox/CheckboxGroup.js.map +1 -0
- package/dist/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/MiddleNameField.d.ts +2 -0
- package/lib/components/ApplicationForm/MiddleNameField.js +5 -0
- package/lib/components/ApplicationForm/MiddleNameField.js.map +1 -0
- package/lib/components/ApplicationForm/NameField.d.ts +2 -0
- package/lib/components/ApplicationForm/NameField.js +10 -0
- package/lib/components/ApplicationForm/NameField.js.map +1 -0
- package/lib/components/ApplicationForm/PhoneField.d.ts +2 -0
- package/lib/components/ApplicationForm/PhoneField.js +7 -0
- package/lib/components/ApplicationForm/PhoneField.js.map +1 -0
- package/lib/components/ApplicationForm/SurnameField.d.ts +2 -0
- package/lib/components/ApplicationForm/SurnameField.js +7 -0
- package/lib/components/ApplicationForm/SurnameField.js.map +1 -0
- package/lib/components/ApplicationForm/getField.js +8 -5
- package/lib/components/ApplicationForm/getField.js.map +1 -1
- package/lib/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
- package/lib/ui-kit/Checkbox/CheckboxGroup.js +18 -0
- package/lib/ui-kit/Checkbox/CheckboxGroup.js.map +1 -0
- package/lib/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
- package/mobile/bundle/bundle.umd.js +40 -29
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/MiddleNameField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationForm/NameField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationForm/PhoneField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationForm/SurnameField.d.ts +2 -0
- package/mobile/bundle/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
- package/mobile/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
- package/mobile/dist/components/ApplicationForm/MiddleNameField.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/MiddleNameField.js +7 -0
- package/mobile/dist/components/ApplicationForm/MiddleNameField.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/NameField.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/NameField.js +12 -0
- package/mobile/dist/components/ApplicationForm/NameField.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/PhoneField.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/PhoneField.js +9 -0
- package/mobile/dist/components/ApplicationForm/PhoneField.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/SurnameField.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/SurnameField.js +9 -0
- package/mobile/dist/components/ApplicationForm/SurnameField.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/getField.js +8 -5
- package/mobile/dist/components/ApplicationForm/getField.js.map +1 -1
- package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
- package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.js +20 -0
- package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.js.map +1 -0
- package/mobile/dist/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/MiddleNameField.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/MiddleNameField.js +5 -0
- package/mobile/lib/components/ApplicationForm/MiddleNameField.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/NameField.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/NameField.js +10 -0
- package/mobile/lib/components/ApplicationForm/NameField.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/PhoneField.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/PhoneField.js +7 -0
- package/mobile/lib/components/ApplicationForm/PhoneField.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/SurnameField.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/SurnameField.js +7 -0
- package/mobile/lib/components/ApplicationForm/SurnameField.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/getField.js +8 -5
- package/mobile/lib/components/ApplicationForm/getField.js.map +1 -1
- package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
- package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.js +18 -0
- package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.js.map +1 -0
- package/mobile/lib/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
- package/mobile/src/components/ApplicationForm/MiddleNameField.tsx +7 -0
- package/mobile/src/components/ApplicationForm/NameField.tsx +18 -0
- package/mobile/src/components/ApplicationForm/PhoneField.tsx +12 -0
- package/mobile/src/components/ApplicationForm/SurnameField.tsx +12 -0
- package/mobile/src/components/ApplicationForm/getField.tsx +8 -23
- package/mobile/src/ui-kit/Checkbox/CheckboxGroup.tsx +52 -0
- package/mobile/src/ui-kit/Checkbox/CheckboxProps.ts +7 -0
- package/package.json +1 -1
- package/src/components/ApplicationForm/MiddleNameField.tsx +7 -0
- package/src/components/ApplicationForm/NameField.tsx +18 -0
- package/src/components/ApplicationForm/PhoneField.tsx +12 -0
- package/src/components/ApplicationForm/SurnameField.tsx +12 -0
- package/src/components/ApplicationForm/getField.tsx +8 -23
- package/src/ui-kit/Checkbox/CheckboxGroup.tsx +52 -0
- package/src/ui-kit/Checkbox/CheckboxProps.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getField.js","sourceRoot":"","sources":["../../../src/components/ApplicationForm/getField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"getField.js","sourceRoot":"","sources":["../../../src/components/ApplicationForm/getField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE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IAAI,CAAC,IAAlC,MAAM,CAAC,CAAC,CAAC,CAAgC,CACpD,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { style } from '../../utils/style.js';
|
|
4
|
+
import { Foldable } from '../Foldable/Foldable.js';
|
|
5
|
+
import { FoldableSection } from '../Foldable/FoldableSection.js';
|
|
6
|
+
import { Icon } from '../Icon/Icon.js';
|
|
7
|
+
import { Checkbox } from './Checkbox.js';
|
|
8
|
+
export const CheckboxGroup = JSX(({ className, items = [], ...props }) => {
|
|
9
|
+
const isChecked = items.every((_) => _?.value);
|
|
10
|
+
const handleGeneralToggle = (value) => {
|
|
11
|
+
for (const item of items) {
|
|
12
|
+
item?.onChange && item.onChange(value);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return (_jsx("div", { className: style('w-full', className), children: _jsx(Foldable, { isFoldButtonOnTop: true, renderFoldableSection: ({ isUnfolded }) => (_jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col gap-lg pl-2xl py-xs", children: items.map(Checkbox) })), renderFoldButton: renderGeneralCheckbox(_jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, ...props })) }) }));
|
|
16
|
+
});
|
|
17
|
+
const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (_jsxs("div", { className: "flex items-center", children: [generalCheckBox, _jsx("button", { onClick: foldableData.onToggle, className: "p-m", children: _jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
|
|
18
|
+
//# sourceMappingURL=CheckboxGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.js","sourceRoot":"","sources":["../../../src/ui-k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;AAEH,MAAM,qBAAqB,GACzB,CAAC,eAAsB,EAAE,EAAE,CAC3B,CAAC,YAA+B,EAAS,EAAE,CACzC,CACE,eAAK,SAAS,EAAC,mBAAmB,aAC/B,eAAe,EAChB,iBAAQ,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAC,KAAK,YACrD,KAAC,IAAI,IACH,SAAS,EAAC,mBAAmB,EAC7B,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAC/D,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,GACX,GACK,IACL,CACP,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputControl } from '../../ui-kit/Input/InputControl';
|
|
3
|
+
import { type CustomFieldProps } from './CustomFieldProps';
|
|
4
|
+
|
|
5
|
+
export const MiddleNameField = JSX<CustomFieldProps>(({ field }) => (
|
|
6
|
+
<InputControl label="Отчество (Обязательно, при наличии)" {...field('middleName')} />
|
|
7
|
+
));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputControl } from '../../ui-kit/Input/InputControl';
|
|
3
|
+
import type { FieldDef } from './ApplicationFormContent';
|
|
4
|
+
import { type CustomFieldProps } from './CustomFieldProps';
|
|
5
|
+
import { validatorObj } from './getObjectValidator';
|
|
6
|
+
import { getValidation } from './getValidation';
|
|
7
|
+
|
|
8
|
+
export const NameField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
+
const { required, ...rest } = input as FieldDef;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<InputControl
|
|
13
|
+
label="Имя"
|
|
14
|
+
{...getValidation(field('name'), validatorObj.name, required)}
|
|
15
|
+
{...rest}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputPhoneControl } from '../../ui-kit/Input/InputPhoneControl';
|
|
3
|
+
import { type CustomFieldProps } from './CustomFieldProps';
|
|
4
|
+
import { validatorObj } from './getObjectValidator';
|
|
5
|
+
import { getValidation } from './getValidation';
|
|
6
|
+
|
|
7
|
+
export const PhoneField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<InputPhoneControl
|
|
9
|
+
label="Телефон"
|
|
10
|
+
{...getValidation(field('phone'), validatorObj.phone, input?.required)}
|
|
11
|
+
/>
|
|
12
|
+
));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputControl } from '../../ui-kit/Input/InputControl';
|
|
3
|
+
import { type CustomFieldProps } from './CustomFieldProps';
|
|
4
|
+
import { validatorObj } from './getObjectValidator';
|
|
5
|
+
import { getValidation } from './getValidation';
|
|
6
|
+
|
|
7
|
+
export const SurnameField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<InputControl
|
|
9
|
+
label="Фамилия"
|
|
10
|
+
{...getValidation(field('surname'), validatorObj.surname, input?.required)}
|
|
11
|
+
/>
|
|
12
|
+
));
|
|
@@ -2,7 +2,6 @@ import { type FormFieldRegisterer } from '../../hooks/useForm';
|
|
|
2
2
|
import { CheckboxWithError } from '../../ui-kit/Checkbox/CheckboxWithError';
|
|
3
3
|
import { DatePickerControl } from '../../ui-kit/DatePicker/DatePickerControl';
|
|
4
4
|
import { InputControl } from '../../ui-kit/Input/InputControl';
|
|
5
|
-
import { InputPhoneControl } from '../../ui-kit/Input/InputPhoneControl';
|
|
6
5
|
import { AcquiringField } from './AcquiringField';
|
|
7
6
|
import { AddressBranchField } from './AddressBranchField';
|
|
8
7
|
import { AmountField } from './AmountField';
|
|
@@ -16,14 +15,18 @@ import { getValidation } from './getValidation';
|
|
|
16
15
|
import { IsClientField } from './IsClientField';
|
|
17
16
|
import { isRenderField } from './isRenderField';
|
|
18
17
|
import { LocalitiesField } from './LocalitiesField';
|
|
18
|
+
import { MiddleNameField } from './MiddleNameField';
|
|
19
|
+
import { NameField } from './NameField';
|
|
19
20
|
import { OnlineCheckoutField } from './OnlineCheckoutField';
|
|
20
21
|
import { PartnerCommentsField } from './PartnerCommentsField';
|
|
22
|
+
import { PhoneField } from './PhoneField';
|
|
21
23
|
import { PosTerminalField } from './PosTerminalField';
|
|
22
24
|
import { ProductField } from './ProductField';
|
|
23
25
|
import { RegionField } from './RegionField';
|
|
24
26
|
import { RegionPremiumField } from './RegionPremiumField';
|
|
25
27
|
import { SecondaryPhoneField } from './SecondaryPhoneField';
|
|
26
28
|
import { ServiceDirectionField } from './ServiceDirectionField';
|
|
29
|
+
import { SurnameField } from './SurnameField';
|
|
27
30
|
import { TermField } from './TermField';
|
|
28
31
|
import { UltraPremiumField } from './UltraPremiumField';
|
|
29
32
|
import { VedField } from './VedField';
|
|
@@ -35,28 +38,10 @@ export const getField =
|
|
|
35
38
|
const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
|
|
36
39
|
|
|
37
40
|
const InputsMap = {
|
|
38
|
-
surname:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/>
|
|
43
|
-
),
|
|
44
|
-
name: (
|
|
45
|
-
<InputControl
|
|
46
|
-
label="Имя"
|
|
47
|
-
{...getValidation(field('name'), validatorObj.name, required)}
|
|
48
|
-
{...rest}
|
|
49
|
-
/>
|
|
50
|
-
),
|
|
51
|
-
middleName: (
|
|
52
|
-
<InputControl label="Отчество (Обязательно, при наличии)" {...field('middleName')} />
|
|
53
|
-
),
|
|
54
|
-
phone: (
|
|
55
|
-
<InputPhoneControl
|
|
56
|
-
label="Телефон"
|
|
57
|
-
{...getValidation(field('phone'), validatorObj.phone, required)}
|
|
58
|
-
/>
|
|
59
|
-
),
|
|
41
|
+
surname: <SurnameField field={field} input={input} />,
|
|
42
|
+
name: <NameField field={field} input={input} />,
|
|
43
|
+
middleName: <MiddleNameField field={field} />,
|
|
44
|
+
phone: <PhoneField field={field} input={input} />,
|
|
60
45
|
email: (
|
|
61
46
|
<InputControl
|
|
62
47
|
label="Электронная почта"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type VNode } from '../../model/VNode';
|
|
3
|
+
import { style } from '../../utils/style';
|
|
4
|
+
import { Foldable } from '../Foldable/Foldable';
|
|
5
|
+
import { type FoldablePartProps } from '../Foldable/FoldablePartProps';
|
|
6
|
+
import { FoldableSection } from '../Foldable/FoldableSection';
|
|
7
|
+
import { Icon } from '../Icon/Icon';
|
|
8
|
+
import { Checkbox } from './Checkbox';
|
|
9
|
+
import { type CheckboxGroupProps } from './CheckboxProps';
|
|
10
|
+
|
|
11
|
+
export const CheckboxGroup = JSX<CheckboxGroupProps>(({ className, items = [], ...props }) => {
|
|
12
|
+
const isChecked = items.every((_) => _?.value);
|
|
13
|
+
|
|
14
|
+
const handleGeneralToggle = (value: boolean) => {
|
|
15
|
+
for (const item of items) {
|
|
16
|
+
item?.onChange && item.onChange(value);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className={style('w-full', className)}>
|
|
22
|
+
<Foldable
|
|
23
|
+
isFoldButtonOnTop
|
|
24
|
+
renderFoldableSection={({ isUnfolded }) => (
|
|
25
|
+
<FoldableSection isUnfolded={isUnfolded} className="flex flex-col gap-lg pl-2xl py-xs">
|
|
26
|
+
{items.map(Checkbox)}
|
|
27
|
+
</FoldableSection>
|
|
28
|
+
)}
|
|
29
|
+
renderFoldButton={renderGeneralCheckbox(
|
|
30
|
+
<Checkbox value={isChecked} onChange={handleGeneralToggle} {...props} />,
|
|
31
|
+
)}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const renderGeneralCheckbox =
|
|
38
|
+
(generalCheckBox: VNode) =>
|
|
39
|
+
(foldableData: FoldablePartProps): VNode =>
|
|
40
|
+
(
|
|
41
|
+
<div className="flex items-center">
|
|
42
|
+
{generalCheckBox}
|
|
43
|
+
<button onClick={foldableData.onToggle} className="p-m">
|
|
44
|
+
<Icon
|
|
45
|
+
className="text-primary-text"
|
|
46
|
+
name={foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
|
|
47
|
+
width="16"
|
|
48
|
+
height="16"
|
|
49
|
+
/>
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
@@ -6,4 +6,11 @@ export interface CheckboxProps {
|
|
|
6
6
|
isRadio?: boolean;
|
|
7
7
|
onChange?: (value: boolean) => void;
|
|
8
8
|
error?: string;
|
|
9
|
+
subItems?: CheckboxProps[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CheckboxGroupProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
items?: CheckboxProps[];
|
|
15
|
+
text?: string;
|
|
9
16
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputControl } from '../../ui-kit/Input/InputControl';
|
|
3
|
+
import { type CustomFieldProps } from './CustomFieldProps';
|
|
4
|
+
|
|
5
|
+
export const MiddleNameField = JSX<CustomFieldProps>(({ field }) => (
|
|
6
|
+
<InputControl label="Отчество (Обязательно, при наличии)" {...field('middleName')} />
|
|
7
|
+
));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputControl } from '../../ui-kit/Input/InputControl';
|
|
3
|
+
import type { FieldDef } from './ApplicationFormContent';
|
|
4
|
+
import { type CustomFieldProps } from './CustomFieldProps';
|
|
5
|
+
import { validatorObj } from './getObjectValidator';
|
|
6
|
+
import { getValidation } from './getValidation';
|
|
7
|
+
|
|
8
|
+
export const NameField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
+
const { required, ...rest } = input as FieldDef;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<InputControl
|
|
13
|
+
label="Имя"
|
|
14
|
+
{...getValidation(field('name'), validatorObj.name, required)}
|
|
15
|
+
{...rest}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputPhoneControl } from '../../ui-kit/Input/InputPhoneControl';
|
|
3
|
+
import { type CustomFieldProps } from './CustomFieldProps';
|
|
4
|
+
import { validatorObj } from './getObjectValidator';
|
|
5
|
+
import { getValidation } from './getValidation';
|
|
6
|
+
|
|
7
|
+
export const PhoneField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<InputPhoneControl
|
|
9
|
+
label="Телефон"
|
|
10
|
+
{...getValidation(field('phone'), validatorObj.phone, input?.required)}
|
|
11
|
+
/>
|
|
12
|
+
));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputControl } from '../../ui-kit/Input/InputControl';
|
|
3
|
+
import { type CustomFieldProps } from './CustomFieldProps';
|
|
4
|
+
import { validatorObj } from './getObjectValidator';
|
|
5
|
+
import { getValidation } from './getValidation';
|
|
6
|
+
|
|
7
|
+
export const SurnameField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
8
|
+
<InputControl
|
|
9
|
+
label="Фамилия"
|
|
10
|
+
{...getValidation(field('surname'), validatorObj.surname, input?.required)}
|
|
11
|
+
/>
|
|
12
|
+
));
|
|
@@ -2,7 +2,6 @@ import { type FormFieldRegisterer } from '../../hooks/useForm';
|
|
|
2
2
|
import { CheckboxWithError } from '../../ui-kit/Checkbox/CheckboxWithError';
|
|
3
3
|
import { DatePickerControl } from '../../ui-kit/DatePicker/DatePickerControl';
|
|
4
4
|
import { InputControl } from '../../ui-kit/Input/InputControl';
|
|
5
|
-
import { InputPhoneControl } from '../../ui-kit/Input/InputPhoneControl';
|
|
6
5
|
import { AcquiringField } from './AcquiringField';
|
|
7
6
|
import { AddressBranchField } from './AddressBranchField';
|
|
8
7
|
import { AmountField } from './AmountField';
|
|
@@ -16,14 +15,18 @@ import { getValidation } from './getValidation';
|
|
|
16
15
|
import { IsClientField } from './IsClientField';
|
|
17
16
|
import { isRenderField } from './isRenderField';
|
|
18
17
|
import { LocalitiesField } from './LocalitiesField';
|
|
18
|
+
import { MiddleNameField } from './MiddleNameField';
|
|
19
|
+
import { NameField } from './NameField';
|
|
19
20
|
import { OnlineCheckoutField } from './OnlineCheckoutField';
|
|
20
21
|
import { PartnerCommentsField } from './PartnerCommentsField';
|
|
22
|
+
import { PhoneField } from './PhoneField';
|
|
21
23
|
import { PosTerminalField } from './PosTerminalField';
|
|
22
24
|
import { ProductField } from './ProductField';
|
|
23
25
|
import { RegionField } from './RegionField';
|
|
24
26
|
import { RegionPremiumField } from './RegionPremiumField';
|
|
25
27
|
import { SecondaryPhoneField } from './SecondaryPhoneField';
|
|
26
28
|
import { ServiceDirectionField } from './ServiceDirectionField';
|
|
29
|
+
import { SurnameField } from './SurnameField';
|
|
27
30
|
import { TermField } from './TermField';
|
|
28
31
|
import { UltraPremiumField } from './UltraPremiumField';
|
|
29
32
|
import { VedField } from './VedField';
|
|
@@ -35,28 +38,10 @@ export const getField =
|
|
|
35
38
|
const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
|
|
36
39
|
|
|
37
40
|
const InputsMap = {
|
|
38
|
-
surname:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/>
|
|
43
|
-
),
|
|
44
|
-
name: (
|
|
45
|
-
<InputControl
|
|
46
|
-
label="Имя"
|
|
47
|
-
{...getValidation(field('name'), validatorObj.name, required)}
|
|
48
|
-
{...rest}
|
|
49
|
-
/>
|
|
50
|
-
),
|
|
51
|
-
middleName: (
|
|
52
|
-
<InputControl label="Отчество (Обязательно, при наличии)" {...field('middleName')} />
|
|
53
|
-
),
|
|
54
|
-
phone: (
|
|
55
|
-
<InputPhoneControl
|
|
56
|
-
label="Телефон"
|
|
57
|
-
{...getValidation(field('phone'), validatorObj.phone, required)}
|
|
58
|
-
/>
|
|
59
|
-
),
|
|
41
|
+
surname: <SurnameField field={field} input={input} />,
|
|
42
|
+
name: <NameField field={field} input={input} />,
|
|
43
|
+
middleName: <MiddleNameField field={field} />,
|
|
44
|
+
phone: <PhoneField field={field} input={input} />,
|
|
60
45
|
email: (
|
|
61
46
|
<InputControl
|
|
62
47
|
label="Электронная почта"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type VNode } from '../../model/VNode';
|
|
3
|
+
import { style } from '../../utils/style';
|
|
4
|
+
import { Foldable } from '../Foldable/Foldable';
|
|
5
|
+
import { type FoldablePartProps } from '../Foldable/FoldablePartProps';
|
|
6
|
+
import { FoldableSection } from '../Foldable/FoldableSection';
|
|
7
|
+
import { Icon } from '../Icon/Icon';
|
|
8
|
+
import { Checkbox } from './Checkbox';
|
|
9
|
+
import { type CheckboxGroupProps } from './CheckboxProps';
|
|
10
|
+
|
|
11
|
+
export const CheckboxGroup = JSX<CheckboxGroupProps>(({ className, items = [], ...props }) => {
|
|
12
|
+
const isChecked = items.every((_) => _?.value);
|
|
13
|
+
|
|
14
|
+
const handleGeneralToggle = (value: boolean) => {
|
|
15
|
+
for (const item of items) {
|
|
16
|
+
item?.onChange && item.onChange(value);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className={style('w-full', className)}>
|
|
22
|
+
<Foldable
|
|
23
|
+
isFoldButtonOnTop
|
|
24
|
+
renderFoldableSection={({ isUnfolded }) => (
|
|
25
|
+
<FoldableSection isUnfolded={isUnfolded} className="flex flex-col gap-lg pl-2xl py-xs">
|
|
26
|
+
{items.map(Checkbox)}
|
|
27
|
+
</FoldableSection>
|
|
28
|
+
)}
|
|
29
|
+
renderFoldButton={renderGeneralCheckbox(
|
|
30
|
+
<Checkbox value={isChecked} onChange={handleGeneralToggle} {...props} />,
|
|
31
|
+
)}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const renderGeneralCheckbox =
|
|
38
|
+
(generalCheckBox: VNode) =>
|
|
39
|
+
(foldableData: FoldablePartProps): VNode =>
|
|
40
|
+
(
|
|
41
|
+
<div className="flex items-center">
|
|
42
|
+
{generalCheckBox}
|
|
43
|
+
<button onClick={foldableData.onToggle} className="p-m">
|
|
44
|
+
<Icon
|
|
45
|
+
className="text-primary-text"
|
|
46
|
+
name={foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
|
|
47
|
+
width="16"
|
|
48
|
+
height="16"
|
|
49
|
+
/>
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
@@ -6,4 +6,11 @@ export interface CheckboxProps {
|
|
|
6
6
|
isRadio?: boolean;
|
|
7
7
|
onChange?: (value: boolean) => void;
|
|
8
8
|
error?: string;
|
|
9
|
+
subItems?: CheckboxProps[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CheckboxGroupProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
items?: CheckboxProps[];
|
|
15
|
+
text?: string;
|
|
9
16
|
}
|