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 { InjectionToken, FactoryProvider } from '@angular/core';
|
---|
9 | import { DateAdapter } from '@angular/material/core';
|
---|
10 | import { DateRange } from './date-selection-model';
|
---|
11 | /** Injection token used to customize the date range selection behavior. */
|
---|
12 | export declare const MAT_DATE_RANGE_SELECTION_STRATEGY: InjectionToken<MatDateRangeSelectionStrategy<any>>;
|
---|
13 | /** Object that can be provided in order to customize the date range selection behavior. */
|
---|
14 | export interface MatDateRangeSelectionStrategy<D> {
|
---|
15 | /**
|
---|
16 | * Called when the user has finished selecting a value.
|
---|
17 | * @param date Date that was selected. Will be null if the user cleared the selection.
|
---|
18 | * @param currentRange Range that is currently show in the calendar.
|
---|
19 | * @param event DOM event that triggered the selection. Currently only corresponds to a `click`
|
---|
20 | * event, but it may get expanded in the future.
|
---|
21 | */
|
---|
22 | selectionFinished(date: D | null, currentRange: DateRange<D>, event: Event): DateRange<D>;
|
---|
23 | /**
|
---|
24 | * Called when the user has activated a new date (e.g. by hovering over
|
---|
25 | * it or moving focus) and the calendar tries to display a date range.
|
---|
26 | *
|
---|
27 | * @param activeDate Date that the user has activated. Will be null if the user moved
|
---|
28 | * focus to an element that's no a calendar cell.
|
---|
29 | * @param currentRange Range that is currently shown in the calendar.
|
---|
30 | * @param event DOM event that caused the preview to be changed. Will be either a
|
---|
31 | * `mouseenter`/`mouseleave` or `focus`/`blur` depending on how the user is navigating.
|
---|
32 | */
|
---|
33 | createPreview(activeDate: D | null, currentRange: DateRange<D>, event: Event): DateRange<D>;
|
---|
34 | }
|
---|
35 | /** Provides the default date range selection behavior. */
|
---|
36 | export declare class DefaultMatCalendarRangeStrategy<D> implements MatDateRangeSelectionStrategy<D> {
|
---|
37 | private _dateAdapter;
|
---|
38 | constructor(_dateAdapter: DateAdapter<D>);
|
---|
39 | selectionFinished(date: D, currentRange: DateRange<D>): DateRange<D>;
|
---|
40 | createPreview(activeDate: D | null, currentRange: DateRange<D>): DateRange<D>;
|
---|
41 | }
|
---|
42 | /** @docs-private */
|
---|
43 | export declare function MAT_CALENDAR_RANGE_STRATEGY_PROVIDER_FACTORY(parent: MatDateRangeSelectionStrategy<unknown>, adapter: DateAdapter<unknown>): MatDateRangeSelectionStrategy<unknown>;
|
---|
44 | /** @docs-private */
|
---|
45 | export declare const MAT_CALENDAR_RANGE_STRATEGY_PROVIDER: FactoryProvider;
|
---|