[6a3a178] | 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 { OnDestroy, AfterContentInit, ChangeDetectorRef, ElementRef, OnChanges, SimpleChanges } from '@angular/core';
|
---|
| 9 | import { MatFormFieldControl, MatFormField } from '@angular/material/form-field';
|
---|
| 10 | import { ThemePalette, DateAdapter } from '@angular/material/core';
|
---|
| 11 | import { NgControl, ControlContainer } from '@angular/forms';
|
---|
| 12 | import { Subject } from 'rxjs';
|
---|
| 13 | import { FocusOrigin } from '@angular/cdk/a11y';
|
---|
| 14 | import { BooleanInput } from '@angular/cdk/coercion';
|
---|
| 15 | import { MatStartDate, MatEndDate, MatDateRangeInputParent } from './date-range-input-parts';
|
---|
| 16 | import { MatDatepickerControl, MatDatepickerPanel } from './datepicker-base';
|
---|
| 17 | import { DateFilterFn } from './datepicker-input-base';
|
---|
| 18 | import { MatDateRangePickerInput } from './date-range-picker';
|
---|
| 19 | import { DateRange } from './date-selection-model';
|
---|
| 20 | export declare class MatDateRangeInput<D> implements MatFormFieldControl<DateRange<D>>, MatDatepickerControl<D>, MatDateRangeInputParent<D>, MatDateRangePickerInput<D>, AfterContentInit, OnChanges, OnDestroy {
|
---|
| 21 | private _changeDetectorRef;
|
---|
| 22 | private _elementRef;
|
---|
| 23 | private _dateAdapter;
|
---|
| 24 | private _formField?;
|
---|
| 25 | private _closedSubscription;
|
---|
| 26 | /** Current value of the range input. */
|
---|
| 27 | get value(): DateRange<D> | null;
|
---|
| 28 | /** Unique ID for the input. */
|
---|
| 29 | id: string;
|
---|
| 30 | /** Whether the control is focused. */
|
---|
| 31 | focused: boolean;
|
---|
| 32 | /** Whether the control's label should float. */
|
---|
| 33 | get shouldLabelFloat(): boolean;
|
---|
| 34 | /** Name of the form control. */
|
---|
| 35 | controlType: string;
|
---|
| 36 | /**
|
---|
| 37 | * Implemented as a part of `MatFormFieldControl`.
|
---|
| 38 | * Set the placeholder attribute on `matStartDate` and `matEndDate`.
|
---|
| 39 | * @docs-private
|
---|
| 40 | */
|
---|
| 41 | get placeholder(): string;
|
---|
| 42 | /** The range picker that this input is associated with. */
|
---|
| 43 | get rangePicker(): MatDatepickerPanel<MatDatepickerControl<D>, DateRange<D>, D>;
|
---|
| 44 | set rangePicker(rangePicker: MatDatepickerPanel<MatDatepickerControl<D>, DateRange<D>, D>);
|
---|
| 45 | private _rangePicker;
|
---|
| 46 | /** Whether the input is required. */
|
---|
| 47 | get required(): boolean;
|
---|
| 48 | set required(value: boolean);
|
---|
| 49 | private _required;
|
---|
| 50 | /** Function that can be used to filter out dates within the date range picker. */
|
---|
| 51 | get dateFilter(): DateFilterFn<D>;
|
---|
| 52 | set dateFilter(value: DateFilterFn<D>);
|
---|
| 53 | private _dateFilter;
|
---|
| 54 | /** The minimum valid date. */
|
---|
| 55 | get min(): D | null;
|
---|
| 56 | set min(value: D | null);
|
---|
| 57 | private _min;
|
---|
| 58 | /** The maximum valid date. */
|
---|
| 59 | get max(): D | null;
|
---|
| 60 | set max(value: D | null);
|
---|
| 61 | private _max;
|
---|
| 62 | /** Whether the input is disabled. */
|
---|
| 63 | get disabled(): boolean;
|
---|
| 64 | set disabled(value: boolean);
|
---|
| 65 | _groupDisabled: boolean;
|
---|
| 66 | /** Whether the input is in an error state. */
|
---|
| 67 | get errorState(): boolean;
|
---|
| 68 | /** Whether the datepicker input is empty. */
|
---|
| 69 | get empty(): boolean;
|
---|
| 70 | /** Value for the `aria-describedby` attribute of the inputs. */
|
---|
| 71 | _ariaDescribedBy: string | null;
|
---|
| 72 | /** Date selection model currently registered with the input. */
|
---|
| 73 | private _model;
|
---|
| 74 | /** Separator text to be shown between the inputs. */
|
---|
| 75 | separator: string;
|
---|
| 76 | /** Start of the comparison range that should be shown in the calendar. */
|
---|
| 77 | comparisonStart: D | null;
|
---|
| 78 | /** End of the comparison range that should be shown in the calendar. */
|
---|
| 79 | comparisonEnd: D | null;
|
---|
| 80 | _startInput: MatStartDate<D>;
|
---|
| 81 | _endInput: MatEndDate<D>;
|
---|
| 82 | /**
|
---|
| 83 | * Implemented as a part of `MatFormFieldControl`.
|
---|
| 84 | * TODO(crisbeto): change type to `AbstractControlDirective` after #18206 lands.
|
---|
| 85 | * @docs-private
|
---|
| 86 | */
|
---|
| 87 | ngControl: NgControl | null;
|
---|
| 88 | /** Emits when the input's state has changed. */
|
---|
| 89 | readonly stateChanges: Subject<void>;
|
---|
| 90 | constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, control: ControlContainer, _dateAdapter: DateAdapter<D>, _formField?: MatFormField | undefined);
|
---|
| 91 | /**
|
---|
| 92 | * Implemented as a part of `MatFormFieldControl`.
|
---|
| 93 | * @docs-private
|
---|
| 94 | */
|
---|
| 95 | setDescribedByIds(ids: string[]): void;
|
---|
| 96 | /**
|
---|
| 97 | * Implemented as a part of `MatFormFieldControl`.
|
---|
| 98 | * @docs-private
|
---|
| 99 | */
|
---|
| 100 | onContainerClick(): void;
|
---|
| 101 | ngAfterContentInit(): void;
|
---|
| 102 | ngOnChanges(changes: SimpleChanges): void;
|
---|
| 103 | ngOnDestroy(): void;
|
---|
| 104 | /** Gets the date at which the calendar should start. */
|
---|
| 105 | getStartValue(): D | null;
|
---|
| 106 | /** Gets the input's theme palette. */
|
---|
| 107 | getThemePalette(): ThemePalette;
|
---|
| 108 | /** Gets the element to which the calendar overlay should be attached. */
|
---|
| 109 | getConnectedOverlayOrigin(): ElementRef;
|
---|
| 110 | /** Gets the ID of an element that should be used a description for the calendar overlay. */
|
---|
| 111 | getOverlayLabelId(): string | null;
|
---|
| 112 | /** Gets the value that is used to mirror the state input. */
|
---|
| 113 | _getInputMirrorValue(): string;
|
---|
| 114 | /** Whether the input placeholders should be hidden. */
|
---|
| 115 | _shouldHidePlaceholders(): boolean;
|
---|
| 116 | /** Handles the value in one of the child inputs changing. */
|
---|
| 117 | _handleChildValueChange(): void;
|
---|
| 118 | /** Opens the date range picker associated with the input. */
|
---|
| 119 | _openDatepicker(): void;
|
---|
| 120 | /** Whether the separate text should be hidden. */
|
---|
| 121 | _shouldHideSeparator(): boolean | "" | null;
|
---|
| 122 | /** Gets the value for the `aria-labelledby` attribute of the inputs. */
|
---|
| 123 | _getAriaLabelledby(): string | null;
|
---|
| 124 | /** Updates the focused state of the range input. */
|
---|
| 125 | _updateFocus(origin: FocusOrigin): void;
|
---|
| 126 | /** Re-runs the validators on the start/end inputs. */
|
---|
| 127 | private _revalidate;
|
---|
| 128 | /** Registers the current date selection model with the start/end inputs. */
|
---|
| 129 | private _registerModel;
|
---|
| 130 | static ngAcceptInputType_required: BooleanInput;
|
---|
| 131 | static ngAcceptInputType_disabled: BooleanInput;
|
---|
| 132 | }
|
---|