@arquimedes.co/eureka-forms 1.9.60 → 1.9.61-test
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.js +0 -6
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +21 -16
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +2 -1
- package/dist/FormComponents/Step/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.module.css +1 -1
- package/dist/FormComponents/Step/Step.js +2 -2
- package/package.json +1 -1
package/dist/App.js
CHANGED
|
@@ -382,12 +382,6 @@ var mapOriginalValues = function (originalValues, form) {
|
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
for (var _f = 0, _g = Object.keys(element); _f < _g.length; _f++) {
|
|
386
|
-
var idValue_1 = _g[_f];
|
|
387
|
-
if (!step.steps[idValue_1] && idValue_1 !== 'id') {
|
|
388
|
-
newValues[idValue_1] = element[idValue_1];
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
385
|
mappedElements.push(mappedElement);
|
|
392
386
|
}
|
|
393
387
|
newValues[step.id] = mappedElements;
|
|
@@ -94,14 +94,14 @@ function ColumnForm(_a) {
|
|
|
94
94
|
return _jsx("div", {});
|
|
95
95
|
}
|
|
96
96
|
var onSubmit = function (token) { return __awaiter(_this, void 0, void 0, function () {
|
|
97
|
-
var valid, values, newValues, _i, _a, idStep, customResp, payload, url, resp,
|
|
98
|
-
return __generator(this, function (
|
|
99
|
-
switch (
|
|
97
|
+
var valid, values, newValues, deleteIds, _i, _a, idStep, _b, deleteIds_1, id, customResp, payload, url, resp, _c, error_1;
|
|
98
|
+
return __generator(this, function (_d) {
|
|
99
|
+
switch (_d.label) {
|
|
100
100
|
case 0:
|
|
101
101
|
if (!(apiKey || internal || customSend)) return [3 /*break*/, 11];
|
|
102
102
|
return [4 /*yield*/, trigger(undefined, { shouldFocus: true })];
|
|
103
103
|
case 1:
|
|
104
|
-
valid =
|
|
104
|
+
valid = _d.sent();
|
|
105
105
|
values = getValues();
|
|
106
106
|
if (!!valid) return [3 /*break*/, 2];
|
|
107
107
|
console.error('ERRORS:', errors);
|
|
@@ -111,17 +111,22 @@ function ColumnForm(_a) {
|
|
|
111
111
|
}, 500);
|
|
112
112
|
return [3 /*break*/, 11];
|
|
113
113
|
case 2:
|
|
114
|
-
|
|
114
|
+
_d.trys.push([2, 10, , 11]);
|
|
115
115
|
setLoading(true);
|
|
116
116
|
newValues = {};
|
|
117
|
+
deleteIds = [];
|
|
117
118
|
for (_i = 0, _a = Object.keys(values); _i < _a.length; _i++) {
|
|
118
119
|
idStep = _a[_i];
|
|
119
|
-
newValues[idStep] = calcValue(
|
|
120
|
+
newValues[idStep] = calcValue(idStep, form.steps, values, customSteps, deleteIds);
|
|
121
|
+
}
|
|
122
|
+
for (_b = 0, deleteIds_1 = deleteIds; _b < deleteIds_1.length; _b++) {
|
|
123
|
+
id = deleteIds_1[_b];
|
|
124
|
+
delete newValues[id];
|
|
120
125
|
}
|
|
121
126
|
if (!customSend) return [3 /*break*/, 4];
|
|
122
127
|
return [4 /*yield*/, customSend(newValues, reload)];
|
|
123
128
|
case 3:
|
|
124
|
-
customResp =
|
|
129
|
+
customResp = _d.sent();
|
|
125
130
|
setLoading(false);
|
|
126
131
|
return [2 /*return*/, customResp];
|
|
127
132
|
case 4:
|
|
@@ -135,21 +140,21 @@ function ColumnForm(_a) {
|
|
|
135
140
|
if (!(domain || internal)) return [3 /*break*/, 6];
|
|
136
141
|
return [4 /*yield*/, widgetInstance.post("".concat(url, "?idOrganization=").concat(domain), payload)];
|
|
137
142
|
case 5:
|
|
138
|
-
|
|
143
|
+
_c = _d.sent();
|
|
139
144
|
return [3 /*break*/, 8];
|
|
140
145
|
case 6: return [4 /*yield*/, axiosInstance.post(url, payload)];
|
|
141
146
|
case 7:
|
|
142
|
-
|
|
143
|
-
|
|
147
|
+
_c = _d.sent();
|
|
148
|
+
_d.label = 8;
|
|
144
149
|
case 8:
|
|
145
|
-
resp =
|
|
150
|
+
resp = _c;
|
|
146
151
|
setShowConfirmation(resp === null || resp === void 0 ? void 0 : resp.data);
|
|
147
|
-
|
|
152
|
+
_d.label = 9;
|
|
148
153
|
case 9:
|
|
149
154
|
setLoading(false);
|
|
150
155
|
return [3 /*break*/, 11];
|
|
151
156
|
case 10:
|
|
152
|
-
error_1 =
|
|
157
|
+
error_1 = _d.sent();
|
|
153
158
|
console.error(error_1);
|
|
154
159
|
setLoading(false);
|
|
155
160
|
return [3 /*break*/, 11];
|
|
@@ -220,7 +225,7 @@ function calcNextSection(form, idSection, sections) {
|
|
|
220
225
|
}
|
|
221
226
|
}
|
|
222
227
|
}
|
|
223
|
-
var calcValue = function (
|
|
228
|
+
var calcValue = function (idStep, steps, values, customSteps, deleteIds, value) {
|
|
224
229
|
var _a, _b;
|
|
225
230
|
if (value === void 0) { value = values[idStep]; }
|
|
226
231
|
var step = steps[idStep];
|
|
@@ -272,8 +277,8 @@ var calcValue = function (newValues, idStep, steps, values, customSteps, value)
|
|
|
272
277
|
var idStep_1 = _d[_c];
|
|
273
278
|
var mappedId = element.ids[idStep_1];
|
|
274
279
|
if (values[mappedId] !== undefined) {
|
|
275
|
-
newValue[idStep_1] = calcValue(
|
|
276
|
-
|
|
280
|
+
newValue[idStep_1] = calcValue(idStep_1, step.steps, values, customSteps, deleteIds, values[mappedId]);
|
|
281
|
+
deleteIds.push(mappedId);
|
|
277
282
|
}
|
|
278
283
|
}
|
|
279
284
|
mappedValues.push(newValue);
|
|
@@ -25,6 +25,7 @@ import { createElement as _createElement } from "react";
|
|
|
25
25
|
import StepComponent from '../../Step/Step';
|
|
26
26
|
import styles from './MaterialSection.module.css';
|
|
27
27
|
function MaterialSection(_a) {
|
|
28
|
+
var _b;
|
|
28
29
|
var form = _a.form, section = _a.section, widthStats = _a.widthStats, sendLabel = _a.sendLabel, others = __rest(_a, ["form", "section", "widthStats", "sendLabel"]);
|
|
29
30
|
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
30
31
|
width: (form.size.blockSize + form.size.spacingSize) *
|
|
@@ -33,7 +34,7 @@ function MaterialSection(_a) {
|
|
|
33
34
|
widthStats.currentBreakPoint < form.size.blockNum
|
|
34
35
|
? 'center'
|
|
35
36
|
: 'normal',
|
|
36
|
-
} }, { children: section.steps.map(function (idStep) {
|
|
37
|
+
} }, { children: (_b = section.steps) === null || _b === void 0 ? void 0 : _b.map(function (idStep) {
|
|
37
38
|
var step = form.steps[idStep];
|
|
38
39
|
//If partial is active only display steps with originalValues
|
|
39
40
|
if (step) {
|
|
@@ -94,10 +94,10 @@ function StepComponent(_a) {
|
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
if (step.type.startsWith('CBR')) {
|
|
97
|
-
return _jsx(CBRStepMapper, __assign({}, props, { step: step }));
|
|
97
|
+
return (_jsx(CBRStepMapper, __assign({}, props, { step: step, editable: editable })));
|
|
98
98
|
}
|
|
99
99
|
else if (step.type.startsWith('AYF')) {
|
|
100
|
-
return _jsx(AYFStepMapper, __assign({}, props, { step: step }));
|
|
100
|
+
return (_jsx(AYFStepMapper, __assign({}, props, { step: step, editable: editable })));
|
|
101
101
|
}
|
|
102
102
|
return _jsx("div", {});
|
|
103
103
|
}
|
package/package.json
CHANGED