@sumaris-net/ngx-components 1.5.8 → 1.5.9
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/bundles/sumaris-net.ngx-components.umd.js +13 -5
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/table/table.class.js +12 -4
- package/esm2015/src/app/shared/functions.js +2 -2
- package/fesm2015/sumaris-net.ngx-components.js +12 -4
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -551,7 +551,7 @@
|
|
|
551
551
|
// Pagination (truncate if need)
|
|
552
552
|
var pageData = filteredItems;
|
|
553
553
|
if (opts) {
|
|
554
|
-
if (
|
|
554
|
+
if ((opts.offset || 0) > 0) {
|
|
555
555
|
pageData = pageData.slice(opts.offset);
|
|
556
556
|
}
|
|
557
557
|
if (isNotNil(opts.size) && pageData.length > opts.size) {
|
|
@@ -24892,8 +24892,9 @@
|
|
|
24892
24892
|
* @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
|
|
24893
24893
|
*/
|
|
24894
24894
|
AppTable.prototype.deleteRows = function (event, rows, opts) {
|
|
24895
|
+
var _a;
|
|
24895
24896
|
return __awaiter(this, void 0, void 0, function () {
|
|
24896
|
-
var canDelete, saved, rowsToDelete, deleteCount, err_2;
|
|
24897
|
+
var confirmed, canDelete, saved, rowsToDelete, deleteCount, err_2;
|
|
24897
24898
|
return __generator(this, function (_d) {
|
|
24898
24899
|
switch (_d.label) {
|
|
24899
24900
|
case 0:
|
|
@@ -24907,6 +24908,12 @@
|
|
|
24907
24908
|
return [2 /*return*/, 0];
|
|
24908
24909
|
if (this.loading || isEmptyArray(rows))
|
|
24909
24910
|
return [2 /*return*/, 0];
|
|
24911
|
+
// Make sure to keep newly created row
|
|
24912
|
+
if (((_a = this.editedRow) === null || _a === void 0 ? void 0 : _a.id) === -1 && this.editedRow.editing && !rows.includes(this.editedRow)) {
|
|
24913
|
+
confirmed = this.confirmEditCreate();
|
|
24914
|
+
if (!confirmed)
|
|
24915
|
+
return [2 /*return*/, 0]; // Cannot delete (e.g. edited row is invalid)
|
|
24916
|
+
}
|
|
24910
24917
|
return [4 /*yield*/, this.canDeleteRows(rows, opts)];
|
|
24911
24918
|
case 1:
|
|
24912
24919
|
canDelete = _d.sent();
|
|
@@ -24939,9 +24946,10 @@
|
|
|
24939
24946
|
return [4 /*yield*/, this._dataSource.deleteAll(rowsToDelete)];
|
|
24940
24947
|
case 5:
|
|
24941
24948
|
_d.sent();
|
|
24942
|
-
//
|
|
24943
|
-
//
|
|
24944
|
-
|
|
24949
|
+
// Update manually, even if watchALl().subscribe() will update this count,
|
|
24950
|
+
// because of memory data service (see issue #
|
|
24951
|
+
this.totalRowCount -= deleteCount;
|
|
24952
|
+
this.visibleRowCount -= deleteCount;
|
|
24945
24953
|
this.selection.clear();
|
|
24946
24954
|
this.editedRow = undefined;
|
|
24947
24955
|
this.markAsDirty({ emitEvent: false /*markForCheck() is called just after*/ });
|