import { FocusMonitor } from '@angular/cdk/a11y'; import { DoCheck, ElementRef, OnDestroy, OnInit } from '@angular/core'; import { ControlValueAccessor, FormBuilder, FormControl, FormGroup, FormGroupDirective, NgControl, NgForm, ValidatorFn } from '@angular/forms'; import { CanUpdateErrorState, CanUpdateErrorStateCtor, ErrorStateMatcher } from '@angular/material/core'; import { MatFormFieldControl } from '@angular/material/form-field'; import { KnoraDate, KnoraPeriod } from '@dasch-swiss/dsp-js'; import { GregorianCalendarDate, JulianCalendarDate } from 'jdnconvertiblecalendar'; import { Subject } from 'rxjs'; import { CalendarHeaderComponent } from '../calendar-header/calendar-header.component'; /** Error when invalid control is dirty, touched, or submitted. */ export declare class DateInputErrorStateMatcher implements ErrorStateMatcher { isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean; } /** If a period is defined, start and end date must have the same calendar */ export declare function sameCalendarValidator(isPeriod: FormControl, endDate: FormControl): ValidatorFn; /** If a period is defined, start date must be before end date */ export declare function periodStartEndValidator(isPeriod: FormControl, endDate: FormControl): ValidatorFn; declare class MatInputBase { _defaultErrorStateMatcher: ErrorStateMatcher; _parentForm: NgForm; _parentFormGroup: FormGroupDirective; ngControl: NgControl; constructor(_defaultErrorStateMatcher: ErrorStateMatcher, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, ngControl: NgControl); } declare const _MatInputMixinBase: CanUpdateErrorStateCtor & typeof MatInputBase; export declare class DateInputComponent extends _MatInputMixinBase implements ControlValueAccessor, MatFormFieldControl, DoCheck, CanUpdateErrorState, OnDestroy, OnInit { ngControl: NgControl; private _fm; private _elRef; static nextId: number; form: FormGroup; stateChanges: Subject; id: string; focused: boolean; errorState: boolean; controlType: string; matcher: DateInputErrorStateMatcher; calendarHeaderComponent: typeof CalendarHeaderComponent; startDateControl: FormControl; endDateControl: FormControl; isPeriodControl: FormControl; valueRequiredValidator: boolean; onChange: (_: any) => void; onTouched: () => void; get empty(): boolean; get shouldLabelFloat(): boolean; get required(): boolean; set required(req: boolean); private _required; get disabled(): boolean; set disabled(value: boolean); private _disabled; get placeholder(): string; set placeholder(plh: string); private _placeholder; describedBy: string; setDescribedByIds(ids: string[]): void; get value(): KnoraDate | KnoraPeriod | null; set value(date: KnoraDate | KnoraPeriod | null); /** * Given a `KnoraDate`, creates a Gregorian or Julian calendar date. * * @param date the given KnoraDate. */ createCalendarDate(date: KnoraDate): GregorianCalendarDate | JulianCalendarDate; errorStateMatcher: ErrorStateMatcher; constructor(fb: FormBuilder, ngControl: NgControl, _fm: FocusMonitor, _elRef: ElementRef, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, _defaultErrorStateMatcher: ErrorStateMatcher); ngOnInit(): void; ngDoCheck(): void; ngOnDestroy(): void; onContainerClick(event: MouseEvent): void; writeValue(date: KnoraDate | KnoraPeriod | null): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; _handleInput(): void; } export {};