tuain-ng-forms-lib 12.0.15 → 12.0.19
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 +35 -23
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/components/elements/action.component.js +12 -12
- package/esm2015/lib/components/elements/field.component.js +25 -13
- package/fesm2015/tuain-ng-forms-lib.js +35 -23
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/components/elements/action.component.d.ts +1 -1
- package/lib/components/elements/field.component.d.ts +4 -2
- package/package.json +1 -1
- package/tuain-ng-forms-lib.metadata.json +1 -1
|
@@ -11,32 +11,32 @@
|
|
|
11
11
|
}
|
|
12
12
|
ActionComponent.prototype.ngOnInit = function () {
|
|
13
13
|
var _a;
|
|
14
|
-
this.formConfig = (_a = this.
|
|
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.
|
|
21
|
-
this.
|
|
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.
|
|
26
|
+
if (!((_a = this.action) === null || _a === void 0 ? void 0 : _a.restrictedOnField)) {
|
|
27
27
|
return true;
|
|
28
28
|
}
|
|
29
|
-
if ((((_b = this.
|
|
30
|
-
&& this.relatedField === ((_c = this.
|
|
31
|
-
|| (((_d = this.
|
|
32
|
-
&& this.relatedField !== ((_e = this.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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.
|
|
395
|
-
this.formConfig = (_a = this.
|
|
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.
|
|
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.
|
|
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,31 @@
|
|
|
421
421
|
};
|
|
422
422
|
FieldComponent.prototype.start = function () { };
|
|
423
423
|
FieldComponent.prototype.focus = function () { };
|
|
424
|
-
FieldComponent.prototype.
|
|
425
|
-
|
|
424
|
+
FieldComponent.prototype.updateObject = function () {
|
|
425
|
+
this.field._fieldValue = this.value;
|
|
426
|
+
};
|
|
427
|
+
FieldComponent.prototype.inputChanged = function () {
|
|
428
|
+
this.field._fieldValue = this.value;
|
|
429
|
+
this.onInputChange();
|
|
430
|
+
};
|
|
431
|
+
FieldComponent.prototype.inputTyped = function () {
|
|
432
|
+
this.field._fieldValue = this.value;
|
|
433
|
+
this.onInputChange();
|
|
434
|
+
};
|
|
435
|
+
FieldComponent.prototype.updateValue = function () {
|
|
436
|
+
this.value = this.field._fieldValue;
|
|
437
|
+
};
|
|
426
438
|
FieldComponent.prototype.onInputChange = function () {
|
|
427
439
|
var _this = this;
|
|
428
|
-
setTimeout(function () { return _this.
|
|
440
|
+
setTimeout(function () { return _this.field.notifyEditionPartial(); }, 50);
|
|
429
441
|
};
|
|
430
442
|
FieldComponent.prototype.onChangeContent = function () {
|
|
431
443
|
var _this = this;
|
|
432
|
-
setTimeout(function () { return _this.
|
|
444
|
+
setTimeout(function () { return _this.field.notifyEditionFinish(); }, 50);
|
|
433
445
|
};
|
|
434
446
|
FieldComponent.prototype.onShowInfo = function () {
|
|
435
447
|
var _this = this;
|
|
436
|
-
setTimeout(function () { return _this.
|
|
448
|
+
setTimeout(function () { return _this.field.notifyEditionDetailRequest(); }, 50);
|
|
437
449
|
};
|
|
438
450
|
FieldComponent.prototype.numberInputValidation = function (event) {
|
|
439
451
|
var k = event.charCode;
|
|
@@ -442,7 +454,7 @@
|
|
|
442
454
|
Object.defineProperty(FieldComponent.prototype, "visible", {
|
|
443
455
|
get: function () {
|
|
444
456
|
var _a;
|
|
445
|
-
return (_a = this.
|
|
457
|
+
return (_a = this.field) === null || _a === void 0 ? void 0 : _a.visibleOn(this.currentState);
|
|
446
458
|
},
|
|
447
459
|
enumerable: false,
|
|
448
460
|
configurable: true
|
|
@@ -450,7 +462,7 @@
|
|
|
450
462
|
Object.defineProperty(FieldComponent.prototype, "disabled", {
|
|
451
463
|
get: function () {
|
|
452
464
|
var _a;
|
|
453
|
-
return !((_a = this.
|
|
465
|
+
return !((_a = this.field) === null || _a === void 0 ? void 0 : _a.enabledOn(this.currentState));
|
|
454
466
|
},
|
|
455
467
|
enumerable: false,
|
|
456
468
|
configurable: true
|
|
@@ -464,7 +476,7 @@
|
|
|
464
476
|
},] }
|
|
465
477
|
];
|
|
466
478
|
FieldComponent.propDecorators = {
|
|
467
|
-
|
|
479
|
+
field: [{ type: core.Input }],
|
|
468
480
|
currentState: [{ type: core.Input }]
|
|
469
481
|
};
|
|
470
482
|
|