@tetacom/ng-components 1.0.7 → 1.0.8
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.
- package/esm2020/directive/only-number/only-number.directive.mjs +6 -3
- package/fesm2015/tetacom-ng-components.mjs +5 -2
- package/fesm2015/tetacom-ng-components.mjs.map +1 -1
- package/fesm2020/tetacom-ng-components.mjs +5 -2
- package/fesm2020/tetacom-ng-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2620,7 +2620,9 @@ class OnlyNumberDirective {
|
|
|
2620
2620
|
if (this.tetaOnlyNumber === false) {
|
|
2621
2621
|
return;
|
|
2622
2622
|
}
|
|
2623
|
-
|
|
2623
|
+
console.log(value);
|
|
2624
|
+
value = value.replace(',', '.').trim();
|
|
2625
|
+
console.log(value);
|
|
2624
2626
|
let regex = this._integerUnsigned;
|
|
2625
2627
|
if (!this.allowDecimals && !this.allowSign) {
|
|
2626
2628
|
regex = this._integerUnsigned;
|
|
@@ -2672,7 +2674,8 @@ class OnlyNumberDirective {
|
|
|
2672
2674
|
if (value === '-0.0') {
|
|
2673
2675
|
value = '0.0';
|
|
2674
2676
|
}
|
|
2675
|
-
const valid = new RegExp(regex).test(value);
|
|
2677
|
+
const valid = new RegExp(regex).test(value.toString());
|
|
2678
|
+
console.log(value, valid);
|
|
2676
2679
|
this._control.control.setValue(valid ? value : this._previousValue ?? 0);
|
|
2677
2680
|
}
|
|
2678
2681
|
}
|