@sumaris-net/ngx-components 1.23.0-rc6 → 1.23.1-rc2

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(opts.timeout))).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(opts.timeout))).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.timeout))).toPromise();
1083
+ }
1075
1084
  return firstNotNil(obs).toPromise();
1076
1085
  }
1077
1086
  function chainPromises(defers) {
@@ -26632,11 +26641,12 @@
26632
26641
  });
26633
26642
  AppTable.prototype.ngOnInit = function () {
26634
26643
  var _this = this;
26644
+ var _a;
26635
26645
  if (this._initialized)
26636
26646
  return; // Init only once
26637
26647
  this._initialized = true;
26638
26648
  // Set defaults
26639
- 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
26640
26650
  this.inlineEdition = !this.readOnly && toBoolean(this.inlineEdition, false); // force to false when readonly
26641
26651
  this.saveBeforeDelete = toBoolean(this.saveBeforeDelete, !this.readOnly); // force to false when readonly
26642
26652
  this.saveBeforeSort = toBoolean(this.saveBeforeSort, !this.readOnly); // force to false when readonly
@@ -27802,23 +27812,25 @@
27802
27812
  var row;
27803
27813
  return __generator(this, function (_e) {
27804
27814
  switch (_e.label) {
27805
- case 0:
27806
- this.focusFirstColumn = true;
27807
- this.focusColumn = (opts === null || opts === void 0 ? void 0 : opts.focusColumn) || this.firstUserColumn;
27808
- 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))];
27809
27816
  case 1:
27810
27817
  row = _e.sent();
27811
27818
  if (!row)
27812
27819
  return [2 /*return*/, undefined];
27813
- // Emit start editing event
27814
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
27815
27825
  this.editedRow = row;
27816
27826
  this.onStartEditingRow.emit(this.editedRow);
27817
27827
  }
27818
27828
  this.totalRowCount++;
27819
27829
  this.visibleRowCount++;
27820
27830
  this.markAsDirty({ emitEvent: false /*markForCheck() is called just after*/ });
27821
- this.markForCheck();
27831
+ // Emit event
27832
+ if (!opts || opts.emitEvent !== false)
27833
+ this.markForCheck();
27822
27834
  return [2 /*return*/, row];
27823
27835
  }
27824
27836
  });