@sumaris-net/ngx-components 1.4.4 → 1.4.6

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.
@@ -1486,9 +1486,10 @@
1486
1486
  // Filter if not enough character
1487
1487
  operators.filter(function (value) { return value.length >= _this.suggestLengthThreshold; }),
1488
1488
  // Wait a debounce time
1489
- operators.debounceTime(this.debounceTime),
1489
+ operators.debounceTime(this.debounceTime)
1490
1490
  // DEBUG
1491
- operators.tap(function (value) { return console.debug(_this.logPrefix + ' Search text changes:', value); })),
1491
+ //tap((value) => console.debug(this.logPrefix + ' Search text changes:', value)),
1492
+ ),
1492
1493
  // Object set: use it (no distinctUntilChanged() pipe need)
1493
1494
  this.formControl.valueChanges
1494
1495
  .pipe(operators.startWith(this.formControl.value), operators.filter(function (value) { return (_this.searchable && isNotNil(value) && typeof value === 'object'); }), operators.tap(function (value) {
@@ -1503,9 +1504,10 @@
1503
1504
  _this.matInputText.nativeElement.value = _this.displayValue;
1504
1505
  }
1505
1506
  }
1506
- }),
1507
+ })
1507
1508
  // DEBUG
1508
- operators.tap(function (value) { return console.debug(_this.logPrefix + ' Received an object value: ', value); })),
1509
+ //tap(value => console.debug(this.logPrefix + ' Received an object value: ', value))
1510
+ ),
1509
1511
  // Merge some observables, with a common distinctUntilChanged() pipe, and NO debounceTime
1510
1512
  rxjs.merge(
1511
1513
  // Focus or click => Load all
@@ -1514,16 +1516,12 @@
1514
1516
  // On dropdown button click
1515
1517
  this.onDropButtonClick
1516
1518
  .pipe(operators.filter(function (event) { return _this.enabled && _this.searchable && (!event || !event.defaultPrevented); }), operators.map(function (_) { return _this.showAllOnFocus ? '*' : _this.formControl.value; })), rxjs.merge(this.$inputItems, this._filter$)
1517
- .pipe(operators.filter(function (event) { return _this.enabled && _this.searchable; }), operators.map(function (_) { return _this.formControl.value; }),
1518
- // DEBUG
1519
- operators.tap(function (value) { return console.debug(_this.logPrefix + ' Received $inputItems or filter event: ', value); })))
1519
+ .pipe(operators.filter(function (event) { return _this.enabled && _this.searchable; }), operators.map(function (_) { return _this.formControl.value; })))
1520
1520
  .pipe(
1521
1521
  // If value is a string (and is not = '*'), filter if not enough character
1522
1522
  operators.filter(function (value) { return value === '*' || !(typeof value === 'string') || value.length >= _this.suggestLengthThreshold; }),
1523
1523
  // Distinguish changes
1524
- operators.distinctUntilChanged(),
1525
- // DEBUG
1526
- operators.tap(function (value) { return console.debug(_this.logPrefix + ' Received update event: ', value); })))
1524
+ operators.distinctUntilChanged()))
1527
1525
  .pipe(
1528
1526
  // Suggest values
1529
1527
  operators.mergeMap(function (value) { return _this.suggest(value, _this.filter); }),
@@ -1687,7 +1685,7 @@
1687
1685
  // If combo is empty, or if has content but should force to show panel on focus
1688
1686
  if (!hasContent || (this.showPanelOnFocus && this.showAllOnFocus)) {
1689
1687
  // DEBUG
1690
- console.debug(this.logPrefix + ' Emit focus event');
1688
+ //console.debug(this.logPrefix + ' Emit focus event');
1691
1689
  this.onFocus.emit(event);
1692
1690
  return true;
1693
1691
  }
@@ -13229,6 +13227,9 @@
13229
13227
  console.warn("[entities-storage] Persisting " + entityName + ": store not found!");
13230
13228
  return;
13231
13229
  }
13230
+ if (!entityStore.dirty)
13231
+ return;
13232
+ // Persist store
13232
13233
  return entityStore.persist()
13233
13234
  .then(function (count) {
13234
13235
  // If no entity found, remove from the entity names array