-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(angular): use event.detail instead of event.target.value
- Loading branch information
hirsch
committed
Sep 13, 2021
1 parent
602e310
commit 4709780
Showing
12 changed files
with
117 additions
and
150 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
packages/components-angular/src/directives/boolean-value-accessor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import { Directive, ElementRef } from '@angular/core'; | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
import { Directive, ElementRef } from '@angular/core' | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms' | ||
|
||
import { ValueAccessor } from './value-accessor'; | ||
import { ValueAccessor } from './value-accessor' | ||
|
||
@Directive({ | ||
/* tslint:disable-next-line:directive-selector */ | ||
selector: 'bal-checkbox', | ||
host: { | ||
'(balChange)': 'handleChangeEvent($event.target.checked)' | ||
'(balChange)': 'handleChangeEvent($event.detail)', | ||
}, | ||
providers: [ | ||
{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: BooleanValueAccessor, | ||
multi: true | ||
} | ||
] | ||
multi: true, | ||
}, | ||
], | ||
}) | ||
export class BooleanValueAccessor extends ValueAccessor { | ||
constructor(el: ElementRef) { | ||
super(el); | ||
super(el) | ||
} | ||
writeValue(value: any) { | ||
this.el.nativeElement.checked = this.lastValue = value == null ? false : value; | ||
this.el.nativeElement.checked = this.lastValue = value == null ? false : value | ||
} | ||
} |
16 changes: 8 additions & 8 deletions
16
packages/components-angular/src/directives/select-value-accessor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import { Directive, ElementRef } from '@angular/core'; | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
import { Directive, ElementRef } from '@angular/core' | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms' | ||
|
||
import { ValueAccessor } from './value-accessor'; | ||
import { ValueAccessor } from './value-accessor' | ||
|
||
@Directive({ | ||
/* tslint:disable-next-line:directive-selector */ | ||
selector: 'bal-radio-group, bal-select, bal-datepicker, bal-timeinput', | ||
host: { | ||
'(balChange)': 'handleChangeEvent($event.target.value)' | ||
'(balChange)': 'handleChangeEvent($event.detail)', | ||
}, | ||
providers: [ | ||
{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: SelectValueAccessor, | ||
multi: true | ||
} | ||
] | ||
multi: true, | ||
}, | ||
], | ||
}) | ||
export class SelectValueAccessor extends ValueAccessor { | ||
constructor(el: ElementRef) { | ||
super(el); | ||
super(el) | ||
} | ||
} |
16 changes: 8 additions & 8 deletions
16
packages/components-angular/src/directives/text-value-accessor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import { Directive, ElementRef } from '@angular/core'; | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
import { Directive, ElementRef } from '@angular/core' | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms' | ||
|
||
import { ValueAccessor } from './value-accessor'; | ||
import { ValueAccessor } from './value-accessor' | ||
|
||
@Directive({ | ||
/* tslint:disable-next-line:directive-selector */ | ||
selector: 'bal-input, bal-textarea, bal-slider', | ||
host: { | ||
'(balInput)': 'handleChangeEvent($event.target.value)' | ||
'(balInput)': 'handleChangeEvent($event.detail)', | ||
}, | ||
providers: [ | ||
{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: TextValueAccessor, | ||
multi: true | ||
} | ||
] | ||
multi: true, | ||
}, | ||
], | ||
}) | ||
export class TextValueAccessor extends ValueAccessor { | ||
constructor(el: ElementRef) { | ||
super(el); | ||
super(el) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.