@tetacom/ng-components 1.0.78 → 1.0.81

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.
@@ -2861,8 +2861,13 @@ class OnlyNumberDirective {
2861
2861
  if (value === '-0.0') {
2862
2862
  value = '0.0';
2863
2863
  }
2864
+ if (value === null || value === undefined || value === '') {
2865
+ return;
2866
+ }
2864
2867
  const valid = new RegExp(regex).test(value.toString());
2865
- this._control.control.setValue(valid ? parseFloat(value) : parseFloat(this._previousValue) ?? 0);
2868
+ if (value.toString() !== parseFloat(value).toString()) {
2869
+ this._control.control.patchValue(parseFloat(value));
2870
+ }
2866
2871
  }
2867
2872
  }
2868
2873
  OnlyNumberDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: OnlyNumberDirective, deps: [{ token: i0.ElementRef }, { token: i3.NgControl }], target: i0.ɵɵFactoryTarget.Directive });