tuain-ng-forms-lib 14.0.16 → 14.1.0
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/table/table.mjs +6 -6
- package/esm2020/lib/components/elements/layout/form-header.component.mjs +2 -1
- package/esm2020/lib/components/elements/tables/table-record-action.component.mjs +1 -1
- package/esm2020/lib/components/forms/basic-form.mjs +42 -1
- package/esm2020/lib/services/form-manager.service.mjs +2 -2
- package/fesm2015/tuain-ng-forms-lib.mjs +50 -7
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +48 -6
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/components/elements/layout/form-header.component.d.ts +1 -1
- package/lib/components/elements/tables/table-record-action.component.d.ts +2 -1
- package/lib/components/forms/basic-form.d.ts +40 -0
- package/lib/services/form-manager.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -200,6 +200,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
200
200
|
|
|
201
201
|
class FormHeaderComponent {
|
|
202
202
|
constructor() {
|
|
203
|
+
this.goBackAction = false;
|
|
203
204
|
this.goBackEvent = new EventEmitter();
|
|
204
205
|
}
|
|
205
206
|
goBackForm() {
|
|
@@ -1269,7 +1270,7 @@ class RecordTable extends FormElement {
|
|
|
1269
1270
|
}
|
|
1270
1271
|
notifyGetDataAction(requestedPage = null) {
|
|
1271
1272
|
this.updateVisibleRecords();
|
|
1272
|
-
this.requestedPage = requestedPage || this.currentPage;
|
|
1273
|
+
this.requestedPage = requestedPage || this.currentPage || 1;
|
|
1273
1274
|
const tableEvent = {
|
|
1274
1275
|
tableCode: this.tableCode,
|
|
1275
1276
|
actionCode: null,
|
|
@@ -1334,7 +1335,7 @@ class RecordTable extends FormElement {
|
|
|
1334
1335
|
const recordsLastPage = this.totalRecordsNumber % this.recordsPerPage;
|
|
1335
1336
|
const totalPages = this.totalRecordsNumber / this.recordsPerPage + (recordsLastPage ? 1 : 0);
|
|
1336
1337
|
if (this.currentPage > totalPages) {
|
|
1337
|
-
this.currentPage = totalPages;
|
|
1338
|
+
this.currentPage = totalPages || 1;
|
|
1338
1339
|
}
|
|
1339
1340
|
}
|
|
1340
1341
|
else {
|
|
@@ -1348,7 +1349,7 @@ class RecordTable extends FormElement {
|
|
|
1348
1349
|
this.visible = tableReceived?.visible || true;
|
|
1349
1350
|
this.totalPages = tableReceived.totalPages || 1;
|
|
1350
1351
|
this.recordsNumber = tableReceived.recordsNumber;
|
|
1351
|
-
this.setAttr('currentPage', +tableReceived?.currentPage
|
|
1352
|
+
this.setAttr('currentPage', +tableReceived?.currentPage || 1);
|
|
1352
1353
|
this.setAttr('recordsPerPage', +tableReceived.recordsPerPage);
|
|
1353
1354
|
this.setAttr('totalRecordsNumber', (this.clientPaging) ? tableReceived.tableRecords.length : +tableReceived.totalRecordsNumber);
|
|
1354
1355
|
this.setAttr('sorting', {
|
|
@@ -1483,8 +1484,8 @@ class RecordTable extends FormElement {
|
|
|
1483
1484
|
recordCompare(recordA, recordB, columnCompare, direction) {
|
|
1484
1485
|
const recordAValue = recordA.getFieldValue(columnCompare);
|
|
1485
1486
|
const recordBValue = recordB.getFieldValue(columnCompare);
|
|
1486
|
-
const recordAColumn = isNaN(recordAValue) ? recordAValue.toLocaleLowerCase() : recordAValue;
|
|
1487
|
-
const recordBColumn = isNaN(recordBValue) ? recordBValue.toLocaleLowerCase() : recordBValue;
|
|
1487
|
+
const recordAColumn = isNaN(recordAValue) ? recordAValue.toLocaleLowerCase() : +recordAValue;
|
|
1488
|
+
const recordBColumn = isNaN(recordBValue) ? recordBValue.toLocaleLowerCase() : +recordBValue;
|
|
1488
1489
|
let result = 0;
|
|
1489
1490
|
if (recordAColumn < recordBColumn) {
|
|
1490
1491
|
result = -1;
|
|
@@ -2125,7 +2126,7 @@ class LibFormManagerService {
|
|
|
2125
2126
|
getFormDefinition(formCode) { }
|
|
2126
2127
|
execServerAction(actionDetail) { }
|
|
2127
2128
|
goToForm(formCode, token, subject) { }
|
|
2128
|
-
loadStack() { }
|
|
2129
|
+
async loadStack() { }
|
|
2129
2130
|
saveStack() { }
|
|
2130
2131
|
cleanStack() { this.pageStack = []; }
|
|
2131
2132
|
resetPageStack() { this.cleanStack(); }
|
|
@@ -2520,6 +2521,7 @@ class BasicFormComponent {
|
|
|
2520
2521
|
get subject() { return this.formSubject ?? ''; }
|
|
2521
2522
|
// Métodos virtuales
|
|
2522
2523
|
customPreProcessing() { }
|
|
2524
|
+
start() { }
|
|
2523
2525
|
customFormStart() { }
|
|
2524
2526
|
displayActionServerError() { }
|
|
2525
2527
|
displayValidationServerError() { }
|
|
@@ -2704,6 +2706,7 @@ class BasicFormComponent {
|
|
|
2704
2706
|
this.subscribeFieldsSubjects();
|
|
2705
2707
|
this.subscribeActionSubjects();
|
|
2706
2708
|
this.subscribeTableSubjects();
|
|
2709
|
+
this.start();
|
|
2707
2710
|
this.customFormStart();
|
|
2708
2711
|
}
|
|
2709
2712
|
checkErrorRecordReceived(recordResponse) {
|
|
@@ -3586,42 +3589,81 @@ class BasicFormComponent {
|
|
|
3586
3589
|
/**
|
|
3587
3590
|
* Métodos Legacy de compatibilidad hacia atrás
|
|
3588
3591
|
*/
|
|
3592
|
+
/**
|
|
3593
|
+
* @deprecated Use onSectionActivation
|
|
3594
|
+
*/
|
|
3589
3595
|
addSectionActivation(codes, callback, properties = null) {
|
|
3590
3596
|
return this.onSectionActivation(codes, callback, properties);
|
|
3591
3597
|
}
|
|
3598
|
+
/**
|
|
3599
|
+
* @deprecated Use onSectionInactivation
|
|
3600
|
+
*/
|
|
3592
3601
|
addSectionInactivation(codes, callback, properties = null) {
|
|
3593
3602
|
return this.onSectionInactivation(codes, callback, properties);
|
|
3594
3603
|
}
|
|
3604
|
+
/**
|
|
3605
|
+
* @deprecated Use onActionStart
|
|
3606
|
+
*/
|
|
3595
3607
|
addActionMethodStart(codes, callback, properties = null) {
|
|
3596
3608
|
return this.onActionStart(codes, callback, properties);
|
|
3597
3609
|
}
|
|
3610
|
+
/**
|
|
3611
|
+
* @deprecated Use onActionFinish
|
|
3612
|
+
*/
|
|
3598
3613
|
addActionMethodFinish(codes, callback, properties = null) {
|
|
3599
3614
|
return this.onActionFinish(codes, callback, properties);
|
|
3600
3615
|
}
|
|
3616
|
+
/**
|
|
3617
|
+
* @deprecated Use onFieldInput
|
|
3618
|
+
*/
|
|
3601
3619
|
addFieldInputValidation(codes, callback, properties = null) {
|
|
3602
3620
|
return this.onFieldInput(codes, callback, properties);
|
|
3603
3621
|
}
|
|
3622
|
+
/**
|
|
3623
|
+
* @deprecated Use onFieldValidationStart
|
|
3624
|
+
*/
|
|
3604
3625
|
addFieldValidationStart(codes, callback, properties = null) {
|
|
3605
3626
|
return this.onFieldValidationStart(codes, callback, properties);
|
|
3606
3627
|
}
|
|
3628
|
+
/**
|
|
3629
|
+
* @deprecated Use onFieldValidationFinish
|
|
3630
|
+
*/
|
|
3607
3631
|
addFieldValidationFinish(codes, callback, properties = null) {
|
|
3608
3632
|
return this.onFieldValidationFinish(codes, callback, properties);
|
|
3609
3633
|
}
|
|
3634
|
+
/**
|
|
3635
|
+
* @deprecated Use onTableActionStart
|
|
3636
|
+
*/
|
|
3610
3637
|
addTableActionStart(code, actionCode, callback, properties = null) {
|
|
3611
3638
|
return this.onTableActionStart(code, actionCode, callback, properties);
|
|
3612
3639
|
}
|
|
3640
|
+
/**
|
|
3641
|
+
* @deprecated Use onTableActionFinish
|
|
3642
|
+
*/
|
|
3613
3643
|
addTableActionFinish(code, actionCode, callback, properties = null) {
|
|
3614
3644
|
return this.onTableActionFinish(code, actionCode, callback, properties);
|
|
3615
3645
|
}
|
|
3646
|
+
/**
|
|
3647
|
+
* @deprecated Use onTableSelectionStart
|
|
3648
|
+
*/
|
|
3616
3649
|
addTableSelectionStart(code, callback, properties = null) {
|
|
3617
3650
|
return this.onTableSelectionStart(code, callback, properties);
|
|
3618
3651
|
}
|
|
3652
|
+
/**
|
|
3653
|
+
* @deprecated Use onTableSelectionFinish
|
|
3654
|
+
*/
|
|
3619
3655
|
addTableSelectionFinish(code, callback, properties = null) {
|
|
3620
3656
|
return this.onTableSelectionFinish(code, callback, properties);
|
|
3621
3657
|
}
|
|
3658
|
+
/**
|
|
3659
|
+
* @deprecated Use onTableGetDataStart
|
|
3660
|
+
*/
|
|
3622
3661
|
addTableGetDataStart(code, callback, properties = null) {
|
|
3623
3662
|
return this.onTableGetDataStart(code, callback, properties);
|
|
3624
3663
|
}
|
|
3664
|
+
/**
|
|
3665
|
+
* @deprecated Use onTableGetDataFinish
|
|
3666
|
+
*/
|
|
3625
3667
|
addTableGetDataFinish(code, callback, properties = null) {
|
|
3626
3668
|
return this.onTableGetDataFinish(code, callback, properties);
|
|
3627
3669
|
}
|