|
|
@ -4,10 +4,9 @@ import { CommonModule } from '@angular/common'; |
|
|
import { |
|
|
import { |
|
|
ChangeDetectionStrategy, |
|
|
ChangeDetectionStrategy, |
|
|
Component, |
|
|
Component, |
|
|
EventEmitter, |
|
|
|
|
|
Input, |
|
|
Input, |
|
|
OnChanges, |
|
|
OnChanges, |
|
|
Output |
|
|
output |
|
|
} from '@angular/core'; |
|
|
} from '@angular/core'; |
|
|
import { FormControl, ReactiveFormsModule } from '@angular/forms'; |
|
|
import { FormControl, ReactiveFormsModule } from '@angular/forms'; |
|
|
import { MatRadioModule } from '@angular/material/radio'; |
|
|
import { MatRadioModule } from '@angular/material/radio'; |
|
|
@ -24,10 +23,10 @@ export class GfToggleComponent implements OnChanges { |
|
|
@Input() isLoading: boolean; |
|
|
@Input() isLoading: boolean; |
|
|
@Input() options: ToggleOption[] = []; |
|
|
@Input() options: ToggleOption[] = []; |
|
|
|
|
|
|
|
|
@Output() valueChange = new EventEmitter<Pick<ToggleOption, 'value'>>(); |
|
|
|
|
|
|
|
|
|
|
|
public optionFormControl = new FormControl<string | null>(null); |
|
|
public optionFormControl = new FormControl<string | null>(null); |
|
|
|
|
|
|
|
|
|
|
|
protected readonly valueChange = output<Pick<ToggleOption, 'value'>>(); |
|
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
public ngOnChanges() { |
|
|
this.optionFormControl.setValue(this.defaultValue); |
|
|
this.optionFormControl.setValue(this.defaultValue); |
|
|
} |
|
|
} |
|
|
|