@wolkabout/commons 0.1.7 → 0.1.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.
@@ -2604,14 +2604,17 @@ class LocalizedNumericInputDirective {
2604
2604
  input(value) {
2605
2605
  const val = this.parseValue(value);
2606
2606
  this.printValue(val);
2607
- this.onChange(val);
2607
+ this.onChange(val ? parseFloat(val) : null);
2608
+ }
2609
+ onBlur() {
2610
+ this.onTouched(null);
2608
2611
  }
2609
2612
  onFocus() {
2610
2613
  const previous = this.element.nativeElement.value;
2611
2614
  const value = this.parseValue(previous);
2612
2615
  this.printValue(value);
2613
2616
  if (this.element.nativeElement.value !== previous) {
2614
- this.onChange(value);
2617
+ this.onChange(value ? parseFloat(value) : null);
2615
2618
  }
2616
2619
  }
2617
2620
  writeValue(value) {
@@ -2675,7 +2678,7 @@ class LocalizedNumericInputDirective {
2675
2678
  return sign + parsedInt + (parsedDec || endsInDecMark ? '.' : '') + parsedDec;
2676
2679
  }
2677
2680
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LocalizedNumericInputDirective, deps: [{ token: i0.ElementRef }, { token: TenantPropertiesService }], target: i0.ɵɵFactoryTarget.Directive });
2678
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: LocalizedNumericInputDirective, isStandalone: true, selector: "input[wolkaboutLocalizedNumericInput]", host: { listeners: { "input": "input($event.target.value)", "focus": "onFocus()" } }, providers: [
2681
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: LocalizedNumericInputDirective, isStandalone: true, selector: "input[wolkaboutLocalizedNumericInput]", host: { listeners: { "input": "input($event.target.value)", "blur": "onBlur()", "focus": "onFocus()" } }, providers: [
2679
2682
  { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: LocalizedNumericInputDirective },
2680
2683
  {
2681
2684
  provide: NG_VALUE_ACCESSOR,
@@ -2700,6 +2703,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
2700
2703
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: TenantPropertiesService }], propDecorators: { input: [{
2701
2704
  type: HostListener,
2702
2705
  args: ['input', ['$event.target.value']]
2706
+ }], onBlur: [{
2707
+ type: HostListener,
2708
+ args: ['blur']
2703
2709
  }], onFocus: [{
2704
2710
  type: HostListener,
2705
2711
  args: ['focus']