@formio/js 5.0.0-rc.55 → 5.0.0-rc.56

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@
10
10
  * MIT licensed
11
11
  */
12
12
 
13
- /*! formiojs v5.0.0-rc.55 | https://unpkg.com/formiojs@5.0.0-rc.55/LICENSE.txt */
13
+ /*! formiojs v5.0.0-rc.56 | https://unpkg.com/formiojs@5.0.0-rc.56/LICENSE.txt */
14
14
 
15
15
  /**
16
16
  * @license
@@ -22,7 +22,7 @@
22
22
 
23
23
  /*! @license DOMPurify 3.1.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.4/LICENSE */
24
24
 
25
- /*! formiojs v5.0.0-rc.55 | https://unpkg.com/formiojs@5.0.0-rc.55/LICENSE.txt */
25
+ /*! formiojs v5.0.0-rc.56 | https://unpkg.com/formiojs@5.0.0-rc.56/LICENSE.txt */
26
26
 
27
27
  /**
28
28
  * @license
package/lib/cjs/Embed.js CHANGED
@@ -297,14 +297,17 @@ class Formio {
297
297
  if (_a.config.template && _a.config.includeLibs) {
298
298
  yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);
299
299
  }
300
- // Add the premium modules.
300
+ if (!_a.config.libraries) {
301
+ _a.config.libraries = _a.config.modules || {};
302
+ }
303
+ // Adding premium if it is provided via the config.
301
304
  if (_a.config.premium) {
302
- _a.config.modules.premium = _a.config.premium;
305
+ _a.config.libraries.premium = _a.config.premium;
303
306
  }
304
307
  // Allow adding dynamic modules.
305
- if (_a.config.modules) {
306
- for (const name in _a.config.modules) {
307
- const lib = _a.config.modules[name];
308
+ if (_a.config.libraries) {
309
+ for (const name in _a.config.libraries) {
310
+ const lib = _a.config.libraries[name];
308
311
  lib.use = lib.use || true;
309
312
  yield _a.addLibrary(libWrapper, lib, name);
310
313
  }
@@ -298,7 +298,7 @@ declare class Webform extends NestedDataComponent {
298
298
  * @param {any} flags - Any flags to apply when setting the form.
299
299
  * @returns {Promise} - The promise that is triggered when the form is set.
300
300
  */
301
- setForm(form: object, flags: any): Promise<any>;
301
+ setForm(form: object, flags?: any): Promise<any>;
302
302
  initialized: boolean | undefined;
303
303
  /**
304
304
  * Sets the form value.
@@ -580,7 +580,7 @@ class Webform extends NestedDataComponent_1.default {
580
580
  * @param {any} flags - Any flags to apply when setting the form.
581
581
  * @returns {Promise} - The promise that is triggered when the form is set.
582
582
  */
583
- setForm(form, flags) {
583
+ setForm(form, flags = {}) {
584
584
  var _a, _b, _c;
585
585
  const isFormAlreadySet = this._form && ((_a = this._form.components) === null || _a === void 0 ? void 0 : _a.length);
586
586
  try {
@@ -96,7 +96,7 @@ declare class Wizard extends Webform {
96
96
  getPageIndexByKey(key: any): number;
97
97
  get schema(): object;
98
98
  setComponentSchema(): void;
99
- setForm(form: any, flags: any): Promise<any> | undefined;
99
+ setForm(form: any, flags?: {}): Promise<any> | undefined;
100
100
  onSetForm(clonedForm: any, initialForm: any): void;
101
101
  setEditMode(submission: any): void;
102
102
  setValue(submission: any, flags: {} | undefined, ignoreEstablishment: any): any;
package/lib/cjs/Wizard.js CHANGED
@@ -794,7 +794,7 @@ class Wizard extends Webform_1.default {
794
794
  this.originalComponents.push(lodash_1.default.clone(newPage));
795
795
  }
796
796
  }
797
- setForm(form, flags) {
797
+ setForm(form, flags = {}) {
798
798
  if (!form) {
799
799
  return;
800
800
  }
package/lib/mjs/Embed.js CHANGED
@@ -285,14 +285,17 @@ export class Formio {
285
285
  if (Formio.config.template && Formio.config.includeLibs) {
286
286
  await Formio.addLibrary(libWrapper, Formio.config.libs[Formio.config.template], Formio.config.template);
287
287
  }
288
- // Add the premium modules.
288
+ if (!Formio.config.libraries) {
289
+ Formio.config.libraries = Formio.config.modules || {};
290
+ }
291
+ // Adding premium if it is provided via the config.
289
292
  if (Formio.config.premium) {
290
- Formio.config.modules.premium = Formio.config.premium;
293
+ Formio.config.libraries.premium = Formio.config.premium;
291
294
  }
292
295
  // Allow adding dynamic modules.
293
- if (Formio.config.modules) {
294
- for (const name in Formio.config.modules) {
295
- const lib = Formio.config.modules[name];
296
+ if (Formio.config.libraries) {
297
+ for (const name in Formio.config.libraries) {
298
+ const lib = Formio.config.libraries[name];
296
299
  lib.use = lib.use || true;
297
300
  await Formio.addLibrary(libWrapper, lib, name);
298
301
  }
@@ -298,7 +298,7 @@ declare class Webform extends NestedDataComponent {
298
298
  * @param {any} flags - Any flags to apply when setting the form.
299
299
  * @returns {Promise} - The promise that is triggered when the form is set.
300
300
  */
301
- setForm(form: object, flags: any): Promise<any>;
301
+ setForm(form: object, flags?: any): Promise<any>;
302
302
  initialized: boolean | undefined;
303
303
  /**
304
304
  * Sets the form value.
@@ -579,7 +579,7 @@ export default class Webform extends NestedDataComponent {
579
579
  * @param {any} flags - Any flags to apply when setting the form.
580
580
  * @returns {Promise} - The promise that is triggered when the form is set.
581
581
  */
582
- setForm(form, flags) {
582
+ setForm(form, flags = {}) {
583
583
  const isFormAlreadySet = this._form && this._form.components?.length;
584
584
  try {
585
585
  // Do not set the form again if it has been already set
@@ -96,7 +96,7 @@ declare class Wizard extends Webform {
96
96
  getPageIndexByKey(key: any): number;
97
97
  get schema(): object;
98
98
  setComponentSchema(): void;
99
- setForm(form: any, flags: any): Promise<any> | undefined;
99
+ setForm(form: any, flags?: {}): Promise<any> | undefined;
100
100
  onSetForm(clonedForm: any, initialForm: any): void;
101
101
  setEditMode(submission: any): void;
102
102
  setValue(submission: any, flags: {} | undefined, ignoreEstablishment: any): any;
package/lib/mjs/Wizard.js CHANGED
@@ -783,7 +783,7 @@ export default class Wizard extends Webform {
783
783
  this.originalComponents.push(_.clone(newPage));
784
784
  }
785
785
  }
786
- setForm(form, flags) {
786
+ setForm(form, flags = {}) {
787
787
  if (!form) {
788
788
  return;
789
789
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-rc.55",
3
+ "version": "5.0.0-rc.56",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {