@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.
@@ -26445,7 +26445,7 @@ class AppTable {
26445
26445
  if (row.id === -1) {
26446
26446
  this.deleteNewRow(event, row);
26447
26447
  }
26448
- // Delete existing (bu not editing) row
26448
+ // Delete existing (but not editing) row
26449
26449
  else if (!row.editing) {
26450
26450
  this.deleteExistingRow(event, row, opts);
26451
26451
  }
@@ -26573,8 +26573,11 @@ class AppTable {
26573
26573
  rows.forEach(row => this.selection.select(row));
26574
26574
  }
26575
26575
  }
26576
- deleteSelection(event, opts) {
26577
- return this.deleteRows(event, this.selection.selected, opts);
26576
+ async deleteSelection(event, opts) {
26577
+ const deleteCount = await this.deleteRows(event, this.selection.selected, opts);
26578
+ if (deleteCount > 0)
26579
+ this.selection.clear();
26580
+ return deleteCount;
26578
26581
  }
26579
26582
  /**
26580
26583
  *
@@ -26584,7 +26587,11 @@ class AppTable {
26584
26587
  * And to force deletion even if table is busy
26585
26588
  */
26586
26589
  async deleteRow(event, row, opts) {
26590
+ const isSelected = this.selection.isSelected(row);
26587
26591
  const deleteCount = await this.deleteRows(event, [row], opts);
26592
+ // Unselect the deleted row
26593
+ if (deleteCount && isSelected)
26594
+ this.selection.deselect(row);
26588
26595
  return deleteCount === 1;
26589
26596
  }
26590
26597
  /**
@@ -26601,6 +26608,7 @@ class AppTable {
26601
26608
  if (event?.defaultPrevented)
26602
26609
  return 0; // SKip
26603
26610
  event?.preventDefault();
26611
+ this.resetError();
26604
26612
  if (!this._enabled || isEmptyArray(rows))
26605
26613
  return 0; // Skip is disabled, or no rows to delete
26606
26614
  if (this.loading && (!opts || opts.interactive !== false)) {
@@ -27309,8 +27317,8 @@ class AppTable {
27309
27317
  this.selection.clear();
27310
27318
  this.editedRow = undefined; // unselect row
27311
27319
  this._dataSource.cancelOrDelete(row);
27312
- this.onCancelOrDeleteRow.next(row);
27313
27320
  this.resetError();
27321
+ this.onCancelOrDeleteRow.next(row);
27314
27322
  this.totalRowCount--;
27315
27323
  this.visibleRowCount--;
27316
27324
  }
@@ -30271,8 +30279,11 @@ class AppAsyncTable {
30271
30279
  rows.forEach(row => this.selection.select(row));
30272
30280
  }
30273
30281
  }
30274
- deleteSelection(event, opts) {
30275
- return this.deleteRows(event, this.selection.selected, opts);
30282
+ async deleteSelection(event, opts) {
30283
+ const deleteCount = await this.deleteRows(event, this.selection.selected, opts);
30284
+ if (deleteCount > 0)
30285
+ this.selection.clear();
30286
+ return deleteCount;
30276
30287
  }
30277
30288
  /**
30278
30289
  *
@@ -30299,6 +30310,7 @@ class AppAsyncTable {
30299
30310
  if (event?.defaultPrevented)
30300
30311
  return 0; // SKip
30301
30312
  event?.preventDefault();
30313
+ this.resetError();
30302
30314
  if (!this._enabled || isEmptyArray(rows))
30303
30315
  return 0; // Skip is disabled, or no rows to delete
30304
30316
  if (this.loading && (!opts || opts.interactive !== false)) {