@paperless/angular 2.0.1-beta.95 → 2.0.1-beta.96

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.
@@ -476,15 +476,17 @@ class RadioDirective extends BaseValueAccessor {
476
476
  .subscribe((value) => this.writeValue(value));
477
477
  }
478
478
  writeValue(value) {
479
+ const elValue = this._getValue();
479
480
  this._modelValue = value;
480
481
  this.el.nativeElement.checked =
481
- this._modelValue === this.el.nativeElement.value;
482
+ this._modelValue === elValue;
482
483
  }
483
484
  handleChangeEvent() {
485
+ const elValue = this._getValue();
484
486
  this._modelValue =
485
- this._modelValue === this.el.nativeElement.value
487
+ this._modelValue === elValue
486
488
  ? undefined
487
- : this.el.nativeElement.value;
489
+ : elValue;
488
490
  this.onChange(this._modelValue);
489
491
  }
490
492
  ngOnDestroy() {
@@ -492,6 +494,16 @@ class RadioDirective extends BaseValueAccessor {
492
494
  this._valueChanges.unsubscribe();
493
495
  }
494
496
  }
497
+ _getValue() {
498
+ let value = this.el.nativeElement.value;
499
+ if (value === 'true') {
500
+ value = true;
501
+ }
502
+ if (value === 'false') {
503
+ value = false;
504
+ }
505
+ return value;
506
+ }
495
507
  }
496
508
  RadioDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RadioDirective, deps: [{ token: i1.NgControl, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
497
509
  RadioDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RadioDirective, selector: "p-radio", host: { listeners: { "checkedChange": "handleChangeEvent($event.detail)" } }, usesInheritance: true, ngImport: i0 });