@sumaris-net/ngx-components 1.23.0-rc5 → 1.23.1-rc1

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.
@@ -1065,13 +1065,22 @@
1065
1065
  function filterFalse(obs) {
1066
1066
  return obs.pipe(operators.filter(function (v) { return v === false; }));
1067
1067
  }
1068
- function firstTruePromise(obs) {
1068
+ function firstTruePromise(obs, opts) {
1069
+ if ((opts === null || opts === void 0 ? void 0 : opts.timeout) > 0) {
1070
+ return obs.pipe(operators.first(function (v) { return v === true; }), operators.takeUntil(rxjs.timer(1000))).toPromise();
1071
+ }
1069
1072
  return obs.pipe(operators.first(function (v) { return v === true; })).toPromise();
1070
1073
  }
1071
- function firstFalsePromise(obs) {
1074
+ function firstFalsePromise(obs, opts) {
1075
+ if ((opts === null || opts === void 0 ? void 0 : opts.timeout) > 0) {
1076
+ return obs.pipe(operators.first(function (v) { return v === false; }), operators.takeUntil(rxjs.timer(1000))).toPromise();
1077
+ }
1072
1078
  return obs.pipe(operators.first(function (v) { return v === false; })).toPromise();
1073
1079
  }
1074
- function firstNotNilPromise(obs) {
1080
+ function firstNotNilPromise(obs, opts) {
1081
+ if ((opts === null || opts === void 0 ? void 0 : opts.timeout) > 0) {
1082
+ return firstNotNil(obs).pipe(operators.takeUntil(rxjs.timer(opts === null || opts === void 0 ? void 0 : opts.timeout))).toPromise();
1083
+ }
1075
1084
  return firstNotNil(obs).toPromise();
1076
1085
  }
1077
1086
  function chainPromises(defers) {
@@ -25831,15 +25840,43 @@
25831
25840
  return _this;
25832
25841
  }
25833
25842
  Object.defineProperty(EntitiesTableDataSource.prototype, "serviceOptions", {
25843
+ /**
25844
+ * @deprecated Use watchAllOptions or saveAllOptions
25845
+ */
25834
25846
  get: function () {
25835
- return this.config.dataServiceOptions;
25847
+ return this.config.dataServiceOptions
25848
+ || Object.assign(Object.assign({}, this.watchAllOptions), this.saveAllOptions);
25836
25849
  },
25850
+ /**
25851
+ * @deprecated Use watchAllOptions or saveAllOptions
25852
+ */
25837
25853
  set: function (value) {
25854
+ console.warn('dataSource.serviceOptions is deprecated! Please use \'watchAllOptions\' or \'saveAllOptions\' instead');
25838
25855
  this.config.dataServiceOptions = value;
25839
25856
  },
25840
25857
  enumerable: false,
25841
25858
  configurable: true
25842
25859
  });
25860
+ Object.defineProperty(EntitiesTableDataSource.prototype, "watchAllOptions", {
25861
+ get: function () {
25862
+ return this.config.watchAllOptions;
25863
+ },
25864
+ set: function (value) {
25865
+ this.config.watchAllOptions = value;
25866
+ },
25867
+ enumerable: false,
25868
+ configurable: true
25869
+ });
25870
+ Object.defineProperty(EntitiesTableDataSource.prototype, "saveAllOptions", {
25871
+ get: function () {
25872
+ return this.config.saveAllOptions;
25873
+ },
25874
+ set: function (value) {
25875
+ this.config.saveAllOptions = value;
25876
+ },
25877
+ enumerable: false,
25878
+ configurable: true
25879
+ });
25843
25880
  Object.defineProperty(EntitiesTableDataSource.prototype, "loaded", {
25844
25881
  get: function () {
25845
25882
  return this.loadingSubject.value === false; // Should be false when undefined (initial state)
@@ -26604,11 +26641,12 @@
26604
26641
  });
26605
26642
  AppTable.prototype.ngOnInit = function () {
26606
26643
  var _this = this;
26644
+ var _a;
26607
26645
  if (this._initialized)
26608
26646
  return; // Init only once
26609
26647
  this._initialized = true;
26610
26648
  // Set defaults
26611
- this.readOnly = toBoolean(this.readOnly, false); // read/write by default
26649
+ this.readOnly = toBoolean(this.readOnly, ((_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.config.readOnly) || false); // read/write by default
26612
26650
  this.inlineEdition = !this.readOnly && toBoolean(this.inlineEdition, false); // force to false when readonly
26613
26651
  this.saveBeforeDelete = toBoolean(this.saveBeforeDelete, !this.readOnly); // force to false when readonly
26614
26652
  this.saveBeforeSort = toBoolean(this.saveBeforeSort, !this.readOnly); // force to false when readonly
@@ -27774,23 +27812,25 @@
27774
27812
  var row;
27775
27813
  return __generator(this, function (_e) {
27776
27814
  switch (_e.label) {
27777
- case 0:
27778
- this.focusFirstColumn = true;
27779
- this.focusColumn = (opts === null || opts === void 0 ? void 0 : opts.focusColumn) || this.firstUserColumn;
27780
- return [4 /*yield*/, this._dataSource.createNew(insertAt, Object.assign({ editing: true }, opts))];
27815
+ case 0: return [4 /*yield*/, this._dataSource.createNew(insertAt, Object.assign({ editing: true }, opts))];
27781
27816
  case 1:
27782
27817
  row = _e.sent();
27783
27818
  if (!row)
27784
27819
  return [2 /*return*/, undefined];
27785
- // Emit start editing event
27786
27820
  if (row.editing) {
27821
+ // Update focused column
27822
+ this.focusFirstColumn = true;
27823
+ this.focusColumn = (opts === null || opts === void 0 ? void 0 : opts.focusColumn) || this.firstUserColumn;
27824
+ // Emit start editing event
27787
27825
  this.editedRow = row;
27788
27826
  this.onStartEditingRow.emit(this.editedRow);
27789
27827
  }
27790
27828
  this.totalRowCount++;
27791
27829
  this.visibleRowCount++;
27792
27830
  this.markAsDirty({ emitEvent: false /*markForCheck() is called just after*/ });
27793
- this.markForCheck();
27831
+ // Emit event
27832
+ if (!opts || opts.emitEvent !== false)
27833
+ this.markForCheck();
27794
27834
  return [2 /*return*/, row];
27795
27835
  }
27796
27836
  });