@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.
Files changed (111) hide show
  1. package/dist/formbuilder.js +660 -0
  2. package/dist/formbuilder.js.LICENSE.txt +60 -0
  3. package/dist/formbuilder.js.map +1 -0
  4. package/package.json +51 -44
  5. package/dist/esm/index.js +0 -128984
  6. package/dist/esm/index.js.map +0 -1
  7. package/dist/esm/types/assets/icons/error/Error.d.ts +0 -2
  8. package/dist/esm/types/components/Checkbox/Checkbox.d.ts +0 -10
  9. package/dist/esm/types/components/Checkbox/index.d.ts +0 -1
  10. package/dist/esm/types/components/ControlWrapper/ControlWrapper.d.ts +0 -11
  11. package/dist/esm/types/components/ControlWrapper/index.d.ts +0 -1
  12. package/dist/esm/types/components/DateRangeGroup/DateRangeGroup.d.ts +0 -10
  13. package/dist/esm/types/components/DateRangeGroup/DateRangeGroup.styles.d.ts +0 -3
  14. package/dist/esm/types/components/DateRangeGroup/components/CalendarModal.d.ts +0 -14
  15. package/dist/esm/types/components/DateRangeGroup/index.d.ts +0 -1
  16. package/dist/esm/types/components/ErrorBoundary/ErrorBoundary.d.ts +0 -14
  17. package/dist/esm/types/components/FileUploader/FileUploader.d.ts +0 -9
  18. package/dist/esm/types/components/FileUploader/index.d.ts +0 -1
  19. package/dist/esm/types/components/FormBuilder/FormBuilder.d.ts +0 -25
  20. package/dist/esm/types/components/FormBuilder/index.d.ts +0 -1
  21. package/dist/esm/types/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.d.ts +0 -6
  22. package/dist/esm/types/components/FormBuilder/utils/extractFormControlValues/index.d.ts +0 -1
  23. package/dist/esm/types/components/FormBuilder/utils/jsonToUrlEncoded/index.d.ts +0 -1
  24. package/dist/esm/types/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.d.ts +0 -5
  25. package/dist/esm/types/components/FormFooter/FormFooter.d.ts +0 -15
  26. package/dist/esm/types/components/FormFooter/components/Switch.d.ts +0 -1
  27. package/dist/esm/types/components/FormFooter/index.d.ts +0 -1
  28. package/dist/esm/types/components/FormGroup/FormGroup.d.ts +0 -15
  29. package/dist/esm/types/components/FormGroup/index.d.ts +0 -1
  30. package/dist/esm/types/components/FormList/FormList.d.ts +0 -11
  31. package/dist/esm/types/components/FormList/index.d.ts +0 -1
  32. package/dist/esm/types/components/GeneralFormGroup/GeneralFormGroup.d.ts +0 -5
  33. package/dist/esm/types/components/GeneralFormGroup/index.d.ts +0 -1
  34. package/dist/esm/types/components/Group/Group.d.ts +0 -12
  35. package/dist/esm/types/components/Group/index.d.ts +0 -1
  36. package/dist/esm/types/components/Input/Input.d.ts +0 -14
  37. package/dist/esm/types/components/Input/index.d.ts +0 -1
  38. package/dist/esm/types/components/Input/input.styles.d.ts +0 -9
  39. package/dist/esm/types/components/InputFreeSolo/InputFreeSolo.d.ts +0 -10
  40. package/dist/esm/types/components/InputFreeSolo/index.d.ts +0 -1
  41. package/dist/esm/types/components/MrnInput/MrnInput.d.ts +0 -11
  42. package/dist/esm/types/components/MrnInput/hooks/useMrn.d.ts +0 -22
  43. package/dist/esm/types/components/MrnInput/index.d.ts +0 -1
  44. package/dist/esm/types/components/MrnInput/services/fetchMrn.d.ts +0 -3
  45. package/dist/esm/types/components/MrnInput/ui-helper/Link/Link.d.ts +0 -3
  46. package/dist/esm/types/components/MrnInput/utils/mrnUtils/mrnUtils.d.ts +0 -8
  47. package/dist/esm/types/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.d.ts +0 -2
  48. package/dist/esm/types/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.d.ts +0 -2
  49. package/dist/esm/types/components/MrnInput/utils/urlSearchParam/urlSearchParam.d.ts +0 -1
  50. package/dist/esm/types/components/MultiSelect/MultiSelect.d.ts +0 -17
  51. package/dist/esm/types/components/MultiSelect/index.d.ts +0 -1
  52. package/dist/esm/types/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.d.ts +0 -24
  53. package/dist/esm/types/components/MultiSelect/utils/extractSelectedOptionValues/index.d.ts +0 -1
  54. package/dist/esm/types/components/PasswordInput/PasswordInput.d.ts +0 -12
  55. package/dist/esm/types/components/PasswordInput/index.d.ts +0 -1
  56. package/dist/esm/types/components/QueryControl/QueryControl.d.ts +0 -13
  57. package/dist/esm/types/components/QueryControl/data/defaultControls.d.ts +0 -9
  58. package/dist/esm/types/components/QueryControl/index.d.ts +0 -1
  59. package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.d.ts +0 -8
  60. package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.d.ts +0 -6
  61. package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/index.d.ts +0 -1
  62. package/dist/esm/types/components/QueryControl/utils/allControlsHidden/allControlsHidden.d.ts +0 -3
  63. package/dist/esm/types/components/QueryControl/utils/allControlsHidden/index.d.ts +0 -1
  64. package/dist/esm/types/components/QueryControl/utils/getMatchingControls.d.ts +0 -9
  65. package/dist/esm/types/components/QueryControl/utils/hasExpertControl/hasExpertControl.d.ts +0 -3
  66. package/dist/esm/types/components/QueryControl/utils/hasExpertControl/index.d.ts +0 -1
  67. package/dist/esm/types/components/QueryControl/utils/hideGroup/hideGroup.d.ts +0 -3
  68. package/dist/esm/types/components/QueryControl/utils/hideGroup/index.d.ts +0 -1
  69. package/dist/esm/types/components/Select/Select.d.ts +0 -12
  70. package/dist/esm/types/components/Select/index.d.ts +0 -1
  71. package/dist/esm/types/components/Select/utils/getSelectedOption.d.ts +0 -3
  72. package/dist/esm/types/components/Textarea/Textarea.d.ts +0 -10
  73. package/dist/esm/types/components/Textarea/Textarea.types.d.ts +0 -12
  74. package/dist/esm/types/components/Textarea/aiWrapper/aiAction.d.ts +0 -12
  75. package/dist/esm/types/components/Textarea/aiWrapper/aiLayout.d.ts +0 -10
  76. package/dist/esm/types/components/Textarea/aiWrapper/index.d.ts +0 -11
  77. package/dist/esm/types/components/Textarea/aiWrapper/useAi.d.ts +0 -21
  78. package/dist/esm/types/components/Textarea/editors/Default.d.ts +0 -13
  79. package/dist/esm/types/components/Textarea/editors/Html.d.ts +0 -10
  80. package/dist/esm/types/components/Textarea/editors/Json.d.ts +0 -10
  81. package/dist/esm/types/components/Textarea/editors/Markdown.d.ts +0 -10
  82. package/dist/esm/types/components/Textarea/editors/Richtext.d.ts +0 -12
  83. package/dist/esm/types/components/Textarea/index.d.ts +0 -1
  84. package/dist/esm/types/components/addressGroup/AddressGroup.d.ts +0 -12
  85. package/dist/esm/types/components/addressGroup/index.d.ts +0 -1
  86. package/dist/esm/types/components/addressGroup/utils/Countries.d.ts +0 -3
  87. package/dist/esm/types/components/states/error/index.d.ts +0 -5
  88. package/dist/esm/types/context/FormData.d.ts +0 -33
  89. package/dist/esm/types/hooks/useDependent/enhanced/useInputDependent/useInputDependent.d.ts +0 -12
  90. package/dist/esm/types/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.d.ts +0 -15
  91. package/dist/esm/types/hooks/useDependent/useDependent.d.ts +0 -11
  92. package/dist/esm/types/hooks/useValueGenerator/useValueGenerator.d.ts +0 -18
  93. package/dist/esm/types/index.d.ts +0 -2
  94. package/dist/esm/types/styles/Hidden.styles.d.ts +0 -7
  95. package/dist/esm/types/styles/Skeleton.d.ts +0 -7
  96. package/dist/esm/types/styles/Textfield.styles.d.ts +0 -5
  97. package/dist/esm/types/testutils.d.ts +0 -14
  98. package/dist/esm/types/types/controlProps.d.ts +0 -70
  99. package/dist/esm/types/types/index.d.ts +0 -166
  100. package/dist/esm/types/ui/menu/hooks/useMenu.d.ts +0 -14
  101. package/dist/esm/types/ui/menu/index.d.ts +0 -13
  102. package/dist/esm/types/ui/menu/test/createControl.d.ts +0 -15
  103. package/dist/esm/types/ui/menu/utils/detemineSubmenuTabs/index.d.ts +0 -14
  104. package/dist/esm/types/ui-helper/HeaderCollapseButton/index.d.ts +0 -7
  105. package/dist/esm/types/ui-helper/notifications/Error.d.ts +0 -6
  106. package/dist/esm/types/ui-helper/notifications/images/background.d.ts +0 -2
  107. package/dist/esm/types/ui-helper/notifications/images/spinner.d.ts +0 -2
  108. package/dist/esm/types/ui-helper/notifications/images/under-improvement.d.ts +0 -2
  109. package/dist/esm/types/utils/findFormControlError/index.d.ts +0 -3
  110. package/dist/esm/types/utils/hasGroupRequiredFieldsWithValues/index.d.ts +0 -6
  111. package/dist/types/index.d.ts +0 -244
@@ -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 };