@arquimedes.co/eureka-forms 2.0.50 → 2.0.52
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/App/AppFunctions.js +2 -3
- package/dist/Form/Form.js +4 -4
- package/dist/Form/FormFunctions.js +10 -2
- package/package.json +1 -1
package/dist/App/AppFunctions.js
CHANGED
|
@@ -155,9 +155,8 @@ export var addMapperStep = function (step, customSteps) {
|
|
|
155
155
|
export function calcRecursiveData(element, newSteps, customSteps) {
|
|
156
156
|
if (!newSteps)
|
|
157
157
|
return;
|
|
158
|
-
for (var _i = 0, _a = Object.
|
|
159
|
-
var
|
|
160
|
-
var step = newSteps[idStep];
|
|
158
|
+
for (var _i = 0, _a = Object.entries(newSteps); _i < _a.length; _i++) {
|
|
159
|
+
var _b = _a[_i], idStep = _b[0], step = _b[1];
|
|
161
160
|
step.id = idStep;
|
|
162
161
|
if (step.dependencies) {
|
|
163
162
|
for (var i = 0; i < step.dependencies.length; i++) {
|
package/dist/Form/Form.js
CHANGED
|
@@ -102,7 +102,7 @@ function FormComponent(_a) {
|
|
|
102
102
|
}
|
|
103
103
|
}, [idFocusStep]);
|
|
104
104
|
var onSubmit = useCallback(function (values) { return __awaiter(_this, void 0, void 0, function () {
|
|
105
|
-
var token,
|
|
105
|
+
var token, ApiKey, state, newValues, deleteIds, _i, _a, idStep, _b, deleteIds_1, id, params, url, axios, resp, error_1;
|
|
106
106
|
var _c;
|
|
107
107
|
return __generator(this, function (_d) {
|
|
108
108
|
switch (_d.label) {
|
|
@@ -116,8 +116,8 @@ function FormComponent(_a) {
|
|
|
116
116
|
token = _d.sent();
|
|
117
117
|
_d.label = 2;
|
|
118
118
|
case 2:
|
|
119
|
-
|
|
120
|
-
if (!
|
|
119
|
+
ApiKey = internal ? form.apiKey : apiKey;
|
|
120
|
+
if (!ApiKey && !customSubmit && !customSubmitBtns)
|
|
121
121
|
return [2 /*return*/];
|
|
122
122
|
_d.label = 3;
|
|
123
123
|
case 3:
|
|
@@ -146,7 +146,7 @@ function FormComponent(_a) {
|
|
|
146
146
|
params.set('idOrganization', idOrganization !== null && idOrganization !== void 0 ? idOrganization : '');
|
|
147
147
|
if (token)
|
|
148
148
|
params.set('token', token);
|
|
149
|
-
url = "/ticket/".concat(
|
|
149
|
+
url = "/ticket/".concat(ApiKey);
|
|
150
150
|
if (params.toString()) {
|
|
151
151
|
url += "?".concat(params.toString());
|
|
152
152
|
}
|
|
@@ -76,19 +76,27 @@ export var calcValue = function (idStep, steps, values, customSteps, deleteIds,
|
|
|
76
76
|
}
|
|
77
77
|
if (element.value)
|
|
78
78
|
newValue.value = element.value;
|
|
79
|
+
var nestedDeleteIds = [];
|
|
79
80
|
for (var _e = 0, _f = Object.keys(step.steps); _e < _f.length; _e++) {
|
|
80
81
|
var idStep_1 = _f[_e];
|
|
81
82
|
var mappedId = element.ids[idStep_1];
|
|
82
83
|
if (values[mappedId] !== undefined) {
|
|
83
|
-
newValue[idStep_1] = calcValue(idStep_1, step.steps, values, customSteps,
|
|
84
|
-
deleteIds.push(mappedId);
|
|
84
|
+
newValue[idStep_1] = calcValue(idStep_1, step.steps, values, customSteps, nestedDeleteIds, values[mappedId]);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
for (var _g = 0, nestedDeleteIds_1 = nestedDeleteIds; _g < nestedDeleteIds_1.length; _g++) {
|
|
88
|
+
var idStep_2 = nestedDeleteIds_1[_g];
|
|
89
|
+
delete newValue[idStep_2];
|
|
90
|
+
}
|
|
91
|
+
deleteIds.push.apply(deleteIds, nestedDeleteIds);
|
|
92
|
+
deleteIds.push.apply(deleteIds, Object.values(element.ids));
|
|
87
93
|
mappedValues.push(newValue);
|
|
88
94
|
}
|
|
89
95
|
return mappedValues;
|
|
90
96
|
}
|
|
91
97
|
case StepTypes.TITLE: {
|
|
98
|
+
if (!value)
|
|
99
|
+
deleteIds.push(idStep);
|
|
92
100
|
return value !== null && value !== void 0 ? value : undefined;
|
|
93
101
|
}
|
|
94
102
|
case StepTypes.COLLAPSIBLE:
|