import { SimpleChanges, ChangeDetectorRef, EventEmitter, AfterContentInit, AfterViewChecked, OnDestroy, OnChanges } from '@angular/core'; import { HcDatepickerIntl } from '../datepicker-intl'; import { Portal, ComponentType } from '@angular/cdk/portal'; import { HcDateFormats, D } from '../datetime/date-formats'; import { DateAdapter } from '../datetime/date-adapter'; import { Subject } from 'rxjs'; import { MultiYearViewComponent } from '../multi-year-view/multi-year-view.component'; import { HcCalendarCellCssClasses } from '../calendar-body/calendar-body.component'; import { MonthViewComponent } from '../month-view/month-view.component'; import { YearViewComponent } from '../year-view/year-view.component'; import { FormControl } from '@angular/forms'; /** * Possible views for the calendar. * @docs-private */ export declare type CalendarViewComponent = 'month' | 'year' | 'multi-year'; /** Default header for hcCalendar */ export declare class CalendarHeaderComponent { private _intl; calendar: CalendarComponent; private _dateAdapter; private _dateFormats; constructor(_intl: HcDatepickerIntl, calendar: CalendarComponent, _dateAdapter: DateAdapter, _dateFormats: HcDateFormats, changeDetectorRef: ChangeDetectorRef); /** The label for the currently visible month */ readonly monthButtonText: string; /** The label for the current calendar view. */ readonly periodButtonText: string; readonly periodButtonLabel: string; /** The label for the currently displayed month */ readonly monthButtonLabel: string; /** The label for the the previous button. */ readonly prevButtonLabel: string; /** The label for the the next button. */ readonly nextButtonLabel: string; /** Handles user clicks on the period label. */ currentPeriodClicked(): void; /** Handles user clicks on the previous button. */ previousClicked(): void; /** Handles user clicks on the next button. */ nextClicked(): void; todayClicked(): void; todayEnabled(): boolean; /** Whether the previous period button is enabled. */ previousEnabled(): boolean; /** Whether the next period button is enabled. */ nextEnabled(): boolean; /** Whether the two dates represent the same view in the current view mode (month or year). */ private _isSameView; } /** * A calendar that is used as part of the datepicker. * @docs-private */ export declare class CalendarComponent implements AfterContentInit, AfterViewChecked, OnDestroy, OnChanges { private _intl; private _dateAdapter; private _dateFormats; private _changeDetectorRef; /** An input indicating the type of the header component, if set. */ headerComponent: ComponentType; /** A portal containing the header component type for this calendar. */ _calendarHeaderPortal: Portal; /** Stores the current am/pm value */ _period: FormControl; private _intlChanges; /** * Used for scheduling that focus should be moved to the active cell on the next tick. * We need to schedule it, rather than do it immediately, because we have to wait * for Angular to re-evaluate the view children. */ private _moveFocusOnNextTick; /** A date representing the period (month or year) to start the calendar in. */ startAt: D | null; private _startAt; /** Whether the calendar should be started in month or year view. */ startView: CalendarViewComponent; /** Whether the calendar should show calendar, time-picker, or both */ mode: 'date' | 'time' | 'date-time'; /** Whether the time picker should display a 12-hour or 24-clock. Accepts 12 or 24. Defaults to 12. */ hourCycle: string | number; _hourCycle: number; /** The currently selected date. */ selected: D | null; private _selected; /** The minimum selectable date. */ minDate: D | null; private _minDate; /** The maximum selectable date. */ maxDate: D | null; private _maxDate; /** Function used to filter which dates are selectable. */ dateFilter: (date: D) => boolean; /** Function that can be used to add custom CSS classes to dates. */ dateClass: (date: D) => HcCalendarCellCssClasses; /** Emits when the currently selected date changes. */ readonly selectedChange: EventEmitter; /** * Emits the year chosen in multiyear view. * This doesn't imply a change on the selected date. */ readonly yearSelected: EventEmitter; /** * Emits the month chosen in year view. * This doesn't imply a change on the selected date. */ readonly monthSelected: EventEmitter; /** Emits when any date is selected. */ readonly _userSelection: EventEmitter; /** Reference to the current month view component. */ monthView: MonthViewComponent; /** Reference to the current year view component. */ yearView: YearViewComponent; /** Reference to the current multi-year view component. */ multiYearView: MultiYearViewComponent; /** * The current active date. This determines which time period is shown and which date is * highlighted when using keyboard navigation. */ activeDate: D; private _clampedActiveDate; /** Whether the calendar is in month view. */ currentView: CalendarViewComponent; private _currentView; /** * Emits whenever there is a state change that the header may need to respond to. */ stateChanges: Subject; /** A string containing the value of minutes for the current date */ minutes: string | null; /** A string containing the hour for the current date */ hours: string | null; _periodChange(): void; constructor(_intl: HcDatepickerIntl, _dateAdapter: DateAdapter, _dateFormats: HcDateFormats, _changeDetectorRef: ChangeDetectorRef); ngAfterContentInit(): void; ngAfterViewChecked(): void; ngOnDestroy(): void; ngOnChanges(changes: SimpleChanges): void; focusActiveCell(): void; /** Updates today's date after an update of the active date */ updateTodaysDate(): void; /** The label for the jump to today button */ readonly _todayButtonLabel: string; /** Handles clicks on the Jump to current date button */ _todayClicked(): void; _todayEnabled(): boolean; /** Handles date selection in the month view. */ _dateSelected(date: D): void; /** Handles year selection in the multiyear view. */ _yearSelectedInMultiYearView(normalizedYear: D): void; /** Handles month selection in the year view. */ _monthSelectedInYearView(normalizedMonth: D): void; _userSelected(): void; /** Handles year/month selection in the multi-year/year views. */ _goToDateInView(date: D, view: 'month' | 'year' | 'multi-year'): void; /** * @param obj The object to check. * @returns The given object if it is both a date instance and valid, otherwise null. */ private _getValidDateOrNull; /** Returns the component instance that corresponds to the current calendar view. */ private _getCurrentViewComponent; _hoursUp(): void; _hoursDown(): void; _minutesUp(): void; _minutesDown(): void; }