@sumaris-net/ngx-components 1.21.4 → 1.21.7

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.
@@ -28053,6 +28053,13 @@
28053
28053
  enumerable: false,
28054
28054
  configurable: true
28055
28055
  });
28056
+ Object.defineProperty(AppEditor.prototype, "editors", {
28057
+ get: function () {
28058
+ return this._children && this._children.filter(function (c) { return c instanceof AppEditor; });
28059
+ },
28060
+ enumerable: false,
28061
+ configurable: true
28062
+ });
28056
28063
  Object.defineProperty(AppEditor.prototype, "dirty", {
28057
28064
  get: function () {
28058
28065
  var _a;
@@ -28154,7 +28161,15 @@
28154
28161
  AppEditor.prototype.addChildForms = function (forms) {
28155
28162
  var _this = this;
28156
28163
  (forms || []).forEach(function (form) { return _this.addChildForm(form); });
28157
- return this;
28164
+ };
28165
+ AppEditor.prototype.removeChildForm = function (form) {
28166
+ if (!form)
28167
+ throw new Error('Trying to remove an undefined child form');
28168
+ var index = (this._children || []).findIndex(function (c) { return c === form; });
28169
+ if (index !== -1) {
28170
+ return this._children.splice(index, 1)[0];
28171
+ }
28172
+ return undefined;
28158
28173
  };
28159
28174
  AppEditor.prototype.disable = function (opts) {
28160
28175
  var _a;
@@ -29588,19 +29603,19 @@
29588
29603
  { type: AppEditorOptions, decorators: [{ type: i0.Optional }] }
29589
29604
  ]; };
29590
29605
 
29591
- var AppEntityEditorModalOptions = /** @class */ (function (_super_1) {
29592
- __extends(AppEntityEditorModalOptions, _super_1);
29606
+ var AppEntityEditorModalOptions = /** @class */ (function (_super) {
29607
+ __extends(AppEntityEditorModalOptions, _super);
29593
29608
  function AppEntityEditorModalOptions() {
29594
- return _super_1 !== null && _super_1.apply(this, arguments) || this;
29609
+ return _super !== null && _super.apply(this, arguments) || this;
29595
29610
  }
29596
29611
  return AppEntityEditorModalOptions;
29597
29612
  }(AppTabEditorOptions));
29598
29613
  // @dynamic
29599
29614
  // eslint-disable-next-line @angular-eslint/directive-class-suffix
29600
- var AppEntityEditorModal = /** @class */ (function (_super_1) {
29601
- __extends(AppEntityEditorModal, _super_1);
29615
+ var AppEntityEditorModal = /** @class */ (function (_super) {
29616
+ __extends(AppEntityEditorModal, _super);
29602
29617
  function AppEntityEditorModal(injector, dataType, options) {
29603
- var _this = _super_1.call(this, null, injector.get(i3.Router), injector.get(i1$5.AlertController), injector.get(i1$2.TranslateService), options) || this;
29618
+ var _this = _super.call(this, null, injector.get(i3.Router), injector.get(i1$5.AlertController), injector.get(i1$2.TranslateService), options) || this;
29604
29619
  _this.dataType = dataType;
29605
29620
  _this.savingSubject = new rxjs.BehaviorSubject(false);
29606
29621
  _this.$title = new rxjs.Subject();
@@ -29674,37 +29689,29 @@
29674
29689
  }
29675
29690
  };
29676
29691
  AppEntityEditorModal.prototype.ngOnInit = function () {
29677
- var _super = Object.create(null, {
29678
- ngOnInit: { get: function () { return _super_1.prototype.ngOnInit; } }
29679
- });
29680
- return __awaiter(this, void 0, void 0, function () {
29681
- var _this = this;
29682
- return __generator(this, function (_b) {
29683
- // Default values
29684
- this.mobile = isNotNil(this.mobile) ? this.mobile : this.settings.mobile;
29685
- _super.ngOnInit.call(this);
29686
- // Register forms
29687
- this.registerForms();
29688
- // Disable
29689
- if (this.disabled)
29690
- this.disable();
29691
- if (this.isNewData) {
29692
- // Update the title.
29693
- this.updateTitle();
29694
- }
29695
- else {
29696
- // Update title each time value changes
29697
- this.registerSubscription(this.form.valueChanges
29698
- .pipe(operators.debounceTime(250))
29699
- .subscribe(function (json) { return _this.updateTitle(json); }));
29700
- }
29701
- return [2 /*return*/];
29702
- });
29703
- });
29692
+ var _this = this;
29693
+ // Default values
29694
+ this.mobile = isNotNil(this.mobile) ? this.mobile : this.settings.mobile;
29695
+ _super.prototype.ngOnInit.call(this);
29696
+ // Register forms
29697
+ this.registerForms();
29698
+ // Disable
29699
+ if (this.disabled)
29700
+ this.disable();
29701
+ if (this.isNewData) {
29702
+ // Update the title.
29703
+ this.updateTitle();
29704
+ }
29705
+ else {
29706
+ // Update title each time value changes
29707
+ this.registerSubscription(this.form.valueChanges
29708
+ .pipe(operators.debounceTime(250))
29709
+ .subscribe(function (json) { return _this.updateTitle(json); }));
29710
+ }
29704
29711
  };
29705
29712
  AppEntityEditorModal.prototype.ngAfterViewInit = function () {
29706
29713
  var _this = this;
29707
- _super_1.prototype.ngAfterViewInit.call(this);
29714
+ _super.prototype.ngAfterViewInit.call(this);
29708
29715
  if (this.onAfterModalInit) {
29709
29716
  Promise.resolve(this.onAfterModalInit(this))
29710
29717
  .then(function () { return _this.load(); });
@@ -29714,7 +29721,7 @@
29714
29721
  }
29715
29722
  };
29716
29723
  AppEntityEditorModal.prototype.ngOnDestroy = function () {
29717
- _super_1.prototype.ngOnDestroy.call(this);
29724
+ _super.prototype.ngOnDestroy.call(this);
29718
29725
  this.$title.complete();
29719
29726
  this.$title.unsubscribe();
29720
29727
  this.savingSubject.unsubscribe();
@@ -29723,7 +29730,7 @@
29723
29730
  // Wait end of saving
29724
29731
  if (this.saving)
29725
29732
  return waitForFalse(this.savingSubject);
29726
- return _super_1.prototype.waitIdle.call(this, opts);
29733
+ return _super.prototype.waitIdle.call(this, opts);
29727
29734
  };
29728
29735
  AppEntityEditorModal.prototype.load = function () {
29729
29736
  return __awaiter(this, void 0, void 0, function () {
@@ -30010,11 +30017,11 @@
30010
30017
  };
30011
30018
  AppEntityEditorModal.prototype.setError = function (err, opts) {
30012
30019
  if (!err) {
30013
- _super_1.prototype.setError.call(this, undefined, opts);
30020
+ _super.prototype.setError.call(this, undefined, opts);
30014
30021
  }
30015
30022
  else if (typeof err === 'string') {
30016
30023
  console.error('[entity-editor] Error: ' + (err || ''));
30017
- _super_1.prototype.setError.call(this, err, opts);
30024
+ _super.prototype.setError.call(this, err, opts);
30018
30025
  }
30019
30026
  else {
30020
30027
  console.error('[entity-editor] Error: ' + err.message || '', err);
@@ -30029,7 +30036,7 @@
30029
30036
  userMessage += detailMessage.length < 70 ? detailMessage : detailMessage.substring(0, 67) + '...';
30030
30037
  userMessage += '</small>';
30031
30038
  }
30032
- _super_1.prototype.setError.call(this, userMessage, opts);
30039
+ _super.prototype.setError.call(this, userMessage, opts);
30033
30040
  }
30034
30041
  };
30035
30042
  /* -- protected methods -- */