@sumaris-net/ngx-components 1.21.2 → 1.21.5

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.
@@ -28499,11 +28499,13 @@
28499
28499
  AppEditor.prototype.setError = function (value, opts) {
28500
28500
  if (this.errorSubject.value !== value) {
28501
28501
  this.errorSubject.next(value);
28502
- if (!opts || opts.emitEvent !== false) {
28502
+ if (!opts || opts.emitEvent !== false)
28503
28503
  this.markForCheck();
28504
- }
28505
28504
  }
28506
28505
  };
28506
+ AppEditor.prototype.resetError = function (opts) {
28507
+ this.setError(undefined, opts);
28508
+ };
28507
28509
  AppEditor.prototype.markForCheck = function () {
28508
28510
  // Should be override by subclasses, if change detection is Push
28509
28511
  };
@@ -29368,19 +29370,15 @@
29368
29370
  });
29369
29371
  };
29370
29372
  AppEntityEditor.prototype.resetError = function (opts) {
29371
- if (isNotNilOrBlank(this.error)) {
29372
- this.error = null;
29373
- if (!opts || opts.emitEvent !== false)
29374
- this.markForCheck();
29375
- }
29373
+ _super.prototype.resetError.call(this, opts);
29376
29374
  };
29377
29375
  AppEntityEditor.prototype.setError = function (err, opts) {
29378
29376
  if (!err) {
29379
- this.error = undefined;
29377
+ _super.prototype.setError.call(this, undefined, opts);
29380
29378
  }
29381
29379
  else if (typeof err === 'string') {
29382
29380
  console.error('[entity-editor] Error: ' + (err || ''));
29383
- this.error = err;
29381
+ _super.prototype.setError.call(this, err, opts);
29384
29382
  }
29385
29383
  else {
29386
29384
  console.error('[entity-editor] Error: ' + err.message || '', err);
@@ -29395,10 +29393,8 @@
29395
29393
  userMessage += detailMessage.length < 70 ? detailMessage : detailMessage.substring(0, 67) + '...';
29396
29394
  userMessage += '</small>';
29397
29395
  }
29398
- this.error = userMessage;
29396
+ _super.prototype.setError.call(this, userMessage, opts);
29399
29397
  }
29400
- if (!opts || opts.emitEvent !== false)
29401
- this.markForCheck();
29402
29398
  };
29403
29399
  /* -- protected methods -- */
29404
29400
  /**
@@ -29592,19 +29588,19 @@
29592
29588
  { type: AppEditorOptions, decorators: [{ type: i0.Optional }] }
29593
29589
  ]; };
29594
29590
 
29595
- var AppEntityEditorModalOptions = /** @class */ (function (_super_1) {
29596
- __extends(AppEntityEditorModalOptions, _super_1);
29591
+ var AppEntityEditorModalOptions = /** @class */ (function (_super) {
29592
+ __extends(AppEntityEditorModalOptions, _super);
29597
29593
  function AppEntityEditorModalOptions() {
29598
- return _super_1 !== null && _super_1.apply(this, arguments) || this;
29594
+ return _super !== null && _super.apply(this, arguments) || this;
29599
29595
  }
29600
29596
  return AppEntityEditorModalOptions;
29601
29597
  }(AppTabEditorOptions));
29602
29598
  // @dynamic
29603
29599
  // eslint-disable-next-line @angular-eslint/directive-class-suffix
29604
- var AppEntityEditorModal = /** @class */ (function (_super_1) {
29605
- __extends(AppEntityEditorModal, _super_1);
29600
+ var AppEntityEditorModal = /** @class */ (function (_super) {
29601
+ __extends(AppEntityEditorModal, _super);
29606
29602
  function AppEntityEditorModal(injector, dataType, options) {
29607
- var _this = _super_1.call(this, null, injector.get(i3.Router), injector.get(i1$5.AlertController), injector.get(i1$2.TranslateService), options) || this;
29603
+ var _this = _super.call(this, null, injector.get(i3.Router), injector.get(i1$5.AlertController), injector.get(i1$2.TranslateService), options) || this;
29608
29604
  _this.dataType = dataType;
29609
29605
  _this.savingSubject = new rxjs.BehaviorSubject(false);
29610
29606
  _this.$title = new rxjs.Subject();
@@ -29678,37 +29674,29 @@
29678
29674
  }
29679
29675
  };
29680
29676
  AppEntityEditorModal.prototype.ngOnInit = function () {
29681
- var _super = Object.create(null, {
29682
- ngOnInit: { get: function () { return _super_1.prototype.ngOnInit; } }
29683
- });
29684
- return __awaiter(this, void 0, void 0, function () {
29685
- var _this = this;
29686
- return __generator(this, function (_b) {
29687
- // Default values
29688
- this.mobile = isNotNil(this.mobile) ? this.mobile : this.settings.mobile;
29689
- _super.ngOnInit.call(this);
29690
- // Register forms
29691
- this.registerForms();
29692
- // Disable
29693
- if (this.disabled)
29694
- this.disable();
29695
- if (this.isNewData) {
29696
- // Update the title.
29697
- this.updateTitle();
29698
- }
29699
- else {
29700
- // Update title each time value changes
29701
- this.registerSubscription(this.form.valueChanges
29702
- .pipe(operators.debounceTime(250))
29703
- .subscribe(function (json) { return _this.updateTitle(json); }));
29704
- }
29705
- return [2 /*return*/];
29706
- });
29707
- });
29677
+ var _this = this;
29678
+ // Default values
29679
+ this.mobile = isNotNil(this.mobile) ? this.mobile : this.settings.mobile;
29680
+ _super.prototype.ngOnInit.call(this);
29681
+ // Register forms
29682
+ this.registerForms();
29683
+ // Disable
29684
+ if (this.disabled)
29685
+ this.disable();
29686
+ if (this.isNewData) {
29687
+ // Update the title.
29688
+ this.updateTitle();
29689
+ }
29690
+ else {
29691
+ // Update title each time value changes
29692
+ this.registerSubscription(this.form.valueChanges
29693
+ .pipe(operators.debounceTime(250))
29694
+ .subscribe(function (json) { return _this.updateTitle(json); }));
29695
+ }
29708
29696
  };
29709
29697
  AppEntityEditorModal.prototype.ngAfterViewInit = function () {
29710
29698
  var _this = this;
29711
- _super_1.prototype.ngAfterViewInit.call(this);
29699
+ _super.prototype.ngAfterViewInit.call(this);
29712
29700
  if (this.onAfterModalInit) {
29713
29701
  Promise.resolve(this.onAfterModalInit(this))
29714
29702
  .then(function () { return _this.load(); });
@@ -29718,7 +29706,7 @@
29718
29706
  }
29719
29707
  };
29720
29708
  AppEntityEditorModal.prototype.ngOnDestroy = function () {
29721
- _super_1.prototype.ngOnDestroy.call(this);
29709
+ _super.prototype.ngOnDestroy.call(this);
29722
29710
  this.$title.complete();
29723
29711
  this.$title.unsubscribe();
29724
29712
  this.savingSubject.unsubscribe();
@@ -29727,7 +29715,7 @@
29727
29715
  // Wait end of saving
29728
29716
  if (this.saving)
29729
29717
  return waitForFalse(this.savingSubject);
29730
- return _super_1.prototype.waitIdle.call(this, opts);
29718
+ return _super.prototype.waitIdle.call(this, opts);
29731
29719
  };
29732
29720
  AppEntityEditorModal.prototype.load = function () {
29733
29721
  return __awaiter(this, void 0, void 0, function () {
@@ -30014,11 +30002,11 @@
30014
30002
  };
30015
30003
  AppEntityEditorModal.prototype.setError = function (err, opts) {
30016
30004
  if (!err) {
30017
- this.error = undefined;
30005
+ _super.prototype.setError.call(this, undefined, opts);
30018
30006
  }
30019
30007
  else if (typeof err === 'string') {
30020
30008
  console.error('[entity-editor] Error: ' + (err || ''));
30021
- this.error = err;
30009
+ _super.prototype.setError.call(this, err, opts);
30022
30010
  }
30023
30011
  else {
30024
30012
  console.error('[entity-editor] Error: ' + err.message || '', err);
@@ -30033,10 +30021,8 @@
30033
30021
  userMessage += detailMessage.length < 70 ? detailMessage : detailMessage.substring(0, 67) + '...';
30034
30022
  userMessage += '</small>';
30035
30023
  }
30036
- this.error = userMessage;
30024
+ _super.prototype.setError.call(this, userMessage, opts);
30037
30025
  }
30038
- if (!opts || opts.emitEvent !== false)
30039
- this.markForCheck();
30040
30026
  };
30041
30027
  /* -- protected methods -- */
30042
30028
  AppEntityEditorModal.prototype.waitWhilePending = function (opts) {