@micromerce/formbuilder-react 1.0.594 → 1.0.596
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formbuilder.js +660 -0
- package/dist/formbuilder.js.LICENSE.txt +60 -0
- package/dist/formbuilder.js.map +1 -0
- package/package.json +51 -44
- package/dist/esm/index.js +0 -128984
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/assets/icons/error/Error.d.ts +0 -2
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +0 -10
- package/dist/esm/types/components/Checkbox/index.d.ts +0 -1
- package/dist/esm/types/components/ControlWrapper/ControlWrapper.d.ts +0 -11
- package/dist/esm/types/components/ControlWrapper/index.d.ts +0 -1
- package/dist/esm/types/components/DateRangeGroup/DateRangeGroup.d.ts +0 -10
- package/dist/esm/types/components/DateRangeGroup/DateRangeGroup.styles.d.ts +0 -3
- package/dist/esm/types/components/DateRangeGroup/components/CalendarModal.d.ts +0 -14
- package/dist/esm/types/components/DateRangeGroup/index.d.ts +0 -1
- package/dist/esm/types/components/ErrorBoundary/ErrorBoundary.d.ts +0 -14
- package/dist/esm/types/components/FileUploader/FileUploader.d.ts +0 -9
- package/dist/esm/types/components/FileUploader/index.d.ts +0 -1
- package/dist/esm/types/components/FormBuilder/FormBuilder.d.ts +0 -25
- package/dist/esm/types/components/FormBuilder/index.d.ts +0 -1
- package/dist/esm/types/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.d.ts +0 -6
- package/dist/esm/types/components/FormBuilder/utils/extractFormControlValues/index.d.ts +0 -1
- package/dist/esm/types/components/FormBuilder/utils/jsonToUrlEncoded/index.d.ts +0 -1
- package/dist/esm/types/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.d.ts +0 -5
- package/dist/esm/types/components/FormFooter/FormFooter.d.ts +0 -15
- package/dist/esm/types/components/FormFooter/components/Switch.d.ts +0 -1
- package/dist/esm/types/components/FormFooter/index.d.ts +0 -1
- package/dist/esm/types/components/FormGroup/FormGroup.d.ts +0 -15
- package/dist/esm/types/components/FormGroup/index.d.ts +0 -1
- package/dist/esm/types/components/FormList/FormList.d.ts +0 -11
- package/dist/esm/types/components/FormList/index.d.ts +0 -1
- package/dist/esm/types/components/GeneralFormGroup/GeneralFormGroup.d.ts +0 -5
- package/dist/esm/types/components/GeneralFormGroup/index.d.ts +0 -1
- package/dist/esm/types/components/Group/Group.d.ts +0 -12
- package/dist/esm/types/components/Group/index.d.ts +0 -1
- package/dist/esm/types/components/Input/Input.d.ts +0 -14
- package/dist/esm/types/components/Input/index.d.ts +0 -1
- package/dist/esm/types/components/Input/input.styles.d.ts +0 -9
- package/dist/esm/types/components/InputFreeSolo/InputFreeSolo.d.ts +0 -10
- package/dist/esm/types/components/InputFreeSolo/index.d.ts +0 -1
- package/dist/esm/types/components/MrnInput/MrnInput.d.ts +0 -11
- package/dist/esm/types/components/MrnInput/hooks/useMrn.d.ts +0 -22
- package/dist/esm/types/components/MrnInput/index.d.ts +0 -1
- package/dist/esm/types/components/MrnInput/services/fetchMrn.d.ts +0 -3
- package/dist/esm/types/components/MrnInput/ui-helper/Link/Link.d.ts +0 -3
- package/dist/esm/types/components/MrnInput/utils/mrnUtils/mrnUtils.d.ts +0 -8
- package/dist/esm/types/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.d.ts +0 -2
- package/dist/esm/types/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.d.ts +0 -2
- package/dist/esm/types/components/MrnInput/utils/urlSearchParam/urlSearchParam.d.ts +0 -1
- package/dist/esm/types/components/MultiSelect/MultiSelect.d.ts +0 -17
- package/dist/esm/types/components/MultiSelect/index.d.ts +0 -1
- package/dist/esm/types/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.d.ts +0 -24
- package/dist/esm/types/components/MultiSelect/utils/extractSelectedOptionValues/index.d.ts +0 -1
- package/dist/esm/types/components/PasswordInput/PasswordInput.d.ts +0 -12
- package/dist/esm/types/components/PasswordInput/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/QueryControl.d.ts +0 -13
- package/dist/esm/types/components/QueryControl/data/defaultControls.d.ts +0 -9
- package/dist/esm/types/components/QueryControl/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.d.ts +0 -8
- package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.d.ts +0 -6
- package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/utils/allControlsHidden/allControlsHidden.d.ts +0 -3
- package/dist/esm/types/components/QueryControl/utils/allControlsHidden/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/utils/getMatchingControls.d.ts +0 -9
- package/dist/esm/types/components/QueryControl/utils/hasExpertControl/hasExpertControl.d.ts +0 -3
- package/dist/esm/types/components/QueryControl/utils/hasExpertControl/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/utils/hideGroup/hideGroup.d.ts +0 -3
- package/dist/esm/types/components/QueryControl/utils/hideGroup/index.d.ts +0 -1
- package/dist/esm/types/components/Select/Select.d.ts +0 -12
- package/dist/esm/types/components/Select/index.d.ts +0 -1
- package/dist/esm/types/components/Select/utils/getSelectedOption.d.ts +0 -3
- package/dist/esm/types/components/Textarea/Textarea.d.ts +0 -10
- package/dist/esm/types/components/Textarea/Textarea.types.d.ts +0 -12
- package/dist/esm/types/components/Textarea/aiWrapper/aiAction.d.ts +0 -12
- package/dist/esm/types/components/Textarea/aiWrapper/aiLayout.d.ts +0 -10
- package/dist/esm/types/components/Textarea/aiWrapper/index.d.ts +0 -11
- package/dist/esm/types/components/Textarea/aiWrapper/useAi.d.ts +0 -21
- package/dist/esm/types/components/Textarea/editors/Default.d.ts +0 -13
- package/dist/esm/types/components/Textarea/editors/Html.d.ts +0 -10
- package/dist/esm/types/components/Textarea/editors/Json.d.ts +0 -10
- package/dist/esm/types/components/Textarea/editors/Markdown.d.ts +0 -10
- package/dist/esm/types/components/Textarea/editors/Richtext.d.ts +0 -12
- package/dist/esm/types/components/Textarea/index.d.ts +0 -1
- package/dist/esm/types/components/addressGroup/AddressGroup.d.ts +0 -12
- package/dist/esm/types/components/addressGroup/index.d.ts +0 -1
- package/dist/esm/types/components/addressGroup/utils/Countries.d.ts +0 -3
- package/dist/esm/types/components/states/error/index.d.ts +0 -5
- package/dist/esm/types/context/FormData.d.ts +0 -33
- package/dist/esm/types/hooks/useDependent/enhanced/useInputDependent/useInputDependent.d.ts +0 -12
- package/dist/esm/types/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.d.ts +0 -15
- package/dist/esm/types/hooks/useDependent/useDependent.d.ts +0 -11
- package/dist/esm/types/hooks/useValueGenerator/useValueGenerator.d.ts +0 -18
- package/dist/esm/types/index.d.ts +0 -2
- package/dist/esm/types/styles/Hidden.styles.d.ts +0 -7
- package/dist/esm/types/styles/Skeleton.d.ts +0 -7
- package/dist/esm/types/styles/Textfield.styles.d.ts +0 -5
- package/dist/esm/types/testutils.d.ts +0 -14
- package/dist/esm/types/types/controlProps.d.ts +0 -70
- package/dist/esm/types/types/index.d.ts +0 -166
- package/dist/esm/types/ui/menu/hooks/useMenu.d.ts +0 -14
- package/dist/esm/types/ui/menu/index.d.ts +0 -13
- package/dist/esm/types/ui/menu/test/createControl.d.ts +0 -15
- package/dist/esm/types/ui/menu/utils/detemineSubmenuTabs/index.d.ts +0 -14
- package/dist/esm/types/ui-helper/HeaderCollapseButton/index.d.ts +0 -7
- package/dist/esm/types/ui-helper/notifications/Error.d.ts +0 -6
- package/dist/esm/types/ui-helper/notifications/images/background.d.ts +0 -2
- package/dist/esm/types/ui-helper/notifications/images/spinner.d.ts +0 -2
- package/dist/esm/types/ui-helper/notifications/images/under-improvement.d.ts +0 -2
- package/dist/esm/types/utils/findFormControlError/index.d.ts +0 -3
- package/dist/esm/types/utils/hasGroupRequiredFieldsWithValues/index.d.ts +0 -6
- package/dist/types/index.d.ts +0 -244
package/dist/types/index.d.ts
DELETED
@@ -1,244 +0,0 @@
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import { SxProps } from '@mui/material';
|
3
|
-
import React from 'react';
|
4
|
-
|
5
|
-
interface ControlCommons {
|
6
|
-
key?: string;
|
7
|
-
displayName?: string;
|
8
|
-
value?: string;
|
9
|
-
mrnEntries?: {
|
10
|
-
[key: string]: any;
|
11
|
-
};
|
12
|
-
hasChanged?: boolean;
|
13
|
-
error?: {
|
14
|
-
message: string;
|
15
|
-
};
|
16
|
-
required?: boolean;
|
17
|
-
placeholder?: string;
|
18
|
-
hasEdited?: "edited" | "not-edited" | undefined;
|
19
|
-
"custom-attributes"?: CustomAttributes;
|
20
|
-
}
|
21
|
-
type FormVisibility = "hidden" | "visible" | "expert" | {
|
22
|
-
hideOnCondition: string;
|
23
|
-
};
|
24
|
-
type GenAiPrompt = {
|
25
|
-
displayValue: string;
|
26
|
-
promptTemplate: string;
|
27
|
-
profile?: string;
|
28
|
-
};
|
29
|
-
type GenAiPrompts = GenAiPrompt[];
|
30
|
-
interface CustomAttributes {
|
31
|
-
media?: string;
|
32
|
-
"mrn-ref"?: string;
|
33
|
-
"mrn-ref-display-field"?: string;
|
34
|
-
"mrn-ref-params"?: string;
|
35
|
-
"mrn-ref-mrn-field"?: string;
|
36
|
-
options?: InputFreeSoloOptions[];
|
37
|
-
mrnPreview?: {
|
38
|
-
displayField?: string;
|
39
|
-
linkDisabled?: boolean;
|
40
|
-
};
|
41
|
-
submenu?: {
|
42
|
-
icon?: string;
|
43
|
-
};
|
44
|
-
mrnSources?: MrnInputMultipleServices[];
|
45
|
-
defaultValue?: string;
|
46
|
-
defaultCollapseThreshold?: string;
|
47
|
-
visibility?: {
|
48
|
-
form?: FormVisibility;
|
49
|
-
detailView?: "hidden" | "visible";
|
50
|
-
table?: "hidden" | "visible";
|
51
|
-
};
|
52
|
-
editor?: "richtext" | "markdown" | "code" | "plate";
|
53
|
-
viewer?: "html" | "markdown";
|
54
|
-
tags?: string | string[];
|
55
|
-
genAiPrompts?: GenAiPrompts;
|
56
|
-
tooltip?: string;
|
57
|
-
[key: string]: any;
|
58
|
-
}
|
59
|
-
type MrnInputMultipleServices = {
|
60
|
-
name: string;
|
61
|
-
mrn: string;
|
62
|
-
query: string;
|
63
|
-
mrnField: string;
|
64
|
-
displayField: string;
|
65
|
-
[key: string]: any;
|
66
|
-
};
|
67
|
-
interface GroupFormControl extends ControlCommons {
|
68
|
-
control: "group";
|
69
|
-
controls: FormControls;
|
70
|
-
}
|
71
|
-
interface InputFormControl extends ControlCommons {
|
72
|
-
control: "input";
|
73
|
-
type: "plain" | "html" | "hex" | "color" | "mrn" | "url" | "date" | "time" | "datetime" | "number" | "email" | "password" | "geolocation";
|
74
|
-
placeholder?: string;
|
75
|
-
pattern?: string;
|
76
|
-
minLength?: number;
|
77
|
-
maxLength?: number;
|
78
|
-
step?: number;
|
79
|
-
}
|
80
|
-
interface InputFreeSoloOptions {
|
81
|
-
value: string;
|
82
|
-
text?: string;
|
83
|
-
tooltip?: string;
|
84
|
-
default?: "true" | "false" | undefined;
|
85
|
-
}
|
86
|
-
interface TextareaFormControl extends ControlCommons {
|
87
|
-
control: "textarea";
|
88
|
-
type: "plain" | "html" | "json";
|
89
|
-
}
|
90
|
-
interface CheckboxFormControl extends ControlCommons {
|
91
|
-
control: "checkbox";
|
92
|
-
selected?: boolean;
|
93
|
-
}
|
94
|
-
interface SelectFormControlOption extends Omit<ControlCommons, "displayName"> {
|
95
|
-
value: string;
|
96
|
-
text: string;
|
97
|
-
phone?: string;
|
98
|
-
selected?: boolean;
|
99
|
-
}
|
100
|
-
interface SelectFormControl extends ControlCommons {
|
101
|
-
control: "select";
|
102
|
-
options?: SelectFormControlOption[];
|
103
|
-
multiple?: boolean;
|
104
|
-
}
|
105
|
-
interface MultiSelectFormControl extends Omit<SelectFormControl, "value"> {
|
106
|
-
value?: string | string[];
|
107
|
-
}
|
108
|
-
interface ListFormControl extends ControlCommons {
|
109
|
-
control: "list";
|
110
|
-
items?: FormControls[];
|
111
|
-
required?: boolean;
|
112
|
-
template: FormControls;
|
113
|
-
}
|
114
|
-
type FormControl = InputFormControl | TextareaFormControl | CheckboxFormControl | SelectFormControl | MultiSelectFormControl | ListFormControl | GroupFormControl;
|
115
|
-
interface FormControls {
|
116
|
-
[key: string]: FormControl;
|
117
|
-
}
|
118
|
-
type fileUploaderEndpoint = {
|
119
|
-
url: string;
|
120
|
-
name: string;
|
121
|
-
};
|
122
|
-
type FileUploaderConfig = {
|
123
|
-
info?: string;
|
124
|
-
endpoints?: fileUploaderEndpoint[];
|
125
|
-
language?: string;
|
126
|
-
previewUrl?: (url: string) => Promise<any>;
|
127
|
-
authorizationHeader?: (url: string, method: string) => string;
|
128
|
-
};
|
129
|
-
interface FormBuilderConfigLink {
|
130
|
-
href: string;
|
131
|
-
rel: string;
|
132
|
-
text: string;
|
133
|
-
}
|
134
|
-
interface FormBuilderConfig {
|
135
|
-
method: "POST" | "GET";
|
136
|
-
links: FormBuilderConfigLink[];
|
137
|
-
error?: {
|
138
|
-
message: string;
|
139
|
-
};
|
140
|
-
items: FormControls;
|
141
|
-
}
|
142
|
-
interface resolveUrl {
|
143
|
-
(mrn: string, params: string, opts: any): Promise<any>;
|
144
|
-
}
|
145
|
-
type MessageType = string;
|
146
|
-
type MessageStatus = "error" | "success";
|
147
|
-
interface PostMessageProps {
|
148
|
-
message: MessageType;
|
149
|
-
profile: string;
|
150
|
-
}
|
151
|
-
type PostMessageResponse = {
|
152
|
-
message: MessageType;
|
153
|
-
model: string;
|
154
|
-
usage: {
|
155
|
-
answer: string;
|
156
|
-
prompt: string;
|
157
|
-
total: string;
|
158
|
-
};
|
159
|
-
status: MessageStatus;
|
160
|
-
};
|
161
|
-
|
162
|
-
type controlProps = {
|
163
|
-
formProps?: {
|
164
|
-
style?: React.CSSProperties;
|
165
|
-
};
|
166
|
-
inputProps?: {
|
167
|
-
style?: React.CSSProperties;
|
168
|
-
};
|
169
|
-
mrnProps?: {
|
170
|
-
disableMrnLink?: boolean;
|
171
|
-
};
|
172
|
-
selectProps?: {
|
173
|
-
sx?: SxProps;
|
174
|
-
textField?: {
|
175
|
-
sx?: SxProps;
|
176
|
-
};
|
177
|
-
listBox?: {
|
178
|
-
sx?: SxProps;
|
179
|
-
};
|
180
|
-
};
|
181
|
-
footerProps?: {
|
182
|
-
style?: React.CSSProperties;
|
183
|
-
container?: {
|
184
|
-
style?: React.CSSProperties;
|
185
|
-
};
|
186
|
-
submitButtonContainer?: {
|
187
|
-
style?: React.CSSProperties;
|
188
|
-
};
|
189
|
-
submitButton?: {
|
190
|
-
sx?: SxProps;
|
191
|
-
};
|
192
|
-
};
|
193
|
-
addressProps?: {
|
194
|
-
style?: React.CSSProperties;
|
195
|
-
label?: {
|
196
|
-
style?: React.CSSProperties;
|
197
|
-
};
|
198
|
-
container?: {
|
199
|
-
style?: React.CSSProperties;
|
200
|
-
};
|
201
|
-
};
|
202
|
-
controlWrapperProps?: {
|
203
|
-
style?: React.CSSProperties;
|
204
|
-
label?: {
|
205
|
-
style?: React.CSSProperties;
|
206
|
-
};
|
207
|
-
container?: {
|
208
|
-
style?: React.CSSProperties;
|
209
|
-
};
|
210
|
-
};
|
211
|
-
groupProps?: {
|
212
|
-
style?: React.CSSProperties;
|
213
|
-
label?: {
|
214
|
-
style?: React.CSSProperties;
|
215
|
-
};
|
216
|
-
};
|
217
|
-
listProps?: {
|
218
|
-
style?: React.CSSProperties;
|
219
|
-
addButton?: {
|
220
|
-
sx?: SxProps;
|
221
|
-
};
|
222
|
-
label?: {
|
223
|
-
style?: React.CSSProperties;
|
224
|
-
};
|
225
|
-
container?: {
|
226
|
-
style?: React.CSSProperties;
|
227
|
-
};
|
228
|
-
};
|
229
|
-
};
|
230
|
-
|
231
|
-
type FormState = "processing" | "success" | "error";
|
232
|
-
interface IProps {
|
233
|
-
config: FormBuilderConfig;
|
234
|
-
controlProps?: controlProps;
|
235
|
-
fileUploaderConfig?: FileUploaderConfig;
|
236
|
-
iconType?: string;
|
237
|
-
state?: FormState | "";
|
238
|
-
resolveUrl?: resolveUrl;
|
239
|
-
onSubmit?: (urlEncodedFormValues: string, formValues: any) => Promise<any>;
|
240
|
-
postGenAiMessage?: ({ message, profile, }: PostMessageProps) => Promise<PostMessageResponse>;
|
241
|
-
}
|
242
|
-
declare const FormBuilder: ({ config, controlProps, fileUploaderConfig, iconType, state, resolveUrl, onSubmit, postGenAiMessage, }: IProps) => react_jsx_runtime.JSX.Element;
|
243
|
-
|
244
|
-
export { type IProps as IFormBuilderProps, FormBuilder as default };
|