@itcase/forms-web 0.0.0-stage → 1.1.117
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/dist/FinalForm_CDnQeCDK.js +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/messages.constant.js +1 -0
- package/dist/css/styles/bundles.css +786 -0
- package/dist/form/Field/Before/FormFieldBefore.constants.js +1 -0
- package/dist/form/Field/Before/FormFieldBefore.js +1 -0
- package/dist/form/Field/Before/index.js +1 -0
- package/dist/form/Field/Checkbox/FormFieldCheckbox.js +1 -0
- package/dist/form/Field/Checkbox/appearance/default.js +1 -0
- package/dist/form/Field/Checkbox/index.js +1 -0
- package/dist/form/Field/Chips/FormFieldChips.js +1 -0
- package/dist/form/Field/Chips/appearance/default.js +1 -0
- package/dist/form/Field/Chips/index.js +1 -0
- package/dist/form/Field/Choice/FormFieldChoice.js +1 -0
- package/dist/form/Field/Choice/appearance/default.js +1 -0
- package/dist/form/Field/Choice/index.js +1 -0
- package/dist/form/Field/Code/FormFieldCode.js +1 -0
- package/dist/form/Field/Code/appearance/default.js +1 -0
- package/dist/form/Field/Code/index.js +1 -0
- package/dist/form/Field/ColorInput/FormFieldColorInput.js +1 -0
- package/dist/form/Field/ColorInput/appearance/default.js +1 -0
- package/dist/form/Field/ColorInput/index.js +1 -0
- package/dist/form/Field/Custom/FormFieldCustom.js +1 -0
- package/dist/form/Field/Custom/index.js +1 -0
- package/dist/form/Field/Dadata/FormFieldDadataInput.js +1 -0
- package/dist/form/Field/Dadata/appearance/default.js +1 -0
- package/dist/form/Field/Dadata/index.js +1 -0
- package/dist/form/Field/DatePicker/FormFieldDatePicker.js +1 -0
- package/dist/form/Field/DatePicker/appearance/default.js +1 -0
- package/dist/form/Field/DatePicker/index.js +1 -0
- package/dist/form/Field/FileInput/FormFieldFileInput.js +1 -0
- package/dist/form/Field/FileInput/appearance/default.js +1 -0
- package/dist/form/Field/FileInput/index.js +1 -0
- package/dist/form/Field/Group/FormGroup.js +1 -0
- package/dist/form/Field/Group/appearance/default.js +1 -0
- package/dist/form/Field/Group/index.js +1 -0
- package/dist/form/Field/Input/FormFieldInput.js +1 -0
- package/dist/form/Field/Input/appearance/default.js +1 -0
- package/dist/form/Field/Input/index.js +1 -0
- package/dist/form/Field/InputNumber/FormFieldInputNumber.js +1 -0
- package/dist/form/Field/InputNumber/appearance/default.js +1 -0
- package/dist/form/Field/InputNumber/index.js +1 -0
- package/dist/form/Field/MaskedInput/FormFieldMaskedInput.js +1 -0
- package/dist/form/Field/MaskedInput/appearance/default.js +1 -0
- package/dist/form/Field/MaskedInput/index.js +1 -0
- package/dist/form/Field/Password/FormFieldPassword.js +1 -0
- package/dist/form/Field/Password/appearance/default.js +1 -0
- package/dist/form/Field/Password/index.js +1 -0
- package/dist/form/Field/RadioGroup/FormFieldRadioGroup.js +1 -0
- package/dist/form/Field/RadioGroup/FormFieldRadioGroupList.js +1 -0
- package/dist/form/Field/RadioGroup/appearance/default.js +1 -0
- package/dist/form/Field/RadioGroup/index.js +1 -0
- package/dist/form/Field/Segmented/FormFieldSegmented.js +1 -0
- package/dist/form/Field/Segmented/appearance/default.js +1 -0
- package/dist/form/Field/Segmented/index.js +1 -0
- package/dist/form/Field/Select/FormFieldSelect.js +1 -0
- package/dist/form/Field/Select/appearance/default.js +1 -0
- package/dist/form/Field/Select/index.js +1 -0
- package/dist/form/Field/Switch/FormFieldSwitch.js +1 -0
- package/dist/form/Field/Switch/appearance/default.js +1 -0
- package/dist/form/Field/Switch/index.js +1 -0
- package/dist/form/Field/Textarea/FormFieldTextarea.js +1 -0
- package/dist/form/Field/Textarea/appearance/default.js +1 -0
- package/dist/form/Field/Textarea/index.js +1 -0
- package/dist/form/Field/index.js +1 -0
- package/dist/form/FieldWrapper/FieldWrapper.js +1 -0
- package/dist/form/FieldWrapper/appearance/default.js +1 -0
- package/dist/form/FieldWrapper/index.js +1 -0
- package/dist/form/Form/FinalForm.js +1 -0
- package/dist/form/generator/generateField.constants.js +1 -0
- package/dist/form/generator/generateField.js +1 -0
- package/dist/form/generator/generateFormButtons.js +1 -0
- package/dist/form/generator/index.js +1 -0
- package/dist/form/index.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/constants/index.d.ts +4 -0
- package/dist/types/constants/messages.constant.d.ts +75 -0
- package/dist/types/constants/messages.interface.d.ts +8 -0
- package/dist/types/form/Field/Before/FormFieldBefore.constants.d.ts +16 -0
- package/dist/types/form/Field/Before/FormFieldBefore.d.ts +3 -0
- package/dist/types/form/Field/Before/FormFieldBefore.interface.d.ts +25 -0
- package/dist/types/form/Field/Before/index.d.ts +4 -0
- package/dist/types/form/Field/Checkbox/FormFieldCheckbox.d.ts +4 -0
- package/dist/types/form/Field/Checkbox/FormFieldCheckbox.interface.d.ts +22 -0
- package/dist/types/form/Field/Checkbox/appearance/default.d.ts +3 -0
- package/dist/types/form/Field/Checkbox/index.d.ts +4 -0
- package/dist/types/form/Field/Chips/FormFieldChips.d.ts +3 -0
- package/dist/types/form/Field/Chips/FormFieldChips.interface.d.ts +28 -0
- package/dist/types/form/Field/Chips/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/Chips/index.d.ts +4 -0
- package/dist/types/form/Field/Choice/FormFieldChoice.d.ts +4 -0
- package/dist/types/form/Field/Choice/FormFieldChoice.interface.d.ts +24 -0
- package/dist/types/form/Field/Choice/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/Choice/index.d.ts +4 -0
- package/dist/types/form/Field/Code/FormFieldCode.d.ts +4 -0
- package/dist/types/form/Field/Code/FormFieldCode.interface.d.ts +20 -0
- package/dist/types/form/Field/Code/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/Code/index.d.ts +4 -0
- package/dist/types/form/Field/ColorInput/FormFieldColorInput.d.ts +4 -0
- package/dist/types/form/Field/ColorInput/FormFieldColorInput.interface.d.ts +20 -0
- package/dist/types/form/Field/ColorInput/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/ColorInput/index.d.ts +4 -0
- package/dist/types/form/Field/Custom/FormFieldCustom.d.ts +4 -0
- package/dist/types/form/Field/Custom/FormFieldCustom.interface.d.ts +19 -0
- package/dist/types/form/Field/Custom/index.d.ts +4 -0
- package/dist/types/form/Field/Dadata/FormFieldDadataInput.d.ts +4 -0
- package/dist/types/form/Field/Dadata/FormFieldDadataInput.interface.d.ts +21 -0
- package/dist/types/form/Field/Dadata/appearance/default.d.ts +3 -0
- package/dist/types/form/Field/Dadata/index.d.ts +4 -0
- package/dist/types/form/Field/DatePicker/FormFieldDatePicker.d.ts +3 -0
- package/dist/types/form/Field/DatePicker/FormFieldDatePicker.interface.d.ts +20 -0
- package/dist/types/form/Field/DatePicker/appearance/default.d.ts +15 -0
- package/dist/types/form/Field/DatePicker/index.d.ts +4 -0
- package/dist/types/form/Field/FileInput/FormFieldFileInput.d.ts +4 -0
- package/dist/types/form/Field/FileInput/FormFieldFileInput.interface.d.ts +20 -0
- package/dist/types/form/Field/FileInput/appearance/default.d.ts +3 -0
- package/dist/types/form/Field/FileInput/index.d.ts +4 -0
- package/dist/types/form/Field/Group/FormGroup.d.ts +4 -0
- package/dist/types/form/Field/Group/FormGroup.interface.d.ts +53 -0
- package/dist/types/form/Field/Group/appearance/default.d.ts +3 -0
- package/dist/types/form/Field/Group/index.d.ts +5 -0
- package/dist/types/form/Field/Input/FormFieldInput.d.ts +4 -0
- package/dist/types/form/Field/Input/FormFieldInput.interface.d.ts +28 -0
- package/dist/types/form/Field/Input/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/Input/index.d.ts +4 -0
- package/dist/types/form/Field/InputNumber/FormFieldInputNumber.d.ts +4 -0
- package/dist/types/form/Field/InputNumber/FormFieldInputNumber.interface.d.ts +22 -0
- package/dist/types/form/Field/InputNumber/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/InputNumber/index.d.ts +4 -0
- package/dist/types/form/Field/MaskedInput/FormFieldMaskedInput.d.ts +4 -0
- package/dist/types/form/Field/MaskedInput/FormFieldMaskedInput.interface.d.ts +30 -0
- package/dist/types/form/Field/MaskedInput/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/MaskedInput/index.d.ts +4 -0
- package/dist/types/form/Field/Password/FormFieldPassword.d.ts +4 -0
- package/dist/types/form/Field/Password/FormFieldPassword.interface.d.ts +20 -0
- package/dist/types/form/Field/Password/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/Password/index.d.ts +4 -0
- package/dist/types/form/Field/RadioGroup/FormFieldRadioGroup.d.ts +4 -0
- package/dist/types/form/Field/RadioGroup/FormFieldRadioGroup.interface.d.ts +31 -0
- package/dist/types/form/Field/RadioGroup/FormFieldRadioGroupList.d.ts +4 -0
- package/dist/types/form/Field/RadioGroup/appearance/default.d.ts +3 -0
- package/dist/types/form/Field/RadioGroup/index.d.ts +4 -0
- package/dist/types/form/Field/Segmented/FormFieldSegmented.d.ts +3 -0
- package/dist/types/form/Field/Segmented/FormFieldSegmented.interface.d.ts +20 -0
- package/dist/types/form/Field/Segmented/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/Segmented/index.d.ts +4 -0
- package/dist/types/form/Field/Select/FormFieldSelect.d.ts +4 -0
- package/dist/types/form/Field/Select/FormFieldSelect.interface.d.ts +38 -0
- package/dist/types/form/Field/Select/appearance/default.d.ts +4 -0
- package/dist/types/form/Field/Select/index.d.ts +4 -0
- package/dist/types/form/Field/Switch/FormFieldSwitch.d.ts +5 -0
- package/dist/types/form/Field/Switch/FormFieldSwitch.interface.d.ts +20 -0
- package/dist/types/form/Field/Switch/appearance/default.d.ts +3 -0
- package/dist/types/form/Field/Switch/index.d.ts +4 -0
- package/dist/types/form/Field/Textarea/FormFieldTextarea.d.ts +4 -0
- package/dist/types/form/Field/Textarea/FormFieldTextarea.interface.d.ts +18 -0
- package/dist/types/form/Field/Textarea/appearance/default.d.ts +3 -0
- package/dist/types/form/Field/Textarea/index.d.ts +4 -0
- package/dist/types/form/Field/index.d.ts +42 -0
- package/dist/types/form/FieldWrapper/FieldWrapper.d.ts +4 -0
- package/dist/types/form/FieldWrapper/FieldWrapper.interface.d.ts +90 -0
- package/dist/types/form/FieldWrapper/appearance/default.d.ts +7 -0
- package/dist/types/form/FieldWrapper/index.d.ts +5 -0
- package/dist/types/form/Form/FinalForm.d.ts +5 -0
- package/dist/types/form/Form/FinalForm.interface.d.ts +112 -0
- package/dist/types/form/generator/generateField.constants.d.ts +23 -0
- package/dist/types/form/generator/generateField.d.ts +3 -0
- package/dist/types/form/generator/generateField.interface.d.ts +45 -0
- package/dist/types/form/generator/generateFormButtons.d.ts +3 -0
- package/dist/types/form/generator/index.d.ts +3 -0
- package/dist/types/form/index.d.ts +4 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +79 -4
- package/README.md +0 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CompositeAppearanceStateDefault } from '@itcase/types-ui';
|
|
2
|
+
import type { InputPasswordProps } from '@itcase/ui-web/components/InputPassword';
|
|
3
|
+
import type { BaseField, FormTypes } from 'src/form';
|
|
4
|
+
type PasswordInputProps = Partial<DefaultPasswordProps & InputPasswordProps>;
|
|
5
|
+
type PasswordField = Omit<BaseField, 'inputProps'> & {
|
|
6
|
+
inputProps: PasswordInputProps;
|
|
7
|
+
type: Extract<FormTypes, 'password'>;
|
|
8
|
+
};
|
|
9
|
+
type FormFieldPasswordProps = PasswordField & {
|
|
10
|
+
initialValue?: string;
|
|
11
|
+
onChange?: (value: string, name: string) => void;
|
|
12
|
+
parse?: (value: string, name: string) => string;
|
|
13
|
+
};
|
|
14
|
+
type DefaultPasswordProps = {
|
|
15
|
+
appearance: CompositeAppearanceStateDefault;
|
|
16
|
+
errorAppearance: CompositeAppearanceStateDefault;
|
|
17
|
+
requiredAppearance: CompositeAppearanceStateDefault;
|
|
18
|
+
successAppearance: CompositeAppearanceStateDefault;
|
|
19
|
+
};
|
|
20
|
+
export type { DefaultPasswordProps, FormFieldPasswordProps, PasswordField, PasswordInputProps, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultPasswordProps, defaultPasswordPropsSizeXL } from './appearance/default';
|
|
2
|
+
import { FormFieldPassword } from './FormFieldPassword';
|
|
3
|
+
export { defaultPasswordProps, defaultPasswordPropsSizeXL, FormFieldPassword };
|
|
4
|
+
export type { DefaultPasswordProps, FormFieldPasswordProps, PasswordField, PasswordInputProps, } from './FormFieldPassword.interface';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FieldInputProps } from 'react-final-form';
|
|
2
|
+
import { Option } from '@itcase/types-core';
|
|
3
|
+
import { CompositeAppearanceStateDefault } from '@itcase/types-ui';
|
|
4
|
+
import type { RadioProps } from '@itcase/ui-web/components/Radio';
|
|
5
|
+
import type { BaseField, FormTypes } from 'src/form';
|
|
6
|
+
type RadioGroupInputProps = Partial<DefaultRadioProps & RadioProps>;
|
|
7
|
+
type RadioGroupField = Omit<BaseField, 'inputProps'> & {
|
|
8
|
+
inputProps: RadioGroupInputProps;
|
|
9
|
+
onChange: (value: string, name: string) => void;
|
|
10
|
+
options: (Option & {
|
|
11
|
+
desc?: string;
|
|
12
|
+
})[];
|
|
13
|
+
type: Extract<FormTypes, 'radioGroup'>;
|
|
14
|
+
};
|
|
15
|
+
type FormFieldRadioGroupProps = RadioGroupField & {
|
|
16
|
+
initialValue?: string;
|
|
17
|
+
};
|
|
18
|
+
type FormFieldRadioGroupListProps = {
|
|
19
|
+
input: FieldInputProps<unknown>;
|
|
20
|
+
inputProps: FormFieldRadioGroupProps['inputProps'];
|
|
21
|
+
isDisabled?: boolean;
|
|
22
|
+
onChange?: FormFieldRadioGroupProps['onChange'];
|
|
23
|
+
options?: FormFieldRadioGroupProps['options'];
|
|
24
|
+
};
|
|
25
|
+
type DefaultRadioProps = {
|
|
26
|
+
appearance: CompositeAppearanceStateDefault;
|
|
27
|
+
errorAppearance: CompositeAppearanceStateDefault;
|
|
28
|
+
requiredAppearance: CompositeAppearanceStateDefault;
|
|
29
|
+
successAppearance: CompositeAppearanceStateDefault;
|
|
30
|
+
};
|
|
31
|
+
export type { DefaultRadioProps, FormFieldRadioGroupListProps, FormFieldRadioGroupProps, RadioGroupField, RadioGroupInputProps, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultRadioProps } from './appearance/default';
|
|
2
|
+
import { FormFieldRadioGroup } from './FormFieldRadioGroup';
|
|
3
|
+
export { defaultRadioProps, FormFieldRadioGroup };
|
|
4
|
+
export type { DefaultRadioProps, FormFieldRadioGroupListProps, FormFieldRadioGroupProps, RadioGroupField, RadioGroupInputProps, } from './FormFieldRadioGroup.interface';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CompositeAppearanceStateDefault, WidthProps } from '@itcase/types-ui';
|
|
2
|
+
import { Segment, SegmentedProps } from '@itcase/ui-web/components/Segmented';
|
|
3
|
+
import type { BaseField, FormTypes } from 'src/form';
|
|
4
|
+
type SegmentedInputProps = Partial<DefaultSegmentedProps & SegmentedProps>;
|
|
5
|
+
type SegmentedField = Omit<BaseField, 'inputProps'> & {
|
|
6
|
+
inputProps: SegmentedInputProps;
|
|
7
|
+
options: Segment[];
|
|
8
|
+
type: Extract<FormTypes, 'segmented'>;
|
|
9
|
+
};
|
|
10
|
+
type FormFieldSegmentedProps = SegmentedField & {
|
|
11
|
+
initialValue?: string;
|
|
12
|
+
};
|
|
13
|
+
type DefaultSegmentedProps = {
|
|
14
|
+
appearance: CompositeAppearanceStateDefault;
|
|
15
|
+
errorAppearance: CompositeAppearanceStateDefault;
|
|
16
|
+
requiredAppearance: CompositeAppearanceStateDefault;
|
|
17
|
+
successAppearance: CompositeAppearanceStateDefault;
|
|
18
|
+
width: WidthProps;
|
|
19
|
+
};
|
|
20
|
+
export type { DefaultSegmentedProps, FormFieldSegmentedProps, SegmentedField, SegmentedInputProps, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultSegmentedProps, defaultSegmentedPropsSizeL } from './appearance/default';
|
|
2
|
+
import { FormFieldSegmented } from './FormFieldSegmented';
|
|
3
|
+
export { defaultSegmentedProps, defaultSegmentedPropsSizeL, FormFieldSegmented };
|
|
4
|
+
export type { DefaultSegmentedProps, FormFieldSegmentedProps, SegmentedField, SegmentedInputProps, } from './FormFieldSegmented.interface';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { FieldRenderProps } from 'react-final-form';
|
|
2
|
+
import { SelectInstance } from 'react-select';
|
|
3
|
+
import { Option } from '@itcase/types-core';
|
|
4
|
+
import { CompositeAppearanceStateDefault } from '@itcase/types-ui';
|
|
5
|
+
import { SelectProps } from '@itcase/ui-web/components/Select';
|
|
6
|
+
import type { BaseField, FormTypes } from 'src/form';
|
|
7
|
+
type SelectChangeValue = Array<Option['value']> | Option['value'] | null;
|
|
8
|
+
interface SelectChangeMeta {
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
type SelectFieldOnChange = (value: SelectChangeValue, meta: SelectChangeMeta) => void;
|
|
12
|
+
type SelectInputProps = Partial<DefaultSelectProps> & Partial<SelectProps<Option>>;
|
|
13
|
+
type SelectField = Omit<BaseField, 'inputProps'> & {
|
|
14
|
+
onChange: SelectFieldOnChange;
|
|
15
|
+
options: Option[];
|
|
16
|
+
selectProps: SelectInputProps;
|
|
17
|
+
type: Extract<FormTypes, 'select'>;
|
|
18
|
+
};
|
|
19
|
+
type FormFieldSelectProps = SelectField & {
|
|
20
|
+
initialValue?: object;
|
|
21
|
+
onInputChange?: SelectProps<Option>['onInputChange'];
|
|
22
|
+
selectRef?: React.ForwardedRef<SelectInstance<Option>>;
|
|
23
|
+
};
|
|
24
|
+
type OptionValue = number | string;
|
|
25
|
+
type GetDefaultValueParams = {
|
|
26
|
+
options: Array<Option & {
|
|
27
|
+
options?: Option[];
|
|
28
|
+
}>;
|
|
29
|
+
selectValue: OptionValue | OptionValue[];
|
|
30
|
+
};
|
|
31
|
+
type SelectFieldRenderProps = FieldRenderProps<string | string[]>;
|
|
32
|
+
type DefaultSelectProps = {
|
|
33
|
+
appearance: CompositeAppearanceStateDefault;
|
|
34
|
+
errorAppearance: CompositeAppearanceStateDefault;
|
|
35
|
+
requiredAppearance: CompositeAppearanceStateDefault;
|
|
36
|
+
successAppearance: CompositeAppearanceStateDefault;
|
|
37
|
+
};
|
|
38
|
+
export type { DefaultSelectProps, FormFieldSelectProps, GetDefaultValueParams, SelectChangeValue, SelectField, SelectFieldOnChange, SelectFieldRenderProps, SelectInputProps, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultSelectProps, defaultSelectPropsSizeXL } from './appearance/default';
|
|
2
|
+
import { FormFieldSelect } from './FormFieldSelect';
|
|
3
|
+
export { defaultSelectProps, defaultSelectPropsSizeXL, FormFieldSelect };
|
|
4
|
+
export type { DefaultSelectProps, FormFieldSelectProps, GetDefaultValueParams, SelectField, SelectFieldRenderProps, SelectInputProps, } from './FormFieldSelect.interface';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { defaultSwitchProps } from './appearance/default';
|
|
3
|
+
import { FormFieldSwitchProps } from './FormFieldSwitch.interface';
|
|
4
|
+
declare const FormFieldSwitch: React.MemoExoticComponent<(props: FormFieldSwitchProps) => React.JSX.Element>;
|
|
5
|
+
export { defaultSwitchProps, FormFieldSwitch };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CompositeAppearanceStateDefault } from '@itcase/types-ui';
|
|
2
|
+
import type { SwitchProps } from '@itcase/ui-web/components/Switch';
|
|
3
|
+
import type { BaseField, FormTypes } from 'src/form';
|
|
4
|
+
type SwitchInputProps = Partial<DefaultSwitchProps & SwitchProps>;
|
|
5
|
+
type SwitchField = Omit<BaseField, 'inputProps'> & {
|
|
6
|
+
inputProps: SwitchInputProps;
|
|
7
|
+
type: Extract<FormTypes, 'switch'>;
|
|
8
|
+
};
|
|
9
|
+
type FormFieldSwitchProps = SwitchField & {
|
|
10
|
+
initialValue?: boolean;
|
|
11
|
+
name: string;
|
|
12
|
+
onChange?: (isChecked: boolean, name: string) => void;
|
|
13
|
+
};
|
|
14
|
+
type DefaultSwitchProps = {
|
|
15
|
+
appearance: CompositeAppearanceStateDefault;
|
|
16
|
+
errorAppearance: CompositeAppearanceStateDefault;
|
|
17
|
+
requiredAppearance: CompositeAppearanceStateDefault;
|
|
18
|
+
successAppearance: CompositeAppearanceStateDefault;
|
|
19
|
+
};
|
|
20
|
+
export type { DefaultSwitchProps, FormFieldSwitchProps, SwitchField, SwitchInputProps, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultSwitchProps } from './appearance/default';
|
|
2
|
+
import { FormFieldSwitch } from './FormFieldSwitch';
|
|
3
|
+
export { defaultSwitchProps, FormFieldSwitch };
|
|
4
|
+
export type { DefaultSwitchProps, FormFieldSwitchProps, SwitchField, SwitchInputProps, } from './FormFieldSwitch.interface';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CompositeAppearanceStateDefault } from '@itcase/types-ui';
|
|
2
|
+
import type { TextareaProps } from '@itcase/ui-web/components/Textarea';
|
|
3
|
+
import type { BaseField, FormTypes } from 'src/form';
|
|
4
|
+
type TextareaInputProps = Partial<DefaultTextareaProps> & Partial<TextareaProps>;
|
|
5
|
+
type TextareaField = Omit<BaseField, 'inputProps'> & {
|
|
6
|
+
inputProps: TextareaInputProps;
|
|
7
|
+
type: Extract<FormTypes, 'textarea'>;
|
|
8
|
+
};
|
|
9
|
+
type FormFieldTextareaProps = TextareaField & {
|
|
10
|
+
initialValue?: string;
|
|
11
|
+
};
|
|
12
|
+
type DefaultTextareaProps = {
|
|
13
|
+
appearance: CompositeAppearanceStateDefault;
|
|
14
|
+
errorAppearance: CompositeAppearanceStateDefault;
|
|
15
|
+
requiredAppearance: CompositeAppearanceStateDefault;
|
|
16
|
+
successAppearance: CompositeAppearanceStateDefault;
|
|
17
|
+
};
|
|
18
|
+
export type { DefaultTextareaProps, FormFieldTextareaProps, TextareaField, TextareaInputProps, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultTextareaProps } from './appearance/default';
|
|
2
|
+
import { FormFieldTextarea } from './FormFieldTextarea';
|
|
3
|
+
export { defaultTextareaProps, FormFieldTextarea };
|
|
4
|
+
export type { DefaultTextareaProps, FormFieldTextareaProps, TextareaField, TextareaInputProps, } from './FormFieldTextarea.interface';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Field } from 'react-final-form';
|
|
2
|
+
export { Field };
|
|
3
|
+
export { FormFieldBefore } from './Before';
|
|
4
|
+
export type { FormFieldBeforeProps, FormFieldBeforeType } from './Before';
|
|
5
|
+
export { defaultCheckboxProps, FormFieldCheckbox } from './Checkbox';
|
|
6
|
+
export type { CheckboxField, CheckboxInputProps, DefaultCheckboxProps, FormFieldCheckboxProps, } from './Checkbox';
|
|
7
|
+
export { defaultChipsProps, defaultChipsPropsSizeXL, FormFieldChips, } from './Chips';
|
|
8
|
+
export type { ChipsField, ChipsInputProps, DefaultChipsProps, FormFieldChipsProps, } from './Chips';
|
|
9
|
+
export { defaultChoiceProps, defaultChoicePropsSizeL, FormFieldChoice, } from './Choice';
|
|
10
|
+
export type { ChoiceField, ChoiceInputProps, DefaultChoiceProps, FormFieldChoiceProps, } from './Choice';
|
|
11
|
+
export { defaultCodeProps, defaultCodePropsSizeL, FormFieldCode } from './Code';
|
|
12
|
+
export type { CodeField, CodeInputProps, DefaultCodeProps, FormFieldCodeProps, } from './Code';
|
|
13
|
+
export { defaultColorInputProps, defaultColorInputPropsSizeXL, FormFieldColorInput, } from './ColorInput';
|
|
14
|
+
export type { ColorInputColorInputProps, ColorInputField, DefaultColorInputProps, FormFieldColorInputProps, } from './ColorInput';
|
|
15
|
+
export { FormFieldCustom } from './Custom';
|
|
16
|
+
export type { CustomField, FormFieldCustomProps } from './Custom';
|
|
17
|
+
export { defaultDadataInputProps, FormFieldDadataInput } from './Dadata';
|
|
18
|
+
export type { DadataField, DadataInputProps, DefaultDadataProps, FormFieldDadataInputProps, } from './Dadata';
|
|
19
|
+
export { defaultDatepickerInputProps, defaultDatepickerProps, FormFieldDatePicker, } from './DatePicker';
|
|
20
|
+
export type { DatePickerField, DatePickerFieldInputProps, DefaultDatepickerInputProps, FormFieldDatePickerProps, } from './DatePicker';
|
|
21
|
+
export { defaultDropzoneProps, FormFieldFileInput } from './FileInput';
|
|
22
|
+
export type { FileInputField, FormFieldFileInputProps } from './FileInput';
|
|
23
|
+
export { defaultGroupProps, FormGroup } from './Group';
|
|
24
|
+
export type { DefaultAppearanceProps, FormGroupProps, GroupField, } from './Group';
|
|
25
|
+
export { defaultInputProps, defaultInputPropsSizeXL, FormFieldInput, } from './Input';
|
|
26
|
+
export type { DefaultInputProps, FormFieldInputProps, InputField, InputInputProps, } from './Input';
|
|
27
|
+
export { defaultInputNumberProps, defaultInputNumberPropsSizeXL, FormFieldInputNumber, } from './InputNumber';
|
|
28
|
+
export type { DefaultInputNumberProps, FormFieldInputNumberProps, InputNumberField, InputNumberInputProps, } from './InputNumber';
|
|
29
|
+
export { defaultMaskedInputProps, defaultMaskedInputPropsSizeXL, FormFieldMaskedInput, } from './MaskedInput';
|
|
30
|
+
export type { DefaultMaskedInputProps, FormFieldMaskedInputProps, MaskedInputField, MaskedInputInputProps, } from './MaskedInput';
|
|
31
|
+
export { defaultPasswordProps, defaultPasswordPropsSizeXL, FormFieldPassword, } from './Password';
|
|
32
|
+
export type { DefaultPasswordProps, FormFieldPasswordProps, PasswordField, PasswordInputProps, } from './Password';
|
|
33
|
+
export { defaultRadioProps, FormFieldRadioGroup } from './RadioGroup';
|
|
34
|
+
export type { DefaultRadioProps, FormFieldRadioGroupListProps, FormFieldRadioGroupProps, RadioGroupField, RadioGroupInputProps, } from './RadioGroup';
|
|
35
|
+
export { defaultSegmentedProps, defaultSegmentedPropsSizeL, FormFieldSegmented, } from './Segmented';
|
|
36
|
+
export type { DefaultSegmentedProps, FormFieldSegmentedProps, SegmentedField, SegmentedInputProps, } from './Segmented';
|
|
37
|
+
export { defaultSelectProps, defaultSelectPropsSizeXL, FormFieldSelect, } from './Select';
|
|
38
|
+
export type { DefaultSelectProps, FormFieldSelectProps, GetDefaultValueParams, SelectField, SelectFieldRenderProps, SelectInputProps, } from './Select';
|
|
39
|
+
export { defaultSwitchProps, FormFieldSwitch } from './Switch';
|
|
40
|
+
export type { DefaultSwitchProps, FormFieldSwitchProps, SwitchField, SwitchInputProps, } from './Switch';
|
|
41
|
+
export { defaultTextareaProps, FormFieldTextarea } from './Textarea';
|
|
42
|
+
export type { DefaultTextareaProps, FormFieldTextareaProps, TextareaField, TextareaInputProps, } from './Textarea';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FieldWrapperBaseProps, FieldWrapperProps } from './FieldWrapper.interface';
|
|
2
|
+
declare function FieldWrapperBase(props: FieldWrapperBaseProps): import("react").JSX.Element;
|
|
3
|
+
declare function FieldWrapper(props: FieldWrapperProps): import("react").JSX.Element;
|
|
4
|
+
export { FieldWrapper, FieldWrapperBase };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DirectionProps, FillProps, ShapeProps, WidthProps } from '@itcase/types-ui';
|
|
3
|
+
import type { DividerProps } from '@itcase/ui-web/components/Divider';
|
|
4
|
+
import type { TextProps } from '@itcase/ui-web/components/Text';
|
|
5
|
+
import type { FormTypes } from 'src/form';
|
|
6
|
+
type FieldWrapperProps = FieldWrapperBaseProps & {
|
|
7
|
+
inputName: string;
|
|
8
|
+
};
|
|
9
|
+
interface FieldWrapperBaseProps {
|
|
10
|
+
id?: string;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
isErrorState?: boolean;
|
|
13
|
+
isHidden?: boolean;
|
|
14
|
+
isRequired?: boolean;
|
|
15
|
+
isValidState?: boolean;
|
|
16
|
+
after?: ReactNode;
|
|
17
|
+
afterItem?: ReactNode;
|
|
18
|
+
before?: ReactNode;
|
|
19
|
+
beforeItem?: ReactNode;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
dataTestId?: string;
|
|
23
|
+
desc?: string;
|
|
24
|
+
descTextColor?: TextProps['textColor'];
|
|
25
|
+
descTextSize?: TextProps['size'];
|
|
26
|
+
descTextWeight?: TextProps['textWeight'];
|
|
27
|
+
direction?: DirectionProps;
|
|
28
|
+
dividerDirection?: DividerProps['direction'];
|
|
29
|
+
dividerFill?: DividerProps['fill'];
|
|
30
|
+
dividerSize?: DividerProps['size'];
|
|
31
|
+
dividerWidth?: DividerProps['width'];
|
|
32
|
+
errorKey?: 'error' | 'required';
|
|
33
|
+
errorMessage?: string;
|
|
34
|
+
errorMessageTextColor?: TextProps['textColor'];
|
|
35
|
+
errorMessageTextSize?: TextProps['size'];
|
|
36
|
+
errorMessageTextWeight?: TextProps['textWeight'];
|
|
37
|
+
fieldClassName?: string;
|
|
38
|
+
fill?: FillProps;
|
|
39
|
+
helpText?: string;
|
|
40
|
+
helpTextColor?: TextProps['textColor'];
|
|
41
|
+
helpTextColorSuccess?: TextProps['textColor'];
|
|
42
|
+
helpTextSize?: TextProps['size'];
|
|
43
|
+
helpTextSizeMobile?: TextProps['size'];
|
|
44
|
+
helpTextWeight?: TextProps['textWeight'];
|
|
45
|
+
inputFill?: FillProps;
|
|
46
|
+
inputName?: string;
|
|
47
|
+
inputShape?: ShapeProps;
|
|
48
|
+
inputValue?: boolean | object | string;
|
|
49
|
+
label?: string;
|
|
50
|
+
labelHidden?: string;
|
|
51
|
+
labelTextColor?: TextProps['textColor'];
|
|
52
|
+
labelTextSize?: TextProps['size'];
|
|
53
|
+
labelTextWeight?: TextProps['textWeight'];
|
|
54
|
+
messageTextSize?: TextProps['size'];
|
|
55
|
+
metaActive?: boolean;
|
|
56
|
+
metaError?: boolean;
|
|
57
|
+
requiredMessageTextColor?: TextProps['textColor'];
|
|
58
|
+
requiredMessageTextSize?: TextProps['size'];
|
|
59
|
+
requiredMessageTextWeight?: TextProps['textWeight'];
|
|
60
|
+
shape?: ShapeProps;
|
|
61
|
+
showDivider?: boolean;
|
|
62
|
+
showMessage?: boolean;
|
|
63
|
+
size?: TextProps['size'];
|
|
64
|
+
tag?: 'div' | 'label';
|
|
65
|
+
type?: FormTypes;
|
|
66
|
+
width?: WidthProps;
|
|
67
|
+
}
|
|
68
|
+
interface FieldBaseProps {
|
|
69
|
+
descTextColor?: TextProps['textColor'];
|
|
70
|
+
descTextSize?: TextProps['size'];
|
|
71
|
+
direction?: DirectionProps;
|
|
72
|
+
dividerFill?: DividerProps['fill'];
|
|
73
|
+
errorMessageTextColor?: TextProps['textColor'];
|
|
74
|
+
helpTextColor?: TextProps['textColor'];
|
|
75
|
+
labelTextColor?: TextProps['textColor'];
|
|
76
|
+
messageTextColor?: TextProps['textColor'];
|
|
77
|
+
requiredMessageTextColor?: TextProps['textColor'];
|
|
78
|
+
showMessage?: boolean;
|
|
79
|
+
width?: WidthProps;
|
|
80
|
+
}
|
|
81
|
+
type FieldProps = FieldBaseProps & FieldWrapperBaseProps & {
|
|
82
|
+
errorMessageTextSize?: TextProps['size'];
|
|
83
|
+
requiredMessageTextSize?: TextProps['size'];
|
|
84
|
+
};
|
|
85
|
+
type FieldWrapperUnmountFormState = {
|
|
86
|
+
lastSubmittedValues?: object;
|
|
87
|
+
submitError?: string;
|
|
88
|
+
submitting: boolean;
|
|
89
|
+
};
|
|
90
|
+
export type { FieldBaseProps, FieldProps, FieldWrapperBaseProps, FieldWrapperProps, FieldWrapperUnmountFormState, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FieldBaseProps, FieldProps } from '../FieldWrapper.interface';
|
|
2
|
+
declare const defaultFieldProps: FieldBaseProps;
|
|
3
|
+
declare const defaultFieldSizeS: FieldProps;
|
|
4
|
+
declare const defaultFieldSizeM: FieldProps;
|
|
5
|
+
declare const defaultFieldSizeL: FieldProps;
|
|
6
|
+
declare const defaultFieldSizeXL: FieldProps;
|
|
7
|
+
export { defaultFieldProps, defaultFieldSizeL, defaultFieldSizeM, defaultFieldSizeS, defaultFieldSizeXL, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { defaultFieldProps, defaultFieldSizeL, defaultFieldSizeM, defaultFieldSizeS, defaultFieldSizeXL } from './appearance/default';
|
|
2
|
+
import { FieldWrapper, FieldWrapperBase } from './FieldWrapper';
|
|
3
|
+
import type { FieldProps, FieldWrapperProps } from './FieldWrapper.interface';
|
|
4
|
+
export { defaultFieldProps, defaultFieldSizeL, defaultFieldSizeM, defaultFieldSizeS, defaultFieldSizeXL, FieldWrapper, FieldWrapperBase, };
|
|
5
|
+
export type { FieldProps, FieldWrapperProps };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Config } from 'final-form';
|
|
2
|
+
import type { FormProps, UseFormStateParams } from 'react-final-form';
|
|
3
|
+
import type { ObjectSchema } from 'yup';
|
|
4
|
+
import type { FormConfig } from '@itcase/forms-core';
|
|
5
|
+
import { DirectionProps, ElevationProps, FillProps, HeightProps, JustifyContentProps, ShapeProps, WidthProps } from '@itcase/types-ui';
|
|
6
|
+
import { ButtonProps } from '@itcase/ui-web/components/Button';
|
|
7
|
+
import { GroupProps } from '@itcase/ui-web/components/Group';
|
|
8
|
+
import { LoaderProps } from '@itcase/ui-web/components/Loader';
|
|
9
|
+
import { NotificationProps } from '@itcase/ui-web/components/Notification';
|
|
10
|
+
import { TextProps } from '@itcase/ui-web/components/Text';
|
|
11
|
+
import { TitleProps } from '@itcase/ui-web/components/Title';
|
|
12
|
+
import type { ButtonFields, GeneratorField } from 'src/form';
|
|
13
|
+
interface FinalFormAppearanceProps {
|
|
14
|
+
buttonDirection?: DirectionProps;
|
|
15
|
+
buttonFill?: FillProps;
|
|
16
|
+
buttonGap?: string;
|
|
17
|
+
buttonJustifyContent?: JustifyContentProps;
|
|
18
|
+
buttonPadding?: string;
|
|
19
|
+
buttonPosition?: 'bottom' | 'sticky';
|
|
20
|
+
descSize?: TextProps['size'];
|
|
21
|
+
descTextColor?: TextProps['textColor'];
|
|
22
|
+
descTextWeight?: TextProps['textWeight'];
|
|
23
|
+
direction?: DirectionProps;
|
|
24
|
+
elevation?: ElevationProps;
|
|
25
|
+
fill?: FillProps;
|
|
26
|
+
height?: HeightProps;
|
|
27
|
+
loader?: React.ReactNode;
|
|
28
|
+
maxWidth?: WidthProps;
|
|
29
|
+
primaryButtonAppearance?: ButtonProps['appearance'];
|
|
30
|
+
primaryButtonFill?: ButtonProps['fill'];
|
|
31
|
+
primaryButtonFillHover?: ButtonProps['fillHover'];
|
|
32
|
+
primaryButtonHtmlType?: ButtonProps['htmlType'];
|
|
33
|
+
primaryButtonIsDisabled?: ButtonProps['isDisabled'];
|
|
34
|
+
primaryButtonIsLoading?: ButtonProps['isLoading'];
|
|
35
|
+
primaryButtonLabel?: ButtonProps['label'];
|
|
36
|
+
primaryButtonLabelSize?: ButtonProps['labelTextSize'];
|
|
37
|
+
primaryButtonLabelTextColor?: ButtonProps['labelTextColor'];
|
|
38
|
+
primaryButtonLabelTextWeight?: ButtonProps['labelTextWeight'];
|
|
39
|
+
primaryButtonSize?: ButtonProps['size'];
|
|
40
|
+
primarySecondaryHtmlType?: ButtonProps['htmlType'];
|
|
41
|
+
secondaryButtonAppearance?: ButtonProps['appearance'];
|
|
42
|
+
secondaryButtonFill?: ButtonProps['fill'];
|
|
43
|
+
secondaryButtonFillHover?: ButtonProps['fillHover'];
|
|
44
|
+
secondaryButtonIsDisabled?: ButtonProps['isDisabled'];
|
|
45
|
+
secondaryButtonIsLoading?: ButtonProps['isLoading'];
|
|
46
|
+
secondaryButtonLabel?: ButtonProps['label'];
|
|
47
|
+
secondaryButtonLabelSize?: ButtonProps['labelTextSize'];
|
|
48
|
+
secondaryButtonLabelTextColor?: ButtonProps['labelTextColor'];
|
|
49
|
+
secondaryButtonLabelTextWeight?: ButtonProps['labelTextWeight'];
|
|
50
|
+
secondaryButtonSize?: ButtonProps['size'];
|
|
51
|
+
shape?: ShapeProps;
|
|
52
|
+
shapeStrength?: ShapeProps;
|
|
53
|
+
titleFill?: TitleProps['fill'];
|
|
54
|
+
titlePosition?: TitleProps['position'];
|
|
55
|
+
titleTextColor?: TitleProps['textColor'];
|
|
56
|
+
titleTextSize?: TitleProps['size'];
|
|
57
|
+
titleTextWeight?: TitleProps['textWeight'];
|
|
58
|
+
width?: WidthProps;
|
|
59
|
+
}
|
|
60
|
+
interface FinalFormProps extends FinalFormAppearanceProps {
|
|
61
|
+
isLoading?: boolean;
|
|
62
|
+
onChangeFormValues?: UseFormStateParams['onChange'];
|
|
63
|
+
onClickSecondaryButton?: ButtonProps['onClick'];
|
|
64
|
+
onClickTertiaryButton?: ButtonProps['onClick'];
|
|
65
|
+
onSubmit: Config['onSubmit'];
|
|
66
|
+
after?: React.ReactNode;
|
|
67
|
+
before?: React.ReactNode;
|
|
68
|
+
className?: string;
|
|
69
|
+
config: FormConfig<ButtonFields, GeneratorField>;
|
|
70
|
+
dataTestId?: string;
|
|
71
|
+
dataTestIdButtons?: string;
|
|
72
|
+
dataTestIdPrimaryButton?: string;
|
|
73
|
+
dataTestIdSecondaryButton?: string;
|
|
74
|
+
dataTestIdTertiaryButton?: string;
|
|
75
|
+
desc?: string;
|
|
76
|
+
disableFieldsAutoComplete?: boolean;
|
|
77
|
+
groupGap?: GroupProps['gap'];
|
|
78
|
+
initialValues: FormProps['initialValues'];
|
|
79
|
+
initialValuesEqual?: FormProps['initialValuesEqual'];
|
|
80
|
+
language?: string;
|
|
81
|
+
loaderAppearance?: LoaderProps['appearance'];
|
|
82
|
+
loaderFill?: LoaderProps['fill'];
|
|
83
|
+
loaderItemFill?: LoaderProps['itemFill'];
|
|
84
|
+
loaderShape?: LoaderProps['shape'];
|
|
85
|
+
loaderSize?: LoaderProps['size'];
|
|
86
|
+
loaderText?: LoaderProps['text'];
|
|
87
|
+
loaderType?: LoaderProps['type'];
|
|
88
|
+
mutators?: Config['mutators'];
|
|
89
|
+
notificationCloseButton?: NotificationProps['closeIcon'];
|
|
90
|
+
notificationTestAlign?: NotificationProps['textAlign'];
|
|
91
|
+
notificationType?: NotificationProps['type'];
|
|
92
|
+
primaryButton?: ButtonProps['children'];
|
|
93
|
+
renderFieldsWrapper?: (children: React.ReactNode) => React.ReactNode;
|
|
94
|
+
secondaryButton?: ButtonProps['children'];
|
|
95
|
+
secondaryButtonHtmlType?: ButtonProps['htmlType'];
|
|
96
|
+
tertiaryButton?: ButtonProps['children'];
|
|
97
|
+
tertiaryButtonAppearance?: ButtonProps['appearance'];
|
|
98
|
+
tertiaryButtonFill?: ButtonProps['fill'];
|
|
99
|
+
tertiaryButtonFillHover?: ButtonProps['fillHover'];
|
|
100
|
+
tertiaryButtonHtmlType?: ButtonProps['htmlType'];
|
|
101
|
+
tertiaryButtonIsDisabled?: ButtonProps['isDisabled'];
|
|
102
|
+
tertiaryButtonIsLoading?: ButtonProps['isLoading'];
|
|
103
|
+
tertiaryButtonLabel?: ButtonProps['label'];
|
|
104
|
+
tertiaryButtonLabelSize?: ButtonProps['labelTextSize'];
|
|
105
|
+
tertiaryButtonLabelTextColor?: ButtonProps['labelTextColor'];
|
|
106
|
+
tertiaryButtonLabelTextWeight?: ButtonProps['labelTextWeight'];
|
|
107
|
+
tertiaryButtonSize?: ButtonProps['size'];
|
|
108
|
+
title?: string;
|
|
109
|
+
type?: 'bottom-button' | 'sticky-button';
|
|
110
|
+
validationSchema: ObjectSchema<object>;
|
|
111
|
+
}
|
|
112
|
+
export type { FinalFormProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FormFieldChips, FormFieldDatePicker, FormFieldSegmented } from 'src/form';
|
|
2
|
+
declare const FORM_FIELDS: {
|
|
3
|
+
checkbox: import("react").MemoExoticComponent<(props: import("src/form").FormFieldCheckboxProps) => import("react").JSX.Element>;
|
|
4
|
+
chips: typeof FormFieldChips;
|
|
5
|
+
choice: import("react").MemoExoticComponent<(props: import("src/form").FormFieldChoiceProps) => import("react").JSX.Element>;
|
|
6
|
+
code: import("react").MemoExoticComponent<(props: import("src/form").FormFieldCodeProps) => import("react").JSX.Element>;
|
|
7
|
+
color: import("react").MemoExoticComponent<(props: import("src/form").FormFieldColorInputProps) => import("react").JSX.Element>;
|
|
8
|
+
custom: import("react").MemoExoticComponent<(props: import("src/form").FormFieldCustomProps) => import("react").JSX.Element>;
|
|
9
|
+
dadataInput: import("react").MemoExoticComponent<(props: import("src/form").FormFieldDadataInputProps) => import("react").JSX.Element>;
|
|
10
|
+
datePicker: typeof FormFieldDatePicker;
|
|
11
|
+
fileInput: import("react").MemoExoticComponent<(props: import("src/form").FormFieldFileInputProps) => import("react").JSX.Element>;
|
|
12
|
+
group: import("react").MemoExoticComponent<(props: import("src/form").FormGroupProps) => import("react").JSX.Element>;
|
|
13
|
+
inputNumber: import("react").MemoExoticComponent<(props: import("src/form").FormFieldInputNumberProps) => import("react").JSX.Element>;
|
|
14
|
+
maskedInput: import("react").MemoExoticComponent<(props: import("src/form").FormFieldMaskedInputProps) => import("react").JSX.Element>;
|
|
15
|
+
password: import("react").MemoExoticComponent<(props: import("src/form").FormFieldPasswordProps) => import("react").JSX.Element>;
|
|
16
|
+
radioGroup: import("react").MemoExoticComponent<(props: import("src/form").FormFieldRadioGroupProps) => import("react").JSX.Element>;
|
|
17
|
+
segmented: typeof FormFieldSegmented;
|
|
18
|
+
select: import("react").MemoExoticComponent<(props: import("src/form").FormFieldSelectProps) => import("react").JSX.Element>;
|
|
19
|
+
switch: import("react").MemoExoticComponent<(props: import("src/form").FormFieldSwitchProps) => import("react").JSX.Element>;
|
|
20
|
+
text: import("react").MemoExoticComponent<(props: import("src/form").FormFieldInputProps) => import("react").JSX.Element>;
|
|
21
|
+
textarea: import("react").MemoExoticComponent<(props: import("src/form").FormFieldTextareaProps) => import("react").JSX.Element>;
|
|
22
|
+
};
|
|
23
|
+
export { FORM_FIELDS };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { formTypes } from '@itcase/forms-core';
|
|
2
|
+
import type { ButtonProps } from '@itcase/ui-web/components/Button';
|
|
3
|
+
import type { CheckboxField, ChipsField, ChoiceField, CodeField, ColorInputField, CustomField, DadataField, DatePickerField, FieldProps, FileInputField, FinalFormProps, GroupField, InputField, InputNumberField, MaskedInputField, PasswordField, RadioGroupField, SegmentedField, SelectField, SwitchField, TextareaField } from 'src/form';
|
|
4
|
+
type FormTypes = keyof typeof formTypes;
|
|
5
|
+
type GeneratorConfig = Omit<ButtonPrimaryField, 'type'> & Omit<ButtonSecondaryField, 'type'> & Omit<ButtonTertiaryField, 'type'> & {
|
|
6
|
+
key: string;
|
|
7
|
+
};
|
|
8
|
+
type BaseField = {
|
|
9
|
+
classNameGroupItem?: string;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
fieldProps: FieldProps & {
|
|
12
|
+
showErrorsOnSubmit?: boolean;
|
|
13
|
+
};
|
|
14
|
+
inputProps: Record<string, string>;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isRequired?: boolean;
|
|
17
|
+
name: string;
|
|
18
|
+
showMessage?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type ButtonPrimaryField = Omit<Partial<ButtonProps>, 'type'> & {
|
|
21
|
+
dataTestId?: string;
|
|
22
|
+
primaryButtonHtmlType?: FinalFormProps['primaryButtonHtmlType'];
|
|
23
|
+
primaryButtonIsDisabled?: FinalFormProps['primaryButtonIsDisabled'];
|
|
24
|
+
primaryButtonIsLoading?: FinalFormProps['primaryButtonIsLoading'];
|
|
25
|
+
type: Extract<FormTypes, 'primaryButton'>;
|
|
26
|
+
};
|
|
27
|
+
type ButtonSecondaryField = Omit<Partial<ButtonProps>, 'type'> & {
|
|
28
|
+
dataTestId?: string;
|
|
29
|
+
onClickSecondaryButton?: FinalFormProps['onClickSecondaryButton'];
|
|
30
|
+
secondaryButtonHtmlType?: FinalFormProps['secondaryButtonHtmlType'];
|
|
31
|
+
secondaryButtonIsDisabled?: FinalFormProps['secondaryButtonIsDisabled'];
|
|
32
|
+
secondaryButtonIsLoading?: FinalFormProps['secondaryButtonIsLoading'];
|
|
33
|
+
type: Extract<FormTypes, 'secondaryButton'>;
|
|
34
|
+
};
|
|
35
|
+
type ButtonTertiaryField = Omit<Partial<ButtonProps>, 'type'> & {
|
|
36
|
+
dataTestId?: string;
|
|
37
|
+
onClickTertiaryButton?: FinalFormProps['onClickTertiaryButton'];
|
|
38
|
+
tertiaryButtonHtmlType?: FinalFormProps['tertiaryButtonHtmlType'];
|
|
39
|
+
tertiaryButtonIsDisabled?: FinalFormProps['tertiaryButtonIsDisabled'];
|
|
40
|
+
tertiaryButtonIsLoading?: FinalFormProps['tertiaryButtonIsLoading'];
|
|
41
|
+
type: Extract<FormTypes, 'tertiaryButton'>;
|
|
42
|
+
};
|
|
43
|
+
type ButtonFields = ButtonPrimaryField | ButtonSecondaryField | ButtonTertiaryField;
|
|
44
|
+
type GeneratorField = CheckboxField | ChipsField | ChoiceField | CodeField | ColorInputField | CustomField | DadataField | DatePickerField | FileInputField | GroupField | InputField | InputNumberField | MaskedInputField | PasswordField | RadioGroupField | SegmentedField | SelectField | SwitchField | TextareaField;
|
|
45
|
+
export type { BaseField, ButtonFields, FormTypes, GeneratorConfig, GeneratorField, };
|