@sumaris-net/ngx-components 2.5.1 → 2.5.2-rc2

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.
@@ -25394,7 +25394,8 @@ class AppTable {
25394
25394
  this.resetError();
25395
25395
  // Keep edited row id (should be done BEFORE confirmEditCreate() )
25396
25396
  this.previouslyEditedRowId = opts.keepEditing ? ((((_a = this.editedRow) === null || _a === void 0 ? void 0 : _a.editing) ? this.editedRow.id : undefined) || ((_b = this.singleSelectedRow) === null || _b === void 0 ? void 0 : _b.id)) : undefined;
25397
- const previouslyEditedData = opts.keepEditing ? (isNotNil(this.previouslyEditedRowId) && ((_c = this.editedRow) === null || _c === void 0 ? void 0 : _c.currentData) || ((_d = this.singleSelectedRow) === null || _d === void 0 ? void 0 : _d.currentData)) : undefined;
25397
+ const previouslyEditedRowId = this.previouslyEditedRowId;
25398
+ const previouslyEditedData = opts.keepEditing ? (isNotNil(previouslyEditedRowId) && ((_c = this.editedRow) === null || _c === void 0 ? void 0 : _c.currentData) || ((_d = this.singleSelectedRow) === null || _d === void 0 ? void 0 : _d.currentData)) : undefined;
25398
25399
  if (!this.confirmEditCreate()) {
25399
25400
  throw { code: ErrorCodes.TABLE_INVALID_ROW_ERROR, message: 'ERROR.TABLE_INVALID_ROW_ERROR' };
25400
25401
  }
@@ -25416,8 +25417,8 @@ class AppTable {
25416
25417
  finally {
25417
25418
  this.markAsSaved();
25418
25419
  // Restore previous row
25419
- if (isNotNil(this.previouslyEditedRowId)) {
25420
- yield this.selectRowByIdOrData(this.previouslyEditedRowId, previouslyEditedData);
25420
+ if (isNotNil(previouslyEditedRowId)) {
25421
+ yield this.selectRowByIdOrData(previouslyEditedRowId, previouslyEditedData);
25421
25422
  }
25422
25423
  }
25423
25424
  });
@@ -31029,25 +31030,28 @@ class AppAsyncTable {
31029
31030
  this.onConfirmEditCreateRow.next(row);
31030
31031
  return true; // Continue
31031
31032
  }
31032
- if (row.validator) {
31033
- // If pending: Wait end of validation
31034
- // TODO: remove when using async isValid() function
31035
- if (row.pending) {
31036
- yield AppFormUtils.waitWhilePending(row.validator);
31037
- }
31038
- // NOT confirmed = row has error
31039
- if (this.debug) {
31040
- console.warn('[table] Cannot confirm row, because invalid');
31041
- AppFormUtils.logFormErrors(row.validator, '[table] ');
31042
- }
31043
- // fix: mark all controls as touched to show errors
31044
- row.validator.markAllAsTouched();
31045
- // Compute row error, and propagate to table's error
31046
- if (this.propagateRowError) {
31047
- const error = this.getRowError(row);
31048
- this.setError(error);
31049
- }
31050
- }
31033
+ // if (row.validator) {
31034
+ // // If pending: Wait end of validation
31035
+ // // TODO: remove when using async isValid() function
31036
+ // if (row.pending) {
31037
+ // await AppFormUtils.waitWhilePending(row.validator);
31038
+ // }
31039
+ //
31040
+ // // NOT confirmed = row has error
31041
+ // if (this.debug) {
31042
+ // console.warn('[table] Cannot confirm row, because invalid');
31043
+ // AppFormUtils.logFormErrors(row.validator, '[table] ');
31044
+ // }
31045
+ //
31046
+ // // fix: mark all controls as touched to show errors
31047
+ // row.validator.markAllAsTouched();
31048
+ //
31049
+ // // Compute row error, and propagate to table's error
31050
+ // if (this.propagateRowError) {
31051
+ // const error = this.getRowError(row);
31052
+ // this.setError(error);
31053
+ // }
31054
+ // }
31051
31055
  // Not confirmed
31052
31056
  return false;
31053
31057
  });
@@ -31099,7 +31103,8 @@ class AppAsyncTable {
31099
31103
  // Keep edited row id (should be done BEFORE confirmEditCreate() )
31100
31104
  const editedRow = this.dataSource.getSingleEditingRow();
31101
31105
  this.previouslyEditedRowId = opts.keepEditing ? (((editedRow === null || editedRow === void 0 ? void 0 : editedRow.editing) ? editedRow.id : undefined) || ((_a = this.singleSelectedRow) === null || _a === void 0 ? void 0 : _a.id)) : undefined;
31102
- const previouslyEditedData = opts.keepEditing ? (isNotNil(this.previouslyEditedRowId) && (editedRow === null || editedRow === void 0 ? void 0 : editedRow.currentData) || ((_b = this.singleSelectedRow) === null || _b === void 0 ? void 0 : _b.currentData)) : undefined;
31106
+ const previouslyEditedRowId = this.previouslyEditedRowId;
31107
+ const previouslyEditedData = opts.keepEditing ? (isNotNil(previouslyEditedRowId) && (editedRow === null || editedRow === void 0 ? void 0 : editedRow.currentData) || ((_b = this.singleSelectedRow) === null || _b === void 0 ? void 0 : _b.currentData)) : undefined;
31103
31108
  if (!(yield this.confirmEditCreate())) {
31104
31109
  throw { code: ErrorCodes.TABLE_INVALID_ROW_ERROR, message: 'ERROR.TABLE_INVALID_ROW_ERROR' };
31105
31110
  }
@@ -31121,8 +31126,8 @@ class AppAsyncTable {
31121
31126
  finally {
31122
31127
  this.markAsSaved();
31123
31128
  // Restore previous row
31124
- if (isNotNil(this.previouslyEditedRowId)) {
31125
- yield this.selectRowByIdOrData(this.previouslyEditedRowId, previouslyEditedData);
31129
+ if (isNotNil(previouslyEditedRowId)) {
31130
+ yield this.selectRowByIdOrData(previouslyEditedRowId, previouslyEditedData);
31126
31131
  }
31127
31132
  }
31128
31133
  });