@formio/js 5.2.4 → 5.2.5

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.
@@ -20,7 +20,7 @@
20
20
 
21
21
  /*! @license DOMPurify 3.2.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.2.4/LICENSE */
22
22
 
23
- /*! formiojs v5.2.4 | https://unpkg.com/formiojs@5.2.4/LICENSE.txt */
23
+ /*! formiojs v5.2.5 | https://unpkg.com/formiojs@5.2.5/LICENSE.txt */
24
24
 
25
25
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
26
26
 
@@ -22,7 +22,7 @@
22
22
 
23
23
  /*! @license DOMPurify 3.2.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.2.6/LICENSE */
24
24
 
25
- /*! formiojs v5.2.4 | https://unpkg.com/formiojs@5.2.4/LICENSE.txt */
25
+ /*! formiojs v5.2.5 | https://unpkg.com/formiojs@5.2.5/LICENSE.txt */
26
26
 
27
27
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
28
28
 
package/lib/cjs/Embed.js CHANGED
@@ -419,7 +419,7 @@ Formio.formioReady = new Promise((ready, reject) => {
419
419
  _a._formioReady = ready;
420
420
  _a._formioReadyReject = reject;
421
421
  });
422
- Formio.version = '5.2.4';
422
+ Formio.version = '5.2.5';
423
423
  // Create a report.
424
424
  Formio.Report = {
425
425
  create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
package/lib/cjs/Formio.js CHANGED
@@ -11,7 +11,7 @@ const CDN_1 = __importDefault(require("./CDN"));
11
11
  const providers_1 = __importDefault(require("./providers"));
12
12
  sdk_1.Formio.cdn = new CDN_1.default();
13
13
  sdk_1.Formio.Providers = providers_1.default;
14
- sdk_1.Formio.version = '5.2.4';
14
+ sdk_1.Formio.version = '5.2.5';
15
15
  CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
16
16
  const isNil = (val) => val === null || val === undefined;
17
17
  sdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
@@ -149,7 +149,7 @@ export default class NestedComponent extends Field {
149
149
  beforeFocus(): void;
150
150
  render(children: any): string;
151
151
  renderComponents(components: any): any;
152
- attach(element: any): Promise<[void, void]>;
152
+ attach(element: any): Promise<void>;
153
153
  /**
154
154
  * Attach the logic to the components.
155
155
  * @param {import('@formio/core').Component[]} components - The components to attach logic to.
@@ -1,4 +1,13 @@
1
1
  'use strict';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
@@ -58,11 +67,12 @@ class NestedComponent extends Field_1.default {
58
67
  * @returns {void}
59
68
  */
60
69
  collapse(value) {
61
- const promise = this.redraw();
62
- if (!value) {
63
- this.checkValidity(this.data, !this.pristine);
64
- }
65
- return promise;
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ yield this.redraw();
72
+ if (!value) {
73
+ this.checkValidity(this.data, !this.pristine);
74
+ }
75
+ });
66
76
  }
67
77
  /**
68
78
  * Set collapsed state.
@@ -490,35 +500,37 @@ class NestedComponent extends Field_1.default {
490
500
  });
491
501
  }
492
502
  attach(element) {
493
- const superPromise = super.attach(element);
494
- this.loadRefs(element, {
495
- header: 'single',
496
- collapsed: this.collapsed,
497
- [this.nestedKey]: 'single',
498
- messageContainer: 'single-scope',
503
+ const _super = Object.create(null, {
504
+ attach: { get: () => super.attach }
499
505
  });
500
- let childPromise = Promise.resolve();
501
- if (this.refs[this.nestedKey]) {
502
- childPromise = this.attachComponents(this.refs[this.nestedKey]);
503
- }
504
- if (!this.visible) {
505
- this.attachComponentsLogic();
506
- }
507
- if (this.component.collapsible && this.refs.header) {
508
- this.addEventListener(this.refs.header, 'click', () => {
509
- this.collapsed = !this.collapsed;
506
+ return __awaiter(this, void 0, void 0, function* () {
507
+ yield _super.attach.call(this, element);
508
+ this.loadRefs(element, {
509
+ header: 'single',
510
+ collapsed: this.collapsed,
511
+ [this.nestedKey]: 'single',
512
+ messageContainer: 'single-scope',
510
513
  });
511
- this.addEventListener(this.refs.header, 'keydown', (e) => {
512
- if (e.keyCode === 13 || e.keyCode === 32) {
513
- e.preventDefault();
514
+ let childPromise = Promise.resolve();
515
+ if (this.refs[this.nestedKey]) {
516
+ childPromise = this.attachComponents(this.refs[this.nestedKey]);
517
+ }
518
+ if (!this.visible) {
519
+ this.attachComponentsLogic();
520
+ }
521
+ if (this.component.collapsible && this.refs.header) {
522
+ this.addEventListener(this.refs.header, 'click', () => {
514
523
  this.collapsed = !this.collapsed;
515
- }
516
- });
517
- }
518
- return Promise.all([
519
- superPromise,
520
- childPromise,
521
- ]);
524
+ });
525
+ this.addEventListener(this.refs.header, 'keydown', (e) => {
526
+ if (e.keyCode === 13 || e.keyCode === 32) {
527
+ e.preventDefault();
528
+ this.collapsed = !this.collapsed;
529
+ }
530
+ });
531
+ }
532
+ return yield childPromise;
533
+ });
522
534
  }
523
535
  /**
524
536
  * Attach the logic to the components.
@@ -72,7 +72,6 @@ export default class AddressComponent extends ContainerComponent {
72
72
  render(): string;
73
73
  onSelectAddress(address: any, element: any, index: any): void;
74
74
  addRow(): void;
75
- attach(element: any): Promise<void>;
76
75
  addChildComponent(component: any): void;
77
76
  clearAddress(element: any, index: any): void;
78
77
  getDisplayValue(value?: any): any;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "type": "commonjs",
3
- "version": "5.2.4"
3
+ "version": "5.2.5"
4
4
  }
package/lib/mjs/Embed.js CHANGED
@@ -14,7 +14,7 @@ export class Formio {
14
14
  Formio._formioReady = ready;
15
15
  Formio._formioReadyReject = reject;
16
16
  });
17
- static version = '5.2.4';
17
+ static version = '5.2.5';
18
18
  static setLicense(license, norecurse = false) {
19
19
  Formio.license = license;
20
20
  if (!norecurse && Formio.FormioClass) {
package/lib/mjs/Formio.js CHANGED
@@ -4,7 +4,7 @@ import CDN from './CDN';
4
4
  import Providers from './providers';
5
5
  FormioCore.cdn = new CDN();
6
6
  FormioCore.Providers = Providers;
7
- FormioCore.version = '5.2.4';
7
+ FormioCore.version = '5.2.5';
8
8
  CDN.defaultCDN = FormioCore.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
9
9
  const isNil = (val) => val === null || val === undefined;
10
10
  FormioCore.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
@@ -149,7 +149,7 @@ export default class NestedComponent extends Field {
149
149
  beforeFocus(): void;
150
150
  render(children: any): string;
151
151
  renderComponents(components: any): any;
152
- attach(element: any): Promise<[void, void]>;
152
+ attach(element: any): Promise<void>;
153
153
  /**
154
154
  * Attach the logic to the components.
155
155
  * @param {import('@formio/core').Component[]} components - The components to attach logic to.
@@ -53,12 +53,11 @@ export default class NestedComponent extends Field {
53
53
  * @param {boolean} value - The collapsed state.
54
54
  * @returns {void}
55
55
  */
56
- collapse(value) {
57
- const promise = this.redraw();
56
+ async collapse(value) {
57
+ await this.redraw();
58
58
  if (!value) {
59
59
  this.checkValidity(this.data, !this.pristine);
60
60
  }
61
- return promise;
62
61
  }
63
62
  /**
64
63
  * Set collapsed state.
@@ -485,8 +484,8 @@ export default class NestedComponent extends Field {
485
484
  components,
486
485
  });
487
486
  }
488
- attach(element) {
489
- const superPromise = super.attach(element);
487
+ async attach(element) {
488
+ await super.attach(element);
490
489
  this.loadRefs(element, {
491
490
  header: 'single',
492
491
  collapsed: this.collapsed,
@@ -511,10 +510,7 @@ export default class NestedComponent extends Field {
511
510
  }
512
511
  });
513
512
  }
514
- return Promise.all([
515
- superPromise,
516
- childPromise,
517
- ]);
513
+ return await childPromise;
518
514
  }
519
515
  /**
520
516
  * Attach the logic to the components.
@@ -72,7 +72,6 @@ export default class AddressComponent extends ContainerComponent {
72
72
  render(): string;
73
73
  onSelectAddress(address: any, element: any, index: any): void;
74
74
  addRow(): void;
75
- attach(element: any): Promise<void>;
76
75
  addChildComponent(component: any): void;
77
76
  clearAddress(element: any, index: any): void;
78
77
  getDisplayValue(value?: any): any;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "5.2.4"
3
+ "version": "5.2.5"
4
4
 
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.2.4",
3
+ "version": "5.2.5",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {