@sumaris-net/ngx-components 1.21.2 → 1.21.3

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.
@@ -24580,11 +24580,13 @@ class AppEditor {
24580
24580
  setError(value, opts) {
24581
24581
  if (this.errorSubject.value !== value) {
24582
24582
  this.errorSubject.next(value);
24583
- if (!opts || opts.emitEvent !== false) {
24583
+ if (!opts || opts.emitEvent !== false)
24584
24584
  this.markForCheck();
24585
- }
24586
24585
  }
24587
24586
  }
24587
+ resetError(opts) {
24588
+ this.setError(undefined, opts);
24589
+ }
24588
24590
  markForCheck() {
24589
24591
  // Should be override by subclasses, if change detection is Push
24590
24592
  }
@@ -25274,19 +25276,15 @@ class AppEntityEditor extends AppTabEditor {
25274
25276
  });
25275
25277
  }
25276
25278
  resetError(opts) {
25277
- if (isNotNilOrBlank(this.error)) {
25278
- this.error = null;
25279
- if (!opts || opts.emitEvent !== false)
25280
- this.markForCheck();
25281
- }
25279
+ super.resetError(opts);
25282
25280
  }
25283
25281
  setError(err, opts) {
25284
25282
  if (!err) {
25285
- this.error = undefined;
25283
+ super.setError(undefined, opts);
25286
25284
  }
25287
25285
  else if (typeof err === 'string') {
25288
25286
  console.error('[entity-editor] Error: ' + (err || ''));
25289
- this.error = err;
25287
+ super.setError(err, opts);
25290
25288
  }
25291
25289
  else {
25292
25290
  console.error('[entity-editor] Error: ' + err.message || '', err);
@@ -25301,10 +25299,8 @@ class AppEntityEditor extends AppTabEditor {
25301
25299
  userMessage += detailMessage.length < 70 ? detailMessage : detailMessage.substring(0, 67) + '...';
25302
25300
  userMessage += '</small>';
25303
25301
  }
25304
- this.error = userMessage;
25302
+ super.setError(userMessage, opts);
25305
25303
  }
25306
- if (!opts || opts.emitEvent !== false)
25307
- this.markForCheck();
25308
25304
  }
25309
25305
  /* -- protected methods -- */
25310
25306
  /**