@sumaris-net/ngx-components 1.5.10 → 1.5.11
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 -9
- 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/esm2015/src/app/core/table/table.class.js +15 -10
- package/fesm2015/sumaris-net.ngx-components.js +14 -9
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -21524,16 +21524,21 @@ class AppTable {
|
|
|
21524
21524
|
return 0; // Cannot delete
|
|
21525
21525
|
if (this.saveBeforeDelete) {
|
|
21526
21526
|
// Cancel invalid rows (because of save() will fail, if invalid rows exists)
|
|
21527
|
-
rows
|
|
21528
|
-
|
|
21529
|
-
|
|
21530
|
-
|
|
21531
|
-
|
|
21532
|
-
|
|
21533
|
-
|
|
21534
|
-
|
|
21527
|
+
rows = rows.reduce((res, row) => {
|
|
21528
|
+
if (row.validator && !row.validator.valid) {
|
|
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
|
+
return res;
|
|
21536
|
+
}
|
|
21535
21537
|
}
|
|
21536
|
-
|
|
21538
|
+
return res.concat(row);
|
|
21539
|
+
}, []);
|
|
21540
|
+
if (isEmptyArray(rows))
|
|
21541
|
+
return 0;
|
|
21537
21542
|
// If data need to be saved first: do it
|
|
21538
21543
|
const saved = yield this.saveBeforeAction('delete');
|
|
21539
21544
|
if (!saved) {
|