diff --git a/package.json b/package.json index d16057210a..593f885004 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@formio/js", - "version": "5.0.0-rc.55", + "version": "5.0.0-rc.56", "description": "JavaScript powered Forms with JSON Form Builder", "main": "lib/cjs/index.js", "exports": { diff --git a/src/Embed.js b/src/Embed.js index a8d740d5b4..142700869e 100644 --- a/src/Embed.js +++ b/src/Embed.js @@ -326,15 +326,19 @@ export class Formio { await Formio.addLibrary(libWrapper, Formio.config.libs[Formio.config.template], Formio.config.template); } - // Add the premium modules. + if (!Formio.config.libraries) { + Formio.config.libraries = Formio.config.modules || {}; + } + + // Adding premium if it is provided via the config. if (Formio.config.premium) { - Formio.config.modules.premium = Formio.config.premium; + Formio.config.libraries.premium = Formio.config.premium; } // Allow adding dynamic modules. - if (Formio.config.modules) { - for (const name in Formio.config.modules) { - const lib = Formio.config.modules[name]; + if (Formio.config.libraries) { + for (const name in Formio.config.libraries) { + const lib = Formio.config.libraries[name]; lib.use = lib.use || true; await Formio.addLibrary(libWrapper, lib, name); } diff --git a/src/Webform.js b/src/Webform.js index affc374002..8a44260c27 100644 --- a/src/Webform.js +++ b/src/Webform.js @@ -651,7 +651,7 @@ export default class Webform extends NestedDataComponent { * @param {any} flags - Any flags to apply when setting the form. * @returns {Promise} - The promise that is triggered when the form is set. */ - setForm(form, flags) { + setForm(form, flags = {}) { const isFormAlreadySet = this._form && this._form.components?.length; try { // Do not set the form again if it has been already set diff --git a/src/Wizard.js b/src/Wizard.js index 19103caf4d..4288bb4cfa 100644 --- a/src/Wizard.js +++ b/src/Wizard.js @@ -909,7 +909,7 @@ export default class Wizard extends Webform { } } - setForm(form, flags) { + setForm(form, flags = {}) { if (!form) { return; }