@sumaris-net/ngx-components 1.3.6 → 1.3.10

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.
@@ -1488,7 +1488,7 @@
1488
1488
  }
1489
1489
  }
1490
1490
  })),
1491
- // Merge some observables, with a common distinctUntilChanged() pipe
1491
+ // Merge some observables, with a common distinctUntilChanged() pipe, and NO debounceTime
1492
1492
  rxjs.merge(
1493
1493
  // Focus or click => Load all
1494
1494
  rxjs.merge(this.onFocus, this.onClick)
@@ -1497,7 +1497,11 @@
1497
1497
  this.onDropButtonClick
1498
1498
  .pipe(operators.filter(function (event) { return _this.searchable && (!event || !event.defaultPrevented) && _this.formControl.enabled; }), operators.map(function (_) { return _this.showAllOnFocus ? '*' : _this.formControl.value; })), rxjs.merge(this.$inputItems, this._filter$)
1499
1499
  .pipe(operators.map(function (_) { return _this.searchable && _this.formControl.value; })))
1500
- .pipe(operators.distinctUntilChanged()))
1500
+ .pipe(
1501
+ // If value is a string (and is not = '*'), filter if not enough character
1502
+ operators.filter(function (value) { return value === '*' || !(typeof value === 'string') || value.length >= _this.suggestLengthThreshold; }),
1503
+ // Distinguish changes
1504
+ operators.distinctUntilChanged()))
1501
1505
  .pipe(
1502
1506
  // DEBUG
1503
1507
  //tap(value => console.debug(this.logPrefix + ' Received update event: ', value)),
@@ -19484,12 +19488,11 @@
19484
19488
  console.warn('[form] Trying to set an empty value to form. Skipping');
19485
19489
  return;
19486
19490
  }
19487
- if (this.debug)
19488
- console.debug('[form] Updating form (using entity)', data);
19491
+ // DEBUG
19492
+ //if (this.debug) console.debug('[form] Updating form (using entity)', data);
19489
19493
  // Convert object to json, then apply it to form (e.g. convert 'undefined' into 'null')
19490
- AppFormUtils.copyEntity2Form(data, this.form, opts);
19491
- if (!opts || opts.emitEvent !== false) {
19492
- this.markAsLoaded({ emitEvent: false });
19494
+ AppFormUtils.copyEntity2Form(data, this.form, Object.assign({ emitEvent: false, onlySelf: true }, opts));
19495
+ if (!opts || opts.emitEvent !== true) {
19493
19496
  this.markForCheck();
19494
19497
  }
19495
19498
  };
@@ -24927,7 +24930,8 @@
24927
24930
  }
24928
24931
  this.markAsLoading();
24929
24932
  this.openRow(row.currentData.id, row)
24930
- .then(function () { return _this.markAsLoaded(); });
24933
+ .then(function () { return _this.markAsLoaded(); })
24934
+ .catch(function () { return _this.markAsLoaded(); });
24931
24935
  return true;
24932
24936
  }
24933
24937
  // Start editing row