@itcase/forms 1.1.61 → 1.1.63

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.
Files changed (134) hide show
  1. package/dist/constants/index.d.ts +7 -0
  2. package/dist/constants/messages.constant.d.ts +10 -0
  3. package/dist/constants/messages.interface.d.ts +5 -0
  4. package/dist/css/form/Field/Input/FormFieldInput.css +0 -107
  5. package/dist/css/form/Field/Textarea/FormFieldTextarea.css +0 -107
  6. package/dist/css/form/Form/Form.css +1 -1
  7. package/dist/form/Field/Checkbox/FormFieldCheckbox.d.ts +4 -0
  8. package/dist/form/Field/Checkbox/FormFieldCheckbox.interface.d.ts +18 -0
  9. package/dist/form/Field/Checkbox/appearance/default.d.ts +3 -0
  10. package/dist/form/Field/Checkbox/index.d.ts +3 -0
  11. package/dist/form/Field/Checkbox/stories/FormFieldCheckbox.stories.d.ts +43 -0
  12. package/dist/form/Field/Chips/FormFieldChips.d.ts +3 -0
  13. package/dist/form/Field/Chips/FormFieldChips.interface.d.ts +27 -0
  14. package/dist/form/Field/Chips/appearance/default.d.ts +3 -0
  15. package/dist/form/Field/Chips/index.d.ts +3 -0
  16. package/dist/form/Field/Chips/stories/FormFieldChips.stories.d.ts +30 -0
  17. package/dist/form/Field/Chips/stories/__mock__/index.d.ts +76 -0
  18. package/dist/form/Field/Choice/FormFieldChoice.d.ts +4 -0
  19. package/dist/form/Field/Choice/FormFieldChoice.interface.d.ts +23 -0
  20. package/dist/form/Field/Choice/appearance/default.d.ts +3 -0
  21. package/dist/form/Field/Choice/index.d.ts +3 -0
  22. package/dist/form/Field/Choice/stories/FormFieldChoice.stories.d.ts +48 -0
  23. package/dist/form/Field/Code/FormFieldCode.d.ts +4 -0
  24. package/dist/form/Field/Code/FormFieldCode.interface.d.ts +16 -0
  25. package/dist/form/Field/Code/appearance/default.d.ts +3 -0
  26. package/dist/form/Field/Code/index.d.ts +3 -0
  27. package/dist/form/Field/Code/stories/FormFieldCode.stories.d.ts +45 -0
  28. package/dist/form/Field/Custom/FormFieldCustom.d.ts +4 -0
  29. package/dist/form/Field/Custom/FormFieldCustom.interface.d.ts +18 -0
  30. package/dist/form/Field/Custom/index.d.ts +2 -0
  31. package/dist/form/Field/Dadata/FormFieldDadataInput.d.ts +4 -0
  32. package/dist/form/Field/Dadata/FormFieldDadataInput.interface.d.ts +19 -0
  33. package/dist/form/Field/Dadata/appearance/default.d.ts +3 -0
  34. package/dist/form/Field/Dadata/index.d.ts +3 -0
  35. package/dist/form/Field/Dadata/stories/FormFieldDadataInput.stories.d.ts +34 -0
  36. package/dist/form/Field/DatePicker/FormFieldDatePicker.d.ts +3 -0
  37. package/dist/form/Field/DatePicker/FormFieldDatePicker.interface.d.ts +10 -0
  38. package/dist/form/Field/DatePicker/appearance/default.d.ts +12 -0
  39. package/dist/form/Field/DatePicker/index.d.ts +3 -0
  40. package/dist/form/Field/DatePicker/stories/FormFieldDatePicker.stories.d.ts +58 -0
  41. package/dist/form/Field/FileInput/FormFieldFileInputDropzone.d.ts +2 -0
  42. package/dist/form/Field/FileInput/appearance/default.d.ts +19 -0
  43. package/dist/form/Field/FileInput/index.d.ts +4 -0
  44. package/dist/form/Field/FileInput/stories/FormFieldFileInput.stories.d.ts +51 -0
  45. package/dist/form/Field/Group/FormGroup.d.ts +4 -0
  46. package/dist/form/Field/Group/FormGroup.interface.d.ts +47 -0
  47. package/dist/form/Field/Group/appearance/default.d.ts +3 -0
  48. package/dist/form/Field/Group/index.d.ts +3 -0
  49. package/dist/form/Field/Input/FormFieldInput.d.ts +4 -0
  50. package/dist/form/Field/Input/FormFieldInput.interface.d.ts +25 -0
  51. package/dist/form/Field/Input/appearance/default.d.ts +3 -0
  52. package/dist/form/Field/Input/index.d.ts +3 -0
  53. package/dist/form/Field/Input/stories/FormFieldInputClassic.stories.d.ts +128 -0
  54. package/dist/form/Field/Input/stories/FormFieldInputFloat.stories.d.ts +128 -0
  55. package/dist/form/Field/Input/stories/FormFieldInputIFTA.stories.d.ts +128 -0
  56. package/dist/form/Field/InputNumber/FormFieldInputNumber.d.ts +4 -0
  57. package/dist/form/Field/InputNumber/FormFieldInputNumber.interface.d.ts +20 -0
  58. package/dist/form/Field/InputNumber/appearance/default.d.ts +3 -0
  59. package/dist/form/Field/InputNumber/index.d.ts +3 -0
  60. package/dist/form/Field/MaskedInput/FormFieldMaskedInput.d.ts +4 -0
  61. package/dist/form/Field/MaskedInput/FormFieldMaskedInput.interface.d.ts +27 -0
  62. package/dist/form/Field/MaskedInput/appearance/default.d.ts +3 -0
  63. package/dist/form/Field/MaskedInput/index.d.ts +3 -0
  64. package/dist/form/Field/MaskedInput/stories/FormFieldMaskedInputClassic.stories.d.ts +71 -0
  65. package/dist/form/Field/MaskedInput/stories/FormFieldMaskedInputFTA.stories.d.ts +63 -0
  66. package/dist/form/Field/MaskedInput/stories/FormFieldMaskedInputFloating.stories.d.ts +63 -0
  67. package/dist/form/Field/Password/FormFieldPassword.d.ts +4 -0
  68. package/dist/form/Field/Password/FormFieldPassword.interface.d.ts +17 -0
  69. package/dist/form/Field/Password/appearance/default.d.ts +3 -0
  70. package/dist/form/Field/Password/index.d.ts +3 -0
  71. package/dist/form/Field/Password/stories/FormFieldPasswordClassic.stories.d.ts +48 -0
  72. package/dist/form/Field/Password/stories/FormFieldPasswordFTA.stories.d.ts +48 -0
  73. package/dist/form/Field/Password/stories/FormFieldPasswordFloating.stories.d.ts +48 -0
  74. package/dist/form/Field/RadioGroup/FormFieldRadioGroup.d.ts +4 -0
  75. package/dist/form/Field/RadioGroup/FormFieldRadioGroup.interface.d.ts +23 -0
  76. package/dist/form/Field/RadioGroup/FormFieldRadioGroupList.d.ts +3 -0
  77. package/dist/form/Field/RadioGroup/appearance/default.d.ts +3 -0
  78. package/dist/form/Field/RadioGroup/index.d.ts +3 -0
  79. package/dist/form/Field/RadioGroup/stories/FormFieldRadioGroup.stories.d.ts +44 -0
  80. package/dist/form/Field/Segmented/FormFieldSegmented.d.ts +3 -0
  81. package/dist/form/Field/Segmented/FormFieldSegmented.interface.d.ts +15 -0
  82. package/dist/form/Field/Segmented/appearance/default.d.ts +3 -0
  83. package/dist/form/Field/Segmented/index.d.ts +3 -0
  84. package/dist/form/Field/Segmented/stories/FormFieldSegmented.stories.d.ts +45 -0
  85. package/dist/form/Field/Select/FormFieldSelect.d.ts +4 -0
  86. package/dist/form/Field/Select/FormFieldSelect.interface.d.ts +33 -0
  87. package/dist/form/Field/Select/appearance/default.d.ts +3 -0
  88. package/dist/form/Field/Select/index.d.ts +3 -0
  89. package/dist/form/Field/Select/stories/FormFieldSelect.stories.d.ts +45 -0
  90. package/dist/form/Field/Switch/FormFieldSwitch.d.ts +5 -0
  91. package/dist/form/Field/Switch/FormFieldSwitch.interface.d.ts +16 -0
  92. package/dist/form/Field/Switch/appearance/default.d.ts +3 -0
  93. package/dist/form/Field/Switch/index.d.ts +3 -0
  94. package/dist/form/Field/Switch/stories/FormFieldSwitch.stories.d.ts +30 -0
  95. package/dist/form/Field/Switch/stories/FormFieldSwitchLeft.stories.d.ts +42 -0
  96. package/dist/form/Field/Switch/stories/FormFieldSwitchRight.stories.d.ts +42 -0
  97. package/dist/form/Field/Textarea/FormFieldTextarea.d.ts +4 -0
  98. package/dist/form/Field/Textarea/FormFieldTextarea.interface.d.ts +13 -0
  99. package/dist/form/Field/Textarea/appearance/default.d.ts +3 -0
  100. package/dist/form/Field/Textarea/index.d.ts +3 -0
  101. package/dist/form/Field/Textarea/stories/FormFieldTextareaClassic.stories.d.ts +48 -0
  102. package/dist/form/Field/Textarea/stories/FormFieldTextareaFloating.stories.d.ts +48 -0
  103. package/dist/form/Field/Textarea/stories/FormFieldTextareaIFTA.stories.d.ts +48 -0
  104. package/dist/form/Field/index.d.ts +20 -0
  105. package/dist/form/FieldWrapper/FieldWrapper.d.ts +4 -0
  106. package/dist/form/FieldWrapper/FieldWrapper.interface.d.ts +77 -0
  107. package/dist/form/FieldWrapper/appearance/default.d.ts +7 -0
  108. package/dist/form/FieldWrapper/index.d.ts +3 -0
  109. package/dist/form/Form/FinalForm.d.ts +4 -0
  110. package/dist/form/Form/FinalForm.interface.d.ts +119 -0
  111. package/dist/form/generator/generator.constants.d.ts +25 -0
  112. package/dist/form/generator/generator.d.ts +3 -0
  113. package/dist/form/generator/generator.interface.d.ts +62 -0
  114. package/dist/form/generator/index.d.ts +4 -0
  115. package/dist/form/index.d.ts +5 -0
  116. package/dist/form/utils.d.ts +22 -0
  117. package/dist/hooks/form/form.d.ts +3 -0
  118. package/dist/hooks/form/index.d.ts +2 -0
  119. package/dist/hooks/index.d.ts +4 -0
  120. package/dist/hooks/useFieldValidationState/index.d.ts +2 -0
  121. package/dist/hooks/useFieldValidationState/useFieldValidationState.d.ts +9 -0
  122. package/dist/hooks/useFieldValidationState/useFieldValidationState.interface.d.ts +8 -0
  123. package/dist/hooks/useValidationAppearanceInputProps/index.d.ts +2 -0
  124. package/dist/hooks/useValidationAppearanceInputProps/useValidationAppearanceInputProps.d.ts +3 -0
  125. package/dist/hooks/useValidationAppearanceInputProps/useValidationAppearanceInputProps.interface.d.ts +5 -0
  126. package/dist/index.d.ts +5 -0
  127. package/dist/itcase-forms.cjs.js +3 -3767
  128. package/dist/itcase-forms.esm.js +3 -3688
  129. package/dist/services/index.d.ts +2 -0
  130. package/dist/services/utils.d.ts +4 -0
  131. package/dist/validators/index.d.ts +2 -0
  132. package/dist/validators/validation.d.ts +6 -0
  133. package/dist/validators/validation.interface.d.ts +6 -0
  134. package/package.json +12 -6
@@ -0,0 +1,7 @@
1
+ import { 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,3 @@
1
+ import { defaultFieldProps, defaultFieldSizeL, defaultFieldSizeM, defaultFieldSizeS, defaultFieldSizeXL } from './appearance/default';
2
+ import { FieldWrapper, FieldWrapperBase } from './FieldWrapper';
3
+ export { defaultFieldProps, defaultFieldSizeL, defaultFieldSizeM, defaultFieldSizeS, defaultFieldSizeXL, FieldWrapper, FieldWrapperBase, };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { FinalFormProps } from './FinalForm.interface';
3
+ declare const FinalForm: React.ForwardRefExoticComponent<FinalFormProps & React.RefAttributes<unknown>>;
4
+ export default FinalForm;
@@ -0,0 +1,119 @@
1
+ import type { Config } from 'final-form';
2
+ import type { FormProps, UseFormStateParams } from 'react-final-form';
3
+ import * as yup from 'yup';
4
+ import { DirectionProps, ElevationProps, FillProps, HeightProps, JustifyContentProps, ShapeProps, WidthProps } from '@itcase/types-ui';
5
+ import { ButtonProps } from '@itcase/ui-web/components/Button';
6
+ import { GroupProps } from '@itcase/ui-web/components/Group';
7
+ import { LoaderProps } from '@itcase/ui-web/components/Loader';
8
+ import { NotificationProps } from '@itcase/ui-web/components/Notification';
9
+ import { TextProps } from '@itcase/ui-web/components/Text';
10
+ import { TitleProps } from '@itcase/ui-web/components/Title';
11
+ import { ButtonFields, FormTypes, GeneratorField } from '../generator/generator.interface';
12
+ interface FinalFormAppearanceProps {
13
+ buttonDirection?: DirectionProps;
14
+ buttonFill?: FillProps;
15
+ buttonGap?: string;
16
+ buttonJustifyContent?: JustifyContentProps;
17
+ buttonPadding?: string;
18
+ buttonPosition?: 'bottom' | 'sticky';
19
+ descSize?: TextProps['size'];
20
+ descTextColor?: TextProps['textColor'];
21
+ descTextWeight?: TextProps['textWeight'];
22
+ direction?: DirectionProps;
23
+ elevation?: ElevationProps;
24
+ fill?: FillProps;
25
+ height?: HeightProps;
26
+ loader?: React.ReactNode;
27
+ primaryButtonAppearance?: ButtonProps['appearance'];
28
+ primaryButtonFill?: ButtonProps['fill'];
29
+ primaryButtonFillHover?: ButtonProps['fillHover'];
30
+ primaryButtonHtmlType?: ButtonProps['htmlType'];
31
+ primaryButtonIsDisabled?: ButtonProps['isDisabled'];
32
+ primaryButtonIsLoading?: ButtonProps['isLoading'];
33
+ primaryButtonLabel?: ButtonProps['label'];
34
+ primaryButtonLabelSize?: ButtonProps['labelTextSize'];
35
+ primaryButtonLabelTextColor?: ButtonProps['labelTextColor'];
36
+ primaryButtonLabelTextWeight?: ButtonProps['labelTextWeight'];
37
+ primaryButtonSize?: ButtonProps['size'];
38
+ primarySecondaryHtmlType?: ButtonProps['htmlType'];
39
+ secondaryButtonAppearance?: ButtonProps['appearance'];
40
+ secondaryButtonFill?: ButtonProps['fill'];
41
+ secondaryButtonFillHover?: ButtonProps['fillHover'];
42
+ secondaryButtonIsDisabled?: ButtonProps['isDisabled'];
43
+ secondaryButtonIsLoading?: ButtonProps['isLoading'];
44
+ secondaryButtonLabel?: ButtonProps['label'];
45
+ secondaryButtonLabelSize?: ButtonProps['labelTextSize'];
46
+ secondaryButtonLabelTextColor?: ButtonProps['labelTextColor'];
47
+ secondaryButtonLabelTextWeight?: ButtonProps['labelTextWeight'];
48
+ secondaryButtonSize?: ButtonProps['size'];
49
+ shape?: ShapeProps;
50
+ shapeStrength?: ShapeProps;
51
+ titleFill?: TitleProps['fill'];
52
+ titlePosition?: TitleProps['position'];
53
+ titleTextColor?: TitleProps['textColor'];
54
+ titleTextSize?: TitleProps['size'];
55
+ titleTextWeight?: TitleProps['textWeight'];
56
+ width?: WidthProps;
57
+ }
58
+ interface FinalFormProps extends FinalFormAppearanceProps {
59
+ isLoading?: boolean;
60
+ onChangeFormValues?: UseFormStateParams['onChange'];
61
+ onClickSecondaryButton?: ButtonProps['onClick'];
62
+ onClickTertiaryButton?: ButtonProps['onClick'];
63
+ onSubmit: Config['onSubmit'];
64
+ after?: React.ReactNode;
65
+ before?: React.ReactNode;
66
+ className?: string;
67
+ config: {
68
+ buttons: Record<string, ButtonFields>;
69
+ fields: Record<string, GeneratorField>;
70
+ form: Record<string, string>;
71
+ };
72
+ dataTestId?: string;
73
+ dataTestIdButtons?: string;
74
+ dataTestIdPrimaryButton?: string;
75
+ dataTestIdSecondaryButton?: string;
76
+ dataTestIdTertiaryButton?: string;
77
+ dataTour?: string;
78
+ dataTourButtons?: GroupProps['dataTour'];
79
+ dataTourPrimaryButton?: ButtonProps['dataTour'];
80
+ dataTourSecondaryButton?: ButtonProps['dataTour'];
81
+ dataTourTertiaryButton?: ButtonProps['dataTour'];
82
+ desc?: string;
83
+ disableFieldsAutoComplete?: boolean;
84
+ fieldsGap?: GroupProps['gap'];
85
+ groupGap?: GroupProps['gap'];
86
+ initialValues: FormProps['initialValues'];
87
+ initialValuesEqual: FormProps['initialValuesEqual'];
88
+ language?: string;
89
+ loaderAppearance?: LoaderProps['appearance'];
90
+ loaderFill?: LoaderProps['fill'];
91
+ loaderItemFill?: LoaderProps['itemFill'];
92
+ loaderShape?: LoaderProps['shape'];
93
+ loaderSize?: LoaderProps['size'];
94
+ loaderText?: LoaderProps['text'];
95
+ loaderType?: LoaderProps['type'];
96
+ mutators: Config['mutators'];
97
+ notificationCloseButton?: NotificationProps['closeIcon'];
98
+ notificationType?: NotificationProps['type'];
99
+ primaryButton?: ButtonProps['children'];
100
+ renderFieldsWrapper?: (children: React.ReactNode) => React.ReactNode;
101
+ secondaryButton?: ButtonProps['children'];
102
+ secondaryButtonHtmlType?: ButtonProps['htmlType'];
103
+ tertiaryButton?: ButtonProps['children'];
104
+ tertiaryButtonAppearance?: ButtonProps['appearance'];
105
+ tertiaryButtonFill?: ButtonProps['fill'];
106
+ tertiaryButtonFillHover?: ButtonProps['fillHover'];
107
+ tertiaryButtonHtmlType?: ButtonProps['htmlType'];
108
+ tertiaryButtonIsDisabled?: ButtonProps['isDisabled'];
109
+ tertiaryButtonIsLoading?: ButtonProps['isLoading'];
110
+ tertiaryButtonLabel?: ButtonProps['label'];
111
+ tertiaryButtonLabelSize?: ButtonProps['labelTextSize'];
112
+ tertiaryButtonLabelTextColor?: ButtonProps['labelTextColor'];
113
+ tertiaryButtonLabelTextWeight?: ButtonProps['labelTextWeight'];
114
+ tertiaryButtonSize?: ButtonProps['size'];
115
+ title?: string;
116
+ type?: FormTypes;
117
+ validationSchema?: yup.ObjectSchema<object>;
118
+ }
119
+ export type { FinalFormProps };
@@ -0,0 +1,25 @@
1
+ declare const formTypes: {
2
+ readonly secondaryButton: "secondaryButton";
3
+ readonly primaryButton: "primaryButton";
4
+ readonly tertiaryButton: "tertiaryButton";
5
+ readonly checkbox: "checkbox";
6
+ readonly chips: "chips";
7
+ readonly choice: "choice";
8
+ readonly code: "code";
9
+ readonly custom: "custom";
10
+ readonly dadataInput: "dadataInput";
11
+ readonly datePicker: "datePicker";
12
+ readonly dateRangePicker: "dateRangePicker";
13
+ readonly fileInput: "fileInput";
14
+ readonly group: "group";
15
+ readonly inputNumber: "inputNumber";
16
+ readonly maskedInput: "maskedInput";
17
+ readonly password: "password";
18
+ readonly radioGroup: "radioGroup";
19
+ readonly segmented: "segmented";
20
+ readonly select: "select";
21
+ readonly switch: "switch";
22
+ readonly text: "text";
23
+ readonly textarea: "textarea";
24
+ };
25
+ export { formTypes };
@@ -0,0 +1,3 @@
1
+ import { GeneratorConfig, GeneratorField } from './generator.interface';
2
+ declare function generateField(field: GeneratorField, props: GeneratorConfig): import("react/jsx-runtime").JSX.Element;
3
+ export { generateField };
@@ -0,0 +1,62 @@
1
+ import { CheckboxField } from '../Field/Checkbox/FormFieldCheckbox.interface';
2
+ import { ChipsField } from '../Field/Chips/FormFieldChips.interface';
3
+ import { ChoiceField } from '../Field/Choice/FormFieldChoice.interface';
4
+ import { CodeField } from '../Field/Code/FormFieldCode.interface';
5
+ import { CustomField } from '../Field/Custom/FormFieldCustom.interface';
6
+ import { DadataField } from '../Field/Dadata/FormFieldDadataInput.interface';
7
+ import { DatePickerField } from '../Field/DatePicker/FormFieldDatePicker.interface';
8
+ import { GroupField } from '../Field/Group/FormGroup.interface';
9
+ import { InputField } from '../Field/Input/FormFieldInput.interface';
10
+ import { InputNumberField } from '../Field/InputNumber/FormFieldInputNumber.interface';
11
+ import { MaskedInputField } from '../Field/MaskedInput/FormFieldMaskedInput.interface';
12
+ import { PasswordField } from '../Field/Password/FormFieldPassword.interface';
13
+ import { RadioGroupField } from '../Field/RadioGroup/FormFieldRadioGroup.interface';
14
+ import { SegmentedField } from '../Field/Segmented/FormFieldSegmented.interface';
15
+ import { SelectField } from '../Field/Select/FormFieldSelect.interface';
16
+ import { SwitchField } from '../Field/Switch/FormFieldSwitch.interface';
17
+ import { TextareaField } from '../Field/Textarea/FormFieldTextarea.interface';
18
+ import { FieldProps } from '../FieldWrapper/FieldWrapper.interface';
19
+ import { FinalFormProps } from '../Form/FinalForm.interface';
20
+ import { formTypes } from './generator.constants';
21
+ type FormTypes = keyof typeof formTypes;
22
+ type GeneratorConfig = Omit<ButtonPrimaryField, 'type'> & Omit<ButtonSecondaryField, 'type'> & Omit<ButtonTertiaryField, 'type'> & {
23
+ key: string;
24
+ };
25
+ type BaseField = {
26
+ classNameGroupItem?: string;
27
+ dataTestId?: string;
28
+ fieldProps: FieldProps & {
29
+ showErrorsOnSubmit?: boolean;
30
+ };
31
+ inputProps: Record<string, string>;
32
+ isDisabled?: boolean;
33
+ isRequired?: boolean;
34
+ name: string;
35
+ showMessage?: boolean;
36
+ };
37
+ type ButtonPrimaryField = {
38
+ dataTestId?: string;
39
+ primaryButtonHtmlType?: FinalFormProps['primaryButtonHtmlType'];
40
+ primaryButtonIsDisabled?: FinalFormProps['primaryButtonIsDisabled'];
41
+ primaryButtonIsLoading?: FinalFormProps['primaryButtonIsLoading'];
42
+ type: Extract<FormTypes, 'primaryButton'>;
43
+ };
44
+ type ButtonSecondaryField = {
45
+ dataTestId?: string;
46
+ onClickSecondaryButton?: FinalFormProps['onClickSecondaryButton'];
47
+ secondaryButtonHtmlType?: FinalFormProps['secondaryButtonHtmlType'];
48
+ secondaryButtonIsDisabled?: FinalFormProps['secondaryButtonIsDisabled'];
49
+ secondaryButtonIsLoading?: FinalFormProps['secondaryButtonIsLoading'];
50
+ type: Extract<FormTypes, 'secondaryButton'>;
51
+ };
52
+ type ButtonTertiaryField = {
53
+ dataTestId?: string;
54
+ onClickTertiaryButton?: FinalFormProps['onClickTertiaryButton'];
55
+ tertiaryButtonHtmlType?: FinalFormProps['tertiaryButtonHtmlType'];
56
+ tertiaryButtonIsDisabled?: FinalFormProps['tertiaryButtonIsDisabled'];
57
+ tertiaryButtonIsLoading?: FinalFormProps['tertiaryButtonIsLoading'];
58
+ type: Extract<FormTypes, 'tertiaryButton'>;
59
+ };
60
+ type ButtonFields = ButtonPrimaryField | ButtonSecondaryField | ButtonTertiaryField;
61
+ type GeneratorField = ButtonPrimaryField | ButtonSecondaryField | ButtonTertiaryField | CheckboxField | ChipsField | ChoiceField | CodeField | CustomField | DadataField | DatePickerField | GroupField | InputField | InputNumberField | MaskedInputField | PasswordField | RadioGroupField | SegmentedField | SelectField | SwitchField | TextareaField;
62
+ export type { BaseField, ButtonFields, FormTypes, GeneratorConfig, GeneratorField, };
@@ -0,0 +1,4 @@
1
+ import { generateField } from './generator';
2
+ import { formTypes } from './generator.constants';
3
+ export { formTypes };
4
+ export { generateField };
@@ -0,0 +1,5 @@
1
+ export * from './Field';
2
+ export * from './FieldWrapper';
3
+ export { default as FinalForm } from './Form/FinalForm';
4
+ export * from './generator';
5
+ export * from './utils';
@@ -0,0 +1,22 @@
1
+ import { AxiosError } from 'axios';
2
+ import { FocusableInput } from 'final-form-focus';
3
+ import { useForm, useFormState } from 'react-final-form';
4
+ declare const focusOnError: (formElementsList: FocusableInput[], errors: object) => undefined;
5
+ declare const focusOnErrorDecorator: import("final-form").Decorator<object, object>;
6
+ declare const setErrorsMutator: (args: [string, {
7
+ error: string;
8
+ submitError: string;
9
+ }], state: any) => void;
10
+ declare const sendFormDataToServer: (url: string, data: unknown) => Promise<{
11
+ response: import("axios").AxiosResponse<any, any, {}>;
12
+ success: boolean;
13
+ error?: undefined;
14
+ formErrors?: undefined;
15
+ } | {
16
+ error: AxiosError<string | Record<string, string[]>, any>;
17
+ formErrors: Record<string, string>;
18
+ success: boolean;
19
+ response?: undefined;
20
+ }>;
21
+ declare const createDataTestIdField: (fieldname: string, dataTestId?: string) => string;
22
+ export { createDataTestIdField, focusOnError, focusOnErrorDecorator, sendFormDataToServer, setErrorsMutator, useForm, useFormState, };
@@ -0,0 +1,3 @@
1
+ import { FinalFormProps } from 'src/form/Form/FinalForm.interface';
2
+ declare function useYupValidationSchema(schema: FinalFormProps['validationSchema'], language?: string): ((values: object) => Promise<any>) | undefined;
3
+ export { useYupValidationSchema };
@@ -0,0 +1,2 @@
1
+ import { useYupValidationSchema } from './form';
2
+ export { useYupValidationSchema };
@@ -0,0 +1,4 @@
1
+ import { useYupValidationSchema } from './form';
2
+ import { useFieldValidationState } from './useFieldValidationState';
3
+ import { useValidationAppearanceInputProps } from './useValidationAppearanceInputProps';
4
+ export { useFieldValidationState, useValidationAppearanceInputProps, useYupValidationSchema, };
@@ -0,0 +1,2 @@
1
+ import { useFieldValidationState } from './useFieldValidationState';
2
+ export { useFieldValidationState };
@@ -0,0 +1,9 @@
1
+ import { UseFieldValidationStateParams } from './useFieldValidationState.interface';
2
+ declare function useFieldValidationState(params: UseFieldValidationStateParams): {
3
+ errorKey: any;
4
+ errorMessage: string;
5
+ successKey: string;
6
+ isErrorState: boolean;
7
+ isValidState: boolean;
8
+ };
9
+ export { useFieldValidationState };
@@ -0,0 +1,8 @@
1
+ import { FieldInputProps, FieldMetaState } from 'react-final-form';
2
+ import { BaseField } from 'src/form/generator/generator.interface';
3
+ interface UseFieldValidationStateParams {
4
+ fieldProps: BaseField['fieldProps'];
5
+ input: FieldInputProps<number | object | string>;
6
+ meta: FieldMetaState<number | object | string>;
7
+ }
8
+ export type { UseFieldValidationStateParams };
@@ -0,0 +1,2 @@
1
+ import { useValidationAppearanceInputProps } from './useValidationAppearanceInputProps';
2
+ export { useValidationAppearanceInputProps };
@@ -0,0 +1,3 @@
1
+ import { UseValidationAppearanceInputProps } from './useValidationAppearanceInputProps.interface';
2
+ declare function useValidationAppearanceInputProps<InputProps extends object>(props: UseValidationAppearanceInputProps<InputProps>): InputProps;
3
+ export { useValidationAppearanceInputProps };
@@ -0,0 +1,5 @@
1
+ type UseValidationAppearanceInputProps<InputProps> = {
2
+ inputProps: InputProps;
3
+ validationStateKey: string | null;
4
+ };
5
+ export type { UseValidationAppearanceInputProps };
@@ -0,0 +1,5 @@
1
+ export * from './constants';
2
+ export * from './form';
3
+ export * from './hooks/form/form';
4
+ export * from './services/utils';
5
+ export * from './validators/validation';