@sumaris-net/ngx-components 1.20.33 → 1.20.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.
@@ -1092,14 +1092,13 @@
1092
1092
  }
1093
1093
  function waitForTrue(observable, opts) {
1094
1094
  return __awaiter(this, void 0, void 0, function () {
1095
- var firstTrueObservable, $timeout;
1095
+ var $timeout;
1096
1096
  return __generator(this, function (_a) {
1097
- firstTrueObservable = firstTrue(observable);
1098
1097
  // Timeout (+ dueTime)
1099
1098
  if (opts && opts.timeout > 0) {
1100
1099
  $timeout = rxjs.timer(opts.timeout);
1101
1100
  return [2 /*return*/, rxjs.merge(rxjs.timer(opts.dueTime || 0)
1102
- .pipe(operators.switchMap(function () { return firstTrueObservable; }), operators.takeUntil($timeout)), $timeout
1101
+ .pipe(operators.switchMap(function () { return firstTrue(observable); }), operators.takeUntil($timeout)), $timeout
1103
1102
  .pipe(operators.map(function () {
1104
1103
  throw new Error("Timeout ready() - after " + opts.timeout + "ms");
1105
1104
  })))
@@ -1108,10 +1107,10 @@
1108
1107
  // dueTime (without timeout)
1109
1108
  if (opts && opts.dueTime > 0) {
1110
1109
  return [2 /*return*/, rxjs.timer(opts.dueTime)
1111
- .pipe(operators.switchMap(function () { return firstTrueObservable; }))
1110
+ .pipe(operators.switchMap(function () { return firstTrue(observable); }))
1112
1111
  .toPromise()];
1113
1112
  }
1114
- return [2 /*return*/, firstTrueObservable.toPromise()];
1113
+ return [2 /*return*/, firstTrue(observable).toPromise()];
1115
1114
  });
1116
1115
  });
1117
1116
  }
@@ -1712,14 +1711,14 @@
1712
1711
  // Wait a debounce time
1713
1712
  operators.debounceTime(this.debounceTime)
1714
1713
  // DEBUG
1715
- , operators.tap(function (value) { return _this.debug && console.debug(_this.logPrefix + ' Search text changes:', value); })),
1714
+ //,tap((value) => this.debug && console.debug(this.logPrefix + ' Search text changes:', value))
1715
+ ),
1716
1716
  // Object set: use it (no distinctUntilChanged() pipe need)
1717
1717
  this.formControl.valueChanges
1718
1718
  .pipe(operators.startWith(this.formControl.value), operators.filter(function (value) { return (isNotNil(value) && typeof value === 'object'); }), operators.tap(function (value) {
1719
- var _a;
1720
1719
  // DEBUG
1721
- if (_this.debug)
1722
- console.debug(_this.logPrefix + ' control object changes:', value);
1720
+ //if (this.debug) console.debug(this.logPrefix + ' control object changes:', value);
1721
+ var _a;
1723
1722
  // Update the display value (if need)
1724
1723
  var displayValue = _this.displayWith(value) || '';
1725
1724
  if (_this.displayValue !== displayValue) {
@@ -12024,7 +12023,7 @@
12024
12023
  Object.defineProperty(LocalSettingsService.prototype, "usageMode", {
12025
12024
  get: function () {
12026
12025
  var _a;
12027
- if (isNil((_a = this._data) === null || _a === void 0 ? void 0 : _a.mobile)) {
12026
+ if (isNil((_a = this._data) === null || _a === void 0 ? void 0 : _a.usageMode)) {
12028
12027
  console.warn("[settings] Accessing to property 'usageMode' BEFORE service started! Please use ready()");
12029
12028
  return isCordova(window) ? 'FIELD' : 'DESK';
12030
12029
  }
@@ -26600,7 +26599,7 @@
26600
26599
  .then(function () { return _this.editRowById(event, row.id, { focusColumn: _this.lastUserColumn }); });
26601
26600
  return true;
26602
26601
  }
26603
- // Edit next row
26602
+ // Edit previous row
26604
26603
  this.editRow(event, row, { focusColumn: this.lastUserColumn });
26605
26604
  return true;
26606
26605
  };
@@ -26628,8 +26627,7 @@
26628
26627
  if (id < 0)
26629
26628
  return [2 /*return*/];
26630
26629
  if (!(id >= this.visibleRowCount)) return [3 /*break*/, 1];
26631
- this.focusColumn = opts && opts.focusColumn || this.firstUserColumn;
26632
- this.addRow(event);
26630
+ this.addRow(event, undefined, opts);
26633
26631
  return [3 /*break*/, 3];
26634
26632
  case 1: return [4 /*yield*/, this.dataSource.getRow(id)];
26635
26633
  case 2:
@@ -26707,7 +26705,7 @@
26707
26705
  this.cancelExistingRow(event, row, opts);
26708
26706
  }
26709
26707
  };
26710
- AppTable.prototype.addRow = function (event, insertAt) {
26708
+ AppTable.prototype.addRow = function (event, insertAt, opts) {
26711
26709
  if (this.debug)
26712
26710
  console.debug('[table] Asking for new row...');
26713
26711
  if (!this._enabled)
@@ -26722,7 +26720,7 @@
26722
26720
  return false;
26723
26721
  }
26724
26722
  // Add new row
26725
- this.addRowToTable(insertAt);
26723
+ this.addRowToTable(insertAt, opts);
26726
26724
  return true;
26727
26725
  };
26728
26726
  AppTable.prototype.save = function (opts) {
@@ -26867,7 +26865,7 @@
26867
26865
  * @param event
26868
26866
  * @param row
26869
26867
  * @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
26870
- * Use skipIfLoading=false to force deletion even if table is busy
26868
+ * And to force deletion even if table is busy
26871
26869
  */
26872
26870
  AppTable.prototype.deleteRow = function (event, row, opts) {
26873
26871
  return __awaiter(this, void 0, void 0, function () {
@@ -26887,7 +26885,7 @@
26887
26885
  * @param event
26888
26886
  * @param rows
26889
26887
  * @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
26890
- * Use skipIfLoading=false to force deletion even if table is busy
26888
+ * And to force deletion even if table is busy
26891
26889
  */
26892
26890
  AppTable.prototype.deleteRows = function (event, rows, opts) {
26893
26891
  var _a;
@@ -26905,8 +26903,8 @@
26905
26903
  event === null || event === void 0 ? void 0 : event.preventDefault();
26906
26904
  if (!this._enabled || isEmptyArray(rows))
26907
26905
  return [2 /*return*/, 0]; // Skip is disabled, or no rows to delete
26908
- if (this.loading && (!opts || opts.skipIfLoading !== false)) {
26909
- console.warn('[app-table] Skip deleteRows() because table is busy (loading). Use opts.skipLoading = false to force deletion');
26906
+ if (this.loading && (!opts || opts.interactive !== false)) {
26907
+ console.warn('[app-table] Skip deleteRows() because table is busy (loading). Use opts.interactive = false to force deletion');
26910
26908
  return [2 /*return*/, 0]; // Skip if loading
26911
26909
  }
26912
26910
  // Make sure to keep newly created row
@@ -27545,12 +27543,13 @@
27545
27543
  //if (this.debug) console.debug("[table] id = " + id);
27546
27544
  return id;
27547
27545
  };
27548
- AppTable.prototype.addRowToTable = function (insertAt) {
27546
+ AppTable.prototype.addRowToTable = function (insertAt, opts) {
27549
27547
  return __awaiter(this, void 0, void 0, function () {
27550
27548
  return __generator(this, function (_e) {
27551
27549
  switch (_e.label) {
27552
27550
  case 0:
27553
27551
  this.focusFirstColumn = true;
27552
+ this.focusColumn = (opts === null || opts === void 0 ? void 0 : opts.focusColumn) || this.firstUserColumn;
27554
27553
  return [4 /*yield*/, this._dataSource.asyncCreateNew(insertAt)];
27555
27554
  case 1:
27556
27555
  _e.sent();
@@ -28151,6 +28150,8 @@
28151
28150
  AppEditor.prototype.ready = function (opts) {
28152
28151
  return __awaiter(this, void 0, void 0, function () {
28153
28152
  return __generator(this, function (_b) {
28153
+ if (this._$ready.value)
28154
+ return [2 /*return*/];
28154
28155
  return [2 /*return*/, waitForTrue(this._$ready, opts)];
28155
28156
  });
28156
28157
  });