@tetacom/ng-components 1.0.77 → 1.0.80

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.
@@ -2826,7 +2826,6 @@ class OnlyNumberDirective {
2826
2826
  }
2827
2827
  }
2828
2828
  validateValue(value) {
2829
- var _a;
2830
2829
  if (this.tetaOnlyNumber === false) {
2831
2830
  return;
2832
2831
  }
@@ -2882,8 +2881,13 @@ class OnlyNumberDirective {
2882
2881
  if (value === '-0.0') {
2883
2882
  value = '0.0';
2884
2883
  }
2884
+ if (value === null || value === undefined || value === '') {
2885
+ return;
2886
+ }
2885
2887
  const valid = new RegExp(regex).test(value.toString());
2886
- this._control.control.setValue(valid ? parseFloat(value) : (_a = parseFloat(this._previousValue)) !== null && _a !== void 0 ? _a : 0);
2888
+ if (value.toString() !== parseFloat(value).toString()) {
2889
+ this._control.control.patchValue(parseFloat(value));
2890
+ }
2887
2891
  }
2888
2892
  }
2889
2893
  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 });