tuain-ng-forms-lib 15.1.11 → 15.1.13
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 -1
- package/esm2020/lib/components/elements/tables/table.component.mjs +2 -2
- package/esm2020/lib/components/forms/basic-form.mjs +20 -2
- package/fesm2015/tuain-ng-forms-lib.mjs +25 -2
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +25 -2
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -474,7 +474,7 @@ class LibTableComponent extends ElementComponent {
|
|
|
474
474
|
tableGlobalAction(actionCode) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifyGlobalAction(actionCode); }
|
|
475
475
|
tableSelectionAction(actionCode) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifySelectionAction(actionCode); }
|
|
476
476
|
tableActionSelected(actionEvent) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifyInlineAction(actionEvent); }
|
|
477
|
-
tableSelectionToggle(recordId) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifyRecordSelection(recordId); }
|
|
477
|
+
tableSelectionToggle(recordId) { var _a; console.log('tableSelectionToggle 1'); (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifyRecordSelection(recordId); }
|
|
478
478
|
toggleSelectAll() { var _a, _b, _c; return ((_a = this.table) === null || _a === void 0 ? void 0 : _a.allSelected) ? (_b = this.table) === null || _b === void 0 ? void 0 : _b.unSelectAll() : (_c = this.table) === null || _c === void 0 ? void 0 : _c.selectAll(); }
|
|
479
479
|
globalFilterCompleted() { this.changePage(1); }
|
|
480
480
|
changePage(requestedPage) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.changePage(requestedPage); }
|
|
@@ -1610,11 +1610,15 @@ class RecordTable extends FormElement {
|
|
|
1610
1610
|
}
|
|
1611
1611
|
notifyRecordSelection(recordId) {
|
|
1612
1612
|
var _a;
|
|
1613
|
+
console.log('notifyRecordSelection 1');
|
|
1613
1614
|
const record = this.getTableRecord(recordId);
|
|
1615
|
+
console.log('notifyRecordSelection 2');
|
|
1614
1616
|
if (!record) {
|
|
1615
1617
|
return;
|
|
1616
1618
|
}
|
|
1619
|
+
console.log('notifyRecordSelection 3');
|
|
1617
1620
|
record.toggleSelect();
|
|
1621
|
+
console.log('notifyRecordSelection 4');
|
|
1618
1622
|
this.requestedPage = (_a = this.currentPage) !== null && _a !== void 0 ? _a : 1;
|
|
1619
1623
|
const tableEvent = {
|
|
1620
1624
|
tableCode: this.tableCode,
|
|
@@ -1624,6 +1628,7 @@ class RecordTable extends FormElement {
|
|
|
1624
1628
|
recordData: record.recordData
|
|
1625
1629
|
}
|
|
1626
1630
|
};
|
|
1631
|
+
console.log(`notifyRecordSelection 5 ${JSON.stringify(tableEvent, null, 2)}`);
|
|
1627
1632
|
this.recordSelectionTrigger.next(tableEvent);
|
|
1628
1633
|
}
|
|
1629
1634
|
notifySelectionAction(actionCode) {
|
|
@@ -3059,7 +3064,10 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3059
3064
|
formTables.forEach(table => {
|
|
3060
3065
|
table.inlineActionTrigger.subscribe(event => this.startTableAction(event));
|
|
3061
3066
|
table.globalActionTrigger.subscribe(event => this.startTableGlobalAction(event));
|
|
3062
|
-
table.recordSelectionTrigger.subscribe(event =>
|
|
3067
|
+
table.recordSelectionTrigger.subscribe(event => {
|
|
3068
|
+
console.log(`recordSelectionTrigger subscribe ${JSON.stringify(event, null, 2)}`);
|
|
3069
|
+
this.startTableRecordSelection(event);
|
|
3070
|
+
});
|
|
3063
3071
|
table.selectionActionTrigger.subscribe(event => this.startTableSelectionAction(event));
|
|
3064
3072
|
table.getDataTrigger.subscribe(event => this.startTableGetData(event));
|
|
3065
3073
|
// Adicionalmente se le pide a la tabla se subscriba al cambio de estado del formulario
|
|
@@ -3810,12 +3818,16 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3810
3818
|
}
|
|
3811
3819
|
startTableRecordSelection(tableActionEvent) {
|
|
3812
3820
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3821
|
+
console.log(`startTableRecordSelection ${JSON.stringify(tableActionEvent, null, 2)}`);
|
|
3813
3822
|
this.notifyFormActivity();
|
|
3823
|
+
console.log(`startTableRecordSelection 2`);
|
|
3814
3824
|
const { tableCode, actionDetail } = tableActionEvent;
|
|
3815
3825
|
const tableObject = this.getTable(tableCode);
|
|
3826
|
+
console.log(`startTableRecordSelection 3`);
|
|
3816
3827
|
if (!tableObject) {
|
|
3817
3828
|
return;
|
|
3818
3829
|
}
|
|
3830
|
+
console.log(`startTableRecordSelection 4`);
|
|
3819
3831
|
this.resetError();
|
|
3820
3832
|
const { recordId, recordData } = actionDetail;
|
|
3821
3833
|
const tableSelectionDetail = {
|
|
@@ -3824,26 +3836,33 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3824
3836
|
recordId,
|
|
3825
3837
|
recordData
|
|
3826
3838
|
};
|
|
3839
|
+
console.log(`startTableRecordSelection 5`);
|
|
3827
3840
|
const tableEventHandlers = this._tableSelectionsStart[tableCode];
|
|
3841
|
+
console.log(`startTableRecordSelection 6 ${tableEventHandlers === null || tableEventHandlers === void 0 ? void 0 : tableEventHandlers.length}`);
|
|
3828
3842
|
if (tableEventHandlers) {
|
|
3829
3843
|
const clientActionPromises = [];
|
|
3830
3844
|
for (const tableSelectionMethod of tableEventHandlers) {
|
|
3831
3845
|
const { callback, properties } = tableSelectionMethod;
|
|
3846
|
+
console.log(`startTableRecordSelection 7`);
|
|
3847
|
+
console.log(callback);
|
|
3832
3848
|
const clientActionPromise = callback(tableSelectionDetail);
|
|
3833
3849
|
clientActionPromises.push(clientActionPromise);
|
|
3834
3850
|
}
|
|
3835
3851
|
const clientActionResults = yield Promise.all(clientActionPromises);
|
|
3836
3852
|
const continueAction = clientActionResults.reduce((total, curr) => (total && (curr !== false)), true);
|
|
3853
|
+
console.log(`startTableRecordSelection 8 ${continueAction}`);
|
|
3837
3854
|
if (!continueAction) {
|
|
3838
3855
|
return;
|
|
3839
3856
|
}
|
|
3840
3857
|
}
|
|
3858
|
+
console.log(`startTableRecordSelection 9`);
|
|
3841
3859
|
this.startTableServerRecordSelection(tableSelectionDetail);
|
|
3842
3860
|
});
|
|
3843
3861
|
}
|
|
3844
3862
|
startTableServerRecordSelection(tableSelectionDetail) {
|
|
3845
3863
|
var _a;
|
|
3846
3864
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3865
|
+
console.log(`startTableServerRecordSelection 1 ${JSON.stringify(tableSelectionDetail, null, 2)}`);
|
|
3847
3866
|
const { tableObject, tableCode, recordId, recordData } = tableSelectionDetail;
|
|
3848
3867
|
if (!tableObject) {
|
|
3849
3868
|
return;
|
|
@@ -3859,14 +3878,17 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3859
3878
|
tableRecordId: recordId,
|
|
3860
3879
|
tableRecordData: recordData
|
|
3861
3880
|
};
|
|
3881
|
+
console.log(`startTableServerRecordSelection 2 ${JSON.stringify(actionSubject, null, 2)}`);
|
|
3862
3882
|
actionResult = yield this
|
|
3863
3883
|
.requestFormAction(formActions.tableAction, actionSubject);
|
|
3864
3884
|
serverError = !!this.errorOccured();
|
|
3865
3885
|
}
|
|
3886
|
+
console.log(`startTableServerRecordSelection 3`);
|
|
3866
3887
|
yield this.finishTableRecordSelection(tableSelectionDetail, actionResult, serverError);
|
|
3867
3888
|
if (serverError) {
|
|
3868
3889
|
this.displayTableServerError();
|
|
3869
3890
|
}
|
|
3891
|
+
console.log(`startTableServerRecordSelection 4`);
|
|
3870
3892
|
tableObject.freeWaiting();
|
|
3871
3893
|
});
|
|
3872
3894
|
}
|
|
@@ -4101,6 +4123,7 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
4101
4123
|
}
|
|
4102
4124
|
notifyFormActivity() {
|
|
4103
4125
|
if (this._notifyFormActivity) {
|
|
4126
|
+
console.log(`notifyFormActivity ${this.name}`);
|
|
4104
4127
|
this._eventEmiter.next('formActivity', { code: this.formCode });
|
|
4105
4128
|
}
|
|
4106
4129
|
}
|