@formio/js 5.1.0-rc.19 → 5.1.0-rc.20

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.3 | (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.3/LICENSE */
22
22
 
23
- /*! formiojs v5.1.0-rc.19 | https://unpkg.com/formiojs@5.1.0-rc.19/LICENSE.txt */
23
+ /*! formiojs v5.1.0-rc.20 | https://unpkg.com/formiojs@5.1.0-rc.20/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
 
package/lib/cjs/Embed.js CHANGED
@@ -418,7 +418,7 @@ Formio.formioReady = new Promise((ready, reject) => {
418
418
  _a._formioReady = ready;
419
419
  _a._formioReadyReject = reject;
420
420
  });
421
- Formio.version = '5.1.0-rc.19';
421
+ Formio.version = '5.1.0-rc.20';
422
422
  // Create a report.
423
423
  Formio.Report = {
424
424
  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.1.0-rc.19';
14
+ sdk_1.Formio.version = '5.1.0-rc.20';
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) {
@@ -452,7 +452,7 @@ declare class Webform extends NestedDataComponent {
452
452
  */
453
453
  submit(before?: boolean, options?: any): Promise<any>;
454
454
  submitUrl(URL: any, headers: any): void;
455
- triggerCaptcha(): void;
455
+ triggerCaptcha(components?: null): void;
456
456
  _nosubmit: any;
457
457
  get conditions(): any;
458
458
  get variables(): any;
@@ -1527,17 +1527,20 @@ class Webform extends NestedDataComponent_1.default {
1527
1527
  return console.warn("You should add a URL to this button.");
1528
1528
  }
1529
1529
  }
1530
- triggerCaptcha() {
1530
+ triggerCaptcha(components = null) {
1531
1531
  if (!this || !this.components) {
1532
1532
  return;
1533
1533
  }
1534
1534
  const captchaComponent = [];
1535
- (0, formUtils_1.eachComponent)(this.components, (component) => {
1535
+ (0, formUtils_1.eachComponent)(components || this.components, (component) => {
1536
1536
  if (/^(re)?captcha$/.test(component.type) && component.component.eventType === 'formLoad') {
1537
1537
  captchaComponent.push(component);
1538
1538
  }
1539
1539
  }, true);
1540
1540
  if (captchaComponent.length > 0) {
1541
+ if (captchaComponent[0].component.provider === 'google' && components) {
1542
+ return;
1543
+ }
1541
1544
  captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
1542
1545
  }
1543
1546
  }
package/lib/cjs/Wizard.js CHANGED
@@ -602,6 +602,7 @@ class Wizard extends Webform_1.default {
602
602
  }
603
603
  this.redraw().then(() => {
604
604
  this.checkData(this.submission.data);
605
+ this.triggerCaptcha(this.currentPanel.componets);
605
606
  const errors = this.submitted ? this.validate(this.localData, { dirty: true }) : this.validateCurrentPage();
606
607
  if (this.alert) {
607
608
  this.showErrors(errors, true, true);
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.1.0-rc.19';
17
+ static version = '5.1.0-rc.20';
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.1.0-rc.19';
7
+ FormioCore.version = '5.1.0-rc.20';
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) {
@@ -452,7 +452,7 @@ declare class Webform extends NestedDataComponent {
452
452
  */
453
453
  submit(before?: boolean, options?: any): Promise<any>;
454
454
  submitUrl(URL: any, headers: any): void;
455
- triggerCaptcha(): void;
455
+ triggerCaptcha(components?: null): void;
456
456
  _nosubmit: any;
457
457
  get conditions(): any;
458
458
  get variables(): any;
@@ -1528,17 +1528,20 @@ export default class Webform extends NestedDataComponent {
1528
1528
  return console.warn("You should add a URL to this button.");
1529
1529
  }
1530
1530
  }
1531
- triggerCaptcha() {
1531
+ triggerCaptcha(components = null) {
1532
1532
  if (!this || !this.components) {
1533
1533
  return;
1534
1534
  }
1535
1535
  const captchaComponent = [];
1536
- eachComponent(this.components, (component) => {
1536
+ eachComponent(components || this.components, (component) => {
1537
1537
  if (/^(re)?captcha$/.test(component.type) && component.component.eventType === 'formLoad') {
1538
1538
  captchaComponent.push(component);
1539
1539
  }
1540
1540
  }, true);
1541
1541
  if (captchaComponent.length > 0) {
1542
+ if (captchaComponent[0].component.provider === 'google' && components) {
1543
+ return;
1544
+ }
1542
1545
  captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
1543
1546
  }
1544
1547
  }
package/lib/mjs/Wizard.js CHANGED
@@ -594,6 +594,7 @@ export default class Wizard extends Webform {
594
594
  }
595
595
  this.redraw().then(() => {
596
596
  this.checkData(this.submission.data);
597
+ this.triggerCaptcha(this.currentPanel.componets);
597
598
  const errors = this.submitted ? this.validate(this.localData, { dirty: true }) : this.validateCurrentPage();
598
599
  if (this.alert) {
599
600
  this.showErrors(errors, true, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-rc.19",
3
+ "version": "5.1.0-rc.20",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@formio/bootstrap": "3.1.0-rc.2",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "2.4.0-rc.10",
84
+ "@formio/core": "2.4.0-rc.11",
85
85
  "@formio/text-mask-addons": "^3.8.0-formio.4",
86
86
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
87
87
  "abortcontroller-polyfill": "^1.7.5",