@sumaris-net/ngx-components 1.5.9 → 1.5.10
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 +14 -6
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +4 -0
- package/esm2015/src/app/core/table/table.class.js +14 -7
- package/fesm2015/sumaris-net.ngx-components.js +13 -6
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -21523,9 +21523,17 @@ class AppTable {
|
|
|
21523
21523
|
if (!canDelete)
|
|
21524
21524
|
return 0; // Cannot delete
|
|
21525
21525
|
if (this.saveBeforeDelete) {
|
|
21526
|
-
// Cancel invalid rows (because of save() will
|
|
21526
|
+
// Cancel invalid rows (because of save() will fail, if invalid rows exists)
|
|
21527
21527
|
rows.filter(row => { var _a; return !((_a = row.validator) === null || _a === void 0 ? void 0 : _a.valid); })
|
|
21528
|
-
.forEach(row =>
|
|
21528
|
+
.forEach(row => {
|
|
21529
|
+
const deleted = row.id === -1;
|
|
21530
|
+
row.cancelOrDelete();
|
|
21531
|
+
// When deleted (= newly created row) : decrement counter
|
|
21532
|
+
if (deleted) {
|
|
21533
|
+
this.visibleRowCount--;
|
|
21534
|
+
this.totalRowCount--;
|
|
21535
|
+
}
|
|
21536
|
+
});
|
|
21529
21537
|
// If data need to be saved first: do it
|
|
21530
21538
|
const saved = yield this.saveBeforeAction('delete');
|
|
21531
21539
|
if (!saved) {
|
|
@@ -21543,10 +21551,9 @@ class AppTable {
|
|
|
21543
21551
|
try {
|
|
21544
21552
|
const deleteCount = rowsToDelete.length;
|
|
21545
21553
|
yield this._dataSource.deleteAll(rowsToDelete);
|
|
21546
|
-
//
|
|
21547
|
-
//
|
|
21548
|
-
this.
|
|
21549
|
-
this.visibleRowCount -= deleteCount;
|
|
21554
|
+
// DO not update manually, because watchALl().subscribe() will update this count
|
|
21555
|
+
//this.totalRowCount -= deleteCount;
|
|
21556
|
+
//this.visibleRowCount -= deleteCount;
|
|
21550
21557
|
this.selection.clear();
|
|
21551
21558
|
this.editedRow = undefined;
|
|
21552
21559
|
this.markAsDirty({ emitEvent: false /*markForCheck() is called just after*/ });
|