Skip to content

Commit

Permalink
Updated build.
Browse files Browse the repository at this point in the history
  • Loading branch information
travist committed Dec 8, 2023
1 parent 7f862d0 commit 9bd0381
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
32 changes: 18 additions & 14 deletions src/Embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {});
Expand Down Expand Up @@ -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`;
Expand Down
3 changes: 3 additions & 0 deletions src/Formio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

0 comments on commit 9bd0381

Please sign in to comment.