tuain-ng-forms-lib 12.0.6 → 12.0.10
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 +24 -4
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/field.js +4 -3
- package/esm2015/lib/classes/forms/form.js +4 -1
- package/esm2015/lib/components/elements/field.component.js +10 -2
- package/esm2015/lib/components/forms/basic-form.js +2 -2
- package/fesm2015/tuain-ng-forms-lib.js +16 -4
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/form.d.ts +1 -0
- package/lib/components/elements/field.component.d.ts +3 -0
- package/lib/components/forms/basic-form.d.ts +1 -0
- package/package.json +1 -1
- package/tuain-ng-forms-lib.metadata.json +1 -1
|
@@ -372,6 +372,7 @@
|
|
|
372
372
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
+
var VALUE = '';
|
|
375
376
|
var FieldComponent = /** @class */ (function () {
|
|
376
377
|
function FieldComponent() {
|
|
377
378
|
}
|
|
@@ -390,13 +391,20 @@
|
|
|
390
391
|
this.fieldObject.attributeChange.subscribe(function (event) {
|
|
391
392
|
var fieldAttr = event.name, value = event.value;
|
|
392
393
|
var compAttr = _this.formConfig.componentFieldAttrMap[fieldAttr];
|
|
393
|
-
|
|
394
|
+
if (compAttr === VALUE) {
|
|
395
|
+
_this.updateValue();
|
|
396
|
+
}
|
|
397
|
+
else if (_this.hasOwnProperty(compAttr)) {
|
|
398
|
+
_this[compAttr] = value;
|
|
399
|
+
}
|
|
394
400
|
});
|
|
395
401
|
}
|
|
396
402
|
this.start();
|
|
397
403
|
};
|
|
398
404
|
FieldComponent.prototype.start = function () { };
|
|
399
405
|
FieldComponent.prototype.focus = function () { };
|
|
406
|
+
FieldComponent.prototype.updateValue = function () { };
|
|
407
|
+
FieldComponent.prototype.updateObject = function () { };
|
|
400
408
|
FieldComponent.prototype.onInputChange = function () {
|
|
401
409
|
var _this = this;
|
|
402
410
|
setTimeout(function () { return _this.fieldObject.notifyEditionPartial(); }, 50);
|
|
@@ -2160,7 +2168,8 @@
|
|
|
2160
2168
|
return (_b = this._fieldValue) !== null && _b !== void 0 ? _b : false;
|
|
2161
2169
|
break;
|
|
2162
2170
|
case this._formConfig.fieldTypes.currency:
|
|
2163
|
-
return this._fieldValue
|
|
2171
|
+
return (typeof this._fieldValue === 'string')
|
|
2172
|
+
? this._fieldValue.replace(',', '') : this._fieldValue;
|
|
2164
2173
|
break;
|
|
2165
2174
|
default:
|
|
2166
2175
|
return this._fieldValue;
|
|
@@ -2309,7 +2318,7 @@
|
|
|
2309
2318
|
}
|
|
2310
2319
|
break;
|
|
2311
2320
|
case this._formConfig.fieldTypes.currency:
|
|
2312
|
-
newFinalValue = formatCurrency(
|
|
2321
|
+
newFinalValue = formatCurrency(newValue);
|
|
2313
2322
|
break;
|
|
2314
2323
|
default:
|
|
2315
2324
|
newFinalValue = newValue;
|
|
@@ -2600,6 +2609,13 @@
|
|
|
2600
2609
|
FormStructureAndData.prototype.getSections = function () {
|
|
2601
2610
|
return this._sections;
|
|
2602
2611
|
};
|
|
2612
|
+
Object.defineProperty(FormStructureAndData.prototype, "visibleSections", {
|
|
2613
|
+
get: function () {
|
|
2614
|
+
return this._sections.filter(function (sec) { return sec.visible; });
|
|
2615
|
+
},
|
|
2616
|
+
enumerable: false,
|
|
2617
|
+
configurable: true
|
|
2618
|
+
});
|
|
2603
2619
|
FormStructureAndData.prototype.numSections = function () {
|
|
2604
2620
|
return this._sections.length;
|
|
2605
2621
|
};
|
|
@@ -3392,6 +3408,11 @@
|
|
|
3392
3408
|
BasicFormComponent.prototype.disableActions = function (actionArray) { return this.formStructure.disableActions(actionArray); };
|
|
3393
3409
|
BasicFormComponent.prototype.getStates = function () { return this.formStructure.getStates(); };
|
|
3394
3410
|
BasicFormComponent.prototype.getSections = function () { return this.formStructure.getSections(); };
|
|
3411
|
+
Object.defineProperty(BasicFormComponent.prototype, "visibleSections", {
|
|
3412
|
+
get: function () { return this.formStructure.visibleSections; },
|
|
3413
|
+
enumerable: false,
|
|
3414
|
+
configurable: true
|
|
3415
|
+
});
|
|
3395
3416
|
BasicFormComponent.prototype.getSection = function (sectionCode) { return this.formStructure.getSection(sectionCode); };
|
|
3396
3417
|
BasicFormComponent.prototype.activateSection = function (sectionCode) { return this.formStructure.activateSection(sectionCode); };
|
|
3397
3418
|
BasicFormComponent.prototype.getSubSection = function (sectionCode, subsectionCode) { return this.formStructure.getSubSection(sectionCode, subsectionCode); };
|
|
@@ -3491,7 +3512,6 @@
|
|
|
3491
3512
|
this.controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]) !== null && _a !== void 0 ? _a : null;
|
|
3492
3513
|
var _j = this.formManagerService.getFormInfo(this.controlToken), token = _j.token, subject = _j.subject, state = _j.state, fields = _j.fields, extra = _j.extra, originToken = _j.originToken;
|
|
3493
3514
|
if (!this.controlToken || this.controlToken !== token) {
|
|
3494
|
-
console.log("No se obtuvo un token v\u00E1lido para abrir el formulario " + this.name + ":" + this.controlToken + "->" + token);
|
|
3495
3515
|
return;
|
|
3496
3516
|
}
|
|
3497
3517
|
this.formSubject = (_c = (_b = params === null || params === void 0 ? void 0 : params[SUBJECT]) !== null && _b !== void 0 ? _b : subject) !== null && _c !== void 0 ? _c : null;
|