@formio/js 5.0.0-rc.35 → 5.0.0-rc.37

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.
@@ -1,4 +1,4 @@
1
- /*! formiojs v5.0.0-rc.34 | https://unpkg.com/formiojs@5.0.0-rc.34/LICENSE.txt */
1
+ /*! formiojs v5.0.0-rc.37 | https://unpkg.com/formiojs@5.0.0-rc.37/LICENSE.txt */
2
2
 
3
3
  /**
4
4
  * @license
@@ -12,7 +12,7 @@
12
12
 
13
13
  /*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */
14
14
 
15
- /*! formiojs v5.0.0-rc.34 | https://unpkg.com/formiojs@5.0.0-rc.34/LICENSE.txt */
15
+ /*! formiojs v5.0.0-rc.37 | https://unpkg.com/formiojs@5.0.0-rc.37/LICENSE.txt */
16
16
 
17
17
  /**
18
18
  * @license
package/embed.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './types/Embed';
package/lib/cjs/Embed.js CHANGED
@@ -210,6 +210,24 @@ class Formio {
210
210
  }
211
211
  });
212
212
  }
213
+ static addLoader(wrapper) {
214
+ return __awaiter(this, void 0, void 0, function* () {
215
+ wrapper.appendChild(Formio.createElement('div', {
216
+ 'class': 'formio-loader'
217
+ }, [{
218
+ tag: 'div',
219
+ attrs: {
220
+ class: 'loader-wrapper'
221
+ },
222
+ children: [{
223
+ tag: 'div',
224
+ attrs: {
225
+ class: 'loader text-center'
226
+ }
227
+ }]
228
+ }]));
229
+ });
230
+ }
213
231
  // eslint-disable-next-line max-statements
214
232
  static init(element, options = {}, builder = false) {
215
233
  return __awaiter(this, void 0, void 0, function* () {
@@ -254,20 +272,7 @@ class Formio {
254
272
  // Load the renderer styles.
255
273
  yield Formio.addStyles(wrapper, Formio.config.embedCSS || `${Formio.cdn.js}/formio.embed.css`);
256
274
  // Add a loader.
257
- wrapper.appendChild(Formio.createElement('div', {
258
- 'class': 'formio-loader'
259
- }, [{
260
- tag: 'div',
261
- attrs: {
262
- class: 'loader-wrapper'
263
- },
264
- children: [{
265
- tag: 'div',
266
- attrs: {
267
- class: 'loader text-center'
268
- }
269
- }]
270
- }]));
275
+ Formio.addLoader(wrapper);
271
276
  const formioSrc = Formio.config.full ? 'formio.full' : 'formio.form';
272
277
  const renderer = Formio.config.debug ? formioSrc : `${formioSrc}.min`;
273
278
  Formio.FormioClass = yield Formio.addScript(wrapper, Formio.formioScript(Formio.config.script || `${Formio.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');
package/lib/cjs/Formio.js CHANGED
@@ -111,3 +111,6 @@ sdk_1.Formio.Form = Embed_1.Formio.Form;
111
111
  sdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;
112
112
  sdk_1.Formio.use = Embed_1.Formio.use;
113
113
  sdk_1.Formio.createForm = Embed_1.Formio.createForm;
114
+ sdk_1.Formio.submitDone = Embed_1.Formio.submitDone;
115
+ sdk_1.Formio.addLibrary = Embed_1.Formio.addLibrary;
116
+ sdk_1.Formio.addLoader = Embed_1.Formio.addLoader;
package/lib/mjs/Embed.js CHANGED
@@ -201,6 +201,22 @@ class Formio {
201
201
  }
202
202
  }
203
203
  }
204
+ static async addLoader(wrapper) {
205
+ wrapper.appendChild(Formio.createElement('div', {
206
+ 'class': 'formio-loader'
207
+ }, [{
208
+ tag: 'div',
209
+ attrs: {
210
+ class: 'loader-wrapper'
211
+ },
212
+ children: [{
213
+ tag: 'div',
214
+ attrs: {
215
+ class: 'loader text-center'
216
+ }
217
+ }]
218
+ }]));
219
+ }
204
220
  // eslint-disable-next-line max-statements
205
221
  static async init(element, options = {}, builder = false) {
206
222
  Formio.cdn = new CDN(Formio.config.cdn, Formio.config.cdnUrls || {});
@@ -244,20 +260,7 @@ class Formio {
244
260
  // Load the renderer styles.
245
261
  await Formio.addStyles(wrapper, Formio.config.embedCSS || `${Formio.cdn.js}/formio.embed.css`);
246
262
  // Add a loader.
247
- wrapper.appendChild(Formio.createElement('div', {
248
- 'class': 'formio-loader'
249
- }, [{
250
- tag: 'div',
251
- attrs: {
252
- class: 'loader-wrapper'
253
- },
254
- children: [{
255
- tag: 'div',
256
- attrs: {
257
- class: 'loader text-center'
258
- }
259
- }]
260
- }]));
263
+ Formio.addLoader(wrapper);
261
264
  const formioSrc = Formio.config.full ? 'formio.full' : 'formio.form';
262
265
  const renderer = Formio.config.debug ? formioSrc : `${formioSrc}.min`;
263
266
  Formio.FormioClass = await Formio.addScript(wrapper, Formio.formioScript(Formio.config.script || `${Formio.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');
package/lib/mjs/Formio.js CHANGED
@@ -104,4 +104,7 @@ FormioCore.Form = FormioEmbed.Form;
104
104
  FormioCore.FormBuilder = FormioEmbed.FormBuilder;
105
105
  FormioCore.use = FormioEmbed.use;
106
106
  FormioCore.createForm = FormioEmbed.createForm;
107
+ FormioCore.submitDone = FormioEmbed.submitDone;
108
+ FormioCore.addLibrary = FormioEmbed.addLibrary;
109
+ FormioCore.addLoader = FormioEmbed.addLoader;
107
110
  export { FormioCore as Formio };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-rc.35",
3
+ "version": "5.0.0-rc.37",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -34,7 +34,10 @@
34
34
  "dist",
35
35
  "lib",
36
36
  "types",
37
- "index.d.ts"
37
+ "index.d.ts",
38
+ "embed.d.ts",
39
+ "sdk.d.ts",
40
+ "utils.d.ts"
38
41
  ],
39
42
  "pre-commit": [
40
43
  "lint"
package/sdk.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './types/formio';
@@ -1,5 +1,5 @@
1
1
  import { Element } from '../../../element';
2
- import { ValidateOptions } from '../../../Formio';
2
+ import { ValidateOptions } from '../../../formio';
3
3
  import { ComponentSchema, ElementInfo, ExtendedComponentSchema } from './../../schema.d';
4
4
 
5
5
  export class Component extends Element {
@@ -1,4 +1,4 @@
1
- import { ConditionalOptions, ValidateOptions } from '../Formio';
1
+ import { ConditionalOptions, ValidateOptions } from '../formio';
2
2
 
3
3
  export interface ComponentSchema<T = any> {
4
4
  /**
package/types/formio.d.ts CHANGED
@@ -19,6 +19,7 @@ export interface FormioOptions {
19
19
  */
20
20
  project?: string;
21
21
  useSessionToken?: boolean;
22
+ formOnly?: boolean;
22
23
  }
23
24
  /**
24
25
  * The different path types for a project.
package/types/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export * from './components/components';
2
2
  export * from './components/schema';
3
3
  export * from './form';
4
4
  export * from './formbuilder';
5
- export * from './Formio';
5
+ export * from './formio';
6
6
  export * from './templates';
7
7
  export * from './displays';
8
8
  export * from './widgets';
package/types/sdk.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './formio';
package/utils.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './types/utils';