@sumaris-net/ngx-components 2.4.48 → 2.4.49
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/doc/changelog.md +3 -0
- package/esm2020/src/app/core/table/async-table.class.mjs +7 -3
- package/esm2020/src/app/core/table/table.class.mjs +13 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +20 -4
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +18 -6
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -26931,7 +26931,7 @@ class AppTable {
|
|
|
26931
26931
|
if (row.id === -1) {
|
|
26932
26932
|
this.deleteNewRow(event, row);
|
|
26933
26933
|
}
|
|
26934
|
-
// Delete existing (
|
|
26934
|
+
// Delete existing (but not editing) row
|
|
26935
26935
|
else if (!row.editing) {
|
|
26936
26936
|
this.deleteExistingRow(event, row, opts);
|
|
26937
26937
|
}
|
|
@@ -27067,7 +27067,12 @@ class AppTable {
|
|
|
27067
27067
|
});
|
|
27068
27068
|
}
|
|
27069
27069
|
deleteSelection(event, opts) {
|
|
27070
|
-
return this
|
|
27070
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27071
|
+
const deleteCount = yield this.deleteRows(event, this.selection.selected, opts);
|
|
27072
|
+
if (deleteCount > 0)
|
|
27073
|
+
this.selection.clear();
|
|
27074
|
+
return deleteCount;
|
|
27075
|
+
});
|
|
27071
27076
|
}
|
|
27072
27077
|
/**
|
|
27073
27078
|
*
|
|
@@ -27078,7 +27083,11 @@ class AppTable {
|
|
|
27078
27083
|
*/
|
|
27079
27084
|
deleteRow(event, row, opts) {
|
|
27080
27085
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27086
|
+
const isSelected = this.selection.isSelected(row);
|
|
27081
27087
|
const deleteCount = yield this.deleteRows(event, [row], opts);
|
|
27088
|
+
// Unselect the deleted row
|
|
27089
|
+
if (deleteCount && isSelected)
|
|
27090
|
+
this.selection.deselect(row);
|
|
27082
27091
|
return deleteCount === 1;
|
|
27083
27092
|
});
|
|
27084
27093
|
}
|
|
@@ -27098,6 +27107,7 @@ class AppTable {
|
|
|
27098
27107
|
if (event === null || event === void 0 ? void 0 : event.defaultPrevented)
|
|
27099
27108
|
return 0; // SKip
|
|
27100
27109
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
27110
|
+
this.resetError();
|
|
27101
27111
|
if (!this._enabled || isEmptyArray(rows))
|
|
27102
27112
|
return 0; // Skip is disabled, or no rows to delete
|
|
27103
27113
|
if (this.loading && (!opts || opts.interactive !== false)) {
|
|
@@ -27840,8 +27850,8 @@ class AppTable {
|
|
|
27840
27850
|
this.selection.clear();
|
|
27841
27851
|
this.editedRow = undefined; // unselect row
|
|
27842
27852
|
this._dataSource.cancelOrDelete(row);
|
|
27843
|
-
this.onCancelOrDeleteRow.next(row);
|
|
27844
27853
|
this.resetError();
|
|
27854
|
+
this.onCancelOrDeleteRow.next(row);
|
|
27845
27855
|
this.totalRowCount--;
|
|
27846
27856
|
this.visibleRowCount--;
|
|
27847
27857
|
}
|
|
@@ -30945,7 +30955,12 @@ class AppAsyncTable {
|
|
|
30945
30955
|
});
|
|
30946
30956
|
}
|
|
30947
30957
|
deleteSelection(event, opts) {
|
|
30948
|
-
return this
|
|
30958
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30959
|
+
const deleteCount = yield this.deleteRows(event, this.selection.selected, opts);
|
|
30960
|
+
if (deleteCount > 0)
|
|
30961
|
+
this.selection.clear();
|
|
30962
|
+
return deleteCount;
|
|
30963
|
+
});
|
|
30949
30964
|
}
|
|
30950
30965
|
/**
|
|
30951
30966
|
*
|
|
@@ -30975,6 +30990,7 @@ class AppAsyncTable {
|
|
|
30975
30990
|
if (event === null || event === void 0 ? void 0 : event.defaultPrevented)
|
|
30976
30991
|
return 0; // SKip
|
|
30977
30992
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
30993
|
+
this.resetError();
|
|
30978
30994
|
if (!this._enabled || isEmptyArray(rows))
|
|
30979
30995
|
return 0; // Skip is disabled, or no rows to delete
|
|
30980
30996
|
if (this.loading && (!opts || opts.interactive !== false)) {
|