@processmaker/screen-builder 2.62.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 +481 -287
- package/dist/vue-form-builder.common.js.map +1 -1
- package/dist/vue-form-builder.umd.js +481 -287
- 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/store/modules/globalErrorsModule.js +22 -10
package/package.json
CHANGED
package/src/.DS_Store
CHANGED
|
Binary file
|
|
@@ -31,12 +31,16 @@ function countErrors(obj) {
|
|
|
31
31
|
return errors;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const updateValidationRules = async (
|
|
35
|
-
const rootScreen = findRootScreen(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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);
|
|
40
44
|
try {
|
|
41
45
|
await rootScreen.loadValidationRules();
|
|
42
46
|
} catch (error) {
|
|
@@ -67,7 +71,15 @@ const updateValidationRules = async (screen, commit) => {
|
|
|
67
71
|
}
|
|
68
72
|
};
|
|
69
73
|
|
|
70
|
-
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
|
+
};
|
|
71
83
|
|
|
72
84
|
const globalErrorsModule = {
|
|
73
85
|
namespaced,
|
|
@@ -100,14 +112,14 @@ const globalErrorsModule = {
|
|
|
100
112
|
},
|
|
101
113
|
actions: {
|
|
102
114
|
validate({ commit }, mainScreen) {
|
|
103
|
-
|
|
115
|
+
queueUpdateValidationRules(mainScreen, commit);
|
|
104
116
|
},
|
|
105
117
|
async validateNow({ commit }, mainScreen) {
|
|
106
|
-
await updateValidationRules(mainScreen, commit);
|
|
118
|
+
await updateValidationRules([mainScreen], commit);
|
|
107
119
|
},
|
|
108
120
|
close({ commit }) {
|
|
109
121
|
commit("basic", { key: "valid", value: true });
|
|
110
|
-
}
|
|
122
|
+
}
|
|
111
123
|
}
|
|
112
124
|
};
|
|
113
125
|
|