tuain-ng-forms-lib 17.2.20 → 17.2.25
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/field.mjs +2 -1
- package/esm2022/lib/classes/forms/table/table.mjs +1 -7
- package/esm2022/lib/components/forms/basic-form.mjs +15 -4
- package/fesm2022/tuain-ng-forms-lib.mjs +15 -9
- package/fesm2022/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/components/forms/basic-form.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1361,6 +1361,7 @@ class FieldDescriptor extends FormElement {
|
|
|
1361
1361
|
(attrName === 'fieldTypeCode') && (this.type = attrValue);
|
|
1362
1362
|
(attrName === 'fieldType') && (this.type = attrValue);
|
|
1363
1363
|
(attrName === 'tooltipText') && (this.tooltip = attrValue);
|
|
1364
|
+
(attrName === 'customAttributes') && (this.setCustomAttributes(attrValue));
|
|
1364
1365
|
}
|
|
1365
1366
|
}
|
|
1366
1367
|
}
|
|
@@ -1902,12 +1903,6 @@ class RecordTable extends FormElement {
|
|
|
1902
1903
|
tableRecord.tableRecordId = tableRecord.tableRecordId ?? tableRecord.recordId ?? tableRecord.recordIdKey;
|
|
1903
1904
|
const recordReceived = new TableRecordData(tableRecord, this._columns, this._selectionField);
|
|
1904
1905
|
const recordIdKey = recordReceived.recordIdKey ?? recordReceived.recordIdKey;
|
|
1905
|
-
if (!recordIdKey) {
|
|
1906
|
-
console.log(`Registro recibido sin idKey`);
|
|
1907
|
-
console.log(recordReceived);
|
|
1908
|
-
console.log(`Origen`);
|
|
1909
|
-
console.log(tableRecord);
|
|
1910
|
-
}
|
|
1911
1906
|
if (newRecordsObj[recordIdKey]) {
|
|
1912
1907
|
continue;
|
|
1913
1908
|
}
|
|
@@ -3180,6 +3175,7 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3180
3175
|
_tableServerError = [];
|
|
3181
3176
|
// Acciones en curso dentro del formulario
|
|
3182
3177
|
_actionsInProgress = {};
|
|
3178
|
+
_serverActionsInProgress = {};
|
|
3183
3179
|
// Datos complementarios del formulario
|
|
3184
3180
|
inputDataFields = {};
|
|
3185
3181
|
extraData = {};
|
|
@@ -3680,19 +3676,27 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3680
3676
|
return;
|
|
3681
3677
|
}
|
|
3682
3678
|
}
|
|
3683
|
-
this.startServerAction(actionObject);
|
|
3679
|
+
await this.startServerAction(actionObject);
|
|
3684
3680
|
this._actionsInProgress[code] = null;
|
|
3685
3681
|
delete this._actionsInProgress[code];
|
|
3686
3682
|
}
|
|
3687
3683
|
async startServerAction(actionInput) {
|
|
3688
3684
|
const action = (typeof actionInput === 'string')
|
|
3689
3685
|
? this.getAction(actionInput) : actionInput;
|
|
3690
|
-
|
|
3686
|
+
const { actionCode: code, backend } = action ?? {};
|
|
3687
|
+
if (!action || !code) {
|
|
3691
3688
|
return;
|
|
3692
3689
|
}
|
|
3693
3690
|
let serverError = false;
|
|
3694
3691
|
let actionResult = null;
|
|
3695
|
-
if (
|
|
3692
|
+
if (backend) {
|
|
3693
|
+
if (this._serverActionsInProgress[code]) {
|
|
3694
|
+
const { sent } = this._serverActionsInProgress[code];
|
|
3695
|
+
console.log(`Reingreso server en acción ${code} con ejecución previa ${sent}`);
|
|
3696
|
+
return;
|
|
3697
|
+
}
|
|
3698
|
+
this._serverActionsInProgress[code] = { sent: new Date() };
|
|
3699
|
+
// Se inicia la parte server de la acción
|
|
3696
3700
|
actionResult = await this.requestFormAction(action.actionCode);
|
|
3697
3701
|
}
|
|
3698
3702
|
await this.finishAction(action, actionResult, serverError);
|
|
@@ -3706,6 +3710,8 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3706
3710
|
callback(action);
|
|
3707
3711
|
}
|
|
3708
3712
|
}
|
|
3713
|
+
this._serverActionsInProgress[code] = null;
|
|
3714
|
+
delete this._serverActionsInProgress[code];
|
|
3709
3715
|
action.stop();
|
|
3710
3716
|
}
|
|
3711
3717
|
async finishAction(action, actionResult, serverError = false) {
|