@formio/js 5.1.0-dev.6025.8026a2f → 5.1.0-dev.6026.7f60c92
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 +3 -5
- package/lib/cjs/Wizard.js +0 -1
- package/lib/cjs/WizardBuilder.d.ts +1 -0
- package/lib/cjs/WizardBuilder.js +21 -2
- package/lib/mjs/Webform.d.ts +1 -1
- package/lib/mjs/Webform.js +3 -5
- package/lib/mjs/Wizard.js +0 -1
- package/lib/mjs/WizardBuilder.d.ts +1 -0
- package/lib/mjs/WizardBuilder.js +21 -2
- 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(
|
458
|
+
triggerCaptcha(): void;
|
459
459
|
_nosubmit: any;
|
460
460
|
get conditions(): any;
|
461
461
|
get variables(): any;
|
package/lib/cjs/Webform.js
CHANGED
@@ -1534,20 +1534,17 @@ class Webform extends NestedDataComponent_1.default {
|
|
1534
1534
|
return console.warn(message);
|
1535
1535
|
}
|
1536
1536
|
}
|
1537
|
-
triggerCaptcha(
|
1537
|
+
triggerCaptcha() {
|
1538
1538
|
if (!this || !this.components || this.options.preview) {
|
1539
1539
|
return;
|
1540
1540
|
}
|
1541
1541
|
const captchaComponent = [];
|
1542
|
-
(0, formUtils_1.eachComponent)(
|
1542
|
+
(0, formUtils_1.eachComponent)(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
|
-
}
|
1551
1548
|
if (this.parent) {
|
1552
1549
|
this.parent.subFormReady.then(() => {
|
1553
1550
|
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
@@ -1556,6 +1553,7 @@ class Webform extends NestedDataComponent_1.default {
|
|
1556
1553
|
else {
|
1557
1554
|
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
1558
1555
|
}
|
1556
|
+
;
|
1559
1557
|
}
|
1560
1558
|
}
|
1561
1559
|
set nosubmit(value) {
|
package/lib/cjs/Wizard.js
CHANGED
@@ -602,7 +602,6 @@ 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);
|
606
605
|
const errors = this.submitted ? this.validate(this.localData, { dirty: true }) : this.validateCurrentPage();
|
607
606
|
if (this.alert) {
|
608
607
|
this.showErrors(errors, true, true);
|
package/lib/cjs/WizardBuilder.js
CHANGED
@@ -261,12 +261,31 @@ class WizardBuilder extends WebformBuilder_1.default {
|
|
261
261
|
if (component instanceof WizardBuilder) {
|
262
262
|
return;
|
263
263
|
}
|
264
|
-
if (
|
265
|
-
this.
|
264
|
+
if (!window.sessionStorage) {
|
265
|
+
return console.warn(this.t('sessionStorageSupportError'));
|
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
|
+
}
|
266
278
|
}
|
267
279
|
else {
|
268
280
|
return super.pasteComponent(component);
|
269
281
|
}
|
270
282
|
}
|
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
|
+
}
|
271
290
|
}
|
272
291
|
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(
|
458
|
+
triggerCaptcha(): void;
|
459
459
|
_nosubmit: any;
|
460
460
|
get conditions(): any;
|
461
461
|
get variables(): any;
|
package/lib/mjs/Webform.js
CHANGED
@@ -1534,20 +1534,17 @@ export default class Webform extends NestedDataComponent {
|
|
1534
1534
|
return console.warn(message);
|
1535
1535
|
}
|
1536
1536
|
}
|
1537
|
-
triggerCaptcha(
|
1537
|
+
triggerCaptcha() {
|
1538
1538
|
if (!this || !this.components || this.options.preview) {
|
1539
1539
|
return;
|
1540
1540
|
}
|
1541
1541
|
const captchaComponent = [];
|
1542
|
-
eachComponent(
|
1542
|
+
eachComponent(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
|
-
}
|
1551
1548
|
if (this.parent) {
|
1552
1549
|
this.parent.subFormReady.then(() => {
|
1553
1550
|
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
@@ -1556,6 +1553,7 @@ export default class Webform extends NestedDataComponent {
|
|
1556
1553
|
else {
|
1557
1554
|
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
1558
1555
|
}
|
1556
|
+
;
|
1559
1557
|
}
|
1560
1558
|
}
|
1561
1559
|
set nosubmit(value) {
|
package/lib/mjs/Wizard.js
CHANGED
@@ -594,7 +594,6 @@ 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);
|
598
597
|
const errors = this.submitted ? this.validate(this.localData, { dirty: true }) : this.validateCurrentPage();
|
599
598
|
if (this.alert) {
|
600
599
|
this.showErrors(errors, true, true);
|
package/lib/mjs/WizardBuilder.js
CHANGED
@@ -255,11 +255,30 @@ export default class WizardBuilder extends WebformBuilder {
|
|
255
255
|
if (component instanceof WizardBuilder) {
|
256
256
|
return;
|
257
257
|
}
|
258
|
-
if (
|
259
|
-
this.
|
258
|
+
if (!window.sessionStorage) {
|
259
|
+
return console.warn(this.t('sessionStorageSupportError'));
|
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
|
+
}
|
260
272
|
}
|
261
273
|
else {
|
262
274
|
return super.pasteComponent(component);
|
263
275
|
}
|
264
276
|
}
|
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
|
+
}
|
265
284
|
}
|