UNPKG

@hxui/angular

Version:

* * *

88 lines (87 loc) 3.46 kB
import { OnInit, ElementRef, EventEmitter, OnDestroy, NgZone, ComponentFactoryResolver, ViewContainerRef } from '@angular/core'; import { ControlValueAccessor, Validator, AbstractControl } from '@angular/forms'; import { Overlay, OverlayRef, ScrollDispatcher } from '@angular/cdk/overlay'; import { DatepickerComponent } from './datepicker.component'; import { Directionality } from '@angular/cdk/bidi'; import { DatepickerConfig } from './datepicker.config'; export declare class DatepickerFormComponent implements OnInit, ControlValueAccessor, Validator, OnDestroy { private _elementRef; private _viewContainerRef; overlay: Overlay; private _ngZone; private _scrollDispatcher; private _componentFactoryResolver; private _config; private _dir; _overlayRef: OverlayRef | null; _calendarInstance: DatepickerComponent | null; private _portal; private readonly _destroyed; disabled: boolean; readonly: boolean; required: boolean; defaultToPresentDate: boolean; allowPreviousDates: boolean; allowFutureDates: boolean; dateFormat: string; placeholder: string; helpText: string; icon: string; iconPlacement: string; placement: 'top' | 'bottom' | 'left' | 'right'; showDelay: number; hideDelay: number; from: string; to: string; interval: boolean; dueDateInterval: string; onDateChange: EventEmitter<Date>; date: Date; visible: boolean; presentDate: Date; isValid: boolean; dateValidators: ((date: Date) => boolean)[]; private onChanged; private onTouched; private validateDateRange; private _elementHtmlRef; private _elementHtmlCollection; constructor(_elementRef: ElementRef, _viewContainerRef: ViewContainerRef, overlay: Overlay, _ngZone: NgZone, _scrollDispatcher: ScrollDispatcher, _componentFactoryResolver: ComponentFactoryResolver, _config: DatepickerConfig, _dir: Directionality); /** * Dispose the tooltip when destroyed. */ ngOnDestroy(): void; ngOnInit(): void; setDate(date: Date): void; onDateSelectEvent: (inputDate: Date) => void; onChange(inputDate: string): void; onFocus(): void; onTab(inputDate: string): void; parseDate(inputDate: string): Date; validateIsNotBeforeDate(date: Date): boolean; validateIsNotAfterDate(date: Date): boolean; createDateRangeValidator(from: Date, to: Date): (date: Date) => boolean; writeValue(value: Date): void; registerOnChange(fn: (value: Date) => void): void; registerOnTouched(fn: () => void): void; propogateTouched(): void; propogateChange(value: any): void; validate(control: AbstractControl): { [key: string]: any; }; private _show; private _hide; private _createOverlay; private _updatePosition; /** * Returns the origin position and a fallback position based on the user's position preference. * The fallback position is the inverse of the origin (e.g. `'bottom' -> 'top'`). */ private _getOrigin; /** Returns the overlay position and a fallback position based on the user's preference */ private _getOverlayPosition; private _invertPosition; private _detach; /** Updates the tooltip content and repositions the overlay according to the new content length */ private _updateTooltipContent; }