RED-5445: emit event when date picker is opened/closed
This commit is contained in:
parent
d9a92992c3
commit
cdfd0b59b4
@ -14,7 +14,7 @@
|
||||
<mat-datepicker-toggle [for]="picker" matSuffix>
|
||||
<mat-icon matDatepickerToggleIcon svgIcon="red:calendar"></mat-icon>
|
||||
</mat-datepicker-toggle>
|
||||
<mat-datepicker #picker></mat-datepicker>
|
||||
<mat-datepicker #picker (closed)="onCloseDatepicker()" (opened)="onOpenDatepicker()"></mat-datepicker>
|
||||
</ng-container>
|
||||
|
||||
<input
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
import { FormFieldComponent } from '../form-field/form-field-component.directive';
|
||||
|
||||
@ -46,6 +46,8 @@ export class DynamicInputComponent extends FormFieldComponent<DynamicInput> {
|
||||
|
||||
@Input() input!: DynamicInput;
|
||||
|
||||
@Output() closedDatepicker = new EventEmitter<boolean>();
|
||||
|
||||
get isDate() {
|
||||
return this.type === InputTypes.DATE;
|
||||
}
|
||||
@ -61,4 +63,12 @@ export class DynamicInputComponent extends FormFieldComponent<DynamicInput> {
|
||||
writeValue(input: DynamicInput): void {
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
onCloseDatepicker() {
|
||||
this.closedDatepicker.emit(true);
|
||||
}
|
||||
|
||||
onOpenDatepicker() {
|
||||
this.closedDatepicker.emit(false);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user