@sumaris-net/ngx-components 1.20.20 → 1.20.21

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.
@@ -5476,8 +5476,8 @@
5476
5476
  return;
5477
5477
  var value = (typeof obj === 'string') ? parseFloat(obj.replace(/,/g, '.')) : obj;
5478
5478
  this._writing = true;
5479
- var strValue = this._formatFn(this.value, Object.assign(Object.assign({}, this._formatOptions), { placeholderChar: this.placeholderChar }));
5480
- var sign = isNotNil(this.value) ? (value < 0 ? -1 : 1) :
5479
+ var strValue = this._formatFn(value, Object.assign(Object.assign({}, this._formatOptions), { placeholderChar: this.placeholderChar }));
5480
+ var sign = isNotNil(value) ? (value < 0 ? -1 : 1) :
5481
5481
  // Use default sign, if any
5482
5482
  (this.defaultSign ? (this.defaultSign === '-' ? -1 : 1) : null);
5483
5483
  // DEBUG
@@ -5520,7 +5520,8 @@
5520
5520
  MatLatLongField.prototype._onFocus = function (event) {
5521
5521
  var _this = this;
5522
5522
  // Apply the default sign, when pattern is DD and field is empty
5523
- if (isNil(this.value)) {
5523
+ var value = this.formControl.value;
5524
+ if (isNilOrNaN(value)) {
5524
5525
  if (this.defaultSign) {
5525
5526
  // Compute the text value, using the default sign
5526
5527
  var defaultSign = this.defaultSign === '-' ? -1 : 1;
@@ -5550,8 +5551,9 @@
5550
5551
  return true;
5551
5552
  };
5552
5553
  MatLatLongField.prototype._onBlur = function (event) {
5554
+ var _a;
5553
5555
  var touched = this.checkIfTouched();
5554
- if (touched && isNil(this.value)) {
5556
+ if (touched && isNil((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value)) {
5555
5557
  this.inputElement.nativeElement.value = '';
5556
5558
  }
5557
5559
  this.onBlur.emit(event);
@@ -5653,7 +5655,7 @@
5653
5655
  this.formControl.patchValue(value, { emitEvent: false });
5654
5656
  this._writing = false;
5655
5657
  this.markForCheck();
5656
- this._onChangeCallback(this.value);
5658
+ this._onChangeCallback(value);
5657
5659
  };
5658
5660
  MatLatLongField.prototype.checkIfTouched = function () {
5659
5661
  if (this.formControl.touched || this.textFormControl.touched) {