@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.
@@ -821,12 +821,11 @@ function waitFor(predicate, opts) {
821
821
  }
822
822
  function waitForTrue(observable, opts) {
823
823
  return __awaiter(this, void 0, void 0, function* () {
824
- const firstTrueObservable = firstTrue(observable);
825
824
  // Timeout (+ dueTime)
826
825
  if (opts && opts.timeout > 0) {
827
826
  const $timeout = timer(opts.timeout);
828
827
  return merge(timer(opts.dueTime || 0)
829
- .pipe(switchMap(() => firstTrueObservable), takeUntil($timeout)), $timeout
828
+ .pipe(switchMap(() => firstTrue(observable)), takeUntil($timeout)), $timeout
830
829
  .pipe(map(() => {
831
830
  throw new Error(`Timeout ready() - after ${opts.timeout}ms`);
832
831
  })))
@@ -835,10 +834,10 @@ function waitForTrue(observable, opts) {
835
834
  // dueTime (without timeout)
836
835
  if (opts && opts.dueTime > 0) {
837
836
  return timer(opts.dueTime)
838
- .pipe(switchMap(() => firstTrueObservable))
837
+ .pipe(switchMap(() => firstTrue(observable)))
839
838
  .toPromise();
840
839
  }
841
- return firstTrueObservable.toPromise();
840
+ return firstTrue(observable).toPromise();
842
841
  });
843
842
  }
844
843
 
@@ -1375,14 +1374,14 @@ class MatAutocompleteField {
1375
1374
  // Wait a debounce time
1376
1375
  debounceTime(this.debounceTime)
1377
1376
  // DEBUG
1378
- , tap((value) => this.debug && console.debug(this.logPrefix + ' Search text changes:', value))),
1377
+ //,tap((value) => this.debug && console.debug(this.logPrefix + ' Search text changes:', value))
1378
+ ),
1379
1379
  // Object set: use it (no distinctUntilChanged() pipe need)
1380
1380
  this.formControl.valueChanges
1381
1381
  .pipe(startWith(this.formControl.value), filter(value => (isNotNil(value) && typeof value === 'object')), tap(value => {
1382
- var _a;
1383
1382
  // DEBUG
1384
- if (this.debug)
1385
- console.debug(this.logPrefix + ' control object changes:', value);
1383
+ //if (this.debug) console.debug(this.logPrefix + ' control object changes:', value);
1384
+ var _a;
1386
1385
  // Update the display value (if need)
1387
1386
  const displayValue = this.displayWith(value) || '';
1388
1387
  if (this.displayValue !== displayValue) {
@@ -10698,7 +10697,7 @@ class LocalSettingsService extends StartableService {
10698
10697
  }
10699
10698
  get usageMode() {
10700
10699
  var _a;
10701
- if (isNil((_a = this._data) === null || _a === void 0 ? void 0 : _a.mobile)) {
10700
+ if (isNil((_a = this._data) === null || _a === void 0 ? void 0 : _a.usageMode)) {
10702
10701
  console.warn("[settings] Accessing to property 'usageMode' BEFORE service started! Please use ready()");
10703
10702
  return isCordova(window) ? 'FIELD' : 'DESK';
10704
10703
  }
@@ -23013,7 +23012,7 @@ class AppTable {
23013
23012
  .then(() => this.editRowById(event, row.id, { focusColumn: this.lastUserColumn }));
23014
23013
  return true;
23015
23014
  }
23016
- // Edit next row
23015
+ // Edit previous row
23017
23016
  this.editRow(event, row, { focusColumn: this.lastUserColumn });
23018
23017
  return true;
23019
23018
  }
@@ -23036,8 +23035,7 @@ class AppTable {
23036
23035
  if (id < 0)
23037
23036
  return;
23038
23037
  if (id >= this.visibleRowCount) {
23039
- this.focusColumn = opts && opts.focusColumn || this.firstUserColumn;
23040
- this.addRow(event);
23038
+ this.addRow(event, undefined, opts);
23041
23039
  }
23042
23040
  else {
23043
23041
  const row = yield this.dataSource.getRow(id);
@@ -23110,7 +23108,7 @@ class AppTable {
23110
23108
  this.cancelExistingRow(event, row, opts);
23111
23109
  }
23112
23110
  }
23113
- addRow(event, insertAt) {
23111
+ addRow(event, insertAt, opts) {
23114
23112
  if (this.debug)
23115
23113
  console.debug('[table] Asking for new row...');
23116
23114
  if (!this._enabled)
@@ -23125,7 +23123,7 @@ class AppTable {
23125
23123
  return false;
23126
23124
  }
23127
23125
  // Add new row
23128
- this.addRowToTable(insertAt);
23126
+ this.addRowToTable(insertAt, opts);
23129
23127
  return true;
23130
23128
  }
23131
23129
  save(opts) {
@@ -23240,7 +23238,7 @@ class AppTable {
23240
23238
  * @param event
23241
23239
  * @param row
23242
23240
  * @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
23243
- * Use skipIfLoading=false to force deletion even if table is busy
23241
+ * And to force deletion even if table is busy
23244
23242
  */
23245
23243
  deleteRow(event, row, opts) {
23246
23244
  return __awaiter(this, void 0, void 0, function* () {
@@ -23253,7 +23251,7 @@ class AppTable {
23253
23251
  * @param event
23254
23252
  * @param rows
23255
23253
  * @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
23256
- * Use skipIfLoading=false to force deletion even if table is busy
23254
+ * And to force deletion even if table is busy
23257
23255
  */
23258
23256
  deleteRows(event, rows, opts) {
23259
23257
  var _a;
@@ -23266,8 +23264,8 @@ class AppTable {
23266
23264
  event === null || event === void 0 ? void 0 : event.preventDefault();
23267
23265
  if (!this._enabled || isEmptyArray(rows))
23268
23266
  return 0; // Skip is disabled, or no rows to delete
23269
- if (this.loading && (!opts || opts.skipIfLoading !== false)) {
23270
- console.warn('[app-table] Skip deleteRows() because table is busy (loading). Use opts.skipLoading = false to force deletion');
23267
+ if (this.loading && (!opts || opts.interactive !== false)) {
23268
+ console.warn('[app-table] Skip deleteRows() because table is busy (loading). Use opts.interactive = false to force deletion');
23271
23269
  return 0; // Skip if loading
23272
23270
  }
23273
23271
  // Make sure to keep newly created row
@@ -23790,9 +23788,10 @@ class AppTable {
23790
23788
  //if (this.debug) console.debug("[table] id = " + id);
23791
23789
  return id;
23792
23790
  }
23793
- addRowToTable(insertAt) {
23791
+ addRowToTable(insertAt, opts) {
23794
23792
  return __awaiter(this, void 0, void 0, function* () {
23795
23793
  this.focusFirstColumn = true;
23794
+ this.focusColumn = (opts === null || opts === void 0 ? void 0 : opts.focusColumn) || this.firstUserColumn;
23796
23795
  yield this._dataSource.asyncCreateNew(insertAt);
23797
23796
  this.editedRow = this._dataSource.getRow(-1);
23798
23797
  // Emit start editing event
@@ -24308,6 +24307,8 @@ class AppEditor {
24308
24307
  }
24309
24308
  ready(opts) {
24310
24309
  return __awaiter(this, void 0, void 0, function* () {
24310
+ if (this._$ready.value)
24311
+ return;
24311
24312
  return waitForTrue(this._$ready, opts);
24312
24313
  });
24313
24314
  }