@processmaker/screen-builder 2.61.0 → 2.62.1
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/vue-form-builder.common.js +975 -652
- package/dist/vue-form-builder.common.js.map +1 -1
- package/dist/vue-form-builder.umd.js +975 -652
- package/dist/vue-form-builder.umd.js.map +1 -1
- package/dist/vue-form-builder.umd.min.js +1 -1
- package/dist/vue-form-builder.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/mixins/ScreenBase.js +3 -5
- package/src/store/modules/globalErrorsModule.js +25 -9
package/package.json
CHANGED
package/src/.DS_Store
CHANGED
|
Binary file
|
package/src/mixins/ScreenBase.js
CHANGED
|
@@ -246,11 +246,9 @@ export default {
|
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
|
|
250
|
-
object,
|
|
251
|
-
|
|
252
|
-
setValue,
|
|
253
|
-
);
|
|
249
|
+
if (object instanceof Object) {
|
|
250
|
+
this.$set(object, attr, setValue);
|
|
251
|
+
}
|
|
254
252
|
|
|
255
253
|
object = get(object, attr);
|
|
256
254
|
defaults = get(defaults, attr);
|
|
@@ -31,14 +31,22 @@ function countErrors(obj) {
|
|
|
31
31
|
return errors;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const updateValidationRules = async (
|
|
35
|
-
const
|
|
34
|
+
const updateValidationRules = async (screens, commit) => {
|
|
35
|
+
const rootScreen = findRootScreen(screens[0]);
|
|
36
|
+
const awaitLoad = [];
|
|
37
|
+
screens.forEach((screen) => {
|
|
38
|
+
if (rootScreen !== screen) {
|
|
39
|
+
// refresh nested screen validation rules
|
|
40
|
+
awaitLoad.push(screen.loadValidationRules());
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
await Promise.all(awaitLoad);
|
|
36
44
|
try {
|
|
37
|
-
await
|
|
45
|
+
await rootScreen.loadValidationRules();
|
|
38
46
|
} catch (error) {
|
|
39
47
|
console.warn("There was a problem rendering the screen", error);
|
|
40
48
|
}
|
|
41
|
-
const validate =
|
|
49
|
+
const validate = rootScreen.$v;
|
|
42
50
|
// update the global error state used by submit buttons
|
|
43
51
|
if (validate) {
|
|
44
52
|
let errors = 0;
|
|
@@ -50,7 +58,7 @@ const updateValidationRules = async (screen, commit) => {
|
|
|
50
58
|
errors === 1
|
|
51
59
|
? "There is a validation error in your form."
|
|
52
60
|
: "There are {{items}} validation errors in your form.";
|
|
53
|
-
message =
|
|
61
|
+
message = rootScreen.$t(message, { items: errors });
|
|
54
62
|
}
|
|
55
63
|
commit("basic", {
|
|
56
64
|
key: "valid",
|
|
@@ -63,7 +71,15 @@ const updateValidationRules = async (screen, commit) => {
|
|
|
63
71
|
}
|
|
64
72
|
};
|
|
65
73
|
|
|
66
|
-
const updateValidationRulesDebounced = debounce(updateValidationRules,
|
|
74
|
+
const updateValidationRulesDebounced = debounce(updateValidationRules, 500);
|
|
75
|
+
|
|
76
|
+
const screensToValidate = [];
|
|
77
|
+
const queueUpdateValidationRules = (mainScreen, commit) => {
|
|
78
|
+
if (!screensToValidate.includes(mainScreen)) {
|
|
79
|
+
screensToValidate.push(mainScreen);
|
|
80
|
+
}
|
|
81
|
+
updateValidationRulesDebounced(screensToValidate, commit);
|
|
82
|
+
};
|
|
67
83
|
|
|
68
84
|
const globalErrorsModule = {
|
|
69
85
|
namespaced,
|
|
@@ -96,14 +112,14 @@ const globalErrorsModule = {
|
|
|
96
112
|
},
|
|
97
113
|
actions: {
|
|
98
114
|
validate({ commit }, mainScreen) {
|
|
99
|
-
|
|
115
|
+
queueUpdateValidationRules(mainScreen, commit);
|
|
100
116
|
},
|
|
101
117
|
async validateNow({ commit }, mainScreen) {
|
|
102
|
-
await updateValidationRules(mainScreen, commit);
|
|
118
|
+
await updateValidationRules([mainScreen], commit);
|
|
103
119
|
},
|
|
104
120
|
close({ commit }) {
|
|
105
121
|
commit("basic", { key: "valid", value: true });
|
|
106
|
-
}
|
|
122
|
+
}
|
|
107
123
|
}
|
|
108
124
|
};
|
|
109
125
|
|