tuain-ng-forms-lib 15.0.26 → 15.0.28
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/esm2020/lib/classes/forms/form.mjs +18 -1
- package/esm2020/lib/components/forms/basic-form.mjs +9 -2
- package/fesm2015/tuain-ng-forms-lib.mjs +27 -1
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +25 -1
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/form.d.ts +4 -0
- package/lib/components/forms/basic-form.d.ts +3 -0
- package/package.json +1 -1
|
@@ -2151,6 +2151,7 @@ class FormStructureAndData {
|
|
|
2151
2151
|
this._immutableData = {};
|
|
2152
2152
|
this._extraInfo = {};
|
|
2153
2153
|
this._exclusiveSectionsByAttr = {};
|
|
2154
|
+
this.customAttributes = {};
|
|
2154
2155
|
this.state = '';
|
|
2155
2156
|
this.actionArray = [];
|
|
2156
2157
|
this.fieldArray = [];
|
|
@@ -2189,6 +2190,10 @@ class FormStructureAndData {
|
|
|
2189
2190
|
this.setStateFlow(definitionReceived === null || definitionReceived === void 0 ? void 0 : definitionReceived.states, definitionReceived === null || definitionReceived === void 0 ? void 0 : definitionReceived.transitions, definitionReceived === null || definitionReceived === void 0 ? void 0 : definitionReceived.defaultState);
|
|
2190
2191
|
this.immutableData = definitionReceived.immutableData;
|
|
2191
2192
|
this.extraInfo = definitionReceived.extraInfo;
|
|
2193
|
+
this.customAttributes = {};
|
|
2194
|
+
if (definitionReceived === null || definitionReceived === void 0 ? void 0 : definitionReceived.customAttributes) {
|
|
2195
|
+
this.setCustomAttributes(definitionReceived === null || definitionReceived === void 0 ? void 0 : definitionReceived.customAttributes);
|
|
2196
|
+
}
|
|
2192
2197
|
if (definitionReceived.actions) {
|
|
2193
2198
|
const formActions = definitionReceived.actions.map(objDef => {
|
|
2194
2199
|
var _a;
|
|
@@ -2314,6 +2319,20 @@ class FormStructureAndData {
|
|
|
2314
2319
|
getExtraInfo(name) { var _a, _b, _c; return (_c = (_b = (_a = this._extraInfo) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; }
|
|
2315
2320
|
set extraInfo(extraInfo) { Object.assign(this._extraInfo, extraInfo); }
|
|
2316
2321
|
get extraInfo() { return JSON.parse(JSON.stringify(this._extraInfo)); }
|
|
2322
|
+
// Custom Attributes
|
|
2323
|
+
getCustomAttribute(name) { var _a, _b; return (_b = (_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null; }
|
|
2324
|
+
setCustomAttribute(name, value) {
|
|
2325
|
+
if (name) {
|
|
2326
|
+
this.customAttributes[name] = value;
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
setCustomAttributes(attributes) {
|
|
2330
|
+
if (attributes && typeof attributes === 'object') {
|
|
2331
|
+
Object.entries(attributes).forEach(([name, value]) => {
|
|
2332
|
+
this.setCustomAttribute(name, value);
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2317
2336
|
// Fields
|
|
2318
2337
|
get fieldNames() { return this.getFieldNames(); }
|
|
2319
2338
|
getFields() { return this.fieldArray; }
|
|
@@ -2795,6 +2814,7 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
2795
2814
|
this._originToken = null;
|
|
2796
2815
|
this._formRoute = null;
|
|
2797
2816
|
this._definitionObtained = false;
|
|
2817
|
+
this._notifyFormActivity = true;
|
|
2798
2818
|
// Eventos de acciones y campos
|
|
2799
2819
|
this._formChangeState = [];
|
|
2800
2820
|
this._formSectionsCanDeactivate = {};
|
|
@@ -2902,6 +2922,8 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
2902
2922
|
target.extra = (_h = target === null || target === void 0 ? void 0 : target.extra) !== null && _h !== void 0 ? _h : {};
|
|
2903
2923
|
this.formManagerService.openForm(origin, target);
|
|
2904
2924
|
}
|
|
2925
|
+
enableActivityNotification() { this._notifyFormActivity = true; }
|
|
2926
|
+
disableActivityNotification() { this._notifyFormActivity = false; }
|
|
2905
2927
|
canGoBack() { return this._originToken !== null; }
|
|
2906
2928
|
goBack() { return this.formManagerService.backTo(); }
|
|
2907
2929
|
goBackForm() { return this.goBack(); }
|
|
@@ -4026,7 +4048,11 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
4026
4048
|
}
|
|
4027
4049
|
return false;
|
|
4028
4050
|
}
|
|
4029
|
-
notifyFormActivity() {
|
|
4051
|
+
notifyFormActivity() {
|
|
4052
|
+
if (this._notifyFormActivity) {
|
|
4053
|
+
this._eventEmiter.next('formActivity', { code: this.formCode });
|
|
4054
|
+
}
|
|
4055
|
+
}
|
|
4030
4056
|
/**
|
|
4031
4057
|
* Métodos Legacy de compatibilidad hacia atrás
|
|
4032
4058
|
*/
|