tuain-ng-forms-lib 0.12.10 → 0.12.14
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/bundles/tuain-ng-forms-lib.umd.js +171 -170
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/components/forms/basic-form.js +9 -9
- package/esm2015/lib/services/form-manager.service.js +3 -2
- package/fesm2015/tuain-ng-forms-lib.js +10 -9
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/package.json +1 -1
|
@@ -3068,7 +3068,8 @@
|
|
|
3068
3068
|
return;
|
|
3069
3069
|
}
|
|
3070
3070
|
var _a = prevForm.origin, url = _a.url, params = _a.params, token = _a.token;
|
|
3071
|
-
var navigationArray = __spreadArray(
|
|
3071
|
+
var navigationArray = __spreadArray([url], __read(params));
|
|
3072
|
+
token && navigationArray.push(token);
|
|
3072
3073
|
this.goToRoute(navigationArray);
|
|
3073
3074
|
};
|
|
3074
3075
|
return LibFormManagerService;
|
|
@@ -3318,24 +3319,24 @@
|
|
|
3318
3319
|
};
|
|
3319
3320
|
BasicFormComponent.prototype.goToPage = function (navigationArray, predefinedFields, options) {
|
|
3320
3321
|
if (options === void 0) { options = null; }
|
|
3321
|
-
var _a;
|
|
3322
|
+
var _a, _b;
|
|
3322
3323
|
var origin = null;
|
|
3323
3324
|
var cleanStack = (_a = options === null || options === void 0 ? void 0 : options.cleanStack) !== null && _a !== void 0 ? _a : false;
|
|
3325
|
+
var params = [];
|
|
3326
|
+
this.currentState && params.push(this.currentState);
|
|
3327
|
+
this.formSubject && params.push(this.formSubject);
|
|
3324
3328
|
if (!cleanStack) {
|
|
3325
3329
|
origin = {
|
|
3326
3330
|
code: this.name,
|
|
3327
3331
|
url: this._formRoute,
|
|
3328
|
-
params:
|
|
3329
|
-
this.currentState,
|
|
3330
|
-
this.formSubject,
|
|
3331
|
-
],
|
|
3332
|
+
params: params,
|
|
3332
3333
|
token: this.transitionToken,
|
|
3333
3334
|
predefinedFields: this.inputDataFields
|
|
3334
3335
|
};
|
|
3335
3336
|
}
|
|
3336
3337
|
var target = {
|
|
3337
3338
|
url: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0],
|
|
3338
|
-
params: navigationArray.splice(1),
|
|
3339
|
+
params: (_b = navigationArray.splice(1)) !== null && _b !== void 0 ? _b : [],
|
|
3339
3340
|
predefinedFields: predefinedFields,
|
|
3340
3341
|
};
|
|
3341
3342
|
this.formManagerService.changeForm(origin, target);
|
|
@@ -3382,8 +3383,8 @@
|
|
|
3382
3383
|
BasicFormComponent.prototype.getSubject = function () { return this.formSubject; };
|
|
3383
3384
|
BasicFormComponent.prototype.getformSubject = function () { return this.getSubject(); };
|
|
3384
3385
|
BasicFormComponent.prototype.preocessInputParams = function (params) {
|
|
3385
|
-
var e_1,
|
|
3386
|
-
var _a, _b, _c, _d, _e;
|
|
3386
|
+
var e_1, _g;
|
|
3387
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3387
3388
|
var allParams = Object.keys(params !== null && params !== void 0 ? params : {});
|
|
3388
3389
|
if (!allParams || !Array.isArray(allParams) || allParams.length === 0) {
|
|
3389
3390
|
return;
|
|
@@ -3398,7 +3399,7 @@
|
|
|
3398
3399
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3399
3400
|
finally {
|
|
3400
3401
|
try {
|
|
3401
|
-
if (allParams_1_1 && !allParams_1_1.done && (
|
|
3402
|
+
if (allParams_1_1 && !allParams_1_1.done && (_g = allParams_1.return)) _g.call(allParams_1);
|
|
3402
3403
|
}
|
|
3403
3404
|
finally { if (e_1) throw e_1.error; }
|
|
3404
3405
|
}
|
|
@@ -3410,7 +3411,7 @@
|
|
|
3410
3411
|
this.formSubject = (_d = (_c = this.extraData) === null || _c === void 0 ? void 0 : _c[FORM_SUBJECT]) !== null && _d !== void 0 ? _d : null;
|
|
3411
3412
|
var initialState = this.extraData[STATE_PARAM];
|
|
3412
3413
|
this.transitionToken = (_e = this.extraData[ORIGIN_PARAM]) !== null && _e !== void 0 ? _e : null;
|
|
3413
|
-
this.inputDataFields = (
|
|
3414
|
+
this.inputDataFields = (_f = this.formManagerService.getInputData(this.transitionToken)) !== null && _f !== void 0 ? _f : [];
|
|
3414
3415
|
if (!this.transitionToken) {
|
|
3415
3416
|
this.formManagerService.cleanStack();
|
|
3416
3417
|
}
|
|
@@ -3461,10 +3462,10 @@
|
|
|
3461
3462
|
};
|
|
3462
3463
|
BasicFormComponent.prototype.formInit = function (params) {
|
|
3463
3464
|
return __awaiter(this, void 0, void 0, function () {
|
|
3464
|
-
var initialState, formDefinition,
|
|
3465
|
-
var e_2,
|
|
3466
|
-
return __generator(this, function (
|
|
3467
|
-
switch (
|
|
3465
|
+
var initialState, formDefinition, _g, _h, inputFieldData, fieldCode, fieldValue, recordResponse;
|
|
3466
|
+
var e_2, _j;
|
|
3467
|
+
return __generator(this, function (_k) {
|
|
3468
|
+
switch (_k.label) {
|
|
3468
3469
|
case 0:
|
|
3469
3470
|
initialState = this.preocessInputParams(params);
|
|
3470
3471
|
if (!this.name) {
|
|
@@ -3474,22 +3475,22 @@
|
|
|
3474
3475
|
this.inServerProcess = true;
|
|
3475
3476
|
return [4 /*yield*/, this.formManagerService.getFormDefinition(this.name)];
|
|
3476
3477
|
case 1:
|
|
3477
|
-
formDefinition =
|
|
3478
|
+
formDefinition = _k.sent();
|
|
3478
3479
|
this.inServerProcess = false;
|
|
3479
3480
|
this.formStructure = new FormStructureAndData(formDefinition);
|
|
3480
3481
|
this.definitionObtained = true;
|
|
3481
3482
|
return [3 /*break*/, 3];
|
|
3482
3483
|
case 2:
|
|
3483
3484
|
this.cleanData();
|
|
3484
|
-
|
|
3485
|
+
_k.label = 3;
|
|
3485
3486
|
case 3:
|
|
3486
3487
|
if (!this.supportState(initialState)) {
|
|
3487
3488
|
initialState = this.formStructure.defaultState;
|
|
3488
3489
|
}
|
|
3489
3490
|
this.formStructure.changeState(initialState || this.formStructure.defaultState);
|
|
3490
3491
|
try {
|
|
3491
|
-
for (
|
|
3492
|
-
inputFieldData =
|
|
3492
|
+
for (_g = __values(this.inputDataFields), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
3493
|
+
inputFieldData = _h.value;
|
|
3493
3494
|
fieldCode = inputFieldData.fieldCode, fieldValue = inputFieldData.fieldValue;
|
|
3494
3495
|
if (fieldCode) {
|
|
3495
3496
|
this.setFieldValue(inputFieldData.fieldCode, fieldValue);
|
|
@@ -3499,13 +3500,13 @@
|
|
|
3499
3500
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
3500
3501
|
finally {
|
|
3501
3502
|
try {
|
|
3502
|
-
if (
|
|
3503
|
+
if (_h && !_h.done && (_j = _g.return)) _j.call(_g);
|
|
3503
3504
|
}
|
|
3504
3505
|
finally { if (e_2) throw e_2.error; }
|
|
3505
3506
|
}
|
|
3506
3507
|
return [4 /*yield*/, this.requestFormAction(componentConstants.FORMACTION_GETDATA)];
|
|
3507
3508
|
case 4:
|
|
3508
|
-
recordResponse =
|
|
3509
|
+
recordResponse = _k.sent();
|
|
3509
3510
|
this.checkErrorRecordReceived(recordResponse);
|
|
3510
3511
|
this.formVisible = true;
|
|
3511
3512
|
this.subscribeSectionActivation();
|
|
@@ -3536,8 +3537,8 @@
|
|
|
3536
3537
|
if (actionSubject === void 0) { actionSubject = {}; }
|
|
3537
3538
|
return __awaiter(this, void 0, void 0, function () {
|
|
3538
3539
|
var actionDetail, formActionResponse, error, formResponseData;
|
|
3539
|
-
return __generator(this, function (
|
|
3540
|
-
switch (
|
|
3540
|
+
return __generator(this, function (_g) {
|
|
3541
|
+
switch (_g.label) {
|
|
3541
3542
|
case 0:
|
|
3542
3543
|
actionDetail = {
|
|
3543
3544
|
formCode: this.name,
|
|
@@ -3555,7 +3556,7 @@
|
|
|
3555
3556
|
this.inServerProcess = true;
|
|
3556
3557
|
return [4 /*yield*/, this.formManagerService.execServerAction(actionDetail)];
|
|
3557
3558
|
case 1:
|
|
3558
|
-
formActionResponse =
|
|
3559
|
+
formActionResponse = _g.sent();
|
|
3559
3560
|
this.inServerProcess = false;
|
|
3560
3561
|
if (formActionResponse && formActionResponse.error.errorType) {
|
|
3561
3562
|
console.log('Excepción no soportada');
|
|
@@ -3574,7 +3575,7 @@
|
|
|
3574
3575
|
});
|
|
3575
3576
|
};
|
|
3576
3577
|
BasicFormComponent.prototype.updateFormWithServerData = function (formContent) {
|
|
3577
|
-
var e_3,
|
|
3578
|
+
var e_3, _g, e_4, _h, e_5, _j;
|
|
3578
3579
|
var currentMode = formContent.currentMode, formSubject = formContent.formSubject, actions = formContent.actions, fields = formContent.fields, recordTables = formContent.recordTables, returnedFile = formContent.returnedFile, immutableData = formContent.immutableData, extraInfo = formContent.extraInfo;
|
|
3579
3580
|
this.changeState(currentMode !== null && currentMode !== void 0 ? currentMode : this.formStructure.state);
|
|
3580
3581
|
if (formSubject) {
|
|
@@ -3593,7 +3594,7 @@
|
|
|
3593
3594
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
3594
3595
|
finally {
|
|
3595
3596
|
try {
|
|
3596
|
-
if (actions_1_1 && !actions_1_1.done && (
|
|
3597
|
+
if (actions_1_1 && !actions_1_1.done && (_g = actions_1.return)) _g.call(actions_1);
|
|
3597
3598
|
}
|
|
3598
3599
|
finally { if (e_3) throw e_3.error; }
|
|
3599
3600
|
}
|
|
@@ -3611,7 +3612,7 @@
|
|
|
3611
3612
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
3612
3613
|
finally {
|
|
3613
3614
|
try {
|
|
3614
|
-
if (fields_1_1 && !fields_1_1.done && (
|
|
3615
|
+
if (fields_1_1 && !fields_1_1.done && (_h = fields_1.return)) _h.call(fields_1);
|
|
3615
3616
|
}
|
|
3616
3617
|
finally { if (e_4) throw e_4.error; }
|
|
3617
3618
|
}
|
|
@@ -3629,7 +3630,7 @@
|
|
|
3629
3630
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
3630
3631
|
finally {
|
|
3631
3632
|
try {
|
|
3632
|
-
if (recordTables_1_1 && !recordTables_1_1.done && (
|
|
3633
|
+
if (recordTables_1_1 && !recordTables_1_1.done && (_j = recordTables_1.return)) _j.call(recordTables_1);
|
|
3633
3634
|
}
|
|
3634
3635
|
finally { if (e_5) throw e_5.error; }
|
|
3635
3636
|
}
|
|
@@ -3686,8 +3687,8 @@
|
|
|
3686
3687
|
BasicFormComponent.prototype.launchSectionActivation = function (sectionCode) {
|
|
3687
3688
|
return __awaiter(this, void 0, void 0, function () {
|
|
3688
3689
|
var sectionObject, clientSectionMethods, clientSectionMethods_1, clientSectionMethods_1_1, clientSectionMethod;
|
|
3689
|
-
var e_6,
|
|
3690
|
-
return __generator(this, function (
|
|
3690
|
+
var e_6, _g;
|
|
3691
|
+
return __generator(this, function (_h) {
|
|
3691
3692
|
sectionObject = this.formStructure.getSectionObject(sectionCode);
|
|
3692
3693
|
if (!sectionObject) {
|
|
3693
3694
|
return [2 /*return*/];
|
|
@@ -3703,7 +3704,7 @@
|
|
|
3703
3704
|
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
3704
3705
|
finally {
|
|
3705
3706
|
try {
|
|
3706
|
-
if (clientSectionMethods_1_1 && !clientSectionMethods_1_1.done && (
|
|
3707
|
+
if (clientSectionMethods_1_1 && !clientSectionMethods_1_1.done && (_g = clientSectionMethods_1.return)) _g.call(clientSectionMethods_1);
|
|
3707
3708
|
}
|
|
3708
3709
|
finally { if (e_6) throw e_6.error; }
|
|
3709
3710
|
}
|
|
@@ -3715,8 +3716,8 @@
|
|
|
3715
3716
|
BasicFormComponent.prototype.launchSectionInactivation = function (sectionCode) {
|
|
3716
3717
|
return __awaiter(this, void 0, void 0, function () {
|
|
3717
3718
|
var sectionObject, clientSectionMethods, clientSectionMethods_2, clientSectionMethods_2_1, clientSectionMethod;
|
|
3718
|
-
var e_7,
|
|
3719
|
-
return __generator(this, function (
|
|
3719
|
+
var e_7, _g;
|
|
3720
|
+
return __generator(this, function (_h) {
|
|
3720
3721
|
sectionObject = this.formStructure.getSectionObject(sectionCode);
|
|
3721
3722
|
if (!sectionObject) {
|
|
3722
3723
|
return [2 /*return*/];
|
|
@@ -3732,7 +3733,7 @@
|
|
|
3732
3733
|
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
3733
3734
|
finally {
|
|
3734
3735
|
try {
|
|
3735
|
-
if (clientSectionMethods_2_1 && !clientSectionMethods_2_1.done && (
|
|
3736
|
+
if (clientSectionMethods_2_1 && !clientSectionMethods_2_1.done && (_g = clientSectionMethods_2.return)) _g.call(clientSectionMethods_2);
|
|
3736
3737
|
}
|
|
3737
3738
|
finally { if (e_7) throw e_7.error; }
|
|
3738
3739
|
}
|
|
@@ -3744,9 +3745,9 @@
|
|
|
3744
3745
|
BasicFormComponent.prototype.startAction = function (actionCode) {
|
|
3745
3746
|
return __awaiter(this, void 0, void 0, function () {
|
|
3746
3747
|
var actionObject, clientActionMethods, clientActionPromises, clientActionMethods_1, clientActionMethods_1_1, clientActionMethod, continueActionPromise, clientActionResults, continueAction;
|
|
3747
|
-
var e_8,
|
|
3748
|
-
return __generator(this, function (
|
|
3749
|
-
switch (
|
|
3748
|
+
var e_8, _g;
|
|
3749
|
+
return __generator(this, function (_h) {
|
|
3750
|
+
switch (_h.label) {
|
|
3750
3751
|
case 0:
|
|
3751
3752
|
actionObject = this.getAction(actionCode);
|
|
3752
3753
|
if (!actionObject) {
|
|
@@ -3767,19 +3768,19 @@
|
|
|
3767
3768
|
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
3768
3769
|
finally {
|
|
3769
3770
|
try {
|
|
3770
|
-
if (clientActionMethods_1_1 && !clientActionMethods_1_1.done && (
|
|
3771
|
+
if (clientActionMethods_1_1 && !clientActionMethods_1_1.done && (_g = clientActionMethods_1.return)) _g.call(clientActionMethods_1);
|
|
3771
3772
|
}
|
|
3772
3773
|
finally { if (e_8) throw e_8.error; }
|
|
3773
3774
|
}
|
|
3774
3775
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
3775
3776
|
case 1:
|
|
3776
|
-
clientActionResults =
|
|
3777
|
+
clientActionResults = _h.sent();
|
|
3777
3778
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
3778
3779
|
if (!continueAction) {
|
|
3779
3780
|
actionObject.stop();
|
|
3780
3781
|
return [2 /*return*/];
|
|
3781
3782
|
}
|
|
3782
|
-
|
|
3783
|
+
_h.label = 2;
|
|
3783
3784
|
case 2:
|
|
3784
3785
|
this.startServerAction(actionObject);
|
|
3785
3786
|
return [2 /*return*/];
|
|
@@ -3790,8 +3791,8 @@
|
|
|
3790
3791
|
BasicFormComponent.prototype.startServerAction = function (actionInput) {
|
|
3791
3792
|
return __awaiter(this, void 0, void 0, function () {
|
|
3792
3793
|
var action, finish, actionResult;
|
|
3793
|
-
return __generator(this, function (
|
|
3794
|
-
switch (
|
|
3794
|
+
return __generator(this, function (_g) {
|
|
3795
|
+
switch (_g.label) {
|
|
3795
3796
|
case 0:
|
|
3796
3797
|
action = (typeof actionInput === 'string')
|
|
3797
3798
|
? this.getAction(actionInput) : actionInput;
|
|
@@ -3800,19 +3801,19 @@
|
|
|
3800
3801
|
if (!action.backend) return [3 /*break*/, 2];
|
|
3801
3802
|
return [4 /*yield*/, this.requestFormAction(action.actionCode)];
|
|
3802
3803
|
case 1:
|
|
3803
|
-
actionResult =
|
|
3804
|
+
actionResult = _g.sent();
|
|
3804
3805
|
finish = !this.errorOccured();
|
|
3805
|
-
|
|
3806
|
+
_g.label = 2;
|
|
3806
3807
|
case 2:
|
|
3807
3808
|
if (!finish) return [3 /*break*/, 4];
|
|
3808
3809
|
return [4 /*yield*/, this.finishAction(action, actionResult)];
|
|
3809
3810
|
case 3:
|
|
3810
|
-
|
|
3811
|
+
_g.sent();
|
|
3811
3812
|
this.changeState(action.newState);
|
|
3812
3813
|
return [3 /*break*/, 5];
|
|
3813
3814
|
case 4:
|
|
3814
3815
|
this.displayActionServerError();
|
|
3815
|
-
|
|
3816
|
+
_g.label = 5;
|
|
3816
3817
|
case 5:
|
|
3817
3818
|
action.stop();
|
|
3818
3819
|
return [2 /*return*/];
|
|
@@ -3823,9 +3824,9 @@
|
|
|
3823
3824
|
BasicFormComponent.prototype.finishAction = function (actionObject, actionResult) {
|
|
3824
3825
|
return __awaiter(this, void 0, void 0, function () {
|
|
3825
3826
|
var finishActionMethods, clientActionPromises, finishActionMethods_1, finishActionMethods_1_1, clientActionMethod;
|
|
3826
|
-
var e_9,
|
|
3827
|
-
return __generator(this, function (
|
|
3828
|
-
switch (
|
|
3827
|
+
var e_9, _g;
|
|
3828
|
+
return __generator(this, function (_h) {
|
|
3829
|
+
switch (_h.label) {
|
|
3829
3830
|
case 0:
|
|
3830
3831
|
finishActionMethods = this.formActionsFinish[actionObject.actionCode];
|
|
3831
3832
|
if (!finishActionMethods) return [3 /*break*/, 2];
|
|
@@ -3839,14 +3840,14 @@
|
|
|
3839
3840
|
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
3840
3841
|
finally {
|
|
3841
3842
|
try {
|
|
3842
|
-
if (finishActionMethods_1_1 && !finishActionMethods_1_1.done && (
|
|
3843
|
+
if (finishActionMethods_1_1 && !finishActionMethods_1_1.done && (_g = finishActionMethods_1.return)) _g.call(finishActionMethods_1);
|
|
3843
3844
|
}
|
|
3844
3845
|
finally { if (e_9) throw e_9.error; }
|
|
3845
3846
|
}
|
|
3846
3847
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
3847
3848
|
case 1:
|
|
3848
|
-
|
|
3849
|
-
|
|
3849
|
+
_h.sent();
|
|
3850
|
+
_h.label = 2;
|
|
3850
3851
|
case 2: return [2 /*return*/];
|
|
3851
3852
|
}
|
|
3852
3853
|
});
|
|
@@ -3891,9 +3892,9 @@
|
|
|
3891
3892
|
BasicFormComponent.prototype.startFieldInputValidation = function (fieldCode) {
|
|
3892
3893
|
return __awaiter(this, void 0, void 0, function () {
|
|
3893
3894
|
var fieldToValidate, validationCallbacks, clientValidationPromises, validationCallbacks_1, validationCallbacks_1_1, validationMethod, continueValidationPromise;
|
|
3894
|
-
var e_10,
|
|
3895
|
-
return __generator(this, function (
|
|
3896
|
-
switch (
|
|
3895
|
+
var e_10, _g;
|
|
3896
|
+
return __generator(this, function (_h) {
|
|
3897
|
+
switch (_h.label) {
|
|
3897
3898
|
case 0:
|
|
3898
3899
|
fieldToValidate = this.getFieldObject(fieldCode);
|
|
3899
3900
|
if (!fieldToValidate) {
|
|
@@ -3914,14 +3915,14 @@
|
|
|
3914
3915
|
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
3915
3916
|
finally {
|
|
3916
3917
|
try {
|
|
3917
|
-
if (validationCallbacks_1_1 && !validationCallbacks_1_1.done && (
|
|
3918
|
+
if (validationCallbacks_1_1 && !validationCallbacks_1_1.done && (_g = validationCallbacks_1.return)) _g.call(validationCallbacks_1);
|
|
3918
3919
|
}
|
|
3919
3920
|
finally { if (e_10) throw e_10.error; }
|
|
3920
3921
|
}
|
|
3921
3922
|
return [4 /*yield*/, Promise.all(clientValidationPromises)];
|
|
3922
3923
|
case 1:
|
|
3923
|
-
|
|
3924
|
-
|
|
3924
|
+
_h.sent();
|
|
3925
|
+
_h.label = 2;
|
|
3925
3926
|
case 2: return [2 /*return*/];
|
|
3926
3927
|
}
|
|
3927
3928
|
});
|
|
@@ -3930,9 +3931,9 @@
|
|
|
3930
3931
|
BasicFormComponent.prototype.startFieldValidation = function (fieldCode) {
|
|
3931
3932
|
return __awaiter(this, void 0, void 0, function () {
|
|
3932
3933
|
var fieldToValidate, validationCallbacks, clientValidationPromises, validationCallbacks_2, validationCallbacks_2_1, validationMethod, clientValidationPromise, clientValidationResults, continueValidation;
|
|
3933
|
-
var e_11,
|
|
3934
|
-
return __generator(this, function (
|
|
3935
|
-
switch (
|
|
3934
|
+
var e_11, _g;
|
|
3935
|
+
return __generator(this, function (_h) {
|
|
3936
|
+
switch (_h.label) {
|
|
3936
3937
|
case 0:
|
|
3937
3938
|
fieldToValidate = this.getField(fieldCode);
|
|
3938
3939
|
if (!fieldToValidate) {
|
|
@@ -3953,18 +3954,18 @@
|
|
|
3953
3954
|
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
3954
3955
|
finally {
|
|
3955
3956
|
try {
|
|
3956
|
-
if (validationCallbacks_2_1 && !validationCallbacks_2_1.done && (
|
|
3957
|
+
if (validationCallbacks_2_1 && !validationCallbacks_2_1.done && (_g = validationCallbacks_2.return)) _g.call(validationCallbacks_2);
|
|
3957
3958
|
}
|
|
3958
3959
|
finally { if (e_11) throw e_11.error; }
|
|
3959
3960
|
}
|
|
3960
3961
|
return [4 /*yield*/, Promise.all(clientValidationPromises)];
|
|
3961
3962
|
case 1:
|
|
3962
|
-
clientValidationResults =
|
|
3963
|
+
clientValidationResults = _h.sent();
|
|
3963
3964
|
continueValidation = clientValidationResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
3964
3965
|
if (!continueValidation) {
|
|
3965
3966
|
return [2 /*return*/];
|
|
3966
3967
|
}
|
|
3967
|
-
|
|
3968
|
+
_h.label = 2;
|
|
3968
3969
|
case 2:
|
|
3969
3970
|
this.startServerFieldValidation(fieldToValidate);
|
|
3970
3971
|
return [2 /*return*/];
|
|
@@ -3975,8 +3976,8 @@
|
|
|
3975
3976
|
BasicFormComponent.prototype.startServerFieldValidation = function (inputField) {
|
|
3976
3977
|
return __awaiter(this, void 0, void 0, function () {
|
|
3977
3978
|
var fieldObj, finish, validationResult;
|
|
3978
|
-
return __generator(this, function (
|
|
3979
|
-
switch (
|
|
3979
|
+
return __generator(this, function (_g) {
|
|
3980
|
+
switch (_g.label) {
|
|
3980
3981
|
case 0:
|
|
3981
3982
|
fieldObj = (typeof inputField === 'string')
|
|
3982
3983
|
? this.getField(inputField) : inputField;
|
|
@@ -3986,20 +3987,20 @@
|
|
|
3986
3987
|
return [4 /*yield*/, this
|
|
3987
3988
|
.requestFormAction(componentConstants.FORMACTION_VALIDATE, fieldObj.fieldCode)];
|
|
3988
3989
|
case 1:
|
|
3989
|
-
validationResult =
|
|
3990
|
+
validationResult = _g.sent();
|
|
3990
3991
|
finish = !this.errorOccured();
|
|
3991
|
-
|
|
3992
|
+
_g.label = 2;
|
|
3992
3993
|
case 2:
|
|
3993
3994
|
if (!finish) return [3 /*break*/, 4];
|
|
3994
3995
|
return [4 /*yield*/, this.finishFieldValidation(fieldObj, validationResult)];
|
|
3995
3996
|
case 3:
|
|
3996
|
-
|
|
3997
|
+
_g.sent();
|
|
3997
3998
|
return [3 /*break*/, 5];
|
|
3998
3999
|
case 4:
|
|
3999
4000
|
fieldObj.setErrorCode(this.errorCode);
|
|
4000
4001
|
fieldObj.setErrorMessage(this.errorMessage);
|
|
4001
4002
|
this.displayValidationServerError();
|
|
4002
|
-
|
|
4003
|
+
_g.label = 5;
|
|
4003
4004
|
case 5: return [2 /*return*/];
|
|
4004
4005
|
}
|
|
4005
4006
|
});
|
|
@@ -4008,9 +4009,9 @@
|
|
|
4008
4009
|
BasicFormComponent.prototype.finishFieldValidation = function (fieldObject, validationResult) {
|
|
4009
4010
|
return __awaiter(this, void 0, void 0, function () {
|
|
4010
4011
|
var validationCallbacks, clientActionPromises, validationCallbacks_3, validationCallbacks_3_1, validationMethod;
|
|
4011
|
-
var e_12,
|
|
4012
|
-
return __generator(this, function (
|
|
4013
|
-
switch (
|
|
4012
|
+
var e_12, _g;
|
|
4013
|
+
return __generator(this, function (_h) {
|
|
4014
|
+
switch (_h.label) {
|
|
4014
4015
|
case 0:
|
|
4015
4016
|
validationCallbacks = this.fieldValidationsFinish[fieldObject.fieldCode];
|
|
4016
4017
|
if (!validationCallbacks) return [3 /*break*/, 2];
|
|
@@ -4024,14 +4025,14 @@
|
|
|
4024
4025
|
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
4025
4026
|
finally {
|
|
4026
4027
|
try {
|
|
4027
|
-
if (validationCallbacks_3_1 && !validationCallbacks_3_1.done && (
|
|
4028
|
+
if (validationCallbacks_3_1 && !validationCallbacks_3_1.done && (_g = validationCallbacks_3.return)) _g.call(validationCallbacks_3);
|
|
4028
4029
|
}
|
|
4029
4030
|
finally { if (e_12) throw e_12.error; }
|
|
4030
4031
|
}
|
|
4031
4032
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4032
4033
|
case 1:
|
|
4033
|
-
|
|
4034
|
-
|
|
4034
|
+
_h.sent();
|
|
4035
|
+
_h.label = 2;
|
|
4035
4036
|
case 2: return [2 /*return*/];
|
|
4036
4037
|
}
|
|
4037
4038
|
});
|
|
@@ -4039,7 +4040,7 @@
|
|
|
4039
4040
|
};
|
|
4040
4041
|
BasicFormComponent.prototype.continueFieldValidation = function (fieldCode) {
|
|
4041
4042
|
return __awaiter(this, void 0, void 0, function () {
|
|
4042
|
-
return __generator(this, function (
|
|
4043
|
+
return __generator(this, function (_g) {
|
|
4043
4044
|
return [2 /*return*/, this.startServerFieldValidation(fieldCode)];
|
|
4044
4045
|
});
|
|
4045
4046
|
});
|
|
@@ -4154,9 +4155,9 @@
|
|
|
4154
4155
|
BasicFormComponent.prototype.startTableGlobalAction = function (tableActionEvent) {
|
|
4155
4156
|
return __awaiter(this, void 0, void 0, function () {
|
|
4156
4157
|
var tableCode, actionCode, tableObject, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_1, tableActionMethods_1_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4157
|
-
var e_13,
|
|
4158
|
-
return __generator(this, function (
|
|
4159
|
-
switch (
|
|
4158
|
+
var e_13, _g;
|
|
4159
|
+
return __generator(this, function (_h) {
|
|
4160
|
+
switch (_h.label) {
|
|
4160
4161
|
case 0:
|
|
4161
4162
|
tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode;
|
|
4162
4163
|
tableObject = this.getTable(tableCode);
|
|
@@ -4188,18 +4189,18 @@
|
|
|
4188
4189
|
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
4189
4190
|
finally {
|
|
4190
4191
|
try {
|
|
4191
|
-
if (tableActionMethods_1_1 && !tableActionMethods_1_1.done && (
|
|
4192
|
+
if (tableActionMethods_1_1 && !tableActionMethods_1_1.done && (_g = tableActionMethods_1.return)) _g.call(tableActionMethods_1);
|
|
4192
4193
|
}
|
|
4193
4194
|
finally { if (e_13) throw e_13.error; }
|
|
4194
4195
|
}
|
|
4195
4196
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4196
4197
|
case 1:
|
|
4197
|
-
clientActionResults =
|
|
4198
|
+
clientActionResults = _h.sent();
|
|
4198
4199
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4199
4200
|
if (!continueAction) {
|
|
4200
4201
|
return [2 /*return*/];
|
|
4201
4202
|
}
|
|
4202
|
-
|
|
4203
|
+
_h.label = 2;
|
|
4203
4204
|
case 2:
|
|
4204
4205
|
this.startTableServerGlobalAction(tableActionDetail);
|
|
4205
4206
|
return [2 /*return*/];
|
|
@@ -4210,8 +4211,8 @@
|
|
|
4210
4211
|
BasicFormComponent.prototype.startTableServerGlobalAction = function (tableActionDetail) {
|
|
4211
4212
|
return __awaiter(this, void 0, void 0, function () {
|
|
4212
4213
|
var tableObject, action, tableCode, actionCode, finish, actionResult, actionSubject;
|
|
4213
|
-
return __generator(this, function (
|
|
4214
|
-
switch (
|
|
4214
|
+
return __generator(this, function (_g) {
|
|
4215
|
+
switch (_g.label) {
|
|
4215
4216
|
case 0:
|
|
4216
4217
|
tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
|
|
4217
4218
|
if (!tableObject || !action) {
|
|
@@ -4229,19 +4230,19 @@
|
|
|
4229
4230
|
return [4 /*yield*/, this
|
|
4230
4231
|
.requestFormAction(componentConstants.FORMACTION_TABLEACTION, actionSubject)];
|
|
4231
4232
|
case 1:
|
|
4232
|
-
actionResult =
|
|
4233
|
+
actionResult = _g.sent();
|
|
4233
4234
|
finish = !this.errorOccured();
|
|
4234
|
-
|
|
4235
|
+
_g.label = 2;
|
|
4235
4236
|
case 2:
|
|
4236
4237
|
if (!finish) return [3 /*break*/, 4];
|
|
4237
4238
|
return [4 /*yield*/, this.finishTableGlobalAction(tableActionDetail, actionResult)];
|
|
4238
4239
|
case 3:
|
|
4239
|
-
|
|
4240
|
+
_g.sent();
|
|
4240
4241
|
this.changeState(action.newState);
|
|
4241
4242
|
return [3 /*break*/, 5];
|
|
4242
4243
|
case 4:
|
|
4243
4244
|
this.displayTableServerError();
|
|
4244
|
-
|
|
4245
|
+
_g.label = 5;
|
|
4245
4246
|
case 5:
|
|
4246
4247
|
tableObject.freeWaiting();
|
|
4247
4248
|
return [2 /*return*/];
|
|
@@ -4252,9 +4253,9 @@
|
|
|
4252
4253
|
BasicFormComponent.prototype.finishTableGlobalAction = function (tableActionDetail, actionResult) {
|
|
4253
4254
|
return __awaiter(this, void 0, void 0, function () {
|
|
4254
4255
|
var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_2, tableActionMethods_2_1, tableActionMethod;
|
|
4255
|
-
var e_14,
|
|
4256
|
-
return __generator(this, function (
|
|
4257
|
-
switch (
|
|
4256
|
+
var e_14, _g;
|
|
4257
|
+
return __generator(this, function (_h) {
|
|
4258
|
+
switch (_h.label) {
|
|
4258
4259
|
case 0:
|
|
4259
4260
|
tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
|
|
4260
4261
|
tableEventHandlers = this.tableActionsFinish[tableCode];
|
|
@@ -4270,14 +4271,14 @@
|
|
|
4270
4271
|
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
4271
4272
|
finally {
|
|
4272
4273
|
try {
|
|
4273
|
-
if (tableActionMethods_2_1 && !tableActionMethods_2_1.done && (
|
|
4274
|
+
if (tableActionMethods_2_1 && !tableActionMethods_2_1.done && (_g = tableActionMethods_2.return)) _g.call(tableActionMethods_2);
|
|
4274
4275
|
}
|
|
4275
4276
|
finally { if (e_14) throw e_14.error; }
|
|
4276
4277
|
}
|
|
4277
4278
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4278
4279
|
case 1:
|
|
4279
|
-
|
|
4280
|
-
|
|
4280
|
+
_h.sent();
|
|
4281
|
+
_h.label = 2;
|
|
4281
4282
|
case 2: return [2 /*return*/];
|
|
4282
4283
|
}
|
|
4283
4284
|
});
|
|
@@ -4286,9 +4287,9 @@
|
|
|
4286
4287
|
BasicFormComponent.prototype.startTableAction = function (tableActionEvent) {
|
|
4287
4288
|
return __awaiter(this, void 0, void 0, function () {
|
|
4288
4289
|
var tableCode, actionCode, actionDetail, tableObject, recordId, recordData, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_3, tableActionMethods_3_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4289
|
-
var e_15,
|
|
4290
|
-
return __generator(this, function (
|
|
4291
|
-
switch (
|
|
4290
|
+
var e_15, _g;
|
|
4291
|
+
return __generator(this, function (_h) {
|
|
4292
|
+
switch (_h.label) {
|
|
4292
4293
|
case 0:
|
|
4293
4294
|
tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode, actionDetail = tableActionEvent.actionDetail;
|
|
4294
4295
|
tableObject = this.getTable(tableCode);
|
|
@@ -4323,18 +4324,18 @@
|
|
|
4323
4324
|
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
4324
4325
|
finally {
|
|
4325
4326
|
try {
|
|
4326
|
-
if (tableActionMethods_3_1 && !tableActionMethods_3_1.done && (
|
|
4327
|
+
if (tableActionMethods_3_1 && !tableActionMethods_3_1.done && (_g = tableActionMethods_3.return)) _g.call(tableActionMethods_3);
|
|
4327
4328
|
}
|
|
4328
4329
|
finally { if (e_15) throw e_15.error; }
|
|
4329
4330
|
}
|
|
4330
4331
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4331
4332
|
case 1:
|
|
4332
|
-
clientActionResults =
|
|
4333
|
+
clientActionResults = _h.sent();
|
|
4333
4334
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4334
4335
|
if (!continueAction) {
|
|
4335
4336
|
return [2 /*return*/];
|
|
4336
4337
|
}
|
|
4337
|
-
|
|
4338
|
+
_h.label = 2;
|
|
4338
4339
|
case 2:
|
|
4339
4340
|
this.startTableServerAction(tableActionDetail);
|
|
4340
4341
|
return [2 /*return*/];
|
|
@@ -4345,8 +4346,8 @@
|
|
|
4345
4346
|
BasicFormComponent.prototype.startTableServerAction = function (tableActionDetail) {
|
|
4346
4347
|
return __awaiter(this, void 0, void 0, function () {
|
|
4347
4348
|
var tableObject, action, tableCode, actionCode, recordId, recordData, finish, actionResult, actionSubject;
|
|
4348
|
-
return __generator(this, function (
|
|
4349
|
-
switch (
|
|
4349
|
+
return __generator(this, function (_g) {
|
|
4350
|
+
switch (_g.label) {
|
|
4350
4351
|
case 0:
|
|
4351
4352
|
tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode, recordId = tableActionDetail.recordId, recordData = tableActionDetail.recordData;
|
|
4352
4353
|
if (!tableObject || !action) {
|
|
@@ -4366,9 +4367,9 @@
|
|
|
4366
4367
|
return [4 /*yield*/, this
|
|
4367
4368
|
.requestFormAction(componentConstants.FORMACTION_TABLEACTION, actionSubject)];
|
|
4368
4369
|
case 1:
|
|
4369
|
-
actionResult =
|
|
4370
|
+
actionResult = _g.sent();
|
|
4370
4371
|
finish = !this.errorOccured();
|
|
4371
|
-
|
|
4372
|
+
_g.label = 2;
|
|
4372
4373
|
case 2:
|
|
4373
4374
|
if (finish) {
|
|
4374
4375
|
this.finishTableAction(tableActionDetail, actionResult);
|
|
@@ -4389,9 +4390,9 @@
|
|
|
4389
4390
|
BasicFormComponent.prototype.finishTableAction = function (tableActionDetail, actionResult) {
|
|
4390
4391
|
return __awaiter(this, void 0, void 0, function () {
|
|
4391
4392
|
var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_4, tableActionMethods_4_1, tableActionMethod;
|
|
4392
|
-
var e_16,
|
|
4393
|
-
return __generator(this, function (
|
|
4394
|
-
switch (
|
|
4393
|
+
var e_16, _g;
|
|
4394
|
+
return __generator(this, function (_h) {
|
|
4395
|
+
switch (_h.label) {
|
|
4395
4396
|
case 0:
|
|
4396
4397
|
tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
|
|
4397
4398
|
tableEventHandlers = this.tableActionsFinish[tableCode];
|
|
@@ -4407,14 +4408,14 @@
|
|
|
4407
4408
|
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
4408
4409
|
finally {
|
|
4409
4410
|
try {
|
|
4410
|
-
if (tableActionMethods_4_1 && !tableActionMethods_4_1.done && (
|
|
4411
|
+
if (tableActionMethods_4_1 && !tableActionMethods_4_1.done && (_g = tableActionMethods_4.return)) _g.call(tableActionMethods_4);
|
|
4411
4412
|
}
|
|
4412
4413
|
finally { if (e_16) throw e_16.error; }
|
|
4413
4414
|
}
|
|
4414
4415
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4415
4416
|
case 1:
|
|
4416
|
-
|
|
4417
|
-
|
|
4417
|
+
_h.sent();
|
|
4418
|
+
_h.label = 2;
|
|
4418
4419
|
case 2: return [2 /*return*/];
|
|
4419
4420
|
}
|
|
4420
4421
|
});
|
|
@@ -4423,9 +4424,9 @@
|
|
|
4423
4424
|
BasicFormComponent.prototype.startTableRecordSelection = function (tableActionEvent) {
|
|
4424
4425
|
return __awaiter(this, void 0, void 0, function () {
|
|
4425
4426
|
var tableCode, actionDetail, tableObject, recordId, recordData, tableSelectionDetail, tableEventHandlers, clientActionPromises, tableEventHandlers_1, tableEventHandlers_1_1, tableSelectionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4426
|
-
var e_17,
|
|
4427
|
-
return __generator(this, function (
|
|
4428
|
-
switch (
|
|
4427
|
+
var e_17, _g;
|
|
4428
|
+
return __generator(this, function (_h) {
|
|
4429
|
+
switch (_h.label) {
|
|
4429
4430
|
case 0:
|
|
4430
4431
|
tableCode = tableActionEvent.tableCode, actionDetail = tableActionEvent.actionDetail;
|
|
4431
4432
|
tableObject = this.getTable(tableCode);
|
|
@@ -4453,18 +4454,18 @@
|
|
|
4453
4454
|
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
4454
4455
|
finally {
|
|
4455
4456
|
try {
|
|
4456
|
-
if (tableEventHandlers_1_1 && !tableEventHandlers_1_1.done && (
|
|
4457
|
+
if (tableEventHandlers_1_1 && !tableEventHandlers_1_1.done && (_g = tableEventHandlers_1.return)) _g.call(tableEventHandlers_1);
|
|
4457
4458
|
}
|
|
4458
4459
|
finally { if (e_17) throw e_17.error; }
|
|
4459
4460
|
}
|
|
4460
4461
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4461
4462
|
case 1:
|
|
4462
|
-
clientActionResults =
|
|
4463
|
+
clientActionResults = _h.sent();
|
|
4463
4464
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4464
4465
|
if (!continueAction) {
|
|
4465
4466
|
return [2 /*return*/];
|
|
4466
4467
|
}
|
|
4467
|
-
|
|
4468
|
+
_h.label = 2;
|
|
4468
4469
|
case 2:
|
|
4469
4470
|
this.startTableServerRecordSelection(tableSelectionDetail);
|
|
4470
4471
|
return [2 /*return*/];
|
|
@@ -4475,8 +4476,8 @@
|
|
|
4475
4476
|
BasicFormComponent.prototype.startTableServerRecordSelection = function (tableSelectionDetail) {
|
|
4476
4477
|
return __awaiter(this, void 0, void 0, function () {
|
|
4477
4478
|
var tableObject, tableCode, recordId, recordData, finish, actionResult, actionSubject;
|
|
4478
|
-
return __generator(this, function (
|
|
4479
|
-
switch (
|
|
4479
|
+
return __generator(this, function (_g) {
|
|
4480
|
+
switch (_g.label) {
|
|
4480
4481
|
case 0:
|
|
4481
4482
|
tableObject = tableSelectionDetail.tableObject, tableCode = tableSelectionDetail.tableCode, recordId = tableSelectionDetail.recordId, recordData = tableSelectionDetail.recordData;
|
|
4482
4483
|
if (!tableObject) {
|
|
@@ -4496,9 +4497,9 @@
|
|
|
4496
4497
|
return [4 /*yield*/, this
|
|
4497
4498
|
.requestFormAction(componentConstants.FORMACTION_TABLEACTION, actionSubject)];
|
|
4498
4499
|
case 1:
|
|
4499
|
-
actionResult =
|
|
4500
|
+
actionResult = _g.sent();
|
|
4500
4501
|
finish = !this.errorOccured();
|
|
4501
|
-
|
|
4502
|
+
_g.label = 2;
|
|
4502
4503
|
case 2:
|
|
4503
4504
|
if (finish) {
|
|
4504
4505
|
this.finishTableRecordSelection(tableSelectionDetail, actionResult);
|
|
@@ -4515,9 +4516,9 @@
|
|
|
4515
4516
|
BasicFormComponent.prototype.finishTableRecordSelection = function (tableSelectionDetail, actionResult) {
|
|
4516
4517
|
return __awaiter(this, void 0, void 0, function () {
|
|
4517
4518
|
var tableCode, tableEventHandlers, clientActionPromises, tableEventHandlers_2, tableEventHandlers_2_1, tableSelectionMethod;
|
|
4518
|
-
var e_18,
|
|
4519
|
-
return __generator(this, function (
|
|
4520
|
-
switch (
|
|
4519
|
+
var e_18, _g;
|
|
4520
|
+
return __generator(this, function (_h) {
|
|
4521
|
+
switch (_h.label) {
|
|
4521
4522
|
case 0:
|
|
4522
4523
|
tableCode = tableSelectionDetail.tableCode;
|
|
4523
4524
|
tableEventHandlers = this.tableSelectionsFinish[tableCode];
|
|
@@ -4532,14 +4533,14 @@
|
|
|
4532
4533
|
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
4533
4534
|
finally {
|
|
4534
4535
|
try {
|
|
4535
|
-
if (tableEventHandlers_2_1 && !tableEventHandlers_2_1.done && (
|
|
4536
|
+
if (tableEventHandlers_2_1 && !tableEventHandlers_2_1.done && (_g = tableEventHandlers_2.return)) _g.call(tableEventHandlers_2);
|
|
4536
4537
|
}
|
|
4537
4538
|
finally { if (e_18) throw e_18.error; }
|
|
4538
4539
|
}
|
|
4539
4540
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4540
4541
|
case 1:
|
|
4541
|
-
|
|
4542
|
-
|
|
4542
|
+
_h.sent();
|
|
4543
|
+
_h.label = 2;
|
|
4543
4544
|
case 2: return [2 /*return*/];
|
|
4544
4545
|
}
|
|
4545
4546
|
});
|
|
@@ -4548,9 +4549,9 @@
|
|
|
4548
4549
|
BasicFormComponent.prototype.startTableSelectionAction = function (tableActionEvent) {
|
|
4549
4550
|
return __awaiter(this, void 0, void 0, function () {
|
|
4550
4551
|
var tableCode, actionCode, actionDetail, tableObject, selectedRecords, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_5, tableActionMethods_5_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4551
|
-
var e_19,
|
|
4552
|
-
return __generator(this, function (
|
|
4553
|
-
switch (
|
|
4552
|
+
var e_19, _g;
|
|
4553
|
+
return __generator(this, function (_h) {
|
|
4554
|
+
switch (_h.label) {
|
|
4554
4555
|
case 0:
|
|
4555
4556
|
tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode, actionDetail = tableActionEvent.actionDetail;
|
|
4556
4557
|
tableObject = this.getTable(tableCode);
|
|
@@ -4584,18 +4585,18 @@
|
|
|
4584
4585
|
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
4585
4586
|
finally {
|
|
4586
4587
|
try {
|
|
4587
|
-
if (tableActionMethods_5_1 && !tableActionMethods_5_1.done && (
|
|
4588
|
+
if (tableActionMethods_5_1 && !tableActionMethods_5_1.done && (_g = tableActionMethods_5.return)) _g.call(tableActionMethods_5);
|
|
4588
4589
|
}
|
|
4589
4590
|
finally { if (e_19) throw e_19.error; }
|
|
4590
4591
|
}
|
|
4591
4592
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4592
4593
|
case 1:
|
|
4593
|
-
clientActionResults =
|
|
4594
|
+
clientActionResults = _h.sent();
|
|
4594
4595
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4595
4596
|
if (!continueAction) {
|
|
4596
4597
|
return [2 /*return*/];
|
|
4597
4598
|
}
|
|
4598
|
-
|
|
4599
|
+
_h.label = 2;
|
|
4599
4600
|
case 2:
|
|
4600
4601
|
this.startTableServerSelectionAction(tableActionDetail);
|
|
4601
4602
|
return [2 /*return*/];
|
|
@@ -4606,8 +4607,8 @@
|
|
|
4606
4607
|
BasicFormComponent.prototype.startTableServerSelectionAction = function (tableActionDetail) {
|
|
4607
4608
|
return __awaiter(this, void 0, void 0, function () {
|
|
4608
4609
|
var tableObject, action, tableCode, actionCode, selectedRecords, finish, actionResult, actionSubject;
|
|
4609
|
-
return __generator(this, function (
|
|
4610
|
-
switch (
|
|
4610
|
+
return __generator(this, function (_g) {
|
|
4611
|
+
switch (_g.label) {
|
|
4611
4612
|
case 0:
|
|
4612
4613
|
tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode, selectedRecords = tableActionDetail.selectedRecords;
|
|
4613
4614
|
if (!tableObject || !action) {
|
|
@@ -4626,9 +4627,9 @@
|
|
|
4626
4627
|
return [4 /*yield*/, this
|
|
4627
4628
|
.requestFormAction(componentConstants.FORMACTION_TABLEACTION, actionSubject)];
|
|
4628
4629
|
case 1:
|
|
4629
|
-
actionResult =
|
|
4630
|
+
actionResult = _g.sent();
|
|
4630
4631
|
finish = !this.errorOccured();
|
|
4631
|
-
|
|
4632
|
+
_g.label = 2;
|
|
4632
4633
|
case 2:
|
|
4633
4634
|
if (finish) {
|
|
4634
4635
|
this.finishTableSelectionAction(tableActionDetail, actionResult);
|
|
@@ -4646,9 +4647,9 @@
|
|
|
4646
4647
|
BasicFormComponent.prototype.finishTableSelectionAction = function (tableActionDetail, actionResult) {
|
|
4647
4648
|
return __awaiter(this, void 0, void 0, function () {
|
|
4648
4649
|
var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_6, tableActionMethods_6_1, tableActionMethod;
|
|
4649
|
-
var e_20,
|
|
4650
|
-
return __generator(this, function (
|
|
4651
|
-
switch (
|
|
4650
|
+
var e_20, _g;
|
|
4651
|
+
return __generator(this, function (_h) {
|
|
4652
|
+
switch (_h.label) {
|
|
4652
4653
|
case 0:
|
|
4653
4654
|
tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
|
|
4654
4655
|
tableEventHandlers = this.tableActionsFinish[tableCode];
|
|
@@ -4664,14 +4665,14 @@
|
|
|
4664
4665
|
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
4665
4666
|
finally {
|
|
4666
4667
|
try {
|
|
4667
|
-
if (tableActionMethods_6_1 && !tableActionMethods_6_1.done && (
|
|
4668
|
+
if (tableActionMethods_6_1 && !tableActionMethods_6_1.done && (_g = tableActionMethods_6.return)) _g.call(tableActionMethods_6);
|
|
4668
4669
|
}
|
|
4669
4670
|
finally { if (e_20) throw e_20.error; }
|
|
4670
4671
|
}
|
|
4671
4672
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4672
4673
|
case 1:
|
|
4673
|
-
|
|
4674
|
-
|
|
4674
|
+
_h.sent();
|
|
4675
|
+
_h.label = 2;
|
|
4675
4676
|
case 2: return [2 /*return*/];
|
|
4676
4677
|
}
|
|
4677
4678
|
});
|
|
@@ -4680,9 +4681,9 @@
|
|
|
4680
4681
|
BasicFormComponent.prototype.startTableGetData = function (tableActionEvent) {
|
|
4681
4682
|
return __awaiter(this, void 0, void 0, function () {
|
|
4682
4683
|
var tableCode, tableObject, tableActionDetail, tableEventHandlers, clientActionPromises, tableEventHandlers_3, tableEventHandlers_3_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4683
|
-
var e_21,
|
|
4684
|
-
return __generator(this, function (
|
|
4685
|
-
switch (
|
|
4684
|
+
var e_21, _g;
|
|
4685
|
+
return __generator(this, function (_h) {
|
|
4686
|
+
switch (_h.label) {
|
|
4686
4687
|
case 0:
|
|
4687
4688
|
tableCode = tableActionEvent.tableCode;
|
|
4688
4689
|
tableObject = this.getTable(tableCode);
|
|
@@ -4704,18 +4705,18 @@
|
|
|
4704
4705
|
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
4705
4706
|
finally {
|
|
4706
4707
|
try {
|
|
4707
|
-
if (tableEventHandlers_3_1 && !tableEventHandlers_3_1.done && (
|
|
4708
|
+
if (tableEventHandlers_3_1 && !tableEventHandlers_3_1.done && (_g = tableEventHandlers_3.return)) _g.call(tableEventHandlers_3);
|
|
4708
4709
|
}
|
|
4709
4710
|
finally { if (e_21) throw e_21.error; }
|
|
4710
4711
|
}
|
|
4711
4712
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4712
4713
|
case 1:
|
|
4713
|
-
clientActionResults =
|
|
4714
|
+
clientActionResults = _h.sent();
|
|
4714
4715
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4715
4716
|
if (!continueAction) {
|
|
4716
4717
|
return [2 /*return*/];
|
|
4717
4718
|
}
|
|
4718
|
-
|
|
4719
|
+
_h.label = 2;
|
|
4719
4720
|
case 2:
|
|
4720
4721
|
this.startTableServerGetData(tableActionDetail);
|
|
4721
4722
|
return [2 /*return*/];
|
|
@@ -4726,8 +4727,8 @@
|
|
|
4726
4727
|
BasicFormComponent.prototype.startTableServerGetData = function (tableActionDetail) {
|
|
4727
4728
|
return __awaiter(this, void 0, void 0, function () {
|
|
4728
4729
|
var tableObject, tableCode, actionSubject, actionResult;
|
|
4729
|
-
return __generator(this, function (
|
|
4730
|
-
switch (
|
|
4730
|
+
return __generator(this, function (_g) {
|
|
4731
|
+
switch (_g.label) {
|
|
4731
4732
|
case 0:
|
|
4732
4733
|
tableObject = tableActionDetail.tableObject, tableCode = tableActionDetail.tableCode;
|
|
4733
4734
|
tableObject.putOnWait();
|
|
@@ -4735,7 +4736,7 @@
|
|
|
4735
4736
|
return [4 /*yield*/, this
|
|
4736
4737
|
.requestFormAction(componentConstants.FORMACTION_GETTABLEDATA, actionSubject)];
|
|
4737
4738
|
case 1:
|
|
4738
|
-
actionResult =
|
|
4739
|
+
actionResult = _g.sent();
|
|
4739
4740
|
if (this.errorOccured()) {
|
|
4740
4741
|
this.displayTableServerError();
|
|
4741
4742
|
}
|
|
@@ -4751,9 +4752,9 @@
|
|
|
4751
4752
|
BasicFormComponent.prototype.finishTableGetData = function (tableActionDetail, actionResult) {
|
|
4752
4753
|
return __awaiter(this, void 0, void 0, function () {
|
|
4753
4754
|
var tableCode, tableActionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_7, tableActionMethods_7_1, tableActionMethod;
|
|
4754
|
-
var e_22,
|
|
4755
|
-
return __generator(this, function (
|
|
4756
|
-
switch (
|
|
4755
|
+
var e_22, _g;
|
|
4756
|
+
return __generator(this, function (_h) {
|
|
4757
|
+
switch (_h.label) {
|
|
4757
4758
|
case 0:
|
|
4758
4759
|
tableCode = tableActionDetail.tableCode, tableActionCode = tableActionDetail.tableActionCode;
|
|
4759
4760
|
tableEventHandlers = this.tableActionsFinish[tableCode];
|
|
@@ -4769,14 +4770,14 @@
|
|
|
4769
4770
|
catch (e_22_1) { e_22 = { error: e_22_1 }; }
|
|
4770
4771
|
finally {
|
|
4771
4772
|
try {
|
|
4772
|
-
if (tableActionMethods_7_1 && !tableActionMethods_7_1.done && (
|
|
4773
|
+
if (tableActionMethods_7_1 && !tableActionMethods_7_1.done && (_g = tableActionMethods_7.return)) _g.call(tableActionMethods_7);
|
|
4773
4774
|
}
|
|
4774
4775
|
finally { if (e_22) throw e_22.error; }
|
|
4775
4776
|
}
|
|
4776
4777
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4777
4778
|
case 1:
|
|
4778
|
-
|
|
4779
|
-
|
|
4779
|
+
_h.sent();
|
|
4780
|
+
_h.label = 2;
|
|
4780
4781
|
case 2: return [2 /*return*/];
|
|
4781
4782
|
}
|
|
4782
4783
|
});
|
|
@@ -4789,7 +4790,7 @@
|
|
|
4789
4790
|
return (numErrors === 0);
|
|
4790
4791
|
};
|
|
4791
4792
|
BasicFormComponent.prototype.validateSectionConsistency = function (sectionCode, reqFieldMessage) {
|
|
4792
|
-
var e_23,
|
|
4793
|
+
var e_23, _g, e_24, _h;
|
|
4793
4794
|
this.resetError();
|
|
4794
4795
|
var completeFields = this.checkSectionRequiredFields(sectionCode, reqFieldMessage);
|
|
4795
4796
|
if (!completeFields) {
|
|
@@ -4816,7 +4817,7 @@
|
|
|
4816
4817
|
catch (e_23_1) { e_23 = { error: e_23_1 }; }
|
|
4817
4818
|
finally {
|
|
4818
4819
|
try {
|
|
4819
|
-
if (requiredEmptyFields_1_1 && !requiredEmptyFields_1_1.done && (
|
|
4820
|
+
if (requiredEmptyFields_1_1 && !requiredEmptyFields_1_1.done && (_g = requiredEmptyFields_1.return)) _g.call(requiredEmptyFields_1);
|
|
4820
4821
|
}
|
|
4821
4822
|
finally { if (e_23) throw e_23.error; }
|
|
4822
4823
|
}
|
|
@@ -4839,7 +4840,7 @@
|
|
|
4839
4840
|
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
4840
4841
|
finally {
|
|
4841
4842
|
try {
|
|
4842
|
-
if (validationIssueFields_1_1 && !validationIssueFields_1_1.done && (
|
|
4843
|
+
if (validationIssueFields_1_1 && !validationIssueFields_1_1.done && (_h = validationIssueFields_1.return)) _h.call(validationIssueFields_1);
|
|
4843
4844
|
}
|
|
4844
4845
|
finally { if (e_24) throw e_24.error; }
|
|
4845
4846
|
}
|
|
@@ -4847,7 +4848,7 @@
|
|
|
4847
4848
|
return validationError;
|
|
4848
4849
|
};
|
|
4849
4850
|
BasicFormComponent.prototype.copyTableRecordToFields = function (tableObj, mappingTable) {
|
|
4850
|
-
var e_25,
|
|
4851
|
+
var e_25, _g;
|
|
4851
4852
|
if (mappingTable === void 0) { mappingTable = null; }
|
|
4852
4853
|
var _a, _b;
|
|
4853
4854
|
var tableObject = this.getTable(tableObj.tableCode);
|
|
@@ -4864,7 +4865,7 @@
|
|
|
4864
4865
|
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
4865
4866
|
finally {
|
|
4866
4867
|
try {
|
|
4867
|
-
if (columnNames_1_1 && !columnNames_1_1.done && (
|
|
4868
|
+
if (columnNames_1_1 && !columnNames_1_1.done && (_g = columnNames_1.return)) _g.call(columnNames_1);
|
|
4868
4869
|
}
|
|
4869
4870
|
finally { if (e_25) throw e_25.error; }
|
|
4870
4871
|
}
|
|
@@ -4874,7 +4875,7 @@
|
|
|
4874
4875
|
* Soporte registros en tablas que se editan en campos del formulario
|
|
4875
4876
|
*/
|
|
4876
4877
|
BasicFormComponent.prototype.defineEditionTable = function (tableEditionDef) {
|
|
4877
|
-
var e_26,
|
|
4878
|
+
var e_26, _g;
|
|
4878
4879
|
var _this = this;
|
|
4879
4880
|
var columnFieldMapping = tableEditionDef.columnFieldMapping, recordCaptureFields = tableEditionDef.recordCaptureFields, startCollapsed = tableEditionDef.startCollapsed;
|
|
4880
4881
|
tableEditionDef.startCollapsed = (typeof startCollapsed !== 'undefined')
|
|
@@ -4884,7 +4885,7 @@
|
|
|
4884
4885
|
try {
|
|
4885
4886
|
for (var columnFieldMapping_1 = __values(columnFieldMapping), columnFieldMapping_1_1 = columnFieldMapping_1.next(); !columnFieldMapping_1_1.done; columnFieldMapping_1_1 = columnFieldMapping_1.next()) {
|
|
4886
4887
|
var columnMap = columnFieldMapping_1_1.value;
|
|
4887
|
-
var
|
|
4888
|
+
var _h = __read(columnMap, 2), columnName = _h[0], formField = _h[1];
|
|
4888
4889
|
fieldsMappingTable[columnName] = formField;
|
|
4889
4890
|
fieldsToClear.push(formField);
|
|
4890
4891
|
}
|
|
@@ -4892,7 +4893,7 @@
|
|
|
4892
4893
|
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
4893
4894
|
finally {
|
|
4894
4895
|
try {
|
|
4895
|
-
if (columnFieldMapping_1_1 && !columnFieldMapping_1_1.done && (
|
|
4896
|
+
if (columnFieldMapping_1_1 && !columnFieldMapping_1_1.done && (_g = columnFieldMapping_1.return)) _g.call(columnFieldMapping_1);
|
|
4896
4897
|
}
|
|
4897
4898
|
finally { if (e_26) throw e_26.error; }
|
|
4898
4899
|
}
|
|
@@ -4945,7 +4946,7 @@
|
|
|
4945
4946
|
}
|
|
4946
4947
|
};
|
|
4947
4948
|
BasicFormComponent.prototype.enableRecordEdition = function (tableEditionDef, tableActionObject) {
|
|
4948
|
-
var e_27,
|
|
4949
|
+
var e_27, _g;
|
|
4949
4950
|
if (tableActionObject === void 0) { tableActionObject = null; }
|
|
4950
4951
|
if (tableActionObject) {
|
|
4951
4952
|
this.copyTableRecordToFields(tableActionObject, tableEditionDef.fieldsMappingTable);
|
|
@@ -4957,15 +4958,15 @@
|
|
|
4957
4958
|
if (tableEditionDef.fieldsToTriggerValidation
|
|
4958
4959
|
&& tableEditionDef.fieldsToTriggerValidation.length > 0) {
|
|
4959
4960
|
try {
|
|
4960
|
-
for (var
|
|
4961
|
-
var fieldName =
|
|
4961
|
+
for (var _h = __values(tableEditionDef.fieldsToTriggerValidation), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
4962
|
+
var fieldName = _j.value;
|
|
4962
4963
|
this.startFieldValidation(fieldName);
|
|
4963
4964
|
}
|
|
4964
4965
|
}
|
|
4965
4966
|
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
4966
4967
|
finally {
|
|
4967
4968
|
try {
|
|
4968
|
-
if (
|
|
4969
|
+
if (_j && !_j.done && (_g = _h.return)) _g.call(_h);
|
|
4969
4970
|
}
|
|
4970
4971
|
finally { if (e_27) throw e_27.error; }
|
|
4971
4972
|
}
|