@sumaris-net/ngx-components 18.27.9 → 18.27.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.
@@ -42304,9 +42304,12 @@ class AppTable {
42304
42304
  return true; // Already the edited row
42305
42305
  if (event?.defaultPrevented)
42306
42306
  return false;
42307
- const confirmed = this.confirmEditCreate();
42308
- if (!confirmed)
42309
- return false;
42307
+ // Don't call confirmEditCreate() if canceling
42308
+ if (!toBoolean(opts?.canceling, false)) {
42309
+ const confirmed = this.confirmEditCreate();
42310
+ if (!confirmed)
42311
+ return false;
42312
+ }
42310
42313
  if (!row.editing && !this.loading) {
42311
42314
  this.focusColumn = opts?.focusColumn ?? this.focusColumn;
42312
42315
  this._dataSource.startEdit(row);
@@ -42869,7 +42872,7 @@ class AppTable {
42869
42872
  this.checkIfRowPristine(row);
42870
42873
  // Restore editing state
42871
42874
  if (keepEditing) {
42872
- this.editRow(undefined, row);
42875
+ this.editRow(undefined, row, { canceling: true });
42873
42876
  }
42874
42877
  }
42875
42878
  async checkIfRowPristine(row, opts) {
@@ -45166,8 +45169,11 @@ class AppAsyncTable {
45166
45169
  return true; // Already the edited row
45167
45170
  if (event?.defaultPrevented)
45168
45171
  return false;
45169
- if (!(await this.confirmEditCreate())) {
45170
- return false;
45172
+ // Don't call confirmEditCreate() if canceling
45173
+ if (!toBoolean(opts?.canceling, false)) {
45174
+ if (!(await this.confirmEditCreate())) {
45175
+ return false;
45176
+ }
45171
45177
  }
45172
45178
  if (!row.editing && !this.loading) {
45173
45179
  this.focusColumn = opts?.focusColumn ?? this.focusColumn;
@@ -45708,6 +45714,7 @@ class AppAsyncTable {
45708
45714
  // Make sure row will be cancelled, and NOT deleted
45709
45715
  if (row.id === -1 || !row.editing)
45710
45716
  throw new Error('Row cannot be canceling, but only deleting');
45717
+ // TODO invert this condition to call canCancelRows
45711
45718
  const confirmed = !opts || opts.interactive !== false;
45712
45719
  // Ask user confirmation, if cancel
45713
45720
  if (!confirmed && row.dirty && (this.confirmBeforeCancel || this.onBeforeCancelRows.observed)) {
@@ -45723,7 +45730,7 @@ class AppAsyncTable {
45723
45730
  await this.checkIfRowPristine(row);
45724
45731
  // Restore editing state
45725
45732
  if (keepEditing) {
45726
- await this.editRow(undefined, row);
45733
+ await this.editRow(undefined, row, { canceling: true });
45727
45734
  }
45728
45735
  }
45729
45736
  async checkIfRowPristine(row, opts) {