diff --git a/package.json b/package.json index 91db2d1e51..627e5610ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@formio/js", - "version": "5.0.0-rc.36", + "version": "5.0.0-rc.37", "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 bcc46eb9b6..f7a2e9f03c 100644 --- a/src/Embed.js +++ b/src/Embed.js @@ -225,6 +225,23 @@ export class Formio { } } + static async addLoader(wrapper) { + wrapper.appendChild(Formio.createElement('div', { + 'class': 'formio-loader' + }, [{ + tag: 'div', + attrs: { + class: 'loader-wrapper' + }, + children: [{ + tag: 'div', + attrs: { + class: 'loader text-center' + } + }] + }])); + } + // eslint-disable-next-line max-statements static async init(element, options = {}, builder = false) { Formio.cdn = new CDN(Formio.config.cdn, Formio.config.cdnUrls || {}); @@ -273,20 +290,7 @@ export class Formio { await Formio.addStyles(wrapper, Formio.config.embedCSS || `${Formio.cdn.js}/formio.embed.css`); // Add a loader. - wrapper.appendChild(Formio.createElement('div', { - 'class': 'formio-loader' - }, [{ - tag: 'div', - attrs: { - class: 'loader-wrapper' - }, - children: [{ - tag: 'div', - attrs: { - class: 'loader text-center' - } - }] - }])); + Formio.addLoader(wrapper); const formioSrc = Formio.config.full ? 'formio.full' : 'formio.form'; const renderer = Formio.config.debug ? formioSrc : `${formioSrc}.min`; diff --git a/src/Formio.js b/src/Formio.js index 3b47045e4d..379f80917e 100644 --- a/src/Formio.js +++ b/src/Formio.js @@ -114,4 +114,7 @@ FormioCore.Form = FormioEmbed.Form; FormioCore.FormBuilder = FormioEmbed.FormBuilder; FormioCore.use = FormioEmbed.use; FormioCore.createForm = FormioEmbed.createForm; +FormioCore.submitDone = FormioEmbed.submitDone; +FormioCore.addLibrary = FormioEmbed.addLibrary; +FormioCore.addLoader = FormioEmbed.addLoader; export { FormioCore as Formio };