import { Directionality } from '@angular/cdk/bidi'; import { Overlay, OverlayRef, ScrollStrategy } from '@angular/cdk/overlay'; import { AfterViewInit, ChangeDetectorRef, EventEmitter, InjectionToken, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'; import { DateAdapter } from '@koobiq/components/core'; import { Subject } from 'rxjs'; import { KbqCalendarCellCssClasses } from './calendar-body.component'; import { KbqCalendar } from './calendar.component'; import { KbqDatepickerInput } from './datepicker-input.directive'; import * as i0 from "@angular/core"; /** Injection token that determines the scroll handling while the calendar is open. */ export declare const KBQ_DATEPICKER_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>; /** @docs-private */ export declare function KBQ_DATEPICKER_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy; /** @docs-private */ export declare const KBQ_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER: { provide: InjectionToken<() => ScrollStrategy>; deps: (typeof Overlay)[]; useFactory: typeof KBQ_DATEPICKER_SCROLL_STRATEGY_FACTORY; }; /** * Component used as the content for the datepicker dialog and popup. We use this instead of using * KbqCalendar directly as the content so we can control the initial focus. This also gives us a * place to put additional features of the popup that are not part of the calendar itself in the * future. (e.g. confirmation buttons). * @docs-private */ export declare class KbqDatepickerContent implements OnDestroy, AfterViewInit { private changeDetectorRef; /** Emits when an animation has finished. */ readonly animationDone: Subject; /** Reference to the datepicker that created the overlay. */ datepicker: KbqDatepicker; /** Current state of the animation. */ animationState: 'enter' | 'void'; /** Reference to the internal calendar component. */ calendar: KbqCalendar; private subscriptions; constructor(changeDetectorRef: ChangeDetectorRef); ngAfterViewInit(): void; ngOnDestroy(): void; startExitAnimation(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "kbq-datepicker__content", ["kbqDatepickerContent"], {}, {}, never, never, true, never>; } /** Component responsible for managing the datepicker popup/dialog. */ export declare class KbqDatepicker implements OnDestroy { private overlay; private ngZone; private viewContainerRef; private readonly dateAdapter; private dir; protected readonly document: Document; get hasBackdrop(): boolean; set hasBackdrop(value: boolean); private _hasBackdrop; /** The date to open the calendar to initially. */ get startAt(): D | null; set startAt(value: D | null); private _startAt; /** Whether the datepicker pop-up should be disabled. */ get disabled(): boolean; set disabled(value: boolean); private _disabled; /** Whether the calendar is open. */ get opened(): boolean; set opened(value: boolean); private _opened; /** The currently selected date. */ get selected(): D | null; set selected(value: D | null); get dateFilter(): (date: D | null) => boolean; get value(): D | null; /** The minimum selectable date. */ minDate: D | null; /** The maximum selectable date. */ maxDate: D | null; /** * Emits selected year in multiyear view. * This doesn't imply a change on the selected date. */ readonly yearSelected: EventEmitter; /** * Emits selected month in year view. * This doesn't imply a change on the selected date. */ readonly monthSelected: EventEmitter; /** Classes to be passed to the date picker panel. Supports the same syntax as `ngClass`. */ panelClass: string | string[]; /** Function that can be used to add custom CSS classes to dates. */ dateClass: (date: D) => KbqCalendarCellCssClasses; backdropClass: string; /** Emits when the datepicker has been opened. */ readonly openedStream: EventEmitter; /** Emits when the datepicker has been closed. */ readonly closedStream: EventEmitter; readonly stateChanges: Subject; /** Emits when the datepicker is disabled. */ readonly disabledChange: Subject; /** Emits new selected date when selected date changes. */ readonly selectedChanged: Subject; /** The id for the datepicker calendar. */ id: string; /** A reference to the overlay when the calendar is opened as a popup. */ popupRef: OverlayRef | null; /** The input element this datepicker is associated with. */ datepickerInput: KbqDatepickerInput; private scrollStrategy; private validSelected; /** A portal containing the calendar for this datepicker. */ private calendarPortal; /** Reference to the component instantiated in popup mode. */ private popupComponentRef; /** The element that was focused before the datepicker was opened. */ private focusedElementBeforeOpen; /** Subscription to value changes in the associated input element. */ private inputSubscription; private closeSubscription; constructor(overlay: Overlay, ngZone: NgZone, viewContainerRef: ViewContainerRef, scrollStrategy: any, dateAdapter: DateAdapter, dir: Directionality); ngOnDestroy(): void; /** Selects the given date */ select(date: D): void; /** Emits the selected year in multiyear view */ selectYear(normalizedYear: D): void; /** Emits selected month in year view */ selectMonth(normalizedMonth: D): void; /** * Register an input with this datepicker. * @param input The datepicker input to register with this datepicker. */ registerInput(input: KbqDatepickerInput): void; /** Open the calendar. */ open(): void; /** Close the calendar. */ close(restoreFocus?: boolean): void; toggle(): void; /** Destroys the current overlay. */ private destroyOverlay; /** Open the calendar as a popup. */ private openAsPopup; /** Create the popup. */ private createPopup; private restoreFocus; private closingActions; /** Create the popup PositionStrategy. */ private createPopupPositionStrategy; static ɵfac: i0.ɵɵFactoryDeclaration, [null, null, null, null, { optional: true; }, { optional: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration, "kbq-datepicker", ["kbqDatepicker"], { "hasBackdrop": { "alias": "hasBackdrop"; "required": false; }; "startAt": { "alias": "startAt"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "opened": { "alias": "opened"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; "dateClass": { "alias": "dateClass"; "required": false; }; "backdropClass": { "alias": "backdropClass"; "required": false; }; }, { "yearSelected": "yearSelected"; "monthSelected": "monthSelected"; "openedStream": "opened"; "closedStream": "closed"; }, never, never, true, never>; }