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
|
@@ -460,7 +460,7 @@ class LibTableComponent extends ElementComponent {
|
|
|
460
460
|
tableGlobalAction(actionCode) { this.table?.notifyGlobalAction(actionCode); }
|
|
461
461
|
tableSelectionAction(actionCode) { this.table?.notifySelectionAction(actionCode); }
|
|
462
462
|
tableActionSelected(actionEvent) { this.table?.notifyInlineAction(actionEvent); }
|
|
463
|
-
tableSelectionToggle(recordId) {
|
|
463
|
+
tableSelectionToggle(recordId) { this.table?.notifyRecordSelection(recordId); }
|
|
464
464
|
toggleSelectAll() { return (this.table?.allSelected) ? this.table?.unSelectAll() : this.table?.selectAll(); }
|
|
465
465
|
globalFilterCompleted() { this.changePage(1); }
|
|
466
466
|
changePage(requestedPage) { this.table?.changePage(requestedPage); }
|
|
@@ -1580,15 +1580,11 @@ class RecordTable extends FormElement {
|
|
|
1580
1580
|
this._inlineActionTrigger.next(tableEvent);
|
|
1581
1581
|
}
|
|
1582
1582
|
notifyRecordSelection(recordId) {
|
|
1583
|
-
console.log('notifyRecordSelection 1');
|
|
1584
1583
|
const record = this.getTableRecord(recordId);
|
|
1585
|
-
console.log('notifyRecordSelection 2');
|
|
1586
1584
|
if (!record) {
|
|
1587
1585
|
return;
|
|
1588
1586
|
}
|
|
1589
|
-
console.log('notifyRecordSelection 3');
|
|
1590
1587
|
record.toggleSelect();
|
|
1591
|
-
console.log('notifyRecordSelection 4');
|
|
1592
1588
|
this.requestedPage = this.currentPage ?? 1;
|
|
1593
1589
|
const tableEvent = {
|
|
1594
1590
|
tableCode: this.tableCode,
|
|
@@ -1598,7 +1594,6 @@ class RecordTable extends FormElement {
|
|
|
1598
1594
|
recordData: record.recordData
|
|
1599
1595
|
}
|
|
1600
1596
|
};
|
|
1601
|
-
console.log(`notifyRecordSelection 5 ${JSON.stringify(tableEvent, null, 2)}`);
|
|
1602
1597
|
this.recordSelectionTrigger.next(tableEvent);
|
|
1603
1598
|
}
|
|
1604
1599
|
notifySelectionAction(actionCode) {
|
|
@@ -3003,7 +2998,6 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3003
2998
|
table.inlineActionTrigger.subscribe(event => this.startTableAction(event));
|
|
3004
2999
|
table.globalActionTrigger.subscribe(event => this.startTableGlobalAction(event));
|
|
3005
3000
|
table.recordSelectionTrigger.subscribe(event => {
|
|
3006
|
-
console.log(`recordSelectionTrigger subscribe ${JSON.stringify(event, null, 2)}`);
|
|
3007
3001
|
this.startTableRecordSelection(event);
|
|
3008
3002
|
});
|
|
3009
3003
|
table.selectionActionTrigger.subscribe(event => this.startTableSelectionAction(event));
|
|
@@ -3710,16 +3704,12 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3710
3704
|
}
|
|
3711
3705
|
}
|
|
3712
3706
|
async startTableRecordSelection(tableActionEvent) {
|
|
3713
|
-
console.log(`startTableRecordSelection ${JSON.stringify(tableActionEvent, null, 2)}`);
|
|
3714
3707
|
this.notifyFormActivity();
|
|
3715
|
-
console.log(`startTableRecordSelection 2`);
|
|
3716
3708
|
const { tableCode, actionDetail } = tableActionEvent;
|
|
3717
3709
|
const tableObject = this.getTable(tableCode);
|
|
3718
|
-
console.log(`startTableRecordSelection 3`);
|
|
3719
3710
|
if (!tableObject) {
|
|
3720
3711
|
return;
|
|
3721
3712
|
}
|
|
3722
|
-
console.log(`startTableRecordSelection 4`);
|
|
3723
3713
|
this.resetError();
|
|
3724
3714
|
const { recordId, recordData } = actionDetail;
|
|
3725
3715
|
const tableSelectionDetail = {
|
|
@@ -3728,31 +3718,23 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3728
3718
|
recordId,
|
|
3729
3719
|
recordData
|
|
3730
3720
|
};
|
|
3731
|
-
console.log(`startTableRecordSelection 5`);
|
|
3732
3721
|
const tableEventHandlers = this._tableSelectionsStart[tableCode];
|
|
3733
|
-
console.log(`startTableRecordSelection 6 ${tableEventHandlers?.length}`);
|
|
3734
3722
|
if (tableEventHandlers) {
|
|
3735
3723
|
const clientActionPromises = [];
|
|
3736
3724
|
for (const tableSelectionMethod of tableEventHandlers) {
|
|
3737
3725
|
const { callback, properties } = tableSelectionMethod;
|
|
3738
|
-
console.log(`startTableRecordSelection 7`);
|
|
3739
|
-
console.log(callback);
|
|
3740
3726
|
const clientActionPromise = callback(tableSelectionDetail);
|
|
3741
3727
|
clientActionPromises.push(clientActionPromise);
|
|
3742
3728
|
}
|
|
3743
3729
|
const clientActionResults = await Promise.all(clientActionPromises);
|
|
3744
3730
|
const continueAction = clientActionResults.reduce((total, curr) => (total && (curr !== false)), true);
|
|
3745
|
-
console.log(`startTableRecordSelection 8 ${continueAction}`);
|
|
3746
3731
|
if (!continueAction) {
|
|
3747
3732
|
return;
|
|
3748
3733
|
}
|
|
3749
3734
|
}
|
|
3750
|
-
console.log(`startTableRecordSelection 9`);
|
|
3751
3735
|
this.startTableServerRecordSelection(tableSelectionDetail);
|
|
3752
3736
|
}
|
|
3753
3737
|
async startTableServerRecordSelection(tableSelectionDetail) {
|
|
3754
|
-
console.log(`startTableServerRecordSelection 1`);
|
|
3755
|
-
console.log(tableSelectionDetail);
|
|
3756
3738
|
const { tableObject, tableCode, recordId, recordData } = tableSelectionDetail;
|
|
3757
3739
|
if (!tableObject) {
|
|
3758
3740
|
return;
|
|
@@ -3768,17 +3750,14 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3768
3750
|
tableRecordId: recordId,
|
|
3769
3751
|
tableRecordData: recordData
|
|
3770
3752
|
};
|
|
3771
|
-
console.log(`startTableServerRecordSelection 2 ${JSON.stringify(actionSubject, null, 2)}`);
|
|
3772
3753
|
actionResult = await this
|
|
3773
3754
|
.requestFormAction(formActions.tableAction, actionSubject);
|
|
3774
3755
|
serverError = !!this.errorOccured();
|
|
3775
3756
|
}
|
|
3776
|
-
console.log(`startTableServerRecordSelection 3`);
|
|
3777
3757
|
await this.finishTableRecordSelection(tableSelectionDetail, actionResult, serverError);
|
|
3778
3758
|
if (serverError) {
|
|
3779
3759
|
this.displayTableServerError();
|
|
3780
3760
|
}
|
|
3781
|
-
console.log(`startTableServerRecordSelection 4`);
|
|
3782
3761
|
tableObject.freeWaiting();
|
|
3783
3762
|
}
|
|
3784
3763
|
async finishTableRecordSelection(tableSelectionDetail, actionResult, serverError = false) {
|
|
@@ -3991,7 +3970,6 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3991
3970
|
}
|
|
3992
3971
|
notifyFormActivity() {
|
|
3993
3972
|
if (this._notifyFormActivity) {
|
|
3994
|
-
console.log(`notifyFormActivity ${this.name}`);
|
|
3995
3973
|
this._eventEmiter.next('formActivity', { code: this.formCode });
|
|
3996
3974
|
}
|
|
3997
3975
|
}
|