/** Autogenerated by public2business schematic. DO NOT CHANGE! */ import { BooleanInput } from '@angular/cdk/coercion'; import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms'; import { TypeRef } from '@sbb-esta/angular-core/common-behaviors'; import { SbbDateAdapter, SbbDateFormats } from '@sbb-esta/angular-core/datetime'; import { SbbDatepicker } from '../datepicker/datepicker.component'; /** * An event used for date input and change events. We don't always have access to a native * input or change event because the event may have been triggered by the user clicking on the * calendar popup. For consistency, we always use SbbDateInputEvent instead. */ export declare class SbbDateInputEvent { /** Reference to the date input component that emitted the event. */ target: SbbDateInput; /** Reference to the native input element associated with the date input. */ targetElement: HTMLElement; /** The new value for the target date input. */ value: D | null; constructor( /** Reference to the date input component that emitted the event. */ target: SbbDateInput, /** Reference to the native input element associated with the date input. */ targetElement: HTMLElement); } export declare const SBB_DATE_VALUE_ACCESSOR: any; export declare const SBB_DATE_VALIDATORS: any; export declare class SbbDateInput implements ControlValueAccessor, Validator, OnInit, OnDestroy { private _elementRef; _dateAdapter: SbbDateAdapter; private _dateFormats; _datepicker: SbbDatepicker; /** Function that can be used to filter out dates within the datepicker. */ set dateFilter(value: (date: D | null) => boolean); get dateFilter(): (date: D | null) => boolean; private _dateFilter; /** The value of the input. */ get value(): D | null; set value(value: D | null); private _value; /** The minimum valid date. */ get min(): D | null; set min(value: D | null); private _min; /** The maximum valid date. */ get max(): D | null; set max(value: D | null); private _max; /** Whether the datepicker-input is disabled. */ get disabled(): boolean; set disabled(value: boolean); private _disabled; /** Emits when a `change` event is fired on this ``. */ readonly dateChange: EventEmitter>; /** Emits when an `input` event is fired on this ``. */ readonly dateInput: EventEmitter>; readonly inputBlurred: EventEmitter; /** Emits when the value changes (either due to user input or programmatic change). */ valueChange: EventEmitter; /** Emits when the disabled state has changed */ disabledChange: EventEmitter; private _datepickerSubscription; /** Whether the last value set on the input was valid. */ private _lastValueValid; /** `View -> model callback called when date input has been touched` */ _onTouched: () => void; /** `View -> model callback called when value changes` */ private _cvaOnChange; private _validatorOnChange; /** The form control validator for whether the input parses. */ private _parseValidator; /** The form control validator for the min date. */ private _minValidator; /** The form control validator for the max date. */ private _maxValidator; /** The form control validator for the date filter. */ private _filterValidator; /** The combined form control validator for this input. */ private _validator; constructor(_elementRef: ElementRef, _dateAdapter: SbbDateAdapter, _dateFormats: SbbDateFormats, _datepicker: SbbDatepicker); ngOnInit(): void; ngOnDestroy(): void; /** @docs-private */ registerOnValidatorChange(fn: () => void): void; /** @docs-private */ validate(c: AbstractControl): ValidationErrors | null; /** * Gets the element that the datepicker popup should be connected to. * @return The element to connect the popup to. */ getConnectedOverlayOrigin(): ElementRef; writeValue(value: D): void; registerOnChange(fn: (value: any) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; _onKeydown(event: TypeRef): void; _onInput(value: string): void; _onChange(): void; /** Handles blur events on the input. */ _onBlur(): void; /** Formats a value and sets it on the input element. */ private _formatValue; /** * @param obj The object to check. * @returns The given object if it is both a date instance and valid, otherwise null. */ private _getValidDateOrNull; static ngAcceptInputType_disabled: BooleanInput; }