@formio/js 5.1.0-dev.6026.7f60c92 → 5.1.0-dev.6030.abc8cfc
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.
- package/dist/formio.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +3 -3
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/Webform.d.ts +1 -1
- package/lib/cjs/Webform.js +5 -3
- package/lib/cjs/Wizard.js +1 -0
- package/lib/cjs/WizardBuilder.d.ts +0 -1
- package/lib/cjs/WizardBuilder.js +2 -21
- package/lib/mjs/Webform.d.ts +1 -1
- package/lib/mjs/Webform.js +5 -3
- package/lib/mjs/Wizard.js +1 -0
- package/lib/mjs/WizardBuilder.d.ts +0 -1
- package/lib/mjs/WizardBuilder.js +2 -21
- package/package.json +1 -1
package/lib/cjs/Webform.d.ts
CHANGED
@@ -455,7 +455,7 @@ declare class Webform extends NestedDataComponent {
|
|
455
455
|
*/
|
456
456
|
submit(before?: boolean, options?: any): Promise<any>;
|
457
457
|
submitUrl(URL: any, headers: any): void;
|
458
|
-
triggerCaptcha(): void;
|
458
|
+
triggerCaptcha(components?: null): void;
|
459
459
|
_nosubmit: any;
|
460
460
|
get conditions(): any;
|
461
461
|
get variables(): any;
|
package/lib/cjs/Webform.js
CHANGED
@@ -1534,17 +1534,20 @@ class Webform extends NestedDataComponent_1.default {
|
|
1534
1534
|
return console.warn(message);
|
1535
1535
|
}
|
1536
1536
|
}
|
1537
|
-
triggerCaptcha() {
|
1537
|
+
triggerCaptcha(components = null) {
|
1538
1538
|
if (!this || !this.components || this.options.preview) {
|
1539
1539
|
return;
|
1540
1540
|
}
|
1541
1541
|
const captchaComponent = [];
|
1542
|
-
(0, formUtils_1.eachComponent)(this.components, (component) => {
|
1542
|
+
(0, formUtils_1.eachComponent)(components || this.components, (component) => {
|
1543
1543
|
if (/^(re)?captcha$/.test(component.type) && component.component.eventType === 'formLoad') {
|
1544
1544
|
captchaComponent.push(component);
|
1545
1545
|
}
|
1546
1546
|
}, true);
|
1547
1547
|
if (captchaComponent.length > 0) {
|
1548
|
+
if (captchaComponent[0].component.provider === 'google' && components) {
|
1549
|
+
return;
|
1550
|
+
}
|
1548
1551
|
if (this.parent) {
|
1549
1552
|
this.parent.subFormReady.then(() => {
|
1550
1553
|
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
@@ -1553,7 +1556,6 @@ class Webform extends NestedDataComponent_1.default {
|
|
1553
1556
|
else {
|
1554
1557
|
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
1555
1558
|
}
|
1556
|
-
;
|
1557
1559
|
}
|
1558
1560
|
}
|
1559
1561
|
set nosubmit(value) {
|
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.components);
|
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/cjs/WizardBuilder.js
CHANGED
@@ -261,31 +261,12 @@ class WizardBuilder extends WebformBuilder_1.default {
|
|
261
261
|
if (component instanceof WizardBuilder) {
|
262
262
|
return;
|
263
263
|
}
|
264
|
-
if (
|
265
|
-
|
266
|
-
}
|
267
|
-
const isWizardPageCopied = window.sessionStorage.getItem('formio.isWizardPageCopied') === 'true' ? true : false;
|
268
|
-
if (isWizardPageCopied) {
|
269
|
-
const data = window.sessionStorage.getItem('formio.clipboard');
|
270
|
-
if (data) {
|
271
|
-
const schema = JSON.parse(data);
|
272
|
-
if (schema.type !== 'panel') {
|
273
|
-
window.sessionStorage.setItem('formio.isWizardPageCopied', 'false');
|
274
|
-
return super.pasteComponent(component);
|
275
|
-
}
|
276
|
-
this.addPage(schema);
|
277
|
-
}
|
264
|
+
if (this._form.components.find(comp => lodash_1.default.isEqual(component.component, comp))) {
|
265
|
+
this.addPage(component);
|
278
266
|
}
|
279
267
|
else {
|
280
268
|
return super.pasteComponent(component);
|
281
269
|
}
|
282
270
|
}
|
283
|
-
copyComponent(component) {
|
284
|
-
super.copyComponent(component);
|
285
|
-
if (window.sessionStorage) {
|
286
|
-
const isWizardPageCopied = this._form.components.indexOf(comp => lodash_1.default.isEqual(component.component, comp)) !== -1;
|
287
|
-
window.sessionStorage.setItem('formio.isWizardPageCopied', isWizardPageCopied.toString());
|
288
|
-
}
|
289
|
-
}
|
290
271
|
}
|
291
272
|
exports.default = WizardBuilder;
|
package/lib/mjs/Webform.d.ts
CHANGED
@@ -455,7 +455,7 @@ declare class Webform extends NestedDataComponent {
|
|
455
455
|
*/
|
456
456
|
submit(before?: boolean, options?: any): Promise<any>;
|
457
457
|
submitUrl(URL: any, headers: any): void;
|
458
|
-
triggerCaptcha(): void;
|
458
|
+
triggerCaptcha(components?: null): void;
|
459
459
|
_nosubmit: any;
|
460
460
|
get conditions(): any;
|
461
461
|
get variables(): any;
|
package/lib/mjs/Webform.js
CHANGED
@@ -1534,17 +1534,20 @@ export default class Webform extends NestedDataComponent {
|
|
1534
1534
|
return console.warn(message);
|
1535
1535
|
}
|
1536
1536
|
}
|
1537
|
-
triggerCaptcha() {
|
1537
|
+
triggerCaptcha(components = null) {
|
1538
1538
|
if (!this || !this.components || this.options.preview) {
|
1539
1539
|
return;
|
1540
1540
|
}
|
1541
1541
|
const captchaComponent = [];
|
1542
|
-
eachComponent(this.components, (component) => {
|
1542
|
+
eachComponent(components || this.components, (component) => {
|
1543
1543
|
if (/^(re)?captcha$/.test(component.type) && component.component.eventType === 'formLoad') {
|
1544
1544
|
captchaComponent.push(component);
|
1545
1545
|
}
|
1546
1546
|
}, true);
|
1547
1547
|
if (captchaComponent.length > 0) {
|
1548
|
+
if (captchaComponent[0].component.provider === 'google' && components) {
|
1549
|
+
return;
|
1550
|
+
}
|
1548
1551
|
if (this.parent) {
|
1549
1552
|
this.parent.subFormReady.then(() => {
|
1550
1553
|
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
@@ -1553,7 +1556,6 @@ export default class Webform extends NestedDataComponent {
|
|
1553
1556
|
else {
|
1554
1557
|
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
1555
1558
|
}
|
1556
|
-
;
|
1557
1559
|
}
|
1558
1560
|
}
|
1559
1561
|
set nosubmit(value) {
|
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.components);
|
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/lib/mjs/WizardBuilder.js
CHANGED
@@ -255,30 +255,11 @@ export default class WizardBuilder extends WebformBuilder {
|
|
255
255
|
if (component instanceof WizardBuilder) {
|
256
256
|
return;
|
257
257
|
}
|
258
|
-
if (
|
259
|
-
|
260
|
-
}
|
261
|
-
const isWizardPageCopied = window.sessionStorage.getItem('formio.isWizardPageCopied') === 'true' ? true : false;
|
262
|
-
if (isWizardPageCopied) {
|
263
|
-
const data = window.sessionStorage.getItem('formio.clipboard');
|
264
|
-
if (data) {
|
265
|
-
const schema = JSON.parse(data);
|
266
|
-
if (schema.type !== 'panel') {
|
267
|
-
window.sessionStorage.setItem('formio.isWizardPageCopied', 'false');
|
268
|
-
return super.pasteComponent(component);
|
269
|
-
}
|
270
|
-
this.addPage(schema);
|
271
|
-
}
|
258
|
+
if (this._form.components.find(comp => _.isEqual(component.component, comp))) {
|
259
|
+
this.addPage(component);
|
272
260
|
}
|
273
261
|
else {
|
274
262
|
return super.pasteComponent(component);
|
275
263
|
}
|
276
264
|
}
|
277
|
-
copyComponent(component) {
|
278
|
-
super.copyComponent(component);
|
279
|
-
if (window.sessionStorage) {
|
280
|
-
const isWizardPageCopied = this._form.components.indexOf(comp => _.isEqual(component.component, comp)) !== -1;
|
281
|
-
window.sessionStorage.setItem('formio.isWizardPageCopied', isWizardPageCopied.toString());
|
282
|
-
}
|
283
|
-
}
|
284
265
|
}
|