@arquimedes.co/eureka-forms 2.0.122 → 2.0.123
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 +32 -24
- package/package.json +1 -1
package/dist/App/AppFunctions.js
CHANGED
|
@@ -168,9 +168,9 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
168
168
|
if (path === void 0) { path = ''; }
|
|
169
169
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
170
170
|
var _a, elements, mappedElements, _loop_1, _i, elements_1, element, defaultValue, option, stepClassifier, classifier, params, url, entityValues, entityValue, country;
|
|
171
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
172
|
-
return __generator(this, function (
|
|
173
|
-
switch (
|
|
171
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
172
|
+
return __generator(this, function (_p) {
|
|
173
|
+
switch (_p.label) {
|
|
174
174
|
case 0:
|
|
175
175
|
if (!value)
|
|
176
176
|
return [2 /*return*/, value];
|
|
@@ -188,9 +188,9 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
188
188
|
elements = value;
|
|
189
189
|
mappedElements = [];
|
|
190
190
|
_loop_1 = function (element) {
|
|
191
|
-
var idElement, mappedElement, base,
|
|
192
|
-
return __generator(this, function (
|
|
193
|
-
switch (
|
|
191
|
+
var idElement, mappedElement, base, _q, _r, subStep, dependencies, _s, dependencies_1, idDep, mappedIdDep, _t, _u, key;
|
|
192
|
+
return __generator(this, function (_v) {
|
|
193
|
+
switch (_v.label) {
|
|
194
194
|
case 0:
|
|
195
195
|
idElement = (_b = element.id) !== null && _b !== void 0 ? _b : nanoid();
|
|
196
196
|
mappedElement = {
|
|
@@ -223,15 +223,15 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
223
223
|
});
|
|
224
224
|
}); }))];
|
|
225
225
|
case 1:
|
|
226
|
-
|
|
227
|
-
for (
|
|
228
|
-
subStep = _q
|
|
226
|
+
_v.sent();
|
|
227
|
+
for (_q = 0, _r = Object.values(step.steps); _q < _r.length; _q++) {
|
|
228
|
+
subStep = _r[_q];
|
|
229
229
|
dependencies = (_c = subStep.dependencies) !== null && _c !== void 0 ? _c : [];
|
|
230
230
|
if (subStep.condition) {
|
|
231
231
|
dependencies = __spreadArray(__spreadArray([], dependencies, true), calcNestedConditionSteps(subStep.condition), true).filter(function (item, i, ar) { return ar.indexOf(item) === i; });
|
|
232
232
|
}
|
|
233
|
-
for (
|
|
234
|
-
idDep = dependencies_1[
|
|
233
|
+
for (_s = 0, dependencies_1 = dependencies; _s < dependencies_1.length; _s++) {
|
|
234
|
+
idDep = dependencies_1[_s];
|
|
235
235
|
mappedIdDep = base + step.id + '-' + idElement + '-' + idDep;
|
|
236
236
|
if (!values.sections[step.idSection][idDep] &&
|
|
237
237
|
!values.global[mappedIdDep] &&
|
|
@@ -241,8 +241,8 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
for (
|
|
245
|
-
key = _t
|
|
244
|
+
for (_t = 0, _u = Object.keys(element); _t < _u.length; _t++) {
|
|
245
|
+
key = _u[_t];
|
|
246
246
|
if (step.steps[key] || key === 'id')
|
|
247
247
|
continue;
|
|
248
248
|
mappedElement.originalValues[key] = element[key];
|
|
@@ -253,14 +253,14 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
253
253
|
});
|
|
254
254
|
};
|
|
255
255
|
_i = 0, elements_1 = elements;
|
|
256
|
-
|
|
256
|
+
_p.label = 2;
|
|
257
257
|
case 2:
|
|
258
258
|
if (!(_i < elements_1.length)) return [3 /*break*/, 5];
|
|
259
259
|
element = elements_1[_i];
|
|
260
260
|
return [5 /*yield**/, _loop_1(element)];
|
|
261
261
|
case 3:
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
_p.sent();
|
|
263
|
+
_p.label = 4;
|
|
264
264
|
case 4:
|
|
265
265
|
_i++;
|
|
266
266
|
return [3 /*break*/, 2];
|
|
@@ -281,7 +281,7 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
281
281
|
return [2 /*return*/, (_e = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.text) !== null && _e !== void 0 ? _e : ''];
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
|
|
284
|
+
_p.label = 7;
|
|
285
285
|
case 7:
|
|
286
286
|
{
|
|
287
287
|
option = step.options.find(function (option) { return option.value === value; });
|
|
@@ -289,7 +289,7 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
289
289
|
return [2 /*return*/, option];
|
|
290
290
|
return [2 /*return*/, value];
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
_p.label = 8;
|
|
293
293
|
case 8:
|
|
294
294
|
{
|
|
295
295
|
stepClassifier = (_f = form === null || form === void 0 ? void 0 : form.classifiers) === null || _f === void 0 ? void 0 : _f[(_g = step.idClassifier) !== null && _g !== void 0 ? _g : ''];
|
|
@@ -299,14 +299,16 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
299
299
|
}
|
|
300
300
|
return [3 /*break*/, 14];
|
|
301
301
|
}
|
|
302
|
-
|
|
302
|
+
_p.label = 9;
|
|
303
303
|
case 9:
|
|
304
304
|
if (!!value._id) return [3 /*break*/, 11];
|
|
305
|
-
params =
|
|
305
|
+
params = typeof value !== 'string'
|
|
306
|
+
? new URLSearchParams(value)
|
|
307
|
+
: new URLSearchParams();
|
|
306
308
|
url = "".concat(orgInfo.idOrganization, "/entities/").concat(step.idEntity, "?").concat(params.toString());
|
|
307
309
|
return [4 /*yield*/, widgetInstance.get(url)];
|
|
308
310
|
case 10:
|
|
309
|
-
entityValues = (
|
|
311
|
+
entityValues = (_p.sent()).data;
|
|
310
312
|
if (entityValues.length === 1) {
|
|
311
313
|
entityValue = entityValues[0];
|
|
312
314
|
if (((_j = step.options[entityValue._id]) === null || _j === void 0 ? void 0 : _j.type) ===
|
|
@@ -314,16 +316,22 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
314
316
|
return [2 /*return*/, undefined];
|
|
315
317
|
return [2 /*return*/, entityValues[0]];
|
|
316
318
|
}
|
|
319
|
+
if (typeof value === 'string') {
|
|
320
|
+
if (((_k = step.options[value]) === null || _k === void 0 ? void 0 : _k.type) ===
|
|
321
|
+
EntityValueOptionTypes.HIDE)
|
|
322
|
+
return [2 /*return*/, undefined];
|
|
323
|
+
return [2 /*return*/, entityValues.find(function (ev) { return ev._id === value; })];
|
|
324
|
+
}
|
|
317
325
|
return [2 /*return*/, null];
|
|
318
326
|
case 11: return [2 /*return*/, value];
|
|
319
327
|
case 12:
|
|
320
328
|
{
|
|
321
329
|
if (step.clientInfoType === 'cel' ||
|
|
322
|
-
((
|
|
330
|
+
((_l = step.validation) === null || _l === void 0 ? void 0 : _l.type) === 'PHONE') {
|
|
323
331
|
if (!isValidPhoneNumber(value)) {
|
|
324
332
|
country = getCountry({
|
|
325
333
|
field: 'iso2',
|
|
326
|
-
value: (
|
|
334
|
+
value: (_o = (_m = orgInfo.countryCode) === null || _m === void 0 ? void 0 : _m.toLowerCase()) !== null && _o !== void 0 ? _o : 'co',
|
|
327
335
|
});
|
|
328
336
|
if (country &&
|
|
329
337
|
isValidPhoneNumber(country.dialCode + value)) {
|
|
@@ -333,7 +341,7 @@ export var mapOriginalValue = function (orgInfo, step, value, values, form, path
|
|
|
333
341
|
}
|
|
334
342
|
return [2 /*return*/, value];
|
|
335
343
|
}
|
|
336
|
-
|
|
344
|
+
_p.label = 13;
|
|
337
345
|
case 13:
|
|
338
346
|
if (step.type.startsWith('CBR_') &&
|
|
339
347
|
(value === null || value === void 0 ? void 0 : value.id) &&
|
package/package.json
CHANGED