@formio/js 5.0.0-dev.5920.f58ae24 → 5.0.0-dev.5923.b428b7b
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/WebformBuilder.js +1 -0
- package/lib/cjs/Wizard.js +11 -12
- package/lib/cjs/components/form/Form.js +1 -1
- package/lib/mjs/WebformBuilder.js +1 -0
- package/lib/mjs/Wizard.js +10 -11
- package/lib/mjs/components/form/Form.js +1 -1
- package/package.json +1 -1
package/lib/cjs/Wizard.js
CHANGED
|
@@ -720,10 +720,9 @@ class Wizard extends Webform_1.default {
|
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
validateCurrentPage(flags = {}) {
|
|
723
|
-
var _a
|
|
724
|
-
const components = (_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.components.map((component) => component.component);
|
|
723
|
+
var _a;
|
|
725
724
|
// Accessing the parent ensures the right instance (whether it's the parent Wizard or a nested Wizard) performs its validation
|
|
726
|
-
return (
|
|
725
|
+
return (_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.parent.validateComponents(this.currentPage.component.components, this.currentPage.parent.data, flags);
|
|
727
726
|
}
|
|
728
727
|
emitPrevPage() {
|
|
729
728
|
this.emit('prevPage', { page: this.page, submission: this.submission });
|
|
@@ -865,8 +864,7 @@ class Wizard extends Webform_1.default {
|
|
|
865
864
|
onChange(flags, changed, modified, changes) {
|
|
866
865
|
var _a, _b;
|
|
867
866
|
super.onChange(flags, changed, modified, changes);
|
|
868
|
-
|
|
869
|
-
const errors = this.submitted ? this.validate(this.localData, { dirty: false }) : this.validateCurrentPage();
|
|
867
|
+
const errors = this.validate(this.localData, { dirty: false });
|
|
870
868
|
if (this.alert) {
|
|
871
869
|
this.showErrors(errors, true, true);
|
|
872
870
|
}
|
|
@@ -927,13 +925,14 @@ class Wizard extends Webform_1.default {
|
|
|
927
925
|
return super.errors;
|
|
928
926
|
}
|
|
929
927
|
showErrors(errors, triggerEvent) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
928
|
+
if (this.hasExtraPages) {
|
|
929
|
+
this.subWizards.forEach((subWizard) => {
|
|
930
|
+
if (Array.isArray(subWizard.errors)) {
|
|
931
|
+
errors = [...errors, ...subWizard.errors];
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
;
|
|
937
936
|
return super.showErrors(errors, triggerEvent);
|
|
938
937
|
}
|
|
939
938
|
focusOnComponent(key) {
|
|
@@ -476,7 +476,7 @@ class FormComponent extends Component_1.default {
|
|
|
476
476
|
checkComponentValidity(data, dirty, row, options, errors = []) {
|
|
477
477
|
options = options || {};
|
|
478
478
|
const silentCheck = options.silentCheck || false;
|
|
479
|
-
if (this.subForm) {
|
|
479
|
+
if (this.subForm && !this.isNestedWizard) {
|
|
480
480
|
return this.subForm.checkValidity(this.subFormData, dirty, null, silentCheck, errors);
|
|
481
481
|
}
|
|
482
482
|
return super.checkComponentValidity(data, dirty, row, options, errors);
|
package/lib/mjs/Wizard.js
CHANGED
|
@@ -710,9 +710,8 @@ export default class Wizard extends Webform {
|
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
validateCurrentPage(flags = {}) {
|
|
713
|
-
const components = this.currentPage?.components.map((component) => component.component);
|
|
714
713
|
// Accessing the parent ensures the right instance (whether it's the parent Wizard or a nested Wizard) performs its validation
|
|
715
|
-
return this.currentPage?.parent.validateComponents(components, this.currentPage.parent.data, flags);
|
|
714
|
+
return this.currentPage?.parent.validateComponents(this.currentPage.component.components, this.currentPage.parent.data, flags);
|
|
716
715
|
}
|
|
717
716
|
emitPrevPage() {
|
|
718
717
|
this.emit('prevPage', { page: this.page, submission: this.submission });
|
|
@@ -853,8 +852,7 @@ export default class Wizard extends Webform {
|
|
|
853
852
|
}
|
|
854
853
|
onChange(flags, changed, modified, changes) {
|
|
855
854
|
super.onChange(flags, changed, modified, changes);
|
|
856
|
-
|
|
857
|
-
const errors = this.submitted ? this.validate(this.localData, { dirty: false }) : this.validateCurrentPage();
|
|
855
|
+
const errors = this.validate(this.localData, { dirty: false });
|
|
858
856
|
if (this.alert) {
|
|
859
857
|
this.showErrors(errors, true, true);
|
|
860
858
|
}
|
|
@@ -914,13 +912,14 @@ export default class Wizard extends Webform {
|
|
|
914
912
|
return super.errors;
|
|
915
913
|
}
|
|
916
914
|
showErrors(errors, triggerEvent) {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
915
|
+
if (this.hasExtraPages) {
|
|
916
|
+
this.subWizards.forEach((subWizard) => {
|
|
917
|
+
if (Array.isArray(subWizard.errors)) {
|
|
918
|
+
errors = [...errors, ...subWizard.errors];
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
;
|
|
924
923
|
return super.showErrors(errors, triggerEvent);
|
|
925
924
|
}
|
|
926
925
|
focusOnComponent(key) {
|
|
@@ -470,7 +470,7 @@ export default class FormComponent extends Component {
|
|
|
470
470
|
checkComponentValidity(data, dirty, row, options, errors = []) {
|
|
471
471
|
options = options || {};
|
|
472
472
|
const silentCheck = options.silentCheck || false;
|
|
473
|
-
if (this.subForm) {
|
|
473
|
+
if (this.subForm && !this.isNestedWizard) {
|
|
474
474
|
return this.subForm.checkValidity(this.subFormData, dirty, null, silentCheck, errors);
|
|
475
475
|
}
|
|
476
476
|
return super.checkComponentValidity(data, dirty, row, options, errors);
|