import { AfterContentInit, ChangeDetectorRef, EventEmitter, OnDestroy, SimpleChanges, OnChanges } from '@angular/core'; import { UsaCalendarBody, UsaCalendarCell, UsaCalendarUserEvent, UsaCalendarCellClassFunction } from './calendar-body'; import { DateRange } from '../date-selection-model'; import { UsaDateRangeSelectionStrategy } from '../date-range-selection-strategy'; import { DateAdapter } from '../dateadapter/date-adapter'; import { UsaDateFormats } from '../dateadapter/date-formats'; import * as i0 from "@angular/core"; /** * An internal component used to display a single month in the datePicker. * @docs-private */ export declare class UsaMonthView implements AfterContentInit, OnChanges, OnDestroy { readonly _changeDetectorRef: ChangeDetectorRef; private _dateFormats; _dateAdapter: DateAdapter; private _rangeStrategy?; private _rerenderSubscription; /** Flag used to filter out space/enter keyup events that originated outside of the view. */ private _selectionKeyPressed; /** * The date to display in this month view (everything other than the month and year is ignored). */ get activeDate(): D; set activeDate(value: D); private _activeDate; /** The currently selected date. */ get selected(): DateRange | D | null; set selected(value: DateRange | D | null); private _selected; /** The minimum selectable date. */ get minDate(): D | null; set minDate(value: D | null); private _minDate; /** The maximum selectable date. */ get maxDate(): D | null; set maxDate(value: 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: UsaCalendarCellClassFunction; /** Start of the comparison range. */ comparisonStart: D | null; /** End of the comparison range. */ comparisonEnd: D | null; /** Emits when a new date is selected. */ readonly selectedChange: EventEmitter; /** Emits when any date is selected. */ readonly _userSelection: EventEmitter>; /** Emits when any date is activated. */ readonly activeDateChange: EventEmitter; /** The body of calendar table */ _usaCalendarBody: UsaCalendarBody; /** The label for this month (e.g. "January 2017"). */ _monthLabel: string; /** Grid of calendar cells representing the dates of the month. */ _weeks: UsaCalendarCell[][]; /** Last few dates for previous month to place in first row if there is offset space */ _prevMonthDays: UsaCalendarCell[]; /** First few dates for next month to place in last row if there is offset space */ _nextMonthDays: UsaCalendarCell[]; /** The number of blank cells in the first row before the 1st of the month. */ _firstWeekOffset: number; /** Start value of the currently-shown date range. */ _rangeStart: number | null; /** End value of the currently-shown date range. */ _rangeEnd: number | null; /** Start value of the currently-shown comparison date range. */ _comparisonRangeStart: number | null; /** End value of the currently-shown comparison date range. */ _comparisonRangeEnd: number | null; /** Start of the preview range. */ _previewStart: number | null; /** End of the preview range. */ _previewEnd: number | null; /** Whether the user is currently selecting a range of dates. */ _isRange: boolean; /** The date of the month that today falls on. Null if today is in another month. */ _todayDate: number | null; /** The names of the weekdays. */ _weekdays: { long: string; narrow: string; }[]; constructor(_changeDetectorRef: ChangeDetectorRef, _dateFormats: UsaDateFormats, _dateAdapter: DateAdapter, _rangeStrategy?: UsaDateRangeSelectionStrategy); ngAfterContentInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; /** Handles when a new date is selected. */ _dateSelected(event: UsaCalendarUserEvent): void; /** Handles keydown events on the calendar body when calendar is in month view. */ _handleCalendarBodyKeydown(event: KeyboardEvent): void; /** Handles keyup events on the calendar body when calendar is in month view. */ _handleCalendarBodyKeyup(event: KeyboardEvent): void; /** Initializes this month view. */ _init(): void; /** Focuses the active cell after the microtask queue is empty. */ _focusActiveCell(movePreview?: boolean): void; /** Called when the user has activated a new cell and the preview needs to be updated. */ _previewChanged({ event, value: cell }: UsaCalendarUserEvent | null>): void; /** Initializes the weekdays. */ private _initWeekdays; /** Creates UsaCalendarCells for the dates in this month. */ private _createWeekCells; /** * Creates filler cells of previous month date to display in first row of current month view */ private _createCellForPrevMonth; /** * Creates filler cells of next month date to display in last row of current month view */ private _createCellForNextMonth; /** Creates a calender cell object for each cell of the calender */ private getCalendarCell; /** Date filter for the month */ private _shouldEnableDate; /** * Gets the date in this month that the given Date falls on. * Returns null if the given Date is in another month. */ private _getDateInCurrentMonth; /** Checks whether the 2 dates are non-null and fall within the same month of the same year. */ private _hasSameMonthAndYear; /** Gets the value that will be used to one cell to another. */ private _getCellCompareValue; /** Sets the current range based on a model value. */ private _setRanges; /** Gets whether a date can be selected in the month view. */ private _canSelect; static ɵfac: i0.ɵɵFactoryDeclaration, [null, { optional: true; }, { optional: true; }, { optional: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration, "usa-month-view", ["usaMonthView"], { "activeDate": { "alias": "activeDate"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "dateFilter": { "alias": "dateFilter"; "required": false; }; "dateClass": { "alias": "dateClass"; "required": false; }; "comparisonStart": { "alias": "comparisonStart"; "required": false; }; "comparisonEnd": { "alias": "comparisonEnd"; "required": false; }; }, { "selectedChange": "selectedChange"; "_userSelection": "_userSelection"; "activeDateChange": "activeDateChange"; }, never, never, false, never>; }