tuain-ng-forms-lib 12.0.14 → 12.0.18

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.
@@ -11,32 +11,32 @@
11
11
  }
12
12
  ActionComponent.prototype.ngOnInit = function () {
13
13
  var _a;
14
- this.formConfig = (_a = this.actionObject) === null || _a === void 0 ? void 0 : _a._formConfig;
14
+ this.formConfig = (_a = this.action) === null || _a === void 0 ? void 0 : _a._formConfig;
15
15
  this.start();
16
16
  };
17
17
  ActionComponent.prototype.start = function () { };
18
18
  ActionComponent.prototype.activate = function () {
19
19
  var _a;
20
- if ((_a = this.actionObject) === null || _a === void 0 ? void 0 : _a.notifyActivation) {
21
- this.actionObject.notifyActivation();
20
+ if ((_a = this.action) === null || _a === void 0 ? void 0 : _a.notifyActivation) {
21
+ this.action.notifyActivation();
22
22
  }
23
23
  };
24
24
  ActionComponent.prototype.visibleOnRestriction = function () {
25
25
  var _a, _b, _c, _d, _e;
26
- if (!((_a = this.actionObject) === null || _a === void 0 ? void 0 : _a.restrictedOnField)) {
26
+ if (!((_a = this.action) === null || _a === void 0 ? void 0 : _a.restrictedOnField)) {
27
27
  return true;
28
28
  }
29
- if ((((_b = this.actionObject) === null || _b === void 0 ? void 0 : _b.restrictedOnOperator) === '=='
30
- && this.relatedField === ((_c = this.actionObject) === null || _c === void 0 ? void 0 : _c.restrictedOnValue))
31
- || (((_d = this.actionObject) === null || _d === void 0 ? void 0 : _d.restrictedOnOperator) === '!='
32
- && this.relatedField !== ((_e = this.actionObject) === null || _e === void 0 ? void 0 : _e.restrictedOnValue))) {
29
+ if ((((_b = this.action) === null || _b === void 0 ? void 0 : _b.restrictedOnOperator) === '=='
30
+ && this.relatedField === ((_c = this.action) === null || _c === void 0 ? void 0 : _c.restrictedOnValue))
31
+ || (((_d = this.action) === null || _d === void 0 ? void 0 : _d.restrictedOnOperator) === '!='
32
+ && this.relatedField !== ((_e = this.action) === null || _e === void 0 ? void 0 : _e.restrictedOnValue))) {
33
33
  return true;
34
34
  }
35
35
  };
36
36
  Object.defineProperty(ActionComponent.prototype, "visible", {
37
37
  get: function () {
38
38
  var _a;
39
- return ((_a = this.actionObject) === null || _a === void 0 ? void 0 : _a.visibleOn(this.currentState)) && this.visibleOnRestriction();
39
+ return ((_a = this.action) === null || _a === void 0 ? void 0 : _a.visibleOn(this.currentState)) && this.visibleOnRestriction();
40
40
  },
41
41
  enumerable: false,
42
42
  configurable: true
@@ -44,7 +44,7 @@
44
44
  Object.defineProperty(ActionComponent.prototype, "disabled", {
45
45
  get: function () {
46
46
  var _a;
47
- return !((_a = this.actionObject) === null || _a === void 0 ? void 0 : _a.enabledOn(this.currentState));
47
+ return !((_a = this.action) === null || _a === void 0 ? void 0 : _a.enabledOn(this.currentState));
48
48
  },
49
49
  enumerable: false,
50
50
  configurable: true
@@ -58,7 +58,7 @@
58
58
  },] }
59
59
  ];
60
60
  ActionComponent.propDecorators = {
61
- actionObject: [{ type: core.Input }],
61
+ action: [{ type: core.Input }],
62
62
  busy: [{ type: core.Input }],
63
63
  relatedField: [{ type: core.Input }],
64
64
  currentState: [{ type: core.Input }],
@@ -391,8 +391,8 @@
391
391
  FieldComponent.prototype.ngOnInit = function () {
392
392
  var _this = this;
393
393
  var _a, _b;
394
- if (this.fieldObject) {
395
- this.formConfig = (_a = this.fieldObject) === null || _a === void 0 ? void 0 : _a._formConfig;
394
+ if (this.field) {
395
+ this.formConfig = (_a = this.field) === null || _a === void 0 ? void 0 : _a._formConfig;
396
396
  // Inicialización
397
397
  var mapping = Object.entries(this.formConfig.componentFieldAttrMap);
398
398
  for (var index = 0; index < mapping.length; index++) {
@@ -402,11 +402,11 @@
402
402
  this.updateValue();
403
403
  }
404
404
  else {
405
- this[compAttr] = (_b = this.fieldObject) === null || _b === void 0 ? void 0 : _b[fieldAttr.toString()];
405
+ this[compAttr] = (_b = this.field) === null || _b === void 0 ? void 0 : _b[fieldAttr.toString()];
406
406
  }
407
407
  }
408
408
  // Subscripción a cambios en atributos
409
- this.fieldObject.attributeChange.subscribe(function (event) {
409
+ this.field.attributeChange.subscribe(function (event) {
410
410
  var fieldAttr = event.name, value = event.value;
411
411
  var compAttr = _this.formConfig.componentFieldAttrMap[fieldAttr];
412
412
  if (compAttr === VALUE) {
@@ -421,19 +421,32 @@
421
421
  };
422
422
  FieldComponent.prototype.start = function () { };
423
423
  FieldComponent.prototype.focus = function () { };
424
- FieldComponent.prototype.updateValue = function () { };
425
- FieldComponent.prototype.updateObject = function () { };
424
+ FieldComponent.prototype.updateObject = function () {
425
+ this.field._fieldValue = this.value;
426
+ this.onChangeContent();
427
+ };
428
+ FieldComponent.prototype.inputChanged = function () {
429
+ this.field._fieldValue = this.value;
430
+ this.onInputChange();
431
+ };
432
+ FieldComponent.prototype.inputTyped = function () {
433
+ this.field._fieldValue = this.value;
434
+ this.onInputChange();
435
+ };
436
+ FieldComponent.prototype.updateValue = function () {
437
+ this.value = this.field._fieldValue;
438
+ };
426
439
  FieldComponent.prototype.onInputChange = function () {
427
440
  var _this = this;
428
- setTimeout(function () { return _this.fieldObject.notifyEditionPartial(); }, 50);
441
+ setTimeout(function () { return _this.field.notifyEditionPartial(); }, 50);
429
442
  };
430
443
  FieldComponent.prototype.onChangeContent = function () {
431
444
  var _this = this;
432
- setTimeout(function () { return _this.fieldObject.notifyEditionFinish(); }, 50);
445
+ setTimeout(function () { return _this.field.notifyEditionFinish(); }, 50);
433
446
  };
434
447
  FieldComponent.prototype.onShowInfo = function () {
435
448
  var _this = this;
436
- setTimeout(function () { return _this.fieldObject.notifyEditionDetailRequest(); }, 50);
449
+ setTimeout(function () { return _this.field.notifyEditionDetailRequest(); }, 50);
437
450
  };
438
451
  FieldComponent.prototype.numberInputValidation = function (event) {
439
452
  var k = event.charCode;
@@ -442,7 +455,7 @@
442
455
  Object.defineProperty(FieldComponent.prototype, "visible", {
443
456
  get: function () {
444
457
  var _a;
445
- return (_a = this.fieldObject) === null || _a === void 0 ? void 0 : _a.visibleOn(this.currentState);
458
+ return (_a = this.field) === null || _a === void 0 ? void 0 : _a.visibleOn(this.currentState);
446
459
  },
447
460
  enumerable: false,
448
461
  configurable: true
@@ -450,7 +463,7 @@
450
463
  Object.defineProperty(FieldComponent.prototype, "disabled", {
451
464
  get: function () {
452
465
  var _a;
453
- return !((_a = this.fieldObject) === null || _a === void 0 ? void 0 : _a.enabledOn(this.currentState));
466
+ return !((_a = this.field) === null || _a === void 0 ? void 0 : _a.enabledOn(this.currentState));
454
467
  },
455
468
  enumerable: false,
456
469
  configurable: true
@@ -464,7 +477,7 @@
464
477
  },] }
465
478
  ];
466
479
  FieldComponent.propDecorators = {
467
- fieldObject: [{ type: core.Input }],
480
+ field: [{ type: core.Input }],
468
481
  currentState: [{ type: core.Input }]
469
482
  };
470
483
 
@@ -3293,7 +3306,7 @@
3293
3306
  this.extraData = {};
3294
3307
  this.definitionObtained = false;
3295
3308
  this.formVisible = false;
3296
- this.inServerProcess = false;
3309
+ this.busy = false;
3297
3310
  this.formSectionsActivate = {};
3298
3311
  this.formSectionsInactivate = {};
3299
3312
  this.formActionsStart = {};
@@ -3312,6 +3325,11 @@
3312
3325
  this.cleanStart();
3313
3326
  this.customPreProcessing();
3314
3327
  }
3328
+ Object.defineProperty(BasicFormComponent.prototype, "inServerProcess", {
3329
+ get: function () { return this.busy; },
3330
+ enumerable: false,
3331
+ configurable: true
3332
+ });
3315
3333
  BasicFormComponent.prototype.setConfig = function (formConfig) {
3316
3334
  this.formConfig = formConfig;
3317
3335
  };
@@ -3328,7 +3346,7 @@
3328
3346
  this.definitionObtained = false;
3329
3347
  // Se limpian los manejadores de eventos
3330
3348
  this.formVisible = false;
3331
- this.inServerProcess = false;
3349
+ this.busy = false;
3332
3350
  this.formSectionsActivate = {};
3333
3351
  this.formSectionsInactivate = {};
3334
3352
  this.formActionsStart = {};
@@ -3635,11 +3653,11 @@
3635
3653
  return [2 /*return*/];
3636
3654
  }
3637
3655
  if (!!this.definitionObtained) return [3 /*break*/, 2];
3638
- this.inServerProcess = true;
3656
+ this.busy = true;
3639
3657
  return [4 /*yield*/, this.formManagerService.getFormDefinition(this.name)];
3640
3658
  case 1:
3641
3659
  formDefinition = _j.sent();
3642
- this.inServerProcess = false;
3660
+ this.busy = false;
3643
3661
  this.formStructure = new FormStructureAndData(formDefinition, this.formConfig);
3644
3662
  this.fields = this.formStructure.fields;
3645
3663
  this.actions = this.formStructure.actions;
@@ -3708,11 +3726,11 @@
3708
3726
  this.errorCode = NO_ERROR;
3709
3727
  this.errorMessage = '';
3710
3728
  this.errorDetail = '';
3711
- this.inServerProcess = true;
3729
+ this.busy = true;
3712
3730
  return [4 /*yield*/, this.formManagerService.execServerAction(actionDetail)];
3713
3731
  case 1:
3714
3732
  formActionResponse = _j.sent();
3715
- this.inServerProcess = false;
3733
+ this.busy = false;
3716
3734
  if (formActionResponse && formActionResponse.error.errorType) {
3717
3735
  console.log('Excepción no soportada');
3718
3736
  }