tuain-ng-forms-lib 17.1.20 → 17.1.21
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/esm2022/lib/classes/forms/form.mjs +13 -11
- package/esm2022/lib/components/forms/basic-form.mjs +14 -4
- package/fesm2022/tuain-ng-forms-lib.mjs +25 -13
- package/fesm2022/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/form.d.ts +8 -7
- package/lib/components/forms/basic-form.d.ts +8 -1
- package/package.json +1 -1
|
@@ -2349,10 +2349,10 @@ const neverVisible = 'NONE';
|
|
|
2349
2349
|
const onStatesVisible = 'ONSTATES';
|
|
2350
2350
|
class FormStructureAndData {
|
|
2351
2351
|
_stateChange = new Subject();
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2352
|
+
_immutableData = {};
|
|
2353
|
+
_extraInfo = {};
|
|
2354
|
+
_exclusiveSectionsByAttr = {};
|
|
2355
|
+
loadInitialData = true;
|
|
2356
2356
|
subject = null;
|
|
2357
2357
|
stateFlow;
|
|
2358
2358
|
fields = {};
|
|
@@ -2363,10 +2363,11 @@ class FormStructureAndData {
|
|
|
2363
2363
|
actionArray;
|
|
2364
2364
|
tableArray;
|
|
2365
2365
|
sectionArray;
|
|
2366
|
-
_immutableData = {};
|
|
2367
|
-
_extraInfo = {};
|
|
2368
|
-
_exclusiveSectionsByAttr = {};
|
|
2369
2366
|
customAttributes = {};
|
|
2367
|
+
formConfig;
|
|
2368
|
+
state;
|
|
2369
|
+
name = '';
|
|
2370
|
+
title = '';
|
|
2370
2371
|
constructor() {
|
|
2371
2372
|
this.state = '';
|
|
2372
2373
|
this.actionArray = [];
|
|
@@ -2402,9 +2403,10 @@ class FormStructureAndData {
|
|
|
2402
2403
|
if (!definitionReceived) {
|
|
2403
2404
|
return;
|
|
2404
2405
|
}
|
|
2405
|
-
|
|
2406
|
-
this.
|
|
2407
|
-
|
|
2406
|
+
const { form = {} } = definitionReceived;
|
|
2407
|
+
this.name = this.name ?? form.formCode;
|
|
2408
|
+
this.title = form.formTitle ?? this.name;
|
|
2409
|
+
this.loadInitialData = form.loadInitialData ?? true;
|
|
2408
2410
|
allStates = definitionReceived?.states;
|
|
2409
2411
|
this.setStateFlow(definitionReceived?.states, definitionReceived?.transitions, definitionReceived?.defaultState, definitionReceived?.stateDescriptions);
|
|
2410
2412
|
this.immutableData = definitionReceived.immutableData;
|
|
@@ -3100,6 +3102,7 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3100
3102
|
this.fileMgmtServices = fileMgmtServices;
|
|
3101
3103
|
this._eventEmiter = this._eventManager;
|
|
3102
3104
|
this.cleanStart();
|
|
3105
|
+
this.preStart();
|
|
3103
3106
|
this.customPreProcessing();
|
|
3104
3107
|
}
|
|
3105
3108
|
cleanStart() {
|
|
@@ -3141,8 +3144,15 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3141
3144
|
get formVisible() { return this.visible; }
|
|
3142
3145
|
get form() { return this; }
|
|
3143
3146
|
// Métodos virtuales
|
|
3144
|
-
|
|
3147
|
+
preStart() { }
|
|
3145
3148
|
start() { }
|
|
3149
|
+
/**
|
|
3150
|
+
* @deprecated Use preStart
|
|
3151
|
+
*/
|
|
3152
|
+
customPreProcessing() { }
|
|
3153
|
+
/**
|
|
3154
|
+
* @deprecated Overload start
|
|
3155
|
+
*/
|
|
3146
3156
|
customFormStart() { }
|
|
3147
3157
|
displayActionServerError() { }
|
|
3148
3158
|
displayValidationServerError() { }
|
|
@@ -3294,8 +3304,10 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3294
3304
|
this.subscribeTableSubjects();
|
|
3295
3305
|
// Se define el estado inicial y se solicita la acción inicial
|
|
3296
3306
|
this.changeState(initialState || this.defaultState);
|
|
3297
|
-
|
|
3298
|
-
|
|
3307
|
+
if (this.loadInitialData) {
|
|
3308
|
+
const recordResponse = await this.requestFormAction(formActions.getData);
|
|
3309
|
+
this.checkErrorRecordReceived(recordResponse);
|
|
3310
|
+
}
|
|
3299
3311
|
this.visible = true;
|
|
3300
3312
|
this.enabledSections = this.visibleSections ?? [];
|
|
3301
3313
|
this.start();
|