@formio/js 5.0.0-dev.5732.56033f1 → 5.0.0-dev.5734.79d4f47

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/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 | string} formParam - The form JSON to set this form to.
401
+ * @param {import('@formio/core').Form} 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 | string): Promise<Webform | Wizard | PDF>;
404
+ setForm(formParam: import('@formio/core').Form): 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 | string} formParam - The form JSON to set this form to.
198
+ * @param {import('@formio/core').Form} 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,14 +222,8 @@ class Form extends Element_1.default {
222
222
  }
223
223
  this.loading = false;
224
224
  this.instance = this.instance || this.create(form.display);
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
- }
225
+ const options = this.getFormInitOptions(formParam, form);
226
+ this.instance.setUrl(formParam, options);
233
227
  this.instance.nosubmit = false;
234
228
  this._form = this.instance.form = form;
235
229
  if (submission) {
@@ -497,6 +497,7 @@ class NestedComponent extends Field_1.default {
497
497
  header: 'single',
498
498
  collapsed: this.collapsed,
499
499
  [this.nestedKey]: 'single',
500
+ messageContainer: 'single-scope',
500
501
  });
501
502
  let childPromise = Promise.resolve();
502
503
  if (this.refs[this.nestedKey]) {
@@ -59,7 +59,6 @@ export default class DataGridComponent extends NestedArrayComponent {
59
59
  getRows(): {}[];
60
60
  getColumns(): any[];
61
61
  hasHeader(): any;
62
- loadRefs(element: any, refs: any): void;
63
62
  dragula: any;
64
63
  getComponentsContainer(): any;
65
64
  /**
@@ -263,13 +263,6 @@ class DataGridComponent extends NestedArrayComponent_1.default {
263
263
  return hasHeader || ((col.label || col.title) && !col.hideLabel);
264
264
  }, false);
265
265
  }
266
- loadRefs(element, refs) {
267
- super.loadRefs(element, refs);
268
- if (refs['messageContainer'] === 'single') {
269
- const container = lodash_1.default.last(element.querySelectorAll(`[${this._referenceAttributeName}=messageContainer]`));
270
- this.refs['messageContainer'] = container || this.refs['messageContainer'];
271
- }
272
- }
273
266
  attach(element) {
274
267
  this.loadRefs(element, {
275
268
  [`${this.datagridKey}-row`]: 'multiple',
@@ -278,7 +271,6 @@ class DataGridComponent extends NestedArrayComponent_1.default {
278
271
  [`${this.datagridKey}-removeRow`]: 'multiple',
279
272
  [`${this.datagridKey}-group-header`]: 'multiple',
280
273
  [this.datagridKey]: 'multiple',
281
- 'messageContainer': 'single'
282
274
  });
283
275
  if (this.allowReorder) {
284
276
  this.refs[`${this.datagridKey}-row`].forEach((row, index) => {
@@ -490,11 +490,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
490
490
  else {
491
491
  this.removeClass(this.refs.component, `formio-component-${this.component.type}-row-open`);
492
492
  }
493
- const superAttach = super.attach(element);
494
- this.loadRefs(element, {
495
- messageContainer: 'single-scope',
496
- });
497
- return superAttach;
493
+ return super.attach(element);
498
494
  }
499
495
  flattenRowDataValue(dataValue) {
500
496
  const flattened = {};
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 | string} formParam - The form JSON to set this form to.
401
+ * @param {import('@formio/core').Form} 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 | string): Promise<Webform | Wizard | PDF>;
404
+ setForm(formParam: import('@formio/core').Form): 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 | string} formParam - The form JSON to set this form to.
267
+ * @param {import('@formio/core').Form} 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,14 +291,8 @@ export default class Form extends Element {
291
291
  }
292
292
  this.loading = false;
293
293
  this.instance = this.instance || this.create(form.display);
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
- }
294
+ const options = this.getFormInitOptions(formParam, form);
295
+ this.instance.setUrl(formParam, options);
302
296
  this.instance.nosubmit = false;
303
297
  this._form = this.instance.form = form;
304
298
  if (submission) {
@@ -493,6 +493,7 @@ export default class NestedComponent extends Field {
493
493
  header: 'single',
494
494
  collapsed: this.collapsed,
495
495
  [this.nestedKey]: 'single',
496
+ messageContainer: 'single-scope',
496
497
  });
497
498
  let childPromise = Promise.resolve();
498
499
  if (this.refs[this.nestedKey]) {
@@ -59,7 +59,6 @@ export default class DataGridComponent extends NestedArrayComponent {
59
59
  getRows(): {}[];
60
60
  getColumns(): any[];
61
61
  hasHeader(): any;
62
- loadRefs(element: any, refs: any): void;
63
62
  dragula: any;
64
63
  getComponentsContainer(): any;
65
64
  /**
@@ -260,13 +260,6 @@ export default class DataGridComponent extends NestedArrayComponent {
260
260
  return hasHeader || ((col.label || col.title) && !col.hideLabel);
261
261
  }, false);
262
262
  }
263
- loadRefs(element, refs) {
264
- super.loadRefs(element, refs);
265
- if (refs['messageContainer'] === 'single') {
266
- const container = _.last(element.querySelectorAll(`[${this._referenceAttributeName}=messageContainer]`));
267
- this.refs['messageContainer'] = container || this.refs['messageContainer'];
268
- }
269
- }
270
263
  attach(element) {
271
264
  this.loadRefs(element, {
272
265
  [`${this.datagridKey}-row`]: 'multiple',
@@ -275,7 +268,6 @@ export default class DataGridComponent extends NestedArrayComponent {
275
268
  [`${this.datagridKey}-removeRow`]: 'multiple',
276
269
  [`${this.datagridKey}-group-header`]: 'multiple',
277
270
  [this.datagridKey]: 'multiple',
278
- 'messageContainer': 'single'
279
271
  });
280
272
  if (this.allowReorder) {
281
273
  this.refs[`${this.datagridKey}-row`].forEach((row, index) => {
@@ -484,11 +484,7 @@ export default class EditGridComponent extends NestedArrayComponent {
484
484
  else {
485
485
  this.removeClass(this.refs.component, `formio-component-${this.component.type}-row-open`);
486
486
  }
487
- const superAttach = super.attach(element);
488
- this.loadRefs(element, {
489
- messageContainer: 'single-scope',
490
- });
491
- return superAttach;
487
+ return super.attach(element);
492
488
  }
493
489
  flattenRowDataValue(dataValue) {
494
490
  const flattened = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5732.56033f1",
3
+ "version": "5.0.0-dev.5734.79d4f47",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {