1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { AfterContentInit, ChangeDetectorRef, EventEmitter, OnDestroy } from '@angular/core';
|
---|
9 | import { DateAdapter, MatDateFormats } from '@angular/material/core';
|
---|
10 | import { Directionality } from '@angular/cdk/bidi';
|
---|
11 | import { MatCalendarBody, MatCalendarCell, MatCalendarUserEvent, MatCalendarCellClassFunction } from './calendar-body';
|
---|
12 | import { DateRange } from './date-selection-model';
|
---|
13 | /**
|
---|
14 | * An internal component used to display a single year in the datepicker.
|
---|
15 | * @docs-private
|
---|
16 | */
|
---|
17 | export declare class MatYearView<D> implements AfterContentInit, OnDestroy {
|
---|
18 | readonly _changeDetectorRef: ChangeDetectorRef;
|
---|
19 | private _dateFormats;
|
---|
20 | _dateAdapter: DateAdapter<D>;
|
---|
21 | private _dir?;
|
---|
22 | private _rerenderSubscription;
|
---|
23 | /** Flag used to filter out space/enter keyup events that originated outside of the view. */
|
---|
24 | private _selectionKeyPressed;
|
---|
25 | /** The date to display in this year view (everything other than the year is ignored). */
|
---|
26 | get activeDate(): D;
|
---|
27 | set activeDate(value: D);
|
---|
28 | private _activeDate;
|
---|
29 | /** The currently selected date. */
|
---|
30 | get selected(): DateRange<D> | D | null;
|
---|
31 | set selected(value: DateRange<D> | D | null);
|
---|
32 | private _selected;
|
---|
33 | /** The minimum selectable date. */
|
---|
34 | get minDate(): D | null;
|
---|
35 | set minDate(value: D | null);
|
---|
36 | private _minDate;
|
---|
37 | /** The maximum selectable date. */
|
---|
38 | get maxDate(): D | null;
|
---|
39 | set maxDate(value: D | null);
|
---|
40 | private _maxDate;
|
---|
41 | /** A function used to filter which dates are selectable. */
|
---|
42 | dateFilter: (date: D) => boolean;
|
---|
43 | /** Function that can be used to add custom CSS classes to date cells. */
|
---|
44 | dateClass: MatCalendarCellClassFunction<D>;
|
---|
45 | /** Emits when a new month is selected. */
|
---|
46 | readonly selectedChange: EventEmitter<D>;
|
---|
47 | /** Emits the selected month. This doesn't imply a change on the selected date */
|
---|
48 | readonly monthSelected: EventEmitter<D>;
|
---|
49 | /** Emits when any date is activated. */
|
---|
50 | readonly activeDateChange: EventEmitter<D>;
|
---|
51 | /** The body of calendar table */
|
---|
52 | _matCalendarBody: MatCalendarBody;
|
---|
53 | /** Grid of calendar cells representing the months of the year. */
|
---|
54 | _months: MatCalendarCell[][];
|
---|
55 | /** The label for this year (e.g. "2017"). */
|
---|
56 | _yearLabel: string;
|
---|
57 | /** The month in this year that today falls on. Null if today is in a different year. */
|
---|
58 | _todayMonth: number | null;
|
---|
59 | /**
|
---|
60 | * The month in this year that the selected Date falls on.
|
---|
61 | * Null if the selected Date is in a different year.
|
---|
62 | */
|
---|
63 | _selectedMonth: number | null;
|
---|
64 | constructor(_changeDetectorRef: ChangeDetectorRef, _dateFormats: MatDateFormats, _dateAdapter: DateAdapter<D>, _dir?: Directionality | undefined);
|
---|
65 | ngAfterContentInit(): void;
|
---|
66 | ngOnDestroy(): void;
|
---|
67 | /** Handles when a new month is selected. */
|
---|
68 | _monthSelected(event: MatCalendarUserEvent<number>): void;
|
---|
69 | /** Handles keydown events on the calendar body when calendar is in year view. */
|
---|
70 | _handleCalendarBodyKeydown(event: KeyboardEvent): void;
|
---|
71 | /** Handles keyup events on the calendar body when calendar is in year view. */
|
---|
72 | _handleCalendarBodyKeyup(event: KeyboardEvent): void;
|
---|
73 | /** Initializes this year view. */
|
---|
74 | _init(): void;
|
---|
75 | /** Focuses the active cell after the microtask queue is empty. */
|
---|
76 | _focusActiveCell(): void;
|
---|
77 | /**
|
---|
78 | * Gets the month in this year that the given Date falls on.
|
---|
79 | * Returns null if the given Date is in another year.
|
---|
80 | */
|
---|
81 | private _getMonthInCurrentYear;
|
---|
82 | /** Creates an MatCalendarCell for the given month. */
|
---|
83 | private _createCellForMonth;
|
---|
84 | /** Whether the given month is enabled. */
|
---|
85 | private _shouldEnableMonth;
|
---|
86 | /**
|
---|
87 | * Tests whether the combination month/year is after this.maxDate, considering
|
---|
88 | * just the month and year of this.maxDate
|
---|
89 | */
|
---|
90 | private _isYearAndMonthAfterMaxDate;
|
---|
91 | /**
|
---|
92 | * Tests whether the combination month/year is before this.minDate, considering
|
---|
93 | * just the month and year of this.minDate
|
---|
94 | */
|
---|
95 | private _isYearAndMonthBeforeMinDate;
|
---|
96 | /** Determines whether the user has the RTL layout direction. */
|
---|
97 | private _isRtl;
|
---|
98 | /** Sets the currently-selected month based on a model value. */
|
---|
99 | private _setSelectedMonth;
|
---|
100 | }
|
---|