@processmaker/screen-builder 3.8.15-patch.a.1 → 3.8.15-patch.c
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.css +1 -1
- package/dist/vue-form-builder.es.js +3518 -3864
- package/dist/vue-form-builder.es.js.map +1 -1
- package/dist/vue-form-builder.umd.js +48 -48
- package/dist/vue-form-builder.umd.js.map +1 -1
- package/package.json +1 -9
- package/src/components/accordions.js +0 -1
- package/src/components/inspector/index.js +0 -1
- package/src/components/renderer/form-button.vue +2 -4
- package/src/components/task.vue +7 -5
- package/src/components/vue-form-renderer.vue +2 -4
- package/src/form-builder-controls.js +0 -8
- package/src/mixins/Json2Vue.js +1 -2
- package/src/mixins/ScreenBase.js +3 -28
- package/src/mixins/index.js +0 -1
- package/src/components/inspector/variables-to-submit.vue +0 -782
- package/src/mixins/VariablesToSubmitFilter.js +0 -76
- package/src/stories/VariablesToSubmit.stories.js +0 -686
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VariablesToSubmitFilter Mixin
|
|
3
|
-
*
|
|
4
|
-
* Filters form data before submission based on button configuration.
|
|
5
|
-
* Protects against invalid data (null/undefined/false) and preserves system variables.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
methods: {
|
|
10
|
-
/**
|
|
11
|
-
* Filters data for submission based on variablesToSubmit configuration
|
|
12
|
-
* @param {Object} data - Form data to filter
|
|
13
|
-
* @param {Object} buttonInfo - Button configuration with optional variablesToSubmit array
|
|
14
|
-
* @returns {Object} Filtered data (always returns a valid object)
|
|
15
|
-
*/
|
|
16
|
-
filterDataForSubmission(data, buttonInfo) {
|
|
17
|
-
// Normalize invalid data to empty object
|
|
18
|
-
const safeData = this.isValidObject(data) ? data : {};
|
|
19
|
-
|
|
20
|
-
// No filtering: return all data (backward compatibility)
|
|
21
|
-
if (!this.shouldFilterVariables(buttonInfo)) {
|
|
22
|
-
return safeData;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Apply filtering
|
|
26
|
-
const variablesToSubmit = buttonInfo.variablesToSubmit;
|
|
27
|
-
const filteredData = {};
|
|
28
|
-
|
|
29
|
-
// Add requested variables
|
|
30
|
-
variablesToSubmit.forEach(variableName => {
|
|
31
|
-
if (variableName in safeData) {
|
|
32
|
-
filteredData[variableName] = safeData[variableName];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// Always preserve system variables (starting with _)
|
|
37
|
-
Object.keys(safeData).forEach(key => {
|
|
38
|
-
if (key.startsWith('_')) {
|
|
39
|
-
filteredData[key] = safeData[key];
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return filteredData;
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Checks if data is a valid plain object
|
|
48
|
-
* @param {*} data - Data to validate
|
|
49
|
-
* @returns {boolean} True if valid object, false otherwise
|
|
50
|
-
*/
|
|
51
|
-
isValidObject(data) {
|
|
52
|
-
return (
|
|
53
|
-
data !== null &&
|
|
54
|
-
data !== undefined &&
|
|
55
|
-
data !== false &&
|
|
56
|
-
typeof data === 'object' &&
|
|
57
|
-
!Array.isArray(data)
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Checks if filtering should be applied
|
|
63
|
-
* @param {Object} buttonInfo - Button configuration
|
|
64
|
-
* @returns {boolean} True if filtering enabled, false otherwise
|
|
65
|
-
*/
|
|
66
|
-
shouldFilterVariables(buttonInfo) {
|
|
67
|
-
return (
|
|
68
|
-
buttonInfo &&
|
|
69
|
-
buttonInfo.variablesToSubmit &&
|
|
70
|
-
Array.isArray(buttonInfo.variablesToSubmit) &&
|
|
71
|
-
buttonInfo.variablesToSubmit.length > 0
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|