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