@sumaris-net/ngx-components 1.23.34 → 1.23.36

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.
@@ -4553,7 +4553,8 @@
4553
4553
  configurable: true
4554
4554
  });
4555
4555
  FormArrayHelper.prototype.add = function (value, options) {
4556
- return addValueInArray(this._formArray, this.createControl, this.equals, this.isEmpty, value, options);
4556
+ var _this = this;
4557
+ return addValueInArray(this._formArray, function () { return _this.createControl(value); }, this.equals, this.isEmpty, value, options);
4557
4558
  };
4558
4559
  FormArrayHelper.prototype.removeAt = function (index) {
4559
4560
  // Do not remove if last criterion
@@ -4589,12 +4590,16 @@
4589
4590
  };
4590
4591
  /**
4591
4592
  * Resize the FormArray, then set values
4592
- * @param data
4593
+ * @param values
4593
4594
  * @param opts
4594
4595
  */
4595
- FormArrayHelper.prototype.setValue = function (data, opts) {
4596
- this.resize((data === null || data === void 0 ? void 0 : data.length) || 0);
4597
- this._formArray.setValue(data, opts);
4596
+ FormArrayHelper.prototype.setValue = function (values, opts) {
4597
+ var _this = this;
4598
+ this.resize(0);
4599
+ (values || []).forEach(function (value, i) {
4600
+ var isLast = i === values.length - 1;
4601
+ _this.add(value, { emitEvent: isLast });
4602
+ });
4598
4603
  };
4599
4604
  /**
4600
4605
  * Resize the FormArray, then patch values
@@ -10189,9 +10194,11 @@
10189
10194
  return data;
10190
10195
  })
10191
10196
  .catch(function (err) {
10192
- console.error('Failed to start a service: ' + (err && err.message || err), err);
10193
- _this._started = false;
10194
- _this._startPromise = null;
10197
+ if (!_this.stopped) {
10198
+ console.error('Failed to start a service: ' + (err && err.message || err), err);
10199
+ _this._startPromise = null;
10200
+ _this._started = false;
10201
+ }
10195
10202
  return null;
10196
10203
  });
10197
10204
  return this._startPromise;
@@ -10224,10 +10231,10 @@
10224
10231
  console.error('Failed to stop a service: ' + (err_1 && err_1.message || err_1), err_1);
10225
10232
  return [3 /*break*/, 4];
10226
10233
  case 3:
10227
- this.stopSubject.next();
10228
10234
  this._data = null;
10229
10235
  this._started = false;
10230
10236
  this._startPromise = undefined;
10237
+ this.stopSubject.next();
10231
10238
  return [7 /*endfinally*/];
10232
10239
  case 4: return [2 /*return*/];
10233
10240
  }
@@ -12850,9 +12857,11 @@
12850
12857
  return data;
12851
12858
  })
12852
12859
  .catch(function (err) {
12853
- console.error('Failed to start a service: ' + (err && err.message || err), err);
12854
- _this._started = false;
12855
- _this._startPromise = null;
12860
+ if (!_this.stopped) {
12861
+ console.error('Failed to start a service: ' + (err && err.message || err), err);
12862
+ _this._started = false;
12863
+ _this._startPromise = null;
12864
+ }
12856
12865
  return null;
12857
12866
  });
12858
12867
  return this._startPromise;