@arquimedes.co/eureka-forms 1.9.45 → 1.9.47
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
CHANGED
|
@@ -403,13 +403,13 @@ var mapOriginalValues = function (originalValues, form) {
|
|
|
403
403
|
return newValues;
|
|
404
404
|
};
|
|
405
405
|
var mapOriginalValue = function (step, value, form) {
|
|
406
|
-
var _a;
|
|
406
|
+
var _a, _b;
|
|
407
407
|
switch (step === null || step === void 0 ? void 0 : step.type) {
|
|
408
408
|
case StepTypes.TEXTAREA: {
|
|
409
409
|
if (step.hasTextEditor) {
|
|
410
410
|
return calcDefaultDraftValue(value);
|
|
411
411
|
}
|
|
412
|
-
return value;
|
|
412
|
+
return (_a = value.value) !== null && _a !== void 0 ? _a : value;
|
|
413
413
|
}
|
|
414
414
|
case StepTypes.SELECTOR: {
|
|
415
415
|
var option = step.options.find(function (option) { return option.value == value; });
|
|
@@ -418,7 +418,7 @@ var mapOriginalValue = function (step, value, form) {
|
|
|
418
418
|
return value;
|
|
419
419
|
}
|
|
420
420
|
case StepTypes.CLASSIFIER_SELECTOR: {
|
|
421
|
-
var classifier = form.classifiers[(
|
|
421
|
+
var classifier = form.classifiers[(_b = step.idClassifier) !== null && _b !== void 0 ? _b : ''];
|
|
422
422
|
if (classifier) {
|
|
423
423
|
var option = classifier.children.find(function (child) { return child._id == value; });
|
|
424
424
|
if (!(value === null || value === void 0 ? void 0 : value.value))
|
|
@@ -94,7 +94,7 @@ 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,
|
|
97
|
+
var valid, values, newValues, _i, _a, idStep, payload, url, resp, _b, error_1;
|
|
98
98
|
return __generator(this, function (_c) {
|
|
99
99
|
switch (_c.label) {
|
|
100
100
|
case 0:
|
|
@@ -116,8 +116,7 @@ function ColumnForm(_a) {
|
|
|
116
116
|
newValues = {};
|
|
117
117
|
for (_i = 0, _a = Object.keys(values); _i < _a.length; _i++) {
|
|
118
118
|
idStep = _a[_i];
|
|
119
|
-
|
|
120
|
-
newValues[idStep] = calcValue(step, values, customSteps);
|
|
119
|
+
newValues[idStep] = calcValue(idStep, form.steps, values, customSteps);
|
|
121
120
|
}
|
|
122
121
|
if (!customSend) return [3 /*break*/, 4];
|
|
123
122
|
return [4 /*yield*/, customSend(newValues, reload)];
|
|
@@ -220,14 +219,15 @@ function calcNextSection(form, idSection, sections) {
|
|
|
220
219
|
}
|
|
221
220
|
}
|
|
222
221
|
}
|
|
223
|
-
var calcValue = function (
|
|
224
|
-
var _a, _b
|
|
225
|
-
if (value === void 0) { value = values[
|
|
222
|
+
var calcValue = function (idStep, steps, values, customSteps, value) {
|
|
223
|
+
var _a, _b;
|
|
224
|
+
if (value === void 0) { value = values[idStep]; }
|
|
225
|
+
var step = steps[idStep];
|
|
226
226
|
if (!step)
|
|
227
|
-
return;
|
|
227
|
+
return value;
|
|
228
228
|
var custom = customSteps[step === null || step === void 0 ? void 0 : step.type];
|
|
229
229
|
if (custom !== undefined) {
|
|
230
|
-
return (
|
|
230
|
+
return (_b = (_a = custom.calcValue) === null || _a === void 0 ? void 0 : _a.call(custom, step, value)) !== null && _b !== void 0 ? _b : value;
|
|
231
231
|
}
|
|
232
232
|
else {
|
|
233
233
|
switch (step === null || step === void 0 ? void 0 : step.type) {
|
|
@@ -264,12 +264,11 @@ var calcValue = function (step, values, customSteps, value) {
|
|
|
264
264
|
var newValue = {
|
|
265
265
|
id: element.id,
|
|
266
266
|
};
|
|
267
|
-
for (var
|
|
268
|
-
var
|
|
269
|
-
var mappedId = element.ids[
|
|
267
|
+
for (var _c = 0, _d = Object.keys(step.steps); _c < _d.length; _c++) {
|
|
268
|
+
var idStep_1 = _d[_c];
|
|
269
|
+
var mappedId = element.ids[idStep_1];
|
|
270
270
|
if (values[mappedId] !== undefined) {
|
|
271
|
-
|
|
272
|
-
newValue[idStep] = calcValue(substep, values, customSteps, values[mappedId]);
|
|
271
|
+
newValue[idStep_1] = calcValue(idStep_1, step.steps, values, customSteps, values[mappedId]);
|
|
273
272
|
}
|
|
274
273
|
}
|
|
275
274
|
mappedValues.push(newValue);
|