@engagebay/engagebay-form-module 1.0.0-beta.3-2 → 1.0.0-beta.3-3
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/package.json +1 -1
- package/src/form/Form.tsx +3 -0
- package/src/form/util/RenderFormField.tsx +2 -0
- package/src/index.js +116 -0
package/package.json
CHANGED
package/src/form/Form.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
UseFormTrigger,
|
|
10
10
|
UseFormUnregister,
|
|
11
11
|
UseFormResetField,
|
|
12
|
+
Control,
|
|
12
13
|
} from "react-hook-form";
|
|
13
14
|
import { FormFieldSchema } from "./schema/FormFieldSchema";
|
|
14
15
|
import { FormContext } from "./context/FormContext";
|
|
@@ -42,6 +43,7 @@ type FormPropsSchema = {
|
|
|
42
43
|
trigger: UseFormTrigger<any>;
|
|
43
44
|
unregister: UseFormUnregister<any>;
|
|
44
45
|
resetField: UseFormResetField<any>;
|
|
46
|
+
control: Control<any, any, any>;
|
|
45
47
|
}) => React.ReactNode;
|
|
46
48
|
customClass?: string;
|
|
47
49
|
};
|
|
@@ -152,6 +154,7 @@ export default function Form(props: FormPropsSchema): JSX.Element {
|
|
|
152
154
|
trigger,
|
|
153
155
|
unregister,
|
|
154
156
|
resetField,
|
|
157
|
+
control,
|
|
155
158
|
})}
|
|
156
159
|
</form>
|
|
157
160
|
</FormContext.Provider>
|
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { FieldAlignType, FormFieldSchema } from "../schema/FormFieldSchema";
|
|
4
4
|
import ErrorContextHandler from "../formfields/ErrorContextHandler";
|
|
5
5
|
import SVGIcon from "../../util/svg/SVGIcon";
|
|
6
|
+
import { useFormState } from "react-hook-form";
|
|
6
7
|
/**
|
|
7
8
|
* RenderFormField Component
|
|
8
9
|
*
|
|
@@ -54,6 +55,7 @@ const RenderFormField = ({
|
|
|
54
55
|
fieldConfig: FormFieldSchema;
|
|
55
56
|
getInput: Function;
|
|
56
57
|
}): JSX.Element => {
|
|
58
|
+
|
|
57
59
|
function formTypeHorizontal() {
|
|
58
60
|
return (
|
|
59
61
|
<Field
|
package/src/index.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Main exports for EngageBay Form Module
|
|
2
|
+
// Core components
|
|
3
|
+
export { default as Form } from './form/Form';
|
|
4
|
+
export { default as FormField } from './form/FormField';
|
|
5
|
+
|
|
6
|
+
// Axios configuration
|
|
7
|
+
export { AxiosConfigProvider, useAxiosConfig, useAxiosConfigOptional } from './api/AxiosConfigProvider';
|
|
8
|
+
|
|
9
|
+
// Form context
|
|
10
|
+
export { FormContext } from './form/context/FormContext';
|
|
11
|
+
|
|
12
|
+
// Schema and types
|
|
13
|
+
export * from './form/schema/FormFieldSchema';
|
|
14
|
+
|
|
15
|
+
// Utilities
|
|
16
|
+
export * from './form/util';
|
|
17
|
+
|
|
18
|
+
// Form field components
|
|
19
|
+
export { default as ArrayField } from './form/formfields/ArrayField';
|
|
20
|
+
export { BusinessHoursField } from './form/formfields/BusinessHoursField';
|
|
21
|
+
export { default as CheckboxButtonsField } from './form/formfields/CheckboxButtonsField';
|
|
22
|
+
export { default as CheckboxField } from './form/formfields/CheckboxField';
|
|
23
|
+
export { ColorPickerField } from './form/formfields/ColorPickerField';
|
|
24
|
+
export { default as ComboMultiSelect } from './form/formfields/ComboMultiSelect';
|
|
25
|
+
export { default as ComboSelect } from './form/formfields/ComboSelect';
|
|
26
|
+
export { default as DatePickerField } from './form/formfields/DatePickerField';
|
|
27
|
+
export { default as DateRangePickerField } from './form/formfields/DateRangePickerField';
|
|
28
|
+
export { default as DynamicMultiSelect } from './form/formfields/DynamicMultiSelect';
|
|
29
|
+
export { default as DynamicSelect } from './form/formfields/DynamicSelect';
|
|
30
|
+
export { default as Error } from './form/formfields/Error';
|
|
31
|
+
export { default as ErrorContextHandler } from './form/formfields/ErrorContextHandler';
|
|
32
|
+
export { default as FileUploadField } from './form/formfields/FileUploadField';
|
|
33
|
+
export { default as IframeField } from './form/formfields/IframeField';
|
|
34
|
+
export { default as InputField } from './form/formfields/InputField';
|
|
35
|
+
export { default as InputGroupField } from './form/formfields/InputGroupField';
|
|
36
|
+
export { default as MultipleSelectField } from './form/formfields/MultipleSelectField';
|
|
37
|
+
export { default as NumberField } from './form/formfields/NumberField';
|
|
38
|
+
export { default as PasswordField } from './form/formfields/PasswordField';
|
|
39
|
+
export { default as PhoneNumberField } from './form/formfields/PhoneNumberField';
|
|
40
|
+
export { default as RadioField } from './form/formfields/RadioField';
|
|
41
|
+
export { default as RadioGroupComponent } from './form/formfields/RadioGroupComponent';
|
|
42
|
+
export { RangeField } from './form/formfields/RangeField';
|
|
43
|
+
export { default as SelectField } from './form/formfields/SelectField';
|
|
44
|
+
export { default as SwitchField } from './form/formfields/SwitchField';
|
|
45
|
+
export { default as TextAreaField } from './form/formfields/TextAreaField';
|
|
46
|
+
export { default as TimeField } from './form/formfields/TimeField';
|
|
47
|
+
export { default as Typeahead } from './form/formfields/Typeahead';
|
|
48
|
+
export { default as TypeaheadMultiSelect } from './form/formfields/TypeaheadMultiSelect';
|
|
49
|
+
export { default as UrlField } from './form/formfields/UrlField';
|
|
50
|
+
|
|
51
|
+
// Hooks
|
|
52
|
+
export { default as useDynamicReducer } from './form/hooks/useDynamicReducer';
|
|
53
|
+
|
|
54
|
+
// Utilities
|
|
55
|
+
export { LoaderWithText } from './util/LoaderWithText';
|
|
56
|
+
export { default as SVGIcon } from './util/svg/SVGIcon';
|
|
57
|
+
export * from './util/svg/HELPER_ICONS';
|
|
58
|
+
|
|
59
|
+
// Main exports for EngageBay Form Module
|
|
60
|
+
|
|
61
|
+
// Core components
|
|
62
|
+
export { default as Form } from './form/Form';
|
|
63
|
+
export { default as FormField } from './form/FormField';
|
|
64
|
+
|
|
65
|
+
// Axios configuration
|
|
66
|
+
export { AxiosConfigProvider, useAxiosConfig, useAxiosConfigOptional } from './api/AxiosConfigProvider';
|
|
67
|
+
|
|
68
|
+
// Form context
|
|
69
|
+
export { FormContext } from './form/context/FormContext';
|
|
70
|
+
|
|
71
|
+
// Schema and types
|
|
72
|
+
export * from './form/schema/FormFieldSchema';
|
|
73
|
+
|
|
74
|
+
// Utilities
|
|
75
|
+
export * from './form/util';
|
|
76
|
+
|
|
77
|
+
// Form field components
|
|
78
|
+
export { default as ArrayField } from './form/formfields/ArrayField';
|
|
79
|
+
export { BusinessHoursField } from './form/formfields/BusinessHoursField';
|
|
80
|
+
export { default as CheckboxButtonsField } from './form/formfields/CheckboxButtonsField';
|
|
81
|
+
export { default as CheckboxField } from './form/formfields/CheckboxField';
|
|
82
|
+
export { default as ColorPickerField } from './form/formfields/ColorPickerField';
|
|
83
|
+
export { default as ComboMultiSelect } from './form/formfields/ComboMultiSelect';
|
|
84
|
+
export { default as ComboSelect } from './form/formfields/ComboSelect';
|
|
85
|
+
export { default as DatePickerField } from './form/formfields/DatePickerField';
|
|
86
|
+
export { default as DateRangePickerField } from './form/formfields/DateRangePickerField';
|
|
87
|
+
export { default as DynamicMultiSelect } from './form/formfields/DynamicMultiSelect';
|
|
88
|
+
export { default as DynamicSelect } from './form/formfields/DynamicSelect';
|
|
89
|
+
export { default as Error } from './form/formfields/Error';
|
|
90
|
+
export { default as ErrorContextHandler } from './form/formfields/ErrorContextHandler';
|
|
91
|
+
export { default as FileUploadField } from './form/formfields/FileUploadField';
|
|
92
|
+
export { default as IframeField } from './form/formfields/IframeField';
|
|
93
|
+
export { default as InputField } from './form/formfields/InputField';
|
|
94
|
+
export { default as InputGroupField } from './form/formfields/InputGroupField';
|
|
95
|
+
export { default as MultipleSelectField } from './form/formfields/MultipleSelectField';
|
|
96
|
+
export { default as NumberField } from './form/formfields/NumberField';
|
|
97
|
+
export { default as PasswordField } from './form/formfields/PasswordField';
|
|
98
|
+
export { default as PhoneNumberField } from './form/formfields/PhoneNumberField';
|
|
99
|
+
export { default as RadioField } from './form/formfields/RadioField';
|
|
100
|
+
export { default as RadioGroupComponent } from './form/formfields/RadioGroupComponent';
|
|
101
|
+
export { default as RangeField } from './form/formfields/RangeField';
|
|
102
|
+
export { default as SelectField } from './form/formfields/SelectField';
|
|
103
|
+
export { default as SwitchField } from './form/formfields/SwitchField';
|
|
104
|
+
export { default as TextAreaField } from './form/formfields/TextAreaField';
|
|
105
|
+
export { default as TimeField } from './form/formfields/TimeField';
|
|
106
|
+
export { default as Typeahead } from './form/formfields/Typeahead';
|
|
107
|
+
export { default as TypeaheadMultiSelect } from './form/formfields/TypeaheadMultiSelect';
|
|
108
|
+
export { default as UrlField } from './form/formfields/UrlField';
|
|
109
|
+
|
|
110
|
+
// Hooks
|
|
111
|
+
export { default as useDynamicReducer } from './form/hooks/useDynamicReducer';
|
|
112
|
+
|
|
113
|
+
// Utilities
|
|
114
|
+
export { default as LoaderWithText } from './util/LoaderWithText';
|
|
115
|
+
export { default as SVGIcon } from './util/svg/SVGIcon';
|
|
116
|
+
export * from './util/svg/HELPER_ICONS';
|