@formio/js 5.0.0-dev.5734.79d4f47 → 5.0.0-dev.5740.c7c00bc
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/Changelog.md +9 -0
- package/dist/formio.form.js +4 -4
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +4 -4
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/Form.d.ts +2 -2
- package/lib/cjs/Form.js +9 -3
- package/lib/cjs/Webform.js +0 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +1 -1
- package/lib/cjs/components/datamap/DataMap.js +1 -1
- package/lib/mjs/Form.d.ts +2 -2
- package/lib/mjs/Form.js +9 -3
- package/lib/mjs/Webform.js +0 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +1 -1
- package/lib/mjs/components/datamap/DataMap.js +1 -1
- package/package.json +1 -1
package/lib/cjs/Form.d.ts
CHANGED
|
@@ -398,10 +398,10 @@ export default class Form extends Element {
|
|
|
398
398
|
getFormInitOptions(url: string, form: import('@formio/core').Form): object;
|
|
399
399
|
/**
|
|
400
400
|
* Sets the form to the JSON schema of a form.
|
|
401
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
401
|
+
* @param {import('@formio/core').Form | string} formParam - The form JSON to set this form to.
|
|
402
402
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
403
403
|
*/
|
|
404
|
-
setForm(formParam: import('@formio/core').Form): Promise<Webform | Wizard | PDF>;
|
|
404
|
+
setForm(formParam: import('@formio/core').Form | string): Promise<Webform | Wizard | PDF>;
|
|
405
405
|
_form: any;
|
|
406
406
|
getSubmission(formio: any, opts: any): any;
|
|
407
407
|
/**
|
package/lib/cjs/Form.js
CHANGED
|
@@ -195,7 +195,7 @@ class Form extends Element_1.default {
|
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
197
|
* Sets the form to the JSON schema of a form.
|
|
198
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
198
|
+
* @param {import('@formio/core').Form | string} formParam - The form JSON to set this form to.
|
|
199
199
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
200
200
|
*/
|
|
201
201
|
setForm(formParam) {
|
|
@@ -222,8 +222,14 @@ class Form extends Element_1.default {
|
|
|
222
222
|
}
|
|
223
223
|
this.loading = false;
|
|
224
224
|
this.instance = this.instance || this.create(form.display);
|
|
225
|
-
|
|
226
|
-
this.instance.setUrl
|
|
225
|
+
// If we're in builder mode, instance.setUrl is not a function, so just manually set the URL.
|
|
226
|
+
if (this.instance.setUrl) {
|
|
227
|
+
const options = this.getFormInitOptions(formParam, form);
|
|
228
|
+
this.instance.setUrl(formParam, options);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
this.instance.url = formParam;
|
|
232
|
+
}
|
|
227
233
|
this.instance.nosubmit = false;
|
|
228
234
|
this._form = this.instance.form = form;
|
|
229
235
|
if (submission) {
|
package/lib/cjs/Webform.js
CHANGED
|
@@ -685,7 +685,7 @@ class NestedComponent extends Field_1.default {
|
|
|
685
685
|
validationProcessor({ scope, data, row, instance, component }, flags) {
|
|
686
686
|
const { dirty } = flags;
|
|
687
687
|
if (this.root.hasExtraPages && this.page !== this.root.page) {
|
|
688
|
-
instance = this.
|
|
688
|
+
instance = this.getComponent(component.path);
|
|
689
689
|
}
|
|
690
690
|
if (!instance) {
|
|
691
691
|
return;
|
|
@@ -241,7 +241,7 @@ class DataMapComponent extends DataGrid_1.default {
|
|
|
241
241
|
delete dataValue[key];
|
|
242
242
|
const comp = components[this.valueKey];
|
|
243
243
|
comp.component.key = newKey;
|
|
244
|
-
comp.path = Components_1.default.
|
|
244
|
+
comp.path = Components_1.default.getComponentPath(comp);
|
|
245
245
|
key = newKey;
|
|
246
246
|
});
|
|
247
247
|
const valueComponent = lodash_1.default.clone(this.component.valueComponent);
|
package/lib/mjs/Form.d.ts
CHANGED
|
@@ -398,10 +398,10 @@ export default class Form extends Element {
|
|
|
398
398
|
getFormInitOptions(url: string, form: import('@formio/core').Form): object;
|
|
399
399
|
/**
|
|
400
400
|
* Sets the form to the JSON schema of a form.
|
|
401
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
401
|
+
* @param {import('@formio/core').Form | string} formParam - The form JSON to set this form to.
|
|
402
402
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
403
403
|
*/
|
|
404
|
-
setForm(formParam: import('@formio/core').Form): Promise<Webform | Wizard | PDF>;
|
|
404
|
+
setForm(formParam: import('@formio/core').Form | string): Promise<Webform | Wizard | PDF>;
|
|
405
405
|
_form: any;
|
|
406
406
|
getSubmission(formio: any, opts: any): any;
|
|
407
407
|
/**
|
package/lib/mjs/Form.js
CHANGED
|
@@ -264,7 +264,7 @@ export default class Form extends Element {
|
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
266
|
* Sets the form to the JSON schema of a form.
|
|
267
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
267
|
+
* @param {import('@formio/core').Form | string} formParam - The form JSON to set this form to.
|
|
268
268
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
269
269
|
*/
|
|
270
270
|
setForm(formParam) {
|
|
@@ -291,8 +291,14 @@ export default class Form extends Element {
|
|
|
291
291
|
}
|
|
292
292
|
this.loading = false;
|
|
293
293
|
this.instance = this.instance || this.create(form.display);
|
|
294
|
-
|
|
295
|
-
this.instance.setUrl
|
|
294
|
+
// If we're in builder mode, instance.setUrl is not a function, so just manually set the URL.
|
|
295
|
+
if (this.instance.setUrl) {
|
|
296
|
+
const options = this.getFormInitOptions(formParam, form);
|
|
297
|
+
this.instance.setUrl(formParam, options);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
this.instance.url = formParam;
|
|
301
|
+
}
|
|
296
302
|
this.instance.nosubmit = false;
|
|
297
303
|
this._form = this.instance.form = form;
|
|
298
304
|
if (submission) {
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -681,7 +681,7 @@ export default class NestedComponent extends Field {
|
|
|
681
681
|
validationProcessor({ scope, data, row, instance, component }, flags) {
|
|
682
682
|
const { dirty } = flags;
|
|
683
683
|
if (this.root.hasExtraPages && this.page !== this.root.page) {
|
|
684
|
-
instance = this.
|
|
684
|
+
instance = this.getComponent(component.path);
|
|
685
685
|
}
|
|
686
686
|
if (!instance) {
|
|
687
687
|
return;
|
|
@@ -236,7 +236,7 @@ export default class DataMapComponent extends DataGridComponent {
|
|
|
236
236
|
delete dataValue[key];
|
|
237
237
|
const comp = components[this.valueKey];
|
|
238
238
|
comp.component.key = newKey;
|
|
239
|
-
comp.path = Components.
|
|
239
|
+
comp.path = Components.getComponentPath(comp);
|
|
240
240
|
key = newKey;
|
|
241
241
|
});
|
|
242
242
|
const valueComponent = _.clone(this.component.valueComponent);
|