@formio/vue 5.0.0 → 6.0.0-rc.1
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/README.md +9 -8
- package/dist/components/Form.js +271 -0
- package/dist/components/Form.js.map +1 -0
- package/dist/components/FormBuilder.js +144 -0
- package/dist/components/FormBuilder.js.map +1 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/composables/useFormioRef.js +11 -0
- package/dist/composables/useFormioRef.js.map +1 -0
- package/dist/index.d.ts +245 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.cjs +2091 -0
- package/dist/index.umd.cjs.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +22 -14
- package/lib/components/Form.d.ts +0 -26
- package/lib/components/Form.js +0 -47
- package/lib/components/Form.js.map +0 -1
- package/lib/components/FormBuilder.d.ts +0 -25
- package/lib/components/FormBuilder.js +0 -49
- package/lib/components/FormBuilder.js.map +0 -1
- package/lib/components/index.d.ts +0 -3
- package/lib/components/index.js +0 -11
- package/lib/components/index.js.map +0 -1
- package/lib/composables/form/useInitializeFormio.d.ts +0 -6
- package/lib/composables/form/useInitializeFormio.js +0 -91
- package/lib/composables/form/useInitializeFormio.js.map +0 -1
- package/lib/composables/formBuilder/useInitializeBuilder.d.ts +0 -6
- package/lib/composables/formBuilder/useInitializeBuilder.js +0 -48
- package/lib/composables/formBuilder/useInitializeBuilder.js.map +0 -1
- package/lib/composables/useFormioRef.d.ts +0 -7
- package/lib/composables/useFormioRef.js +0 -14
- package/lib/composables/useFormioRef.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -24
- package/lib/index.js.map +0 -1
- package/lib/intefaces/form/initializeFormOptions.d.ts +0 -5
- package/lib/intefaces/form/initializeFormOptions.js +0 -4
- package/lib/intefaces/form/initializeFormOptions.js.map +0 -1
- package/lib/intefaces/formBuilder/initializeFormBuilderOptions.d.ts +0 -5
- package/lib/intefaces/formBuilder/initializeFormBuilderOptions.js +0 -4
- package/lib/intefaces/formBuilder/initializeFormBuilderOptions.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# vue
|
|
1
|
+
# @formio/vue
|
|
2
2
|
|
|
3
|
-
A [Vue.js](
|
|
3
|
+
A [Vue.js](https://vuejs.org/) component for rendering out forms based on the [Form.io](https://www.form.io) platform.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ npm-compatible packaging system such as [Browserify](http://browserify.org/) or
|
|
|
11
11
|
[webpack](http://webpack.github.io/).
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
npm install vue
|
|
14
|
+
npm install @formio/vue --save
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Basic Usage
|
|
@@ -28,7 +28,7 @@ HTML inside of Vue template file:
|
|
|
28
28
|
Javascript inside of Vue template file.
|
|
29
29
|
```
|
|
30
30
|
<script>
|
|
31
|
-
import { Form } from 'vue
|
|
31
|
+
import { Form } from '@formio/vue';
|
|
32
32
|
export default {
|
|
33
33
|
name: 'app',
|
|
34
34
|
components: { formio: Form },
|
|
@@ -41,7 +41,7 @@ Javascript inside of Vue template file.
|
|
|
41
41
|
|
|
42
42
|
The form API source from [form.io](https://www.form.io) or your custom formio server.
|
|
43
43
|
|
|
44
|
-
See the [Creating a form](
|
|
44
|
+
See the [Creating a form](https://help.form.io/userguide/forms/form-creation#creating-a-form)
|
|
45
45
|
for where to set the API Path for your form.
|
|
46
46
|
|
|
47
47
|
You can also pass in the submission url as the `src` and the form will render with the data populated from the submission.
|
|
@@ -64,11 +64,11 @@ An object representing the default data for the form.
|
|
|
64
64
|
|
|
65
65
|
### `options`: `object`
|
|
66
66
|
|
|
67
|
-
An object with the formio.js options that is passed through. See [Form.io Options](https://
|
|
67
|
+
An object with the formio.js options that is passed through. See [Form.io Options](https://help.form.io/developers/form-development/form-renderer#form-renderer-options).
|
|
68
68
|
|
|
69
69
|
## Events
|
|
70
70
|
|
|
71
|
-
All events triggered from the form are available via the v-on property. See [Form.io Events](https://
|
|
71
|
+
All events triggered from the form are available via the v-on property. See [Form.io Events](https://help.form.io/developers/form-development/form-renderer#form-events) for all the available events.
|
|
72
72
|
|
|
73
73
|
Then on the form set `<formio src="myform" v-on:submit="doSomething" />`
|
|
74
74
|
|
|
@@ -86,7 +86,7 @@ HTML inside of Vue template file:
|
|
|
86
86
|
Javascript inside of Vue template file.
|
|
87
87
|
```
|
|
88
88
|
<script>
|
|
89
|
-
import { FormBuilder } from 'vue
|
|
89
|
+
import { FormBuilder } from '@formio/vue';
|
|
90
90
|
export default {
|
|
91
91
|
name: 'app',
|
|
92
92
|
components: { FormBuilder },
|
|
@@ -114,3 +114,4 @@ All methods are available here https://help.form.io/developers/form-renderer#for
|
|
|
114
114
|
|
|
115
115
|
## License
|
|
116
116
|
Released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
|
117
|
+
touch
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, onBeforeUnmount, watch, toRaw } from 'vue';
|
|
2
|
+
import { EventEmitter, Form as FormClass } from '@formio/js';
|
|
3
|
+
import structuredClone from '@ungap/structured-clone';
|
|
4
|
+
import useFormioRef from '../composables/useFormioRef';
|
|
5
|
+
const getDefaultEmitter = () => {
|
|
6
|
+
return new EventEmitter({
|
|
7
|
+
wildcard: false,
|
|
8
|
+
maxListeners: 0,
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
const onAnyEvent = (handlers, ...args) => {
|
|
12
|
+
const [event, ...outputArgs] = args;
|
|
13
|
+
if (event.startsWith('formio.')) {
|
|
14
|
+
const funcName = `on${event.charAt(7).toUpperCase()}${event.slice(8)}`;
|
|
15
|
+
switch (funcName) {
|
|
16
|
+
case 'onPrevPage':
|
|
17
|
+
if (handlers.onPrevPage)
|
|
18
|
+
handlers.onPrevPage(outputArgs[0], outputArgs[1]);
|
|
19
|
+
break;
|
|
20
|
+
case 'onNextPage':
|
|
21
|
+
if (handlers.onNextPage)
|
|
22
|
+
handlers.onNextPage(outputArgs[0], outputArgs[1]);
|
|
23
|
+
break;
|
|
24
|
+
case 'onCancelSubmit':
|
|
25
|
+
if (handlers.onCancelSubmit)
|
|
26
|
+
handlers.onCancelSubmit();
|
|
27
|
+
break;
|
|
28
|
+
case 'onCancelComponent':
|
|
29
|
+
if (handlers.onCancelComponent)
|
|
30
|
+
handlers.onCancelComponent(outputArgs[0]);
|
|
31
|
+
break;
|
|
32
|
+
case 'onChange':
|
|
33
|
+
if (handlers.onChange)
|
|
34
|
+
handlers.onChange(outputArgs[0], outputArgs[1], outputArgs[2]);
|
|
35
|
+
break;
|
|
36
|
+
case 'onCustomEvent':
|
|
37
|
+
if (handlers.onCustomEvent)
|
|
38
|
+
handlers.onCustomEvent(outputArgs[0]);
|
|
39
|
+
break;
|
|
40
|
+
case 'onComponentChange':
|
|
41
|
+
if (handlers.onComponentChange)
|
|
42
|
+
handlers.onComponentChange(outputArgs[0]);
|
|
43
|
+
break;
|
|
44
|
+
case 'onSubmit':
|
|
45
|
+
if (handlers.onSubmit)
|
|
46
|
+
handlers.onSubmit(outputArgs[0], outputArgs[1]);
|
|
47
|
+
break;
|
|
48
|
+
case 'onSubmitDone':
|
|
49
|
+
if (handlers.onSubmitDone)
|
|
50
|
+
handlers.onSubmitDone(outputArgs[0]);
|
|
51
|
+
break;
|
|
52
|
+
case 'onSubmitError':
|
|
53
|
+
if (handlers.onSubmitError)
|
|
54
|
+
handlers.onSubmitError(outputArgs[0]);
|
|
55
|
+
break;
|
|
56
|
+
case 'onFormLoad':
|
|
57
|
+
if (handlers.onFormLoad)
|
|
58
|
+
handlers.onFormLoad(outputArgs[0]);
|
|
59
|
+
break;
|
|
60
|
+
case 'onError':
|
|
61
|
+
if (handlers.onError)
|
|
62
|
+
handlers.onError(outputArgs[0]);
|
|
63
|
+
break;
|
|
64
|
+
case 'onRender':
|
|
65
|
+
if (handlers.onRender)
|
|
66
|
+
handlers.onRender(outputArgs[0]);
|
|
67
|
+
break;
|
|
68
|
+
case 'onAttach':
|
|
69
|
+
if (handlers.onAttach)
|
|
70
|
+
handlers.onAttach(outputArgs[0]);
|
|
71
|
+
break;
|
|
72
|
+
case 'onBuild':
|
|
73
|
+
if (handlers.onBuild)
|
|
74
|
+
handlers.onBuild(outputArgs[0]);
|
|
75
|
+
break;
|
|
76
|
+
case 'onFocus':
|
|
77
|
+
if (handlers.onFocus)
|
|
78
|
+
handlers.onFocus(outputArgs[0]);
|
|
79
|
+
break;
|
|
80
|
+
case 'onBlur':
|
|
81
|
+
if (handlers.onBlur)
|
|
82
|
+
handlers.onBlur(outputArgs[0]);
|
|
83
|
+
break;
|
|
84
|
+
case 'onInitialized':
|
|
85
|
+
if (handlers.onInitialized)
|
|
86
|
+
handlers.onInitialized();
|
|
87
|
+
break;
|
|
88
|
+
case 'onLanguageChanged':
|
|
89
|
+
if (handlers.onLanguageChanged)
|
|
90
|
+
handlers.onLanguageChanged();
|
|
91
|
+
break;
|
|
92
|
+
case 'onBeforeSetSubmission':
|
|
93
|
+
if (handlers.onBeforeSetSubmission)
|
|
94
|
+
handlers.onBeforeSetSubmission(outputArgs[0]);
|
|
95
|
+
break;
|
|
96
|
+
case 'onSaveDraftBegin':
|
|
97
|
+
if (handlers.onSaveDraftBegin)
|
|
98
|
+
handlers.onSaveDraftBegin();
|
|
99
|
+
break;
|
|
100
|
+
case 'onSaveDraft':
|
|
101
|
+
if (handlers.onSaveDraft)
|
|
102
|
+
handlers.onSaveDraft(outputArgs[0]);
|
|
103
|
+
break;
|
|
104
|
+
case 'onRestoreDraft':
|
|
105
|
+
if (handlers.onRestoreDraft)
|
|
106
|
+
handlers.onRestoreDraft(outputArgs[0]);
|
|
107
|
+
break;
|
|
108
|
+
case 'onSubmissionDeleted':
|
|
109
|
+
if (handlers.onSubmissionDeleted)
|
|
110
|
+
handlers.onSubmissionDeleted(outputArgs[0]);
|
|
111
|
+
break;
|
|
112
|
+
case 'onRequestDone':
|
|
113
|
+
if (handlers.onRequestDone)
|
|
114
|
+
handlers.onRequestDone();
|
|
115
|
+
break;
|
|
116
|
+
default:
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (handlers.otherEvents && handlers.otherEvents[event]) {
|
|
121
|
+
handlers.otherEvents[event](...outputArgs);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const createWebformInstance = async (FormConstructor, formSource, element, options = {}) => {
|
|
125
|
+
if (!options?.events) {
|
|
126
|
+
options.events = getDefaultEmitter();
|
|
127
|
+
}
|
|
128
|
+
if (typeof formSource !== 'string') {
|
|
129
|
+
formSource = structuredClone(toRaw(formSource));
|
|
130
|
+
}
|
|
131
|
+
const promise = FormConstructor
|
|
132
|
+
? new FormConstructor(element, formSource, options)
|
|
133
|
+
: new FormClass(element, formSource, options);
|
|
134
|
+
const instance = await promise.ready;
|
|
135
|
+
return instance;
|
|
136
|
+
};
|
|
137
|
+
const getEffectiveProps = (props) => {
|
|
138
|
+
const { FormClass, formioform, form, src, formReady, onFormReady } = props;
|
|
139
|
+
const formConstructor = FormClass !== undefined ? FormClass : formioform;
|
|
140
|
+
const formSource = form !== undefined ? form : src;
|
|
141
|
+
const formReadyCallback = onFormReady !== undefined ? onFormReady : formReady;
|
|
142
|
+
return { formConstructor, formSource, formReadyCallback };
|
|
143
|
+
};
|
|
144
|
+
export const Form = defineComponent({
|
|
145
|
+
name: 'FormComponent',
|
|
146
|
+
props: {
|
|
147
|
+
className: String,
|
|
148
|
+
style: Object,
|
|
149
|
+
src: [String, Object],
|
|
150
|
+
url: String,
|
|
151
|
+
form: Object,
|
|
152
|
+
submission: Object,
|
|
153
|
+
options: Object,
|
|
154
|
+
formioform: Object,
|
|
155
|
+
FormClass: Object,
|
|
156
|
+
formReady: Function,
|
|
157
|
+
onFormReady: Function,
|
|
158
|
+
onPrevPage: Function,
|
|
159
|
+
onNextPage: Function,
|
|
160
|
+
onCancelSubmit: Function,
|
|
161
|
+
onCancelComponent: Function,
|
|
162
|
+
onChange: Function,
|
|
163
|
+
onCustomEvent: Function,
|
|
164
|
+
onComponentChange: Function,
|
|
165
|
+
onSubmit: Function,
|
|
166
|
+
onSubmitDone: Function,
|
|
167
|
+
onSubmitError: Function,
|
|
168
|
+
onFormLoad: Function,
|
|
169
|
+
onError: Function,
|
|
170
|
+
onRender: Function,
|
|
171
|
+
onAttach: Function,
|
|
172
|
+
onBuild: Function,
|
|
173
|
+
onFocus: Function,
|
|
174
|
+
onBlur: Function,
|
|
175
|
+
onInitialized: Function,
|
|
176
|
+
onLanguageChanged: Function,
|
|
177
|
+
onBeforeSetSubmission: Function,
|
|
178
|
+
onSaveDraftBegin: Function,
|
|
179
|
+
onSaveDraft: Function,
|
|
180
|
+
onRestoreDraft: Function,
|
|
181
|
+
onSubmissionDeleted: Function,
|
|
182
|
+
onRequestDone: Function,
|
|
183
|
+
otherEvents: Object,
|
|
184
|
+
},
|
|
185
|
+
setup(props, context) {
|
|
186
|
+
const { formioRef, render } = useFormioRef();
|
|
187
|
+
const formInstance = ref(null);
|
|
188
|
+
const instanceIsReady = ref(false);
|
|
189
|
+
const { src, form, submission, url, options, formioform, formReady, FormClass, style, className, ...handlers } = props;
|
|
190
|
+
const createInstance = async () => {
|
|
191
|
+
const { formConstructor, formSource, formReadyCallback } = getEffectiveProps(props);
|
|
192
|
+
if (formioRef.value === null) {
|
|
193
|
+
console.warn('Form element not found');
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (typeof formSource === 'undefined') {
|
|
197
|
+
console.warn('Form source not found');
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const instance = await createWebformInstance(formConstructor, formSource, formioRef.value, props.options);
|
|
201
|
+
if (instance) {
|
|
202
|
+
if (typeof formSource === 'string') {
|
|
203
|
+
instance.src = formSource;
|
|
204
|
+
}
|
|
205
|
+
else if (typeof formSource === 'object') {
|
|
206
|
+
instance.form = formSource;
|
|
207
|
+
if (props.url) {
|
|
208
|
+
instance.url = props.url;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
formReadyCallback?.(instance);
|
|
212
|
+
formInstance.value = instance;
|
|
213
|
+
instanceIsReady.value = true;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
console.warn('Failed to create form instance');
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
const cleanupInstance = () => {
|
|
220
|
+
instanceIsReady.value = false;
|
|
221
|
+
if (formInstance.value) {
|
|
222
|
+
formInstance.value.destroy(true);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
onMounted(() => {
|
|
226
|
+
createInstance();
|
|
227
|
+
});
|
|
228
|
+
onBeforeUnmount(() => {
|
|
229
|
+
cleanupInstance();
|
|
230
|
+
});
|
|
231
|
+
watch(() => [
|
|
232
|
+
props.FormClass,
|
|
233
|
+
props.formioform,
|
|
234
|
+
props.onFormReady,
|
|
235
|
+
props.formReady,
|
|
236
|
+
props.form,
|
|
237
|
+
props.src,
|
|
238
|
+
props.options,
|
|
239
|
+
props.url,
|
|
240
|
+
], () => {
|
|
241
|
+
if (instanceIsReady.value) {
|
|
242
|
+
cleanupInstance();
|
|
243
|
+
}
|
|
244
|
+
createInstance();
|
|
245
|
+
});
|
|
246
|
+
watch(() => [
|
|
247
|
+
instanceIsReady.value,
|
|
248
|
+
props.submission
|
|
249
|
+
], () => {
|
|
250
|
+
if (instanceIsReady.value && formInstance.value && props.submission) {
|
|
251
|
+
formInstance.value.submission = props.submission;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
watch(() => [
|
|
255
|
+
instanceIsReady.value,
|
|
256
|
+
handlers,
|
|
257
|
+
], (newValue, oldValue, onCleanup) => {
|
|
258
|
+
if (instanceIsReady.value && formInstance.value && Object.keys(handlers).length > 0) {
|
|
259
|
+
formInstance.value.onAny((...args) => onAnyEvent(handlers, ...args));
|
|
260
|
+
}
|
|
261
|
+
onCleanup(() => {
|
|
262
|
+
if (instanceIsReady.value && formInstance.value && Object.keys(handlers).length > 0) {
|
|
263
|
+
formInstance.value.offAny((...args) => onAnyEvent(handlers, ...args));
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}, { immediate: true });
|
|
267
|
+
context.expose({ formio: formInstance });
|
|
268
|
+
return render;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
//# sourceMappingURL=Form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../src/components/Form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAyC,KAAK,EAAE,MAAM,KAAK,CAAC;AAC5H,OAAO,EAAE,YAAY,EAAE,IAAI,IAAI,SAAS,EAAW,MAAM,YAAY,CAAC;AACtE,OAAO,eAAe,MAAM,yBAAyB,CAAC;AAEtD,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAEvD,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC7B,OAAO,IAAI,YAAY,CAAC;QACtB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,CAAC;KAChB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CACjB,QAAsB,EACtB,GAAG,IAAwB,EAC3B,EAAE;IACF,MAAM,CAAC,KAAK,EAAE,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;IACpC,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,YAAY;gBACf,IAAI,QAAQ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GAAG,IAAwB,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;YAC3F,CAAC;YACD,SAAS,CAAC,GAAG,EAAE;gBACb,IAAI,eAAe,CAAC,KAAK,IAAI,YAAY,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACpF,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,IAAwB,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;gBAC5F,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,EACD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;QAEF,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;QAEzC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { defineComponent, onMounted, onBeforeUnmount, ref, watch, toRaw } from 'vue';
|
|
2
|
+
import { FormBuilder as FormioFormBuilder } from '@formio/js';
|
|
3
|
+
import structuredClone from '@ungap/structured-clone';
|
|
4
|
+
import useFormioRef from '../composables/useFormioRef';
|
|
5
|
+
const toggleEventHandlers = (builder, handlers, shouldAttach = true) => {
|
|
6
|
+
const fn = shouldAttach ? 'on' : 'off';
|
|
7
|
+
const { onSaveComponent, onEditComponent, onUpdateComponent, onDeleteComponent, onChange, } = handlers;
|
|
8
|
+
builder.instance[fn]('saveComponent', (component, original, parent, path, index, isNew, originalComponentSchema) => {
|
|
9
|
+
onSaveComponent?.(component, original, parent, path, index, isNew, originalComponentSchema);
|
|
10
|
+
onChange?.(structuredClone(toRaw(builder.instance.form)));
|
|
11
|
+
});
|
|
12
|
+
builder.instance[fn]('updateComponent', (component) => {
|
|
13
|
+
onUpdateComponent?.(component);
|
|
14
|
+
onChange?.(structuredClone(toRaw(builder.instance.form)));
|
|
15
|
+
});
|
|
16
|
+
builder.instance[fn]('removeComponent', (component, parent, path, index) => {
|
|
17
|
+
onDeleteComponent?.(component, parent, path, index);
|
|
18
|
+
onChange?.(structuredClone(toRaw(builder.instance.form)));
|
|
19
|
+
});
|
|
20
|
+
builder.instance[fn]('cancelComponent', (component) => {
|
|
21
|
+
onUpdateComponent?.(component);
|
|
22
|
+
onChange?.(structuredClone(toRaw(builder.instance.form)));
|
|
23
|
+
});
|
|
24
|
+
builder.instance[fn]('editComponent', (component) => {
|
|
25
|
+
onEditComponent?.(component);
|
|
26
|
+
onChange?.(structuredClone(toRaw(builder.instance.form)));
|
|
27
|
+
});
|
|
28
|
+
builder.instance[fn]('addComponent', () => {
|
|
29
|
+
onChange?.(structuredClone(toRaw(builder.instance.form)));
|
|
30
|
+
});
|
|
31
|
+
builder.instance[fn]('pdfUploaded', () => {
|
|
32
|
+
onChange?.(structuredClone(toRaw(builder.instance.form)));
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const createBuilderInstance = async (element, form = { display: 'form', components: [] }, options = {}) => {
|
|
36
|
+
options = Object.assign({}, options);
|
|
37
|
+
form = Object.assign({}, form);
|
|
38
|
+
const instance = new FormioFormBuilder(element, form, options);
|
|
39
|
+
await instance.ready;
|
|
40
|
+
return instance;
|
|
41
|
+
};
|
|
42
|
+
const DEFAULT_FORM = { display: 'form', components: [] };
|
|
43
|
+
export const FormBuilder = defineComponent({
|
|
44
|
+
name: 'FormBuilder',
|
|
45
|
+
props: {
|
|
46
|
+
options: Object,
|
|
47
|
+
initialForm: {
|
|
48
|
+
type: Object,
|
|
49
|
+
default: () => DEFAULT_FORM,
|
|
50
|
+
},
|
|
51
|
+
onBuilderReady: Function,
|
|
52
|
+
onChange: Function,
|
|
53
|
+
onSaveComponent: Function,
|
|
54
|
+
onEditComponent: Function,
|
|
55
|
+
onUpdateComponent: Function,
|
|
56
|
+
onDeleteComponent: Function,
|
|
57
|
+
},
|
|
58
|
+
setup(props, context) {
|
|
59
|
+
const { formioRef, render } = useFormioRef();
|
|
60
|
+
const builder = ref(null);
|
|
61
|
+
const instanceIsReady = ref(false);
|
|
62
|
+
const createInstance = async () => {
|
|
63
|
+
if (!formioRef.value) {
|
|
64
|
+
console.warn('FormBuilder render element not found, cannot render builder.');
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const instance = await createBuilderInstance(formioRef.value, structuredClone(props.initialForm), props.options);
|
|
68
|
+
if (instance) {
|
|
69
|
+
if (props.onBuilderReady) {
|
|
70
|
+
props.onBuilderReady(instance);
|
|
71
|
+
}
|
|
72
|
+
builder.value = instance;
|
|
73
|
+
instanceIsReady.value = true;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
console.warn('Failed to create FormBuilder instance');
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const cleanupInstance = () => {
|
|
80
|
+
instanceIsReady.value = false;
|
|
81
|
+
if (builder.value) {
|
|
82
|
+
builder.value.instance.destroy(true);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
watch(() => [
|
|
86
|
+
props.initialForm,
|
|
87
|
+
props.options,
|
|
88
|
+
props.onBuilderReady,
|
|
89
|
+
], () => {
|
|
90
|
+
if (instanceIsReady.value) {
|
|
91
|
+
cleanupInstance();
|
|
92
|
+
}
|
|
93
|
+
createInstance();
|
|
94
|
+
});
|
|
95
|
+
onMounted(() => {
|
|
96
|
+
createInstance();
|
|
97
|
+
});
|
|
98
|
+
onBeforeUnmount(() => {
|
|
99
|
+
cleanupInstance();
|
|
100
|
+
});
|
|
101
|
+
watch(() => [
|
|
102
|
+
props.initialForm,
|
|
103
|
+
props.options,
|
|
104
|
+
props.onBuilderReady,
|
|
105
|
+
], () => {
|
|
106
|
+
if (instanceIsReady.value) {
|
|
107
|
+
cleanupInstance();
|
|
108
|
+
}
|
|
109
|
+
createInstance();
|
|
110
|
+
});
|
|
111
|
+
watch(() => [
|
|
112
|
+
instanceIsReady.value,
|
|
113
|
+
props.onChange,
|
|
114
|
+
props.onDeleteComponent,
|
|
115
|
+
props.onEditComponent,
|
|
116
|
+
props.onSaveComponent,
|
|
117
|
+
props.onUpdateComponent,
|
|
118
|
+
], (newValues, oldValues, onCleanup) => {
|
|
119
|
+
if (instanceIsReady.value && builder.value) {
|
|
120
|
+
toggleEventHandlers(builder.value, {
|
|
121
|
+
onChange: props.onChange,
|
|
122
|
+
onDeleteComponent: props.onDeleteComponent,
|
|
123
|
+
onEditComponent: props.onEditComponent,
|
|
124
|
+
onSaveComponent: props.onSaveComponent,
|
|
125
|
+
onUpdateComponent: props.onUpdateComponent,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
onCleanup(() => {
|
|
129
|
+
if (instanceIsReady.value && builder.value) {
|
|
130
|
+
toggleEventHandlers(builder.value, {
|
|
131
|
+
onChange: props.onChange,
|
|
132
|
+
onDeleteComponent: props.onDeleteComponent,
|
|
133
|
+
onEditComponent: props.onEditComponent,
|
|
134
|
+
onSaveComponent: props.onSaveComponent,
|
|
135
|
+
onUpdateComponent: props.onUpdateComponent,
|
|
136
|
+
}, false);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}, { immediate: true });
|
|
140
|
+
context.expose({ builder });
|
|
141
|
+
return render;
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=FormBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormBuilder.js","sourceRoot":"","sources":["../../src/components/FormBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAK,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,KAAK,EAAY,KAAK,EAAE,MAAM,KAAK,CAAC;AAClG,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,eAAe,MAAM,yBAAyB,CAAC;AAEtD,OAAO,YAAY,MA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QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormioRef.js","sourceRoot":"","sources":["../../src/composables/useFormioRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAO,CAAC,EAAE,MAAM,KAAK,CAAC;AAElC,MAAM,CAAC,OAAO,UAAU,YAAY;IAClC,MAAM,SAAS,GAAG,GAAG,EAAyB,CAAC;IAE/C,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAElD,OAAO;QACL,SAAS;QACT,MAAM;KACP,CAAC;AACJ,CAAC;AAAA,CAAC"}
|