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 { ElementRef, InjectionToken, OnInit, Injector, DoCheck } from '@angular/core';
|
---|
9 | import { NgForm, FormGroupDirective, NgControl, ValidatorFn } from '@angular/forms';
|
---|
10 | import { CanUpdateErrorState, DateAdapter, MatDateFormats, ErrorStateMatcher } from '@angular/material/core';
|
---|
11 | import { MatDatepickerInputBase, DateFilterFn } from './datepicker-input-base';
|
---|
12 | import { DateRange, DateSelectionModelChange } from './date-selection-model';
|
---|
13 | /** Parent component that should be wrapped around `MatStartDate` and `MatEndDate`. */
|
---|
14 | export interface MatDateRangeInputParent<D> {
|
---|
15 | id: string;
|
---|
16 | min: D | null;
|
---|
17 | max: D | null;
|
---|
18 | dateFilter: DateFilterFn<D>;
|
---|
19 | rangePicker: {
|
---|
20 | opened: boolean;
|
---|
21 | id: string;
|
---|
22 | };
|
---|
23 | _startInput: MatDateRangeInputPartBase<D>;
|
---|
24 | _endInput: MatDateRangeInputPartBase<D>;
|
---|
25 | _groupDisabled: boolean;
|
---|
26 | _handleChildValueChange(): void;
|
---|
27 | _openDatepicker(): void;
|
---|
28 | }
|
---|
29 | /**
|
---|
30 | * Used to provide the date range input wrapper component
|
---|
31 | * to the parts without circular dependencies.
|
---|
32 | */
|
---|
33 | export declare const MAT_DATE_RANGE_INPUT_PARENT: InjectionToken<MatDateRangeInputParent<unknown>>;
|
---|
34 | /**
|
---|
35 | * Base class for the individual inputs that can be projected inside a `mat-date-range-input`.
|
---|
36 | */
|
---|
37 | declare abstract class MatDateRangeInputPartBase<D> extends MatDatepickerInputBase<DateRange<D>> implements OnInit, DoCheck {
|
---|
38 | _rangeInput: MatDateRangeInputParent<D>;
|
---|
39 | _defaultErrorStateMatcher: ErrorStateMatcher;
|
---|
40 | private _injector;
|
---|
41 | _parentForm: NgForm;
|
---|
42 | _parentFormGroup: FormGroupDirective;
|
---|
43 | /** @docs-private */
|
---|
44 | ngControl: NgControl;
|
---|
45 | /** @docs-private */
|
---|
46 | abstract updateErrorState(): void;
|
---|
47 | protected abstract _validator: ValidatorFn | null;
|
---|
48 | protected abstract _assignValueToModel(value: D | null): void;
|
---|
49 | protected abstract _getValueFromModel(modelValue: DateRange<D>): D | null;
|
---|
50 | constructor(_rangeInput: MatDateRangeInputParent<D>, elementRef: ElementRef<HTMLInputElement>, _defaultErrorStateMatcher: ErrorStateMatcher, _injector: Injector, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, dateAdapter: DateAdapter<D>, dateFormats: MatDateFormats);
|
---|
51 | ngOnInit(): void;
|
---|
52 | ngDoCheck(): void;
|
---|
53 | /** Gets whether the input is empty. */
|
---|
54 | isEmpty(): boolean;
|
---|
55 | /** Gets the placeholder of the input. */
|
---|
56 | _getPlaceholder(): string;
|
---|
57 | /** Focuses the input. */
|
---|
58 | focus(): void;
|
---|
59 | /** Handles `input` events on the input element. */
|
---|
60 | _onInput(value: string): void;
|
---|
61 | /** Opens the datepicker associated with the input. */
|
---|
62 | protected _openPopup(): void;
|
---|
63 | /** Gets the minimum date from the range input. */
|
---|
64 | _getMinDate(): D | null;
|
---|
65 | /** Gets the maximum date from the range input. */
|
---|
66 | _getMaxDate(): D | null;
|
---|
67 | /** Gets the date filter function from the range input. */
|
---|
68 | protected _getDateFilter(): DateFilterFn<D>;
|
---|
69 | protected _parentDisabled(): boolean;
|
---|
70 | protected _shouldHandleChangeEvent({ source }: DateSelectionModelChange<DateRange<D>>): boolean;
|
---|
71 | protected _assignValueProgrammatically(value: D | null): void;
|
---|
72 | }
|
---|
73 | declare const _MatDateRangeInputBase: import("@angular/material/core/common-behaviors/constructor").Constructor<CanUpdateErrorState> & import("@angular/material/core/common-behaviors/constructor").AbstractConstructor<CanUpdateErrorState> & typeof MatDateRangeInputPartBase;
|
---|
74 | /** Input for entering the start date in a `mat-date-range-input`. */
|
---|
75 | export declare class MatStartDate<D> extends _MatDateRangeInputBase<D> implements CanUpdateErrorState, DoCheck, OnInit {
|
---|
76 | /** Validator that checks that the start date isn't after the end date. */
|
---|
77 | private _startValidator;
|
---|
78 | constructor(rangeInput: MatDateRangeInputParent<D>, elementRef: ElementRef<HTMLInputElement>, defaultErrorStateMatcher: ErrorStateMatcher, injector: Injector, parentForm: NgForm, parentFormGroup: FormGroupDirective, dateAdapter: DateAdapter<D>, dateFormats: MatDateFormats);
|
---|
79 | ngOnInit(): void;
|
---|
80 | ngDoCheck(): void;
|
---|
81 | protected _validator: ValidatorFn | null;
|
---|
82 | protected _getValueFromModel(modelValue: DateRange<D>): D | null;
|
---|
83 | protected _shouldHandleChangeEvent(change: DateSelectionModelChange<DateRange<D>>): boolean;
|
---|
84 | protected _assignValueToModel(value: D | null): void;
|
---|
85 | protected _formatValue(value: D | null): void;
|
---|
86 | /** Gets the value that should be used when mirroring the input's size. */
|
---|
87 | getMirrorValue(): string;
|
---|
88 | }
|
---|
89 | /** Input for entering the end date in a `mat-date-range-input`. */
|
---|
90 | export declare class MatEndDate<D> extends _MatDateRangeInputBase<D> implements CanUpdateErrorState, DoCheck, OnInit {
|
---|
91 | /** Validator that checks that the end date isn't before the start date. */
|
---|
92 | private _endValidator;
|
---|
93 | constructor(rangeInput: MatDateRangeInputParent<D>, elementRef: ElementRef<HTMLInputElement>, defaultErrorStateMatcher: ErrorStateMatcher, injector: Injector, parentForm: NgForm, parentFormGroup: FormGroupDirective, dateAdapter: DateAdapter<D>, dateFormats: MatDateFormats);
|
---|
94 | ngOnInit(): void;
|
---|
95 | ngDoCheck(): void;
|
---|
96 | protected _validator: ValidatorFn | null;
|
---|
97 | protected _getValueFromModel(modelValue: DateRange<D>): D | null;
|
---|
98 | protected _shouldHandleChangeEvent(change: DateSelectionModelChange<DateRange<D>>): boolean;
|
---|
99 | protected _assignValueToModel(value: D | null): void;
|
---|
100 | _onKeydown(event: KeyboardEvent): void;
|
---|
101 | }
|
---|
102 | export {};
|
---|